WP Live Chat Support - Version 8.0.15

Version Description

It is highly recommended that you upgrade to WP Live Chat Support version 8.0.15 for security reasons.

Download this release

Release Info

Developer WP-LiveChat
Plugin Icon 128x128 WP Live Chat Support
Version 8.0.15
Comparing to
See all releases

Code changes from version 8.0.14 to 8.0.15

Files changed (45) hide show
  1. ajax_new.php +458 -458
  2. css/ace.css +445 -445
  3. css/admin-chat-style.css +444 -444
  4. css/admin_styles.css +314 -314
  5. css/chat-style.css +923 -923
  6. css/fontawesome-iconpicker.css +334 -334
  7. css/remote_dash_styles.css +10 -0
  8. css/wplc_gif_integration.css +363 -363
  9. css/wplc_gutenberg_template_styles.css +216 -216
  10. css/wplcstyle.css +250 -242
  11. functions.php +2442 -2414
  12. includes/blocks/wplc-chat-box/block.js +130 -130
  13. includes/blocks/wplc-chat-box/editor.css +89 -89
  14. includes/blocks/wplc-chat-box/index.php +242 -241
  15. includes/blocks/wplc-chat-box/style.css +148 -148
  16. includes/blocks/wplc-chat-box/wplc_gutenberg_template_styles.css +365 -365
  17. includes/blocks/wplc-inline-chat-box/block.js +127 -127
  18. includes/blocks/wplc-inline-chat-box/editor.css +177 -177
  19. includes/blocks/wplc-inline-chat-box/index.php +60 -60
  20. includes/blocks/wplc-inline-chat-box/wplc_functions.js +38 -38
  21. includes/notification_control.php +1 -1
  22. includes/settings_page.php +1090 -1079
  23. includes/shortcodes.php +28 -28
  24. includes/update_control.class.php +1 -1
  25. includes/welcome_page.php +159 -159
  26. js/ace.js +134 -134
  27. js/fontawesome-iconpicker.js +1024 -1024
  28. js/themes/classic.js +168 -167
  29. js/themes/modern.js +475 -473
  30. js/wplc-admin-modal.js +2 -2
  31. js/wplc-admin-pointers.js +1 -1
  32. js/wplc_admin_dynamic_translations.js +8 -8
  33. js/wplc_admin_popup.js +14 -14
  34. js/wplc_error_handling.js +5 -5
  35. js/wplc_gutenberg.js +200 -200
  36. js/wplc_heartbeat.js +24 -24
  37. js/wplc_lead_forms.js +6 -6
  38. js/wplc_node_offline_mode_controller.js +15 -15
  39. js/wplc_server.js +1104 -1095
  40. js/wplc_surveys.js +24 -24
  41. js/wplc_tabs.js +267 -267
  42. js/wplc_transcript.js +59 -59
  43. js/wplc_u.js +976 -976
  44. js/wplc_u.min.js +1 -1
  45. js/wplc_u_admin.js +0 -53
ajax_new.php CHANGED
@@ -1,459 +1,459 @@
1
- <?php
2
-
3
- add_action('wp_ajax_wplc_admin_long_poll', 'wplc_init_ajax_callback');
4
- add_action('wp_ajax_wplc_admin_long_poll_chat', 'wplc_init_ajax_callback');
5
- add_action('wp_ajax_wplc_admin_accept_chat', 'wplc_init_ajax_callback');
6
- add_action('wp_ajax_wplc_admin_close_chat', 'wplc_init_ajax_callback');
7
- add_action('wp_ajax_wplc_admin_send_msg', 'wplc_init_ajax_callback');
8
- add_action('wp_ajax_wplc_call_to_server_visitor', 'wplc_init_ajax_callback');
9
- add_action('wp_ajax_wplc_user_close_chat', 'wplc_init_ajax_callback');
10
- add_action('wp_ajax_wplc_user_minimize_chat', 'wplc_init_ajax_callback');
11
- add_action('wp_ajax_wplc_user_maximize_chat', 'wplc_init_ajax_callback');
12
- add_action('wp_ajax_wplc_user_send_msg', 'wplc_init_ajax_callback');
13
- add_action('wp_ajax_wplc_start_chat', 'wplc_init_ajax_callback');
14
- add_action('wp_ajax_nopriv_wplc_start_chat', 'wplc_init_ajax_callback');
15
- add_action('wp_ajax_nopriv_wplc_call_to_server_visitor', 'wplc_init_ajax_callback');
16
- add_action('wp_ajax_nopriv_wplc_user_close_chat', 'wplc_init_ajax_callback');
17
- add_action('wp_ajax_nopriv_wplc_user_minimize_chat', 'wplc_init_ajax_callback');
18
- add_action('wp_ajax_nopriv_wplc_user_maximize_chat', 'wplc_init_ajax_callback');
19
- add_action('wp_ajax_nopriv_wplc_user_send_msg', 'wplc_init_ajax_callback');
20
-
21
- add_action('wp_ajax_wplc_get_chat_box', 'wplc_init_ajax_callback');
22
- add_action('wp_ajax_nopriv_wplc_get_chat_box', 'wplc_init_ajax_callback');
23
-
24
- function wplc_init_ajax_callback() {
25
- @ob_start();
26
-
27
- $wplc_session_id = rand(0,9).rand(0,9).rand(0,9).rand(0,9).rand(0,9).rand(0,9).rand(0,9);
28
- $check = check_ajax_referer( 'wplc', 'security' );
29
-
30
- if ($check == 1) {
31
-
32
- $wplc_advanced_settings = get_option("wplc_advanced_settings");
33
- if (!$wplc_advanced_settings) {
34
- $wplc_delay_between_updates = 500000;
35
- $wplc_delay_between_loops = 500000;
36
- $wplc_iterations = 55;
37
- } else {
38
- if (isset($wplc_advanced_settings['wplc_delay_between_updates'])) { $wplc_delay_between_updates = intval($wplc_advanced_settings['wplc_delay_between_updates']); } else { $wplc_delay_between_updates = 500000; }
39
- if (isset($wplc_advanced_settings['wplc_delay_between_loops'])) { $wplc_delay_between_loops = intval($wplc_advanced_settings['wplc_delay_between_loops']); } else { $wplc_delay_between_loops = 500000; }
40
- if (isset($wplc_advanced_settings['wplc_iterations'])) { $wplc_iterations = intval($wplc_advanced_settings['wplc_iterations']); } else { $wplc_iterations = 55; }
41
-
42
- if ($wplc_iterations < 10) { $wplc_iterations = 10; }
43
- if ($wplc_iterations > 200) { $wplc_iterations = 200; }
44
-
45
- if ($wplc_delay_between_updates < 250000) { $wplc_delay_between_updates = 250000; }
46
- if ($wplc_delay_between_updates > 1000000) { $wplc_delay_between_updates = 1000000; }
47
-
48
- if ($wplc_delay_between_loops < 250000) { $wplc_delay_between_loops = 250000; }
49
- if ($wplc_delay_between_loops > 1000000) { $wplc_delay_between_loops = 1000000; }
50
-
51
- }
52
-
53
-
54
- $iterations = $wplc_iterations;
55
-
56
-
57
-
58
- /* time in microseconds between updating the user on the page within the DB (lower number = higher resource usage) */
59
- define('WPLC_DELAY_BETWEEN_UPDATES', $wplc_delay_between_updates);
60
- /* time in microseconds between long poll loop (lower number = higher resource usage) */
61
- define('WPLC_DELAY_BETWEEN_LOOPS', $wplc_delay_between_loops);
62
- /* this needs to take into account the previous constants so that we dont run out of time, which in turn returns a 503 error */
63
- define('WPLC_TIMEOUT', (((WPLC_DELAY_BETWEEN_UPDATES + WPLC_DELAY_BETWEEN_LOOPS)) * $iterations) / 1000000);
64
-
65
-
66
-
67
- global $wpdb;
68
- global $wplc_tblname_chats;
69
- global $wplc_tblname_msgs;
70
- /* we're using PHP 'sleep' which may lock other requests until our script wakes up. Call this function to ensure that other requests can run without waiting for us to finish */
71
- session_write_close();
72
-
73
- if ($_POST['action'] == "wplc_get_chat_box") {
74
- $continue = apply_filters( "wplc_version_check_continue", true );
75
- if ($continue === true) {
76
- echo wplc_output_box_5100(sanitize_text_field($_POST['cid']));
77
- } else {
78
- echo $continue;
79
- }
80
- die();
81
- }
82
-
83
- if($_POST['action'] == 'wplc_admin_long_poll'){
84
- // header("HTTP/1.0 500"); //Simulate 500 error
85
- // header("HTTP/1.0 404"); //Simulate 404 error
86
- // die();
87
-
88
- if (defined('WPLC_TIMEOUT')) { @set_time_limit(WPLC_TIMEOUT); } else { @set_time_limit(120); }
89
- //sleep(6);
90
- $i = 1;
91
- $wplc_current_user = get_current_user_id();
92
-
93
- /* If user is either an agent or an admin, access the page. */
94
- if( !get_user_meta( $wplc_current_user, 'wplc_ma_agent', true )) {
95
- $array['error'] = 1;
96
- echo json_encode($array);
97
- exit();
98
- }
99
-
100
- while($i <= $iterations){
101
-
102
-
103
-
104
- if($i %round($iterations/2) == 0) {
105
- wplc_update_chat_statuses();
106
- }
107
-
108
-
109
-
110
- if($_POST['wplc_update_admin_chat_table'] == 'false'){
111
- /* this is a new load of the page, return false so we can force a send of the new visitor data */
112
- $old_chat_data = false;
113
- } else {
114
- $old_chat_data = stripslashes($_POST['wplc_update_admin_chat_table']);
115
- }
116
-
117
- $pending = wplc_check_pending_chats();
118
- $new_chat_data = wplc_list_chats_new($_POST);
119
-
120
-
121
- if ($new_chat_data == "false") { $new_chat_data = false; }
122
-
123
-
124
- if($new_chat_data !== $old_chat_data){
125
- $array['old_chat_data'] = $old_chat_data;
126
- $array['wplc_update_admin_chat_table'] = $new_chat_data;
127
- $array['pending'] = $pending;
128
- $array['action'] = "wplc_update_chat_list";
129
-
130
- }
131
-
132
- if(isset($array)){
133
- echo json_encode($array);
134
- break;
135
- }
136
- @ob_end_flush();
137
- if (defined('WPLC_DELAY_BETWEEN_LOOPS')) { usleep(WPLC_DELAY_BETWEEN_LOOPS); } else { usleep(500000); }
138
- $i++;
139
- }
140
- }
141
- if($_POST['action'] == "wplc_admin_long_poll_chat"){
142
- if (defined('WPLC_TIMEOUT')) { @set_time_limit(WPLC_TIMEOUT); } else { @set_time_limit(120); }
143
- $i = 1;
144
- $cdata = wplc_get_chat_data($_POST['cid']);
145
- $array = array();
146
- while($i <= $iterations){
147
- $array = apply_filters("wplc_filter_admin_long_poll_chat_loop_iteration",$array,$_POST,$i,$cdata);
148
- if($array){
149
- echo json_encode($array);
150
- break;
151
- }
152
- @ob_end_flush();
153
- if (defined('WPLC_DELAY_BETWEEN_LOOPS')) { usleep(WPLC_DELAY_BETWEEN_LOOPS); } else { usleep(500000); }
154
- $i++;
155
- }
156
- }
157
- if ($_POST['action'] == "wplc_admin_accept_chat") {
158
- wplc_admin_accept_chat(sanitize_text_field($_POST['cid']));
159
- }
160
- if ($_POST['action'] == "wplc_admin_close_chat") {
161
- $chat_id = sanitize_text_field($_POST['cid']);
162
- wplc_change_chat_status($chat_id,1);
163
- echo 'done';
164
- }
165
- if ($_POST['action'] == "wplc_admin_send_msg") {
166
- $chat_id = sanitize_text_field($_POST['cid']);
167
- $chat_msg = strip_tags($_POST['msg'], '<a><p><img><hr>');
168
- $wplc_rec_msg = wplc_record_chat_msg("2",$chat_id,$chat_msg);
169
- if ($wplc_rec_msg) {
170
- echo 'sent';
171
- } else {
172
- echo "There was an error sending your chat message. Please contact support";
173
- }
174
- }
175
-
176
- //User Ajax
177
-
178
- if($_POST['action'] == 'wplc_call_to_server_visitor'){
179
-
180
-
181
-
182
- $wplc_settings = get_option("WPLC_SETTINGS");
183
-
184
-
185
- if (defined('WPLC_TIMEOUT')) { @set_time_limit(WPLC_TIMEOUT); } else { @set_time_limit(120); }
186
- $i = 1;
187
- $array = array("check" => false);
188
- $array['debug'] = "";
189
-
190
- $cdata = false;
191
- if($_POST['cid'] == null || $_POST['cid'] == "" || $_POST['cid'] == "null" || $_POST['cid'] == 0){ } else {
192
- /* get agent ID */
193
-
194
-
195
- $cdata = wplc_get_chat_data(sanitize_text_field(intval($_POST['cid'])),__LINE__);
196
- $from = __("Admin","wplivechat"); /* set default */
197
-
198
- $array['aname'] = apply_filters("wplc_filter_admin_from", $from, $_POST['cid'],$cdata);
199
-
200
- }
201
-
202
- while($i <= $iterations) {
203
-
204
- if($i %round($iterations/2) == 0) {
205
- wplc_update_chat_statuses();
206
- }
207
-
208
-
209
-
210
- if($_POST['cid'] == null || $_POST['cid'] == "" || $_POST['cid'] == "null" || $_POST['cid'] == 0){
211
- // echo 1;
212
-
213
- if( isset( $_POST['wplc_name'] ) && $_POST['wplc_name'] !== '' ){
214
- $user = sanitize_text_field($_POST['wplc_name']);
215
- } else {
216
- $user = "Guest";
217
- }
218
-
219
- if( isset( $_POST['wplc_email'] ) && $_POST['wplc_email'] !== '' ){
220
- $email = sanitize_text_field($_POST['wplc_email']);
221
- } else {
222
- $email = "no email set";
223
- }
224
-
225
- if(isset($_POST['wplc_is_mobile']) && ($_POST['wplc_is_mobile'] === 'true' || $_POST['wplc_is_mobile'] === true)){
226
- $is_mobile = true;
227
- } else {
228
- $is_mobile = false;
229
- }
230
-
231
- $cid = wplc_log_user_on_page($user,$email,sanitize_text_field($_POST['wplcsession']), $is_mobile);
232
- $array['cid'] = $cid;
233
- $array['status'] = wplc_return_chat_status($cid);
234
- $array['wplc_name'] = $user;
235
- $array['wplc_email'] = $email;
236
- $array['check'] = true;
237
-
238
- } else {
239
- // echo 2;
240
-
241
-
242
-
243
-
244
- $new_status = wplc_return_chat_status(sanitize_text_field($_POST['cid']));
245
- $array['wplc_name'] = sanitize_text_field($_POST['wplc_name']);
246
- $array['wplc_email'] = sanitize_text_field($_POST['wplc_email']);
247
- $array['cid'] = sanitize_text_field($_POST['cid']);
248
- $array['aid'] = sanitize_text_field($_POST['cid']);
249
-
250
- $array = apply_filters("wplc_filter_user_long_poll_chat_loop_iteration",$array,$_POST,$i,$cdata);
251
-
252
-
253
- if($new_status == $_POST['status']){ // if status matches do the following
254
- if( intval( $_POST['status'] ) != 2){
255
- /* check if session_variable is different? if yes then stop this script completely. */
256
- if (isset($_POST['wplcsession']) && $_POST['wplcsession'] != '' && $i > 1) {
257
- $wplc_session_variable = sanitize_text_field($_POST['wplcsession']);
258
- $current_session_variable = wplc_return_chat_session_variable(sanitize_text_field($_POST['cid']));
259
- if ($current_session_variable != "" && $current_session_variable != $wplc_session_variable) {
260
- /* stop this script */
261
- $array['status'] = 11;
262
- echo json_encode($array);
263
- die();
264
- }
265
- }
266
-
267
-
268
- if ($i == 1) {
269
- if (intval( $_POST['status'] ) != 12) {
270
- /* we dont want to update the time if the user was not answered by the agent as this needs to eventually time out and become a "missed chat" - status: 0 */
271
- wplc_update_user_on_page(sanitize_text_field($_POST['cid']), sanitize_text_field($_POST['status']), sanitize_text_field($_POST['wplcsession']));
272
- }
273
- }
274
- }
275
-
276
- if ( intval( $_POST['status'] ) == 0 || intval($_POST['status'] ) == 12 ){ // browsing - user tried to chat but admin didn't answer so turn back to browsing
277
- //wplc_update_user_on_page(sanitize_text_field($_POST['cid']), 0, sanitize_text_field($_POST['wplcsession']));
278
- //$array['status'] = 5;
279
- $array['status'] = 12;
280
- //$array['check'] = true;
281
-
282
- }
283
- else if( intval($_POST['status'] ) == 3 || intval($_POST['status'] ) == 10){
284
- //wplc_update_user_on_page(sanitize_text_field($_POST['cid']), 3);
285
- $messages = wplc_return_user_chat_messages(sanitize_text_field($_POST['cid']),$wplc_settings,$cdata);
286
- if ( intval( $_POST['status'] ) == 10 ) {
287
- $array['alert'] = true;
288
- }
289
- if ($messages){
290
- wplc_mark_as_read_user_chat_messages( sanitize_text_field($_POST['cid']) );
291
- $array['status'] = 3;
292
- $array['data'] = $messages;
293
- $array['check'] = true;
294
- }
295
- }
296
- else if(intval($_POST['status']) == 2){
297
- //wplc_update_user_on_page(sanitize_text_field($_POST['cid']), 3);
298
- $messages = wplc_return_user_chat_messages(sanitize_text_field($_POST['cid']),$wplc_settings,$cdata);
299
- $array['debug'] = "we are here ".__LINE__;
300
- if ($messages){
301
- wplc_mark_as_read_user_chat_messages(sanitize_text_field($_POST['cid']));
302
- $array['status'] = 2;
303
- $array['data'] = $messages;
304
- $array['check'] = true;
305
- }
306
- }
307
- else if( intval( $new_status ) == 12){ // no answer from admin, for the second+ time.
308
- $array['data'] = wplc_return_no_answer_string(sanitize_text_field($_POST['cid']));
309
- $array['check'] = true;
310
- @do_action("wplc_hook_missed_chat",array("cid" => $_POST['cid'],"name" => $_POST['wplc_name'],"email" => $_POST['wplc_email']));
311
-
312
- }
313
-
314
-
315
- /* check if this is part of the first run */
316
- if (isset($_POST['first_run']) && sanitize_text_field($_POST['first_run']) == 1) {
317
- /* if yes, then send data now and dont wait for all iterations to complete */
318
- if (!isset($array['status'])) { $array['status'] = $new_status; }
319
- $array['check'] = true;
320
- }
321
- else if (isset($_POST['short_poll']) && sanitize_text_field($_POST['short_poll']) == "true") {
322
- /* if yes, then send data now and dont wait for all iterations to complete */
323
- if (!isset($array['status'])) { $array['status'] = $new_status; }
324
- $array['check'] = true;
325
- }
326
- } else { // statuses do not match
327
-
328
- $array['debug'] = $array['debug']. " ". "Doesnt match $new_status ".$_POST['status'];
329
- $array['status'] = $new_status;
330
- if( intval( $new_status ) == 1 ){ // completed
331
- wplc_update_user_on_page( sanitize_text_field( $_POST['cid'] ), 8, sanitize_text_field( $_POST['wplcsession'] ) );
332
- $array['check'] = true;
333
- $array['status'] = 8;
334
- $array['data'] = array();
335
- $array['data'][9999] = array();
336
- $array['data'][9999]['msg'] = __("Admin has closed and ended the chat","wplivechat");
337
-
338
- }
339
- else if( intval( $new_status ) == 2 ) { // pending
340
- $array['debug'] = "we are here ".__LINE__;
341
- $array['check'] = true;
342
- $array['wplc_name'] = wplc_return_chat_name( sanitize_text_field($_POST['cid'] ) );
343
- $array['wplc_email'] = wplc_return_chat_email( sanitize_text_field($_POST['cid'] ) );
344
- $messages = wplc_return_chat_messages( sanitize_text_field($_POST['cid']), false, true, $wplc_settings, $cdata, 'array', false );
345
- if ($messages){
346
- $array['data'] = $messages;
347
- }
348
- }
349
- else if( intval( $new_status ) == 3 ){ // active
350
- $array['data'] = null;
351
- $array['check'] = true;
352
-
353
- if($_POST['status'] == 5 || $_POST['status'] == 3){
354
- $array['sound'] = false;
355
- $messages = wplc_return_chat_messages(sanitize_text_field($_POST['cid']),false,true,$wplc_settings,$cdata,'array',false);
356
- if ($messages){
357
- $array['data'] = $messages;
358
- }
359
- }
360
- }
361
- else if( intval( $new_status ) == 7){ // timed out
362
- wplc_update_user_on_page(sanitize_text_field($_POST['cid']), 5, sanitize_text_field($_POST['wplcsession']));
363
- }
364
- else if( intval( $new_status ) == 9){ // user closed chat without inputting or starting a chat
365
- $array['check'] = true;
366
- }
367
- else if( intval( $new_status ) == 12){ // no answer from admin
368
-
369
- $array['data'] = wplc_return_no_answer_string(sanitize_text_field($_POST['cid']));
370
- $array['check'] = true;
371
- wplc_update_user_on_page(sanitize_text_field($_POST['cid']), 12, sanitize_text_field($_POST['wplcsession']));
372
- @do_action("wplc_hook_missed_chat",array("cid" => $_POST['cid'],"name" => $_POST['wplc_name'],"email" => $_POST['wplc_email']));
373
-
374
- }
375
- else if( intval( $new_status ) == 10 ) { // minimized active chat
376
- $array['check'] = true;
377
- if($_POST['status'] == 5){
378
- $messages = wplc_return_chat_messages(sanitize_text_field($_POST['cid']),false,true,$wplc_settings,$cdata,'array',false);
379
- if ($messages){
380
- $array['data'] = $messages;
381
- }
382
- }
383
- }
384
- /* check if this is part of the first run */
385
- if (isset($_POST['first_run']) && sanitize_text_field($_POST['first_run']) == "1") {
386
- /* if yes, then send data now and dont wait for all iterations to complete */
387
- if (!isset($array['status'])) { $array['status'] = $new_status; }
388
- $array['check'] = true;
389
- }
390
- else if (isset($_POST['short_poll']) && sanitize_text_field($_POST['short_poll']) == "true") {
391
- /* if yes, then send data now and dont wait for all iterations to complete */
392
- if (!isset($array['status'])) { $array['status'] = $new_status; }
393
- $array['check'] = true;
394
- }
395
- $array = apply_filters("wplc_filter_wplc_call_to_server_visitor_new_status_check",$array);
396
-
397
- }
398
- }
399
- if($array['check'] == true){
400
- echo json_encode($array);
401
- break;
402
- }
403
- $i++;
404
-
405
- if (defined('WPLC_DELAY_BETWEEN_LOOPS')) { usleep(WPLC_DELAY_BETWEEN_LOOPS); } else { usleep(500000); }
406
-
407
- @ob_end_flush();
408
- }
409
- }
410
-
411
- /* */
412
- if ($_POST['action'] == "wplc_user_close_chat") {
413
- if($_POST['status'] == 5){
414
- wplc_change_chat_status(sanitize_text_field($_POST['cid']),9);
415
- } else if($_POST['status'] == 3){
416
- wplc_change_chat_status(sanitize_text_field($_POST['cid']),8);
417
- }
418
- }
419
-
420
- if ($_POST['action'] == "wplc_user_minimize_chat") {
421
- $chat_id = sanitize_text_field($_POST['cid']);
422
- wplc_change_chat_status(sanitize_text_field($_POST['cid']),10);
423
- }
424
- if ($_POST['action'] == "wplc_user_maximize_chat") {
425
- $chat_id = sanitize_text_field($_POST['cid']);
426
- $chat_status = intval(sanitize_text_field($_POST['chat_status']));
427
- wplc_change_chat_status(sanitize_text_field($_POST['cid']),$chat_status);
428
- }
429
-
430
- if ($_POST['action'] == "wplc_user_send_msg") {
431
- $chat_id = sanitize_text_field($_POST['cid']);
432
- $chat_msg = strip_tags($_POST['msg'], '<p><a><img><hr>');
433
- $wplc_rec_msg = wplc_record_chat_msg("1",$chat_id,$chat_msg);
434
- if ($wplc_rec_msg) {
435
- echo 'sent';
436
- } else {
437
- echo "There was an error sending your chat message. Please contact support";
438
- }
439
- }
440
- if ($_POST['action'] == "wplc_start_chat") {
441
- if (isset($_POST['cid'])) {
442
- if ($_POST['name'] && $_POST['email']) {
443
- echo wplc_user_initiate_chat(sanitize_text_field($_POST['name']),sanitize_email($_POST['email']),sanitize_text_field($_POST['cid']), sanitize_text_field($_POST['wplcsession'])); // echo the chat session id
444
- } else {
445
- echo "error2";
446
- }
447
- } else {
448
- if ($_POST['name'] && $_POST['email']) {
449
- echo wplc_user_initiate_chat(sanitize_text_field($_POST['name']), sanitize_email($_POST['email']), null, sanitize_text_field($_POST['wplcsession'])); // echo the chat session id
450
- } else {
451
- echo "error2";
452
- }
453
- }
454
- }
455
-
456
- }
457
-
458
- die();
459
  }
1
+ <?php
2
+
3
+ add_action('wp_ajax_wplc_admin_long_poll', 'wplc_init_ajax_callback');
4
+ add_action('wp_ajax_wplc_admin_long_poll_chat', 'wplc_init_ajax_callback');
5
+ add_action('wp_ajax_wplc_admin_accept_chat', 'wplc_init_ajax_callback');
6
+ add_action('wp_ajax_wplc_admin_close_chat', 'wplc_init_ajax_callback');
7
+ add_action('wp_ajax_wplc_admin_send_msg', 'wplc_init_ajax_callback');
8
+ add_action('wp_ajax_wplc_call_to_server_visitor', 'wplc_init_ajax_callback');
9
+ add_action('wp_ajax_wplc_user_close_chat', 'wplc_init_ajax_callback');
10
+ add_action('wp_ajax_wplc_user_minimize_chat', 'wplc_init_ajax_callback');
11
+ add_action('wp_ajax_wplc_user_maximize_chat', 'wplc_init_ajax_callback');
12
+ add_action('wp_ajax_wplc_user_send_msg', 'wplc_init_ajax_callback');
13
+ add_action('wp_ajax_wplc_start_chat', 'wplc_init_ajax_callback');
14
+ add_action('wp_ajax_nopriv_wplc_start_chat', 'wplc_init_ajax_callback');
15
+ add_action('wp_ajax_nopriv_wplc_call_to_server_visitor', 'wplc_init_ajax_callback');
16
+ add_action('wp_ajax_nopriv_wplc_user_close_chat', 'wplc_init_ajax_callback');
17
+ add_action('wp_ajax_nopriv_wplc_user_minimize_chat', 'wplc_init_ajax_callback');
18
+ add_action('wp_ajax_nopriv_wplc_user_maximize_chat', 'wplc_init_ajax_callback');
19
+ add_action('wp_ajax_nopriv_wplc_user_send_msg', 'wplc_init_ajax_callback');
20
+
21
+ add_action('wp_ajax_wplc_get_chat_box', 'wplc_init_ajax_callback');
22
+ add_action('wp_ajax_nopriv_wplc_get_chat_box', 'wplc_init_ajax_callback');
23
+
24
+ function wplc_init_ajax_callback() {
25
+ @ob_start();
26
+
27
+ $wplc_session_id = rand(0,9).rand(0,9).rand(0,9).rand(0,9).rand(0,9).rand(0,9).rand(0,9);
28
+ $check = is_user_logged_in() ? check_ajax_referer( 'wplc', 'security' ) : 1;
29
+
30
+ if ($check == 1) {
31
+
32
+ $wplc_advanced_settings = get_option("wplc_advanced_settings");
33
+ if (!$wplc_advanced_settings) {
34
+ $wplc_delay_between_updates = 500000;
35
+ $wplc_delay_between_loops = 500000;
36
+ $wplc_iterations = 55;
37
+ } else {
38
+ if (isset($wplc_advanced_settings['wplc_delay_between_updates'])) { $wplc_delay_between_updates = intval($wplc_advanced_settings['wplc_delay_between_updates']); } else { $wplc_delay_between_updates = 500000; }
39
+ if (isset($wplc_advanced_settings['wplc_delay_between_loops'])) { $wplc_delay_between_loops = intval($wplc_advanced_settings['wplc_delay_between_loops']); } else { $wplc_delay_between_loops = 500000; }
40
+ if (isset($wplc_advanced_settings['wplc_iterations'])) { $wplc_iterations = intval($wplc_advanced_settings['wplc_iterations']); } else { $wplc_iterations = 55; }
41
+
42
+ if ($wplc_iterations < 10) { $wplc_iterations = 10; }
43
+ if ($wplc_iterations > 200) { $wplc_iterations = 200; }
44
+
45
+ if ($wplc_delay_between_updates < 250000) { $wplc_delay_between_updates = 250000; }
46
+ if ($wplc_delay_between_updates > 1000000) { $wplc_delay_between_updates = 1000000; }
47
+
48
+ if ($wplc_delay_between_loops < 250000) { $wplc_delay_between_loops = 250000; }
49
+ if ($wplc_delay_between_loops > 1000000) { $wplc_delay_between_loops = 1000000; }
50
+
51
+ }
52
+
53
+
54
+ $iterations = $wplc_iterations;
55
+
56
+
57
+
58
+ /* time in microseconds between updating the user on the page within the DB (lower number = higher resource usage) */
59
+ define('WPLC_DELAY_BETWEEN_UPDATES', $wplc_delay_between_updates);
60
+ /* time in microseconds between long poll loop (lower number = higher resource usage) */
61
+ define('WPLC_DELAY_BETWEEN_LOOPS', $wplc_delay_between_loops);
62
+ /* this needs to take into account the previous constants so that we dont run out of time, which in turn returns a 503 error */
63
+ define('WPLC_TIMEOUT', (((WPLC_DELAY_BETWEEN_UPDATES + WPLC_DELAY_BETWEEN_LOOPS)) * $iterations) / 1000000);
64
+
65
+
66
+
67
+ global $wpdb;
68
+ global $wplc_tblname_chats;
69
+ global $wplc_tblname_msgs;
70
+ /* we're using PHP 'sleep' which may lock other requests until our script wakes up. Call this function to ensure that other requests can run without waiting for us to finish */
71
+ session_write_close();
72
+
73
+ if ($_POST['action'] == "wplc_get_chat_box") {
74
+ $continue = apply_filters( "wplc_version_check_continue", true );
75
+ if ($continue === true) {
76
+ echo wplc_output_box_5100(sanitize_text_field($_POST['cid']));
77
+ } else {
78
+ echo $continue;
79
+ }
80
+ die();
81
+ }
82
+
83
+ if($_POST['action'] == 'wplc_admin_long_poll'){
84
+ // header("HTTP/1.0 500"); //Simulate 500 error
85
+ // header("HTTP/1.0 404"); //Simulate 404 error
86
+ // die();
87
+
88
+ if (defined('WPLC_TIMEOUT')) { @set_time_limit(WPLC_TIMEOUT); } else { @set_time_limit(120); }
89
+ //sleep(6);
90
+ $i = 1;
91
+ $wplc_current_user = get_current_user_id();
92
+
93
+ /* If user is either an agent or an admin, access the page. */
94
+ if( !get_user_meta( $wplc_current_user, 'wplc_ma_agent', true )) {
95
+ $array['error'] = 1;
96
+ echo json_encode($array);
97
+ exit();
98
+ }
99
+
100
+ while($i <= $iterations){
101
+
102
+
103
+
104
+ if($i %round($iterations/2) == 0) {
105
+ wplc_update_chat_statuses();
106
+ }
107
+
108
+
109
+
110
+ if($_POST['wplc_update_admin_chat_table'] == 'false'){
111
+ /* this is a new load of the page, return false so we can force a send of the new visitor data */
112
+ $old_chat_data = false;
113
+ } else {
114
+ $old_chat_data = stripslashes($_POST['wplc_update_admin_chat_table']);
115
+ }
116
+
117
+ $pending = wplc_check_pending_chats();
118
+ $new_chat_data = wplc_list_chats_new($_POST);
119
+
120
+
121
+ if ($new_chat_data == "false") { $new_chat_data = false; }
122
+
123
+
124
+ if($new_chat_data !== $old_chat_data){
125
+ $array['old_chat_data'] = $old_chat_data;
126
+ $array['wplc_update_admin_chat_table'] = $new_chat_data;
127
+ $array['pending'] = $pending;
128
+ $array['action'] = "wplc_update_chat_list";
129
+
130
+ }
131
+
132
+ if(isset($array)){
133
+ echo json_encode($array);
134
+ break;
135
+ }
136
+ @ob_end_flush();
137
+ if (defined('WPLC_DELAY_BETWEEN_LOOPS')) { usleep(WPLC_DELAY_BETWEEN_LOOPS); } else { usleep(500000); }
138
+ $i++;
139
+ }
140
+ }
141
+ if($_POST['action'] == "wplc_admin_long_poll_chat"){
142
+ if (defined('WPLC_TIMEOUT')) { @set_time_limit(WPLC_TIMEOUT); } else { @set_time_limit(120); }
143
+ $i = 1;
144
+ $cdata = wplc_get_chat_data($_POST['cid']);
145
+ $array = array();
146
+ while($i <= $iterations){
147
+ $array = apply_filters("wplc_filter_admin_long_poll_chat_loop_iteration",$array,$_POST,$i,$cdata);
148
+ if($array){
149
+ echo json_encode($array);
150
+ break;
151
+ }
152
+ @ob_end_flush();
153
+ if (defined('WPLC_DELAY_BETWEEN_LOOPS')) { usleep(WPLC_DELAY_BETWEEN_LOOPS); } else { usleep(500000); }
154
+ $i++;
155
+ }
156
+ }
157
+ if ($_POST['action'] == "wplc_admin_accept_chat") {
158
+ wplc_admin_accept_chat(sanitize_text_field($_POST['cid']));
159
+ }
160
+ if ($_POST['action'] == "wplc_admin_close_chat") {
161
+ $chat_id = sanitize_text_field($_POST['cid']);
162
+ wplc_change_chat_status($chat_id,1);
163
+ echo 'done';
164
+ }
165
+ if ($_POST['action'] == "wplc_admin_send_msg") {
166
+ $chat_id = sanitize_text_field($_POST['cid']);
167
+ $chat_msg = strip_tags($_POST['msg'], '<a><p><img><hr>');
168
+ $wplc_rec_msg = wplc_record_chat_msg("2",$chat_id,$chat_msg);
169
+ if ($wplc_rec_msg) {
170
+ echo 'sent';
171
+ } else {
172
+ echo "There was an error sending your chat message. Please contact support";
173
+ }
174
+ }
175
+
176
+ //User Ajax
177
+
178
+ if($_POST['action'] == 'wplc_call_to_server_visitor'){
179
+
180
+
181
+
182
+ $wplc_settings = get_option("WPLC_SETTINGS");
183
+
184
+
185
+ if (defined('WPLC_TIMEOUT')) { @set_time_limit(WPLC_TIMEOUT); } else { @set_time_limit(120); }
186
+ $i = 1;
187
+ $array = array("check" => false);
188
+ $array['debug'] = "";
189
+
190
+ $cdata = false;
191
+ if($_POST['cid'] == null || $_POST['cid'] == "" || $_POST['cid'] == "null" || $_POST['cid'] == 0){ } else {
192
+ /* get agent ID */
193
+
194
+
195
+ $cdata = wplc_get_chat_data(sanitize_text_field(intval($_POST['cid'])),__LINE__);
196
+ $from = __("Admin","wplivechat"); /* set default */
197
+
198
+ $array['aname'] = apply_filters("wplc_filter_admin_from", $from, $_POST['cid'],$cdata);
199
+
200
+ }
201
+
202
+ while($i <= $iterations) {
203
+
204
+ if($i %round($iterations/2) == 0) {
205
+ wplc_update_chat_statuses();
206
+ }
207
+
208
+
209
+
210
+ if($_POST['cid'] == null || $_POST['cid'] == "" || $_POST['cid'] == "null" || $_POST['cid'] == 0){
211
+ // echo 1;
212
+
213
+ if( isset( $_POST['wplc_name'] ) && $_POST['wplc_name'] !== '' ){
214
+ $user = sanitize_text_field($_POST['wplc_name']);
215
+ } else {
216
+ $user = "Guest";
217
+ }
218
+
219
+ if( isset( $_POST['wplc_email'] ) && $_POST['wplc_email'] !== '' ){
220
+ $email = sanitize_text_field($_POST['wplc_email']);
221
+ } else {
222
+ $email = "no email set";
223
+ }
224
+
225
+ if(isset($_POST['wplc_is_mobile']) && ($_POST['wplc_is_mobile'] === 'true' || $_POST['wplc_is_mobile'] === true)){
226
+ $is_mobile = true;
227
+ } else {
228
+ $is_mobile = false;
229
+ }
230
+
231
+ $cid = wplc_log_user_on_page($user,$email,sanitize_text_field($_POST['wplcsession']), $is_mobile);
232
+ $array['cid'] = $cid;
233
+ $array['status'] = wplc_return_chat_status($cid);
234
+ $array['wplc_name'] = $user;
235
+ $array['wplc_email'] = $email;
236
+ $array['check'] = true;
237
+
238
+ } else {
239
+ // echo 2;
240
+
241
+
242
+
243
+
244
+ $new_status = wplc_return_chat_status(sanitize_text_field($_POST['cid']));
245
+ $array['wplc_name'] = sanitize_text_field($_POST['wplc_name']);
246
+ $array['wplc_email'] = sanitize_text_field($_POST['wplc_email']);
247
+ $array['cid'] = sanitize_text_field($_POST['cid']);
248
+ $array['aid'] = sanitize_text_field($_POST['cid']);
249
+
250
+ $array = apply_filters("wplc_filter_user_long_poll_chat_loop_iteration",$array,$_POST,$i,$cdata);
251
+
252
+
253
+ if($new_status == $_POST['status']){ // if status matches do the following
254
+ if( intval( $_POST['status'] ) != 2){
255
+ /* check if session_variable is different? if yes then stop this script completely. */
256
+ if (isset($_POST['wplcsession']) && $_POST['wplcsession'] != '' && $i > 1) {
257
+ $wplc_session_variable = sanitize_text_field($_POST['wplcsession']);
258
+ $current_session_variable = wplc_return_chat_session_variable(sanitize_text_field($_POST['cid']));
259
+ if ($current_session_variable != "" && $current_session_variable != $wplc_session_variable) {
260
+ /* stop this script */
261
+ $array['status'] = 11;
262
+ echo json_encode($array);
263
+ die();
264
+ }
265
+ }
266
+
267
+
268
+ if ($i == 1) {
269
+ if (intval( $_POST['status'] ) != 12) {
270
+ /* we dont want to update the time if the user was not answered by the agent as this needs to eventually time out and become a "missed chat" - status: 0 */
271
+ wplc_update_user_on_page(sanitize_text_field($_POST['cid']), sanitize_text_field($_POST['status']), sanitize_text_field($_POST['wplcsession']));
272
+ }
273
+ }
274
+ }
275
+
276
+ if ( intval( $_POST['status'] ) == 0 || intval($_POST['status'] ) == 12 ){ // browsing - user tried to chat but admin didn't answer so turn back to browsing
277
+ //wplc_update_user_on_page(sanitize_text_field($_POST['cid']), 0, sanitize_text_field($_POST['wplcsession']));
278
+ //$array['status'] = 5;
279
+ $array['status'] = 12;
280
+ //$array['check'] = true;
281
+
282
+ }
283
+ else if( intval($_POST['status'] ) == 3 || intval($_POST['status'] ) == 10){
284
+ //wplc_update_user_on_page(sanitize_text_field($_POST['cid']), 3);
285
+ $messages = wplc_return_user_chat_messages(sanitize_text_field($_POST['cid']),$wplc_settings,$cdata);
286
+ if ( intval( $_POST['status'] ) == 10 ) {
287
+ $array['alert'] = true;
288
+ }
289
+ if ($messages){
290
+ wplc_mark_as_read_user_chat_messages( sanitize_text_field($_POST['cid']) );
291
+ $array['status'] = 3;
292
+ $array['data'] = $messages;
293
+ $array['check'] = true;
294
+ }
295
+ }
296
+ else if(intval($_POST['status']) == 2){
297
+ //wplc_update_user_on_page(sanitize_text_field($_POST['cid']), 3);
298
+ $messages = wplc_return_user_chat_messages(sanitize_text_field($_POST['cid']),$wplc_settings,$cdata);
299
+ $array['debug'] = "we are here ".__LINE__;
300
+ if ($messages){
301
+ wplc_mark_as_read_user_chat_messages(sanitize_text_field($_POST['cid']));
302
+ $array['status'] = 2;
303
+ $array['data'] = $messages;
304
+ $array['check'] = true;
305
+ }
306
+ }
307
+ else if( intval( $new_status ) == 12){ // no answer from admin, for the second+ time.
308
+ $array['data'] = wplc_return_no_answer_string(sanitize_text_field($_POST['cid']));
309
+ $array['check'] = true;
310
+ @do_action("wplc_hook_missed_chat",array("cid" => $_POST['cid'],"name" => $_POST['wplc_name'],"email" => $_POST['wplc_email']));
311
+
312
+ }
313
+
314
+
315
+ /* check if this is part of the first run */
316
+ if (isset($_POST['first_run']) && sanitize_text_field($_POST['first_run']) == 1) {
317
+ /* if yes, then send data now and dont wait for all iterations to complete */
318
+ if (!isset($array['status'])) { $array['status'] = $new_status; }
319
+ $array['check'] = true;
320
+ }
321
+ else if (isset($_POST['short_poll']) && sanitize_text_field($_POST['short_poll']) == "true") {
322
+ /* if yes, then send data now and dont wait for all iterations to complete */
323
+ if (!isset($array['status'])) { $array['status'] = $new_status; }
324
+ $array['check'] = true;
325
+ }
326
+ } else { // statuses do not match
327
+
328
+ $array['debug'] = $array['debug']. " ". "Doesnt match $new_status ".$_POST['status'];
329
+ $array['status'] = $new_status;
330
+ if( intval( $new_status ) == 1 ){ // completed
331
+ wplc_update_user_on_page( sanitize_text_field( $_POST['cid'] ), 8, sanitize_text_field( $_POST['wplcsession'] ) );
332
+ $array['check'] = true;
333
+ $array['status'] = 8;
334
+ $array['data'] = array();
335
+ $array['data'][9999] = array();
336
+ $array['data'][9999]['msg'] = __("Admin has closed and ended the chat","wplivechat");
337
+
338
+ }
339
+ else if( intval( $new_status ) == 2 ) { // pending
340
+ $array['debug'] = "we are here ".__LINE__;
341
+ $array['check'] = true;
342
+ $array['wplc_name'] = wplc_return_chat_name( sanitize_text_field($_POST['cid'] ) );
343
+ $array['wplc_email'] = wplc_return_chat_email( sanitize_text_field($_POST['cid'] ) );
344
+ $messages = wplc_return_chat_messages( sanitize_text_field($_POST['cid']), false, true, $wplc_settings, $cdata, 'array', false );
345
+ if ($messages){
346
+ $array['data'] = $messages;
347
+ }
348
+ }
349
+ else if( intval( $new_status ) == 3 ){ // active
350
+ $array['data'] = null;
351
+ $array['check'] = true;
352
+
353
+ if($_POST['status'] == 5 || $_POST['status'] == 3){
354
+ $array['sound'] = false;
355
+ $messages = wplc_return_chat_messages(sanitize_text_field($_POST['cid']),false,true,$wplc_settings,$cdata,'array',false);
356
+ if ($messages){
357
+ $array['data'] = $messages;
358
+ }
359
+ }
360
+ }
361
+ else if( intval( $new_status ) == 7){ // timed out
362
+ wplc_update_user_on_page(sanitize_text_field($_POST['cid']), 5, sanitize_text_field($_POST['wplcsession']));
363
+ }
364
+ else if( intval( $new_status ) == 9){ // user closed chat without inputting or starting a chat
365
+ $array['check'] = true;
366
+ }
367
+ else if( intval( $new_status ) == 12){ // no answer from admin
368
+
369
+ $array['data'] = wplc_return_no_answer_string(sanitize_text_field($_POST['cid']));
370
+ $array['check'] = true;
371
+ wplc_update_user_on_page(sanitize_text_field($_POST['cid']), 12, sanitize_text_field($_POST['wplcsession']));
372
+ @do_action("wplc_hook_missed_chat",array("cid" => $_POST['cid'],"name" => $_POST['wplc_name'],"email" => $_POST['wplc_email']));
373
+
374
+ }
375
+ else if( intval( $new_status ) == 10 ) { // minimized active chat
376
+ $array['check'] = true;
377
+ if($_POST['status'] == 5){
378
+ $messages = wplc_return_chat_messages(sanitize_text_field($_POST['cid']),false,true,$wplc_settings,$cdata,'array',false);
379
+ if ($messages){
380
+ $array['data'] = $messages;
381
+ }
382
+ }
383
+ }
384
+ /* check if this is part of the first run */
385
+ if (isset($_POST['first_run']) && sanitize_text_field($_POST['first_run']) == "1") {
386
+ /* if yes, then send data now and dont wait for all iterations to complete */
387
+ if (!isset($array['status'])) { $array['status'] = $new_status; }
388
+ $array['check'] = true;
389
+ }
390
+ else if (isset($_POST['short_poll']) && sanitize_text_field($_POST['short_poll']) == "true") {
391
+ /* if yes, then send data now and dont wait for all iterations to complete */
392
+ if (!isset($array['status'])) { $array['status'] = $new_status; }
393
+ $array['check'] = true;
394
+ }
395
+ $array = apply_filters("wplc_filter_wplc_call_to_server_visitor_new_status_check",$array);
396
+
397
+ }
398
+ }
399
+ if($array['check'] == true){
400
+ echo json_encode($array);
401
+ break;
402
+ }
403
+ $i++;
404
+
405
+ if (defined('WPLC_DELAY_BETWEEN_LOOPS')) { usleep(WPLC_DELAY_BETWEEN_LOOPS); } else { usleep(500000); }
406
+
407
+ @ob_end_flush();
408
+ }
409
+ }
410
+
411
+ /* */
412
+ if ($_POST['action'] == "wplc_user_close_chat") {
413
+ if($_POST['status'] == 5){
414
+ wplc_change_chat_status(sanitize_text_field($_POST['cid']),9);
415
+ } else if($_POST['status'] == 3){
416
+ wplc_change_chat_status(sanitize_text_field($_POST['cid']),8);
417
+ }
418
+ }
419
+
420
+ if ($_POST['action'] == "wplc_user_minimize_chat") {
421
+ $chat_id = sanitize_text_field($_POST['cid']);
422
+ wplc_change_chat_status(sanitize_text_field($_POST['cid']),10);
423
+ }
424
+ if ($_POST['action'] == "wplc_user_maximize_chat") {
425
+ $chat_id = sanitize_text_field($_POST['cid']);
426
+ $chat_status = intval(sanitize_text_field($_POST['chat_status']));
427
+ wplc_change_chat_status(sanitize_text_field($_POST['cid']),$chat_status);
428
+ }
429
+
430
+ if ($_POST['action'] == "wplc_user_send_msg") {
431
+ $chat_id = sanitize_text_field($_POST['cid']);
432
+ $chat_msg = strip_tags($_POST['msg'], '<p><a><img><hr>');
433
+ $wplc_rec_msg = wplc_record_chat_msg("1",$chat_id,$chat_msg);
434
+ if ($wplc_rec_msg) {
435
+ echo 'sent';
436
+ } else {
437
+ echo "There was an error sending your chat message. Please contact support";
438
+ }
439
+ }
440
+ if ($_POST['action'] == "wplc_start_chat") {
441
+ if (isset($_POST['cid'])) {
442
+ if ($_POST['name'] && $_POST['email']) {
443
+ echo wplc_user_initiate_chat(sanitize_text_field($_POST['name']),sanitize_email($_POST['email']),sanitize_text_field($_POST['cid']), sanitize_text_field($_POST['wplcsession'])); // echo the chat session id
444
+ } else {
445
+ echo "error2";
446
+ }
447
+ } else {
448
+ if ($_POST['name'] && $_POST['email']) {
449
+ echo wplc_user_initiate_chat(sanitize_text_field($_POST['name']), sanitize_email($_POST['email']), null, sanitize_text_field($_POST['wplcsession'])); // echo the chat session id
450
+ } else {
451
+ echo "error2";
452
+ }
453
+ }
454
+ }
455
+
456
+ }
457
+
458
+ die();
459
  }
css/ace.css CHANGED
@@ -1,445 +1,445 @@
1
- .ace_editor {
2
- position: relative;
3
- overflow: hidden;
4
- font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
5
- direction: ltr;
6
- text-align: left;
7
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
8
- }
9
-
10
- .ace_scroller {
11
- position: absolute;
12
- overflow: hidden;
13
- top: 0;
14
- bottom: 0;
15
- background-color: inherit;
16
- -ms-user-select: none;
17
- -moz-user-select: none;
18
- -webkit-user-select: none;
19
- user-select: none;
20
- cursor: text;
21
- }
22
-
23
- .ace_content {
24
- position: absolute;
25
- box-sizing: border-box;
26
- min-width: 100%;
27
- }
28
-
29
- .ace_dragging .ace_scroller:before{
30
- position: absolute;
31
- top: 0;
32
- left: 0;
33
- right: 0;
34
- bottom: 0;
35
- content: '';
36
- background: rgba(250, 250, 250, 0.01);
37
- z-index: 1000;
38
- }
39
- .ace_dragging.ace_dark .ace_scroller:before{
40
- background: rgba(0, 0, 0, 0.01);
41
- }
42
-
43
- .ace_selecting, .ace_selecting * {
44
- cursor: text !important;
45
- }
46
-
47
- .ace_gutter {
48
- position: absolute;
49
- overflow : hidden;
50
- width: auto;
51
- top: 0;
52
- bottom: 0;
53
- left: 0;
54
- cursor: default;
55
- z-index: 4;
56
- -ms-user-select: none;
57
- -moz-user-select: none;
58
- -webkit-user-select: none;
59
- user-select: none;
60
- }
61
-
62
- .ace_gutter-active-line {
63
- position: absolute;
64
- left: 0;
65
- right: 0;
66
- }
67
-
68
- .ace_scroller.ace_scroll-left {
69
- box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;
70
- }
71
-
72
- .ace_gutter-cell {
73
- padding-left: 19px;
74
- padding-right: 6px;
75
- background-repeat: no-repeat;
76
- }
77
-
78
- .ace_gutter-cell.ace_error {
79
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");
80
- background-repeat: no-repeat;
81
- background-position: 2px center;
82
- }
83
-
84
- .ace_gutter-cell.ace_warning {
85
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");
86
- background-position: 2px center;
87
- }
88
-
89
- .ace_gutter-cell.ace_info {
90
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");
91
- background-position: 2px center;
92
- }
93
- .ace_dark .ace_gutter-cell.ace_info {
94
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");
95
- }
96
-
97
- .ace_scrollbar {
98
- position: absolute;
99
- right: 0;
100
- bottom: 0;
101
- z-index: 6;
102
- }
103
-
104
- .ace_scrollbar-inner {
105
- position: absolute;
106
- cursor: text;
107
- left: 0;
108
- top: 0;
109
- }
110
-
111
- .ace_scrollbar-v{
112
- overflow-x: hidden;
113
- overflow-y: scroll;
114
- top: 0;
115
- }
116
-
117
- .ace_scrollbar-h {
118
- overflow-x: scroll;
119
- overflow-y: hidden;
120
- left: 0;
121
- }
122
-
123
- .ace_print-margin {
124
- position: absolute;
125
- height: 100%;
126
- }
127
-
128
- .ace_text-input {
129
- position: absolute;
130
- z-index: 0;
131
- width: 0.5em;
132
- height: 1em;
133
- opacity: 0;
134
- background: transparent;
135
- -moz-appearance: none;
136
- appearance: none;
137
- border: none;
138
- resize: none;
139
- outline: none;
140
- overflow: hidden;
141
- font: inherit;
142
- padding: 0 1px;
143
- margin: 0 -1px;
144
- text-indent: -1em;
145
- -ms-user-select: text;
146
- -moz-user-select: text;
147
- -webkit-user-select: text;
148
- user-select: text;
149
- /*with `pre-line` chrome inserts &nbsp; instead of space*/
150
- white-space: pre!important;
151
- }
152
-
153
- .ace_text-input.ace_composition {
154
- background: inherit;
155
- color: inherit;
156
- z-index: 1000;
157
- opacity: 1;
158
- text-indent: 0;
159
- }
160
-
161
- .ace_layer {
162
- z-index: 1;
163
- position: absolute;
164
- overflow: hidden;
165
- /* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/
166
- word-wrap: normal;
167
- white-space: pre;
168
- height: 100%;
169
- width: 100%;
170
- box-sizing: border-box;
171
- /* setting pointer-events: auto; on node under the mouse, which changes
172
- during scroll, will break mouse wheel scrolling in Safari */
173
- pointer-events: none;
174
- }
175
-
176
- .ace_gutter-layer {
177
- position: relative;
178
- width: auto;
179
- text-align: right;
180
- pointer-events: auto;
181
- }
182
-
183
- .ace_text-layer {
184
- font: inherit !important;
185
- }
186
-
187
- .ace_cjk {
188
- display: inline-block;
189
- text-align: center;
190
- }
191
-
192
- .ace_cursor-layer {
193
- z-index: 4;
194
- }
195
-
196
- .ace_cursor {
197
- z-index: 4;
198
- position: absolute;
199
- box-sizing: border-box;
200
- border-left: 2px solid;
201
- /* workaround for smooth cursor repaintng whole screen in chrome */
202
- transform: translatez(0);
203
- }
204
-
205
- .ace_multiselect .ace_cursor {
206
- border-left-width: 1px;
207
- }
208
-
209
- .ace_slim-cursors .ace_cursor {
210
- border-left-width: 1px;
211
- }
212
-
213
- .ace_overwrite-cursors .ace_cursor {
214
- border-left-width: 0;
215
- border-bottom: 1px solid;
216
- }
217
-
218
- .ace_hidden-cursors .ace_cursor {
219
- opacity: 0.2;
220
- }
221
-
222
- .ace_smooth-blinking .ace_cursor {
223
- transition: opacity 0.18s;
224
- }
225
-
226
- .ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {
227
- position: absolute;
228
- z-index: 3;
229
- }
230
-
231
- .ace_marker-layer .ace_selection {
232
- position: absolute;
233
- z-index: 5;
234
- }
235
-
236
- .ace_marker-layer .ace_bracket {
237
- position: absolute;
238
- z-index: 6;
239
- }
240
-
241
- .ace_marker-layer .ace_active-line {
242
- position: absolute;
243
- z-index: 2;
244
- }
245
-
246
- .ace_marker-layer .ace_selected-word {
247
- position: absolute;
248
- z-index: 4;
249
- box-sizing: border-box;
250
- }
251
-
252
- .ace_line .ace_fold {
253
- box-sizing: border-box;
254
-
255
- display: inline-block;
256
- height: 11px;
257
- margin-top: -2px;
258
- vertical-align: middle;
259
-
260
- background-image:
261
- url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
262
- url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");
263
- background-repeat: no-repeat, repeat-x;
264
- background-position: center center, top left;
265
- color: transparent;
266
-
267
- border: 1px solid black;
268
- border-radius: 2px;
269
-
270
- cursor: pointer;
271
- pointer-events: auto;
272
- }
273
-
274
- .ace_dark .ace_fold {
275
- }
276
-
277
- .ace_fold:hover{
278
- background-image:
279
- url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
280
- url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");
281
- }
282
-
283
- .ace_tooltip {
284
- background-color: #FFF;
285
- background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));
286
- border: 1px solid gray;
287
- border-radius: 1px;
288
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
289
- color: black;
290
- max-width: 100%;
291
- padding: 3px 4px;
292
- position: fixed;
293
- z-index: 999999;
294
- box-sizing: border-box;
295
- cursor: default;
296
- white-space: pre;
297
- word-wrap: break-word;
298
- line-height: normal;
299
- font-style: normal;
300
- font-weight: normal;
301
- letter-spacing: normal;
302
- pointer-events: none;
303
- }
304
-
305
- .ace_folding-enabled > .ace_gutter-cell {
306
- padding-right: 13px;
307
- }
308
-
309
- .ace_fold-widget {
310
- box-sizing: border-box;
311
-
312
- margin: 0 -12px 0 1px;
313
- display: none;
314
- width: 11px;
315
- vertical-align: top;
316
-
317
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");
318
- background-repeat: no-repeat;
319
- background-position: center;
320
-
321
- border-radius: 3px;
322
-
323
- border: 1px solid transparent;
324
- cursor: pointer;
325
- }
326
-
327
- .ace_folding-enabled .ace_fold-widget {
328
- display: inline-block;
329
- }
330
-
331
- .ace_fold-widget.ace_end {
332
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");
333
- }
334
-
335
- .ace_fold-widget.ace_closed {
336
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");
337
- }
338
-
339
- .ace_fold-widget:hover {
340
- border: 1px solid rgba(0, 0, 0, 0.3);
341
- background-color: rgba(255, 255, 255, 0.2);
342
- box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
343
- }
344
-
345
- .ace_fold-widget:active {
346
- border: 1px solid rgba(0, 0, 0, 0.4);
347
- background-color: rgba(0, 0, 0, 0.05);
348
- box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
349
- }
350
- /**
351
- * Dark version for fold widgets
352
- */
353
- .ace_dark .ace_fold-widget {
354
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");
355
- }
356
- .ace_dark .ace_fold-widget.ace_end {
357
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");
358
- }
359
- .ace_dark .ace_fold-widget.ace_closed {
360
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");
361
- }
362
- .ace_dark .ace_fold-widget:hover {
363
- box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
364
- background-color: rgba(255, 255, 255, 0.1);
365
- }
366
- .ace_dark .ace_fold-widget:active {
367
- box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
368
- }
369
-
370
- .ace_fold-widget.ace_invalid {
371
- background-color: #FFB4B4;
372
- border-color: #DE5555;
373
- }
374
-
375
- .ace_fade-fold-widgets .ace_fold-widget {
376
- transition: opacity 0.4s ease 0.05s;
377
- opacity: 0;
378
- }
379
-
380
- .ace_fade-fold-widgets:hover .ace_fold-widget {
381
- transition: opacity 0.05s ease 0.05s;
382
- opacity:1;
383
- }
384
-
385
- .ace_underline {
386
- text-decoration: underline;
387
- }
388
-
389
- .ace_bold {
390
- font-weight: bold;
391
- }
392
-
393
- .ace_nobold .ace_bold {
394
- font-weight: normal;
395
- }
396
-
397
- .ace_italic {
398
- font-style: italic;
399
- }
400
-
401
-
402
- .ace_error-marker {
403
- background-color: rgba(255, 0, 0,0.2);
404
- position: absolute;
405
- z-index: 9;
406
- }
407
-
408
- .ace_highlight-marker {
409
- background-color: rgba(255, 255, 0,0.2);
410
- position: absolute;
411
- z-index: 8;
412
- }
413
-
414
- /*
415
- styles = []
416
- for (var i = 1; i < 16; i++) {
417
- styles.push(".ace_br" + i + "{" + (
418
- ["top-left", "top-right", "bottom-right", "bottom-left"]
419
- ).map(function(x, j) {
420
- return i & (1<<j) ? "border-" + x + "-radius: 3px;" : ""
421
- }).filter(Boolean).join(" ") + "}")
422
- }
423
- styles.join("\n")
424
- */
425
- .ace_br1 {border-top-left-radius : 3px;}
426
- .ace_br2 {border-top-right-radius : 3px;}
427
- .ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}
428
- .ace_br4 {border-bottom-right-radius: 3px;}
429
- .ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}
430
- .ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}
431
- .ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}
432
- .ace_br8 {border-bottom-left-radius : 3px;}
433
- .ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}
434
- .ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}
435
- .ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}
436
- .ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
437
- .ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
438
- .ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
439
- .ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
440
-
441
- .ace_text-input-ios {
442
- position: absolute !important;
443
- top: -100000px !important;
444
- left: -100000px !important;
445
- }
1
+ .ace_editor {
2
+ position: relative;
3
+ overflow: hidden;
4
+ font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
5
+ direction: ltr;
6
+ text-align: left;
7
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
8
+ }
9
+
10
+ .ace_scroller {
11
+ position: absolute;
12
+ overflow: hidden;
13
+ top: 0;
14
+ bottom: 0;
15
+ background-color: inherit;
16
+ -ms-user-select: none;
17
+ -moz-user-select: none;
18
+ -webkit-user-select: none;
19
+ user-select: none;
20
+ cursor: text;
21
+ }
22
+
23
+ .ace_content {
24
+ position: absolute;
25
+ box-sizing: border-box;
26
+ min-width: 100%;
27
+ }
28
+
29
+ .ace_dragging .ace_scroller:before{
30
+ position: absolute;
31
+ top: 0;
32
+ left: 0;
33
+ right: 0;
34
+ bottom: 0;
35
+ content: '';
36
+ background: rgba(250, 250, 250, 0.01);
37
+ z-index: 1000;
38
+ }
39
+ .ace_dragging.ace_dark .ace_scroller:before{
40
+ background: rgba(0, 0, 0, 0.01);
41
+ }
42
+
43
+ .ace_selecting, .ace_selecting * {
44
+ cursor: text !important;
45
+ }
46
+
47
+ .ace_gutter {
48
+ position: absolute;
49
+ overflow : hidden;
50
+ width: auto;
51
+ top: 0;
52
+ bottom: 0;
53
+ left: 0;
54
+ cursor: default;
55
+ z-index: 4;
56
+ -ms-user-select: none;
57
+ -moz-user-select: none;
58
+ -webkit-user-select: none;
59
+ user-select: none;
60
+ }
61
+
62
+ .ace_gutter-active-line {
63
+ position: absolute;
64
+ left: 0;
65
+ right: 0;
66
+ }
67
+
68
+ .ace_scroller.ace_scroll-left {
69
+ box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;
70
+ }
71
+
72
+ .ace_gutter-cell {
73
+ padding-left: 19px;
74
+ padding-right: 6px;
75
+ background-repeat: no-repeat;
76
+ }
77
+
78
+ .ace_gutter-cell.ace_error {
79
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");
80
+ background-repeat: no-repeat;
81
+ background-position: 2px center;
82
+ }
83
+
84
+ .ace_gutter-cell.ace_warning {
85
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");
86
+ background-position: 2px center;
87
+ }
88
+
89
+ .ace_gutter-cell.ace_info {
90
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");
91
+ background-position: 2px center;
92
+ }
93
+ .ace_dark .ace_gutter-cell.ace_info {
94
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");
95
+ }
96
+
97
+ .ace_scrollbar {
98
+ position: absolute;
99
+ right: 0;
100
+ bottom: 0;
101
+ z-index: 6;
102
+ }
103
+
104
+ .ace_scrollbar-inner {
105
+ position: absolute;
106
+ cursor: text;
107
+ left: 0;
108
+ top: 0;
109
+ }
110
+
111
+ .ace_scrollbar-v{
112
+ overflow-x: hidden;
113
+ overflow-y: scroll;
114
+ top: 0;
115
+ }
116
+
117
+ .ace_scrollbar-h {
118
+ overflow-x: scroll;
119
+ overflow-y: hidden;
120
+ left: 0;
121
+ }
122
+
123
+ .ace_print-margin {
124
+ position: absolute;
125
+ height: 100%;
126
+ }
127
+
128
+ .ace_text-input {
129
+ position: absolute;
130
+ z-index: 0;
131
+ width: 0.5em;
132
+ height: 1em;
133
+ opacity: 0;
134
+ background: transparent;
135
+ -moz-appearance: none;
136
+ appearance: none;
137
+ border: none;
138
+ resize: none;
139
+ outline: none;
140
+ overflow: hidden;
141
+ font: inherit;
142
+ padding: 0 1px;
143
+ margin: 0 -1px;
144
+ text-indent: -1em;
145
+ -ms-user-select: text;
146
+ -moz-user-select: text;
147
+ -webkit-user-select: text;
148
+ user-select: text;
149
+ /*with `pre-line` chrome inserts &nbsp; instead of space*/
150
+ white-space: pre!important;
151
+ }
152
+
153
+ .ace_text-input.ace_composition {
154
+ background: inherit;
155
+ color: inherit;
156
+ z-index: 1000;
157
+ opacity: 1;
158
+ text-indent: 0;
159
+ }
160
+
161
+ .ace_layer {
162
+ z-index: 1;
163
+ position: absolute;
164
+ overflow: hidden;
165
+ /* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/
166
+ word-wrap: normal;
167
+ white-space: pre;
168
+ height: 100%;
169
+ width: 100%;
170
+ box-sizing: border-box;
171
+ /* setting pointer-events: auto; on node under the mouse, which changes
172
+ during scroll, will break mouse wheel scrolling in Safari */
173
+ pointer-events: none;
174
+ }
175
+
176
+ .ace_gutter-layer {
177
+ position: relative;
178
+ width: auto;
179
+ text-align: right;
180
+ pointer-events: auto;
181
+ }
182
+
183
+ .ace_text-layer {
184
+ font: inherit !important;
185
+ }
186
+
187
+ .ace_cjk {
188
+ display: inline-block;
189
+ text-align: center;
190
+ }
191
+
192
+ .ace_cursor-layer {
193
+ z-index: 4;
194
+ }
195
+
196
+ .ace_cursor {
197
+ z-index: 4;
198
+ position: absolute;
199
+ box-sizing: border-box;
200
+ border-left: 2px solid;
201
+ /* workaround for smooth cursor repaintng whole screen in chrome */
202
+ transform: translatez(0);
203
+ }
204
+
205
+ .ace_multiselect .ace_cursor {
206
+ border-left-width: 1px;
207
+ }
208
+
209
+ .ace_slim-cursors .ace_cursor {
210
+ border-left-width: 1px;
211
+ }
212
+
213
+ .ace_overwrite-cursors .ace_cursor {
214
+ border-left-width: 0;
215
+ border-bottom: 1px solid;
216
+ }
217
+
218
+ .ace_hidden-cursors .ace_cursor {
219
+ opacity: 0.2;
220
+ }
221
+
222
+ .ace_smooth-blinking .ace_cursor {
223
+ transition: opacity 0.18s;
224
+ }
225
+
226
+ .ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {
227
+ position: absolute;
228
+ z-index: 3;
229
+ }
230
+
231
+ .ace_marker-layer .ace_selection {
232
+ position: absolute;
233
+ z-index: 5;
234
+ }
235
+
236
+ .ace_marker-layer .ace_bracket {
237
+ position: absolute;
238
+ z-index: 6;
239
+ }
240
+
241
+ .ace_marker-layer .ace_active-line {
242
+ position: absolute;
243
+ z-index: 2;
244
+ }
245
+
246
+ .ace_marker-layer .ace_selected-word {
247
+ position: absolute;
248
+ z-index: 4;
249
+ box-sizing: border-box;
250
+ }
251
+
252
+ .ace_line .ace_fold {
253
+ box-sizing: border-box;
254
+
255
+ display: inline-block;
256
+ height: 11px;
257
+ margin-top: -2px;
258
+ vertical-align: middle;
259
+
260
+ background-image:
261
+ url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
262
+ url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");
263
+ background-repeat: no-repeat, repeat-x;
264
+ background-position: center center, top left;
265
+ color: transparent;
266
+
267
+ border: 1px solid black;
268
+ border-radius: 2px;
269
+
270
+ cursor: pointer;
271
+ pointer-events: auto;
272
+ }
273
+
274
+ .ace_dark .ace_fold {
275
+ }
276
+
277
+ .ace_fold:hover{
278
+ background-image:
279
+ url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
280
+ url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");
281
+ }
282
+
283
+ .ace_tooltip {
284
+ background-color: #FFF;
285
+ background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));
286
+ border: 1px solid gray;
287
+ border-radius: 1px;
288
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
289
+ color: black;
290
+ max-width: 100%;
291
+ padding: 3px 4px;
292
+ position: fixed;
293
+ z-index: 999999;
294
+ box-sizing: border-box;
295
+ cursor: default;
296
+ white-space: pre;
297
+ word-wrap: break-word;
298
+ line-height: normal;
299
+ font-style: normal;
300
+ font-weight: normal;
301
+ letter-spacing: normal;
302
+ pointer-events: none;
303
+ }
304
+
305
+ .ace_folding-enabled > .ace_gutter-cell {
306
+ padding-right: 13px;
307
+ }
308
+
309
+ .ace_fold-widget {
310
+ box-sizing: border-box;
311
+
312
+ margin: 0 -12px 0 1px;
313
+ display: none;
314
+ width: 11px;
315
+ vertical-align: top;
316
+
317
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");
318
+ background-repeat: no-repeat;
319
+ background-position: center;
320
+
321
+ border-radius: 3px;
322
+
323
+ border: 1px solid transparent;
324
+ cursor: pointer;
325
+ }
326
+
327
+ .ace_folding-enabled .ace_fold-widget {
328
+ display: inline-block;
329
+ }
330
+
331
+ .ace_fold-widget.ace_end {
332
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");
333
+ }
334
+
335
+ .ace_fold-widget.ace_closed {
336
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");
337
+ }
338
+
339
+ .ace_fold-widget:hover {
340
+ border: 1px solid rgba(0, 0, 0, 0.3);
341
+ background-color: rgba(255, 255, 255, 0.2);
342
+ box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
343
+ }
344
+
345
+ .ace_fold-widget:active {
346
+ border: 1px solid rgba(0, 0, 0, 0.4);
347
+ background-color: rgba(0, 0, 0, 0.05);
348
+ box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
349
+ }
350
+ /**
351
+ * Dark version for fold widgets
352
+ */
353
+ .ace_dark .ace_fold-widget {
354
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");
355
+ }
356
+ .ace_dark .ace_fold-widget.ace_end {
357
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");
358
+ }
359
+ .ace_dark .ace_fold-widget.ace_closed {
360
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");
361
+ }
362
+ .ace_dark .ace_fold-widget:hover {
363
+ box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
364
+ background-color: rgba(255, 255, 255, 0.1);
365
+ }
366
+ .ace_dark .ace_fold-widget:active {
367
+ box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
368
+ }
369
+
370
+ .ace_fold-widget.ace_invalid {
371
+ background-color: #FFB4B4;
372
+ border-color: #DE5555;
373
+ }
374
+
375
+ .ace_fade-fold-widgets .ace_fold-widget {
376
+ transition: opacity 0.4s ease 0.05s;
377
+ opacity: 0;
378
+ }
379
+
380
+ .ace_fade-fold-widgets:hover .ace_fold-widget {
381
+ transition: opacity 0.05s ease 0.05s;
382
+ opacity:1;
383
+ }
384
+
385
+ .ace_underline {
386
+ text-decoration: underline;
387
+ }
388
+
389
+ .ace_bold {
390
+ font-weight: bold;
391
+ }
392
+
393
+ .ace_nobold .ace_bold {
394
+ font-weight: normal;
395
+ }
396
+
397
+ .ace_italic {
398
+ font-style: italic;
399
+ }
400
+
401
+
402
+ .ace_error-marker {
403
+ background-color: rgba(255, 0, 0,0.2);
404
+ position: absolute;
405
+ z-index: 9;
406
+ }
407
+
408
+ .ace_highlight-marker {
409
+ background-color: rgba(255, 255, 0,0.2);
410
+ position: absolute;
411
+ z-index: 8;
412
+ }
413
+
414
+ /*
415
+ styles = []
416
+ for (var i = 1; i < 16; i++) {
417
+ styles.push(".ace_br" + i + "{" + (
418
+ ["top-left", "top-right", "bottom-right", "bottom-left"]
419
+ ).map(function(x, j) {
420
+ return i & (1<<j) ? "border-" + x + "-radius: 3px;" : ""
421
+ }).filter(Boolean).join(" ") + "}")
422
+ }
423
+ styles.join("\n")
424
+ */
425
+ .ace_br1 {border-top-left-radius : 3px;}
426
+ .ace_br2 {border-top-right-radius : 3px;}
427
+ .ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}
428
+ .ace_br4 {border-bottom-right-radius: 3px;}
429
+ .ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}
430
+ .ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}
431
+ .ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}
432
+ .ace_br8 {border-bottom-left-radius : 3px;}
433
+ .ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}
434
+ .ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}
435
+ .ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}
436
+ .ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
437
+ .ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
438
+ .ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
439
+ .ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
440
+
441
+ .ace_text-input-ios {
442
+ position: absolute !important;
443
+ top: -100000px !important;
444
+ left: -100000px !important;
445
+ }
css/admin-chat-style.css CHANGED
@@ -1,444 +1,444 @@
1
- /**
2
- * Chat page, header section, user info
3
- */
4
- #nifty_wrapper .user_header_wrapper_info {
5
- display: block;
6
- position: relative;
7
- top: -8px;
8
- float: left;
9
- width: 60% !important;
10
- height: calc(100% + 1px);
11
- padding: 8px;
12
- overflow-x: hidden;
13
- overflow-y: auto;
14
- font-size: 0.9em;
15
- line-height: 1em;
16
- background-color: #fefefe;
17
- border-radius: 3px;
18
- }
19
-
20
- #nifty_wrapper .user_header_wrapper_info h3 {
21
- font-size: 1.5em;
22
- margin-top:0px;
23
- margin-bottom:8px;
24
- }
25
- #nifty_wrapper .user_header_wrapper_info h4 {
26
- font-size: 1.3em;
27
- margin-bottom:8px;
28
- }
29
- #nifty_wrapper .user_header_wrapper_info p {
30
- font-size: 1em;
31
- margin-bottom:0px;
32
- }
33
-
34
- /* Join chat button */
35
- #nifty_wrapper .bleeper_join_chat_div button {
36
- position: relative;
37
- left: 33.3%;
38
- top: 15px;
39
- width: 33.3%;
40
- background-color: #ed832f;
41
- border: 1px solid #e2731b;
42
- color: #fafafa;
43
- font-weight: 600;
44
- font-size: 1.2em;
45
- }
46
-
47
- @media(max-width:767px) {
48
-
49
- /* Chat page, header section, user info */
50
- #nifty_wrapper .user_header_wrapper_info h3,
51
- #nifty_wrapper .user_header_wrapper_info h4,
52
- #nifty_wrapper .user_header_wrapper_info p {
53
- line-height:1;
54
- }
55
- #nifty_wrapper .user_header_wrapper_info h3 {
56
- font-size: 1em;
57
- }
58
- #nifty_wrapper .user_header_wrapper_info h4 {
59
- font-size: 0.9em;
60
- }
61
- #nifty_wrapper .user_header_wrapper_info p {
62
- font-size: 0.9em;
63
- }
64
-
65
- #nifty_wrapper .user_header_wrapper_info h3 a,
66
- #nifty_wrapper .user_header_wrapper_info h4 a,
67
- #nifty_wrapper .user_header_wrapper_info p a {
68
- display: block;
69
- margin-top: 0px;
70
- word-wrap: break-word;
71
- line-height: 1em;
72
- }
73
-
74
- #nifty_wrapper .user_header_wrapper_info .chatInfoArea-Email:before {
75
- display: inline-block;
76
- position: relative;
77
- left: 0px;
78
- top: 0px;
79
- margin-right:5px;
80
- content:"email: ";
81
- }
82
-
83
- /* Chat page, header section, buttons */
84
- #nifty_wrapper .eventbox {
85
- position: absolute;
86
- right: -3px;
87
- top: 80px;
88
- }
89
-
90
- #nifty_wrapper span.minChat {
91
- margin-top: -5px;
92
- }
93
-
94
- }
95
-
96
- @media(max-width:500px) {
97
- /* Chat page, header section, user image */
98
- #nifty_wrapper .user_header_wrapper_img {
99
- display:none;
100
- }
101
- #nifty_wrapper .user_header_wrapper_info {
102
- width: 56% !important;
103
- border: 1px solid #f1f1f1;
104
- background-color: #fcfcfc;
105
- }
106
- }
107
-
108
- /**
109
- * Admin chat page
110
- */
111
- #nifty_wrapper span.minChat {
112
- margin-top: 0px;
113
- }
114
- #nifty_wrapper .chatArea .messages {
115
- background-size: cover;
116
- border: 1px solid #e6e6e6;
117
- }
118
- #nifty_wrapper .timedate {
119
- display:none;
120
- }
121
-
122
- /* System notification messages */
123
- #nifty_wrapper .messages .wplc_system_notification {
124
- display: block;
125
- position: relative;
126
- top: 0px;
127
- width: 100%;
128
- }
129
- #nifty_wrapper .messages .wplc_system_notification .messageBody {
130
- display: block;
131
- position: relative;
132
- left: 0px;
133
- top: 7px;
134
- width: 100%;
135
- margin-top: 10px;
136
- margin-bottom: 10px;
137
- padding: 10px;
138
- background-color: #fafafa;
139
- border: 1px solid #e6e6e6;
140
- border-radius: 5px;
141
- color: #555555;
142
- line-height:1.2em;
143
- }
144
- #nifty_wrapper .messages .wplc_system_notification .messageBody .wplc_system_notification {
145
- display: inline-block;
146
- position: relative;
147
- left: 0px;
148
- top: 0px;
149
- width: auto;
150
- height:auto;
151
- margin-top: 0px;
152
- margin-bottom: 0px;
153
- background-color: transparent;
154
- border: none;
155
- border-radius: 0px;
156
- }
157
- #nifty_wrapper .messages .wplc_system_notification .messageBody .chat_time {
158
- display: block;
159
- position: relative;
160
- left: 0px;
161
- top: 0px;
162
- width: 100%;
163
- margin-bottom: 5px;
164
- font-size: 0.9em;
165
- font-weight: 600;
166
- color: #555555;
167
- }
168
-
169
- /* Admin and user messages */
170
- #nifty_wrapper ul.messages {
171
- padding-bottom: 35px;
172
- }
173
- #nifty_wrapper .messages .wplc-admin-message,
174
- #nifty_wrapper .messages .wplc-user-message {
175
- display: block;
176
- position: relative;
177
- width: 100%;
178
- height: auto;
179
- clear: both;
180
- }
181
- #nifty_wrapper .messages .wplc-admin-message::before,
182
- #nifty_wrapper .messages .wplc-user-message::before {
183
- display: none;
184
- }
185
- #nifty_wrapper .messages .wplc-user-message .wplc-msg-content,
186
- #nifty_wrapper .messages .wplc-admin-message .wplc-msg-content {
187
- margin-top: 2px;
188
- margin-bottom: 2px;
189
- padding: 10px;
190
- }
191
-
192
- #nifty_wrapper .messages .wplc-user-message .wplc-msg-content:before,
193
- #nifty_wrapper .messages .wplc-admin-message .wplc-msg-content:after {
194
- display: block;
195
- position: absolute;
196
- width: 0;
197
- border-style: solid;
198
- content: "";
199
- }
200
- #nifty_wrapper .messages .wplc-user-message .wplc-msg-content .wplc-chat-person-name,
201
- #nifty_wrapper .messages .wplc-user-message .wplc-msg-content .wplc-admin-message .messageBody,
202
- #nifty_wrapper .messages .wplc-user-message .wplc-msg-content .wplc-user-message .messageBody {
203
- display: inline-block;
204
- position: relative;
205
- left: 0px;
206
- top: 0px;
207
- }
208
- #nifty_wrapper .messages .wplc-admin-message .wplc-admin-message-avatar,
209
- #nifty_wrapper .messages .wplc-user-message .wplc-user-message-avatar {
210
- border-radius: 50%;
211
- }
212
- #nifty_wrapper .messages .wplc-user-message .wplc-msg-content .wplc-chat-person-name {
213
- margin-right:10px;
214
- }
215
- #nifty_wrapper .chatArea span.messageBody {
216
- display:inline-block!important;
217
- position:relative;
218
- top:0px;
219
- width:auto;
220
- max-width: 100%;
221
- height:auto;
222
- font-size:1.2em;
223
- }
224
- span.bleeper-edit-message {
225
- display: inline-block;
226
- position: relative;
227
- left: 0px;
228
- width: auto;
229
- height: auto;
230
- margin-left: 20px;
231
- margin-right: 0px;
232
- margin-top: 0px;
233
- font-size: 1.1em;
234
- color: #ffffff;
235
- font-weight: 500;
236
- text-decoration: underline;
237
- font-style: italic;
238
- }
239
-
240
- /* Admin messages */
241
- #nifty_wrapper .messages .wplc-admin-message {
242
- padding-right: 12px;
243
- }
244
- #nifty_wrapper .messages .wplc-admin-message .wplc-msg-content {
245
- display: inline-block;
246
- position: relative;
247
- float: right;
248
- max-width: calc(100% - 190px);
249
- background-color:#ED832F;
250
- color:#ffffff;
251
- border-radius: 6px;
252
- }
253
- #nifty_wrapper .messages .wplc-admin-message .wplc-msg-content:after {
254
- top: 11px;
255
- right: -7px;
256
- border-width: 6px 0px 6px 7px;
257
- border-color: transparent #EB832C;
258
- }
259
- #nifty_wrapper .messages .wplc-admin-message .wplc-admin-message-avatar {
260
- display: block;
261
- position: relative;
262
- float: right;
263
- }
264
-
265
- /* User messages */
266
- #nifty_wrapper .messages .wplc-user-message {
267
- padding-left:0px!important;
268
- }
269
- #nifty_wrapper .messages .wplc-user-message .wplc-msg-content {
270
- display: inline-block;
271
- position: relative;
272
- top: 0px;
273
- left: 0px;
274
- width: auto;
275
- max-width: calc(100% - 250px);
276
- background-color: rgba(90, 90, 90, 0.94);
277
- color: #ffffff;
278
- border-radius: 3px;
279
- }
280
- #nifty_wrapper .messages .wplc-user-message .wplc-msg-content:before {
281
- top: 15px;
282
- left: -7px;
283
- border-width: 6px 7px 6px 0px;
284
- border-color: transparent #646464;
285
- }
286
- #nifty_wrapper .messages .wplc-user-message .wplc-user-message-avatar {
287
- display: inline-block;
288
- position: relative;
289
- left: 0px;
290
- top: 0px;
291
- margin-right: 10px;
292
- }
293
-
294
- /* User and admin timestamp popup */
295
- #nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp,
296
- #nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp {
297
- display: block;
298
- position: absolute;
299
- z-index: 1;
300
- width: auto;
301
- height: auto;
302
- padding-top: 6px;
303
- padding-bottom: 6px;
304
- padding-left: 10px;
305
- padding-right: 10px;
306
- background-color: rgba(39, 36, 36, 0.94);
307
- border-radius:5px;
308
- color: #fafafa;
309
- font-size: 0.8em !important;
310
- }
311
- #nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp:before,
312
- #nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp:before {
313
- display: block;
314
- position: absolute;
315
- top: 9px;
316
- width: 0;
317
- border-color: transparent #272424;
318
- border-style: solid;
319
- content: "";
320
- }
321
- #nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp:before {
322
- left: -7px;
323
- border-width: 6px 7px 6px 0px;
324
- }
325
- #nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp:before {
326
- right: -7px;
327
- border-width: 6px 0px 6px 7px;
328
- }
329
-
330
- /* Admin timestamp popup */
331
- #nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp.only-hours,
332
- #nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp {
333
- float: left;
334
- top: 0px;
335
- }
336
- #nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp {
337
- left: -200px;
338
- }
339
- #nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp.only-hours {
340
- left: -80px;
341
- }
342
-
343
- /* User timestamp popup */
344
- #nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp {
345
- float:right;
346
- top:0px;
347
- }
348
- #nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp {
349
- right:-200px;
350
- }
351
- #nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp.only-hours {
352
- right:-80px;
353
- }
354
-
355
- @media(max-width:767px) {
356
- #nifty_wrapper .messages .wplc-admin-message .wplc-msg-content {
357
- max-width: calc(100% - 100px);
358
- }
359
- #nifty_wrapper .messages .wplc-user-message .wplc-msg-content {
360
- max-width: calc(100% - 135px);
361
- }
362
-
363
- #nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp {
364
- left: -100px;
365
- }
366
-
367
- #nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp,
368
- #nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp {
369
- max-width: 130px;
370
- }
371
-
372
- #nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp {
373
- left: -100px;
374
- }
375
- #nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp {
376
- right: -100px;
377
- }
378
-
379
- #nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp.only-hours {
380
- right:-80px;
381
- }
382
-
383
- }
384
-
385
- /* Quick messages button */
386
- #nifty_wrapper #quick_response_drawer_handle {
387
- z-index: 1;
388
- }
389
-
390
- /* Events box */
391
- #nifty_wrapper .eventbox-wrapper {
392
- overflow-y: auto;
393
- height: calc(100% - 61px);
394
- width: 356px;
395
- border-bottom-right-radius: 5px;
396
- border-bottom-left-radius: 5px;
397
- }
398
-
399
- /* Emoji's box */
400
- .wdt-emoji-popup {
401
-
402
- z-index: 5;
403
- height: 300px;
404
- margin-top:45px;
405
- }
406
- .wdt-emoji-popup .wdt-credit {
407
- display: block;
408
- position: relative;
409
- left: 0px;
410
- top: 0px;
411
- padding-right: 15px;
412
- color: #dcdcdc;
413
- text-align: right;
414
- }
415
-
416
- /* Quick Response */
417
- #quick_response_drawer_container {
418
- display: block;
419
- position: absolute;
420
- float: right;
421
- left: auto !important;
422
- right: 23px;
423
- bottom: 0px;
424
- top: 48vh !important;
425
- width: 57%;
426
- max-height: 180px;
427
- padding: 10px;
428
- background: #fff;
429
- overflow-y: auto;
430
- border-radius: 2px;
431
- box-shadow: 0px 0px 10px 1px rgba(0,0,0,0.1);
432
- }
433
-
434
- #chatTranscriptTitle {
435
- display: block !important;
436
- }
437
-
438
- #chatTranscriptTitle.is-disabled {
439
- color: currentColor;
440
- cursor: not-allowed;
441
- opacity: .5;
442
- text-decoration: none;
443
- }
444
-
1
+ /**
2
+ * Chat page, header section, user info
3
+ */
4
+ #nifty_wrapper .user_header_wrapper_info {
5
+ display: block;
6
+ position: relative;
7
+ top: -8px;
8
+ float: left;
9
+ width: 60% !important;
10
+ height: calc(100% + 1px);
11
+ padding: 8px;
12
+ overflow-x: hidden;
13
+ overflow-y: auto;
14
+ font-size: 0.9em;
15
+ line-height: 1em;
16
+ background-color: #fefefe;
17
+ border-radius: 3px;
18
+ }
19
+
20
+ #nifty_wrapper .user_header_wrapper_info h3 {
21
+ font-size: 1.5em;
22
+ margin-top:0px;
23
+ margin-bottom:8px;
24
+ }
25
+ #nifty_wrapper .user_header_wrapper_info h4 {
26
+ font-size: 1.3em;
27
+ margin-bottom:8px;
28
+ }
29
+ #nifty_wrapper .user_header_wrapper_info p {
30
+ font-size: 1em;
31
+ margin-bottom:0px;
32
+ }
33
+
34
+ /* Join chat button */
35
+ #nifty_wrapper .bleeper_join_chat_div button {
36
+ position: relative;
37
+ left: 33.3%;
38
+ top: 15px;
39
+ width: 33.3%;
40
+ background-color: #ed832f;
41
+ border: 1px solid #e2731b;
42
+ color: #fafafa;
43
+ font-weight: 600;
44
+ font-size: 1.2em;
45
+ }
46
+
47
+ @media(max-width:767px) {
48
+
49
+ /* Chat page, header section, user info */
50
+ #nifty_wrapper .user_header_wrapper_info h3,
51
+ #nifty_wrapper .user_header_wrapper_info h4,
52
+ #nifty_wrapper .user_header_wrapper_info p {
53
+ line-height:1;
54
+ }
55
+ #nifty_wrapper .user_header_wrapper_info h3 {
56
+ font-size: 1em;
57
+ }
58
+ #nifty_wrapper .user_header_wrapper_info h4 {
59
+ font-size: 0.9em;
60
+ }
61
+ #nifty_wrapper .user_header_wrapper_info p {
62
+ font-size: 0.9em;
63
+ }
64
+
65
+ #nifty_wrapper .user_header_wrapper_info h3 a,
66
+ #nifty_wrapper .user_header_wrapper_info h4 a,
67
+ #nifty_wrapper .user_header_wrapper_info p a {
68
+ display: block;
69
+ margin-top: 0px;
70
+ word-wrap: break-word;
71
+ line-height: 1em;
72
+ }
73
+
74
+ #nifty_wrapper .user_header_wrapper_info .chatInfoArea-Email:before {
75
+ display: inline-block;
76
+ position: relative;
77
+ left: 0px;
78
+ top: 0px;
79
+ margin-right:5px;
80
+ content:"email: ";
81
+ }
82
+
83
+ /* Chat page, header section, buttons */
84
+ #nifty_wrapper .eventbox {
85
+ position: absolute;
86
+ right: -3px;
87
+ top: 80px;
88
+ }
89
+
90
+ #nifty_wrapper span.minChat {
91
+ margin-top: -5px;
92
+ }
93
+
94
+ }
95
+
96
+ @media(max-width:500px) {
97
+ /* Chat page, header section, user image */
98
+ #nifty_wrapper .user_header_wrapper_img {
99
+ display:none;
100
+ }
101
+ #nifty_wrapper .user_header_wrapper_info {
102
+ width: 56% !important;
103
+ border: 1px solid #f1f1f1;
104
+ background-color: #fcfcfc;
105
+ }
106
+ }
107
+
108
+ /**
109
+ * Admin chat page
110
+ */
111
+ #nifty_wrapper span.minChat {
112
+ margin-top: 0px;
113
+ }
114
+ #nifty_wrapper .chatArea .messages {
115
+ background-size: cover;
116
+ border: 1px solid #e6e6e6;
117
+ }
118
+ #nifty_wrapper .timedate {
119
+ display:none;
120
+ }
121
+
122
+ /* System notification messages */
123
+ #nifty_wrapper .messages .wplc_system_notification {
124
+ display: block;
125
+ position: relative;
126
+ top: 0px;
127
+ width: 100%;
128
+ }
129
+ #nifty_wrapper .messages .wplc_system_notification .messageBody {
130
+ display: block;
131
+ position: relative;
132
+ left: 0px;
133
+ top: 7px;
134
+ width: 100%;
135
+ margin-top: 10px;
136
+ margin-bottom: 10px;
137
+ padding: 10px;
138
+ background-color: #fafafa;
139
+ border: 1px solid #e6e6e6;
140
+ border-radius: 5px;
141
+ color: #555555;
142
+ line-height:1.2em;
143
+ }
144
+ #nifty_wrapper .messages .wplc_system_notification .messageBody .wplc_system_notification {
145
+ display: inline-block;
146
+ position: relative;
147
+ left: 0px;
148
+ top: 0px;
149
+ width: auto;
150
+ height:auto;
151
+ margin-top: 0px;
152
+ margin-bottom: 0px;
153
+ background-color: transparent;
154
+ border: none;
155
+ border-radius: 0px;
156
+ }
157
+ #nifty_wrapper .messages .wplc_system_notification .messageBody .chat_time {
158
+ display: block;
159
+ position: relative;
160
+ left: 0px;
161
+ top: 0px;
162
+ width: 100%;
163
+ margin-bottom: 5px;
164
+ font-size: 0.9em;
165
+ font-weight: 600;
166
+ color: #555555;
167
+ }
168
+
169
+ /* Admin and user messages */
170
+ #nifty_wrapper ul.messages {
171
+ padding-bottom: 35px;
172
+ }
173
+ #nifty_wrapper .messages .wplc-admin-message,
174
+ #nifty_wrapper .messages .wplc-user-message {
175
+ display: block;
176
+ position: relative;
177
+ width: 100%;
178
+ height: auto;
179
+ clear: both;
180
+ }
181
+ #nifty_wrapper .messages .wplc-admin-message::before,
182
+ #nifty_wrapper .messages .wplc-user-message::before {
183
+ display: none;
184
+ }
185
+ #nifty_wrapper .messages .wplc-user-message .wplc-msg-content,
186
+ #nifty_wrapper .messages .wplc-admin-message .wplc-msg-content {
187
+ margin-top: 2px;
188
+ margin-bottom: 2px;
189
+ padding: 10px;
190
+ }
191
+
192
+ #nifty_wrapper .messages .wplc-user-message .wplc-msg-content:before,
193
+ #nifty_wrapper .messages .wplc-admin-message .wplc-msg-content:after {
194
+ display: block;
195
+ position: absolute;
196
+ width: 0;
197
+ border-style: solid;
198
+ content: "";
199
+ }
200
+ #nifty_wrapper .messages .wplc-user-message .wplc-msg-content .wplc-chat-person-name,
201
+ #nifty_wrapper .messages .wplc-user-message .wplc-msg-content .wplc-admin-message .messageBody,
202
+ #nifty_wrapper .messages .wplc-user-message .wplc-msg-content .wplc-user-message .messageBody {
203
+ display: inline-block;
204
+ position: relative;
205
+ left: 0px;
206
+ top: 0px;
207
+ }
208
+ #nifty_wrapper .messages .wplc-admin-message .wplc-admin-message-avatar,
209
+ #nifty_wrapper .messages .wplc-user-message .wplc-user-message-avatar {
210
+ border-radius: 50%;
211
+ }
212
+ #nifty_wrapper .messages .wplc-user-message .wplc-msg-content .wplc-chat-person-name {
213
+ margin-right:10px;
214
+ }
215
+ #nifty_wrapper .chatArea span.messageBody {
216
+ display:inline-block!important;
217
+ position:relative;
218
+ top:0px;
219
+ width:auto;
220
+ max-width: 100%;
221
+ height:auto;
222
+ font-size:1.2em;
223
+ }
224
+ span.bleeper-edit-message {
225
+ display: inline-block;
226
+ position: relative;
227
+ left: 0px;
228
+ width: auto;
229
+ height: auto;
230
+ margin-left: 20px;
231
+ margin-right: 0px;
232
+ margin-top: 0px;
233
+ font-size: 1.1em;
234
+ color: #ffffff;
235
+ font-weight: 500;
236
+ text-decoration: underline;
237
+ font-style: italic;
238
+ }
239
+
240
+ /* Admin messages */
241
+ #nifty_wrapper .messages .wplc-admin-message {
242
+ padding-right: 12px;
243
+ }
244
+ #nifty_wrapper .messages .wplc-admin-message .wplc-msg-content {
245
+ display: inline-block;
246
+ position: relative;
247
+ float: right;
248
+ max-width: calc(100% - 190px);
249
+ background-color:#ED832F;
250
+ color:#ffffff;
251
+ border-radius: 6px;
252
+ }
253
+ #nifty_wrapper .messages .wplc-admin-message .wplc-msg-content:after {
254
+ top: 11px;
255
+ right: -7px;
256
+ border-width: 6px 0px 6px 7px;
257
+ border-color: transparent #EB832C;
258
+ }
259
+ #nifty_wrapper .messages .wplc-admin-message .wplc-admin-message-avatar {
260
+ display: block;
261
+ position: relative;
262
+ float: right;
263
+ }
264
+
265
+ /* User messages */
266
+ #nifty_wrapper .messages .wplc-user-message {
267
+ padding-left:0px!important;
268
+ }
269
+ #nifty_wrapper .messages .wplc-user-message .wplc-msg-content {
270
+ display: inline-block;
271
+ position: relative;
272
+ top: 0px;
273
+ left: 0px;
274
+ width: auto;
275
+ max-width: calc(100% - 250px);
276
+ background-color: rgba(90, 90, 90, 0.94);
277
+ color: #ffffff;
278
+ border-radius: 3px;
279
+ }
280
+ #nifty_wrapper .messages .wplc-user-message .wplc-msg-content:before {
281
+ top: 15px;
282
+ left: -7px;
283
+ border-width: 6px 7px 6px 0px;
284
+ border-color: transparent #646464;
285
+ }
286
+ #nifty_wrapper .messages .wplc-user-message .wplc-user-message-avatar {
287
+ display: inline-block;
288
+ position: relative;
289
+ left: 0px;
290
+ top: 0px;
291
+ margin-right: 10px;
292
+ }
293
+
294
+ /* User and admin timestamp popup */
295
+ #nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp,
296
+ #nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp {
297
+ display: block;
298
+ position: absolute;
299
+ z-index: 1;
300
+ width: auto;
301
+ height: auto;
302
+ padding-top: 6px;
303
+ padding-bottom: 6px;
304
+ padding-left: 10px;
305
+ padding-right: 10px;
306
+ background-color: rgba(39, 36, 36, 0.94);
307
+ border-radius:5px;
308
+ color: #fafafa;
309
+ font-size: 0.8em !important;
310
+ }
311
+ #nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp:before,
312
+ #nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp:before {
313
+ display: block;
314
+ position: absolute;
315
+ top: 9px;
316
+ width: 0;
317
+ border-color: transparent #272424;
318
+ border-style: solid;
319
+ content: "";
320
+ }
321
+ #nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp:before {
322
+ left: -7px;
323
+ border-width: 6px 7px 6px 0px;
324
+ }
325
+ #nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp:before {
326
+ right: -7px;
327
+ border-width: 6px 0px 6px 7px;
328
+ }
329
+
330
+ /* Admin timestamp popup */
331
+ #nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp.only-hours,
332
+ #nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp {
333
+ float: left;
334
+ top: 0px;
335
+ }
336
+ #nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp {
337
+ left: -200px;
338
+ }
339
+ #nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp.only-hours {
340
+ left: -80px;
341
+ }
342
+
343
+ /* User timestamp popup */
344
+ #nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp {
345
+ float:right;
346
+ top:0px;
347
+ }
348
+ #nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp {
349
+ right:-200px;
350
+ }
351
+ #nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp.only-hours {
352
+ right:-80px;
353
+ }
354
+
355
+ @media(max-width:767px) {
356
+ #nifty_wrapper .messages .wplc-admin-message .wplc-msg-content {
357
+ max-width: calc(100% - 100px);
358
+ }
359
+ #nifty_wrapper .messages .wplc-user-message .wplc-msg-content {
360
+ max-width: calc(100% - 135px);
361
+ }
362
+
363
+ #nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp {
364
+ left: -100px;
365
+ }
366
+
367
+ #nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp,
368
+ #nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp {
369
+ max-width: 130px;
370
+ }
371
+
372
+ #nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp {
373
+ left: -100px;
374
+ }
375
+ #nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp {
376
+ right: -100px;
377
+ }
378
+
379
+ #nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp.only-hours {
380
+ right:-80px;
381
+ }
382
+
383
+ }
384
+
385
+ /* Quick messages button */
386
+ #nifty_wrapper #quick_response_drawer_handle {
387
+ z-index: 1;
388
+ }
389
+
390
+ /* Events box */
391
+ #nifty_wrapper .eventbox-wrapper {
392
+ overflow-y: auto;
393
+ height: calc(100% - 61px);
394
+ width: 356px;
395
+ border-bottom-right-radius: 5px;
396
+ border-bottom-left-radius: 5px;
397
+ }
398
+
399
+ /* Emoji's box */
400
+ .wdt-emoji-popup {
401
+
402
+ z-index: 5;
403
+ height: 300px;
404
+ margin-top:45px;
405
+ }
406
+ .wdt-emoji-popup .wdt-credit {
407
+ display: block;
408
+ position: relative;
409
+ left: 0px;
410
+ top: 0px;
411
+ padding-right: 15px;
412
+ color: #dcdcdc;
413
+ text-align: right;
414
+ }
415
+
416
+ /* Quick Response */
417
+ #quick_response_drawer_container {
418
+ display: block;
419
+ position: absolute;
420
+ float: right;
421
+ left: auto !important;
422
+ right: 23px;
423
+ bottom: 0px;
424
+ top: 48vh !important;
425
+ width: 57%;
426
+ max-height: 180px;
427
+ padding: 10px;
428
+ background: #fff;
429
+ overflow-y: auto;
430
+ border-radius: 2px;
431
+ box-shadow: 0px 0px 10px 1px rgba(0,0,0,0.1);
432
+ }
433
+
434
+ #chatTranscriptTitle {
435
+ display: block !important;
436
+ }
437
+
438
+ #chatTranscriptTitle.is-disabled {
439
+ color: currentColor;
440
+ cursor: not-allowed;
441
+ opacity: .5;
442
+ text-decoration: none;
443
+ }
444
+
css/admin_styles.css CHANGED
@@ -1,315 +1,315 @@
1
-
2
- /**
3
- * Settings
4
- */
5
-
6
- #wplc_settings .tooltip {
7
- background-color: #333;
8
- color: #eee;
9
- padding: 15px;
10
- border-radius: 15px;
11
- opacity: 0.8;
12
- }
13
-
14
- #wplc_settings .form-table td {
15
- font-size: 13px !important;
16
- line-height: 1.5em !important;
17
- }
18
-
19
-
20
- .wplc-extension-label-box {
21
- display:block;
22
- overflow:auto;
23
- clear:both;
24
- }
25
- .wplc-extension-label {
26
- display:block;
27
- float:left;
28
- padding:5px;
29
- margin-right:5px;
30
- font-size:0.8em;
31
- background-color:#bbb;
32
- color:#FFF;
33
- webkit-border-radius: 5px;
34
- -moz-border-radius: 5px;
35
- border-radius: 5px;
36
- }
37
-
38
-
39
- #wplc_tabs {
40
- box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
41
- -webkit-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
42
- -moz-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
43
- -o-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
44
- }
45
-
46
-
47
- .wplc-extension {
48
-
49
- float: left;
50
- margin: 0 1% 1% 0;
51
- background: #fff;
52
- border: 1px solid #ccc;
53
- width: 320px;
54
- padding: 14px;
55
- height: 370px;
56
- position: relative;
57
-
58
- }
59
- .wplc-extension h3 {
60
- margin: 0 0 8px;
61
- font-size: 13px;
62
-
63
- }
64
-
65
- .wplc-extension .button-secondary {
66
- position: absolute;
67
- bottom: 14px;
68
- left: 14px;
69
- }
70
- .wplc-plugin {
71
- height: 250px;
72
- }
73
-
74
-
75
- .wplc_header_vh {
76
- font: bold 14px/26px Arial;
77
- padding: 0 0 0 0px;
78
- color: #C2BBBE;
79
- display: block;
80
- text-transform: uppercase;
81
- display:block;
82
- }
83
- .wplc_headerspan_v { min-width:120px; width:20%; display:block; }
84
- .wplc_headerspan_nr { min-width:60px; width:10%; display:block; }
85
- .wplc_headerspan_dev { min-width:60px; width:10%; display:block; }
86
- .wplc_headerspan_d { min-width:200px; width:30%; display:block; }
87
- .wplc_headerspan_d a { font-style: italic; }
88
- .wplc_headerspan_t { min-width:60px; width:9%; display:block; }
89
- .wplc_headerspan_s { min-width:80px; width:12%; display:block; }
90
- .wplc_headerspan_a { min-width:100px; width:15%; display:block; }
91
- .wplc_chat_ul_header {
92
- clear: both;
93
- overflow:auto;
94
- display:block;
95
- padding:10px;
96
- }
97
-
98
-
99
- .relevant_extension p {
100
- margin-top:2px;
101
- }
102
- .relevant_extension h3 {
103
- margin-bottom:2px;
104
- }
105
- .relevant_extension {
106
- width: 49% !important;
107
- height: 125px !important;
108
- opacity:0.5;
109
- }
110
- .relevant_extension:hover {
111
- opacity:1.0;
112
- }
113
-
114
-
115
- .relevant_extension .button-secondary {
116
- right:10px !important;
117
- left: initial !important;
118
-
119
- }
120
-
121
-
122
- .relevant_extension img {
123
- margin-right:10px;
124
- }
125
-
126
-
127
-
128
- @media (min-width:320px) {
129
- /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */
130
- .relevant_extension {
131
- width: 85% !important;
132
- height: 145px !important;
133
- opacity:0.5;
134
- }
135
- .relevant_extension img {
136
- width:105px;
137
- }
138
- .wplc-extension .wp-post-image {
139
- height: auto;
140
- }
141
- }
142
- @media (min-width:480px) {
143
- /* smartphones, Android phones, landscape iPhone */
144
- .relevant_extension {
145
- width: 94% !important;
146
- height: 125px !important;
147
- opacity:0.5;
148
- }
149
- .relevant_extension img {
150
- width:105px;
151
- }
152
- .wplc-extension .wp-post-image {
153
- height: auto;
154
- }
155
- }
156
- @media (min-width:600px) {
157
- /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */
158
- .relevant_extension {
159
- width: 94% !important;
160
- height: 125px !important;
161
- opacity:0.5;
162
- }
163
- .relevant_extension img {
164
- width:105px;
165
- }
166
- .wplc-extension .wp-post-image {
167
- height: auto;
168
- }
169
- }
170
- @media (min-width:801px) {
171
- /* tablet, landscape iPad, lo-res laptops ands desktops */
172
- .relevant_extension {
173
- width: 43% !important;
174
- height: 145px !important;
175
- opacity:0.5;
176
- }
177
- .relevant_extension img {
178
- width:95px;
179
- }
180
- .wplc-extension .wp-post-image {
181
- height: auto;
182
- }
183
- }
184
- @media (min-width:1025px) {
185
- /* big landscape tablets, laptops, and desktops */
186
- .relevant_extension {
187
- width: 44% !important;
188
- height: 125px !important;
189
- opacity:0.5;
190
- }
191
- .relevant_extension img {
192
- width:125px;
193
- }
194
- .wplc-extension .wp-post-image {
195
- height: auto;
196
- }
197
- }
198
- @media (min-width:1281px) {
199
- /* hi-res laptops and desktops */
200
- .relevant_extension {
201
- width: 32% !important;
202
- height: 125px !important;
203
- opacity:0.5;
204
- }
205
- .relevant_extension img {
206
- width:110px;
207
- }
208
- .wplc-extension .wp-post-image {
209
- height: auto;
210
- }
211
- }
212
-
213
-
214
- .wplc-palette-selection {
215
- border: 1px solid #CCC;
216
- border-radius: 5px;
217
- padding: 5px;
218
- margin: 5px;
219
- height:100%;
220
-
221
- }
222
-
223
- .wplc_palette_single {
224
- margin: 5px;
225
- margin-top: 15px;
226
- width: 162px;
227
- height: 122px;
228
- text-align: center;
229
- display: inline-block;
230
- vertical-align: top;
231
- cursor: pointer;
232
-
233
- }
234
- .wplc-palette-top { display:block; width:100%; height:25%; }
235
-
236
-
237
-
238
- #wplc_tabs .ui-tabs-anchor {
239
- width: 100%;
240
- }
241
-
242
-
243
-
244
- /* Gutenberg styles */
245
- #tabs-gutenberg input[type='button'] {
246
- cursor: pointer;
247
- }
248
-
249
- #wplc_custom_js_editor, #wplc_custom_css_editor, #wplc_custom_html_editor {
250
- width: 560px;
251
- height: 285px;
252
- margin: 10px 0 10px 0;
253
- }
254
-
255
- #wplc_gutenberg_icon {
256
- cursor: pointer;
257
- }
258
-
259
- .wplc_code {
260
- cursor: pointer;
261
- transition: all .2s ease-in-out;
262
- border-radius: 3px;
263
- color: #696969;
264
- }
265
-
266
- .wplc_code:hover {
267
- background: #d7d7d7;
268
- }
269
-
270
- .wplc_code:focus, .wplc_code:active {
271
- background: #018add;
272
- color: #fff;
273
- }
274
-
275
-
276
- .wplc_agent_container ul {
277
- display:block;
278
- overflow:auto;
279
- }
280
- .wplc_agent_container li{
281
- display: block;
282
- float: left;
283
- text-align: center;
284
- border: 1px solid #CCC;
285
- width:150px;
286
- height:310px;
287
- padding: 10px;
288
- border-radius: 5px;
289
- margin: 10px;
290
- box-shadow: 2px 2px 2px #CCC;
291
- overflow: auto;
292
-
293
- }
294
- .wplc_agent_container img{
295
- border-radius: 100px;
296
- }
297
- .wplc_agent_container h3 {
298
- font: bold 12px/16px Arial;
299
- padding: 0 0 0 0px;
300
- color: #C2BBBE;
301
- display: block;
302
- height:40px;
303
- text-transform: uppercase;
304
- }
305
- .wplc_agent_container small { word-wrap: break-word; display:block; height:50px; }
306
- .wplc_agent_container select { width: 120px; }
307
-
308
- .initiate_upsell {
309
- position: absolute;
310
- bottom: 0;
311
- padding: 10px;
312
- border-top: 1px solid #ccc;
313
- width: 100%;
314
- background-color: #fff;
315
  }
1
+
2
+ /**
3
+ * Settings
4
+ */
5
+
6
+ #wplc_settings .tooltip {
7
+ background-color: #333;
8
+ color: #eee;
9
+ padding: 15px;
10
+ border-radius: 15px;
11
+ opacity: 0.8;
12
+ }
13
+
14
+ #wplc_settings .form-table td {
15
+ font-size: 13px !important;
16
+ line-height: 1.5em !important;
17
+ }
18
+
19
+
20
+ .wplc-extension-label-box {
21
+ display:block;
22
+ overflow:auto;
23
+ clear:both;
24
+ }
25
+ .wplc-extension-label {
26
+ display:block;
27
+ float:left;
28
+ padding:5px;
29
+ margin-right:5px;
30
+ font-size:0.8em;
31
+ background-color:#bbb;
32
+ color:#FFF;
33
+ webkit-border-radius: 5px;
34
+ -moz-border-radius: 5px;
35
+ border-radius: 5px;
36
+ }
37
+
38
+
39
+ #wplc_tabs {
40
+ box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
41
+ -webkit-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
42
+ -moz-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
43
+ -o-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
44
+ }
45
+
46
+
47
+ .wplc-extension {
48
+
49
+ float: left;
50
+ margin: 0 1% 1% 0;
51
+ background: #fff;
52
+ border: 1px solid #ccc;
53
+ width: 320px;
54
+ padding: 14px;
55
+ height: 370px;
56
+ position: relative;
57
+
58
+ }
59
+ .wplc-extension h3 {
60
+ margin: 0 0 8px;
61
+ font-size: 13px;
62
+
63
+ }
64
+
65
+ .wplc-extension .button-secondary {
66
+ position: absolute;
67
+ bottom: 14px;
68
+ left: 14px;
69
+ }
70
+ .wplc-plugin {
71
+ height: 250px;
72
+ }
73
+
74
+
75
+ .wplc_header_vh {
76
+ font: bold 14px/26px Arial;
77
+ padding: 0 0 0 0px;
78
+ color: #C2BBBE;
79
+ display: block;
80
+ text-transform: uppercase;
81
+ display:block;
82
+ }
83
+ .wplc_headerspan_v { min-width:120px; width:20%; display:block; }
84
+ .wplc_headerspan_nr { min-width:60px; width:10%; display:block; }
85
+ .wplc_headerspan_dev { min-width:60px; width:10%; display:block; }
86
+ .wplc_headerspan_d { min-width:200px; width:30%; display:block; }
87
+ .wplc_headerspan_d a { font-style: italic; }
88
+ .wplc_headerspan_t { min-width:60px; width:9%; display:block; }
89
+ .wplc_headerspan_s { min-width:80px; width:12%; display:block; }
90
+ .wplc_headerspan_a { min-width:100px; width:15%; display:block; }
91
+ .wplc_chat_ul_header {
92
+ clear: both;
93
+ overflow:auto;
94
+ display:block;
95
+ padding:10px;
96
+ }
97
+
98
+
99
+ .relevant_extension p {
100
+ margin-top:2px;
101
+ }
102
+ .relevant_extension h3 {
103
+ margin-bottom:2px;
104
+ }
105
+ .relevant_extension {
106
+ width: 49% !important;
107
+ height: 125px !important;
108
+ opacity:0.5;
109
+ }
110
+ .relevant_extension:hover {
111
+ opacity:1.0;
112
+ }
113
+
114
+
115
+ .relevant_extension .button-secondary {
116
+ right:10px !important;
117
+ left: initial !important;
118
+
119
+ }
120
+
121
+
122
+ .relevant_extension img {
123
+ margin-right:10px;
124
+ }
125
+
126
+
127
+
128
+ @media (min-width:320px) {
129
+ /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */
130
+ .relevant_extension {
131
+ width: 85% !important;
132
+ height: 145px !important;
133
+ opacity:0.5;
134
+ }
135
+ .relevant_extension img {
136
+ width:105px;
137
+ }
138
+ .wplc-extension .wp-post-image {
139
+ height: auto;
140
+ }
141
+ }
142
+ @media (min-width:480px) {
143
+ /* smartphones, Android phones, landscape iPhone */
144
+ .relevant_extension {
145
+ width: 94% !important;
146
+ height: 125px !important;
147
+ opacity:0.5;
148
+ }
149
+ .relevant_extension img {
150
+ width:105px;
151
+ }
152
+ .wplc-extension .wp-post-image {
153
+ height: auto;
154
+ }
155
+ }
156
+ @media (min-width:600px) {
157
+ /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */
158
+ .relevant_extension {
159
+ width: 94% !important;
160
+ height: 125px !important;
161
+ opacity:0.5;
162
+ }
163
+ .relevant_extension img {
164
+ width:105px;
165
+ }
166
+ .wplc-extension .wp-post-image {
167
+ height: auto;
168
+ }
169
+ }
170
+ @media (min-width:801px) {
171
+ /* tablet, landscape iPad, lo-res laptops ands desktops */
172
+ .relevant_extension {
173
+ width: 43% !important;
174
+ height: 145px !important;
175
+ opacity:0.5;
176
+ }
177
+ .relevant_extension img {
178
+ width:95px;
179
+ }
180
+ .wplc-extension .wp-post-image {
181
+ height: auto;
182
+ }
183
+ }
184
+ @media (min-width:1025px) {
185
+ /* big landscape tablets, laptops, and desktops */
186
+ .relevant_extension {
187
+ width: 44% !important;
188
+ height: 125px !important;
189
+ opacity:0.5;
190
+ }
191
+ .relevant_extension img {
192
+ width:125px;
193
+ }
194
+ .wplc-extension .wp-post-image {
195
+ height: auto;
196
+ }
197
+ }
198
+ @media (min-width:1281px) {
199
+ /* hi-res laptops and desktops */
200
+ .relevant_extension {
201
+ width: 32% !important;
202
+ height: 125px !important;
203
+ opacity:0.5;
204
+ }
205
+ .relevant_extension img {
206
+ width:110px;
207
+ }
208
+ .wplc-extension .wp-post-image {
209
+ height: auto;
210
+ }
211
+ }
212
+
213
+
214
+ .wplc-palette-selection {
215
+ border: 1px solid #CCC;
216
+ border-radius: 5px;
217
+ padding: 5px;
218
+ margin: 5px;
219
+ height:100%;
220
+
221
+ }
222
+
223
+ .wplc_palette_single {
224
+ margin: 5px;
225
+ margin-top: 15px;
226
+ width: 162px;
227
+ height: 122px;
228
+ text-align: center;
229
+ display: inline-block;
230
+ vertical-align: top;
231
+ cursor: pointer;
232
+
233
+ }
234
+ .wplc-palette-top { display:block; width:100%; height:25%; }
235
+
236
+
237
+
238
+ #wplc_tabs .ui-tabs-anchor {
239
+ width: 100%;
240
+ }
241
+
242
+
243
+
244
+ /* Gutenberg styles */
245
+ #tabs-gutenberg input[type='button'] {
246
+ cursor: pointer;
247
+ }
248
+
249
+ #wplc_custom_js_editor, #wplc_custom_css_editor, #wplc_custom_html_editor {
250
+ width: 560px;
251
+ height: 285px;
252
+ margin: 10px 0 10px 0;
253
+ }
254
+
255
+ #wplc_gutenberg_icon {
256
+ cursor: pointer;
257
+ }
258
+
259
+ .wplc_code {
260
+ cursor: pointer;
261
+ transition: all .2s ease-in-out;
262
+ border-radius: 3px;
263
+ color: #696969;
264
+ }
265
+
266
+ .wplc_code:hover {
267
+ background: #d7d7d7;
268
+ }
269
+
270
+ .wplc_code:focus, .wplc_code:active {
271
+ background: #018add;
272
+ color: #fff;
273
+ }
274
+
275
+
276
+ .wplc_agent_container ul {
277
+ display:block;
278
+ overflow:auto;
279
+ }
280
+ .wplc_agent_container li{
281
+ display: block;
282
+ float: left;
283
+ text-align: center;
284
+ border: 1px solid #CCC;
285
+ width:150px;
286
+ height:310px;
287
+ padding: 10px;
288
+ border-radius: 5px;
289
+ margin: 10px;
290
+ box-shadow: 2px 2px 2px #CCC;
291
+ overflow: auto;
292
+
293
+ }
294
+ .wplc_agent_container img{
295
+ border-radius: 100px;
296
+ }
297
+ .wplc_agent_container h3 {
298
+ font: bold 12px/16px Arial;
299
+ padding: 0 0 0 0px;
300
+ color: #C2BBBE;
301
+ display: block;
302
+ height:40px;
303
+ text-transform: uppercase;
304
+ }
305
+ .wplc_agent_container small { word-wrap: break-word; display:block; height:50px; }
306
+ .wplc_agent_container select { width: 120px; }
307
+
308
+ .initiate_upsell {
309
+ position: absolute;
310
+ bottom: 0;
311
+ padding: 10px;
312
+ border-top: 1px solid #ccc;
313
+ width: 100%;
314
+ background-color: #fff;
315
  }
css/chat-style.css CHANGED
@@ -1,923 +1,923 @@
1
-
2
- #admin_chat_box {
3
- display:block;
4
- overflow:auto;
5
- clear:both;
6
- padding:20px;
7
- -webkit-border-radius: 5px;
8
- -moz-border-radius: 5px;
9
- border-radius: 5px;
10
- border: 1px solid #ccc;
11
- background-color:#fff;
12
- width:85%;
13
- min-width:675px;
14
- }
15
-
16
- .wplc-sub-item-email-string {
17
- white-space: nowrap;
18
- display:inline-block;
19
- width: 120px; /* IE6 needs any width */
20
- overflow: hidden; /* "overflow" value must be different from visible"*/
21
- -o-text-overflow: ellipsis; /* Opera < 11*/
22
- text-overflow: ellipsis; /* IE, Safari (WebKit), Opera >= 11, FF > 6 */
23
- }
24
- .admin_chat_box {
25
- -webkit-border-radius: 5px;
26
- -moz-border-radius: 5px;
27
- border-radius: 5px;
28
- border: 1px solid #ccc;
29
- float:left;
30
- display:block;
31
- background-color:white;
32
- width: 50%;
33
- min-width:300px;
34
- /*height:315px;*/
35
- background-color: #ffffff;
36
- background-image: -webkit-gradient(linear, left top, left bottom, from(#CCC), to(#FFF));
37
- background-image: -webkit-linear-gradient(top, #CCC, #FFF);
38
- background-image: -moz-linear-gradient(top, #CCC, #FFF);
39
- background-image: -o-linear-gradient(top, #CCC, #FFF);
40
- background-image: linear-gradient(to bottom, #CCC, #FFF);
41
- }
42
- .chat_response_box {
43
-
44
- }
45
- .admin_chat_box_inner {
46
- height:210px;
47
- padding:10px;
48
- overflow:scroll;
49
- overflow-x: hidden;
50
- background-color:#FFF;
51
- }
52
-
53
- .admin_chat_box_inner_bottom {
54
- /*height:60px;*/
55
- width:100%;
56
- border-top:1px solid #ccc;
57
- display:block;
58
- overflow:auto;
59
- }
60
- .admin_chat_quick_controls {
61
- clear:left;
62
- padding-left:10px;
63
- }
64
-
65
- .admin_visitor_info {
66
- float:left;
67
- width: 47%;
68
- padding-left:15px;
69
- min-width:250px;
70
- }
71
-
72
- #wplc_admin_chatmsg {
73
- width:95%;
74
- margin:0 auto;
75
- margin-top:10px;
76
- display:block;
77
- height:50px;
78
- padding:10px;
79
- -webkit-border-radius: 5px;
80
- -moz-border-radius: 5px;
81
- border-radius: 5px;
82
- border: 1px solid #ccc;
83
- }
84
-
85
- .admin_chat_img {
86
- -webkit-border-radius: 5px;
87
- -moz-border-radius: 5px;
88
- border-radius: 5px;
89
- }
90
-
91
- .admin_chat_box .admin_chat_box_inner {
92
- background: url('../images/bg/cloudy.jpg') repeat;
93
- background-size: cover;
94
- }
95
- .wplc-admin-message {
96
- padding:10px;
97
- -webkit-border-radius: 2px;
98
- -moz-border-radius: 2px;
99
- border-radius: 2px;
100
- border: 1px solid #ccc;
101
- margin-top:2px;
102
- background-color:#EEE;
103
- display: inline-block;
104
- float: left;
105
- clear:both;
106
- margin-bottom: 3px;
107
- word-wrap: break-word;
108
- max-width:96%;
109
- }
110
-
111
- .wplc-user-message {
112
- padding:10px;
113
- -webkit-border-radius: 2px;
114
- -moz-border-radius: 2px;
115
- border-radius: 2px;
116
- border: 1px solid #ffdb99;
117
- margin-top:2px;
118
- background-color:#fff6ef;
119
- color:#000;
120
- display: inline-block;
121
- float: right;
122
- clear:both;
123
- margin-bottom: 3px;
124
- word-wrap: break-word;
125
- max-width:96%;
126
- position: relative;
127
- right: 35px;
128
- max-width: 71%;
129
- }
130
-
131
- .wplc-admin-message {
132
- padding: 10px;
133
- -webkit-border-radius: 2px;
134
- -moz-border-radius: 2px;
135
- border-radius: 2px;
136
- border: 1px solid #666;
137
- margin-top: 2px;
138
- background-color: #666;
139
- display: inline-block;
140
- float: left;
141
- clear: both;
142
- margin-bottom: 3px;
143
- position: relative;
144
- left: 32px;
145
- color: #FFF;
146
- max-width: 82%;
147
- word-wrap: break-word;
148
- max-width: 71%;
149
- }
150
-
151
- .wplc-admin-message img{
152
- border-radius: 25px;
153
- position: absolute;
154
- left: -37px;
155
- top: 3px;
156
- }
157
-
158
- .wplc-user-message:before {
159
- display: block;
160
- width: 0;
161
- top: 15px;
162
- bottom: auto;
163
- left: auto;
164
- right: -7px;
165
- border-width: 6px 0 6px 7px;
166
- border-color: transparent #ffdb99;
167
- content: "";
168
- position: absolute;
169
- border-style: solid;
170
- }
171
-
172
- .wplc-admin-message:before {
173
- display: block;
174
- width: 0;
175
- top: 15px;
176
- bottom: auto;
177
- left: auto;
178
- left: -7px;
179
- border-width: 6px 7px 6px 0;
180
- border-color: transparent #666;
181
- content: "";
182
- position: absolute;
183
- border-style: solid;
184
- }
185
-
186
- .wplc-user-message img.wplc-user-message-avatar {
187
- border-radius: 25px;
188
- position: absolute;
189
- right: -37px;
190
- top: 3px;
191
- }
192
-
193
- .wplc-user-message hr, .wplc-admin-message hr{
194
- margin-bottom: 0px !important;
195
- }
196
- /* ./Messages */
197
-
198
- .chat_time {
199
- display:block;
200
- width:100%;
201
- text-align:center;
202
- font-size:0.8em;
203
- color:#ccc;
204
- clear:both;
205
-
206
- }
207
-
208
- .admin_visitor_advanced_info { clear:left; }
209
-
210
-
211
- /*.admin_visitor_advanced_info {
212
- clear:both;
213
- font-size:0.9em;
214
- margin-top:20px;
215
-
216
- }*/
217
- .admin_visitor_advanced_info .part1 {
218
- color:#3b3b3b;
219
- }
220
- .admin_visitor_advanced_info .part2 {
221
- color:#949494;
222
- }
223
- .admin_chat_name { font-size:1.3em; display:block; clear:right; font-weight:bold; margin-bottom:5px; }
224
- .admin_chat_email { font-size:1em; display:block; clear:right; }
225
-
226
-
227
- .end_chat_div {
228
- display:block;
229
- clear:both;
230
- text-align:right;
231
- font-size:10px;
232
- width:85%;
233
- margin-left: 40px;
234
- margin-bottom:20px;
235
- }
236
-
237
- /* New Dashboard Layout */
238
- .wplc_admin_dashboard_container{
239
- width: 80%;
240
- margin: 0 auto;
241
- }
242
- #wplc_admin_chat_area{
243
- width: 65%;
244
- display: inline-block;
245
- background-color: #FFF;
246
- float: left;
247
- /*padding: 10px;*/
248
- box-shadow: 1px 1px 3px #ccc;
249
- }
250
-
251
- #wplc_admin_visitor_area{
252
- width: 30%;
253
- display: inline-block;
254
- background-color: #FFF;
255
- float: right;
256
- box-shadow: 1px 1px 3px #ccc;
257
- }
258
-
259
- .wplc_visitor_container{
260
- padding: 10px;
261
- }
262
- .wplc_visitor_container h1{
263
- text-align: center;
264
- line-height: 22px;
265
- }
266
-
267
- .wplc_chats_container h2{
268
- padding: 10px;
269
- }
270
-
271
- .wplc_chat_section {
272
- width: 33.33%;
273
- display: table-cell;
274
- vertical-align: middle;
275
- }
276
-
277
- .wplc_agent_actions{
278
- text-align: center;
279
- }
280
-
281
- .wplc_single_chat{
282
- width: 100%;
283
- display: inline-block;
284
- border: 1px solid #EEE;
285
- border-radius: 5px;
286
- box-shadow: 1px 1px 21px #EEE;
287
- margin: 8px auto;
288
- padding: 10px;
289
- }
290
- .wplc_single_chat .wplc_user_image {
291
- width: 30%;
292
- display: inline-block;
293
- float: left;
294
- }
295
- .wplc_user_meta_data {
296
- width: 70%;
297
- display: inline-block;
298
- }
299
- .wplc_single_chat .wplc_user_image img{
300
- border-radius: 100px;
301
- }
302
-
303
-
304
- .wplc_single_visitor{
305
- border-bottom: 1px solid #ccc;
306
- padding: 20px;
307
- }
308
-
309
- .wplc_single_visitor .wplc_chat_status{
310
-
311
- }
312
-
313
- .wplc_single_visitor .wplc_user_image {
314
- width: 120px;
315
- display: inline-block;
316
- margin-right: 10px;
317
- }
318
-
319
- .wplc_single_visitor .wplc_user_image img{
320
- border-radius: 100px;
321
- }
322
-
323
- .wplc_single_visitor .wplc_user_meta_data{
324
- display: inline-block;
325
- vertical-align: top;
326
- }
327
-
328
- .wplc_single_visitor .wplc_user_name {
329
-
330
- }
331
-
332
- .wplc_single_visitor .wplc_user_name h3{
333
- margin: 0;
334
- padding: 0;
335
- }
336
-
337
- .wplc_single_visitor h3.ui-accordion .ui-accordion-icons{
338
- margin: 0;
339
- padding-left: 0;
340
- }
341
-
342
- .wplc_single_visitor .wplc_user_name h3 i{
343
- padding: 0 10px;
344
- }
345
- .wplc_active{
346
- color: green;
347
- }
348
-
349
- .wplc_pending{
350
- color: orange;
351
- }
352
-
353
- .wplc_closed{
354
- color: red;
355
- }
356
-
357
- .wplc_single_visitor .wplc_user_email{
358
-
359
- }
360
-
361
- .wplc_single_visitor .wplc_user_ip{
362
-
363
- }
364
-
365
- .wplc_single_visitor .wplc_current_page a{
366
- width: 100%;
367
- }
368
-
369
- .wplc_single_visitor .wplc_actions{
370
-
371
- }
372
-
373
- .wplc_icon_message{
374
- font-size: 10px;
375
- font-weight: normal;
376
- }
377
-
378
- .wplc_page_title{
379
- text-align: center;
380
- }
381
-
382
- .wplc_page_title h1{
383
- font-size: 3em;
384
- }
385
-
386
- .wplc_visitor_icon{
387
- padding-right: 10px;
388
-
389
- }
390
-
391
- @media all and (max-width: 550px) {
392
- #wplc_admin_chat_area{
393
- width: 100%;
394
- padding: 0;
395
- margin: 0 0 10px 0;
396
- }
397
- #wplc_admin_visitor_area{
398
- width: 100%;
399
- }
400
- #wplc_admin_chat_area p{
401
- padding: 10px
402
- }
403
- }
404
- @media all and (max-width: 1440px) {
405
- .wplc_single_chat .wplc_user_image {
406
- width: 100%;
407
- display: block;
408
- text-align: center;
409
- }
410
- .wplc_user_meta_data {
411
- width: 100%;
412
- display: block;
413
- text-align: center;
414
- }
415
- }
416
-
417
- @media all and (max-width: 1200px) {
418
- .wplc_chat_section.section_1 {
419
- display: inline-block;
420
- width: 100%;
421
- padding: 10px;
422
- }
423
- }
424
-
425
- @media all and (max-width: 850px) {
426
- .wplc_chat_section.section_2 {
427
- display: inline-block;
428
- width: 100%;
429
- padding: 10px;
430
- }
431
- .admin_visitor_advanced_info{
432
- width: 93%;
433
- clear:both;
434
- }
435
- }
436
-
437
- .wplc_admin_dashboard_container p {
438
- padding: 0 5px;
439
- }
440
-
441
- .toplevel_page_wplivechat-menu .wp-pointer-content h3 {
442
- background-color: #ec822c;
443
- border: 1px solid #ec822c;
444
- }
445
- .toplevel_page_wplivechat-menu .wp-pointer-content h3:before {
446
- color: #ec822c;
447
- }
448
-
449
- #wplc_admin_chat_holder {
450
- width:990px;
451
- margin:0 auto;
452
- display:block;
453
- overflow:auto;
454
- clear:both;
455
- }
456
-
457
- #wplc_admin_chat_area_new {
458
- width: 750px;
459
- font-size: 13px;
460
- float:left;
461
- display:block;
462
- background-color:#FFF;
463
- border-radius:25px;
464
- }
465
- #wplc_admin_chat_info_new {
466
- float:left;
467
- width:240px;
468
- display:block;
469
- margin-bottom:20px;
470
- }
471
- .wplc_chat_vis_count_box {
472
- width:57%;
473
- min-width:198px;
474
- background-color:#FFF;
475
- min-height:150px;
476
- border-radius:25px;
477
- margin-left:auto;
478
- margin-right:auto;
479
- display:block;
480
- text-align:center;
481
- padding:10px;
482
- }
483
-
484
- .wplc_vis_online {
485
- font-size: 60px;
486
- line-height:70px;
487
- color: #ec822c;
488
- text-align: center;
489
- padding-top: 36px;
490
- font-family: Arial;
491
- display: block;
492
- font-weight:bold;
493
- }
494
-
495
- #wplc_admin_chat_area_new li {
496
- float: left;
497
- background: none;
498
- padding: 0 2px 0 0;
499
- list-style:none;
500
- margin:0;
501
- }
502
-
503
- #wplc_chat_ul {
504
- clear: both;
505
- overflow:auto;
506
- display:block;
507
- }
508
- .wplc_p_cul { padding:10px; clear:both; display:block; overflow: auto; }
509
- .wplc_p_cul:hover { background-color:#eee; border-radius:5px; }
510
-
511
- .wplc_status_box {
512
- padding: 3px;
513
- border-radius: 5px;
514
- color:white;
515
- font-size:11px;
516
- }
517
- .wplc-agent-info {
518
- font: bold 12px/24px Arial;
519
- color: #C2BBBE;
520
- text-transform: uppercase;
521
- display: block;
522
- }
523
- .wplc_agents_online { color: #ec822c; }
524
- .wplc_type_new { background-color: #E1734A; }
525
- .wplc_type_returning { background-color: #ec822c; }
526
-
527
- .wplc_status_1 { background-color: #CCCCCC; }
528
- .wplc_status_4 { background-color: #CCCCCC; }
529
- .wplc_status_8 { background-color: #CCCCCC; }
530
-
531
- .wplc_status_5 { background-color: #B3D24B; }
532
-
533
- .wplc_status_2 { background-color: #3278CD; }
534
- .wplc_status_3 { background-color: #3278CD; }
535
-
536
- .wplc_status_6 { background-color: red; }
537
- .wplc_status_7 { background-color: #BFBCBB; }
538
- .wplc_status_9 { background-color: #BFBCBB; }
539
-
540
- .browser-tag { font-size:10px; }
541
- .browser-tag img{ top:3px; position:relative }
542
- .wplc-sub-item-header { color:#C7C3C3; font-style: italic; }
543
-
544
- @media (min-width:320px) { #wplc_admin_chat_holder { width:100%; } #wplc_admin_chat_area_new { width:90%; float:none; display:block; margin: 0 auto; } #wplc_admin_chat_info_new { width:240px; float:none; display:block; margin: 20px auto; } .wplc_headerspan_t { display:none; } .wplc_headerspan_nr { display:none; } .wplc_chat_ul_header { display:none; } .wplc_p_cul { border-bottom:1px solid #ccc; } #wplc_admin_chat_area_new li { float:none; } .wplc_headerspan_a,.wplc_headerspan_d,.wplc_headerspan_v,.wplc_headerspan_s { margin:5px auto; text-align:center; } .wplc_chat_vis_count_box { min-width:180px; } }
545
- @media (min-width:481px) { #wplc_admin_chat_holder { width:100%; } #wplc_admin_chat_area_new { width:90%; float:none; display:block; margin: 0 auto; } #wplc_admin_chat_info_new { width:240px; float:none; display:block; margin: 20px auto; } .wplc_headerspan_t { display:none; } .wplc_headerspan_nr { display:none; } .wplc_chat_ul_header { display:none; } .wplc_p_cul { border-bottom:1px solid #ccc; } #wplc_admin_chat_area_new li { float:none; } .wplc_headerspan_a,.wplc_headerspan_d,.wplc_headerspan_v,.wplc_headerspan_s { margin:5px auto; text-align:center; } .wplc_chat_vis_count_box { min-width:180px; } .wplc-sub-item-email-string { white-space: nowrap; width: 100%; /* IE6 needs any width */ overflow: hidden; /* "overflow" value must be different from visible"*/ -o-text-overflow: ellipsis; /* Opera < 11*/ text-overflow: ellipsis; /* IE, Safari (WebKit), Opera >= 11, FF > 6 */ } }
546
- @media (min-width:641px) { #wplc_admin_chat_holder { width:650px; } #wplc_admin_chat_area_new { width:640px; float:none; display:block; margin: 0 auto; } #wplc_admin_chat_info_new { width:240px; float:none; display:block; margin: 20px auto; } .wplc_headerspan_t { display:block; } .wplc_headerspan_nr { display:none; } .wplc_chat_ul_header { display:block; } .wplc_p_cul { border-bottom:none; } #wplc_admin_chat_area_new li { float:left; } .wplc_headerspan_a,.wplc_headerspan_d,.wplc_headerspan_v,.wplc_headerspan_s { margin:0; text-align:left; } .wplc_chat_vis_count_box { min-width:180px; } }
547
- @media (min-width:961px) { #wplc_admin_chat_holder { width:850px; } #wplc_admin_chat_area_new { width:700px; float:none; display:block; margin: 0 auto; } #wplc_admin_chat_info_new { width:240px; float:none; display:block; margin: 20px auto; } .wplc_headerspan_t { display:none; } .wplc_headerspan_nr { display:block; } .wplc_chat_ul_header { display:block; } .wplc_p_cul { border-bottom:none; } #wplc_admin_chat_area_new li { float:left; } .wplc_headerspan_a,.wplc_headerspan_d,.wplc_headerspan_v,.wplc_headerspan_s { margin:0; text-align:left; } .wplc_chat_vis_count_box { min-width:110px; } }
548
- @media (min-width:1025px) { #wplc_admin_chat_holder { width:990px; } #wplc_admin_chat_area_new { width:700px; float:left; display:block; margin: 0; } #wplc_admin_chat_info_new { width:140px; float:left; display:block; margin: 0; } .wplc_headerspan_t { display:none; } .wplc_headerspan_nr { display:block; } .wplc_chat_ul_header { display:block; } .wplc_p_cul { border-bottom:none; } #wplc_admin_chat_area_new li { float:left; } .wplc_headerspan_a,.wplc_headerspan_d,.wplc_headerspan_v,.wplc_headerspan_s { margin:0; text-align:left; } .wplc_chat_vis_count_box { min-width:110px; } }
549
- @media (min-width:1281px) { #wplc_admin_chat_holder { width:990px; } #wplc_admin_chat_area_new { width:750px; float:left; display:block; margin: 0; } #wplc_admin_chat_info_new { width:240px; float:left; display:block; margin: 0; } .wplc_headerspan_t { display:block; } .wplc_headerspan_nr { display:block; } .wplc_chat_ul_header { display:block; } .wplc_p_cul { border-bottom:none; } #wplc_admin_chat_area_new li { float:left; } .wplc_headerspan_a,.wplc_headerspan_d,.wplc_headerspan_v,.wplc_headerspan_s { margin:0; text-align:left; } .wplc_chat_vis_count_box { min-width:198px; } }
550
-
551
- .wplc_add_on_button_chat {
552
- float:left; margin-right: 10px;
553
- }
554
-
555
- .wplc_no_visitors {
556
- display: block;
557
- width: 100%;
558
- text-align: center;
559
- font-style: italic;
560
- }
561
-
562
-
563
-
564
-
565
- #wplc_star_rating{
566
- text-align: center;
567
- padding: 10px;
568
- }
569
-
570
- #nifty_file_holder {
571
- float: right;
572
- margin-right: 13px;
573
- margin-top: 4px;
574
- }
575
-
576
- .nifty_tedit_icon{
577
- font-size: 12px;
578
- padding-left: 6px;
579
- }
580
-
581
- #nifty_text_editor_holder{
582
- margin-top:3px;
583
- margin-left:4px;
584
- }
585
-
586
- .wplc_faded_upsell {
587
- color: lightgrey;
588
- }
589
- .wplc_chat_area_temp { padding:20px; }
590
- .offline-quote {
591
- font-size: 26px;
592
- font-style: italic;
593
- text-align: center;
594
- width: 100%;
595
- display: block;
596
- color: #343434;
597
- }
598
- .offline-status {
599
- display: block;
600
- width: 100%;
601
- clear:both;
602
- text-align: center;
603
- line-height: 45px;
604
- }
605
-
606
-
607
- .wplc-logo {
608
-
609
- padding-top: 50px;
610
- max-width: 100vw;
611
- padding-bottom: 50px;
612
-
613
- }
614
-
615
- .wplc_network_issue {
616
- position: absolute;
617
- background: white;
618
- width: 400px;
619
- height: 55px;
620
- border-left: 4px solid #ec822c;
621
- left: 0;
622
- right: 0;
623
- top: 0;
624
- bottom: 0;
625
- margin: auto;
626
- box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);
627
- -webkit-box-shadow: 0 0px 0px 0 rgba(0,0,0,0.16),0 2px 7px 0 rgba(0,0,0,0.12);
628
- -moz-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);
629
- -o-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);
630
- }
631
-
632
- .wplc_network_issue span {
633
- width: 80%;
634
- display: block;
635
- padding-top: 5%;
636
- padding-bottom: 5%;
637
- padding-left: 10%;
638
- padding-right: 10%;
639
- margin: auto;
640
- position: absolute;
641
- top: 0;
642
- bottom: 0;
643
- }
644
-
645
- .wplc_dashboard_additional_label {
646
- width: 100%;
647
- text-align: center;
648
- display: block;
649
- margin-top: 10px;
650
- cursor: help;
651
- }
652
-
653
- .wplc_modal {
654
- display: block;
655
- position: fixed;
656
- top: 0;
657
- bottom: 0;
658
- left: 0;
659
- right: 0;
660
- background: rgba(0, 0, 0, 0.3);
661
- }
662
-
663
- .wplc_modal_inner {
664
- width: 60%;
665
- height: 300px;
666
- margin: auto;
667
- background: #ffffff;
668
- position: fixed;
669
- z-index: 9999;
670
- display: block;
671
- top: 0;
672
- bottom: 0;
673
- left: 0;
674
- right: 0;
675
- border: 1px solid #9f9f9f;
676
- border-radius: 3px;
677
- }
678
-
679
- .wplc_modal_inner_title {
680
- font-size: 18px;
681
- padding: 17px;
682
- border-bottom: 1px solid #d5d5d5;
683
- }
684
-
685
- .wplc_modal_inner_content {
686
- position: absolute;
687
- display: block;
688
- left: 10px;
689
- right: 10px;
690
- bottom: 55px;
691
- top: 55px;
692
- overflow-y: auto;
693
- }
694
-
695
- .wplc_modal_inner_actions {
696
- height: 28px;
697
- position: absolute;
698
- bottom: 5px;
699
- left: 0;
700
- right: 0;
701
- text-align: center;
702
- }
703
-
704
- span.wplc_system_notification {
705
- display: block;
706
- clear:both;
707
- padding: 8px;
708
- font-style: italic;
709
- text-align: right;
710
- }
711
- .widefat th.sortable, .widefat th.sorted {
712
- padding: 5px 10px !important;
713
- }
714
-
715
- @media (max-width: 1145px) {
716
- .wplc-badge {
717
- max-width: 35% !important;
718
- float: none !important;
719
- margin: 0 auto !important;
720
- }
721
- }
722
-
723
- .wplc-chat-in-progress {
724
- display: inline-block;
725
- width: 100px;
726
- margin-top: 5px;
727
- }
728
-
729
- .wplc-history__date {
730
- display: block;
731
- margin-bottom: 5px;
732
- }
733
-
734
- .wplc-history__date-end {
735
- margin-bottom: 10px;
736
- }
737
-
738
- .wplc-history__date strong {
739
- margin-right: 5px;
740
- }
741
-
742
- .wplc-exclude-post-types__item,
743
- .wplc-require-user-info__item {
744
- margin-bottom: 5px;
745
-
746
- }
747
- .wplc-chat-box-notification--disabled {
748
- padding: 5px;
749
- display: block;
750
- width: 40%;
751
- margin-left: auto;
752
- margin-right: auto;
753
- border: 1px solid #d26d6d;
754
- background-color: #f3bfbf;
755
- font-weight: bold;
756
- }
757
-
758
- .admin_chat_box_inner span.timedate {
759
- clear: both;
760
- position: relative;
761
- font-size: 0.8em;
762
- font-style:italic
763
- }
764
-
765
- .wplc-msg-float-left {
766
- left: 32px;
767
- float:left;
768
- }
769
-
770
- .wplc-msg-float-right {
771
- right: 32px;
772
- float:right;
773
- }
774
-
775
-
776
- #wplc-chat-box {
777
- width: fit-content;
778
- position: relative;
779
- cursor: pointer;
780
- }
781
-
782
- .wplc_block {
783
- position: relative;
784
- display:inline-block;
785
- background: #32373c;
786
- color: #eee;
787
- border-radius: 3px;
788
- height: 35px;
789
- padding-left: 45px;
790
- margin: 5px 0 5px 0;
791
- transition: all .2s ease-in-out;
792
- cursor: pointer;
793
- border-bottom: 0px solid #111;
794
- font-size: 17px;
795
- line-height: 35px;
796
- }
797
-
798
-
799
- .wplc_block:hover {
800
- transform: translateY(-2px);
801
- }
802
-
803
- .wplc_block:after {
804
- content: "";
805
- position: absolute;
806
- display: block;
807
- height: 0px;
808
- bottom: 0;
809
- left: 0;
810
- width: 100%;
811
- background-color: #000;
812
- opacity: 0;
813
- transition: all .2s ease-in-out;
814
- }
815
-
816
- .wplc_block:hover:after {
817
- height: 3px;
818
- opacity: .2;
819
- }
820
-
821
- #wplc-chat-box.disabled:first-child:after {
822
- content: "Disabled";
823
- color:#fff;
824
- font-size: 17px;
825
- text-transform: uppercase;
826
- text-align: center;
827
- display: block;
828
- position: absolute;
829
- height: 100%;
830
- width: 100%;
831
- bottom: 0;
832
- left: 0;
833
- background: #ED832F;
834
- opacity: .9;
835
- }
836
-
837
- .wplc_block_logo {
838
- width: 35px;
839
- height: 35px;
840
- position: absolute;
841
- left: 0;
842
- background: #e7e7e7;
843
- display: inline-block;
844
- margin:0;
845
- background-size: cover;
846
- background-position: center;
847
- background-color:#ED832F !important;
848
- transition: all .2s ease-in-out;
849
- box-sizing: border-box;
850
- box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
851
- -webkit-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
852
- -moz-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
853
- }
854
-
855
- .wplc_block_text {
856
- display: inline-block;
857
- height: 100%;
858
- margin-right: 7px;
859
- }
860
-
861
- .wplc_block_icon {
862
- height: 100%;
863
- width: 35px;
864
- background: transparent;
865
- display: inline-block;
866
- }
867
-
868
- .wplc_block_icon.disabled {
869
- display: none;
870
- }
871
-
872
- /* Block size styles: small */
873
- .wplc_block.sm {
874
- height: 25px;
875
- line-height: 25px;
876
- padding-left: 30px;
877
- font-size: 12px;
878
- }
879
-
880
- .wplc_block.sm:hover:after {
881
- height: 2px;
882
- opacity: .2;
883
- }
884
-
885
- .wplc_block.sm .wplc_block_logo {
886
- height: 25px;
887
- width: 25px;
888
- }
889
-
890
- .wplc_block.sm .wplc_block_text {
891
- margin-right: 7px;
892
- }
893
-
894
- .wplc_block.sm .wplc_block_icon {
895
- margin-right: 7px;
896
- width: 13px;
897
- }
898
-
899
- /* Block size styles: large */
900
- .wplc_block.lg {
901
- height: 80px;
902
- line-height: 80px;
903
- padding-left: 100px;
904
- font-size: 25px;
905
- }
906
-
907
- .wplc_block.lg:hover:after {
908
- height: 6px;
909
- opacity: .2;
910
- }
911
-
912
- .wplc_block.lg .wplc_block_logo {
913
- height: 80px;
914
- width: 80px;
915
- }
916
-
917
- .wplc_block.lg .wplc_block_text {
918
- margin-right: 13px;
919
- }
920
-
921
- .wplc_block.lg .wplc_block_icon {
922
- margin-right: 13px;
923
- }
1
+
2
+ #admin_chat_box {
3
+ display:block;
4
+ overflow:auto;
5
+ clear:both;
6
+ padding:20px;
7
+ -webkit-border-radius: 5px;
8
+ -moz-border-radius: 5px;
9
+ border-radius: 5px;
10
+ border: 1px solid #ccc;
11
+ background-color:#fff;
12
+ width:85%;
13
+ min-width:675px;
14
+ }
15
+
16
+ .wplc-sub-item-email-string {
17
+ white-space: nowrap;
18
+ display:inline-block;
19
+ width: 120px; /* IE6 needs any width */
20
+ overflow: hidden; /* "overflow" value must be different from visible"*/
21
+ -o-text-overflow: ellipsis; /* Opera < 11*/
22
+ text-overflow: ellipsis; /* IE, Safari (WebKit), Opera >= 11, FF > 6 */
23
+ }
24
+ .admin_chat_box {
25
+ -webkit-border-radius: 5px;
26
+ -moz-border-radius: 5px;
27
+ border-radius: 5px;
28
+ border: 1px solid #ccc;
29
+ float:left;
30
+ display:block;
31
+ background-color:white;
32
+ width: 50%;
33
+ min-width:300px;
34
+ /*height:315px;*/
35
+ background-color: #ffffff;
36
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#CCC), to(#FFF));
37
+ background-image: -webkit-linear-gradient(top, #CCC, #FFF);
38
+ background-image: -moz-linear-gradient(top, #CCC, #FFF);
39
+ background-image: -o-linear-gradient(top, #CCC, #FFF);
40
+ background-image: linear-gradient(to bottom, #CCC, #FFF);
41
+ }
42
+ .chat_response_box {
43
+
44
+ }
45
+ .admin_chat_box_inner {
46
+ height:210px;
47
+ padding:10px;
48
+ overflow:scroll;
49
+ overflow-x: hidden;
50
+ background-color:#FFF;
51
+ }
52
+
53
+ .admin_chat_box_inner_bottom {
54
+ /*height:60px;*/
55
+ width:100%;
56
+ border-top:1px solid #ccc;
57
+ display:block;
58
+ overflow:auto;
59
+ }
60
+ .admin_chat_quick_controls {
61
+ clear:left;
62
+ padding-left:10px;
63
+ }
64
+
65
+ .admin_visitor_info {
66
+ float:left;
67
+ width: 47%;
68
+ padding-left:15px;
69
+ min-width:250px;
70
+ }
71
+
72
+ #wplc_admin_chatmsg {
73
+ width:95%;
74
+ margin:0 auto;
75
+ margin-top:10px;
76
+ display:block;
77
+ height:50px;
78
+ padding:10px;
79
+ -webkit-border-radius: 5px;
80
+ -moz-border-radius: 5px;
81
+ border-radius: 5px;
82
+ border: 1px solid #ccc;
83
+ }
84
+
85
+ .admin_chat_img {
86
+ -webkit-border-radius: 5px;
87
+ -moz-border-radius: 5px;
88
+ border-radius: 5px;
89
+ }
90
+
91
+ .admin_chat_box .admin_chat_box_inner {
92
+ background: url('../images/bg/cloudy.jpg') repeat;
93
+ background-size: cover;
94
+ }
95
+ .wplc-admin-message {
96
+ padding:10px;
97
+ -webkit-border-radius: 2px;
98
+ -moz-border-radius: 2px;
99
+ border-radius: 2px;
100
+ border: 1px solid #ccc;
101
+ margin-top:2px;
102
+ background-color:#EEE;
103
+ display: inline-block;
104
+ float: left;
105
+ clear:both;
106
+ margin-bottom: 3px;
107
+ word-wrap: break-word;
108
+ max-width:96%;
109
+ }
110
+
111
+ .wplc-user-message {
112
+ padding:10px;
113
+ -webkit-border-radius: 2px;
114
+ -moz-border-radius: 2px;
115
+ border-radius: 2px;
116
+ border: 1px solid #ffdb99;
117
+ margin-top:2px;
118
+ background-color:#fff6ef;
119
+ color:#000;
120
+ display: inline-block;
121
+ float: right;
122
+ clear:both;
123
+ margin-bottom: 3px;
124
+ word-wrap: break-word;
125
+ max-width:96%;
126
+ position: relative;
127
+ right: 35px;
128
+ max-width: 71%;
129
+ }
130
+
131
+ .wplc-admin-message {
132
+ padding: 10px;
133
+ -webkit-border-radius: 2px;
134
+ -moz-border-radius: 2px;
135
+ border-radius: 2px;
136
+ border: 1px solid #666;
137
+ margin-top: 2px;
138
+ background-color: #666;
139
+ display: inline-block;
140
+ float: left;
141
+ clear: both;
142
+ margin-bottom: 3px;
143
+ position: relative;
144
+ left: 32px;
145
+ color: #FFF;
146
+ max-width: 82%;
147
+ word-wrap: break-word;
148
+ max-width: 71%;
149
+ }
150
+
151
+ .wplc-admin-message img{
152
+ border-radius: 25px;
153
+ position: absolute;
154
+ left: -37px;
155
+ top: 3px;
156
+ }
157
+
158
+ .wplc-user-message:before {
159
+ display: block;
160
+ width: 0;
161
+ top: 15px;
162
+ bottom: auto;
163
+ left: auto;
164
+ right: -7px;
165
+ border-width: 6px 0 6px 7px;
166
+ border-color: transparent #ffdb99;
167
+ content: "";
168
+ position: absolute;
169
+ border-style: solid;
170
+ }
171
+
172
+ .wplc-admin-message:before {
173
+ display: block;
174
+ width: 0;
175
+ top: 15px;
176
+ bottom: auto;
177
+ left: auto;
178
+ left: -7px;
179
+ border-width: 6px 7px 6px 0;
180
+ border-color: transparent #666;
181
+ content: "";
182
+ position: absolute;
183
+ border-style: solid;
184
+ }
185
+
186
+ .wplc-user-message img.wplc-user-message-avatar {
187
+ border-radius: 25px;
188
+ position: absolute;
189
+ right: -37px;
190
+ top: 3px;
191
+ }
192
+
193
+ .wplc-user-message hr, .wplc-admin-message hr{
194
+ margin-bottom: 0px !important;
195
+ }
196
+ /* ./Messages */
197
+
198
+ .chat_time {
199
+ display:block;
200
+ width:100%;
201
+ text-align:center;
202
+ font-size:0.8em;
203
+ color:#ccc;
204
+ clear:both;
205
+
206
+ }
207
+
208
+ .admin_visitor_advanced_info { clear:left; }
209
+
210
+
211
+ /*.admin_visitor_advanced_info {
212
+ clear:both;
213
+ font-size:0.9em;
214
+ margin-top:20px;
215
+
216
+ }*/
217
+ .admin_visitor_advanced_info .part1 {
218
+ color:#3b3b3b;
219
+ }
220
+ .admin_visitor_advanced_info .part2 {
221
+ color:#949494;
222
+ }
223
+ .admin_chat_name { font-size:1.3em; display:block; clear:right; font-weight:bold; margin-bottom:5px; }
224
+ .admin_chat_email { font-size:1em; display:block; clear:right; }
225
+
226
+
227
+ .end_chat_div {
228
+ display:block;
229
+ clear:both;
230
+ text-align:right;
231
+ font-size:10px;
232
+ width:85%;
233
+ margin-left: 40px;
234
+ margin-bottom:20px;
235
+ }
236
+
237
+ /* New Dashboard Layout */
238
+ .wplc_admin_dashboard_container{
239
+ width: 80%;
240
+ margin: 0 auto;
241
+ }
242
+ #wplc_admin_chat_area{
243
+ width: 65%;
244
+ display: inline-block;
245
+ background-color: #FFF;
246
+ float: left;
247
+ /*padding: 10px;*/
248
+ box-shadow: 1px 1px 3px #ccc;
249
+ }
250
+
251
+ #wplc_admin_visitor_area{
252
+ width: 30%;
253
+ display: inline-block;
254
+ background-color: #FFF;
255
+ float: right;
256
+ box-shadow: 1px 1px 3px #ccc;
257
+ }
258
+
259
+ .wplc_visitor_container{
260
+ padding: 10px;
261
+ }
262
+ .wplc_visitor_container h1{
263
+ text-align: center;
264
+ line-height: 22px;
265
+ }
266
+
267
+ .wplc_chats_container h2{
268
+ padding: 10px;
269
+ }
270
+
271
+ .wplc_chat_section {
272
+ width: 33.33%;
273
+ display: table-cell;
274
+ vertical-align: middle;
275
+ }
276
+
277
+ .wplc_agent_actions{
278
+ text-align: center;
279
+ }
280
+
281
+ .wplc_single_chat{
282
+ width: 100%;
283
+ display: inline-block;
284
+ border: 1px solid #EEE;
285
+ border-radius: 5px;
286
+ box-shadow: 1px 1px 21px #EEE;
287
+ margin: 8px auto;
288
+ padding: 10px;
289
+ }
290
+ .wplc_single_chat .wplc_user_image {
291
+ width: 30%;
292
+ display: inline-block;
293
+ float: left;
294
+ }
295
+ .wplc_user_meta_data {
296
+ width: 70%;
297
+ display: inline-block;
298
+ }
299
+ .wplc_single_chat .wplc_user_image img{
300
+ border-radius: 100px;
301
+ }
302
+
303
+
304
+ .wplc_single_visitor{
305
+ border-bottom: 1px solid #ccc;
306
+ padding: 20px;
307
+ }
308
+
309
+ .wplc_single_visitor .wplc_chat_status{
310
+
311
+ }
312
+
313
+ .wplc_single_visitor .wplc_user_image {
314
+ width: 120px;
315
+ display: inline-block;
316
+ margin-right: 10px;
317
+ }
318
+
319
+ .wplc_single_visitor .wplc_user_image img{
320
+ border-radius: 100px;
321
+ }
322
+
323
+ .wplc_single_visitor .wplc_user_meta_data{
324
+ display: inline-block;
325
+ vertical-align: top;
326
+ }
327
+
328
+ .wplc_single_visitor .wplc_user_name {
329
+
330
+ }
331
+
332
+ .wplc_single_visitor .wplc_user_name h3{
333
+ margin: 0;
334
+ padding: 0;
335
+ }
336
+
337
+ .wplc_single_visitor h3.ui-accordion .ui-accordion-icons{
338
+ margin: 0;
339
+ padding-left: 0;
340
+ }
341
+
342
+ .wplc_single_visitor .wplc_user_name h3 i{
343
+ padding: 0 10px;
344
+ }
345
+ .wplc_active{
346
+ color: green;
347
+ }
348
+
349
+ .wplc_pending{
350
+ color: orange;
351
+ }
352
+
353
+ .wplc_closed{
354
+ color: red;
355
+ }
356
+
357
+ .wplc_single_visitor .wplc_user_email{
358
+
359
+ }
360
+
361
+ .wplc_single_visitor .wplc_user_ip{
362
+
363
+ }
364
+
365
+ .wplc_single_visitor .wplc_current_page a{
366
+ width: 100%;
367
+ }
368
+
369
+ .wplc_single_visitor .wplc_actions{
370
+
371
+ }
372
+
373
+ .wplc_icon_message{
374
+ font-size: 10px;
375
+ font-weight: normal;
376
+ }
377
+
378
+ .wplc_page_title{
379
+ text-align: center;
380
+ }
381
+
382
+ .wplc_page_title h1{
383
+ font-size: 3em;
384
+ }
385
+
386
+ .wplc_visitor_icon{
387
+ padding-right: 10px;
388
+
389
+ }
390
+
391
+ @media all and (max-width: 550px) {
392
+ #wplc_admin_chat_area{
393
+ width: 100%;
394
+ padding: 0;
395
+ margin: 0 0 10px 0;
396
+ }
397
+ #wplc_admin_visitor_area{
398
+ width: 100%;
399
+ }
400
+ #wplc_admin_chat_area p{
401
+ padding: 10px
402
+ }
403
+ }
404
+ @media all and (max-width: 1440px) {
405
+ .wplc_single_chat .wplc_user_image {
406
+ width: 100%;
407
+ display: block;
408
+ text-align: center;
409
+ }
410
+ .wplc_user_meta_data {
411
+ width: 100%;
412
+ display: block;
413
+ text-align: center;
414
+ }
415
+ }
416
+
417
+ @media all and (max-width: 1200px) {
418
+ .wplc_chat_section.section_1 {
419
+ display: inline-block;
420
+ width: 100%;
421
+ padding: 10px;
422
+ }
423
+ }
424
+
425
+ @media all and (max-width: 850px) {
426
+ .wplc_chat_section.section_2 {
427
+ display: inline-block;
428
+ width: 100%;
429
+ padding: 10px;
430
+ }
431
+ .admin_visitor_advanced_info{
432
+ width: 93%;
433
+ clear:both;
434
+ }
435
+ }
436
+
437
+ .wplc_admin_dashboard_container p {
438
+ padding: 0 5px;
439
+ }
440
+
441
+ .toplevel_page_wplivechat-menu .wp-pointer-content h3 {
442
+ background-color: #ec822c;
443
+ border: 1px solid #ec822c;
444
+ }
445
+ .toplevel_page_wplivechat-menu .wp-pointer-content h3:before {
446
+ color: #ec822c;
447
+ }
448
+
449
+ #wplc_admin_chat_holder {
450
+ width:990px;
451
+ margin:0 auto;
452
+ display:block;
453
+ overflow:auto;
454
+ clear:both;
455
+ }
456
+
457
+ #wplc_admin_chat_area_new {
458
+ width: 750px;
459
+ font-size: 13px;
460
+ float:left;
461
+ display:block;
462
+ background-color:#FFF;
463
+ border-radius:25px;
464
+ }
465
+ #wplc_admin_chat_info_new {
466
+ float:left;
467
+ width:240px;
468
+ display:block;
469
+ margin-bottom:20px;
470
+ }
471
+ .wplc_chat_vis_count_box {
472
+ width:57%;
473
+ min-width:198px;
474
+ background-color:#FFF;
475
+ min-height:150px;
476
+ border-radius:25px;
477
+ margin-left:auto;
478
+ margin-right:auto;
479
+ display:block;
480
+ text-align:center;
481
+ padding:10px;
482
+ }
483
+
484
+ .wplc_vis_online {
485
+ font-size: 60px;
486
+ line-height:70px;
487
+ color: #ec822c;
488
+ text-align: center;
489
+ padding-top: 36px;
490
+ font-family: Arial;
491
+ display: block;
492
+ font-weight:bold;
493
+ }
494
+
495
+ #wplc_admin_chat_area_new li {
496
+ float: left;
497
+ background: none;
498
+ padding: 0 2px 0 0;
499
+ list-style:none;
500
+ margin:0;
501
+ }
502
+
503
+ #wplc_chat_ul {
504
+ clear: both;
505
+ overflow:auto;
506
+ display:block;
507
+ }
508
+ .wplc_p_cul { padding:10px; clear:both; display:block; overflow: auto; }
509
+ .wplc_p_cul:hover { background-color:#eee; border-radius:5px; }
510
+
511
+ .wplc_status_box {
512
+ padding: 3px;
513
+ border-radius: 5px;
514
+ color:white;
515
+ font-size:11px;
516
+ }
517
+ .wplc-agent-info {
518
+ font: bold 12px/24px Arial;
519
+ color: #C2BBBE;
520
+ text-transform: uppercase;
521
+ display: block;
522
+ }
523
+ .wplc_agents_online { color: #ec822c; }
524
+ .wplc_type_new { background-color: #E1734A; }
525
+ .wplc_type_returning { background-color: #ec822c; }
526
+
527
+ .wplc_status_1 { background-color: #CCCCCC; }
528
+ .wplc_status_4 { background-color: #CCCCCC; }
529
+ .wplc_status_8 { background-color: #CCCCCC; }
530
+
531
+ .wplc_status_5 { background-color: #B3D24B; }
532
+
533
+ .wplc_status_2 { background-color: #3278CD; }
534
+ .wplc_status_3 { background-color: #3278CD; }
535
+
536
+ .wplc_status_6 { background-color: red; }
537
+ .wplc_status_7 { background-color: #BFBCBB; }
538
+ .wplc_status_9 { background-color: #BFBCBB; }
539
+
540
+ .browser-tag { font-size:10px; }
541
+ .browser-tag img{ top:3px; position:relative }
542
+ .wplc-sub-item-header { color:#C7C3C3; font-style: italic; }
543
+
544
+ @media (min-width:320px) { #wplc_admin_chat_holder { width:100%; } #wplc_admin_chat_area_new { width:90%; float:none; display:block; margin: 0 auto; } #wplc_admin_chat_info_new { width:240px; float:none; display:block; margin: 20px auto; } .wplc_headerspan_t { display:none; } .wplc_headerspan_nr { display:none; } .wplc_chat_ul_header { display:none; } .wplc_p_cul { border-bottom:1px solid #ccc; } #wplc_admin_chat_area_new li { float:none; } .wplc_headerspan_a,.wplc_headerspan_d,.wplc_headerspan_v,.wplc_headerspan_s { margin:5px auto; text-align:center; } .wplc_chat_vis_count_box { min-width:180px; } }
545
+ @media (min-width:481px) { #wplc_admin_chat_holder { width:100%; } #wplc_admin_chat_area_new { width:90%; float:none; display:block; margin: 0 auto; } #wplc_admin_chat_info_new { width:240px; float:none; display:block; margin: 20px auto; } .wplc_headerspan_t { display:none; } .wplc_headerspan_nr { display:none; } .wplc_chat_ul_header { display:none; } .wplc_p_cul { border-bottom:1px solid #ccc; } #wplc_admin_chat_area_new li { float:none; } .wplc_headerspan_a,.wplc_headerspan_d,.wplc_headerspan_v,.wplc_headerspan_s { margin:5px auto; text-align:center; } .wplc_chat_vis_count_box { min-width:180px; } .wplc-sub-item-email-string { white-space: nowrap; width: 100%; /* IE6 needs any width */ overflow: hidden; /* "overflow" value must be different from visible"*/ -o-text-overflow: ellipsis; /* Opera < 11*/ text-overflow: ellipsis; /* IE, Safari (WebKit), Opera >= 11, FF > 6 */ } }
546
+ @media (min-width:641px) { #wplc_admin_chat_holder { width:650px; } #wplc_admin_chat_area_new { width:640px; float:none; display:block; margin: 0 auto; } #wplc_admin_chat_info_new { width:240px; float:none; display:block; margin: 20px auto; } .wplc_headerspan_t { display:block; } .wplc_headerspan_nr { display:none; } .wplc_chat_ul_header { display:block; } .wplc_p_cul { border-bottom:none; } #wplc_admin_chat_area_new li { float:left; } .wplc_headerspan_a,.wplc_headerspan_d,.wplc_headerspan_v,.wplc_headerspan_s { margin:0; text-align:left; } .wplc_chat_vis_count_box { min-width:180px; } }
547
+ @media (min-width:961px) { #wplc_admin_chat_holder { width:850px; } #wplc_admin_chat_area_new { width:700px; float:none; display:block; margin: 0 auto; } #wplc_admin_chat_info_new { width:240px; float:none; display:block; margin: 20px auto; } .wplc_headerspan_t { display:none; } .wplc_headerspan_nr { display:block; } .wplc_chat_ul_header { display:block; } .wplc_p_cul { border-bottom:none; } #wplc_admin_chat_area_new li { float:left; } .wplc_headerspan_a,.wplc_headerspan_d,.wplc_headerspan_v,.wplc_headerspan_s { margin:0; text-align:left; } .wplc_chat_vis_count_box { min-width:110px; } }
548
+ @media (min-width:1025px) { #wplc_admin_chat_holder { width:990px; } #wplc_admin_chat_area_new { width:700px; float:left; display:block; margin: 0; } #wplc_admin_chat_info_new { width:140px; float:left; display:block; margin: 0; } .wplc_headerspan_t { display:none; } .wplc_headerspan_nr { display:block; } .wplc_chat_ul_header { display:block; } .wplc_p_cul { border-bottom:none; } #wplc_admin_chat_area_new li { float:left; } .wplc_headerspan_a,.wplc_headerspan_d,.wplc_headerspan_v,.wplc_headerspan_s { margin:0; text-align:left; } .wplc_chat_vis_count_box { min-width:110px; } }
549
+ @media (min-width:1281px) { #wplc_admin_chat_holder { width:990px; } #wplc_admin_chat_area_new { width:750px; float:left; display:block; margin: 0; } #wplc_admin_chat_info_new { width:240px; float:left; display:block; margin: 0; } .wplc_headerspan_t { display:block; } .wplc_headerspan_nr { display:block; } .wplc_chat_ul_header { display:block; } .wplc_p_cul { border-bottom:none; } #wplc_admin_chat_area_new li { float:left; } .wplc_headerspan_a,.wplc_headerspan_d,.wplc_headerspan_v,.wplc_headerspan_s { margin:0; text-align:left; } .wplc_chat_vis_count_box { min-width:198px; } }
550
+
551
+ .wplc_add_on_button_chat {
552
+ float:left; margin-right: 10px;
553
+ }
554
+
555
+ .wplc_no_visitors {
556
+ display: block;
557
+ width: 100%;
558
+ text-align: center;
559
+ font-style: italic;
560
+ }
561
+
562
+
563
+
564
+
565
+ #wplc_star_rating{
566
+ text-align: center;
567
+ padding: 10px;
568
+ }
569
+
570
+ #nifty_file_holder {
571
+ float: right;
572
+ margin-right: 13px;
573
+ margin-top: 4px;
574
+ }
575
+
576
+ .nifty_tedit_icon{
577
+ font-size: 12px;
578
+ padding-left: 6px;
579
+ }
580
+
581
+ #nifty_text_editor_holder{
582
+ margin-top:3px;
583
+ margin-left:4px;
584
+ }
585
+
586
+ .wplc_faded_upsell {
587
+ color: lightgrey;
588
+ }
589
+ .wplc_chat_area_temp { padding:20px; }
590
+ .offline-quote {
591
+ font-size: 26px;
592
+ font-style: italic;
593
+ text-align: center;
594
+ width: 100%;
595
+ display: block;
596
+ color: #343434;
597
+ }
598
+ .offline-status {
599
+ display: block;
600
+ width: 100%;
601
+ clear:both;
602
+ text-align: center;
603
+ line-height: 45px;
604
+ }
605
+
606
+
607
+ .wplc-logo {
608
+
609
+ padding-top: 50px;
610
+ max-width: 100vw;
611
+ padding-bottom: 50px;
612
+
613
+ }
614
+
615
+ .wplc_network_issue {
616
+ position: absolute;
617
+ background: white;
618
+ width: 400px;
619
+ height: 55px;
620
+ border-left: 4px solid #ec822c;
621
+ left: 0;
622
+ right: 0;
623
+ top: 0;
624
+ bottom: 0;
625
+ margin: auto;
626
+ box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);
627
+ -webkit-box-shadow: 0 0px 0px 0 rgba(0,0,0,0.16),0 2px 7px 0 rgba(0,0,0,0.12);
628
+ -moz-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);
629
+ -o-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);
630
+ }
631
+
632
+ .wplc_network_issue span {
633
+ width: 80%;
634
+ display: block;
635
+ padding-top: 5%;
636
+ padding-bottom: 5%;
637
+ padding-left: 10%;
638
+ padding-right: 10%;
639
+ margin: auto;
640
+ position: absolute;
641
+ top: 0;
642
+ bottom: 0;
643
+ }
644
+
645
+ .wplc_dashboard_additional_label {
646
+ width: 100%;
647
+ text-align: center;
648
+ display: block;
649
+ margin-top: 10px;
650
+ cursor: help;
651
+ }
652
+
653
+ .wplc_modal {
654
+ display: block;
655
+ position: fixed;
656
+ top: 0;
657
+ bottom: 0;
658
+ left: 0;
659
+ right: 0;
660
+ background: rgba(0, 0, 0, 0.3);
661
+ }
662
+
663
+ .wplc_modal_inner {
664
+ width: 60%;
665
+ height: 300px;
666
+ margin: auto;
667
+ background: #ffffff;
668
+ position: fixed;
669
+ z-index: 9999;
670
+ display: block;
671
+ top: 0;
672
+ bottom: 0;
673
+ left: 0;
674
+ right: 0;
675
+ border: 1px solid #9f9f9f;
676
+ border-radius: 3px;
677
+ }
678
+
679
+ .wplc_modal_inner_title {
680
+ font-size: 18px;
681
+ padding: 17px;
682
+ border-bottom: 1px solid #d5d5d5;
683
+ }
684
+
685
+ .wplc_modal_inner_content {
686
+ position: absolute;
687
+ display: block;
688
+ left: 10px;
689
+ right: 10px;
690
+ bottom: 55px;
691
+ top: 55px;
692
+ overflow-y: auto;
693
+ }
694
+
695
+ .wplc_modal_inner_actions {
696
+ height: 28px;
697
+ position: absolute;
698
+ bottom: 5px;
699
+ left: 0;
700
+ right: 0;
701
+ text-align: center;
702
+ }
703
+
704
+ span.wplc_system_notification {
705
+ display: block;
706
+ clear:both;
707
+ padding: 8px;
708
+ font-style: italic;
709
+ text-align: right;
710
+ }
711
+ .widefat th.sortable, .widefat th.sorted {
712
+ padding: 5px 10px !important;
713
+ }
714
+
715
+ @media (max-width: 1145px) {
716
+ .wplc-badge {
717
+ max-width: 35% !important;
718
+ float: none !important;
719
+ margin: 0 auto !important;
720
+ }
721
+ }
722
+
723
+ .wplc-chat-in-progress {
724
+ display: inline-block;
725
+ width: 100px;
726
+ margin-top: 5px;
727
+ }
728
+
729
+ .wplc-history__date {
730
+ display: block;
731
+ margin-bottom: 5px;
732
+ }
733
+
734
+ .wplc-history__date-end {
735
+ margin-bottom: 10px;
736
+ }
737
+
738
+ .wplc-history__date strong {
739
+ margin-right: 5px;
740
+ }
741
+
742
+ .wplc-exclude-post-types__item,
743
+ .wplc-require-user-info__item {
744
+ margin-bottom: 5px;
745
+
746
+ }
747
+ .wplc-chat-box-notification--disabled {
748
+ padding: 5px;
749
+ display: block;
750
+ width: 40%;
751
+ margin-left: auto;
752
+ margin-right: auto;
753
+ border: 1px solid #d26d6d;
754
+ background-color: #f3bfbf;
755
+ font-weight: bold;
756
+ }
757
+
758
+ .admin_chat_box_inner span.timedate {
759
+ clear: both;
760
+ position: relative;
761
+ font-size: 0.8em;
762
+ font-style:italic
763
+ }
764
+
765
+ .wplc-msg-float-left {
766
+ left: 32px;
767
+ float:left;
768
+ }
769
+
770
+ .wplc-msg-float-right {
771
+ right: 32px;
772
+ float:right;
773
+ }
774
+
775
+
776
+ #wplc-chat-box {
777
+ width: fit-content;
778
+ position: relative;
779
+ cursor: pointer;
780
+ }
781
+
782
+ .wplc_block {
783
+ position: relative;
784
+ display:inline-block;
785
+ background: #32373c;
786
+ color: #eee;
787
+ border-radius: 3px;
788
+ height: 35px;
789
+ padding-left: 45px;
790
+ margin: 5px 0 5px 0;
791
+ transition: all .2s ease-in-out;
792
+ cursor: pointer;
793
+ border-bottom: 0px solid #111;
794
+ font-size: 17px;
795
+ line-height: 35px;
796
+ }
797
+
798
+
799
+ .wplc_block:hover {
800
+ transform: translateY(-2px);
801
+ }
802
+
803
+ .wplc_block:after {
804
+ content: "";
805
+ position: absolute;
806
+ display: block;
807
+ height: 0px;
808
+ bottom: 0;
809
+ left: 0;
810
+ width: 100%;
811
+ background-color: #000;
812
+ opacity: 0;
813
+ transition: all .2s ease-in-out;
814
+ }
815
+
816
+ .wplc_block:hover:after {
817
+ height: 3px;
818
+ opacity: .2;
819
+ }
820
+
821
+ #wplc-chat-box.disabled:first-child:after {
822
+ content: "Disabled";
823
+ color:#fff;
824
+ font-size: 17px;
825
+ text-transform: uppercase;
826
+ text-align: center;
827
+ display: block;
828
+ position: absolute;
829
+ height: 100%;
830
+ width: 100%;
831
+ bottom: 0;
832
+ left: 0;
833
+ background: #ED832F;
834
+ opacity: .9;
835
+ }
836
+
837
+ .wplc_block_logo {
838
+ width: 35px;
839
+ height: 35px;
840
+ position: absolute;
841
+ left: 0;
842
+ background: #e7e7e7;
843
+ display: inline-block;
844
+ margin:0;
845
+ background-size: cover;
846
+ background-position: center;
847
+ background-color:#ED832F !important;
848
+ transition: all .2s ease-in-out;
849
+ box-sizing: border-box;
850
+ box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
851
+ -webkit-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
852
+ -moz-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
853
+ }
854
+
855
+ .wplc_block_text {
856
+ display: inline-block;
857
+ height: 100%;
858
+ margin-right: 7px;
859
+ }
860
+
861
+ .wplc_block_icon {
862
+ height: 100%;
863
+ width: 35px;
864
+ background: transparent;
865
+ display: inline-block;
866
+ }
867
+
868
+ .wplc_block_icon.disabled {
869
+ display: none;
870
+ }
871
+
872
+ /* Block size styles: small */
873
+ .wplc_block.sm {
874
+ height: 25px;
875
+ line-height: 25px;
876
+ padding-left: 30px;
877
+ font-size: 12px;
878
+ }
879
+
880
+ .wplc_block.sm:hover:after {
881
+ height: 2px;
882
+ opacity: .2;
883
+ }
884
+
885
+ .wplc_block.sm .wplc_block_logo {
886
+ height: 25px;
887
+ width: 25px;
888
+ }
889
+
890
+ .wplc_block.sm .wplc_block_text {
891
+ margin-right: 7px;
892
+ }
893
+
894
+ .wplc_block.sm .wplc_block_icon {
895
+ margin-right: 7px;
896
+ width: 13px;
897
+ }
898
+
899
+ /* Block size styles: large */
900
+ .wplc_block.lg {
901
+ height: 80px;
902
+ line-height: 80px;
903
+ padding-left: 100px;
904
+ font-size: 25px;
905
+ }
906
+
907
+ .wplc_block.lg:hover:after {
908
+ height: 6px;
909
+ opacity: .2;
910
+ }
911
+
912
+ .wplc_block.lg .wplc_block_logo {
913
+ height: 80px;
914
+ width: 80px;
915
+ }
916
+
917
+ .wplc_block.lg .wplc_block_text {
918
+ margin-right: 13px;
919
+ }
920
+
921
+ .wplc_block.lg .wplc_block_icon {
922
+ margin-right: 13px;
923
+ }
css/fontawesome-iconpicker.css CHANGED
@@ -1,335 +1,335 @@
1
- /*!
2
- * Font Awesome Icon Picker
3
- * https://itsjavi.com/fontawesome-iconpicker/
4
- *
5
- * Originally written by (c) 2016 Javi Aguilar
6
- * Licensed under the MIT License
7
- * https://github.com/itsjavi/fontawesome-iconpicker/blob/master/LICENSE
8
- *
9
- */
10
- /*
11
- * Font Awesome Icon Picker
12
- * https://itsjavi.com/fontawesome-iconpicker/
13
- *
14
- * Originally written by (c) 2016 Javi Aguilar
15
- * Licensed under the MIT License
16
- * https://github.com/itsjavi/fontawesome-iconpicker/blob/master/LICENSE
17
- *
18
- */
19
- /*
20
- * Font Awesome Icon Picker
21
- * https://itsjavi.com/fontawesome-iconpicker/
22
- *
23
- * Originally written by (c) 2016 Javi Aguilar
24
- * Licensed under the MIT License
25
- * https://github.com/itsjavi/fontawesome-iconpicker/blob/master/LICENSE
26
- *
27
- */
28
- .iconpicker-popover.popover {
29
- position: absolute;
30
- top: 0;
31
- left: 0;
32
- display: none;
33
- max-width: none;
34
- padding: 1px;
35
- text-align: left;
36
- width: 216px;
37
- background: #f7f7f7;
38
- z-index: 100;
39
- border: 1px solid #e7e7e7;
40
- border-radius: 3px;
41
- }
42
- .iconpicker-popover.popover.top,
43
- .iconpicker-popover.popover.topLeftCorner,
44
- .iconpicker-popover.popover.topLeft,
45
- .iconpicker-popover.popover.topRight,
46
- .iconpicker-popover.popover.topRightCorner {
47
- margin-top: -10px;
48
- }
49
- .iconpicker-popover.popover.right,
50
- .iconpicker-popover.popover.rightTop,
51
- .iconpicker-popover.popover.rightBottom {
52
- margin-left: 10px;
53
- }
54
- .iconpicker-popover.popover.bottom,
55
- .iconpicker-popover.popover.bottomRightCorner,
56
- .iconpicker-popover.popover.bottomRight,
57
- .iconpicker-popover.popover.bottomLeft,
58
- .iconpicker-popover.popover.bottomLeftCorner {
59
- margin-top: 10px;
60
- }
61
- .iconpicker-popover.popover.left,
62
- .iconpicker-popover.popover.leftBottom,
63
- .iconpicker-popover.popover.leftTop {
64
- margin-left: -10px;
65
- }
66
- .iconpicker-popover.popover.inline {
67
- margin: 0 0 12px 0;
68
- position: relative;
69
- display: inline-block;
70
- opacity: 1;
71
- top: auto;
72
- left: auto;
73
- bottom: auto;
74
- right: auto;
75
- max-width: 100%;
76
- box-shadow: none;
77
- z-index: auto;
78
- vertical-align: top;
79
- }
80
- .iconpicker-popover.popover.inline > .arrow {
81
- display: none;
82
- }
83
- .dropdown-menu .iconpicker-popover.inline {
84
- margin: 0;
85
- border: none;
86
- }
87
- .dropdown-menu.iconpicker-container {
88
- padding: 0;
89
- }
90
- .iconpicker-popover.popover .popover-title {
91
- padding: 12px;
92
- font-size: 13px;
93
- line-height: 15px;
94
- border-bottom: 1px solid #ebebeb;
95
- background-color: #f7f7f7;
96
- }
97
- .iconpicker-popover.popover .popover-title input[type=search].iconpicker-search {
98
- margin: 0 0 2px 0;
99
- }
100
- .iconpicker-popover.popover .popover-title-text ~ input[type=search].iconpicker-search {
101
- margin-top: 12px;
102
- }
103
- .iconpicker-popover.popover .popover-content {
104
- padding: 0px;
105
- text-align: center;
106
- }
107
- .iconpicker-popover .popover-footer {
108
- float: none;
109
- clear: both;
110
- padding: 12px;
111
- text-align: right;
112
- margin: 0;
113
- border-top: 1px solid #ebebeb;
114
- background-color: #f7f7f7;
115
- }
116
- .iconpicker-popover .popover-footer:before,
117
- .iconpicker-popover .popover-footer:after {
118
- content: " ";
119
- display: table;
120
- }
121
- .iconpicker-popover .popover-footer:after {
122
- clear: both;
123
- }
124
- .iconpicker-popover .popover-footer .iconpicker-btn {
125
- margin-left: 10px;
126
- }
127
- .iconpicker-popover .popover-footer input[type=search].iconpicker-search {
128
- /*width:auto;
129
- float:left;*/
130
- margin-bottom: 12px;
131
- }
132
- .iconpicker-popover.popover > .arrow,
133
- .iconpicker-popover.popover > .arrow:after {
134
- position: absolute;
135
- display: block;
136
- width: 0;
137
- height: 0;
138
- border-color: transparent;
139
- border-style: solid;
140
- }
141
- .iconpicker-popover.popover > .arrow {
142
- border-width: 11px;
143
- }
144
- .iconpicker-popover.popover > .arrow:after {
145
- border-width: 10px;
146
- content: "";
147
- }
148
- .iconpicker-popover.popover.top > .arrow,
149
- .iconpicker-popover.popover.topLeft > .arrow,
150
- .iconpicker-popover.popover.topRight > .arrow {
151
- left: 50%;
152
- margin-left: -11px;
153
- border-bottom-width: 0;
154
- border-top-color: #999999;
155
- border-top-color: rgba(0, 0, 0, 0.25);
156
- bottom: -11px;
157
- }
158
- .iconpicker-popover.popover.top > .arrow:after,
159
- .iconpicker-popover.popover.topLeft > .arrow:after,
160
- .iconpicker-popover.popover.topRight > .arrow:after {
161
- content: " ";
162
- bottom: 1px;
163
- margin-left: -10px;
164
- border-bottom-width: 0;
165
- border-top-color: #ffffff;
166
- }
167
- .iconpicker-popover.popover.topLeft > .arrow {
168
- left: 8px;
169
- margin-left: 0;
170
- }
171
- .iconpicker-popover.popover.topRight > .arrow {
172
- left: auto;
173
- right: 8px;
174
- margin-left: 0;
175
- }
176
- .iconpicker-popover.popover.right > .arrow,
177
- .iconpicker-popover.popover.rightTop > .arrow,
178
- .iconpicker-popover.popover.rightBottom > .arrow {
179
- top: 50%;
180
- left: 23px;
181
- margin-top: -11px;
182
- border-left-width: 0;
183
- border-right-color: #999999;
184
- border-right-color: rgba(0, 0, 0, 0.25);
185
- }
186
- .iconpicker-popover.popover.right > .arrow:after,
187
- .iconpicker-popover.popover.rightTop > .arrow:after,
188
- .iconpicker-popover.popover.rightBottom > .arrow:after {
189
- content: " ";
190
- left: 1px;
191
- bottom: -10px;
192
- border-left-width: 0;
193
- border-right-color: #ffffff;
194
- }
195
- .iconpicker-popover.popover.rightTop > .arrow {
196
- top: auto;
197
- bottom: 8px;
198
- margin-top: 0;
199
- }
200
- .iconpicker-popover.popover.rightBottom > .arrow {
201
- top: 8px;
202
- margin-top: 0;
203
- }
204
- .iconpicker-popover.popover.bottom > .arrow,
205
- .iconpicker-popover.popover.bottomRight > .arrow,
206
- .iconpicker-popover.popover.bottomLeft > .arrow {
207
- left: 50%;
208
- margin-left: -11px;
209
- border-top-width: 0;
210
- border-bottom-color: #999999;
211
- border-bottom-color: rgba(0, 0, 0, 0.25);
212
- top: -11px;
213
- }
214
- .iconpicker-popover.popover.bottom > .arrow:after,
215
- .iconpicker-popover.popover.bottomRight > .arrow:after,
216
- .iconpicker-popover.popover.bottomLeft > .arrow:after {
217
- content: " ";
218
- top: 1px;
219
- margin-left: -10px;
220
- border-top-width: 0;
221
- border-bottom-color: #ffffff;
222
- }
223
- .iconpicker-popover.popover.bottomLeft > .arrow {
224
- left: 8px;
225
- margin-left: 0;
226
- }
227
- .iconpicker-popover.popover.bottomRight > .arrow {
228
- left: auto;
229
- right: 8px;
230
- margin-left: 0;
231
- }
232
- .iconpicker-popover.popover.left > .arrow,
233
- .iconpicker-popover.popover.leftBottom > .arrow,
234
- .iconpicker-popover.popover.leftTop > .arrow {
235
- top: 50%;
236
- right: -11px;
237
- margin-top: -11px;
238
- border-right-width: 0;
239
- border-left-color: #999999;
240
- border-left-color: rgba(0, 0, 0, 0.25);
241
- }
242
- .iconpicker-popover.popover.left > .arrow:after,
243
- .iconpicker-popover.popover.leftBottom > .arrow:after,
244
- .iconpicker-popover.popover.leftTop > .arrow:after {
245
- content: " ";
246
- right: 1px;
247
- border-right-width: 0;
248
- border-left-color: #ffffff;
249
- bottom: -10px;
250
- }
251
- .iconpicker-popover.popover.leftBottom > .arrow {
252
- top: 8px;
253
- margin-top: 0;
254
- }
255
- .iconpicker-popover.popover.leftTop > .arrow {
256
- top: auto;
257
- bottom: 8px;
258
- margin-top: 0;
259
- }
260
- .iconpicker {
261
- position: relative;
262
- text-align: left;
263
- text-shadow: none;
264
- line-height: 0;
265
- display: block;
266
- margin: 0;
267
- overflow: hidden;
268
- }
269
- .iconpicker * {
270
- -webkit-box-sizing: content-box;
271
- -moz-box-sizing: content-box;
272
- box-sizing: content-box;
273
- position: relative;
274
- }
275
- .iconpicker:before,
276
- .iconpicker:after {
277
- content: " ";
278
- display: table;
279
- }
280
- .iconpicker:after {
281
- clear: both;
282
- }
283
- .iconpicker .iconpicker-items {
284
- position: relative;
285
- clear: both;
286
- float: none;
287
- padding: 12px 0 0 12px;
288
- background: #fff;
289
- margin: 0;
290
- overflow: hidden;
291
- overflow-y: auto;
292
- min-height: 49px;
293
- max-height: 246px;
294
- }
295
- .iconpicker .iconpicker-items:before,
296
- .iconpicker .iconpicker-items:after {
297
- content: " ";
298
- display: table;
299
- }
300
- .iconpicker .iconpicker-items:after {
301
- clear: both;
302
- }
303
- .iconpicker .iconpicker-item {
304
- float: left;
305
- width: 14px;
306
- height: 14px;
307
- padding: 12px;
308
- margin: 0 12px 12px 0;
309
- text-align: center;
310
- cursor: pointer;
311
- border-radius: 3px;
312
- font-size: 14px;
313
- box-shadow: 0 0 0 1px #dddddd;
314
- color: inherit;
315
- /*&:nth-child(4n+4) {
316
- margin-right: 0;
317
- }
318
- &:nth-last-child(-n+4) {
319
- margin-bottom: 0;
320
- }*/
321
- }
322
- .iconpicker .iconpicker-item:hover:not(.iconpicker-selected) {
323
- background-color: #eeeeee;
324
- }
325
- .iconpicker .iconpicker-item.iconpicker-selected {
326
- box-shadow: none;
327
- color: #fff;
328
- background-color: #ED832F !important;
329
- }
330
- .iconpicker-component {
331
- cursor: pointer;
332
- }
333
- a.iconpicker-selected {
334
- background: #ED832F !important;
335
  }
1
+ /*!
2
+ * Font Awesome Icon Picker
3
+ * https://itsjavi.com/fontawesome-iconpicker/
4
+ *
5
+ * Originally written by (c) 2016 Javi Aguilar
6
+ * Licensed under the MIT License
7
+ * https://github.com/itsjavi/fontawesome-iconpicker/blob/master/LICENSE
8
+ *
9
+ */
10
+ /*
11
+ * Font Awesome Icon Picker
12
+ * https://itsjavi.com/fontawesome-iconpicker/
13
+ *
14
+ * Originally written by (c) 2016 Javi Aguilar
15
+ * Licensed under the MIT License
16
+ * https://github.com/itsjavi/fontawesome-iconpicker/blob/master/LICENSE
17
+ *
18
+ */
19
+ /*
20
+ * Font Awesome Icon Picker
21
+ * https://itsjavi.com/fontawesome-iconpicker/
22
+ *
23
+ * Originally written by (c) 2016 Javi Aguilar
24
+ * Licensed under the MIT License
25
+ * https://github.com/itsjavi/fontawesome-iconpicker/blob/master/LICENSE
26
+ *
27
+ */
28
+ .iconpicker-popover.popover {
29
+ position: absolute;
30
+ top: 0;
31
+ left: 0;
32
+ display: none;
33
+ max-width: none;
34
+ padding: 1px;
35
+ text-align: left;
36
+ width: 216px;
37
+ background: #f7f7f7;
38
+ z-index: 100;
39
+ border: 1px solid #e7e7e7;
40
+ border-radius: 3px;
41
+ }
42
+ .iconpicker-popover.popover.top,
43
+ .iconpicker-popover.popover.topLeftCorner,
44
+ .iconpicker-popover.popover.topLeft,
45
+ .iconpicker-popover.popover.topRight,
46
+ .iconpicker-popover.popover.topRightCorner {
47
+ margin-top: -10px;
48
+ }
49
+ .iconpicker-popover.popover.right,
50
+ .iconpicker-popover.popover.rightTop,
51
+ .iconpicker-popover.popover.rightBottom {
52
+ margin-left: 10px;
53
+ }
54
+ .iconpicker-popover.popover.bottom,
55
+ .iconpicker-popover.popover.bottomRightCorner,
56
+ .iconpicker-popover.popover.bottomRight,
57
+ .iconpicker-popover.popover.bottomLeft,
58
+ .iconpicker-popover.popover.bottomLeftCorner {
59
+ margin-top: 10px;
60
+ }
61
+ .iconpicker-popover.popover.left,
62
+ .iconpicker-popover.popover.leftBottom,
63
+ .iconpicker-popover.popover.leftTop {
64
+ margin-left: -10px;
65
+ }
66
+ .iconpicker-popover.popover.inline {
67
+ margin: 0 0 12px 0;
68
+ position: relative;
69
+ display: inline-block;
70
+ opacity: 1;
71
+ top: auto;
72
+ left: auto;
73
+ bottom: auto;
74
+ right: auto;
75
+ max-width: 100%;
76
+ box-shadow: none;
77
+ z-index: auto;
78
+ vertical-align: top;
79
+ }
80
+ .iconpicker-popover.popover.inline > .arrow {
81
+ display: none;
82
+ }
83
+ .dropdown-menu .iconpicker-popover.inline {
84
+ margin: 0;
85
+ border: none;
86
+ }
87
+ .dropdown-menu.iconpicker-container {
88
+ padding: 0;
89
+ }
90
+ .iconpicker-popover.popover .popover-title {
91
+ padding: 12px;
92
+ font-size: 13px;
93
+ line-height: 15px;
94
+ border-bottom: 1px solid #ebebeb;
95
+ background-color: #f7f7f7;
96
+ }
97
+ .iconpicker-popover.popover .popover-title input[type=search].iconpicker-search {
98
+ margin: 0 0 2px 0;
99
+ }
100
+ .iconpicker-popover.popover .popover-title-text ~ input[type=search].iconpicker-search {
101
+ margin-top: 12px;
102
+ }
103
+ .iconpicker-popover.popover .popover-content {
104
+ padding: 0px;
105
+ text-align: center;
106
+ }
107
+ .iconpicker-popover .popover-footer {
108
+ float: none;
109
+ clear: both;
110
+ padding: 12px;
111
+ text-align: right;
112
+ margin: 0;
113
+ border-top: 1px solid #ebebeb;
114
+ background-color: #f7f7f7;
115
+ }
116
+ .iconpicker-popover .popover-footer:before,
117
+ .iconpicker-popover .popover-footer:after {
118
+ content: " ";
119
+ display: table;
120
+ }
121
+ .iconpicker-popover .popover-footer:after {
122
+ clear: both;
123
+ }
124
+ .iconpicker-popover .popover-footer .iconpicker-btn {
125
+ margin-left: 10px;
126
+ }
127
+ .iconpicker-popover .popover-footer input[type=search].iconpicker-search {
128
+ /*width:auto;
129
+ float:left;*/
130
+ margin-bottom: 12px;
131
+ }
132
+ .iconpicker-popover.popover > .arrow,
133
+ .iconpicker-popover.popover > .arrow:after {
134
+ position: absolute;
135
+ display: block;
136
+ width: 0;
137
+ height: 0;
138
+ border-color: transparent;
139
+ border-style: solid;
140
+ }
141
+ .iconpicker-popover.popover > .arrow {
142
+ border-width: 11px;
143
+ }
144
+ .iconpicker-popover.popover > .arrow:after {
145
+ border-width: 10px;
146
+ content: "";
147
+ }
148
+ .iconpicker-popover.popover.top > .arrow,
149
+ .iconpicker-popover.popover.topLeft > .arrow,
150
+ .iconpicker-popover.popover.topRight > .arrow {
151
+ left: 50%;
152
+ margin-left: -11px;
153
+ border-bottom-width: 0;
154
+ border-top-color: #999999;
155
+ border-top-color: rgba(0, 0, 0, 0.25);
156
+ bottom: -11px;
157
+ }
158
+ .iconpicker-popover.popover.top > .arrow:after,
159
+ .iconpicker-popover.popover.topLeft > .arrow:after,
160
+ .iconpicker-popover.popover.topRight > .arrow:after {
161
+ content: " ";
162
+ bottom: 1px;
163
+ margin-left: -10px;
164
+ border-bottom-width: 0;
165
+ border-top-color: #ffffff;
166
+ }
167
+ .iconpicker-popover.popover.topLeft > .arrow {
168
+ left: 8px;
169
+ margin-left: 0;
170
+ }
171
+ .iconpicker-popover.popover.topRight > .arrow {
172
+ left: auto;
173
+ right: 8px;
174
+ margin-left: 0;
175
+ }
176
+ .iconpicker-popover.popover.right > .arrow,
177
+ .iconpicker-popover.popover.rightTop > .arrow,
178
+ .iconpicker-popover.popover.rightBottom > .arrow {
179
+ top: 50%;
180
+ left: 23px;
181
+ margin-top: -11px;
182
+ border-left-width: 0;
183
+ border-right-color: #999999;
184
+ border-right-color: rgba(0, 0, 0, 0.25);
185
+ }
186
+ .iconpicker-popover.popover.right > .arrow:after,
187
+ .iconpicker-popover.popover.rightTop > .arrow:after,
188
+ .iconpicker-popover.popover.rightBottom > .arrow:after {
189
+ content: " ";
190
+ left: 1px;
191
+ bottom: -10px;
192
+ border-left-width: 0;
193
+ border-right-color: #ffffff;
194
+ }
195
+ .iconpicker-popover.popover.rightTop > .arrow {
196
+ top: auto;
197
+ bottom: 8px;
198
+ margin-top: 0;
199
+ }
200
+ .iconpicker-popover.popover.rightBottom > .arrow {
201
+ top: 8px;
202
+ margin-top: 0;
203
+ }
204
+ .iconpicker-popover.popover.bottom > .arrow,
205
+ .iconpicker-popover.popover.bottomRight > .arrow,
206
+ .iconpicker-popover.popover.bottomLeft > .arrow {
207
+ left: 50%;
208
+ margin-left: -11px;
209
+ border-top-width: 0;
210
+ border-bottom-color: #999999;
211
+ border-bottom-color: rgba(0, 0, 0, 0.25);
212
+ top: -11px;
213
+ }
214
+ .iconpicker-popover.popover.bottom > .arrow:after,
215
+ .iconpicker-popover.popover.bottomRight > .arrow:after,
216
+ .iconpicker-popover.popover.bottomLeft > .arrow:after {
217
+ content: " ";
218
+ top: 1px;
219
+ margin-left: -10px;
220
+ border-top-width: 0;
221
+ border-bottom-color: #ffffff;
222
+ }
223
+ .iconpicker-popover.popover.bottomLeft > .arrow {
224
+ left: 8px;
225
+ margin-left: 0;
226
+ }
227
+ .iconpicker-popover.popover.bottomRight > .arrow {
228
+ left: auto;
229
+ right: 8px;
230
+ margin-left: 0;
231
+ }
232
+ .iconpicker-popover.popover.left > .arrow,
233
+ .iconpicker-popover.popover.leftBottom > .arrow,
234
+ .iconpicker-popover.popover.leftTop > .arrow {
235
+ top: 50%;
236
+ right: -11px;
237
+ margin-top: -11px;
238
+ border-right-width: 0;
239
+ border-left-color: #999999;
240
+ border-left-color: rgba(0, 0, 0, 0.25);
241
+ }
242
+ .iconpicker-popover.popover.left > .arrow:after,
243
+ .iconpicker-popover.popover.leftBottom > .arrow:after,
244
+ .iconpicker-popover.popover.leftTop > .arrow:after {
245
+ content: " ";
246
+ right: 1px;
247
+ border-right-width: 0;
248
+ border-left-color: #ffffff;
249
+ bottom: -10px;
250
+ }
251
+ .iconpicker-popover.popover.leftBottom > .arrow {
252
+ top: 8px;
253
+ margin-top: 0;
254
+ }
255
+ .iconpicker-popover.popover.leftTop > .arrow {
256
+ top: auto;
257
+ bottom: 8px;
258
+ margin-top: 0;
259
+ }
260
+ .iconpicker {
261
+ position: relative;
262
+ text-align: left;
263
+ text-shadow: none;
264
+ line-height: 0;
265
+ display: block;
266
+ margin: 0;
267
+ overflow: hidden;
268
+ }
269
+ .iconpicker * {
270
+ -webkit-box-sizing: content-box;
271
+ -moz-box-sizing: content-box;
272
+ box-sizing: content-box;
273
+ position: relative;
274
+ }
275
+ .iconpicker:before,
276
+ .iconpicker:after {
277
+ content: " ";
278
+ display: table;
279
+ }
280
+ .iconpicker:after {
281
+ clear: both;
282
+ }
283
+ .iconpicker .iconpicker-items {
284
+ position: relative;
285
+ clear: both;
286
+ float: none;
287
+ padding: 12px 0 0 12px;
288
+ background: #fff;
289
+ margin: 0;
290
+ overflow: hidden;
291
+ overflow-y: auto;
292
+ min-height: 49px;
293
+ max-height: 246px;
294
+ }
295
+ .iconpicker .iconpicker-items:before,
296
+ .iconpicker .iconpicker-items:after {
297
+ content: " ";
298
+ display: table;
299
+ }
300
+ .iconpicker .iconpicker-items:after {
301
+ clear: both;
302
+ }
303
+ .iconpicker .iconpicker-item {
304
+ float: left;
305
+ width: 14px;
306
+ height: 14px;
307
+ padding: 12px;
308
+ margin: 0 12px 12px 0;
309
+ text-align: center;
310
+ cursor: pointer;
311
+ border-radius: 3px;
312
+ font-size: 14px;
313
+ box-shadow: 0 0 0 1px #dddddd;
314
+ color: inherit;
315
+ /*&:nth-child(4n+4) {
316
+ margin-right: 0;
317
+ }
318
+ &:nth-last-child(-n+4) {
319
+ margin-bottom: 0;
320
+ }*/
321
+ }
322
+ .iconpicker .iconpicker-item:hover:not(.iconpicker-selected) {
323
+ background-color: #eeeeee;
324
+ }
325
+ .iconpicker .iconpicker-item.iconpicker-selected {
326
+ box-shadow: none;
327
+ color: #fff;
328
+ background-color: #ED832F !important;
329
+ }
330
+ .iconpicker-component {
331
+ cursor: pointer;
332
+ }
333
+ a.iconpicker-selected {
334
+ background: #ED832F !important;
335
  }
css/remote_dash_styles.css CHANGED
@@ -357,6 +357,10 @@ span.bleeper-edit-message {
357
  width:60% !important;
358
  }
359
 
 
 
 
 
360
  .admin_visitor_advanced_info {
361
  border: 1px solid #ccc;
362
  border-radius: 3px;
@@ -1252,3 +1256,9 @@ span.wplc_system_notification {
1252
  color: #fff !important;
1253
  text-decoration: underline !important;
1254
  }
 
 
 
 
 
 
357
  width:60% !important;
358
  }
359
 
360
+ .nifty_top_wrapper.bleeper-out-dash .wrap {
361
+ z-index: 9999 !important;
362
+ }
363
+
364
  .admin_visitor_advanced_info {
365
  border: 1px solid #ccc;
366
  border-radius: 3px;
1256
  color: #fff !important;
1257
  text-decoration: underline !important;
1258
  }
1259
+
1260
+ #nifty_wrapper .messages .wplc_system_notification .admin_visitor_advanced_info {
1261
+ background: none !important;
1262
+ border:none !important;
1263
+ padding: 0 !important;
1264
+ }
css/wplc_gif_integration.css CHANGED
@@ -1,364 +1,364 @@
1
- /**
2
- * GIF image style within a message
3
- */
4
- .messageBody .gif-img {
5
- max-width: 100%;
6
- margin-bottom: -5px;
7
- }
8
-
9
- /**
10
- * GIF Search box
11
- */
12
- /* Loader */
13
- .wplc-gif-integration-search-box .gif-sb-loader {
14
- display:block;
15
- position: absolute;
16
- left:0px;
17
- top:0px;
18
- width: 100%;
19
- height: 100%;
20
- z-index: 1;
21
- background-color:#ffffff;
22
- }
23
- .wplc-gif-integration-search-box .gif-sb-loader.hidden {
24
- display: none;
25
- z-index: 0;
26
- }
27
- .wplc-gif-integration-search-box .gif-sb-loader img {
28
- display: block;
29
- position: relative;
30
- top: calc(50% - 25px);
31
- width: 50px;
32
- height: auto;
33
- margin: auto;
34
- }
35
-
36
- /* Outter container */
37
- .wplc-gif-integration-search-box.show,
38
- .wplc-gif-integration-search-box {
39
- display: block;
40
- position: absolute;
41
- bottom: 66px;
42
- width: 70%;
43
- margin-left:15%;
44
- height: 300px;
45
- background: #fafafa;
46
- z-index: 100000000;
47
- box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
48
- transition: all 0.3s cubic-bezier(.25,.8,.25,1);
49
- }
50
- .wplc-gif-integration-search-box.show {
51
- animation-name: present-gif-search-box;
52
- animation-duration: 500ms;
53
- animation-timing-function: ease-in-out;
54
- animation-fill-mode: forwards;
55
-
56
- -webkit-animation-name: present-gif-search-box;
57
- -webkit-animation-duration: 500ms;
58
- -webkit-animation-timing-function: ease-in-out;
59
- -webkit-animation-fill-mode: forwards;
60
-
61
- -moz-animation-name: present-gif-search-box;
62
- -moz-animation-duration: 500ms;
63
- -moz-animation-timing-function: ease-in-out;
64
- -moz-animation-fill-mode: forwards;
65
-
66
- -ms-animation-name: present-gif-search-box;
67
- -ms-animation-duration: 500ms;
68
- -ms-animation-timing-function: ease-in-out;
69
- -ms-animation-fill-mode: forwards;
70
- }
71
- .wplc-gif-integration-search-box {
72
- animation-name: dismiss-gif-search-box;
73
- animation-duration: 500ms;
74
- animation-timing-function: ease-in-out;
75
- animation-fill-mode: forwards;
76
-
77
- -webkit-animation-name: dismiss-gif-search-box;
78
- -webkit-animation-duration: 500ms;
79
- -webkit-animation-timing-function: ease-in-out;
80
- -webkit-animation-fill-mode: forwards;
81
-
82
- -moz-animation-name: dismiss-gif-search-box;
83
- -moz-animation-duration: 500ms;
84
- -moz-animation-timing-function: ease-in-out;
85
- -moz-animation-fill-mode: forwards;
86
-
87
- -ms-animation-name: dismiss-gif-search-box;
88
- -ms-animation-duration: 500ms;
89
- -ms-animation-timing-function: ease-in-out;
90
- -ms-animation-fill-mode: forwards;
91
- }
92
- .wplc-gif-integration-search-box.hidden {
93
- display: none;
94
- }
95
-
96
- /**
97
- * Present full screen msg
98
- */
99
- @keyframes present-gif-search-box {
100
- 0% {
101
- left: 5000px;
102
- }
103
- 100% {
104
- left: 0px;
105
- }
106
- }
107
- @-moz-keyframes present-gif-search-box {
108
- 0% {
109
- left: 5000px;
110
- }
111
- 100% {
112
- left: 0px;
113
- }
114
- }
115
- @-webkit-keyframes present-gif-search-box {
116
- 0% {
117
- left: 5000px;
118
- }
119
- 100% {
120
- left: 0px;
121
- }
122
- }
123
-
124
- /**
125
- * Dismiss full screen msg
126
- */
127
- @keyframes dismiss-gif-search-box {
128
- 0% {
129
- left: 0px;
130
- }
131
- 100% {
132
- left: 5000px;
133
- }
134
- }
135
- @-moz-keyframes dismiss-gif-search-box {
136
- 0% {
137
- left: 0px;
138
- }
139
- 100% {
140
- left: 5000px;
141
- }
142
- }
143
- @-webkit-keyframes dismiss-gif-search-box {
144
- 0% {
145
- left: 0px;
146
- }
147
- 100% {
148
- left: 5000px;
149
- }
150
- }
151
-
152
- @media(max-width:767px) {
153
-
154
- .wplc-gif-integration-search-box.show,
155
- .wplc-gif-integration-search-box {
156
- bottom: 75px;
157
- }
158
-
159
- }
160
-
161
- /* Header, Body and Footer */
162
- .wplc-gif-integration-search-box .gif-sb-header,
163
- .wplc-gif-integration-search-box .gif-sb-body,
164
- .wplc-gif-integration-search-box .gif-sb-footer {
165
- display: block;
166
- position: relative;
167
- left: 0px;
168
- top: 0px;
169
- width: 100%;
170
- height: auto;
171
- padding: 10px;
172
- padding-top: 5px;
173
- padding-bottom: 5px;
174
- }
175
-
176
- /* Header */
177
- .wplc-gif-integration-search-box .gif-sb-header {
178
- min-height: 10%;
179
- background-color:#ffffff;
180
- border: 1px solid #e6e6e6;
181
- }
182
- .wplc-gif-integration-search-box .gif-sb-header .gif-sb-search-term,
183
- .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search, {
184
- display: inline-block;
185
- position: relative;
186
- left: 0px;
187
- margin: 0px;
188
- border-bottom: 1px solid #f0f0f0 !important;
189
- background-color: transparent !important;
190
- border-right: none;
191
- }
192
- .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search i,
193
- .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close i,
194
- .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search:hover i,
195
- .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close:hover i {
196
- display: block;
197
- position: relative;
198
- left: 0px;
199
- font-style: initial;
200
- color:#ccc;
201
- }
202
-
203
- .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close {
204
- position: absolute;
205
- top: 3px;
206
- right: 4px;
207
-
208
- border: none !important;
209
- }
210
-
211
- .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search,
212
- .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close,
213
- .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search:hover,
214
- .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close:hover {
215
- text-decoration: none !important;
216
- }
217
-
218
- .wplc-gif-integration-search-box .gif-sb-header .gif-sb-search-term {
219
- top: -1px;
220
- width: 95%;
221
- height: 38px;
222
- margin-bottom: 0px !important;
223
- padding-left: 10px !important;
224
- padding-right: 10px !important;
225
- background-color:transparent !important;
226
- border-bottom:1px solid #eee !important;
227
- border-top: none;
228
- border-left: none;
229
- border-right: none;
230
- }
231
-
232
- .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search,
233
- .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search:hover {
234
- top: 0px;
235
- left: 1px;
236
- width: 10%;
237
- height: 40px;
238
- text-align: center;
239
- padding-top: 10px;
240
- border-radius: 3px;
241
-
242
- }
243
-
244
-
245
- .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search i,
246
- .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search:hover i {
247
- top:0px;
248
- left:-1px;
249
- font-weight: 600;
250
- }
251
-
252
- .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close {
253
- color: #999999 !important;
254
- cursor: pointer;
255
- }
256
- .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close:hover {
257
- background-color: #ffffff;
258
- color: #333333 !important;
259
- }
260
- .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close i,
261
- .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close:hover i {
262
- top: -3px;
263
- font-weight: 500;
264
- }
265
-
266
- /* Body */
267
- .wplc-gif-integration-search-box .gif-sb-body {
268
- min-height: 65%;
269
- max-height: 195px;
270
- background-color: #f0f0f0;
271
- border: 1px solid #eaeaea;
272
- overflow: auto;
273
- }
274
- .wplc-gif-integration-search-box .gif-sb-body .gif-img,
275
- .wplc-gif-integration-search-box .gif-sb-body .gif-img:hover,
276
- .wplc-gif-integration-search-box .gif-sb-body .gif-img.selected-gif {
277
- display:inline-block;
278
- position:relative;
279
- left:0px;
280
- top:0px;
281
- min-height:70px;
282
- min-height:70px;
283
- width: auto;
284
- max-width: 100px;
285
- margin-left: 2px;
286
- margin-right: 2px;
287
- margin-bottom: 1px;
288
- }
289
- .wplc-gif-integration-search-box .gif-sb-body .gif-img {
290
- opacity:0.7;
291
- }
292
- .wplc-gif-integration-search-box .gif-sb-body .gif-img:hover {
293
- opacity:1;
294
- }
295
- .wplc-gif-integration-search-box .gif-sb-body .gif-img.selected-gif {
296
- min-height:100px;
297
- opacity:1;
298
- }
299
-
300
- @media(max-width:767px) {
301
- .wplc-gif-integration-search-box .gif-sb-body .gif-img {
302
- width:50%;
303
- }
304
- }
305
-
306
- @media(max-width:900px) {
307
- .wplc-gif-integration-search-box .gif-sb-body .gif-img {
308
- width:33%;
309
- }
310
- }
311
-
312
- @media(max-width:1200px) {
313
- .wplc-gif-integration-search-box .gif-sb-body .gif-img {
314
- width:20%;
315
- }
316
- }
317
-
318
- /* Footer */
319
- .wplc-gif-integration-search-box .gif-sb-footer {
320
- min-height: 10%;
321
- background-color: #fafafa;
322
- border: 1px solid #eaeaea;
323
- font-size: 0.9em;
324
- color: #777777;
325
- }
326
-
327
- /**
328
- * Adjustments of the base style made for the admin chat
329
- */
330
- /**
331
- * GIF image style within a message
332
- */
333
- #chat_area .messageBody .gif-img {
334
- max-width: 100%;
335
- margin-bottom: 0px;
336
- }
337
-
338
- /* Header */
339
- #chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-search-term {
340
- top:1px;
341
- }
342
- #chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search,
343
- #chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search:hover {
344
-
345
- padding-top: 9px;
346
- }
347
- #chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close,
348
- #chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close:hover {
349
- top: 2px;
350
- height: 38px;
351
- }
352
- #chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close i,
353
- #chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close:hover i {
354
- top: 0px;
355
- }
356
- #chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search i,
357
- #chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search:hover i {
358
- top: 1px;
359
- }
360
-
361
- /* Body */
362
- #chat_area .wplc-gif-integration-search-box .gif-sb-body {
363
- min-height: 73%;
364
  }
1
+ /**
2
+ * GIF image style within a message
3
+ */
4
+ .messageBody .gif-img {
5
+ max-width: 100%;
6
+ margin-bottom: -5px;
7
+ }
8
+
9
+ /**
10
+ * GIF Search box
11
+ */
12
+ /* Loader */
13
+ .wplc-gif-integration-search-box .gif-sb-loader {
14
+ display:block;
15
+ position: absolute;
16
+ left:0px;
17
+ top:0px;
18
+ width: 100%;
19
+ height: 100%;
20
+ z-index: 1;
21
+ background-color:#ffffff;
22
+ }
23
+ .wplc-gif-integration-search-box .gif-sb-loader.hidden {
24
+ display: none;
25
+ z-index: 0;
26
+ }
27
+ .wplc-gif-integration-search-box .gif-sb-loader img {
28
+ display: block;
29
+ position: relative;
30
+ top: calc(50% - 25px);
31
+ width: 50px;
32
+ height: auto;
33
+ margin: auto;
34
+ }
35
+
36
+ /* Outter container */
37
+ .wplc-gif-integration-search-box.show,
38
+ .wplc-gif-integration-search-box {
39
+ display: block;
40
+ position: absolute;
41
+ bottom: 66px;
42
+ width: 70%;
43
+ margin-left:15%;
44
+ height: 300px;
45
+ background: #fafafa;
46
+ z-index: 100000000;
47
+ box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
48
+ transition: all 0.3s cubic-bezier(.25,.8,.25,1);
49
+ }
50
+ .wplc-gif-integration-search-box.show {
51
+ animation-name: present-gif-search-box;
52
+ animation-duration: 500ms;
53
+ animation-timing-function: ease-in-out;
54
+ animation-fill-mode: forwards;
55
+
56
+ -webkit-animation-name: present-gif-search-box;
57
+ -webkit-animation-duration: 500ms;
58
+ -webkit-animation-timing-function: ease-in-out;
59
+ -webkit-animation-fill-mode: forwards;
60
+
61
+ -moz-animation-name: present-gif-search-box;
62
+ -moz-animation-duration: 500ms;
63
+ -moz-animation-timing-function: ease-in-out;
64
+ -moz-animation-fill-mode: forwards;
65
+
66
+ -ms-animation-name: present-gif-search-box;
67
+ -ms-animation-duration: 500ms;
68
+ -ms-animation-timing-function: ease-in-out;
69
+ -ms-animation-fill-mode: forwards;
70
+ }
71
+ .wplc-gif-integration-search-box {
72
+ animation-name: dismiss-gif-search-box;
73
+ animation-duration: 500ms;
74
+ animation-timing-function: ease-in-out;
75
+ animation-fill-mode: forwards;
76
+
77
+ -webkit-animation-name: dismiss-gif-search-box;
78
+ -webkit-animation-duration: 500ms;
79
+ -webkit-animation-timing-function: ease-in-out;
80
+ -webkit-animation-fill-mode: forwards;
81
+
82
+ -moz-animation-name: dismiss-gif-search-box;
83
+ -moz-animation-duration: 500ms;
84
+ -moz-animation-timing-function: ease-in-out;
85
+ -moz-animation-fill-mode: forwards;
86
+
87
+ -ms-animation-name: dismiss-gif-search-box;
88
+ -ms-animation-duration: 500ms;
89
+ -ms-animation-timing-function: ease-in-out;
90
+ -ms-animation-fill-mode: forwards;
91
+ }
92
+ .wplc-gif-integration-search-box.hidden {
93
+ display: none;
94
+ }
95
+
96
+ /**
97
+ * Present full screen msg
98
+ */
99
+ @keyframes present-gif-search-box {
100
+ 0% {
101
+ left: 5000px;
102
+ }
103
+ 100% {
104
+ left: 0px;
105
+ }
106
+ }
107
+ @-moz-keyframes present-gif-search-box {
108
+ 0% {
109
+ left: 5000px;
110
+ }
111
+ 100% {
112
+ left: 0px;
113
+ }
114
+ }
115
+ @-webkit-keyframes present-gif-search-box {
116
+ 0% {
117
+ left: 5000px;
118
+ }
119
+ 100% {
120
+ left: 0px;
121
+ }
122
+ }
123
+
124
+ /**
125
+ * Dismiss full screen msg
126
+ */
127
+ @keyframes dismiss-gif-search-box {
128
+ 0% {
129
+ left: 0px;
130
+ }
131
+ 100% {
132
+ left: 5000px;
133
+ }
134
+ }
135
+ @-moz-keyframes dismiss-gif-search-box {
136
+ 0% {
137
+ left: 0px;
138
+ }
139
+ 100% {
140
+ left: 5000px;
141
+ }
142
+ }
143
+ @-webkit-keyframes dismiss-gif-search-box {
144
+ 0% {
145
+ left: 0px;
146
+ }
147
+ 100% {
148
+ left: 5000px;
149
+ }
150
+ }
151
+
152
+ @media(max-width:767px) {
153
+
154
+ .wplc-gif-integration-search-box.show,
155
+ .wplc-gif-integration-search-box {
156
+ bottom: 75px;
157
+ }
158
+
159
+ }
160
+
161
+ /* Header, Body and Footer */
162
+ .wplc-gif-integration-search-box .gif-sb-header,
163
+ .wplc-gif-integration-search-box .gif-sb-body,
164
+ .wplc-gif-integration-search-box .gif-sb-footer {
165
+ display: block;
166
+ position: relative;
167
+ left: 0px;
168
+ top: 0px;
169
+ width: 100%;
170
+ height: auto;
171
+ padding: 10px;
172
+ padding-top: 5px;
173
+ padding-bottom: 5px;
174
+ }
175
+
176
+ /* Header */
177
+ .wplc-gif-integration-search-box .gif-sb-header {
178
+ min-height: 10%;
179
+ background-color:#ffffff;
180
+ border: 1px solid #e6e6e6;
181
+ }
182
+ .wplc-gif-integration-search-box .gif-sb-header .gif-sb-search-term,
183
+ .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search, {
184
+ display: inline-block;
185
+ position: relative;
186
+ left: 0px;
187
+ margin: 0px;
188
+ border-bottom: 1px solid #f0f0f0 !important;
189
+ background-color: transparent !important;
190
+ border-right: none;
191
+ }
192
+ .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search i,
193
+ .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close i,
194
+ .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search:hover i,
195
+ .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close:hover i {
196
+ display: block;
197
+ position: relative;
198
+ left: 0px;
199
+ font-style: initial;
200
+ color:#ccc;
201
+ }
202
+
203
+ .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close {
204
+ position: absolute;
205
+ top: 3px;
206
+ right: 4px;
207
+
208
+ border: none !important;
209
+ }
210
+
211
+ .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search,
212
+ .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close,
213
+ .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search:hover,
214
+ .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close:hover {
215
+ text-decoration: none !important;
216
+ }
217
+
218
+ .wplc-gif-integration-search-box .gif-sb-header .gif-sb-search-term {
219
+ top: -1px;
220
+ width: 95%;
221
+ height: 38px;
222
+ margin-bottom: 0px !important;
223
+ padding-left: 10px !important;
224
+ padding-right: 10px !important;
225
+ background-color:transparent !important;
226
+ border-bottom:1px solid #eee !important;
227
+ border-top: none;
228
+ border-left: none;
229
+ border-right: none;
230
+ }
231
+
232
+ .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search,
233
+ .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search:hover {
234
+ top: 0px;
235
+ left: 1px;
236
+ width: 10%;
237
+ height: 40px;
238
+ text-align: center;
239
+ padding-top: 10px;
240
+ border-radius: 3px;
241
+
242
+ }
243
+
244
+
245
+ .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search i,
246
+ .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search:hover i {
247
+ top:0px;
248
+ left:-1px;
249
+ font-weight: 600;
250
+ }
251
+
252
+ .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close {
253
+ color: #999999 !important;
254
+ cursor: pointer;
255
+ }
256
+ .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close:hover {
257
+ background-color: #ffffff;
258
+ color: #333333 !important;
259
+ }
260
+ .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close i,
261
+ .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close:hover i {
262
+ top: -3px;
263
+ font-weight: 500;
264
+ }
265
+
266
+ /* Body */
267
+ .wplc-gif-integration-search-box .gif-sb-body {
268
+ min-height: 65%;
269
+ max-height: 195px;
270
+ background-color: #f0f0f0;
271
+ border: 1px solid #eaeaea;
272
+ overflow: auto;
273
+ }
274
+ .wplc-gif-integration-search-box .gif-sb-body .gif-img,
275
+ .wplc-gif-integration-search-box .gif-sb-body .gif-img:hover,
276
+ .wplc-gif-integration-search-box .gif-sb-body .gif-img.selected-gif {
277
+ display:inline-block;
278
+ position:relative;
279
+ left:0px;
280
+ top:0px;
281
+ min-height:70px;
282
+ min-height:70px;
283
+ width: auto;
284
+ max-width: 100px;
285
+ margin-left: 2px;
286
+ margin-right: 2px;
287
+ margin-bottom: 1px;
288
+ }
289
+ .wplc-gif-integration-search-box .gif-sb-body .gif-img {
290
+ opacity:0.7;
291
+ }
292
+ .wplc-gif-integration-search-box .gif-sb-body .gif-img:hover {
293
+ opacity:1;
294
+ }
295
+ .wplc-gif-integration-search-box .gif-sb-body .gif-img.selected-gif {
296
+ min-height:100px;
297
+ opacity:1;
298
+ }
299
+
300
+ @media(max-width:767px) {
301
+ .wplc-gif-integration-search-box .gif-sb-body .gif-img {
302
+ width:50%;
303
+ }
304
+ }
305
+
306
+ @media(max-width:900px) {
307
+ .wplc-gif-integration-search-box .gif-sb-body .gif-img {
308
+ width:33%;
309
+ }
310
+ }
311
+
312
+ @media(max-width:1200px) {
313
+ .wplc-gif-integration-search-box .gif-sb-body .gif-img {
314
+ width:20%;
315
+ }
316
+ }
317
+
318
+ /* Footer */
319
+ .wplc-gif-integration-search-box .gif-sb-footer {
320
+ min-height: 10%;
321
+ background-color: #fafafa;
322
+ border: 1px solid #eaeaea;
323
+ font-size: 0.9em;
324
+ color: #777777;
325
+ }
326
+
327
+ /**
328
+ * Adjustments of the base style made for the admin chat
329
+ */
330
+ /**
331
+ * GIF image style within a message
332
+ */
333
+ #chat_area .messageBody .gif-img {
334
+ max-width: 100%;
335
+ margin-bottom: 0px;
336
+ }
337
+
338
+ /* Header */
339
+ #chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-search-term {
340
+ top:1px;
341
+ }
342
+ #chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search,
343
+ #chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search:hover {
344
+
345
+ padding-top: 9px;
346
+ }
347
+ #chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close,
348
+ #chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close:hover {
349
+ top: 2px;
350
+ height: 38px;
351
+ }
352
+ #chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close i,
353
+ #chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close:hover i {
354
+ top: 0px;
355
+ }
356
+ #chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search i,
357
+ #chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search:hover i {
358
+ top: 1px;
359
+ }
360
+
361
+ /* Body */
362
+ #chat_area .wplc-gif-integration-search-box .gif-sb-body {
363
+ min-height: 73%;
364
  }
css/wplc_gutenberg_template_styles.css CHANGED
@@ -1,217 +1,217 @@
1
- /* WPLC Gutenber Template Styles */
2
- /* Custom Templates: Default - Light */
3
- .wplc_block.light {
4
- background: #ECEFF1;
5
- color: #555;
6
- border: 1px solid #ccc;
7
- }
8
-
9
- /* Custom Templates: Circle */
10
- .wplc_block.circle {
11
- background: transparent;
12
- width: 50px;
13
- height: 50px;
14
- padding: 0;
15
- position: relative;
16
- }
17
-
18
- .wplc_block.circle:after {
19
- display: none;
20
- }
21
-
22
- .wplc_block.circle .wplc_block_logo {
23
- position: relative;
24
- width: 50px;
25
- height: 50px;
26
- padding: 0;
27
- border-radius: 50%;
28
- }
29
-
30
- .wplc_block.sm.circle {
31
- background: transparent;
32
- width: 35px;
33
- height: 35px;
34
- padding: 0;
35
- }
36
-
37
- .wplc_block.sm.circle:after {
38
- display: none;
39
- }
40
-
41
- .wplc_block.sm.circle .wplc_block_logo {
42
- position: relative;
43
- width: 35px;
44
- height: 35px;
45
- padding: 0;
46
- border-radius: 50%;
47
- }
48
-
49
- .wplc_block.lg.circle {
50
- background: transparent;
51
- width: 65px;
52
- height: 65px;
53
- padding: 0;
54
- }
55
-
56
- .wplc_block.lg.circle:after {
57
- display: none;
58
- }
59
-
60
- .wplc_block.lg.circle .wplc_block_logo {
61
- position: relative;
62
- width: 65px;
63
- height: 65px;
64
- padding: 0;
65
- border-radius: 50%;
66
- }
67
-
68
- /* Custom Templates: Tooltip */
69
- .wplc_block:hover .wplc_block_tooltip {
70
- top: -62px;
71
- background: #333;
72
- color: #fff;
73
- opacity: .85;
74
- display: inline-block;
75
- }
76
-
77
- .wplc_block_tooltip {
78
- min-width: 100px;
79
- border-radius: 3px;
80
- color: transparent;
81
- position: absolute;
82
- line-height: 25px;
83
- padding: 10px;
84
- top: -50px;
85
- left: 0;
86
- opacity: 0;
87
- transition: opacity .2s ease-in-out, top .2s ease-in-out;
88
- }
89
-
90
- .wplc_block.circle:hover .wplc_block_tooltip {
91
- top: -75px;
92
- display: block;
93
- }
94
- .wplc_block.circle.sm:hover .wplc_block_tooltip {
95
- top: -50px;
96
- }
97
-
98
- .wplc_block.circle.lg:hover .wplc_block_tooltip {
99
- top: -100px;
100
- }
101
-
102
- /* Custom Templates: Chat Bubble */
103
- .wplc_block.chat_bubble:before {
104
- content: '';
105
- position: absolute;
106
- width: 0;
107
- height: 0;
108
- left: 0px;
109
- bottom: -10px;
110
- border: 8px solid;
111
- border-color: #32373c transparent transparent #32373c;
112
- }
113
-
114
- .wplc_block.chat_bubble:hover:after {
115
- content: '';
116
- position: absolute;
117
- width: 0;
118
- height: 0;
119
- }
120
-
121
- .wplc_block.chat_bubble {
122
- padding-left: 10px;
123
- padding-right: 40px;
124
- border-radius: 7px 7px 7px 0;
125
- }
126
-
127
- .wplc_block.chat_bubble .wplc_block_logo {
128
- border:none;
129
- right: 0px;
130
- left: initial;
131
- border-radius: 0 7px 7px 0;
132
- }
133
-
134
- .wplc_block.chat_bubble.sm {
135
- padding-left: 10px;
136
- padding-right: 25px;
137
- }
138
-
139
- .wplc_block.chat_bubble.lg {
140
- padding-left: 20px;
141
- padding-right: 80px;
142
- }
143
-
144
- /* Custom Templates: Rotating circle */
145
- .wplc_block.rotate {
146
- transform:rotate(0deg);
147
- }
148
-
149
- .wplc_block.rotate:hover {
150
- transition: all .3s ease-in-out;
151
- transform:rotate(-90deg);
152
- }
153
-
154
- .wplc_block.rotate .wplc_block_icon {
155
- position: relative;
156
- height: 100%;
157
- width: 100%;
158
- text-align: center;
159
- font-size: 30px;
160
- transform: rotate(90deg);
161
- line-height: 150%;
162
- }
163
-
164
- .wplc_block.rotate .wplc_block_logo {
165
- z-index: 10;
166
- position: absolute;
167
- }
168
- .wplc_block.rotate {
169
- border-radius: 50%;
170
- background: #32373c;
171
- }
172
-
173
- .wplc_block.rotate .wplc_block_logo:hover {
174
- opacity: 0;
175
- }
176
-
177
- .wplc_block.circle.rotate.lg .wplc_block_logo {
178
- padding: 0;
179
- margin: 0;
180
- position:absolute;
181
- }
182
-
183
- .wplc_block.circle.rotate.lg {
184
- background: #32373c;
185
- }
186
-
187
- .wplc_block.rotate.lg .wplc_block_icon {
188
- position: relative;
189
- height: 100%;
190
- width: 100%;
191
- text-align: center;
192
- font-size: 30px;
193
- transform: rotate(90deg);
194
- line-height: 225%;
195
- padding-right: 10px;
196
- }
197
-
198
- .wplc_block.circle.rotate.sm .wplc_block_logo {
199
- padding: 0;
200
- margin: 0;
201
- position:absolute;
202
- }
203
-
204
- .wplc_block.circle.rotate.sm {
205
- background: #32373c;
206
- }
207
-
208
- .wplc_block.rotate.sm .wplc_block_icon {
209
- position: relative;
210
- height: 100%;
211
- width: 100%;
212
- text-align: center;
213
- font-size: 20px;
214
- transform: rotate(90deg);
215
- line-height: 100%;
216
- right:5px;
217
  }
1
+ /* WPLC Gutenber Template Styles */
2
+ /* Custom Templates: Default - Light */
3
+ .wplc_block.light {
4
+ background: #ECEFF1;
5
+ color: #555;
6
+ border: 1px solid #ccc;
7
+ }
8
+
9
+ /* Custom Templates: Circle */
10
+ .wplc_block.circle {
11
+ background: transparent;
12
+ width: 50px;
13
+ height: 50px;
14
+ padding: 0;
15
+ position: relative;
16
+ }
17
+
18
+ .wplc_block.circle:after {
19
+ display: none;
20
+ }
21
+
22
+ .wplc_block.circle .wplc_block_logo {
23
+ position: relative;
24
+ width: 50px;
25
+ height: 50px;
26
+ padding: 0;
27
+ border-radius: 50%;
28
+ }
29
+
30
+ .wplc_block.sm.circle {
31
+ background: transparent;
32
+ width: 35px;
33
+ height: 35px;
34
+ padding: 0;
35
+ }
36
+
37
+ .wplc_block.sm.circle:after {
38
+ display: none;
39
+ }
40
+
41
+ .wplc_block.sm.circle .wplc_block_logo {
42
+ position: relative;
43
+ width: 35px;
44
+ height: 35px;
45
+ padding: 0;
46
+ border-radius: 50%;
47
+ }
48
+
49
+ .wplc_block.lg.circle {
50
+ background: transparent;
51
+ width: 65px;
52
+ height: 65px;
53
+ padding: 0;
54
+ }
55
+
56
+ .wplc_block.lg.circle:after {
57
+ display: none;
58
+ }
59
+
60
+ .wplc_block.lg.circle .wplc_block_logo {
61
+ position: relative;
62
+ width: 65px;
63
+ height: 65px;
64
+ padding: 0;
65
+ border-radius: 50%;
66
+ }
67
+
68
+ /* Custom Templates: Tooltip */
69
+ .wplc_block:hover .wplc_block_tooltip {
70
+ top: -62px;
71
+ background: #333;
72
+ color: #fff;
73
+ opacity: .85;
74
+ display: inline-block;
75
+ }
76
+
77
+ .wplc_block_tooltip {
78
+ min-width: 100px;
79
+ border-radius: 3px;
80
+ color: transparent;
81
+ position: absolute;
82
+ line-height: 25px;
83
+ padding: 10px;
84
+ top: -50px;
85
+ left: 0;
86
+ opacity: 0;
87
+ transition: opacity .2s ease-in-out, top .2s ease-in-out;
88
+ }
89
+
90
+ .wplc_block.circle:hover .wplc_block_tooltip {
91
+ top: -75px;
92
+ display: block;
93
+ }
94
+ .wplc_block.circle.sm:hover .wplc_block_tooltip {
95
+ top: -50px;
96
+ }
97
+
98
+ .wplc_block.circle.lg:hover .wplc_block_tooltip {
99
+ top: -100px;
100
+ }
101
+
102
+ /* Custom Templates: Chat Bubble */
103
+ .wplc_block.chat_bubble:before {
104
+ content: '';
105
+ position: absolute;
106
+ width: 0;
107
+ height: 0;
108
+ left: 0px;
109
+ bottom: -10px;
110
+ border: 8px solid;
111
+ border-color: #32373c transparent transparent #32373c;
112
+ }
113
+
114
+ .wplc_block.chat_bubble:hover:after {
115
+ content: '';
116
+ position: absolute;
117
+ width: 0;
118
+ height: 0;
119
+ }
120
+
121
+ .wplc_block.chat_bubble {
122
+ padding-left: 10px;
123
+ padding-right: 40px;
124
+ border-radius: 7px 7px 7px 0;
125
+ }
126
+
127
+ .wplc_block.chat_bubble .wplc_block_logo {
128
+ border:none;
129
+ right: 0px;
130
+ left: initial;
131
+ border-radius: 0 7px 7px 0;
132
+ }
133
+
134
+ .wplc_block.chat_bubble.sm {
135
+ padding-left: 10px;
136
+ padding-right: 25px;
137
+ }
138
+
139
+ .wplc_block.chat_bubble.lg {
140
+ padding-left: 20px;
141
+ padding-right: 80px;
142
+ }
143
+
144
+ /* Custom Templates: Rotating circle */
145
+ .wplc_block.rotate {
146
+ transform:rotate(0deg);
147
+ }
148
+
149
+ .wplc_block.rotate:hover {
150
+ transition: all .3s ease-in-out;
151
+ transform:rotate(-90deg);
152
+ }
153
+
154
+ .wplc_block.rotate .wplc_block_icon {
155
+ position: relative;
156
+ height: 100%;
157
+ width: 100%;
158
+ text-align: center;
159
+ font-size: 30px;
160
+ transform: rotate(90deg);
161
+ line-height: 150%;
162
+ }
163
+
164
+ .wplc_block.rotate .wplc_block_logo {
165
+ z-index: 10;
166
+ position: absolute;
167
+ }
168
+ .wplc_block.rotate {
169
+ border-radius: 50%;
170
+ background: #32373c;
171
+ }
172
+
173
+ .wplc_block.rotate .wplc_block_logo:hover {
174
+ opacity: 0;
175
+ }
176
+
177
+ .wplc_block.circle.rotate.lg .wplc_block_logo {
178
+ padding: 0;
179
+ margin: 0;
180
+ position:absolute;
181
+ }
182
+
183
+ .wplc_block.circle.rotate.lg {
184
+ background: #32373c;
185
+ }
186
+
187
+ .wplc_block.rotate.lg .wplc_block_icon {
188
+ position: relative;
189
+ height: 100%;
190
+ width: 100%;
191
+ text-align: center;
192
+ font-size: 30px;
193
+ transform: rotate(90deg);
194
+ line-height: 225%;
195
+ padding-right: 10px;
196
+ }
197
+
198
+ .wplc_block.circle.rotate.sm .wplc_block_logo {
199
+ padding: 0;
200
+ margin: 0;
201
+ position:absolute;
202
+ }
203
+
204
+ .wplc_block.circle.rotate.sm {
205
+ background: #32373c;
206
+ }
207
+
208
+ .wplc_block.rotate.sm .wplc_block_icon {
209
+ position: relative;
210
+ height: 100%;
211
+ width: 100%;
212
+ text-align: center;
213
+ font-size: 20px;
214
+ transform: rotate(90deg);
215
+ line-height: 100%;
216
+ right:5px;
217
  }
css/wplcstyle.css CHANGED
@@ -1,242 +1,250 @@
1
-
2
-
3
-
4
- .wplc-chat-alert {
5
- display: none;
6
- width: 30px;
7
- height: 30px;
8
- position: absolute;
9
- top: -10px;
10
- right: -10px;
11
- background-color: #666;
12
- border-radius: 15px;
13
- }
14
-
15
- .wplc-chat-alert--theme-3 {
16
- background-color: #5a0031;
17
- }
18
-
19
- .wplc-chat-alert.is-active {
20
- display: inline-block;
21
- }
22
-
23
- .wplc-chat-alert:after {
24
- content: '\f0a2';
25
- position: absolute;
26
- left: 7px;
27
- font-family: FontAwesome;
28
- color: #fff;
29
- line-height: 30px;
30
- }
31
-
32
-
33
-
34
- .bleeper-edit-message {
35
- display:none;
36
- cursor: pointer;
37
- margin-left:10px;
38
- font-style: italic;
39
- text-decoration: underline;
40
-
41
- }
42
-
43
-
44
-
45
- /**
46
- * Mobile Responsiveness (Jarek)
47
- */
48
- @media (max-width: 767px) {
49
- #wp-live-chat-2 {
50
- min-height: 420px;
51
- top: 2px;
52
- }
53
-
54
- #wp-live-chat.classic {
55
- right: 30px !important;
56
- }
57
-
58
- #wp-live-chat.classic.wplc_right {
59
- right: 0 !important;
60
- }
61
-
62
- #wp-live-chat.classic.wplc_left {
63
- right: auto !important;
64
- }
65
-
66
- #wp-live-chat.classic.is-active {
67
- top: 2px;
68
- }
69
-
70
- #wp-live-chat.mobile-active #wp-live-chat-2 {
71
- min-height: auto;
72
- top: auto;
73
- }
74
-
75
- #wp-live-chat-inner {
76
- overflow-y: scroll;
77
- }
78
-
79
- #wp-live-chat-4 {
80
- top: 2px !important;
81
- bottom: 150px !important;
82
- }
83
-
84
- .wplc_left #wp-live-chat-4 {
85
- bottom: 80px !important;
86
- }
87
-
88
- #wp-live-chat-4.is-full-height {
89
- bottom: 70px !important;
90
- }
91
-
92
- #wp-live-chat.is-full-height.classic {
93
- top: -40px;
94
- }
95
-
96
- .wplc_left #wp-live-chat-4 {
97
- width: 225px;
98
- }
99
-
100
- .modern[original_pos="bottom_left"] #wp-live-chat-4 {
101
- width: 310px;
102
- }
103
- }
104
-
105
- /* Gutenberg styles */
106
- #wplc-chat-box.disabled {
107
- display: none;
108
- }
109
-
110
- .wplc_live_chat_support_shortcode .wp-live-chat-wraper {
111
- position: relative;
112
- z-index: 0;
113
- display: block;
114
- }
115
-
116
- .wplc_live_chat_support_shortcode #wp-live-chat-4 {
117
- position: relative;
118
- height: 500px;
119
- z-index: 0;
120
- bottom: unset;
121
- right: unset;
122
- left: 70px;
123
- top: -80px;
124
- }
125
-
126
- .wplc_live_chat_support_shortcode #wplc_hovercard {
127
- position: absolute;
128
- top: 0;
129
- left: 70px;
130
- bottom: unset;
131
- z-index: 0;
132
- }
133
-
134
- .wplc_live_chat_support_shortcode #wp-live-chat {
135
- position: relative;
136
- z-index: 0;
137
- }
138
-
139
- .wplc_live_chat_support_shortcode {
140
- position: relative;
141
- transition: all .3s ease-in-out;
142
- z-index: 10;
143
- }
144
-
145
- .wplc_live_chat_support_shortcode #wp-live-chat-2 {
146
- position: relative;
147
- left: 70px;
148
- z-index: 5;
149
- }
150
-
151
- @media screen and (max-width: 500px) {
152
- .wplc_live_chat_support_shortcode #wp-live-chat-4 {
153
- max-width: 280px;
154
- }
155
- .wplc_live_chat_support_shortcode #wp-live-chat-2 {
156
- left: 0px !important;
157
- }
158
- .wplc_live_chat_support_shortcode #wplc_hovercard {
159
- top: 80px !important;
160
- left: -20px !important;
161
- }
162
- }
163
-
164
- @media screen and (max-width: 400px) {
165
- .wplc_live_chat_support_shortcode #wp-live-chat-4 {
166
- max-width: 240px;
167
- }
168
- }
169
-
170
-
171
-
172
- .wplc_live_chat_support_shortcode #wp-live-chat-4 {
173
- margin-bottom: 65px !important;
174
- }
175
- /* WPLC Gutenberg style: Wide */
176
- .wplc_live_chat_support_shortcode.wplc_wide #wp-live-chat-4 {
177
- width: 100%;
178
- left: 0;
179
- top: 0px;
180
- }
181
-
182
- .wplc_live_chat_support_shortcode.wplc_wide #wplc_hovercard {
183
- top: 0px;
184
- left: 0;
185
- margin: 0 auto;
186
- width: 70%;
187
- }
188
-
189
- .wplc_live_chat_support_shortcode.wplc_wide #wp-live-chat-2 {
190
- top: 0;
191
- width: 100%;
192
- left: 0;
193
- }
194
-
195
- /* WPLC Gutenberg style: Center */
196
- .wplc_live_chat_support_shortcode.wplc_center #wp-live-chat-header {
197
- margin: 0 auto;
198
- left: 0;
199
- top: 0px;
200
- margin-bottom: 10px;
201
- }
202
-
203
- .wplc_live_chat_support_shortcode.wplc_center #wp-live-chat-4 {
204
- margin: 0 auto;
205
- left: 0;
206
- top: 0px;
207
- }
208
-
209
- .wplc_live_chat_support_shortcode.wplc_center #wplc_hovercard {
210
- left: 0;
211
- margin: 0 auto;
212
- top: 75px;
213
- }
214
-
215
- .wplc_live_chat_support_shortcode.wplc_center #wp-live-chat-2 {
216
- left: 0px;
217
- margin: 0px auto;
218
- top: 0px;
219
- }
220
-
221
- /* Link override */
222
- #wplc_chatbox .wplc-user-message a,
223
- #wplc_chatbox .wplc-admin-message a {
224
- color: #fff !important;
225
- text-decoration:underline !important;
226
- }
227
-
228
-
229
-
230
-
231
- #wp-live-chat-inner .wpcf_wrapper {
232
- position: inherit;
233
- padding: 25px;
234
- max-height: 400px;
235
- margin-bottom:20px;
236
- }
237
-
238
- input#wplc_chat_gdpr_opt_in.incomplete + label {
239
- border-left: 1px solid #bd0000 !important;
240
- background: none !important;
241
- padding: 4px;
242
- }
 
 
 
 
 
 
 
 
1
+
2
+
3
+
4
+ .wplc-chat-alert {
5
+ display: none;
6
+ width: 30px;
7
+ height: 30px;
8
+ position: absolute;
9
+ top: -10px;
10
+ right: -10px;
11
+ background-color: #666;
12
+ border-radius: 15px;
13
+ }
14
+
15
+ .wplc-chat-alert--theme-3 {
16
+ background-color: #5a0031;
17
+ }
18
+
19
+ .wplc-chat-alert.is-active {
20
+ display: inline-block;
21
+ }
22
+
23
+ .wplc-chat-alert:after {
24
+ content: '\f0a2';
25
+ position: absolute;
26
+ left: 7px;
27
+ font-family: FontAwesome;
28
+ color: #fff;
29
+ line-height: 30px;
30
+ }
31
+
32
+
33
+
34
+ .bleeper-edit-message {
35
+ display:none;
36
+ cursor: pointer;
37
+ margin-left:10px;
38
+ font-style: italic;
39
+ text-decoration: underline;
40
+
41
+ }
42
+
43
+
44
+
45
+ /**
46
+ * Mobile Responsiveness (Jarek)
47
+ */
48
+ @media (max-width: 767px) {
49
+ #wp-live-chat-2 {
50
+ min-height: 420px;
51
+ top: 2px;
52
+ }
53
+
54
+ #wp-live-chat.classic {
55
+ right: 30px !important;
56
+ }
57
+
58
+ #wp-live-chat.classic.wplc_right {
59
+ right: 0 !important;
60
+ }
61
+
62
+ #wp-live-chat.classic.wplc_left {
63
+ right: auto !important;
64
+ }
65
+
66
+ #wp-live-chat.classic.is-active {
67
+ top: 2px;
68
+ }
69
+
70
+ #wp-live-chat.mobile-active #wp-live-chat-2 {
71
+ min-height: auto;
72
+ top: auto;
73
+ }
74
+
75
+ #wp-live-chat-inner {
76
+ overflow-y: scroll;
77
+ }
78
+
79
+ #wp-live-chat-4 {
80
+ top: 2px !important;
81
+ bottom: 150px !important;
82
+ }
83
+
84
+ .wplc_left #wp-live-chat-4 {
85
+ bottom: 80px !important;
86
+ }
87
+
88
+ #wp-live-chat-4.is-full-height {
89
+ bottom: 70px !important;
90
+ }
91
+
92
+ #wp-live-chat.is-full-height.classic {
93
+ top: -40px;
94
+ }
95
+
96
+ .wplc_left #wp-live-chat-4 {
97
+ width: 225px;
98
+ }
99
+
100
+ .modern[original_pos="bottom_left"] #wp-live-chat-4 {
101
+ width: 310px;
102
+ }
103
+ }
104
+
105
+ /* Gutenberg styles */
106
+ #wplc-chat-box.disabled {
107
+ display: none;
108
+ }
109
+
110
+ .wplc_live_chat_support_shortcode .wp-live-chat-wraper {
111
+ position: relative;
112
+ z-index: 0;
113
+ display: block;
114
+ }
115
+
116
+ .wplc_live_chat_support_shortcode #wp-live-chat-4 {
117
+ position: relative;
118
+ height: 500px;
119
+ z-index: 0;
120
+ bottom: unset;
121
+ right: unset;
122
+ left: 70px;
123
+ top: -80px;
124
+ }
125
+
126
+ .wplc_live_chat_support_shortcode #wplc_hovercard {
127
+ position: absolute;
128
+ top: 0;
129
+ left: 70px;
130
+ bottom: unset;
131
+ z-index: 0;
132
+ }
133
+
134
+ .wplc_live_chat_support_shortcode #wp-live-chat {
135
+ position: relative;
136
+ z-index: 0;
137
+ }
138
+
139
+ .wplc_live_chat_support_shortcode {
140
+ position: relative;
141
+ transition: all .3s ease-in-out;
142
+ z-index: 10;
143
+ }
144
+
145
+ .wplc_live_chat_support_shortcode #wp-live-chat-2 {
146
+ position: relative;
147
+ left: 70px;
148
+ z-index: 5;
149
+ }
150
+
151
+ @media screen and (max-width: 500px) {
152
+ .wplc_live_chat_support_shortcode #wp-live-chat-4 {
153
+ max-width: 280px;
154
+ }
155
+ .wplc_live_chat_support_shortcode #wp-live-chat-2 {
156
+ left: 0px !important;
157
+ }
158
+ .wplc_live_chat_support_shortcode #wplc_hovercard {
159
+ top: 80px !important;
160
+ left: -20px !important;
161
+ }
162
+ }
163
+
164
+ @media screen and (max-width: 400px) {
165
+ .wplc_live_chat_support_shortcode #wp-live-chat-4 {
166
+ max-width: 240px;
167
+ }
168
+ }
169
+
170
+
171
+
172
+ .wplc_live_chat_support_shortcode #wp-live-chat-4 {
173
+ margin-bottom: 65px !important;
174
+ }
175
+ /* WPLC Gutenberg style: Wide */
176
+ .wplc_live_chat_support_shortcode.wplc_wide #wp-live-chat-4 {
177
+ width: 100%;
178
+ left: 0;
179
+ top: 0px;
180
+ }
181
+
182
+ .wplc_live_chat_support_shortcode.wplc_wide #wplc_hovercard {
183
+ top: 0px;
184
+ left: 0;
185
+ margin: 0 auto;
186
+ width: 70%;
187
+ }
188
+
189
+ .wplc_live_chat_support_shortcode.wplc_wide #wp-live-chat-2 {
190
+ top: 0;
191
+ width: 100%;
192
+ left: 0;
193
+ }
194
+
195
+ /* WPLC Gutenberg style: Center */
196
+ .wplc_live_chat_support_shortcode.wplc_center #wp-live-chat-header {
197
+ margin: 0 auto;
198
+ left: 0;
199
+ top: 0px;
200
+ margin-bottom: 10px;
201
+ }
202
+
203
+ .wplc_live_chat_support_shortcode.wplc_center #wp-live-chat-4 {
204
+ margin: 0 auto;
205
+ left: 0;
206
+ top: 0px;
207
+ }
208
+
209
+ .wplc_live_chat_support_shortcode.wplc_center #wplc_hovercard {
210
+ left: 0;
211
+ margin: 0 auto;
212
+ top: 75px;
213
+ }
214
+
215
+ .wplc_live_chat_support_shortcode.wplc_center #wp-live-chat-2 {
216
+ left: 0px;
217
+ margin: 0px auto;
218
+ top: 0px;
219
+ }
220
+
221
+ /* Link override */
222
+ #wplc_chatbox .wplc-user-message a,
223
+ #wplc_chatbox .wplc-admin-message a {
224
+ color: #fff !important;
225
+ text-decoration:underline !important;
226
+ }
227
+
228
+
229
+
230
+
231
+ #wp-live-chat-inner .wpcf_wrapper {
232
+ position: inherit;
233
+ padding: 25px;
234
+ max-height: 400px;
235
+ margin-bottom:20px;
236
+ }
237
+
238
+ input#wplc_chat_gdpr_opt_in.incomplete + label {
239
+ border-left: 1px solid #bd0000 !important;
240
+ background: none !important;
241
+ padding: 4px;
242
+ }
243
+
244
+
245
+ @media screen and (max-width:510px){
246
+ #wp-live-chat.modern #wp-live-chat-2,
247
+ #wp-live-chat.modern #wp-live-chat-4 {
248
+ bottom:100px;
249
+ }
250
+ }
functions.php CHANGED
@@ -1,2415 +1,2443 @@
1
- <?php
2
- $wplc_basic_plugin_url = WPLC_BASIC_PLUGIN_URL;
3
-
4
- function wplc_log_user_on_page($name,$email,$session, $is_mobile = false) {
5
- global $wpdb;
6
- global $wplc_tblname_chats;
7
-
8
- $wplc_settings = get_option('WPLC_SETTINGS');
9
-
10
-
11
- /** DEPRECATED DUE TO GDPR */
12
- /*if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
13
-
14
- if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {
15
- $ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];
16
- } else {
17
- $ip_address = $_SERVER['REMOTE_ADDR'];
18
- }
19
-
20
- $user_data = array(
21
- 'ip' => $ip_address,
22
- 'user_agent' => $_SERVER['HTTP_USER_AGENT']
23
- );
24
- } else {
25
- $user_data = array(
26
- 'ip' => "",
27
- 'user_agent' => $_SERVER['HTTP_USER_AGENT']
28
- );
29
- }*/
30
-
31
- $user_data = array(
32
- 'ip' => "",
33
- 'user_agent' => $_SERVER['HTTP_USER_AGENT']
34
- );
35
-
36
-
37
- /* user types
38
- * 1 = new
39
- * 2 = returning
40
- * 3 = timed out
41
- */
42
-
43
- $other = array(
44
- "user_type" => 1
45
- );
46
-
47
- if($is_mobile){
48
- $other['user_is_mobile'] = true;
49
- } else {
50
- $other['user_is_mobile'] = false;
51
- }
52
-
53
- $other = apply_filters("wplc_log_user_on_page_insert_other_data_filter", $other);
54
-
55
- $wplc_chat_session_data = array(
56
- 'status' => '5',
57
- 'timestamp' => current_time('mysql'),
58
- 'name' => $name,
59
- 'email' => $email,
60
- 'session' => $session,
61
- 'ip' => maybe_serialize($user_data),
62
- 'url' => sanitize_text_field($_SERVER['HTTP_REFERER']),
63
- 'last_active_timestamp' => current_time('mysql'),
64
- 'other' => maybe_serialize($other),
65
- );
66
-
67
- $wplc_chat_session_data = apply_filters("wplc_log_user_on_page_insert_filter", $wplc_chat_session_data);
68
-
69
- /* Omitted from inser call as this defaults to string
70
- $wplc_chat_session_types = array(
71
- '%s',
72
- '%s',
73
- '%s',
74
- '%s',
75
- '%s',
76
- '%s',
77
- '%s',
78
- '%s',
79
- '%s'
80
- ); */
81
-
82
-
83
- $wpdb->insert($wplc_tblname_chats, $wplc_chat_session_data);
84
- $lastid = $wpdb->insert_id;
85
-
86
- do_action("wplc_log_user_on_page_after_hook", $lastid, $wplc_chat_session_data);
87
-
88
-
89
- return $lastid;
90
-
91
- }
92
- function wplc_update_user_on_page($cid, $status = 5,$session) {
93
- global $wpdb;
94
- global $wplc_tblname_chats;
95
- $wplc_settings = get_option('WPLC_SETTINGS');
96
-
97
- /** DEPRECATED BY GDPR */
98
- /*if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
99
-
100
- if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {
101
- $ip_address = sanitize_text_field($_SERVER['HTTP_X_FORWARDED_FOR']);
102
- } else {
103
- $ip_address = sanitize_text_field($_SERVER['REMOTE_ADDR']);
104
- }
105
- $user_data = array(
106
- 'ip' => $ip_address,
107
- 'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
108
- );
109
- } else {
110
- $user_data = array(
111
- 'ip' => "",
112
- 'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
113
- );
114
- }*/
115
-
116
- $user_data = array(
117
- 'ip' => "",
118
- 'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
119
- );
120
-
121
-
122
-
123
- $query = $wpdb->update(
124
- $wplc_tblname_chats,
125
- array(
126
- 'url' => sanitize_text_field($_SERVER['HTTP_REFERER']),
127
- 'last_active_timestamp' => current_time('mysql'),
128
- 'ip' => maybe_serialize($user_data),
129
- 'status' => $status,
130
- 'session' => $session,
131
- ),
132
- array('id' => $cid),
133
- array(
134
- '%s',
135
- '%s',
136
- '%s',
137
- '%d',
138
- '%s'
139
- ),
140
- array('%d')
141
- );
142
-
143
-
144
- return $query;
145
-
146
-
147
- }
148
-
149
-
150
- function wplc_record_chat_msg($from, $cid, $msg, $rest_check = false, $aid = false, $other = false) {
151
- global $wpdb;
152
- global $wplc_tblname_msgs;
153
-
154
-
155
- if( ! filter_var($cid, FILTER_VALIDATE_INT) ) {
156
-
157
- /**
158
- * We need to identify if this CID is a node CID, and if so, return the WP CID from the wplc_chat_msgs table
159
- */
160
- $cid = wplc_return_chat_id_by_rel($cid);
161
- }
162
-
163
- /**
164
- * check if this CID even exists, if not, create it
165
- *
166
- * If it doesnt exist, it most likely is an agent-to-agent chat that we now need to save.
167
- */
168
-
169
- global $wplc_tblname_chats;
170
- $results = $wpdb->get_results("SELECT * FROM $wplc_tblname_chats WHERE `rel` = '".$cid."' OR `id` = '".$cid."' LIMIT 1");
171
- if (!$results) {
172
- /* it doesnt exist, lets put it in the table */
173
-
174
- $wpdb->insert(
175
- $wplc_tblname_chats,
176
- array(
177
- 'status' => 3,
178
- 'timestamp' => current_time('mysql'),
179
- 'name' => 'agent-to-agent chat',
180
- 'email' => 'none',
181
- 'session' => '1',
182
- 'ip' => '0',
183
- 'url' => '',
184
- 'last_active_timestamp' => current_time('mysql'),
185
- 'other' => '',
186
- 'rel' => $cid,
187
- ),
188
- array(
189
- '%s',
190
- '%s',
191
- '%s',
192
- '%s',
193
- '%s',
194
- '%s',
195
- '%s',
196
- '%s',
197
- '%s',
198
- '%s'
199
- )
200
- );
201
-
202
-
203
- $cid = $wpdb->insert_id;
204
- }
205
-
206
-
207
- if ($from == "2" && $rest_check == false) {
208
- $wplc_current_user = get_current_user_id();
209
-
210
- if( get_user_meta( $wplc_current_user, 'wplc_ma_agent', true ) ){
211
- /*
212
- -- modified in in 6.0.04 --
213
-
214
- if(current_user_can('wplc_ma_agent') || current_user_can('manage_options')){
215
- */ } else { return "security issue"; }
216
- }
217
-
218
- if ($from == "1") {
219
- $fromname = wplc_return_chat_name(sanitize_text_field($cid));
220
- if (empty($fromname)) { $fromname = 'Guest'; }
221
- //$fromemail = wplc_return_chat_email($cid);
222
- $orig = '2';
223
- }
224
- else {
225
- $fromname = apply_filters("wplc_filter_admin_name","Admin");
226
-
227
- //$fromemail = "SET email";
228
- $orig = '1';
229
- }
230
-
231
- $msg_id = '';
232
-
233
- if ($other !== false) {
234
- if (!empty($other->msgID)) {
235
- $msg_id = $other->msgID;
236
- } else {
237
- $msg_id = '';
238
- }
239
- }
240
-
241
-
242
- $orig_msg = $msg;
243
-
244
- $msg = apply_filters("wplc_filter_message_control",$msg);
245
-
246
- if (!$aid) {
247
- $wplc_current_user = get_current_user_id();
248
-
249
- if( get_user_meta( $wplc_current_user, 'wplc_ma_agent', true ) ){
250
- $other_data = array('aid'=>$wplc_current_user);
251
- } else {
252
- $other_data = '';
253
- }
254
- } else {
255
- if( get_user_meta( $aid, 'wplc_ma_agent', true ) ){
256
- $other_data = array('aid'=>$aid);
257
- } else {
258
- $other_data = '';
259
- }
260
- }
261
-
262
-
263
-
264
-
265
-
266
- $wpdb->insert(
267
- $wplc_tblname_msgs,
268
- array(
269
- 'chat_sess_id' => $cid,
270
- 'timestamp' => current_time('mysql'),
271
- 'msgfrom' => $fromname,
272
- 'msg' => $msg,
273
- 'status' => 0,
274
- 'originates' => $orig,
275
- 'other' => maybe_serialize( $other_data ),
276
- 'rel' => $msg_id
277
- ),
278
- array(
279
- '%s',
280
- '%s',
281
- '%s',
282
- '%s',
283
- '%d',
284
- '%s',
285
- '%s',
286
- '%s'
287
- )
288
- );
289
-
290
- $data = array(
291
- 'cid' => $cid,
292
- 'from' => $from,
293
- 'msg' => $orig_msg,
294
- 'orig' => $orig
295
- );
296
- do_action("wplc_hook_message_sent",$data);
297
-
298
- wplc_update_active_timestamp(sanitize_text_field($cid));
299
-
300
-
301
- return true;
302
-
303
- }
304
-
305
- function wplc_update_active_timestamp($cid) {
306
- global $wpdb;
307
- global $wplc_tblname_chats;
308
- // $results = $wpdb->get_results(
309
- // "
310
- // UPDATE $wplc_tblname_chats
311
- // SET `last_active_timestamp` = '".date("Y-m-d H:i:s")."'
312
- // WHERE `id` = '$cid'
313
- // LIMIT 1
314
- // "
315
- // );
316
- $wpdb->update(
317
- $wplc_tblname_chats,
318
- array(
319
- 'last_active_timestamp' => current_time('mysql')
320
- ),
321
- array('id' => $cid),
322
- array('%s'),
323
- array('%d')
324
- );
325
-
326
- //wplc_change_chat_status(sanitize_text_field($cid),3);
327
- return true;
328
-
329
- }
330
-
331
- function wplc_return_chat_name($cid) {
332
- global $wpdb;
333
- global $wplc_tblname_chats;
334
-
335
- $results = $wpdb->get_results(
336
- "
337
- SELECT *
338
- FROM $wplc_tblname_chats
339
- WHERE `id` = '$cid'
340
- "
341
- );
342
- foreach ($results as $result) {
343
- return $result->name;
344
- }
345
-
346
- }
347
-
348
-
349
- /**
350
- * Find out if we are dealing with a NODE CID and convert it to the WP CID.
351
- *
352
- * If it cannot find a relative, then simply return the original CID parsed through.
353
- *
354
- * @param string|int $rel The CId to compare
355
- * @return string|int The suggested CID
356
- */
357
- function wplc_return_chat_id_by_rel($rel) {
358
- global $wpdb;
359
- global $wplc_tblname_chats;
360
-
361
- $results = $wpdb->get_results("SELECT * FROM $wplc_tblname_chats WHERE `rel` = '$rel' LIMIT 1");
362
- if ($results) {
363
- foreach ($results as $result) {
364
- if (isset($result->id)) {
365
- return $result->id;
366
- } else {
367
- return $rel;
368
- }
369
- }
370
- } else {
371
- return $rel;
372
- }
373
-
374
- }
375
- function wplc_return_chat_email($cid) {
376
- global $wpdb;
377
- global $wplc_tblname_chats;
378
- $results = $wpdb->get_results(
379
- "
380
- SELECT *
381
- FROM $wplc_tblname_chats
382
- WHERE `id` = '$cid'
383
- "
384
- );
385
- foreach ($results as $result) {
386
- return $result->email;
387
- }
388
-
389
- }
390
- function wplc_list_chats() {
391
-
392
- global $wpdb;
393
- global $wplc_tblname_chats;
394
- $status = 3;
395
- $wplc_c = 0;
396
- $results = $wpdb->get_results(
397
- "
398
- SELECT *
399
- FROM $wplc_tblname_chats
400
- WHERE `status` = 3 OR `status` = 2 OR `status` = 10
401
- ORDER BY `timestamp` ASC
402
-
403
- "
404
- );
405
-
406
- $table = "<div class='wplc_chats_container'>";
407
-
408
- if (!$results) {
409
- $table.= "<p>".__("No chat sessions available at the moment","wplivechat")."</p>";
410
- } else {
411
- $table .= "<h2>".__('Active Chats', 'wplivechat')."</h2>";
412
-
413
- foreach ($results as $result) {
414
- unset($trstyle);
415
- unset($actions);
416
- $wplc_c++;
417
-
418
-
419
- global $wplc_basic_plugin_url;
420
- $user_data = maybe_unserialize($result->ip);
421
- $user_ip = $user_data['ip'];
422
- $browser = wplc_return_browser_string($user_data['user_agent']);
423
- $browser_image = wplc_return_browser_image($browser,"16");
424
-
425
- if($user_ip == ""){
426
- $user_ip = __('IP Address not recorded', 'wplivechat');
427
- } else {
428
- $user_ip = "<a href='http://www.ip-adress.com/ip_tracer/" . $user_ip . "' title='".__('Whois for' ,'wplivechat')." ".$user_ip."' target='_BLANK'>".$user_ip."</a>";
429
- }
430
-
431
- if ($result->status == 2) {
432
- $url = admin_url( 'admin.php?page=wplivechat-menu&action=ac&cid='.$result->id);
433
- $actions = "<a href=\"".$url."\" class=\"wplc_open_chat button button-primary\" window-title=\"WP_Live_Chat_".$result->id."\">".__("Accept Chat","wplivechat")."</a>";
434
- $trstyle = "style='background-color:#FFFBE4; height:30px;'";
435
- $icon = "<i class=\"fa fa-phone wplc_pending\" title='".__('Incoming Chat', 'wplivechat')."' alt='".__('Incoming Chat', 'wplivechat')."'></i><div class='wplc_icon_message'>".__('You have an incoming chat.', 'wplivechat')."</div>";
436
- }
437
- if ($result->status == 3) {
438
- $url = admin_url( 'admin.php?page=wplivechat-menu&action=ac&cid='.$result->id);
439
- $actions = "<a href=\"".$url."\" class=\"wplc_open_chat button button-primary\" window-title=\"WP_Live_Chat_".$result->id."\">".__("Open Chat Window","wplivechat")."</a>";
440
- $trstyle = "style='background-color:#F7FCFE; height:30px;'";
441
- $icon = "<i class=\"fa fa-check-circle wplc_active\" title='".__('Chat Active', 'wplivechat')."' alt='".__('Chat Active', 'wplivechat')."'></i><div class='wplc_icon_message'>".__('This chat is active', 'wplivechat')."</div>";
442
- }
443
-
444
-
445
- /* if ($wplc_c>1) { $actions = wplc_get_msg(); } */
446
-
447
- $trstyle = "";
448
-
449
- $table .= "
450
- <div class='wplc_single_chat' id='record_".$result->id."' $trstyle>
451
- <div class='wplc_chat_section section_1'>
452
- <div class='wplc_user_image' id='chat_image_".$result->id."'>
453
- <img src=\"//www.gravatar.com/avatar/".md5($result->email)."?s=60&d=mm\" />
454
- </div>
455
- <div class='wplc_user_meta_data'>
456
- <div class='wplc_user_name' id='chat_name_".$result->id."'>
457
- <h3>".$result->name.$icon."</h3>
458
- <a href='mailto:".$result->email."' target='_BLANK'>".$result->email."</a>
459
- </div>
460
- </div>
461
- </div>
462
- <div class='wplc_chat_section section_2'>
463
- <div class='admin_visitor_advanced_info'>
464
- <strong>" . __("Site Info", "wplivechat") . "</strong>
465
- <hr />
466
- <span class='part1'>" . __("Chat initiated on:", "wplivechat") . "</span> <span class='part2'> <a href='".esc_url($result->url)."' target='_BLANK'>" . esc_url($result->url) . "</a></span>
467
- </div>
468
-
469
- <div class='admin_visitor_advanced_info'>
470
- <strong>" . __("Advanced Info", "wplivechat") . "</strong>
471
- <hr />
472
- <span class='part1'>" . __("Browser:", "wplivechat") . "</span><span class='part2'> $browser <img src='" . $wplc_basic_plugin_url . "/images/$browser_image' alt='$browser' title='$browser' /><br />
473
- <span class='part1'>" . __("IP Address:", "wplivechat") . "</span><span class='part2'> ".$user_ip."
474
- </div>
475
- </div>
476
- <div class='wplc_chat_section section_3'>
477
- <div class='wplc_agent_actions'>
478
- $actions
479
- </div>
480
- </div>
481
- </div>
482
- ";
483
- }
484
- }
485
- $table .= "</div>";
486
-
487
- return $table;
488
- }
489
-
490
- function wplc_time_ago($time_ago)
491
- {
492
- $time_ago = strtotime($time_ago);
493
- $cur_time = current_time('timestamp');
494
- $time_elapsed = $cur_time - $time_ago;
495
- $seconds = $time_elapsed ;
496
- $minutes = round($time_elapsed / 60 );
497
- $hours = round($time_elapsed / 3600);
498
- $days = round($time_elapsed / 86400 );
499
- $weeks = round($time_elapsed / 604800);
500
- $months = round($time_elapsed / 2600640 );
501
- $years = round($time_elapsed / 31207680 );
502
- // Seconds
503
- if($seconds <= 60){
504
- return "0 min";
505
- }
506
- //Minutes
507
- else if($minutes <=60){
508
- if($minutes==1){
509
- return "1 min";
510
- }
511
- else{
512
- return "$minutes min";
513
- }
514
- }
515
- //Hours
516
- else if($hours <=24){
517
- if($hours==1){
518
- return "1 hr";
519
- }else{
520
- return "$hours hrs";
521
- }
522
- }
523
- //Days
524
- else if($days <= 7){
525
- if($days==1){
526
- return "1 day";
527
- }else{
528
- return "$days days";
529
- }
530
- }
531
- //Weeks
532
- else if($weeks <= 4.3){
533
- if($weeks==1){
534
- return "1 week";
535
- }else{
536
- return "$weeks weeks";
537
- }
538
- }
539
- //Months
540
- else if($months <=12){
541
- if($months==1){
542
- return "1 month";
543
- }else{
544
- return "$months months";
545
- }
546
- }
547
- //Years
548
- else{
549
- if($years==1){
550
- return "1 year";
551
- }else{
552
- return "$years years";
553
- }
554
- }
555
- }
556
-
557
- add_filter("wplc_filter_list_chats_actions","wplc_filter_control_list_chats_actions",15,3);
558
- /**
559
- * Only allow agents access
560
- * @return void
561
- * @since 6.0.00
562
- * @version 6.0.04 Updated to ensure those with the correct access can access this function
563
- * @author Nick Duncan <nick@codecabin.co.za>
564
- */
565
- function wplc_filter_control_list_chats_actions($actions,$result,$post_data) {
566
- $aid = apply_filters("wplc_filter_aid_in_action","");
567
-
568
- $wplc_current_user = get_current_user_id();
569
-
570
- if( get_user_meta( $wplc_current_user, 'wplc_ma_agent', true ) ){
571
-
572
- if (intval($result->status) == 2) {
573
- $url_params = "&action=ac&cid=".$result->id.$aid;
574
- $url = admin_url( 'admin.php?page=wplivechat-menu'.$url_params);
575
- $actions = "<a href=\"".$url."\" class=\"wplc_open_chat button button-primary\" window-title=\"WP_Live_Chat_".$result->id."\">". apply_filters("wplc_accept_chat_button_filter", __("Accept Chat","wplivechat"), $result->id)."</a>";
576
- }
577
- else if (intval($result->status) == 3 || intval($result->status) == 10) {
578
- $url_params = "&action=ac&cid=".$result->id.$aid;
579
- $url = admin_url( 'admin.php?page=wplivechat-menu'.$url_params);
580
- if ( ! function_exists("wplc_pro_version_control") || !isset( $result->agent_id ) || $wplc_current_user == $result->agent_id ) { //Added backwards compat checks
581
- $actions = "<a href=\"".$url."\" class=\"wplc_open_chat button button-primary\" window-title=\"WP_Live_Chat_".$result->id."\">".__("Open Chat","wplivechat")."</a>";
582
- } else {
583
- $actions = "<span class=\"wplc-chat-in-progress\">" . __( "In progress with another agent", "wplivechat" ) . "</span>";
584
- }
585
- }
586
- else if (intval($result->status) == 2) {
587
- $url_params = "&action=ac&cid=".$result->id.$aid;
588
- $url = admin_url( 'admin.php?page=wplivechat-menu'.$url_params);
589
- $actions = "<a href=\"".$url."\" class=\"wplc_open_chat button button-primary\" window-title=\"WP_Live_Chat_".$result->id."\">".__("Accept Chat","wplivechat")."</a>";
590
- }
591
- else if (intval($result->status) == 12 ) {
592
- $url_params = "&action=ac&cid=".$result->id.$aid;
593
- $url = admin_url( 'admin.php?page=wplivechat-menu'.$url_params);
594
- $actions = "<a href=\"".$url."\" class=\"wplc_open_chat button button-primary\" window-title=\"WP_Live_Chat_".$result->id."\">".__("Open Chat","wplivechat")."</a>";
595
- }
596
- } else {
597
- $actions = "<a href='#'>".__( 'Only chat agents can accept chats', 'wplivechat' )."</a>";
598
- }
599
- return $actions;
600
- }
601
-
602
- function wplc_list_chats_new($post_data) {
603
-
604
- global $wpdb;
605
- global $wplc_tblname_chats;
606
-
607
- $data_array = array();
608
- $id_list = array();
609
-
610
- $status = 3;
611
- $wplc_c = 0;
612
-
613
- // Retrieve count of users in same department or in no department
614
- $user_id = get_current_user_id();
615
- $user_department = get_user_meta($user_id ,"wplc_user_department", true);
616
-
617
- $wplc_chat_count_sql = "SELECT COUNT(*) FROM $wplc_tblname_chats WHERE status IN (3,2,10,5,8,9,12)";
618
- if($user_department > 0)
619
- $wplc_chat_count_sql .= " AND (department_id=0 OR department_id=$user_department)";
620
- $data_array['visitor_count'] = $wpdb->get_var($wplc_chat_count_sql);
621
-
622
- // Retrieve data
623
- $wplc_chat_sql = "SELECT * FROM $wplc_tblname_chats WHERE (`status` = 3 OR `status` = 2 OR `status` = 10 OR `status` = 5 or `status` = 8 or `status` = 9 or `status` = 12)";
624
- $wplc_chat_sql .= apply_filters("wplc_alter_chat_list_sql_before_sorting", "");
625
-
626
- $wplc_chat_sql .= " ORDER BY `timestamp` ASC";
627
-
628
- $results = $wpdb->get_results($wplc_chat_sql);
629
-
630
-
631
- if($results) {
632
-
633
-
634
- foreach ($results as $result) {
635
- unset($trstyle);
636
- unset($actions);
637
-
638
-
639
-
640
-
641
- global $wplc_basic_plugin_url;
642
- $user_data = maybe_unserialize($result->ip);
643
- $user_ip = $user_data['ip'];
644
- $browser = wplc_return_browser_string($user_data['user_agent']);
645
- $browser_image = wplc_return_browser_image($browser,"16");
646
-
647
- if($user_ip == ""){
648
- $user_ip = __('IP Address not recorded', 'wplivechat');
649
- } else {
650
- $user_ip = "<a href='http://www.ip-adress.com/ip_tracer/" . $user_ip . "' title='".__('Whois for' ,'wplivechat')." ".$user_ip."' target='_BLANK'>".$user_ip."</a>";
651
- }
652
-
653
-
654
- $actions = apply_filters("wplc_filter_list_chats_actions","",$result,$post_data);
655
-
656
-
657
- $other_data = maybe_unserialize($result->other);
658
-
659
-
660
-
661
- $trstyle = "";
662
-
663
- $id_list[intval($result->id)] = true;
664
-
665
- $data_array[$result->id]['name'] = $result->name;
666
- $data_array[$result->id]['email'] = $result->email;
667
-
668
- $data_array[$result->id]['status'] = $result->status;
669
- $data_array[$result->id]['action'] = $actions;
670
- $data_array[$result->id]['timestamp'] = wplc_time_ago($result->timestamp);
671
-
672
- if ((current_time('timestamp') - strtotime($result->timestamp)) < 3600) {
673
- $data_array[$result->id]['type'] = __("New","wplivechat");
674
- } else {
675
- $data_array[$result->id]['type'] = __("Returning","wplivechat");
676
- }
677
-
678
- $data_array[$result->id]['image'] = "<img src=\"//www.gravatar.com/avatar/".md5($result->email)."?s=30&d=mm\" class='wplc-user-message-avatar' />";
679
- $data_array[$result->id]['data']['browsing'] = $result->url;
680
- $path = parse_url($result->url, PHP_URL_PATH);
681
-
682
- if (strlen($path) > 20) {
683
- $data_array[$result->id]['data']['browsing_nice_url'] = substr($path,0,20).'...';
684
- } else {
685
- $data_array[$result->id]['data']['browsing_nice_url'] = $path;
686
- }
687
-
688
- $data_array[$result->id]['data']['browser'] = "<img src='" . $wplc_basic_plugin_url . "/images/$browser_image' alt='$browser' title='$browser' /> ";
689
- $data_array[$result->id]['data']['ip'] = $user_ip;
690
- $data_array[$result->id]['other'] = $other_data;
691
- }
692
-
693
- $data_array['ids'] = $id_list;
694
- }
695
-
696
- return json_encode($data_array);
697
- }
698
-
699
-
700
-
701
- function wplc_return_user_chat_messages($cid,$wplc_settings = false,$cdata = false) {
702
- global $wpdb;
703
- global $wplc_tblname_msgs;
704
-
705
- if (!$wplc_settings) {
706
- $wplc_settings = get_option("WPLC_SETTINGS");
707
- }
708
-
709
- if(isset($wplc_settings['wplc_display_name']) && $wplc_settings['wplc_display_name'] == 1){ $display_name = 1; } else { $display_name = 0; }
710
-
711
- $sql = "SELECT * FROM $wplc_tblname_msgs WHERE `chat_sess_id` = '$cid' AND `status` = '0' AND (`originates` = '1' OR `originates` = '0') ORDER BY `timestamp` ASC";
712
- $results = $wpdb->get_results($sql);
713
- if (!$cdata) {
714
- $cdata = wplc_get_chat_data($cid,__LINE__);
715
- }
716
-
717
-
718
- $msg_hist = array();
719
- foreach ($results as $result) {
720
- $system_notification = false;
721
-
722
- $id = $result->id;
723
- $from = $result->msgfrom;
724
-
725
-
726
- $msg = $result->msg;
727
-
728
- if ( isset( $result->other ) ) { $other_data = maybe_unserialize( $result->other ); } else { $other_data = array(); }
729
- if ($other_data == '') { $other_data = array(); }
730
-
731
- $timestamp = strtotime( $result->timestamp );
732
- $other_data['datetime'] = $timestamp;
733
- $other_data['datetimeUTC'] = strtotime( get_gmt_from_date( $result->timestamp ) );
734
-
735
- //
736
- if($result->originates == 1){
737
- /* removed in 7.1.00
738
- $class = "wplc-admin-message wplc-color-bg-4 wplc-color-2 wplc-color-border-4";
739
- if(function_exists("wplc_pro_get_admin_picture")){
740
- $src = wplc_pro_get_admin_picture();
741
- if($src){
742
- $image = "<img src=".$src." width='20px' id='wp-live-chat-2-img'/>";
743
- } else {
744
- $image = "";
745
- }
746
- } else {
747
- $other = maybe_unserialize($cdata->other);
748
- if (isset($other['aid'])) {
749
-
750
-
751
- $user_info = get_userdata(intval($other['aid']));
752
-
753
- $image = "<img src='//www.gravatar.com/avatar/".md5($user_info->user_email)."?s=30' class='wplc-admin-message-avatar' />";
754
- } else {
755
-
756
-
757
- $image = "";
758
- if(1 == 1) {
759
-
760
- } else {
761
-
762
- $image = "";
763
- }
764
- }
765
-
766
- }
767
-
768
- $from = apply_filters("wplc_filter_admin_name",$from, $cid);
769
- */
770
-
771
- }
772
- else if (intval($result->originates) == 0) {
773
- /*
774
- system notifications
775
- from version 7
776
- */
777
- $system_notification = true;
778
-
779
- }
780
- else {
781
-
782
- /*
783
- removed in 7.1.00
784
- $class = "wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1";
785
-
786
- if(isset($_COOKIE['wplc_email']) && $_COOKIE['wplc_email'] != ""){ $wplc_user_gravatar = md5(strtolower(trim(sanitize_text_field($_COOKIE['wplc_email'])))); } else { $wplc_user_gravatar = ""; }
787
-
788
- if($wplc_user_gravatar != ""){
789
- $image = "<img src='//www.gravatar.com/avatar/$wplc_user_gravatar?s=30' class='wplc-user-message-avatar' />";
790
- } else {
791
- $image = "";
792
- }
793
- */
794
- }
795
-
796
- if (!$system_notification) {
797
- /* this is a normal message */
798
- if(function_exists('wplc_encrypt_decrypt_msg')){
799
- $msg = wplc_encrypt_decrypt_msg($msg);
800
- }
801
-
802
- $msg_array = maybe_unserialize( $msg );
803
-
804
- if( is_array( $msg_array ) ){
805
- $msg = $msg_array['m'];
806
- }
807
-
808
- $msg = stripslashes($msg);
809
-
810
- $msg = apply_filters("wplc_filter_message_control_out",$msg);
811
-
812
- $msg = stripslashes($msg);
813
-
814
- $msg_hist[$id]['msg'] = $msg;
815
- $msg_hist[$id]['originates'] = intval($result->originates);
816
- $msg_hist[$id]['other'] = $other_data;
817
-
818
- /*
819
- removed this in 7.1.00 as the JS now handles this
820
- if($display_name){
821
- $msg_hist[$id]['msg'] = "<span class='wplc-admin-message wplc-color-bg-4 wplc-color-2 wplc-color-border-4'>$image <strong>$from </strong> $msg</span><br /><div class='wplc-clear-float-message'></div>";
822
- } else {
823
- $msg_hist[$id]['msg'] = "<span class='wplc-admin-message wplc-color-bg-4 wplc-color-2 wplc-color-border-4'>$msg</span><div class='wplc-clear-float-message'></div>";
824
- }*/
825
- } else {
826
- /* add the system notification to the list */
827
- if ( isset( $msg_hist[$id] ) ) { $msg_hist[$id] = array(); }
828
-
829
- $msg_hist[$id]['msg'] = $msg;
830
- $msg_hist[$id]['other'] = $other_data;
831
- $msg_hist[$id]['originates'] = intval($result->originates);
832
- }
833
-
834
-
835
-
836
-
837
- }
838
-
839
- return $msg_hist;
840
-
841
-
842
- }
843
-
844
-
845
-
846
-
847
-
848
- function wplc_return_no_answer_string($cid) {
849
-
850
- $wplc_settings = get_option("WPLC_SETTINGS");
851
- if (isset($wplc_settings['wplc_user_no_answer'])) {
852
- $string = stripslashes($wplc_settings['wplc_user_no_answer']);
853
- } else {
854
- $string = __("No agent was able to answer your chat request. Please try again.","wplivechat");
855
- }
856
- $string = apply_filters("wplc_filter_no_answer_string",$string,$cid);
857
- return "<span class='wplc_system_notification wplc_no_answer wplc-color-4'><center>".$string."</center></span>";
858
- }
859
- add_filter("wplc_filter_no_answer_string","wplc_filter_control_no_answer_string",10,2);
860
-
861
- /**
862
- * Add the "retry chat" button when an agent hasnt answered
863
- * @param string $string Original "No Answer" string
864
- * @param intval $cid Chat ID
865
- * @return string
866
- */
867
- function wplc_filter_control_no_answer_string($string,$cid) {
868
- $string = $string. " <br /><button class='wplc_retry_chat wplc-color-bg-1 wplc-color-2' cid='".$cid."'>".__("Request new chat","wplivechat")."</button>";
869
- return $string;
870
- }
871
-
872
-
873
- function wplc_change_chat_status($id,$status,$aid = 0) {
874
- global $wpdb;
875
- global $wplc_tblname_chats;
876
-
877
- if ($aid > 0) {
878
- /* only run when accepting a chat */
879
- $results = $wpdb->get_results("SELECT * FROM ".$wplc_tblname_chats." WHERE `id` = '".$id."' LIMIT 1");
880
- foreach ($results as $result) {
881
- $other = maybe_unserialize($result->other);
882
- if (isset($other['aid']) && $other['aid'] > 0) {
883
- /* we have recorded this already */
884
-
885
- } else {
886
- /* first time answering the chat! */
887
-
888
-
889
- /* send welcome note */
890
- /*
891
- removed in version 7. added "chat notification events" instead, i.e. Agent has joined the chat.
892
- $wplc_settings = get_option("WPLC_SETTINGS");
893
- $wplc_welcome = __('Welcome. How may I help you?', 'wplivechat');
894
- if(isset($wplc_settings['wplc_using_localization_plugin']) && $wplc_settings['wplc_using_localization_plugin'] == 1){ $wplc_using_locale = true; } else { $wplc_using_locale = false; }
895
- if (!isset($wplc_settings['wplc_user_welcome_chat']) || $wplc_settings['wplc_user_welcome_chat'] == "") { $wplc_settings['wplc_user_welcome_chat'] = $wplc_welcome; }
896
- $text2 = ($wplc_using_locale ? $wplc_welcome : stripslashes($wplc_settings['wplc_user_welcome_chat']));
897
-
898
- $chat_id = sanitize_text_field($id);
899
- $chat_msg = sanitize_text_field($text2);
900
- $wplc_rec_msg = wplc_record_chat_msg("2",$chat_id,$chat_msg);
901
-
902
- */
903
-
904
-
905
- }
906
-
907
- $other['aid'] = $aid;
908
- }
909
- }
910
-
911
-
912
-
913
-
914
- if ($aid > 0) {
915
- $wpdb->update(
916
- $wplc_tblname_chats,
917
- array(
918
- 'status' => $status,
919
- 'other' => maybe_serialize($other),
920
- 'agent_id' => $aid
921
- ),
922
- array('id' => $id),
923
- array(
924
- '%d',
925
- '%s',
926
- '%d'
927
- ),
928
- array('%d')
929
- );
930
- } else {
931
- $wpdb->update(
932
- $wplc_tblname_chats,
933
- array(
934
- 'status' => $status
935
- ),
936
- array('id' => $id),
937
- array('%d'),
938
- array('%d')
939
- );
940
- }
941
-
942
- do_action("wplc_change_chat_status_hook", $id, $status);
943
-
944
- return true;
945
-
946
- }
947
-
948
- //come back here
949
- function wplc_return_chat_messages($cid, $transcript = false, $html = true, $wplc_settings = false, $cdata = false, $display = 'string', $only_read_message = false) {
950
- global $wpdb;
951
- global $wplc_tblname_msgs;
952
-
953
-
954
- if (!$wplc_settings) {
955
- $wplc_settings = get_option("WPLC_SETTINGS");
956
- }
957
-
958
- if(isset($wplc_settings['wplc_display_name']) && $wplc_settings['wplc_display_name'] == 1){ $display_name = 1; } else { $display_name = 0; }
959
-
960
- $results = wplc_get_chat_messages($cid, $only_read_message, $wplc_settings);
961
- if (!$results) { return; }
962
-
963
- if (!$cdata) {
964
- $cdata = wplc_get_chat_data($cid,__LINE__);
965
- }
966
- $msg_array = array();
967
- $msg_hist = "";
968
- $previous_time = "";
969
- $previous_timestamp = 0;
970
- foreach ($results as $result) {
971
- $display_notification = false;
972
- $system_notification = false;
973
-
974
- $from = $result->msgfrom;
975
-
976
-
977
- /* added a control here to see if we should use the NODE ID instead of the SQL ID */
978
- if (empty($result->rel)) {
979
- $id = $result->id;
980
- } else {
981
- $id = $result->rel;
982
- }
983
- $msg = $result->msg;
984
-
985
-
986
- if ( isset( $result->other ) ) { $other_data = maybe_unserialize( $result->other ); } else { $other_data = array(); }
987
- if ($other_data == '') { $other_data = array(); }
988
-
989
- $timestamp = strtotime( $result->timestamp );
990
- $other_data['datetime'] = $timestamp;
991
- $other_data['datetimeUTC'] = strtotime( get_gmt_from_date( $result->timestamp ) );
992
- $nice_time = date("d M Y H:i:s",$timestamp);
993
-
994
-
995
- $agent_from = false;
996
-
997
- $image = "";
998
- if($result->originates == 1){
999
-
1000
- $agent_from = 'Agent';
1001
-
1002
- } else if ($result->originates == 2){
1003
-
1004
-
1005
- } else if ($result->originates == 0 || $result->originates == 3) {
1006
-
1007
-
1008
-
1009
- $system_notification = true;
1010
- $cuid = get_current_user_id();
1011
- $is_agent = get_user_meta(esc_html( $cuid ), 'wplc_ma_agent', true);
1012
- if ($is_agent && $result->originates == 3 ) {
1013
- /* this user is an agent and the notification is meant for an agent, therefore display it */
1014
- $display_notification = true;
1015
-
1016
- /* check if this came from the front end.. if it did, then dont display it (if this code is removed, all notifications will be displayed to agents who are logged in and chatting with themselves during testing, which may cause confusion) */
1017
- if (isset($_POST) && isset($_POST['action']) && sanitize_text_field( $_POST['action'] ) == "wplc_call_to_server_visitor") {
1018
- $display_notification = false;
1019
- }
1020
- }
1021
- else if (!$is_agent && $result->originates == 0) {
1022
- /* this user is a not an agent and the notification is meant for a users, therefore display it */
1023
- $display_notification = true;
1024
- } else {
1025
- /* this notification is not intended for this user */
1026
- $display_notification = false;
1027
- }
1028
- }
1029
-
1030
- if (!$system_notification) {
1031
-
1032
- if(function_exists('wplc_encrypt_decrypt_msg')){
1033
- $msg = wplc_encrypt_decrypt_msg($msg);
1034
- }
1035
-
1036
- $msg = apply_filters("wplc_filter_message_control_out",$msg);
1037
-
1038
- if( is_serialized( $msg ) ){
1039
- $msg_array = maybe_unserialize( $msg );
1040
-
1041
- if( is_array( $msg_array ) ){
1042
- $msg = $msg_array['m'];
1043
- } else {
1044
- $msg = $msg;
1045
- }
1046
-
1047
- $msg = stripslashes($msg);
1048
- }
1049
-
1050
- if ( isset( $result->afrom ) && intval( $result->afrom ) > 0 ) {
1051
- $msg_array[$id]['afrom'] = intval( $result->afrom ); $other_data['aid'] = intval( $result->afrom );
1052
-
1053
- }
1054
- if ( isset( $result->ato ) && intval( $result->ato ) > 0 ) { $msg_array[$id]['ato'] = intval( $result->ato ); }
1055
-
1056
-
1057
- /* use the new "other" array to get the AID and agent name */
1058
- if ( $result->originates == '1' && isset( $result->other ) ){
1059
- $other_data = maybe_unserialize( $result->other );
1060
- if ( isset( $other_data['aid'] ) ) {
1061
- $user_info = get_userdata( intval( $other_data['aid'] ) );
1062
- $agent_from = $user_info->display_name;
1063
- }
1064
-
1065
- }
1066
-
1067
- /* get the name of the USER if there is one */
1068
- if ( $result->originates == '2' && isset( $result->msgfrom ) ) {
1069
- $user_from = $result->msgfrom;
1070
- } else {
1071
- $user_from = 'User';
1072
- }
1073
-
1074
-
1075
- $msg_array[$id]['msg'] = $msg;
1076
-
1077
- if ($agent_from !== false) {
1078
- $msg_hist .= $agent_from . ": " . $msg . "<br />";
1079
- } else {
1080
- $msg_hist .= $user_from . ": " . $msg . "<br />";
1081
- }
1082
-
1083
-
1084
- $msg_array[$id]['originates'] = $result->originates;
1085
- $msg_array[$id]['other'] = $other_data;
1086
-
1087
-
1088
- } else {
1089
- /* this is a system notification */
1090
- if ($display_notification) {
1091
- $str = "<span class='chat_time wplc-color-4'>".$nice_time."</span> <span class='wplc_system_notification wplc-color-4'>".$msg."</span>";
1092
-
1093
- if ( !isset( $msg_array[$id] ) ) { $msg_array[$id] = array(); }
1094
- $msg_array[$id]['msg'] = $str;
1095
- $msg_array[$id]['other'] = $other_data;
1096
- $msg_array[$id]['originates'] = $result->originates;
1097
-
1098
- $msg_hist .= $str;
1099
- }
1100
- }
1101
-
1102
- }
1103
-
1104
- if ($display == 'string') { return $msg_hist; } else { return $msg_array; }
1105
-
1106
-
1107
- }
1108
-
1109
- /**
1110
- * Mark a message as 'read'
1111
- *
1112
- * Sets the 'status' of the message to 1 in the message table
1113
- *
1114
- * @param [int] $mid Message ID - Unique
1115
- * @return bool
1116
- */
1117
- function wplc_mark_message_as_read( $mid ) {
1118
- global $wpdb;
1119
- global $wplc_tblname_msgs;
1120
-
1121
- $wpdb->update(
1122
- $wplc_tblname_msgs,
1123
- array(
1124
- 'status' => 1
1125
- ),
1126
- array('id' => $mid),
1127
- array('%d'),
1128
- array('%d')
1129
- );
1130
- return true;
1131
- }
1132
-
1133
-
1134
- /**
1135
- * Mark all messages sent by an AGENT as read (a user has read them)
1136
- *
1137
- * @param int $cid Chat ID
1138
- * @return string "ok"
1139
- */
1140
- function wplc_mark_as_read_user_chat_messages($cid) {
1141
- global $wpdb;
1142
- global $wplc_tblname_msgs;
1143
-
1144
- $results = $wpdb->get_results("SELECT *
1145
- FROM $wplc_tblname_msgs
1146
- WHERE `chat_sess_id` = '$cid' AND `status` = '0' AND (`originates` = 1 OR `originates` = 0)
1147
- ORDER BY `timestamp` DESC");
1148
-
1149
-
1150
- foreach ($results as $result) {
1151
- $id = $result->id;
1152
-
1153
- $wpdb->update(
1154
- $wplc_tblname_msgs,
1155
- array(
1156
- 'status' => 1
1157
- ),
1158
- array('id' => $id),
1159
- array('%d'),
1160
- array('%d')
1161
- );
1162
-
1163
-
1164
- }
1165
- return "ok";
1166
-
1167
-
1168
- }
1169
- /**
1170
- * Mark all messages sent by a USER as read (an agent has read them)
1171
- *
1172
- * @param int $cid Chat ID
1173
- * @return string "ok"
1174
- */
1175
- function wplc_mark_as_read_agent_chat_messages($cid, $aid) {
1176
- global $wpdb;
1177
- global $wplc_tblname_msgs;
1178
-
1179
- $results = $wpdb->get_results("SELECT *
1180
- FROM $wplc_tblname_msgs
1181
- WHERE `chat_sess_id` = '$cid' AND `ato` = '".intval( $aid )."'
1182
- ORDER BY `timestamp` DESC");
1183
-
1184
-
1185
- foreach ($results as $result) {
1186
- $id = $result->id;
1187
-
1188
- $wpdb->update(
1189
- $wplc_tblname_msgs,
1190
- array(
1191
- 'status' => 1
1192
- ),
1193
- array('id' => $id),
1194
- array('%d'),
1195
- array('%d')
1196
- );
1197
-
1198
-
1199
- }
1200
- return "ok";
1201
-
1202
-
1203
- }
1204
-
1205
-
1206
- //here
1207
- function wplc_return_admin_chat_messages($cid) {
1208
- $wplc_current_user = get_current_user_id();
1209
- if( get_user_meta( $wplc_current_user, 'wplc_ma_agent', true ) ){
1210
- /*
1211
- -- modified in in 6.0.04 --
1212
-
1213
- if(current_user_can('wplc_ma_agent') || current_user_can('manage_options')){
1214
- */
1215
- $wplc_settings = get_option("WPLC_SETTINGS");
1216
-
1217
- if(isset($wplc_settings['wplc_display_name']) && $wplc_settings['wplc_display_name'] == 1){ $display_name = 1; } else { $display_name = 0; }
1218
-
1219
- global $wpdb;
1220
- global $wplc_tblname_msgs;
1221
-
1222
- /**
1223
- * `Originates` - codes:
1224
- * 0 - System notification to be delivered to users
1225
- * 1 - Message from an agent
1226
- * 2 - Message from a user
1227
- * 3 - System notification to be delivered to agents
1228
- *
1229
- */
1230
- $results = $wpdb->get_results("SELECT * FROM $wplc_tblname_msgs WHERE `chat_sess_id` = '$cid' AND `status` = '0' AND (`originates` = '2' OR `originates` = '3') ORDER BY `timestamp` ASC");
1231
-
1232
-
1233
- $msg_hist = array();
1234
- foreach ($results as $result) {
1235
- $system_notification = false;
1236
-
1237
- $id = $result->id;
1238
- wplc_mark_as_read_admin_chat_messages($id);
1239
- $from = $result->msgfrom;
1240
-
1241
-
1242
- $msg = $result->msg;
1243
-
1244
- if ( isset( $result->other ) ) { $other_data = maybe_unserialize( $result->other ); } else { $other_data = array(); }
1245
- if ($other_data == '') { $other_data = array(); }
1246
-
1247
- $timestamp = strtotime( $result->timestamp );
1248
- $other_data['datetime'] = $timestamp;
1249
- $other_data['datetimeUTC'] = strtotime( get_gmt_from_date( $result->timestamp ) );
1250
-
1251
- if (intval($result->originates) == 3) {
1252
- /*
1253
- system notifications
1254
- from version 7
1255
- */
1256
- $system_notification = true;
1257
-
1258
- }
1259
- else {
1260
-
1261
-
1262
- }
1263
-
1264
- if (!$system_notification) {
1265
- /* this is a normal message */
1266
- if(function_exists('wplc_encrypt_decrypt_msg')){
1267
- $msg = wplc_encrypt_decrypt_msg($msg);
1268
- }
1269
-
1270
- $msg_array = maybe_unserialize( $msg );
1271
-
1272
- if( is_array( $msg_array ) ){
1273
- $msg = $msg_array['m'];
1274
- }
1275
-
1276
- $msg = stripslashes($msg);
1277
-
1278
- $msg = apply_filters("wplc_filter_message_control_out",$msg);
1279
-
1280
- $msg = stripslashes($msg);
1281
-
1282
- $msg_hist[$id]['msg'] = $msg;
1283
- $msg_hist[$id]['originates'] = intval($result->originates);
1284
- $msg_hist[$id]['other'] = $other_data;
1285
-
1286
- } else {
1287
- /* add the system notification to the list */
1288
- if ( isset( $msg_hist[$id] ) ) { $msg_hist[$id] = array(); }
1289
-
1290
- $msg_hist[$id]['msg'] = $msg;
1291
- $msg_hist[$id]['other'] = $other_data;
1292
- $msg_hist[$id]['originates'] = intval($result->originates);
1293
- }
1294
-
1295
-
1296
-
1297
-
1298
- }
1299
-
1300
- return $msg_hist;
1301
- }
1302
-
1303
-
1304
-
1305
- else {
1306
- return "security issue";
1307
- }
1308
-
1309
-
1310
- }
1311
-
1312
- /**
1313
- * Mark all messages sent by a USER as read (an agent has read them)
1314
- *
1315
- * @param int $cid Chat ID
1316
- * @return string "ok"
1317
- */
1318
- function wplc_mark_as_read_admin_chat_messages( $mid ) {
1319
- $wplc_current_user = get_current_user_id();
1320
-
1321
- if( get_user_meta( $wplc_current_user, 'wplc_ma_agent', true ) ){
1322
- global $wpdb;
1323
- global $wplc_tblname_msgs;
1324
-
1325
- $wpdb->update(
1326
- $wplc_tblname_msgs,
1327
- array(
1328
- 'status' => 1
1329
- ),
1330
- array('id' => $mid),
1331
- array('%d'),
1332
- array('%d')
1333
- );
1334
-
1335
- } else { return "security issue"; }
1336
-
1337
- return "ok";
1338
- }
1339
-
1340
-
1341
-
1342
-
1343
-
1344
- function wplc_return_chat_session_variable($cid) {
1345
- global $wpdb;
1346
- global $wplc_tblname_chats;
1347
- $results = $wpdb->get_results(
1348
- "
1349
- SELECT *
1350
- FROM $wplc_tblname_chats
1351
- WHERE `id` = '$cid'
1352
- "
1353
- );
1354
- foreach ($results as $result) {
1355
- return $result->session;
1356
- }
1357
- }
1358
-
1359
-
1360
-
1361
- function wplc_return_chat_status($cid) {
1362
- global $wpdb;
1363
- global $wplc_tblname_chats;
1364
- $results = $wpdb->get_results(
1365
- "
1366
- SELECT *
1367
- FROM $wplc_tblname_chats
1368
- WHERE `id` = '$cid'
1369
- "
1370
- );
1371
- foreach ($results as $result) {
1372
- return $result->status;
1373
- }
1374
- }
1375
-
1376
-
1377
- function wplc_return_status($status) {
1378
- if ($status == 1) {
1379
- return __("complete","wplivechat");
1380
- }
1381
- if ($status == 2) {
1382
- return __("pending", "wplivechat");
1383
- }
1384
- if ($status == 3) {
1385
- return __("active", "wplivechat");
1386
- }
1387
- if ($status == 4) {
1388
- return __("deleted", "wplivechat");
1389
- }
1390
- if ($status == 5) {
1391
- return __("browsing", "wplivechat");
1392
- }
1393
- if ($status == 6) {
1394
- return __("requesting chat", "wplivechat");
1395
- }
1396
- if($status == 8){
1397
- return __("Chat Ended - User still browsing", "wplivechat");
1398
- }
1399
- if($status == 9){
1400
- return __("User is browsing but doesn't want to chat", "wplivechat");
1401
- }
1402
-
1403
- }
1404
-
1405
- add_filter("wplc_filter_mail_body","wplc_filter_control_mail_body",10,2);
1406
- function wplc_filter_control_mail_body($header,$msg) {
1407
- $primary_bg_color = apply_filters("wplc_mailer_bg_color", "#ec822c"); //Default orange
1408
- $body = '
1409
- <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">
1410
- <html>
1411
-
1412
- <body>
1413
-
1414
-
1415
-
1416
- <table id="" border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color: ' . $primary_bg_color . ';">
1417
- <tbody>
1418
- <tr>
1419
- <td width="100%" style="padding: 30px 20px 100px 20px;">
1420
- <table align="center" cellpadding="0" cellspacing="0" class="" width="100%" style="border-collapse: separate; max-width:600px;">
1421
- <tbody>
1422
- <tr>
1423
- <td style="text-align: center; padding-bottom: 20px;">
1424
-
1425
- <p>'.$header.'</p>
1426
- </td>
1427
- </tr>
1428
- </tbody>
1429
- </table>
1430
-
1431
- <table id="" align="center" cellpadding="0" cellspacing="0" class="" width="100%" style="border-collapse: separate; max-width: 600px; font-family: Georgia, serif; font-size: 12px; color: rgb(51, 62, 72); border: 0px solid rgb(255, 255, 255); border-radius: 10px; background-color: rgb(255, 255, 255);">
1432
- <tbody>
1433
- <tr>
1434
- <td class="sortable-list ui-sortable" style="padding:20px; text-align:center;">
1435
- '.nl2br($msg).'
1436
- </td>
1437
- </tr>
1438
- </tbody>
1439
- </table>
1440
-
1441
- <table align="center" cellpadding="0" cellspacing="0" class="" width="100%" style="border-collapse: separate; max-width:100%;">
1442
- <tbody>
1443
- <tr>
1444
- <td style="padding:20px;">
1445
- <table border="0" cellpadding="0" cellspacing="0" class="" width="100%">
1446
- <tbody>
1447
- <tr>
1448
- <td id="" align="center">
1449
- <p>'.site_url().'</p>
1450
- </td>
1451
- </tr>
1452
- </tbody>
1453
- </table>
1454
- </td>
1455
- </tr>
1456
- </tbody>
1457
- </table>
1458
- </td>
1459
- </tr>
1460
- </tbody>
1461
- </table>
1462
-
1463
-
1464
-
1465
- </div>
1466
- </body>
1467
- </html>
1468
- ';
1469
- return $body;
1470
- }
1471
-
1472
-
1473
- add_filter("wplc_mailer_bg_color","wplc_fitler_mailer_bg_color",10,1);
1474
- function wplc_fitler_mailer_bg_color($default_color) {
1475
- $wplc_settings = get_option('WPLC_SETTINGS');
1476
-
1477
- if (isset($wplc_settings['wplc_theme'])) {
1478
- $wplc_theme = $wplc_settings['wplc_theme'];
1479
- }
1480
-
1481
- if (isset($wplc_theme)) {
1482
- if($wplc_theme == 'theme-1') {
1483
- $default_color = "#DB0000";
1484
- } else if ($wplc_theme == 'theme-2'){
1485
- $default_color = "#000000";
1486
- } else if ($wplc_theme == 'theme-3'){
1487
- $default_color = "#B97B9D";
1488
- } else if ($wplc_theme == 'theme-4'){
1489
- $default_color = "#1A14DB";
1490
- } else if ($wplc_theme == 'theme-5'){
1491
- $default_color = "#3DCC13";
1492
- } else if ($wplc_theme == 'theme-6'){
1493
- //Check what color is selected in palette
1494
- if (isset($wplc_settings["wplc_settings_color1"])) {
1495
- $default_color = "#" . $wplc_settings["wplc_settings_color1"];
1496
- }
1497
- }
1498
- }
1499
-
1500
- return $default_color;
1501
- }
1502
-
1503
- /**
1504
- * Send an email to the admin based on the settings in the settings page
1505
- * @param string $reply_to email of the user
1506
- * @param string $reply_to_name name of the user
1507
- * @param string $subject subject
1508
- * @param string $msg message being emailed
1509
- * @return void
1510
- * @since 5.1.00
1511
- */
1512
- function wplcmail($reply_to,$reply_to_name,$subject,$msg) {
1513
-
1514
- $upload_dir = wp_upload_dir();
1515
-
1516
- $wplc_pro_settings = get_option("WPLC_SETTINGS");
1517
- if(isset($wplc_pro_settings['wplc_pro_chat_email_address'])){
1518
- $email_address = $wplc_pro_settings['wplc_pro_chat_email_address'];
1519
- }else{
1520
- $email_address = get_option('admin_email');
1521
- }
1522
-
1523
- $email_address = explode(',', $email_address);
1524
-
1525
- if(get_option("wplc_mail_type") == "wp_mail" || !get_option('wplc_mail_type')){
1526
- $headers[] = 'Content-type: text/html';
1527
- $headers[] = 'Reply-To: '.$reply_to_name.'<'.$reply_to.'>';
1528
- if($email_address){
1529
- foreach($email_address as $email){
1530
- /* Send offline message to each email address */
1531
- $overbody = apply_filters("wplc_filter_mail_body",$subject,$msg);
1532
- if (!wp_mail($email, $subject, $overbody, $headers)) {
1533
- $handle = fopen($upload_dir['basedir'].'/wp_livechat_error_log.txt', 'a');
1534
- $error = date("Y-m-d H:i:s") . " WP-Mail Failed to send \n";
1535
- @fwrite($handle, $error);
1536
- }
1537
- }
1538
- }
1539
- // $to = $wplc_pro_settings['wplc_pro_chat_email_address'];
1540
- return;
1541
- } else {
1542
-
1543
-
1544
-
1545
- //require 'phpmailer/PHPMailerAutoload.php';
1546
- $wplc_pro_settings = get_option("WPLC_PRO_SETTINGS");
1547
- $host = get_option('wplc_mail_host');
1548
- $port = get_option('wplc_mail_port');
1549
- $username = get_option("wplc_mail_username");
1550
- $password = get_option("wplc_mail_password");
1551
- if($host && $port && $username && $password){
1552
- //Create a new PHPMailer instance
1553
-
1554
- global $phpmailer;
1555
-
1556
- // (Re)create it, if it's gone missing
1557
- if ( ! ( $phpmailer instanceof PHPMailer ) ) {
1558
- require_once ABSPATH . WPINC . '/class-phpmailer.php';
1559
- require_once ABSPATH . WPINC . '/class-smtp.php';
1560
- $mail = new PHPMailer( true );
1561
- }
1562
-
1563
-
1564
-
1565
- //$mail = new PHPMailer();
1566
-
1567
-
1568
- $mail->isSMTP();
1569
- //Enable SMTP debugging
1570
- // 0 = off (for production use)
1571
- // 1 = client messages
1572
- // 2 = client and server messages
1573
- $mail->SMTPDebug = 0;
1574
- //Ask for HTML-friendly debug output
1575
- $mail->Debugoutput = 'html';
1576
- //Set the hostname of the mail server
1577
- $mail->Host = $host;
1578
- //Set the SMTP port number - likely to be 25, 26, 465 or 587
1579
- $mail->Port = $port;
1580
- //Set the encryption system to use - ssl (deprecated) or tls
1581
- if($port == "587"){
1582
- $mail->SMTPSecure = 'tls';
1583
- } else if($port == "465"){
1584
- $mail->SMTPSecure = 'ssl';
1585
- }
1586
-
1587
- // Empty out the values that may be set
1588
- $mail->ClearAllRecipients();
1589
- $mail->ClearAttachments();
1590
- $mail->ClearCustomHeaders();
1591
- $mail->ClearReplyTos();
1592
-
1593
-
1594
- //Whether to use SMTP authentication
1595
- $mail->SMTPAuth = true;
1596
- //Username to use for SMTP authentication
1597
- $mail->Username = $username;
1598
- //Password to use for SMTP authentication
1599
- $mail->Password = $password;
1600
- //Set who the message is to be sent from
1601
- $mail->setFrom($reply_to, $reply_to_name);
1602
- //Set who the message is to be sent to
1603
- if($email_address){
1604
- foreach($email_address as $email){
1605
- $mail->addAddress($email);
1606
- }
1607
- }
1608
- //Set the subject line
1609
- $mail->Subject = $subject;
1610
- //Read an HTML message body from an external file, convert referenced images to embedded,
1611
- //convert HTML into a basic plain-text alternative body
1612
- $body = apply_filters("wplc_filter_mail_body",$subject,$msg);
1613
- $mail->msgHTML($body);
1614
- //Replace the plain text body with one created manually
1615
- $mail->AltBody = $msg;
1616
-
1617
-
1618
- //send the message, check for errors
1619
- if (!$mail->send()) {
1620
- $handle = fopen($upload_dir['basedir'].'/wp_livechat_error_log.txt', 'a');
1621
- $error = date("Y-m-d H:i:s")." ".$mail->ErrorInfo." \n";
1622
- @fwrite($handle, $error);
1623
- }
1624
- return;
1625
- }
1626
- }
1627
- }
1628
- /**
1629
- * Sends offline messages to the admin (normally via ajax)
1630
- * @param string $name Name of the user
1631
- * @param string $email Email of the user
1632
- * @param string $msg The message being sent to the admin
1633
- * @param int $cid Chat ID
1634
- * @return void
1635
- */
1636
- function wplc_send_offline_msg($name,$email,$msg,$cid) {
1637
- $subject = apply_filters("wplc_offline_message_subject_filter", __("WP Live Chat Support - Offline Message from ", "wplivechat") ) . "$name";
1638
- $msg = __("Name", "wplivechat").": $name \n".
1639
- __("Email", "wplivechat").": $email\n".
1640
- __("Message", "wplivechat").": $msg\n\n".
1641
- __("Via WP Live Chat Support", "wplivechat");
1642
- wplcmail($email,$name, $subject, $msg);
1643
- return;
1644
- }
1645
-
1646
-
1647
- /**
1648
- * Saves offline messages to the database
1649
- * @param string $name User name
1650
- * @param string $email User email
1651
- * @param string $message Message being saved
1652
- * @return Void
1653
- * @since 5.1.00
1654
- */
1655
- function wplc_store_offline_message($name, $email, $message){
1656
- global $wpdb;
1657
- global $wplc_tblname_offline_msgs;
1658
-
1659
- $wplc_settings = get_option('WPLC_SETTINGS');
1660
-
1661
- /** DEPRECATED BY GDPR */
1662
- /**if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
1663
- if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {
1664
- $ip_address = sanitize_text_field($_SERVER['HTTP_X_FORWARDED_FOR']);
1665
- } else {
1666
- $ip_address = sanitize_text_field($_SERVER['REMOTE_ADDR']);
1667
- }
1668
- $offline_ip_address = $ip_address;
1669
- } else {
1670
- $offline_ip_address = "";
1671
- }*/
1672
-
1673
- $offline_ip_address = "";
1674
-
1675
-
1676
- $ins_array = array(
1677
- 'timestamp' => current_time('mysql'),
1678
- 'name' => sanitize_text_field($name),
1679
- 'email' => sanitize_email($email),
1680
- 'message' => implode( "\n", array_map( 'sanitize_text_field', explode( "\n", $message ) ) ),
1681
- 'ip' => sanitize_text_field($offline_ip_address),
1682
- 'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
1683
- );
1684
-
1685
- $rows_affected = $wpdb->insert( $wplc_tblname_offline_msgs, $ins_array );
1686
- return;
1687
- }
1688
- /**
1689
- * Send what we have found as a system notification
1690
- */
1691
- function wplc_send_welcome($cid,$wplc_settings) {
1692
-
1693
- if (!isset($wplc_settings['wplc_welcome_msg'])) { $wplc_settings['wplc_welcome_msg'] = __("Please standby for an agent. While you wait for the agent you may type your message.","wplivechat"); }
1694
- $mdata = array(
1695
- 'msg' => $wplc_settings['wplc_welcome_msg']
1696
- );
1697
- wplc_record_chat_notification('await_agent',$cid,$mdata);
1698
- return;
1699
-
1700
- }
1701
-
1702
-
1703
- function wplc_user_initiate_chat($name,$email,$cid = null,$session) {
1704
-
1705
- global $wpdb;
1706
- global $wplc_tblname_chats;
1707
-
1708
-
1709
- $wplc_settings = get_option('WPLC_SETTINGS');
1710
-
1711
- /** DEPRECATED BY GDPR */
1712
- /*if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
1713
- if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {
1714
- $ip_address = sanitize_text_field($_SERVER['HTTP_X_FORWARDED_FOR']);
1715
- } else {
1716
- $ip_address = sanitize_text_field($_SERVER['REMOTE_ADDR']);
1717
- }
1718
- $user_data = array(
1719
- 'ip' => $ip_address,
1720
- 'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
1721
- );
1722
- $wplc_ce_ip = $ip_address;
1723
- } else {
1724
- $user_data = array(
1725
- 'ip' => "",
1726
- 'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
1727
- );
1728
- $wplc_ce_ip = null;
1729
- }*/
1730
-
1731
- $user_data = array(
1732
- 'ip' => "",
1733
- 'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
1734
- );
1735
- $wplc_ce_ip = null;
1736
-
1737
- if(function_exists('wplc_ce_activate')){
1738
- /* Log the chat for statistical purposes as well */
1739
- if(function_exists('wplc_ce_record_initial_chat')){
1740
- wplc_ce_record_initial_chat($name, $email, $cid, $wplc_ce_ip, sanitize_text_field($_SERVER['HTTP_REFERER']));
1741
- }
1742
- }
1743
-
1744
- if ($cid != null) {
1745
- /* change from a visitor to a chat */
1746
-
1747
- /**
1748
- * This helps us identify if this user needs to be answered. The user can start typing so long but an agent still needs to answer the chat
1749
- * @var serialized array
1750
- */
1751
- $chat_data = wplc_get_chat_data($cid,__LINE__);
1752
-
1753
- if (isset($chat_data->other)) {
1754
- $other_data = maybe_unserialize( $chat_data->other );
1755
- $other_data['unanswered'] = true;
1756
-
1757
- $other_data = apply_filters("wplc_start_chat_hook_other_data_hook", $other_data);
1758
- if (!isset($other_data['welcome'])) {
1759
- //wplc_send_welcome($cid,$wplc_settings);
1760
- $other_data['welcome'] = true;
1761
- }
1762
-
1763
- } else {
1764
- //wplc_send_welcome($cid,$wplc_settings);
1765
- $other_data = array();
1766
- $other_data['welcome'] = true;
1767
-
1768
- }
1769
-
1770
-
1771
- $wpdb->update(
1772
- $wplc_tblname_chats,
1773
- array(
1774
- 'status' => 2,
1775
- 'timestamp' => current_time('mysql'),
1776
- 'name' => $name,
1777
- 'email' => $email,
1778
- 'session' => $session,
1779
- 'ip' => maybe_serialize($user_data),
1780
- 'url' => sanitize_text_field($_SERVER['HTTP_REFERER']),
1781
- 'last_active_timestamp' => current_time('mysql'),
1782
- 'other' => maybe_serialize($other_data)
1783
- ),
1784
- array('id' => $cid),
1785
- array(
1786
- '%d',
1787
- '%s',
1788
- '%s',
1789
- '%s',
1790
- '%s',
1791
- '%s',
1792
- '%s',
1793
- '%s',
1794
- '%s'
1795
- ),
1796
- array('%d')
1797
- );
1798
-
1799
- do_action("wplc_hook_initiate_chat",array("cid" => $cid, "name" => $name, "email" => $email));
1800
-
1801
- do_action("wplc_start_chat_hook_after_data_insert", $cid);
1802
- return $cid;
1803
- }
1804
- else {
1805
- $other_data = array();
1806
- $other_data['unanswered'] = true;
1807
-
1808
- $other_data = apply_filters("wplc_start_chat_hook_other_data_hook", $other_data);
1809
-
1810
-
1811
-
1812
- $wpdb->insert(
1813
- $wplc_tblname_chats,
1814
- array(
1815
- 'status' => 2,
1816
- 'timestamp' => current_time('mysql'),
1817
- 'name' => $name,
1818
- 'email' => $email,
1819
- 'session' => $session,
1820
- 'ip' => maybe_serialize($user_data),
1821
- 'url' => sanitize_text_field($_SERVER['HTTP_REFERER']),
1822
- 'last_active_timestamp' => current_time('mysql'),
1823
- 'other' => maybe_serialize($other_data)
1824
- ),
1825
- array(
1826
- '%s',
1827
- '%s',
1828
- '%s',
1829
- '%s',
1830
- '%s',
1831
- '%s',
1832
- '%s',
1833
- '%s',
1834
- '%s'
1835
- )
1836
- );
1837
-
1838
-
1839
- $lastid = $wpdb->insert_id;
1840
-
1841
-
1842
-
1843
-
1844
- /* Nick: moved from top of function to bottom of function to try speed up the process of accepting the chart - version 7 */
1845
- if (function_exists("wplc_list_chats_pro")) { /* check if functions-pro is around */
1846
- wplc_pro_notify_via_email();
1847
- }
1848
-
1849
- do_action("wplc_start_chat_hook_after_data_insert", $lastid);
1850
- return $lastid;
1851
- }
1852
-
1853
- }
1854
-
1855
-
1856
-
1857
- function wplc_get_msg() {
1858
- return "<a href=\"javascript:void(0);\" class=\"wplc_second_chat_request button button-primary\" style='cursor:not-allowed' title=\"".__("Get Pro Add-on to accept more chats","wplivechat")."\" target=\"_BLANK\">".__("Accept Chat","wplivechat")."</a>";
1859
- }
1860
- function wplc_update_chat_statuses() {
1861
- global $wpdb;
1862
- global $wplc_tblname_chats;
1863
- $results = $wpdb->get_results(
1864
- "
1865
- SELECT *
1866
- FROM $wplc_tblname_chats
1867
- WHERE `status` = '2' OR `status` = '3' OR `status` = '5' or `status` = '8' or `status` = '9' or `status` = '10' or `status` = 12
1868
- "
1869
- );
1870
- foreach ($results as $result) {
1871
- $id = $result->id;
1872
- $timestamp = strtotime($result->last_active_timestamp);
1873
- $datenow = current_time('timestamp');
1874
- $difference = $datenow - $timestamp;
1875
-
1876
-
1877
-
1878
- if (intval($result->status) == 2) {
1879
- if ($difference >= 30) { // 60 seconds max
1880
- wplc_change_chat_status($id,12);
1881
- }
1882
- }
1883
- else if (intval($result->status) == 12) {
1884
- if ($difference >= 30) { // 30 seconds max
1885
- wplc_change_chat_status($id,0);
1886
- }
1887
- }
1888
- else if (intval($result->status) == 3) {
1889
- if ($difference >= 300) { // 5 minutes
1890
- wplc_change_chat_status($id,1);
1891
- }
1892
- }
1893
- else if (intval($result->status) == 5) {
1894
- if ($difference >= 120) { // 2 minute timeout
1895
- wplc_change_chat_status($id,7); // 7 - timedout
1896
- }
1897
- } else if(intval($result->status) == 8){ // chat is complete but user is still browsing
1898
- if ($difference >= 45) { // 30 seconds
1899
- wplc_change_chat_status($id,1); // 1 - chat is now complete
1900
- }
1901
- } else if(intval($result->status) == 9 || $result->status == 10){
1902
- if ($difference >= 120) { // 120 seconds
1903
- wplc_change_chat_status($id,7); // 7 - timedout
1904
- }
1905
- }
1906
- }
1907
- }
1908
- function wplc_check_pending_chats(){
1909
- global $wpdb;
1910
- global $wplc_tblname_chats;
1911
- $sql = "SELECT * FROM `$wplc_tblname_chats` WHERE `status` = 2";
1912
- $wpdb->query($sql);
1913
- $results = $wpdb->get_results($sql);
1914
- if($results){
1915
- foreach ($results as $result) {
1916
- $other = maybe_unserialize($result->other);
1917
- if (isset($other['unanswered'])) {
1918
- return true;
1919
- }
1920
- }
1921
-
1922
- }
1923
- return false;
1924
- }
1925
- function wplc_get_active_and_pending_chats(){
1926
- global $wpdb;
1927
- global $wplc_tblname_chats;
1928
- $sql = "SELECT * FROM `$wplc_tblname_chats` WHERE `status` = 2 OR `status` = 3 ORDER BY `status`";
1929
- $results = $wpdb->get_results($sql);
1930
- if($results){
1931
- return $results;
1932
- } else {
1933
- return false;
1934
- }
1935
- }
1936
- function wplc_convert_array_to_string($array){
1937
- $string = "";
1938
- if($array){
1939
- foreach($array as $value){
1940
- $string.= $value->id." ;";
1941
- }
1942
- } else {
1943
- $string = false;
1944
- }
1945
- return $string;
1946
- }
1947
-
1948
- function wplc_return_browser_image($string,$size) {
1949
- switch($string) {
1950
-
1951
- case "Internet Explorer":
1952
- return "internet-explorer_".$size."x".$size.".png";
1953
- break;
1954
- case "Mozilla Firefox":
1955
- return "firefox_".$size."x".$size.".png";
1956
- break;
1957
- case "Opera":
1958
- return "opera_".$size."x".$size.".png";
1959
- break;
1960
- case "Google Chrome":
1961
- return "chrome_".$size."x".$size.".png";
1962
- break;
1963
- case "Safari":
1964
- return "safari_".$size."x".$size.".png";
1965
- break;
1966
- case "Other browser":
1967
- return "web_".$size."x".$size.".png";
1968
- break;
1969
- default:
1970
- return "web_".$size."x".$size.".png";
1971
- break;
1972
- }
1973
-
1974
-
1975
- }
1976
- function wplc_return_browser_string($user_agent) {
1977
- if(strpos($user_agent, 'MSIE') !== FALSE)
1978
- return 'Internet Explorer';
1979
- elseif(strpos($user_agent, 'Trident') !== FALSE) //For Supporting IE 11
1980
- return 'Internet Explorer';
1981
- elseif(strpos($user_agent, 'Edge') !== FALSE)
1982
- return 'Internet Explorer';
1983
- elseif(strpos($user_agent, 'Firefox') !== FALSE)
1984
- return 'Mozilla Firefox';
1985
- elseif(strpos($user_agent, 'Chrome') !== FALSE)
1986
- return 'Google Chrome';
1987
- elseif(strpos($user_agent, 'Opera Mini') !== FALSE)
1988
- return "Opera";
1989
- elseif(strpos($user_agent, 'Opera') !== FALSE)
1990
- return "Opera";
1991
- elseif(strpos($user_agent, 'Safari') !== FALSE)
1992
- return "Safari";
1993
- else
1994
- return 'Other browser';
1995
- }
1996
-
1997
- function wplc_error_directory() {
1998
- $upload_dir = wp_upload_dir();
1999
-
2000
- if (is_multisite()) {
2001
- if (!file_exists($upload_dir['basedir'].'/wp-live-chat-support')) {
2002
- wp_mkdir_p($upload_dir['basedir'].'/wp-live-chat-support');
2003
- $content = "Error log created";
2004
- $fp = @fopen($upload_dir['basedir'].'/wp-live-chat-support/error_log.txt','w+');
2005
- @fwrite($fp,$content);
2006
- }
2007
- } else {
2008
- if (!file_exists($upload_dir['basedir'] .'/wp-live-chat-support')) {
2009
- wp_mkdir_p($upload_dir['basedir'] . '/wp-live-chat-support');
2010
- $content = "Error log created";
2011
- $fp = @fopen($upload_dir['basedir'] . '/wp-live-chat-support/error_log.txt','w+');
2012
- @fwrite($fp,$content);
2013
- }
2014
-
2015
- }
2016
- return true;
2017
-
2018
- }
2019
-
2020
- function wplc_error_log($error) {
2021
- return;
2022
- $upload_dir = wp_upload_dir();
2023
- $content = "\r\n[".date("Y-m-d")."] [".date("H:i:s")."]".$error;
2024
- $fp = @fopen($upload_dir['basedir'].'/wp-live-chat-support/error_log.txt','a+');
2025
- @fwrite($fp,$content);
2026
- @fclose($fp);
2027
-
2028
-
2029
- }
2030
- function Memory_Usage($decimals = 2) {
2031
- $result = 0;
2032
-
2033
- if (function_exists('memory_get_usage')) {
2034
- $result = memory_get_usage() / 1024;
2035
- }
2036
-
2037
- else {
2038
- if (function_exists('exec')) {
2039
- $output = array();
2040
-
2041
- if (substr(strtoupper(PHP_OS), 0, 3) == 'WIN') {
2042
- exec('tasklist /FI "PID eq ' . getmypid() . '" /FO LIST', $output);
2043
-
2044
- $result = preg_replace('/[\D]/', '', $output[5]);
2045
- }
2046
-
2047
- else {
2048
- exec('ps -eo%mem,rss,pid | grep ' . getmypid(), $output);
2049
-
2050
- $output = explode(' ', $output[0]);
2051
-
2052
- $result = $output[1];
2053
- }
2054
- }
2055
- }
2056
-
2057
- return number_format(intval($result) / 1024, $decimals, '.', '')." mb";
2058
- }
2059
- function wplc_get_memory_usage() {
2060
- $size = memory_get_usage(true);
2061
- $unit=array('b','kb','mb','gb','tb','pb');
2062
- return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];
2063
-
2064
- }
2065
- function wplc_record_mem() {
2066
- $upload_dir = wp_upload_dir();
2067
- $data = array(
2068
- 'date' => current_time('mysql'),
2069
- 'php_mem' => wplc_get_memory_usage()
2070
- );
2071
- $fp = @fopen($upload_dir['basedir'].'/wp-live-chat-support'."/mem_usag.csv","a+");
2072
- fputcsv($fp, $data);
2073
- fclose($fp);
2074
- }
2075
-
2076
- function wplc_admin_display_missed_chats() {
2077
-
2078
- global $wpdb;
2079
- global $wplc_tblname_chats;
2080
-
2081
-
2082
- if(isset($_GET['wplc_action']) && $_GET['wplc_action'] == 'remove_missed_cid'){
2083
- if(isset($_GET['cid'])){
2084
- if(isset($_GET['wplc_confirm'])){
2085
- //Confirmed - delete
2086
- $delete_sql = "";
2087
- if ( empty( $_GET['cid'] ) ) {
2088
- exit('No CID?');
2089
- }
2090
- $delete_sql = "DELETE FROM $wplc_tblname_chats WHERE `id` = '".intval( sanitize_text_field( $_GET['cid'] ) )."' LIMIT 1";
2091
-
2092
- $wpdb->query($delete_sql);
2093
- if ($wpdb->last_error) {
2094
- echo "<div class='update-nag' style='margin-top: 0px;margin-bottom: 5px;'>
2095
- ".__("Error: Could not delete chat", "wplivechat")."<br>
2096
- </div>";
2097
- } else {
2098
- echo "<div class='update-nag' style='margin-top: 0px;margin-bottom: 5px;border-color:#67d552;'>
2099
- ".__("Chat Deleted", "wplivechat")."<br>
2100
- </div>";
2101
- }
2102
-
2103
- } else {
2104
- //Prompt
2105
- echo "<div class='update-nag' style='margin-top: 0px;margin-bottom: 5px;'>
2106
- ".__("Are you sure you would like to delete this chat?", "wplivechat")."<br>
2107
- <a class='button' href='?page=wplivechat-menu-missed-chats&wplc_action=remove_missed_cid&cid=".$_GET['cid']."&wplc_confirm=1''>".__("Yes", "wplivechat")."</a> <a class='button' href='?page=wplivechat-menu-missed-chats'>".__("No", "wplivechat")."</a>
2108
- </div>";
2109
- }
2110
- }
2111
- }
2112
-
2113
- echo "
2114
- <table class=\"wp-list-table widefat fixed \" cellspacing=\"0\">
2115
- <thead>
2116
- <tr>
2117
- <th class='manage-column column-id'><span>" . __("Date", "wplivechat") . "</span></th>
2118
- <th scope='col' id='wplc_name_colum' class='manage-column column-id'><span>" . __("Name", "wplivechat") . "</span></th>
2119
- <th scope='col' id='wplc_email_colum' class='manage-column column-id'>" . __("Email", "wplivechat") . "</th>
2120
- <th scope='col' id='wplc_url_colum' class='manage-column column-id'>" . __("URL", "wplivechat") . "</th>
2121
- <th scope='col' id='wplc_url_colum' class='manage-column column-id'>" . __("Action", "wplivechat") . "</th>
2122
- </tr>
2123
- </thead>
2124
- <tbody id=\"the-list\" class='list:wp_list_text_link'>";
2125
-
2126
- $pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 1;
2127
- $limit = 20; // number of rows in page
2128
- $offset = ( $pagenum - 1 ) * $limit;
2129
- if (function_exists("wplc_register_pro_version")) {
2130
- $total = $wpdb->get_var( "SELECT COUNT(`id`) FROM $wplc_tblname_chats WHERE (`status` = 0 OR `agent_id` = 0)" );
2131
- } else {
2132
- $total = $wpdb->get_var( "SELECT COUNT(`id`) FROM $wplc_tblname_chats WHERE `status` = 0" );
2133
- }
2134
- $num_of_pages = ceil( $total / $limit );
2135
-
2136
- if (function_exists("wplc_register_pro_version")) {
2137
- $sql = "SELECT * FROM $wplc_tblname_chats WHERE (`status` = 0 OR `agent_id` = 0) ORDER BY `timestamp` DESC LIMIT $limit OFFSET $offset";
2138
- } else {
2139
- $sql = "SELECT * FROM $wplc_tblname_chats WHERE `status` = 0 ORDER BY `timestamp` DESC LIMIT $limit OFFSET $offset";
2140
- }
2141
-
2142
- $results = $wpdb->get_results($sql);
2143
-
2144
- if (!$results) {
2145
- echo "<tr><td></td><td>" . __("You have not missed any chat requests.", "wplivechat") . "</td></tr>";
2146
- } else {
2147
- foreach ($results as $result) {
2148
-
2149
- $url = admin_url('admin.php?page=wplivechat-menu&action=history&cid=' . $result->id);
2150
- $url2 = admin_url('admin.php?page=wplivechat-menu&action=download_history&type=csv&cid=' . $result->id);
2151
- $url3 = "?page=wplivechat-menu-missed-chats&wplc_action=remove_missed_cid&cid=" . $result->id;
2152
- $actions = "
2153
- <a href='$url' class='button' title='".__('View Chat History', 'wplivechat')."' target='_BLANK' id=''><i class='fa fa-eye'></i></a> <a href='$url2' class='button' title='".__('Download Chat History', 'wplivechat')."' target='_BLANK' id=''><i class='fa fa-download'></i></a> <a href='$url3' class='button'><i class='fa fa-trash-o'></i></a>
2154
- ";
2155
-
2156
- echo "<tr id=\"record_" . $result->id . "\">";
2157
- echo "<td class='chat_id column-chat_d'>" . sanitize_text_field($result->timestamp) . "</td>";
2158
- echo "<td class='chat_name column_chat_name' id='chat_name_" . $result->id . "'><img src=\"//www.gravatar.com/avatar/" . md5($result->email) . "?s=30\" class='wplc-user-message-avatar' /> " . sanitize_text_field($result->name) . "</td>";
2159
- echo "<td class='chat_email column_chat_email' id='chat_email_" . $result->id . "'><a href='mailto:" . sanitize_text_field($result->email) . "' title='Email " . ".$result->email." . "'>" . sanitize_text_field($result->email) . "</a></td>";
2160
- echo "<td class='chat_name column_chat_url' id='chat_url_" . $result->id . "'>" . esc_url($result->url) . "</td>";
2161
- echo "<td class='chat_name column_chat_url'>".$actions."</td>";
2162
- echo "</tr>";
2163
- }
2164
- }
2165
-
2166
- echo "
2167
- </tbody>
2168
- </table>";
2169
-
2170
- $page_links = paginate_links( array(
2171
- 'base' => add_query_arg( 'pagenum', '%#%' ),
2172
- 'format' => '',
2173
- 'prev_text' => __( '&laquo;', 'wplivechat' ),
2174
- 'next_text' => __( '&raquo;', 'wplivechat' ),
2175
- 'total' => $num_of_pages,
2176
- 'current' => $pagenum
2177
- ) );
2178
-
2179
- if ( $page_links ) {
2180
- echo '<div class="tablenav"><div class="tablenav-pages" style="margin: 1em 0;float:none;text-align:center;">' . $page_links . '</div></div>';
2181
- }
2182
- }
2183
-
2184
-
2185
- /**
2186
- * Compares the users IP address to the list in the banned IPs in the settings page
2187
- * @return BOOL
2188
- */
2189
- function wplc_is_user_banned_basic(){
2190
- $banned_ip = get_option('WPLC_BANNED_IP_ADDRESSES');
2191
- if($banned_ip){
2192
- $banned_ip = maybe_unserialize($banned_ip);
2193
- $banned = 0;
2194
- if (is_array($banned_ip)) {
2195
- foreach($banned_ip as $ip){
2196
-
2197
- if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {
2198
- $ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];
2199
- } else {
2200
- $ip_address = $_SERVER['REMOTE_ADDR'];
2201
- }
2202
-
2203
- if(isset($ip_address)){
2204
- if($ip == $ip_address){
2205
- $banned++;
2206
- }
2207
- } else {
2208
- $banned = 0;
2209
- }
2210
- }
2211
- } else {
2212
- return 0;
2213
- }
2214
- } else {
2215
- $banned = 0;
2216
- }
2217
- return $banned;
2218
- }
2219
-
2220
-
2221
-
2222
-
2223
- function wplc_return_animations_basic(){
2224
-
2225
- $wplc_settings = get_option("WPLC_SETTINGS");
2226
-
2227
- if ($wplc_settings["wplc_settings_align"] == 1) {
2228
- $original_pos = "bottom_left";
2229
- //$wplc_box_align = "left:100px; bottom:0px;";
2230
- $wplc_box_align = "bottom:0px;";
2231
- } else if ($wplc_settings["wplc_settings_align"] == 2) {
2232
- $original_pos = "bottom_right";
2233
- //$wplc_box_align = "right:100px; bottom:0px;";
2234
- $wplc_box_align = "bottom:0px;";
2235
- } else if ($wplc_settings["wplc_settings_align"] == 3) {
2236
- $original_pos = "left";
2237
- // $wplc_box_align = "left:0; bottom:100px;";
2238
- $wplc_box_align = " bottom:100px;";
2239
- $wplc_class = "wplc_left";
2240
- } else if ($wplc_settings["wplc_settings_align"] == 4) {
2241
- $original_pos = "right";
2242
- // $wplc_box_align = "right:0; bottom:100px;";
2243
- $wplc_box_align = "bottom:100px;";
2244
- $wplc_class = "wplc_right";
2245
- }
2246
-
2247
- $animation_data = array();
2248
-
2249
- if(isset($wplc_settings['wplc_animation']) && $wplc_settings['wplc_animation'] == 'animation-1'){
2250
-
2251
- if($original_pos == 'bottom_right'){
2252
- $wplc_starting_point = 'margin-bottom: -350px; right: 20px;';
2253
- $wplc_animation = 'animation-1';
2254
- } else if ($original_pos == 'bottom_left'){
2255
- $wplc_starting_point = 'margin-bottom: -350px; left: 20px;';
2256
- $wplc_animation = 'animation-1';
2257
- } else if ($original_pos == 'left'){
2258
- $wplc_starting_point = 'margin-bottom: -350px; left: 0px;';
2259
- $wplc_box_align = "left:0; bottom:100px;";
2260
- $wplc_animation = 'animation-1';
2261
- } else if ($original_pos == 'right'){
2262
- $wplc_starting_point = 'margin-bottom: -350px; right: 0px;';
2263
- $wplc_animation = 'animation-1';
2264
- $wplc_box_align = "right:0; bottom:100px;";
2265
- }
2266
-
2267
- $animation_data['animation'] = $wplc_animation;
2268
- $animation_data['starting_point'] = $wplc_starting_point;
2269
- $animation_data['box_align'] = $wplc_box_align;
2270
-
2271
- } else if (isset($wplc_settings['wplc_animation']) && $wplc_settings['wplc_animation'] == 'animation-2'){
2272
-
2273
- if($original_pos == 'bottom_right'){
2274
- $wplc_starting_point = 'margin-bottom: 0px; right: -300px;';
2275
- $wplc_animation = 'animation-2-br';
2276
- } else if ($original_pos == 'bottom_left'){
2277
- $wplc_starting_point = 'margin-bottom: 0px; left: -300px;';
2278
- $wplc_animation = 'animation-2-bl';
2279
- } else if ($original_pos == 'left'){
2280
- $wplc_starting_point = 'margin-bottom: 0px; left: -999px;';
2281
- $wplc_animation = 'animation-2-l';
2282
- } else if ($original_pos == 'right'){
2283
- $wplc_starting_point = 'margin-bottom: 0px; right: -999px;';
2284
- $wplc_animation = 'animation-2-r';
2285
- }
2286
-
2287
- $animation_data['animation'] = $wplc_animation;
2288
- $animation_data['starting_point'] = $wplc_starting_point;
2289
- $animation_data['box_align'] = $wplc_box_align;
2290
-
2291
- } else if (isset($wplc_settings['wplc_animation']) && $wplc_settings['wplc_animation'] == 'animation-3'){
2292
-
2293
- $wplc_animation = 'animation-3';
2294
-
2295
- if($original_pos == 'bottom_right'){
2296
- $wplc_starting_point = 'margin-bottom: 0; right: 20px; display: none;';
2297
- } else if ($original_pos == 'bottom_left'){
2298
- $wplc_starting_point = 'margin-bottom: 0px; left: 20px; display: none;';
2299
- } else if ($original_pos == 'left'){
2300
- $wplc_starting_point = 'margin-bottom: 100px; left: 0px; display: none;';
2301
- } else if ($original_pos == 'right'){
2302
- $wplc_starting_point = 'margin-bottom: 100px; right: 0px; display: none;';
2303
- }
2304
-
2305
- $animation_data['animation'] = $wplc_animation;
2306
- $animation_data['starting_point'] = $wplc_starting_point;
2307
- $animation_data['box_align'] = $wplc_box_align;
2308
-
2309
- } else if (isset($wplc_settings['wplc_animation']) && $wplc_settings['wplc_animation'] == 'animation-4'){
2310
- // Dont use an animation
2311
-
2312
- $wplc_animation = "animation-4";
2313
-
2314
- if($original_pos == 'bottom_right'){
2315
- $wplc_starting_point = 'margin-bottom: 0; right: 20px; display: none;';
2316
- } else if ($original_pos == 'bottom_left'){
2317
- $wplc_starting_point = 'margin-bottom: 0px; left: 20px; display: none;';
2318
- } else if ($original_pos == 'left'){
2319
- $wplc_starting_point = 'margin-bottom: 100px; left: 0px; display: none;';
2320
- } else if ($original_pos == 'right'){
2321
- $wplc_starting_point = 'margin-bottom: 100px; right: 0px; display: none;';
2322
- }
2323
-
2324
- $animation_data['animation'] = $wplc_animation;
2325
- $animation_data['starting_point'] = $wplc_starting_point;
2326
- $animation_data['box_align'] = $wplc_box_align;
2327
-
2328
- } else {
2329
-
2330
- if($original_pos == 'bottom_right'){
2331
- $wplc_starting_point = 'margin-bottom: 0; right: 20px; display: none;';
2332
- } else if ($original_pos == 'bottom_left'){
2333
- $wplc_starting_point = 'margin-bottom: 0px; left: 20px; display: none;';
2334
- } else if ($original_pos == 'left'){
2335
- $wplc_starting_point = 'margin-bottom: 100px; left: 0px; display: none;';
2336
- } else if ($original_pos == 'right'){
2337
- $wplc_starting_point = 'margin-bottom: 100px; right: 0px; display: none;';
2338
- }
2339
-
2340
- $wplc_animation = 'none';
2341
-
2342
- $animation_data['animation'] = $wplc_animation;
2343
- $animation_data['starting_point'] = $wplc_starting_point;
2344
- $animation_data['box_align'] = $wplc_box_align;
2345
- }
2346
-
2347
- return $animation_data;
2348
- }
2349
-
2350
-
2351
- add_action("wplc_advanced_settings_above_performance", "wplc_advanced_settings_above_performance_control", 10, 1);
2352
- function wplc_advanced_settings_above_performance_control($wplc_settings){
2353
- $elem_trig_action = isset($wplc_settings['wplc_elem_trigger_action']) ? $wplc_settings['wplc_elem_trigger_action'] : "0";
2354
- $elem_trig_type = isset($wplc_settings['wplc_elem_trigger_type']) ? $wplc_settings['wplc_elem_trigger_type'] : "0";
2355
- $elem_trig_id = isset($wplc_settings['wplc_elem_trigger_id']) ? $wplc_settings['wplc_elem_trigger_id'] : "";
2356
-
2357
- echo "<tr>
2358
- <td width='350'>
2359
- ".__("Open chat window via", "wplivechat").":
2360
- </td>
2361
- <td>
2362
- <select name='wplc_elem_trigger_action'>
2363
- <option value='0' ".($elem_trig_action == "0" ? "selected" : "").">".__("Click", "wplivechat")."</option>
2364
- <option value='1' ".($elem_trig_action == "1" ? "selected" : "").">".__("Hover", "wplivechat")."</option>
2365
- </select>
2366
- ".__("element with", "wplivechat").":
2367
- <select name='wplc_elem_trigger_type'>
2368
- <option value='0' ".($elem_trig_type == "0" ? "selected" : "").">".__("Class", "wplivechat")."</option>
2369
- <option value='1' ".($elem_trig_type == "1" ? "selected" : "").">".__("ID", "wplivechat")."</option>
2370
- </select>
2371
- <input type='text' name='wplc_elem_trigger_id' value='".$elem_trig_id."'>
2372
- </td>
2373
- </tr>
2374
- ";
2375
- }
2376
-
2377
- /**
2378
- * Reverse of wplc_return_chat_id_by_rel
2379
- */
2380
- function wplc_return_chat_rel_by_id($cid) {
2381
- global $wpdb;
2382
- global $wplc_tblname_chats;
2383
-
2384
- $results = $wpdb->get_results("SELECT * FROM $wplc_tblname_chats WHERE `id` = '$cid' LIMIT 1");
2385
- if ($results) {
2386
- foreach ($results as $result) {
2387
- if (isset($result->rel)) {
2388
- return $result->rel;
2389
- } else {
2390
- return $cid;
2391
- }
2392
- }
2393
- } else {
2394
- return $cid;
2395
- }
2396
-
2397
- }
2398
-
2399
- /*
2400
- * Returns total message count for a chat
2401
- */
2402
- function wplc_return_message_count_by_cid($cid) {
2403
- global $wpdb;
2404
- global $wplc_tblname_msgs;
2405
-
2406
- $sql = "SELECT `id` FROM $wplc_tblname_msgs WHERE `chat_sess_id` = '$cid'";
2407
- $results = $wpdb->get_results($sql);
2408
-
2409
- $message_count = 0;
2410
- foreach ($results as $result) {
2411
- $message_count ++;
2412
- }
2413
-
2414
- return $message_count;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2415
  }
1
+ <?php
2
+ $wplc_basic_plugin_url = WPLC_BASIC_PLUGIN_URL;
3
+
4
+ function wplc_log_user_on_page($name,$email,$session, $is_mobile = false) {
5
+ global $wpdb;
6
+ global $wplc_tblname_chats;
7
+
8
+ $wplc_settings = get_option('WPLC_SETTINGS');
9
+
10
+
11
+ /** DEPRECATED DUE TO GDPR */
12
+ /*if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
13
+
14
+ if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {
15
+ $ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];
16
+ } else {
17
+ $ip_address = $_SERVER['REMOTE_ADDR'];
18
+ }
19
+
20
+ $user_data = array(
21
+ 'ip' => $ip_address,
22
+ 'user_agent' => $_SERVER['HTTP_USER_AGENT']
23
+ );
24
+ } else {
25
+ $user_data = array(
26
+ 'ip' => "",
27
+ 'user_agent' => $_SERVER['HTTP_USER_AGENT']
28
+ );
29
+ }*/
30
+
31
+ $user_data = array(
32
+ 'ip' => "",
33
+ 'user_agent' => $_SERVER['HTTP_USER_AGENT']
34
+ );
35
+
36
+
37
+ /* user types
38
+ * 1 = new
39
+ * 2 = returning
40
+ * 3 = timed out
41
+ */
42
+
43
+ $other = array(
44
+ "user_type" => 1
45
+ );
46
+
47
+ if($is_mobile){
48
+ $other['user_is_mobile'] = true;
49
+ } else {
50
+ $other['user_is_mobile'] = false;
51
+ }
52
+
53
+ $other = apply_filters("wplc_log_user_on_page_insert_other_data_filter", $other);
54
+
55
+ $wplc_chat_session_data = array(
56
+ 'status' => '5',
57
+ 'timestamp' => current_time('mysql'),
58
+ 'name' => $name,
59
+ 'email' => $email,
60
+ 'session' => $session,
61
+ 'ip' => maybe_serialize($user_data),
62
+ 'url' => sanitize_text_field($_SERVER['HTTP_REFERER']),
63
+ 'last_active_timestamp' => current_time('mysql'),
64
+ 'other' => maybe_serialize($other),
65
+ );
66
+
67
+ $wplc_chat_session_data = apply_filters("wplc_log_user_on_page_insert_filter", $wplc_chat_session_data);
68
+
69
+ /* Omitted from inser call as this defaults to string
70
+ $wplc_chat_session_types = array(
71
+ '%s',
72
+ '%s',
73
+ '%s',
74
+ '%s',
75
+ '%s',
76
+ '%s',
77
+ '%s',
78
+ '%s',
79
+ '%s'
80
+ ); */
81
+
82
+
83
+ $wpdb->insert($wplc_tblname_chats, $wplc_chat_session_data);
84
+ $lastid = $wpdb->insert_id;
85
+
86
+ do_action("wplc_log_user_on_page_after_hook", $lastid, $wplc_chat_session_data);
87
+
88
+
89
+ return $lastid;
90
+
91
+ }
92
+ function wplc_update_user_on_page($cid, $status = 5,$session) {
93
+ global $wpdb;
94
+ global $wplc_tblname_chats;
95
+ $wplc_settings = get_option('WPLC_SETTINGS');
96
+
97
+ /** DEPRECATED BY GDPR */
98
+ /*if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
99
+
100
+ if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {
101
+ $ip_address = sanitize_text_field($_SERVER['HTTP_X_FORWARDED_FOR']);
102
+ } else {
103
+ $ip_address = sanitize_text_field($_SERVER['REMOTE_ADDR']);
104
+ }
105
+ $user_data = array(
106
+ 'ip' => $ip_address,
107
+ 'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
108
+ );
109
+ } else {
110
+ $user_data = array(
111
+ 'ip' => "",
112
+ 'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
113
+ );
114
+ }*/
115
+
116
+ $user_data = array(
117
+ 'ip' => "",
118
+ 'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
119
+ );
120
+
121
+
122
+
123
+ $query = $wpdb->update(
124
+ $wplc_tblname_chats,
125
+ array(
126
+ 'url' => sanitize_text_field($_SERVER['HTTP_REFERER']),
127
+ 'last_active_timestamp' => current_time('mysql'),
128
+ 'ip' => maybe_serialize($user_data),
129
+ 'status' => $status,
130
+ 'session' => $session,
131
+ ),
132
+ array('id' => $cid),
133
+ array(
134
+ '%s',
135
+ '%s',
136
+ '%s',
137
+ '%d',
138
+ '%s'
139
+ ),
140
+ array('%d')
141
+ );
142
+
143
+
144
+ return $query;
145
+
146
+
147
+ }
148
+
149
+
150
+ function wplc_record_chat_msg($from, $cid, $msg, $rest_check = false, $aid = false, $other = false) {
151
+ global $wpdb;
152
+ global $wplc_tblname_msgs;
153
+
154
+
155
+ if( ! filter_var($cid, FILTER_VALIDATE_INT) ) {
156
+
157
+ /**
158
+ * We need to identify if this CID is a node CID, and if so, return the WP CID from the wplc_chat_msgs table
159
+ */
160
+ $cid = wplc_return_chat_id_by_rel($cid);
161
+ }
162
+
163
+ /**
164
+ * check if this CID even exists, if not, create it
165
+ *
166
+ * If it doesnt exist, it most likely is an agent-to-agent chat that we now need to save.
167
+ */
168
+
169
+ global $wplc_tblname_chats;
170
+ $results = $wpdb->get_results("SELECT * FROM $wplc_tblname_chats WHERE `rel` = '".$cid."' OR `id` = '".$cid."' LIMIT 1");
171
+ if (!$results) {
172
+ /* it doesnt exist, lets put it in the table */
173
+
174
+ $wpdb->insert(
175
+ $wplc_tblname_chats,
176
+ array(
177
+ 'status' => 3,
178
+ 'timestamp' => current_time('mysql'),
179
+ 'name' => 'agent-to-agent chat',
180
+ 'email' => 'none',
181
+ 'session' => '1',
182
+ 'ip' => '0',
183
+ 'url' => '',
184
+ 'last_active_timestamp' => current_time('mysql'),
185
+ 'other' => '',
186
+ 'rel' => $cid,
187
+ ),
188
+ array(
189
+ '%s',
190
+ '%s',
191
+ '%s',
192
+ '%s',
193
+ '%s',
194
+ '%s',
195
+ '%s',
196
+ '%s',
197
+ '%s',
198
+ '%s'
199
+ )
200
+ );
201
+
202
+
203
+ $cid = $wpdb->insert_id;
204
+ }
205
+
206
+
207
+ if ($from == "2" && $rest_check == false) {
208
+ $wplc_current_user = get_current_user_id();
209
+
210
+ if( get_user_meta( $wplc_current_user, 'wplc_ma_agent', true ) ){
211
+ /*
212
+ -- modified in in 6.0.04 --
213
+
214
+ if(current_user_can('wplc_ma_agent') || current_user_can('manage_options')){
215
+ */ } else { return "security issue"; }
216
+ }
217
+
218
+ if ($from == "1") {
219
+ $fromname = wplc_return_chat_name(sanitize_text_field($cid));
220
+ if (empty($fromname)) { $fromname = 'Guest'; }
221
+ //$fromemail = wplc_return_chat_email($cid);
222
+ $orig = '2';
223
+ }
224
+ else {
225
+ $fromname = apply_filters("wplc_filter_admin_name","Admin");
226
+
227
+ //$fromemail = "SET email";
228
+ $orig = '1';
229
+ }
230
+
231
+ $msg_id = '';
232
+
233
+ if ($other !== false) {
234
+ if (!empty($other->msgID)) {
235
+ $msg_id = $other->msgID;
236
+ } else {
237
+ $msg_id = '';
238
+ }
239
+ }
240
+
241
+
242
+ $orig_msg = $msg;
243
+
244
+ $msg = apply_filters("wplc_filter_message_control",$msg);
245
+
246
+ if (!$aid) {
247
+ $wplc_current_user = get_current_user_id();
248
+
249
+ if( get_user_meta( $wplc_current_user, 'wplc_ma_agent', true ) ){
250
+ $other_data = array('aid'=>$wplc_current_user);
251
+ } else {
252
+ $other_data = '';
253
+ }
254
+ } else {
255
+ if( get_user_meta( $aid, 'wplc_ma_agent', true ) ){
256
+ $other_data = array('aid'=>$aid);
257
+ } else {
258
+ $other_data = '';
259
+ }
260
+ }
261
+
262
+
263
+
264
+
265
+
266
+ $wpdb->insert(
267
+ $wplc_tblname_msgs,
268
+ array(
269
+ 'chat_sess_id' => $cid,
270
+ 'timestamp' => current_time('mysql'),
271
+ 'msgfrom' => $fromname,
272
+ 'msg' => $msg,
273
+ 'status' => 0,
274
+ 'originates' => $orig,
275
+ 'other' => maybe_serialize( $other_data ),
276
+ 'rel' => $msg_id
277
+ ),
278
+ array(
279
+ '%s',
280
+ '%s',
281
+ '%s',
282
+ '%s',
283
+ '%d',
284
+ '%s',
285
+ '%s',
286
+ '%s'
287
+ )
288
+ );
289
+
290
+ $data = array(
291
+ 'cid' => $cid,
292
+ 'from' => $from,
293
+ 'msg' => $orig_msg,
294
+ 'orig' => $orig
295
+ );
296
+ do_action("wplc_hook_message_sent",$data);
297
+
298
+ wplc_update_active_timestamp(sanitize_text_field($cid));
299
+
300
+
301
+ return true;
302
+
303
+ }
304
+
305
+ function wplc_update_active_timestamp($cid) {
306
+ global $wpdb;
307
+ global $wplc_tblname_chats;
308
+ // $results = $wpdb->get_results(
309
+ // "
310
+ // UPDATE $wplc_tblname_chats
311
+ // SET `last_active_timestamp` = '".date("Y-m-d H:i:s")."'
312
+ // WHERE `id` = '$cid'
313
+ // LIMIT 1
314
+ // "
315
+ // );
316
+ $wpdb->update(
317
+ $wplc_tblname_chats,
318
+ array(
319
+ 'last_active_timestamp' => current_time('mysql')
320
+ ),
321
+ array('id' => $cid),
322
+ array('%s'),
323
+ array('%d')
324
+ );
325
+
326
+ //wplc_change_chat_status(sanitize_text_field($cid),3);
327
+ return true;
328
+
329
+ }
330
+
331
+ function wplc_return_chat_name($cid) {
332
+ global $wpdb;
333
+ global $wplc_tblname_chats;
334
+
335
+ $results = $wpdb->get_results(
336
+ "
337
+ SELECT *
338
+ FROM $wplc_tblname_chats
339
+ WHERE `id` = '$cid'
340
+ "
341
+ );
342
+ foreach ($results as $result) {
343
+ return $result->name;
344
+ }
345
+
346
+ }
347
+
348
+
349
+ /**
350
+ * Find out if we are dealing with a NODE CID and convert it to the WP CID.
351
+ *
352
+ * If it cannot find a relative, then simply return the original CID parsed through.
353
+ *
354
+ * @param string|int $rel The CId to compare
355
+ * @return string|int The suggested CID
356
+ */
357
+ function wplc_return_chat_id_by_rel($rel) {
358
+ global $wpdb;
359
+ global $wplc_tblname_chats;
360
+
361
+ $results = $wpdb->get_results("SELECT * FROM $wplc_tblname_chats WHERE `rel` = '$rel' LIMIT 1");
362
+ if ($results) {
363
+ foreach ($results as $result) {
364
+ if (isset($result->id)) {
365
+ return $result->id;
366
+ } else {
367
+ return $rel;
368
+ }
369
+ }
370
+ } else {
371
+ return $rel;
372
+ }
373
+
374
+ }
375
+ function wplc_return_chat_email($cid) {
376
+ global $wpdb;
377
+ global $wplc_tblname_chats;
378
+ $results = $wpdb->get_results(
379
+ "
380
+ SELECT *
381
+ FROM $wplc_tblname_chats
382
+ WHERE `id` = '$cid'
383
+ "
384
+ );
385
+ foreach ($results as $result) {
386
+ return $result->email;
387
+ }
388
+
389
+ }
390
+ function wplc_list_chats() {
391
+
392
+ global $wpdb;
393
+ global $wplc_tblname_chats;
394
+ $status = 3;
395
+ $wplc_c = 0;
396
+ $results = $wpdb->get_results(
397
+ "
398
+ SELECT *
399
+ FROM $wplc_tblname_chats
400
+ WHERE `status` = 3 OR `status` = 2 OR `status` = 10
401
+ ORDER BY `timestamp` ASC
402
+
403
+ "
404
+ );
405
+
406
+ $table = "<div class='wplc_chats_container'>";
407
+
408
+ if (!$results) {
409
+ $table.= "<p>".__("No chat sessions available at the moment","wplivechat")."</p>";
410
+ } else {
411
+ $table .= "<h2>".__('Active Chats', 'wplivechat')."</h2>";
412
+
413
+ foreach ($results as $result) {
414
+ unset($trstyle);
415
+ unset($actions);
416
+ $wplc_c++;
417
+
418
+
419
+ global $wplc_basic_plugin_url;
420
+ $user_data = maybe_unserialize($result->ip);
421
+ $user_ip = $user_data['ip'];
422
+ $browser = wplc_return_browser_string($user_data['user_agent']);
423
+ $browser_image = wplc_return_browser_image($browser,"16");
424
+
425
+ if($user_ip == ""){
426
+ $user_ip = __('IP Address not recorded', 'wplivechat');
427
+ } else {
428
+ $user_ip = "<a href='http://www.ip-adress.com/ip_tracer/" . $user_ip . "' title='".__('Whois for' ,'wplivechat')." ".$user_ip."' target='_BLANK'>".$user_ip."</a>";
429
+ }
430
+
431
+ if ($result->status == 2) {
432
+ $url = admin_url( 'admin.php?page=wplivechat-menu&action=ac&cid='.$result->id);
433
+ $actions = "<a href=\"".$url."\" class=\"wplc_open_chat button button-primary\" window-title=\"WP_Live_Chat_".$result->id."\">".__("Accept Chat","wplivechat")."</a>";
434
+ $trstyle = "style='background-color:#FFFBE4; height:30px;'";
435
+ $icon = "<i class=\"fa fa-phone wplc_pending\" title='".__('Incoming Chat', 'wplivechat')."' alt='".__('Incoming Chat', 'wplivechat')."'></i><div class='wplc_icon_message'>".__('You have an incoming chat.', 'wplivechat')."</div>";
436
+ }
437
+ if ($result->status == 3) {
438
+ $url = admin_url( 'admin.php?page=wplivechat-menu&action=ac&cid='.$result->id);
439
+ $actions = "<a href=\"".$url."\" class=\"wplc_open_chat button button-primary\" window-title=\"WP_Live_Chat_".$result->id."\">".__("Open Chat Window","wplivechat")."</a>";
440
+ $trstyle = "style='background-color:#F7FCFE; height:30px;'";
441
+ $icon = "<i class=\"fa fa-check-circle wplc_active\" title='".__('Chat Active', 'wplivechat')."' alt='".__('Chat Active', 'wplivechat')."'></i><div class='wplc_icon_message'>".__('This chat is active', 'wplivechat')."</div>";
442
+ }
443
+
444
+
445
+ /* if ($wplc_c>1) { $actions = wplc_get_msg(); } */
446
+
447
+ $trstyle = "";
448
+
449
+ $table .= "
450
+ <div class='wplc_single_chat' id='record_".$result->id."' $trstyle>
451
+ <div class='wplc_chat_section section_1'>
452
+ <div class='wplc_user_image' id='chat_image_".$result->id."'>
453
+ <img src=\"//www.gravatar.com/avatar/".md5($result->email)."?s=60&d=mm\" />
454
+ </div>
455
+ <div class='wplc_user_meta_data'>
456
+ <div class='wplc_user_name' id='chat_name_".$result->id."'>
457
+ <h3>".$result->name.$icon."</h3>
458
+ <a href='mailto:".$result->email."' target='_BLANK'>".$result->email."</a>
459
+ </div>
460
+ </div>
461
+ </div>
462
+ <div class='wplc_chat_section section_2'>
463
+ <div class='admin_visitor_advanced_info'>
464
+ <strong>" . __("Site Info", "wplivechat") . "</strong>
465
+ <hr />
466
+ <span class='part1'>" . __("Chat initiated on:", "wplivechat") . "</span> <span class='part2'> <a href='".esc_url($result->url)."' target='_BLANK'>" . esc_url($result->url) . "</a></span>
467
+ </div>
468
+
469
+ <div class='admin_visitor_advanced_info'>
470
+ <strong>" . __("Advanced Info", "wplivechat") . "</strong>
471
+ <hr />
472
+ <span class='part1'>" . __("Browser:", "wplivechat") . "</span><span class='part2'> $browser <img src='" . $wplc_basic_plugin_url . "/images/$browser_image' alt='$browser' title='$browser' /><br />
473
+ <span class='part1'>" . __("IP Address:", "wplivechat") . "</span><span class='part2'> ".$user_ip."
474
+ </div>
475
+ </div>
476
+ <div class='wplc_chat_section section_3'>
477
+ <div class='wplc_agent_actions'>
478
+ $actions
479
+ </div>
480
+ </div>
481
+ </div>
482
+ ";
483
+ }
484
+ }
485
+ $table .= "</div>";
486
+
487
+ return $table;
488
+ }
489
+
490
+ function wplc_time_ago($time_ago)
491
+ {
492
+ $time_ago = strtotime($time_ago);
493
+ $cur_time = current_time('timestamp');
494
+ $time_elapsed = $cur_time - $time_ago;
495
+ $seconds = $time_elapsed ;
496
+ $minutes = round($time_elapsed / 60 );
497
+ $hours = round($time_elapsed / 3600);
498
+ $days = round($time_elapsed / 86400 );
499
+ $weeks = round($time_elapsed / 604800);
500
+ $months = round($time_elapsed / 2600640 );
501
+ $years = round($time_elapsed / 31207680 );
502
+ // Seconds
503
+ if($seconds <= 60){
504
+ return "0 min";
505
+ }
506
+ //Minutes
507
+ else if($minutes <=60){
508
+ if($minutes==1){
509
+ return "1 min";
510
+ }
511
+ else{
512
+ return "$minutes min";
513
+ }
514
+ }
515
+ //Hours
516
+ else if($hours <=24){
517
+ if($hours==1){
518
+ return "1 hr";
519
+ }else{
520
+ return "$hours hrs";
521
+ }
522
+ }
523
+ //Days
524
+ else if($days <= 7){
525
+ if($days==1){
526
+ return "1 day";
527
+ }else{
528
+ return "$days days";
529
+ }
530
+ }
531
+ //Weeks
532
+ else if($weeks <= 4.3){
533
+ if($weeks==1){
534
+ return "1 week";
535
+ }else{
536
+ return "$weeks weeks";
537
+ }
538
+ }
539
+ //Months
540
+ else if($months <=12){
541
+ if($months==1){
542
+ return "1 month";
543
+ }else{
544
+ return "$months months";
545
+ }
546
+ }
547
+ //Years
548
+ else{
549
+ if($years==1){
550
+ return "1 year";
551
+ }else{
552
+ return "$years years";
553
+ }
554
+ }
555
+ }
556
+
557
+ add_filter("wplc_filter_list_chats_actions","wplc_filter_control_list_chats_actions",15,3);
558
+ /**
559
+ * Only allow agents access
560
+ * @return void
561
+ * @since 6.0.00
562
+ * @version 6.0.04 Updated to ensure those with the correct access can access this function
563
+ * @author Nick Duncan <nick@codecabin.co.za>
564
+ */
565
+ function wplc_filter_control_list_chats_actions($actions,$result,$post_data) {
566
+ $aid = apply_filters("wplc_filter_aid_in_action","");
567
+
568
+ $wplc_current_user = get_current_user_id();
569
+
570
+ if( get_user_meta( $wplc_current_user, 'wplc_ma_agent', true ) ){
571
+
572
+ if (intval($result->status) == 2) {
573
+ $url_params = "&action=ac&cid=".$result->id.$aid;
574
+ $url = admin_url( 'admin.php?page=wplivechat-menu'.$url_params);
575
+ $actions = "<a href=\"".$url."\" class=\"wplc_open_chat button button-primary\" window-title=\"WP_Live_Chat_".$result->id."\">". apply_filters("wplc_accept_chat_button_filter", __("Accept Chat","wplivechat"), $result->id)."</a>";
576
+ }
577
+ else if (intval($result->status) == 3 || intval($result->status) == 10) {
578
+ $url_params = "&action=ac&cid=".$result->id.$aid;
579
+ $url = admin_url( 'admin.php?page=wplivechat-menu'.$url_params);
580
+ if ( ! function_exists("wplc_pro_version_control") || !isset( $result->agent_id ) || $wplc_current_user == $result->agent_id ) { //Added backwards compat checks
581
+ $actions = "<a href=\"".$url."\" class=\"wplc_open_chat button button-primary\" window-title=\"WP_Live_Chat_".$result->id."\">".__("Open Chat","wplivechat")."</a>";
582
+ } else {
583
+ $actions = "<span class=\"wplc-chat-in-progress\">" . __( "In progress with another agent", "wplivechat" ) . "</span>";
584
+ }
585
+ }
586
+ else if (intval($result->status) == 2) {
587
+ $url_params = "&action=ac&cid=".$result->id.$aid;
588
+ $url = admin_url( 'admin.php?page=wplivechat-menu'.$url_params);
589
+ $actions = "<a href=\"".$url."\" class=\"wplc_open_chat button button-primary\" window-title=\"WP_Live_Chat_".$result->id."\">".__("Accept Chat","wplivechat")."</a>";
590
+ }
591
+ else if (intval($result->status) == 12 ) {
592
+ $url_params = "&action=ac&cid=".$result->id.$aid;
593
+ $url = admin_url( 'admin.php?page=wplivechat-menu'.$url_params);
594
+ $actions = "<a href=\"".$url."\" class=\"wplc_open_chat button button-primary\" window-title=\"WP_Live_Chat_".$result->id."\">".__("Open Chat","wplivechat")."</a>";
595
+ }
596
+ } else {
597
+ $actions = "<a href='#'>".__( 'Only chat agents can accept chats', 'wplivechat' )."</a>";
598
+ }
599
+ return $actions;
600
+ }
601
+
602
+ function wplc_list_chats_new($post_data) {
603
+
604
+ global $wpdb;
605
+ global $wplc_tblname_chats;
606
+
607
+ $data_array = array();
608
+ $id_list = array();
609
+
610
+ $status = 3;
611
+ $wplc_c = 0;
612
+
613
+ // Retrieve count of users in same department or in no department
614
+ $user_id = get_current_user_id();
615
+ $user_department = get_user_meta($user_id ,"wplc_user_department", true);
616
+
617
+ $wplc_chat_count_sql = "SELECT COUNT(*) FROM $wplc_tblname_chats WHERE status IN (3,2,10,5,8,9,12)";
618
+ if($user_department > 0)
619
+ $wplc_chat_count_sql .= " AND (department_id=0 OR department_id=$user_department)";
620
+ $data_array['visitor_count'] = $wpdb->get_var($wplc_chat_count_sql);
621
+
622
+ // Retrieve data
623
+ $wplc_chat_sql = "SELECT * FROM $wplc_tblname_chats WHERE (`status` = 3 OR `status` = 2 OR `status` = 10 OR `status` = 5 or `status` = 8 or `status` = 9 or `status` = 12)";
624
+ $wplc_chat_sql .= apply_filters("wplc_alter_chat_list_sql_before_sorting", "");
625
+
626
+ $wplc_chat_sql .= " ORDER BY `timestamp` ASC";
627
+
628
+ $results = $wpdb->get_results($wplc_chat_sql);
629
+
630
+
631
+ if($results) {
632
+
633
+
634
+ foreach ($results as $result) {
635
+ unset($trstyle);
636
+ unset($actions);
637
+
638
+
639
+
640
+
641
+ global $wplc_basic_plugin_url;
642
+ $user_data = maybe_unserialize($result->ip);
643
+ $user_ip = $user_data['ip'];
644
+ $browser = wplc_return_browser_string($user_data['user_agent']);
645
+ $browser_image = wplc_return_browser_image($browser,"16");
646
+
647
+ if($user_ip == ""){
648
+ $user_ip = __('IP Address not recorded', 'wplivechat');
649
+ } else {
650
+ $user_ip = "<a href='http://www.ip-adress.com/ip_tracer/" . $user_ip . "' title='".__('Whois for' ,'wplivechat')." ".$user_ip."' target='_BLANK'>".$user_ip."</a>";
651
+ }
652
+
653
+
654
+ $actions = apply_filters("wplc_filter_list_chats_actions","",$result,$post_data);
655
+
656
+
657
+ $other_data = maybe_unserialize($result->other);
658
+
659
+
660
+
661
+ $trstyle = "";
662
+
663
+ $id_list[intval($result->id)] = true;
664
+
665
+ $data_array[$result->id]['name'] = $result->name;
666
+ $data_array[$result->id]['email'] = $result->email;
667
+
668
+ $data_array[$result->id]['status'] = $result->status;
669
+ $data_array[$result->id]['action'] = $actions;
670
+ $data_array[$result->id]['timestamp'] = wplc_time_ago($result->timestamp);
671
+
672
+ if ((current_time('timestamp') - strtotime($result->timestamp)) < 3600) {
673
+ $data_array[$result->id]['type'] = __("New","wplivechat");
674
+ } else {
675
+ $data_array[$result->id]['type'] = __("Returning","wplivechat");
676
+ }
677
+
678
+ $data_array[$result->id]['image'] = "<img src=\"//www.gravatar.com/avatar/".md5($result->email)."?s=30&d=mm\" class='wplc-user-message-avatar' />";
679
+ $data_array[$result->id]['data']['browsing'] = $result->url;
680
+ $path = parse_url($result->url, PHP_URL_PATH);
681
+
682
+ if (strlen($path) > 20) {
683
+ $data_array[$result->id]['data']['browsing_nice_url'] = substr($path,0,20).'...';
684
+ } else {
685
+ $data_array[$result->id]['data']['browsing_nice_url'] = $path;
686
+ }
687
+
688
+ $data_array[$result->id]['data']['browser'] = "<img src='" . $wplc_basic_plugin_url . "/images/$browser_image' alt='$browser' title='$browser' /> ";
689
+ $data_array[$result->id]['data']['ip'] = $user_ip;
690
+ $data_array[$result->id]['other'] = $other_data;
691
+ }
692
+
693
+ $data_array['ids'] = $id_list;
694
+ }
695
+
696
+ return json_encode($data_array);
697
+ }
698
+
699
+
700
+
701
+ function wplc_return_user_chat_messages($cid,$wplc_settings = false,$cdata = false) {
702
+ global $wpdb;
703
+ global $wplc_tblname_msgs;
704
+
705
+ if (!$wplc_settings) {
706
+ $wplc_settings = get_option("WPLC_SETTINGS");
707
+ }
708
+
709
+ if(isset($wplc_settings['wplc_display_name']) && $wplc_settings['wplc_display_name'] == 1){ $display_name = 1; } else { $display_name = 0; }
710
+
711
+ $sql = "SELECT * FROM $wplc_tblname_msgs WHERE `chat_sess_id` = '$cid' AND `status` = '0' AND (`originates` = '1' OR `originates` = '0') ORDER BY `timestamp` ASC";
712
+ $results = $wpdb->get_results($sql);
713
+ if (!$cdata) {
714
+ $cdata = wplc_get_chat_data($cid,__LINE__);
715
+ }
716
+
717
+
718
+ $msg_hist = array();
719
+ foreach ($results as $result) {
720
+ $system_notification = false;
721
+
722
+ $id = $result->id;
723
+ $from = $result->msgfrom;
724
+
725
+
726
+ $msg = $result->msg;
727
+
728
+ if ( isset( $result->other ) ) { $other_data = maybe_unserialize( $result->other ); } else { $other_data = array(); }
729
+ if ($other_data == '') { $other_data = array(); }
730
+
731
+ $timestamp = strtotime( $result->timestamp );
732
+ $other_data['datetime'] = $timestamp;
733
+ $other_data['datetimeUTC'] = strtotime( get_gmt_from_date( $result->timestamp ) );
734
+
735
+ //
736
+ if($result->originates == 1){
737
+ /* removed in 7.1.00
738
+ $class = "wplc-admin-message wplc-color-bg-4 wplc-color-2 wplc-color-border-4";
739
+ if(function_exists("wplc_pro_get_admin_picture")){
740
+ $src = wplc_pro_get_admin_picture();
741
+ if($src){
742
+ $image = "<img src=".$src." width='20px' id='wp-live-chat-2-img'/>";
743
+ } else {
744
+ $image = "";
745
+ }
746
+ } else {
747
+ $other = maybe_unserialize($cdata->other);
748
+ if (isset($other['aid'])) {
749
+
750
+
751
+ $user_info = get_userdata(intval($other['aid']));
752
+
753
+ $image = "<img src='//www.gravatar.com/avatar/".md5($user_info->user_email)."?s=30' class='wplc-admin-message-avatar' />";
754
+ } else {
755
+
756
+
757
+ $image = "";
758
+ if(1 == 1) {
759
+
760
+ } else {
761
+
762
+ $image = "";
763
+ }
764
+ }
765
+
766
+ }
767
+
768
+ $from = apply_filters("wplc_filter_admin_name",$from, $cid);
769
+ */
770
+
771
+ }
772
+ else if (intval($result->originates) == 0) {
773
+ /*
774
+ system notifications
775
+ from version 7
776
+ */
777
+ $system_notification = true;
778
+
779
+ }
780
+ else {
781
+
782
+ /*
783
+ removed in 7.1.00
784
+ $class = "wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1";
785
+
786
+ if(isset($_COOKIE['wplc_email']) && $_COOKIE['wplc_email'] != ""){ $wplc_user_gravatar = md5(strtolower(trim(sanitize_text_field($_COOKIE['wplc_email'])))); } else { $wplc_user_gravatar = ""; }
787
+
788
+ if($wplc_user_gravatar != ""){
789
+ $image = "<img src='//www.gravatar.com/avatar/$wplc_user_gravatar?s=30' class='wplc-user-message-avatar' />";
790
+ } else {
791
+ $image = "";
792
+ }
793
+ */
794
+ }
795
+
796
+ if (!$system_notification) {
797
+ /* this is a normal message */
798
+ if(function_exists('wplc_encrypt_decrypt_msg')){
799
+ $msg = wplc_encrypt_decrypt_msg($msg);
800
+ }
801
+
802
+ $msg_array = maybe_unserialize( $msg );
803
+
804
+ if( is_array( $msg_array ) ){
805
+ $msg = $msg_array['m'];
806
+ }
807
+
808
+ $msg = stripslashes($msg);
809
+
810
+ $msg = apply_filters("wplc_filter_message_control_out",$msg);
811
+
812
+ $msg = stripslashes($msg);
813
+
814
+ $msg_hist[$id]['msg'] = $msg;
815
+ $msg_hist[$id]['originates'] = intval($result->originates);
816
+ $msg_hist[$id]['other'] = $other_data;
817
+
818
+ /*
819
+ removed this in 7.1.00 as the JS now handles this
820
+ if($display_name){
821
+ $msg_hist[$id]['msg'] = "<span class='wplc-admin-message wplc-color-bg-4 wplc-color-2 wplc-color-border-4'>$image <strong>$from </strong> $msg</span><br /><div class='wplc-clear-float-message'></div>";
822
+ } else {
823
+ $msg_hist[$id]['msg'] = "<span class='wplc-admin-message wplc-color-bg-4 wplc-color-2 wplc-color-border-4'>$msg</span><div class='wplc-clear-float-message'></div>";
824
+ }*/
825
+ } else {
826
+ /* add the system notification to the list */
827
+ if ( isset( $msg_hist[$id] ) ) { $msg_hist[$id] = array(); }
828
+
829
+ $msg_hist[$id]['msg'] = $msg;
830
+ $msg_hist[$id]['other'] = $other_data;
831
+ $msg_hist[$id]['originates'] = intval($result->originates);
832
+ }
833
+
834
+
835
+
836
+
837
+ }
838
+
839
+ return $msg_hist;
840
+
841
+
842
+ }
843
+
844
+
845
+
846
+
847
+
848
+ function wplc_return_no_answer_string($cid) {
849
+
850
+ $wplc_settings = get_option("WPLC_SETTINGS");
851
+ if (isset($wplc_settings['wplc_user_no_answer'])) {
852
+ $string = stripslashes($wplc_settings['wplc_user_no_answer']);
853
+ } else {
854
+ $string = __("No agent was able to answer your chat request. Please try again.","wplivechat");
855
+ }
856
+ $string = apply_filters("wplc_filter_no_answer_string",$string,$cid);
857
+ return "<span class='wplc_system_notification wplc_no_answer wplc-color-4'><center>".$string."</center></span>";
858
+ }
859
+ add_filter("wplc_filter_no_answer_string","wplc_filter_control_no_answer_string",10,2);
860
+
861
+ /**
862
+ * Add the "retry chat" button when an agent hasnt answered
863
+ * @param string $string Original "No Answer" string
864
+ * @param intval $cid Chat ID
865
+ * @return string
866
+ */
867
+ function wplc_filter_control_no_answer_string($string,$cid) {
868
+ $string = $string. " <br /><button class='wplc_retry_chat wplc-color-bg-1 wplc-color-2' cid='".$cid."'>".__("Request new chat","wplivechat")."</button>";
869
+ return $string;
870
+ }
871
+
872
+
873
+ function wplc_change_chat_status($id,$status,$aid = 0) {
874
+ global $wpdb;
875
+ global $wplc_tblname_chats;
876
+
877
+ if ($aid > 0) {
878
+ /* only run when accepting a chat */
879
+ $results = $wpdb->get_results("SELECT * FROM ".$wplc_tblname_chats." WHERE `id` = '".$id."' LIMIT 1");
880
+ foreach ($results as $result) {
881
+ $other = maybe_unserialize($result->other);
882
+ if (isset($other['aid']) && $other['aid'] > 0) {
883
+ /* we have recorded this already */
884
+
885
+ } else {
886
+ /* first time answering the chat! */
887
+
888
+
889
+ /* send welcome note */
890
+ /*
891
+ removed in version 7. added "chat notification events" instead, i.e. Agent has joined the chat.
892
+ $wplc_settings = get_option("WPLC_SETTINGS");
893
+ $wplc_welcome = __('Welcome. How may I help you?', 'wplivechat');
894
+ if(isset($wplc_settings['wplc_using_localization_plugin']) && $wplc_settings['wplc_using_localization_plugin'] == 1){ $wplc_using_locale = true; } else { $wplc_using_locale = false; }
895
+ if (!isset($wplc_settings['wplc_user_welcome_chat']) || $wplc_settings['wplc_user_welcome_chat'] == "") { $wplc_settings['wplc_user_welcome_chat'] = $wplc_welcome; }
896
+ $text2 = ($wplc_using_locale ? $wplc_welcome : stripslashes($wplc_settings['wplc_user_welcome_chat']));
897
+
898
+ $chat_id = sanitize_text_field($id);
899
+ $chat_msg = sanitize_text_field($text2);
900
+ $wplc_rec_msg = wplc_record_chat_msg("2",$chat_id,$chat_msg);
901
+
902
+ */
903
+
904
+
905
+ }
906
+
907
+ $other['aid'] = $aid;
908
+ }
909
+ }
910
+
911
+
912
+
913
+
914
+ if ($aid > 0) {
915
+ $wpdb->update(
916
+ $wplc_tblname_chats,
917
+ array(
918
+ 'status' => $status,
919
+ 'other' => maybe_serialize($other),
920
+ 'agent_id' => $aid
921
+ ),
922
+ array('id' => $id),
923
+ array(
924
+ '%d',
925
+ '%s',
926
+ '%d'
927
+ ),
928
+ array('%d')
929
+ );
930
+ } else {
931
+ $wpdb->update(
932
+ $wplc_tblname_chats,
933
+ array(
934
+ 'status' => $status
935
+ ),
936
+ array('id' => $id),
937
+ array('%d'),
938
+ array('%d')
939
+ );
940
+ }
941
+
942
+ do_action("wplc_change_chat_status_hook", $id, $status);
943
+
944
+ return true;
945
+
946
+ }
947
+
948
+ //come back here
949
+ function wplc_return_chat_messages($cid, $transcript = false, $html = true, $wplc_settings = false, $cdata = false, $display = 'string', $only_read_message = false) {
950
+ global $wpdb;
951
+ global $wplc_tblname_msgs;
952
+
953
+
954
+ if (!$wplc_settings) {
955
+ $wplc_settings = get_option("WPLC_SETTINGS");
956
+ }
957
+
958
+ if(isset($wplc_settings['wplc_display_name']) && $wplc_settings['wplc_display_name'] == 1){ $display_name = 1; } else { $display_name = 0; }
959
+
960
+ $results = wplc_get_chat_messages($cid, $only_read_message, $wplc_settings);
961
+ if (!$results) { return; }
962
+
963
+ if (!$cdata) {
964
+ $cdata = wplc_get_chat_data($cid,__LINE__);
965
+ }
966
+ $msg_array = array();
967
+ $msg_hist = "";
968
+ $previous_time = "";
969
+ $previous_timestamp = 0;
970
+ foreach ($results as $result) {
971
+ $display_notification = false;
972
+ $system_notification = false;
973
+
974
+ $from = $result->msgfrom;
975
+
976
+
977
+ /* added a control here to see if we should use the NODE ID instead of the SQL ID */
978
+ if (empty($result->rel)) {
979
+ $id = $result->id;
980
+ } else {
981
+ $id = $result->rel;
982
+ }
983
+ $msg = $result->msg;
984
+
985
+
986
+ if ( isset( $result->other ) ) { $other_data = maybe_unserialize( $result->other ); } else { $other_data = array(); }
987
+ if ($other_data == '') { $other_data = array(); }
988
+
989
+ $timestamp = strtotime( $result->timestamp );
990
+ $other_data['datetime'] = $timestamp;
991
+ $other_data['datetimeUTC'] = strtotime( get_gmt_from_date( $result->timestamp ) );
992
+ $nice_time = date("d M Y H:i:s",$timestamp);
993
+
994
+
995
+ $agent_from = false;
996
+
997
+ $image = "";
998
+ if($result->originates == 1){
999
+
1000
+ $agent_from = 'Agent';
1001
+
1002
+ } else if ($result->originates == 2){
1003
+
1004
+
1005
+ } else if ($result->originates == 0 || $result->originates == 3) {
1006
+
1007
+
1008
+
1009
+ $system_notification = true;
1010
+ $cuid = get_current_user_id();
1011
+ $is_agent = get_user_meta(esc_html( $cuid ), 'wplc_ma_agent', true);
1012
+ if ($is_agent && $result->originates == 3 ) {
1013
+ /* this user is an agent and the notification is meant for an agent, therefore display it */
1014
+ $display_notification = true;
1015
+
1016
+ /* check if this came from the front end.. if it did, then dont display it (if this code is removed, all notifications will be displayed to agents who are logged in and chatting with themselves during testing, which may cause confusion) */
1017
+ if (isset($_POST) && isset($_POST['action']) && sanitize_text_field( $_POST['action'] ) == "wplc_call_to_server_visitor") {
1018
+ $display_notification = false;
1019
+ }
1020
+ }
1021
+ else if (!$is_agent && $result->originates == 0) {
1022
+ /* this user is a not an agent and the notification is meant for a users, therefore display it */
1023
+ $display_notification = true;
1024
+ } else {
1025
+ /* this notification is not intended for this user */
1026
+ $display_notification = false;
1027
+ }
1028
+ }
1029
+
1030
+ if (!$system_notification) {
1031
+
1032
+ if(function_exists('wplc_encrypt_decrypt_msg')){
1033
+ $msg = wplc_encrypt_decrypt_msg($msg);
1034
+ }
1035
+
1036
+ $msg = apply_filters("wplc_filter_message_control_out",$msg);
1037
+
1038
+ if( is_serialized( $msg ) ){
1039
+ $msg_array = maybe_unserialize( $msg );
1040
+
1041
+ if( is_array( $msg_array ) ){
1042
+ $msg = $msg_array['m'];
1043
+ } else {
1044
+ $msg = $msg;
1045
+ }
1046
+
1047
+ $msg = stripslashes($msg);
1048
+ }
1049
+
1050
+ if ( isset( $result->afrom ) && intval( $result->afrom ) > 0 ) {
1051
+ $msg_array[$id]['afrom'] = intval( $result->afrom ); $other_data['aid'] = intval( $result->afrom );
1052
+
1053
+ }
1054
+ if ( isset( $result->ato ) && intval( $result->ato ) > 0 ) { $msg_array[$id]['ato'] = intval( $result->ato ); }
1055
+
1056
+
1057
+ /* use the new "other" array to get the AID and agent name */
1058
+ if ( $result->originates == '1' && isset( $result->other ) ){
1059
+ $other_data = maybe_unserialize( $result->other );
1060
+ if ( isset( $other_data['aid'] ) ) {
1061
+ $user_info = get_userdata( intval( $other_data['aid'] ) );
1062
+ $agent_from = $user_info->display_name;
1063
+ }
1064
+
1065
+ }
1066
+
1067
+ /* get the name of the USER if there is one */
1068
+ if ( $result->originates == '2' && isset( $result->msgfrom ) ) {
1069
+ $user_from = $result->msgfrom;
1070
+ } else {
1071
+ $user_from = 'User';
1072
+ }
1073
+
1074
+
1075
+ $msg_array[$id]['msg'] = $msg;
1076
+
1077
+ if ($agent_from !== false) {
1078
+ $msg_hist .= $agent_from . ": " . $msg . "<br />";
1079
+ } else {
1080
+ $msg_hist .= $user_from . ": " . $msg . "<br />";
1081
+ }
1082
+
1083
+
1084
+ $msg_array[$id]['originates'] = $result->originates;
1085
+ $msg_array[$id]['other'] = $other_data;
1086
+
1087
+
1088
+ } else {
1089
+ /* this is a system notification */
1090
+ if ($display_notification) {
1091
+ $str = "<span class='chat_time wplc-color-4'>".$nice_time."</span> <span class='wplc_system_notification wplc-color-4'>".$msg."</span>";
1092
+
1093
+ if ( !isset( $msg_array[$id] ) ) { $msg_array[$id] = array(); }
1094
+ $msg_array[$id]['msg'] = $str;
1095
+ $msg_array[$id]['other'] = $other_data;
1096
+ $msg_array[$id]['originates'] = $result->originates;
1097
+
1098
+ $msg_hist .= $str;
1099
+ }
1100
+ }
1101
+
1102
+ }
1103
+
1104
+ if ($display == 'string') { return $msg_hist; } else { return $msg_array; }
1105
+
1106
+
1107
+ }
1108
+
1109
+ /**
1110
+ * Mark a message as 'read'
1111
+ *
1112
+ * Sets the 'status' of the message to 1 in the message table
1113
+ *
1114
+ * @param [int] $mid Message ID - Unique
1115
+ * @return bool
1116
+ */
1117
+ function wplc_mark_message_as_read( $mid ) {
1118
+ global $wpdb;
1119
+ global $wplc_tblname_msgs;
1120
+
1121
+ $wpdb->update(
1122
+ $wplc_tblname_msgs,
1123
+ array(
1124
+ 'status' => 1
1125
+ ),
1126
+ array('id' => $mid),
1127
+ array('%d'),
1128
+ array('%d')
1129
+ );
1130
+ return true;
1131
+ }
1132
+
1133
+
1134
+ /**
1135
+ * Mark all messages sent by an AGENT as read (a user has read them)
1136
+ *
1137
+ * @param int $cid Chat ID
1138
+ * @return string "ok"
1139
+ */
1140
+ function wplc_mark_as_read_user_chat_messages($cid) {
1141
+ global $wpdb;
1142
+ global $wplc_tblname_msgs;
1143
+
1144
+ $results = $wpdb->get_results("SELECT *
1145
+ FROM $wplc_tblname_msgs
1146
+ WHERE `chat_sess_id` = '$cid' AND `status` = '0' AND (`originates` = 1 OR `originates` = 0)
1147
+ ORDER BY `timestamp` DESC");
1148
+
1149
+
1150
+ foreach ($results as $result) {
1151
+ $id = $result->id;
1152
+
1153
+ $wpdb->update(
1154
+ $wplc_tblname_msgs,
1155
+ array(
1156
+ 'status' => 1
1157
+ ),
1158
+ array('id' => $id),
1159
+ array('%d'),
1160
+ array('%d')
1161
+ );
1162
+
1163
+
1164
+ }
1165
+ return "ok";
1166
+
1167
+
1168
+ }
1169
+ /**
1170
+ * Mark all messages sent by a USER as read (an agent has read them)
1171
+ *
1172
+ * @param int $cid Chat ID
1173
+ * @return string "ok"
1174
+ */
1175
+ function wplc_mark_as_read_agent_chat_messages($cid, $aid) {
1176
+ global $wpdb;
1177
+ global $wplc_tblname_msgs;
1178
+
1179
+ $results = $wpdb->get_results("SELECT *
1180
+ FROM $wplc_tblname_msgs
1181
+ WHERE `chat_sess_id` = '$cid' AND `ato` = '".intval( $aid )."'
1182
+ ORDER BY `timestamp` DESC");
1183
+
1184
+
1185
+ foreach ($results as $result) {
1186
+ $id = $result->id;
1187
+
1188
+ $wpdb->update(
1189
+ $wplc_tblname_msgs,
1190
+ array(
1191
+ 'status' => 1
1192
+ ),
1193
+ array('id' => $id),
1194
+ array('%d'),
1195
+ array('%d')
1196
+ );
1197
+
1198
+
1199
+ }
1200
+ return "ok";
1201
+
1202
+
1203
+ }
1204
+
1205
+
1206
+ //here
1207
+ function wplc_return_admin_chat_messages($cid) {
1208
+ $wplc_current_user = get_current_user_id();
1209
+ if( get_user_meta( $wplc_current_user, 'wplc_ma_agent', true ) ){
1210
+ /*
1211
+ -- modified in in 6.0.04 --
1212
+
1213
+ if(current_user_can('wplc_ma_agent') || current_user_can('manage_options')){
1214
+ */
1215
+ $wplc_settings = get_option("WPLC_SETTINGS");
1216
+
1217
+ if(isset($wplc_settings['wplc_display_name']) && $wplc_settings['wplc_display_name'] == 1){ $display_name = 1; } else { $display_name = 0; }
1218
+
1219
+ global $wpdb;
1220
+ global $wplc_tblname_msgs;
1221
+
1222
+ /**
1223
+ * `Originates` - codes:
1224
+ * 0 - System notification to be delivered to users
1225
+ * 1 - Message from an agent
1226
+ * 2 - Message from a user
1227
+ * 3 - System notification to be delivered to agents
1228
+ *
1229
+ */
1230
+ $results = $wpdb->get_results("SELECT * FROM $wplc_tblname_msgs WHERE `chat_sess_id` = '$cid' AND `status` = '0' AND (`originates` = '2' OR `originates` = '3') ORDER BY `timestamp` ASC");
1231
+
1232
+
1233
+ $msg_hist = array();
1234
+ foreach ($results as $result) {
1235
+ $system_notification = false;
1236
+
1237
+ $id = $result->id;
1238
+ wplc_mark_as_read_admin_chat_messages($id);
1239
+ $from = $result->msgfrom;
1240
+
1241
+
1242
+ $msg = $result->msg;
1243
+
1244
+ if ( isset( $result->other ) ) { $other_data = maybe_unserialize( $result->other ); } else { $other_data = array(); }
1245
+ if ($other_data == '') { $other_data = array(); }
1246
+
1247
+ $timestamp = strtotime( $result->timestamp );
1248
+ $other_data['datetime'] = $timestamp;
1249
+ $other_data['datetimeUTC'] = strtotime( get_gmt_from_date( $result->timestamp ) );
1250
+
1251
+ if (intval($result->originates) == 3) {
1252
+ /*
1253
+ system notifications
1254
+ from version 7
1255
+ */
1256
+ $system_notification = true;
1257
+
1258
+ }
1259
+ else {
1260
+
1261
+
1262
+ }
1263
+
1264
+ if (!$system_notification) {
1265
+ /* this is a normal message */
1266
+ if(function_exists('wplc_encrypt_decrypt_msg')){
1267
+ $msg = wplc_encrypt_decrypt_msg($msg);
1268
+ }
1269
+
1270
+ $msg_array = maybe_unserialize( $msg );
1271
+
1272
+ if( is_array( $msg_array ) ){
1273
+ $msg = $msg_array['m'];
1274
+ }
1275
+
1276
+ $msg = stripslashes($msg);
1277
+
1278
+ $msg = apply_filters("wplc_filter_message_control_out",$msg);
1279
+
1280
+ $msg = stripslashes($msg);
1281
+
1282
+ $msg_hist[$id]['msg'] = $msg;
1283
+ $msg_hist[$id]['originates'] = intval($result->originates);
1284
+ $msg_hist[$id]['other'] = $other_data;
1285
+
1286
+ } else {
1287
+ /* add the system notification to the list */
1288
+ if ( isset( $msg_hist[$id] ) ) { $msg_hist[$id] = array(); }
1289
+
1290
+ $msg_hist[$id]['msg'] = $msg;
1291
+ $msg_hist[$id]['other'] = $other_data;
1292
+ $msg_hist[$id]['originates'] = intval($result->originates);
1293
+ }
1294
+
1295
+
1296
+
1297
+
1298
+ }
1299
+
1300
+ return $msg_hist;
1301
+ }
1302
+
1303
+
1304
+
1305
+ else {
1306
+ return "security issue";
1307
+ }
1308
+
1309
+
1310
+ }
1311
+
1312
+ /**
1313
+ * Mark all messages sent by a USER as read (an agent has read them)
1314
+ *
1315
+ * @param int $cid Chat ID
1316
+ * @return string "ok"
1317
+ */
1318
+ function wplc_mark_as_read_admin_chat_messages( $mid ) {
1319
+ $wplc_current_user = get_current_user_id();
1320
+
1321
+ if( get_user_meta( $wplc_current_user, 'wplc_ma_agent', true ) ){
1322
+ global $wpdb;
1323
+ global $wplc_tblname_msgs;
1324
+
1325
+ $wpdb->update(
1326
+ $wplc_tblname_msgs,
1327
+ array(
1328
+ 'status' => 1
1329
+ ),
1330
+ array('id' => $mid),
1331
+ array('%d'),
1332
+ array('%d')
1333
+ );
1334
+
1335
+ } else { return "security issue"; }
1336
+
1337
+ return "ok";
1338
+ }
1339
+
1340
+
1341
+
1342
+
1343
+
1344
+ function wplc_return_chat_session_variable($cid) {
1345
+ global $wpdb;
1346
+ global $wplc_tblname_chats;
1347
+ $results = $wpdb->get_results(
1348
+ "
1349
+ SELECT *
1350
+ FROM $wplc_tblname_chats
1351
+ WHERE `id` = '$cid'
1352
+ "
1353
+ );
1354
+ foreach ($results as $result) {
1355
+ return $result->session;
1356
+ }
1357
+ }
1358
+
1359
+
1360
+
1361
+ function wplc_return_chat_status($cid) {
1362
+ global $wpdb;
1363
+ global $wplc_tblname_chats;
1364
+ $results = $wpdb->get_results(
1365
+ "
1366
+ SELECT *
1367
+ FROM $wplc_tblname_chats
1368
+ WHERE `id` = '$cid'
1369
+ "
1370
+ );
1371
+ foreach ($results as $result) {
1372
+ return $result->status;
1373
+ }
1374
+ }
1375
+
1376
+
1377
+ function wplc_return_status($status) {
1378
+ if ($status == 1) {
1379
+ return __("complete","wplivechat");
1380
+ }
1381
+ if ($status == 2) {
1382
+ return __("pending", "wplivechat");
1383
+ }
1384
+ if ($status == 3) {
1385
+ return __("active", "wplivechat");
1386
+ }
1387
+ if ($status == 4) {
1388
+ return __("deleted", "wplivechat");
1389
+ }
1390
+ if ($status == 5) {
1391
+ return __("browsing", "wplivechat");
1392
+ }
1393
+ if ($status == 6) {
1394
+ return __("requesting chat", "wplivechat");
1395
+ }
1396
+ if($status == 8){
1397
+ return __("Chat Ended - User still browsing", "wplivechat");
1398
+ }
1399
+ if($status == 9){
1400
+ return __("User is browsing but doesn't want to chat", "wplivechat");
1401
+ }
1402
+
1403
+ }
1404
+
1405
+ add_filter("wplc_filter_mail_body","wplc_filter_control_mail_body",10,2);
1406
+ function wplc_filter_control_mail_body($header,$msg) {
1407
+ $primary_bg_color = apply_filters("wplc_mailer_bg_color", "#ec822c"); //Default orange
1408
+ $body = '
1409
+ <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">
1410
+ <html>
1411
+
1412
+ <body>
1413
+
1414
+
1415
+
1416
+ <table id="" border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color: ' . $primary_bg_color . ';">
1417
+ <tbody>
1418
+ <tr>
1419
+ <td width="100%" style="padding: 30px 20px 100px 20px;">
1420
+ <table align="center" cellpadding="0" cellspacing="0" class="" width="100%" style="border-collapse: separate; max-width:600px;">
1421
+ <tbody>
1422
+ <tr>
1423
+ <td style="text-align: center; padding-bottom: 20px;">
1424
+
1425
+ <p>'.$header.'</p>
1426
+ </td>
1427
+ </tr>
1428
+ </tbody>
1429
+ </table>
1430
+
1431
+ <table id="" align="center" cellpadding="0" cellspacing="0" class="" width="100%" style="border-collapse: separate; max-width: 600px; font-family: Georgia, serif; font-size: 12px; color: rgb(51, 62, 72); border: 0px solid rgb(255, 255, 255); border-radius: 10px; background-color: rgb(255, 255, 255);">
1432
+ <tbody>
1433
+ <tr>
1434
+ <td class="sortable-list ui-sortable" style="padding:20px; text-align:center;">
1435
+ '.nl2br($msg).'
1436
+ </td>
1437
+ </tr>
1438
+ </tbody>
1439
+ </table>
1440
+
1441
+ <table align="center" cellpadding="0" cellspacing="0" class="" width="100%" style="border-collapse: separate; max-width:100%;">
1442
+ <tbody>
1443
+ <tr>
1444
+ <td style="padding:20px;">
1445
+ <table border="0" cellpadding="0" cellspacing="0" class="" width="100%">
1446
+ <tbody>
1447
+ <tr>
1448
+ <td id="" align="center">
1449
+ <p>'.site_url().'</p>
1450
+ </td>
1451
+ </tr>
1452
+ </tbody>
1453
+ </table>
1454
+ </td>
1455
+ </tr>
1456
+ </tbody>
1457
+ </table>
1458
+ </td>
1459
+ </tr>
1460
+ </tbody>
1461
+ </table>
1462
+
1463
+
1464
+
1465
+ </div>
1466
+ </body>
1467
+ </html>
1468
+ ';
1469
+ return $body;
1470
+ }
1471
+
1472
+
1473
+ add_filter("wplc_mailer_bg_color","wplc_fitler_mailer_bg_color",10,1);
1474
+ function wplc_fitler_mailer_bg_color($default_color) {
1475
+ $wplc_settings = get_option('WPLC_SETTINGS');
1476
+
1477
+ if (isset($wplc_settings['wplc_theme'])) {
1478
+ $wplc_theme = $wplc_settings['wplc_theme'];
1479
+ }
1480
+
1481
+ if (isset($wplc_theme)) {
1482
+ if($wplc_theme == 'theme-1') {
1483
+ $default_color = "#DB0000";
1484
+ } else if ($wplc_theme == 'theme-2'){
1485
+ $default_color = "#000000";
1486
+ } else if ($wplc_theme == 'theme-3'){
1487
+ $default_color = "#B97B9D";
1488
+ } else if ($wplc_theme == 'theme-4'){
1489
+ $default_color = "#1A14DB";
1490
+ } else if ($wplc_theme == 'theme-5'){
1491
+ $default_color = "#3DCC13";
1492
+ } else if ($wplc_theme == 'theme-6'){
1493
+ //Check what color is selected in palette
1494
+ if (isset($wplc_settings["wplc_settings_color1"])) {
1495
+ $default_color = "#" . $wplc_settings["wplc_settings_color1"];
1496
+ }
1497
+ }
1498
+ }
1499
+
1500
+ return $default_color;
1501
+ }
1502
+
1503
+ /**
1504
+ * Send an email to the admin based on the settings in the settings page
1505
+ * @param string $reply_to email of the user
1506
+ * @param string $reply_to_name name of the user
1507
+ * @param string $subject subject
1508
+ * @param string $msg message being emailed
1509
+ * @return void
1510
+ * @since 5.1.00
1511
+ */
1512
+ function wplcmail($reply_to,$reply_to_name,$subject,$msg) {
1513
+
1514
+ $upload_dir = wp_upload_dir();
1515
+
1516
+ $wplc_pro_settings = get_option("WPLC_SETTINGS");
1517
+ if(isset($wplc_pro_settings['wplc_pro_chat_email_address'])){
1518
+ $email_address = $wplc_pro_settings['wplc_pro_chat_email_address'];
1519
+ }else{
1520
+ $email_address = get_option('admin_email');
1521
+ }
1522
+
1523
+ $email_address = explode(',', $email_address);
1524
+
1525
+ if(get_option("wplc_mail_type") == "wp_mail" || !get_option('wplc_mail_type')){
1526
+ $headers[] = 'Content-type: text/html';
1527
+ $headers[] = 'Reply-To: '.$reply_to_name.'<'.$reply_to.'>';
1528
+ if($email_address){
1529
+ foreach($email_address as $email){
1530
+ /* Send offline message to each email address */
1531
+ $overbody = apply_filters("wplc_filter_mail_body",$subject,$msg);
1532
+ if (!wp_mail($email, $subject, $overbody, $headers)) {
1533
+ $handle = fopen($upload_dir['basedir'].'/wp_livechat_error_log.txt', 'a');
1534
+ $error = date("Y-m-d H:i:s") . " WP-Mail Failed to send \n";
1535
+ @fwrite($handle, $error);
1536
+ }
1537
+ }
1538
+ }
1539
+ // $to = $wplc_pro_settings['wplc_pro_chat_email_address'];
1540
+ return;
1541
+ } else {
1542
+
1543
+
1544
+
1545
+ //require 'phpmailer/PHPMailerAutoload.php';
1546
+ $wplc_pro_settings = get_option("WPLC_PRO_SETTINGS");
1547
+ $host = get_option('wplc_mail_host');
1548
+ $port = get_option('wplc_mail_port');
1549
+ $username = get_option("wplc_mail_username");
1550
+ $password = get_option("wplc_mail_password");
1551
+ if($host && $port && $username && $password){
1552
+ //Create a new PHPMailer instance
1553
+
1554
+ global $phpmailer;
1555
+
1556
+ // (Re)create it, if it's gone missing
1557
+ if ( ! ( $phpmailer instanceof PHPMailer ) ) {
1558
+ require_once ABSPATH . WPINC . '/class-phpmailer.php';
1559
+ require_once ABSPATH . WPINC . '/class-smtp.php';
1560
+ $mail = new PHPMailer( true );
1561
+ }
1562
+
1563
+
1564
+
1565
+ //$mail = new PHPMailer();
1566
+
1567
+
1568
+ $mail->isSMTP();
1569
+ //Enable SMTP debugging
1570
+ // 0 = off (for production use)
1571
+ // 1 = client messages
1572
+ // 2 = client and server messages
1573
+ $mail->SMTPDebug = 0;
1574
+ //Ask for HTML-friendly debug output
1575
+ $mail->Debugoutput = 'html';
1576
+ //Set the hostname of the mail server
1577
+ $mail->Host = $host;
1578
+ //Set the SMTP port number - likely to be 25, 26, 465 or 587
1579
+ $mail->Port = $port;
1580
+ //Set the encryption system to use - ssl (deprecated) or tls
1581
+ if($port == "587"){
1582
+ $mail->SMTPSecure = 'tls';
1583
+ } else if($port == "465"){
1584
+ $mail->SMTPSecure = 'ssl';
1585
+ }
1586
+
1587
+ // Empty out the values that may be set
1588
+ $mail->ClearAllRecipients();
1589
+ $mail->ClearAttachments();
1590
+ $mail->ClearCustomHeaders();
1591
+ $mail->ClearReplyTos();
1592
+
1593
+
1594
+ //Whether to use SMTP authentication
1595
+ $mail->SMTPAuth = true;
1596
+ //Username to use for SMTP authentication
1597
+ $mail->Username = $username;
1598
+ //Password to use for SMTP authentication
1599
+ $mail->Password = $password;
1600
+ //Set who the message is to be sent from
1601
+ $mail->setFrom($reply_to, $reply_to_name);
1602
+ //Set who the message is to be sent to
1603
+ if($email_address){
1604
+ foreach($email_address as $email){
1605
+ $mail->addAddress($email);
1606
+ }
1607
+ }
1608
+ //Set the subject line
1609
+ $mail->Subject = $subject;
1610
+ //Read an HTML message body from an external file, convert referenced images to embedded,
1611
+ //convert HTML into a basic plain-text alternative body
1612
+ $body = apply_filters("wplc_filter_mail_body",$subject,$msg);
1613
+ $mail->msgHTML($body);
1614
+ //Replace the plain text body with one created manually
1615
+ $mail->AltBody = $msg;
1616
+
1617
+
1618
+ //send the message, check for errors
1619
+ if (!$mail->send()) {
1620
+ $handle = fopen($upload_dir['basedir'].'/wp_livechat_error_log.txt', 'a');
1621
+ $error = date("Y-m-d H:i:s")." ".$mail->ErrorInfo." \n";
1622
+ @fwrite($handle, $error);
1623
+ }
1624
+ return;
1625
+ }
1626
+ }
1627
+ }
1628
+ /**
1629
+ * Sends offline messages to the admin (normally via ajax)
1630
+ * @param string $name Name of the user
1631
+ * @param string $email Email of the user
1632
+ * @param string $msg The message being sent to the admin
1633
+ * @param int $cid Chat ID
1634
+ * @return void
1635
+ */
1636
+ function wplc_send_offline_msg($name,$email,$msg,$cid) {
1637
+ $subject = apply_filters("wplc_offline_message_subject_filter", __("WP Live Chat Support - Offline Message from ", "wplivechat") ) . "$name";
1638
+ $msg = __("Name", "wplivechat").": $name \n".
1639
+ __("Email", "wplivechat").": $email\n".
1640
+ __("Message", "wplivechat").": $msg\n\n".
1641
+ __("Via WP Live Chat Support", "wplivechat");
1642
+ wplcmail($email,$name, $subject, $msg);
1643
+ return;
1644
+ }
1645
+
1646
+
1647
+ /**
1648
+ * Saves offline messages to the database
1649
+ * @param string $name User name
1650
+ * @param string $email User email
1651
+ * @param string $message Message being saved
1652
+ * @return Void
1653
+ * @since 5.1.00
1654
+ */
1655
+ function wplc_store_offline_message($name, $email, $message){
1656
+ global $wpdb;
1657
+ global $wplc_tblname_offline_msgs;
1658
+
1659
+ $wplc_settings = get_option('WPLC_SETTINGS');
1660
+
1661
+ /** DEPRECATED BY GDPR */
1662
+ /**if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
1663
+ if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {
1664
+ $ip_address = sanitize_text_field($_SERVER['HTTP_X_FORWARDED_FOR']);
1665
+ } else {
1666
+ $ip_address = sanitize_text_field($_SERVER['REMOTE_ADDR']);
1667
+ }
1668
+ $offline_ip_address = $ip_address;
1669
+ } else {
1670
+ $offline_ip_address = "";
1671
+ }*/
1672
+
1673
+ $offline_ip_address = "";
1674
+
1675
+
1676
+ $ins_array = array(
1677
+ 'timestamp' => current_time('mysql'),
1678
+ 'name' => sanitize_text_field($name),
1679
+ 'email' => sanitize_email($email),
1680
+ 'message' => implode( "\n", array_map( 'sanitize_text_field', explode( "\n", $message ) ) ),
1681
+ 'ip' => sanitize_text_field($offline_ip_address),
1682
+ 'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
1683
+ );
1684
+
1685
+ $rows_affected = $wpdb->insert( $wplc_tblname_offline_msgs, $ins_array );
1686
+ return;
1687
+ }
1688
+ /**
1689
+ * Send what we have found as a system notification
1690
+ */
1691
+ function wplc_send_welcome($cid,$wplc_settings) {
1692
+
1693
+ if (!isset($wplc_settings['wplc_welcome_msg'])) { $wplc_settings['wplc_welcome_msg'] = __("Please standby for an agent. While you wait for the agent you may type your message.","wplivechat"); }
1694
+ $mdata = array(
1695
+ 'msg' => $wplc_settings['wplc_welcome_msg']
1696
+ );
1697
+ wplc_record_chat_notification('await_agent',$cid,$mdata);
1698
+ return;
1699
+
1700
+ }
1701
+
1702
+
1703
+ function wplc_user_initiate_chat($name,$email,$cid = null,$session) {
1704
+
1705
+ global $wpdb;
1706
+ global $wplc_tblname_chats;
1707
+
1708
+
1709
+ $wplc_settings = get_option('WPLC_SETTINGS');
1710
+
1711
+ /** DEPRECATED BY GDPR */
1712
+ /*if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
1713
+ if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {
1714
+ $ip_address = sanitize_text_field($_SERVER['HTTP_X_FORWARDED_FOR']);
1715
+ } else {
1716
+ $ip_address = sanitize_text_field($_SERVER['REMOTE_ADDR']);
1717
+ }
1718
+ $user_data = array(
1719
+ 'ip' => $ip_address,
1720
+ 'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
1721
+ );
1722
+ $wplc_ce_ip = $ip_address;
1723
+ } else {
1724
+ $user_data = array(
1725
+ 'ip' => "",
1726
+ 'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
1727
+ );
1728
+ $wplc_ce_ip = null;
1729
+ }*/
1730
+
1731
+ $user_data = array(
1732
+ 'ip' => "",
1733
+ 'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
1734
+ );
1735
+ $wplc_ce_ip = null;
1736
+
1737
+ if(function_exists('wplc_ce_activate')){
1738
+ /* Log the chat for statistical purposes as well */
1739
+ if(function_exists('wplc_ce_record_initial_chat')){
1740
+ wplc_ce_record_initial_chat($name, $email, $cid, $wplc_ce_ip, sanitize_text_field($_SERVER['HTTP_REFERER']));
1741
+ }
1742
+ }
1743
+
1744
+ if ($cid != null) {
1745
+ /* change from a visitor to a chat */
1746
+
1747
+ /**
1748
+ * This helps us identify if this user needs to be answered. The user can start typing so long but an agent still needs to answer the chat
1749
+ * @var serialized array
1750
+ */
1751
+ $chat_data = wplc_get_chat_data($cid,__LINE__);
1752
+
1753
+ if (isset($chat_data->other)) {
1754
+ $other_data = maybe_unserialize( $chat_data->other );
1755
+ $other_data['unanswered'] = true;
1756
+
1757
+ $other_data = apply_filters("wplc_start_chat_hook_other_data_hook", $other_data);
1758
+ if (!isset($other_data['welcome'])) {
1759
+ //wplc_send_welcome($cid,$wplc_settings);
1760
+ $other_data['welcome'] = true;
1761
+ }
1762
+
1763
+ } else {
1764
+ //wplc_send_welcome($cid,$wplc_settings);
1765
+ $other_data = array();
1766
+ $other_data['welcome'] = true;
1767
+
1768
+ }
1769
+
1770
+
1771
+ $wpdb->update(
1772
+ $wplc_tblname_chats,
1773
+ array(
1774
+ 'status' => 2,
1775
+ 'timestamp' => current_time('mysql'),
1776
+ 'name' => $name,
1777
+ 'email' => $email,
1778
+ 'session' => $session,
1779
+ 'ip' => maybe_serialize($user_data),
1780
+ 'url' => sanitize_text_field($_SERVER['HTTP_REFERER']),
1781
+ 'last_active_timestamp' => current_time('mysql'),
1782
+ 'other' => maybe_serialize($other_data)
1783
+ ),
1784
+ array('id' => $cid),
1785
+ array(
1786
+ '%d',
1787
+ '%s',
1788
+ '%s',
1789
+ '%s',
1790
+ '%s',
1791
+ '%s',
1792
+ '%s',
1793
+ '%s',
1794
+ '%s'
1795
+ ),
1796
+ array('%d')
1797
+ );
1798
+
1799
+ do_action("wplc_hook_initiate_chat",array("cid" => $cid, "name" => $name, "email" => $email));
1800
+
1801
+ do_action("wplc_start_chat_hook_after_data_insert", $cid);
1802
+ return $cid;
1803
+ }
1804
+ else {
1805
+ $other_data = array();
1806
+ $other_data['unanswered'] = true;
1807
+
1808
+ $other_data = apply_filters("wplc_start_chat_hook_other_data_hook", $other_data);
1809
+
1810
+
1811
+
1812
+ $wpdb->insert(
1813
+ $wplc_tblname_chats,
1814
+ array(
1815
+ 'status' => 2,
1816
+ 'timestamp' => current_time('mysql'),
1817
+ 'name' => $name,
1818
+ 'email' => $email,
1819
+ 'session' => $session,
1820
+ 'ip' => maybe_serialize($user_data),
1821
+ 'url' => sanitize_text_field($_SERVER['HTTP_REFERER']),
1822
+ 'last_active_timestamp' => current_time('mysql'),
1823
+ 'other' => maybe_serialize($other_data)
1824
+ ),
1825
+ array(
1826
+ '%s',
1827
+ '%s',
1828
+ '%s',
1829
+ '%s',
1830
+ '%s',
1831
+ '%s',
1832
+ '%s',
1833
+ '%s',
1834
+ '%s'
1835
+ )
1836
+ );
1837
+
1838
+
1839
+ $lastid = $wpdb->insert_id;
1840
+
1841
+
1842
+
1843
+
1844
+ /* Nick: moved from top of function to bottom of function to try speed up the process of accepting the chart - version 7 */
1845
+ if (function_exists("wplc_list_chats_pro")) { /* check if functions-pro is around */
1846
+ wplc_pro_notify_via_email();
1847
+ }
1848
+
1849
+ do_action("wplc_start_chat_hook_after_data_insert", $lastid);
1850
+ return $lastid;
1851
+ }
1852
+
1853
+ }
1854
+
1855
+
1856
+
1857
+ function wplc_get_msg() {
1858
+ return "<a href=\"javascript:void(0);\" class=\"wplc_second_chat_request button button-primary\" style='cursor:not-allowed' title=\"".__("Get Pro Add-on to accept more chats","wplivechat")."\" target=\"_BLANK\">".__("Accept Chat","wplivechat")."</a>";
1859
+ }
1860
+ function wplc_update_chat_statuses() {
1861
+ global $wpdb;
1862
+ global $wplc_tblname_chats;
1863
+ $results = $wpdb->get_results(
1864
+ "
1865
+ SELECT *
1866
+ FROM $wplc_tblname_chats
1867
+ WHERE `status` = '2' OR `status` = '3' OR `status` = '5' or `status` = '8' or `status` = '9' or `status` = '10' or `status` = 12
1868
+ "
1869
+ );
1870
+ foreach ($results as $result) {
1871
+ $id = $result->id;
1872
+ $timestamp = strtotime($result->last_active_timestamp);
1873
+ $datenow = current_time('timestamp');
1874
+ $difference = $datenow - $timestamp;
1875
+
1876
+
1877
+
1878
+ if (intval($result->status) == 2) {
1879
+ if ($difference >= 30) { // 60 seconds max
1880
+ wplc_change_chat_status($id,12);
1881
+ }
1882
+ }
1883
+ else if (intval($result->status) == 12) {
1884
+ if ($difference >= 30) { // 30 seconds max
1885
+ wplc_change_chat_status($id,0);
1886
+ }
1887
+ }
1888
+ else if (intval($result->status) == 3) {
1889
+ if ($difference >= 300) { // 5 minutes
1890
+ wplc_change_chat_status($id,1);
1891
+ }
1892
+ }
1893
+ else if (intval($result->status) == 5) {
1894
+ if ($difference >= 120) { // 2 minute timeout
1895
+ wplc_change_chat_status($id,7); // 7 - timedout
1896
+ }
1897
+ } else if(intval($result->status) == 8){ // chat is complete but user is still browsing
1898
+ if ($difference >= 45) { // 30 seconds
1899
+ wplc_change_chat_status($id,1); // 1 - chat is now complete
1900
+ }
1901
+ } else if(intval($result->status) == 9 || $result->status == 10){
1902
+ if ($difference >= 120) { // 120 seconds
1903
+ wplc_change_chat_status($id,7); // 7 - timedout
1904
+ }
1905
+ }
1906
+ }
1907
+ }
1908
+ function wplc_check_pending_chats(){
1909
+ global $wpdb;
1910
+ global $wplc_tblname_chats;
1911
+ $sql = "SELECT * FROM `$wplc_tblname_chats` WHERE `status` = 2";
1912
+ $wpdb->query($sql);
1913
+ $results = $wpdb->get_results($sql);
1914
+ if($results){
1915
+ foreach ($results as $result) {
1916
+ $other = maybe_unserialize($result->other);
1917
+ if (isset($other['unanswered'])) {
1918
+ return true;
1919
+ }
1920
+ }
1921
+
1922
+ }
1923
+ return false;
1924
+ }
1925
+ function wplc_get_active_and_pending_chats(){
1926
+ global $wpdb;
1927
+ global $wplc_tblname_chats;
1928
+ $sql = "SELECT * FROM `$wplc_tblname_chats` WHERE `status` = 2 OR `status` = 3 ORDER BY `status`";
1929
+ $results = $wpdb->get_results($sql);
1930
+ if($results){
1931
+ return $results;
1932
+ } else {
1933
+ return false;
1934
+ }
1935
+ }
1936
+ function wplc_convert_array_to_string($array){
1937
+ $string = "";
1938
+ if($array){
1939
+ foreach($array as $value){
1940
+ $string.= $value->id." ;";
1941
+ }
1942
+ } else {
1943
+ $string = false;
1944
+ }
1945
+ return $string;
1946
+ }
1947
+
1948
+ function wplc_return_browser_image($string,$size) {
1949
+ switch($string) {
1950
+
1951
+ case "Internet Explorer":
1952
+ return "internet-explorer_".$size."x".$size.".png";
1953
+ break;
1954
+ case "Mozilla Firefox":
1955
+ return "firefox_".$size."x".$size.".png";
1956
+ break;
1957
+ case "Opera":
1958
+ return "opera_".$size."x".$size.".png";
1959
+ break;
1960
+ case "Google Chrome":
1961
+ return "chrome_".$size."x".$size.".png";
1962
+ break;
1963
+ case "Safari":
1964
+ return "safari_".$size."x".$size.".png";
1965
+ break;
1966
+ case "Other browser":
1967
+ return "web_".$size."x".$size.".png";
1968
+ break;
1969
+ default:
1970
+ return "web_".$size."x".$size.".png";
1971
+ break;
1972
+ }
1973
+
1974
+
1975
+ }
1976
+ function wplc_return_browser_string($user_agent) {
1977
+ if(strpos($user_agent, 'MSIE') !== FALSE)
1978
+ return 'Internet Explorer';
1979
+ elseif(strpos($user_agent, 'Trident') !== FALSE) //For Supporting IE 11
1980
+ return 'Internet Explorer';
1981
+ elseif(strpos($user_agent, 'Edge') !== FALSE)
1982
+ return 'Internet Explorer';
1983
+ elseif(strpos($user_agent, 'Firefox') !== FALSE)
1984
+ return 'Mozilla Firefox';
1985
+ elseif(strpos($user_agent, 'Chrome') !== FALSE)
1986
+ return 'Google Chrome';
1987
+ elseif(strpos($user_agent, 'Opera Mini') !== FALSE)
1988
+ return "Opera";
1989
+ elseif(strpos($user_agent, 'Opera') !== FALSE)
1990
+ return "Opera";
1991
+ elseif(strpos($user_agent, 'Safari') !== FALSE)
1992
+ return "Safari";
1993
+ else
1994
+ return 'Other browser';
1995
+ }
1996
+
1997
+ function wplc_error_directory() {
1998
+ $upload_dir = wp_upload_dir();
1999
+
2000
+ if (is_multisite()) {
2001
+ if (!file_exists($upload_dir['basedir'].'/wp-live-chat-support')) {
2002
+ wp_mkdir_p($upload_dir['basedir'].'/wp-live-chat-support');
2003
+ $content = "Error log created";
2004
+ $fp = @fopen($upload_dir['basedir'].'/wp-live-chat-support/error_log.txt','w+');
2005
+ @fwrite($fp,$content);
2006
+ }
2007
+ } else {
2008
+ if (!file_exists($upload_dir['basedir'] .'/wp-live-chat-support')) {
2009
+ wp_mkdir_p($upload_dir['basedir'] . '/wp-live-chat-support');
2010
+ $content = "Error log created";
2011
+ $fp = @fopen($upload_dir['basedir'] . '/wp-live-chat-support/error_log.txt','w+');
2012
+ @fwrite($fp,$content);
2013
+ }
2014
+
2015
+ }
2016
+ return true;
2017
+
2018
+ }
2019
+
2020
+ function wplc_error_log($error) {
2021
+ return;
2022
+ $upload_dir = wp_upload_dir();
2023
+ $content = "\r\n[".date("Y-m-d")."] [".date("H:i:s")."]".$error;
2024
+ $fp = @fopen($upload_dir['basedir'].'/wp-live-chat-support/error_log.txt','a+');
2025
+ @fwrite($fp,$content);
2026
+ @fclose($fp);
2027
+
2028
+
2029
+ }
2030
+ function Memory_Usage($decimals = 2) {
2031
+ $result = 0;
2032
+
2033
+ if (function_exists('memory_get_usage')) {
2034
+ $result = memory_get_usage() / 1024;
2035
+ }
2036
+
2037
+ else {
2038
+ if (function_exists('exec')) {
2039
+ $output = array();
2040
+
2041
+ if (substr(strtoupper(PHP_OS), 0, 3) == 'WIN') {
2042
+ exec('tasklist /FI "PID eq ' . getmypid() . '" /FO LIST', $output);
2043
+
2044
+ $result = preg_replace('/[\D]/', '', $output[5]);
2045
+ }
2046
+
2047
+ else {
2048
+ exec('ps -eo%mem,rss,pid | grep ' . getmypid(), $output);
2049
+
2050
+ $output = explode(' ', $output[0]);
2051
+
2052
+ $result = $output[1];
2053
+ }
2054
+ }
2055
+ }
2056
+
2057
+ return number_format(intval($result) / 1024, $decimals, '.', '')." mb";
2058
+ }
2059
+ function wplc_get_memory_usage() {
2060
+ $size = memory_get_usage(true);
2061
+ $unit=array('b','kb','mb','gb','tb','pb');
2062
+ return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];
2063
+
2064
+ }
2065
+ function wplc_record_mem() {
2066
+ $upload_dir = wp_upload_dir();
2067
+ $data = array(
2068
+ 'date' => current_time('mysql'),
2069
+ 'php_mem' => wplc_get_memory_usage()
2070
+ );
2071
+ $fp = @fopen($upload_dir['basedir'].'/wp-live-chat-support'."/mem_usag.csv","a+");
2072
+ fputcsv($fp, $data);
2073
+ fclose($fp);
2074
+ }
2075
+
2076
+ function wplc_admin_display_missed_chats() {
2077
+
2078
+ global $wpdb;
2079
+ global $wplc_tblname_chats;
2080
+
2081
+
2082
+ if(isset($_GET['wplc_action']) && $_GET['wplc_action'] == 'remove_missed_cid'){
2083
+ if(isset($_GET['cid'])){
2084
+ if(isset($_GET['wplc_confirm'])){
2085
+ //Confirmed - delete
2086
+ $delete_sql = "";
2087
+ if ( empty( $_GET['cid'] ) ) {
2088
+ exit('No CID?');
2089
+ }
2090
+ $delete_sql = "DELETE FROM $wplc_tblname_chats WHERE `id` = '".intval( sanitize_text_field( $_GET['cid'] ) )."' LIMIT 1";
2091
+
2092
+ $wpdb->query($delete_sql);
2093
+ if ($wpdb->last_error) {
2094
+ echo "<div class='update-nag' style='margin-top: 0px;margin-bottom: 5px;'>
2095
+ ".__("Error: Could not delete chat", "wplivechat")."<br>
2096
+ </div>";
2097
+ } else {
2098
+ echo "<div class='update-nag' style='margin-top: 0px;margin-bottom: 5px;border-color:#67d552;'>
2099
+ ".__("Chat Deleted", "wplivechat")."<br>
2100
+ </div>";
2101
+ }
2102
+
2103
+ } else {
2104
+ //Prompt
2105
+ echo "<div class='update-nag' style='margin-top: 0px;margin-bottom: 5px;'>
2106
+ ".__("Are you sure you would like to delete this chat?", "wplivechat")."<br>
2107
+ <a class='button' href='?page=wplivechat-menu-missed-chats&wplc_action=remove_missed_cid&cid=".$_GET['cid']."&wplc_confirm=1''>".__("Yes", "wplivechat")."</a> <a class='button' href='?page=wplivechat-menu-missed-chats'>".__("No", "wplivechat")."</a>
2108
+ </div>";
2109
+ }
2110
+ }
2111
+ }
2112
+
2113
+ echo "
2114
+ <table class=\"wp-list-table widefat fixed \" cellspacing=\"0\">
2115
+ <thead>
2116
+ <tr>
2117
+ <th class='manage-column column-id'><span>" . __("Date", "wplivechat") . "</span></th>
2118
+ <th scope='col' id='wplc_name_colum' class='manage-column column-id'><span>" . __("Name", "wplivechat") . "</span></th>
2119
+ <th scope='col' id='wplc_email_colum' class='manage-column column-id'>" . __("Email", "wplivechat") . "</th>
2120
+ <th scope='col' id='wplc_url_colum' class='manage-column column-id'>" . __("URL", "wplivechat") . "</th>
2121
+ <th scope='col' id='wplc_url_colum' class='manage-column column-id'>" . __("Action", "wplivechat") . "</th>
2122
+ </tr>
2123
+ </thead>
2124
+ <tbody id=\"the-list\" class='list:wp_list_text_link'>";
2125
+
2126
+ $pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 1;
2127
+ $limit = 20; // number of rows in page
2128
+ $offset = ( $pagenum - 1 ) * $limit;
2129
+ if (function_exists("wplc_register_pro_version")) {
2130
+ $total = $wpdb->get_var( "SELECT COUNT(`id`) FROM $wplc_tblname_chats WHERE (`status` = 0 OR `agent_id` = 0)" );
2131
+ } else {
2132
+ $total = $wpdb->get_var( "SELECT COUNT(`id`) FROM $wplc_tblname_chats WHERE `status` = 0" );
2133
+ }
2134
+ $num_of_pages = ceil( $total / $limit );
2135
+
2136
+ if (function_exists("wplc_register_pro_version")) {
2137
+ $sql = "SELECT * FROM $wplc_tblname_chats WHERE (`status` = 0 OR `agent_id` = 0) ORDER BY `timestamp` DESC LIMIT $limit OFFSET $offset";
2138
+ } else {
2139
+ $sql = "SELECT * FROM $wplc_tblname_chats WHERE `status` = 0 ORDER BY `timestamp` DESC LIMIT $limit OFFSET $offset";
2140
+ }
2141
+
2142
+ $results = $wpdb->get_results($sql);
2143
+
2144
+ if (!$results) {
2145
+ echo "<tr><td></td><td>" . __("You have not missed any chat requests.", "wplivechat") . "</td></tr>";
2146
+ } else {
2147
+ foreach ($results as $result) {
2148
+
2149
+ $url = admin_url('admin.php?page=wplivechat-menu&action=history&cid=' . $result->id);
2150
+ $url2 = admin_url('admin.php?page=wplivechat-menu&action=download_history&type=csv&cid=' . $result->id);
2151
+ $url3 = "?page=wplivechat-menu-missed-chats&wplc_action=remove_missed_cid&cid=" . $result->id;
2152
+ $actions = "
2153
+ <a href='$url' class='button' title='".__('View Chat History', 'wplivechat')."' target='_BLANK' id=''><i class='fa fa-eye'></i></a> <a href='$url2' class='button' title='".__('Download Chat History', 'wplivechat')."' target='_BLANK' id=''><i class='fa fa-download'></i></a> <a href='$url3' class='button'><i class='fa fa-trash-o'></i></a>
2154
+ ";
2155
+
2156
+ echo "<tr id=\"record_" . $result->id . "\">";
2157
+ echo "<td class='chat_id column-chat_d'>" . sanitize_text_field($result->timestamp) . "</td>";
2158
+ echo "<td class='chat_name column_chat_name' id='chat_name_" . $result->id . "'><img src=\"//www.gravatar.com/avatar/" . md5($result->email) . "?s=30\" class='wplc-user-message-avatar' /> " . sanitize_text_field($result->name) . "</td>";
2159
+ echo "<td class='chat_email column_chat_email' id='chat_email_" . $result->id . "'><a href='mailto:" . sanitize_text_field($result->email) . "' title='Email " . ".$result->email." . "'>" . sanitize_text_field($result->email) . "</a></td>";
2160
+ echo "<td class='chat_name column_chat_url' id='chat_url_" . $result->id . "'>" . esc_url($result->url) . "</td>";
2161
+ echo "<td class='chat_name column_chat_url'>".$actions."</td>";
2162
+ echo "</tr>";
2163
+ }
2164
+ }
2165
+
2166
+ echo "
2167
+ </tbody>
2168
+ </table>";
2169
+
2170
+ $page_links = paginate_links( array(
2171
+ 'base' => add_query_arg( 'pagenum', '%#%' ),
2172
+ 'format' => '',
2173
+ 'prev_text' => __( '&laquo;', 'wplivechat' ),
2174
+ 'next_text' => __( '&raquo;', 'wplivechat' ),
2175
+ 'total' => $num_of_pages,
2176
+ 'current' => $pagenum
2177
+ ) );
2178
+
2179
+ if ( $page_links ) {
2180
+ echo '<div class="tablenav"><div class="tablenav-pages" style="margin: 1em 0;float:none;text-align:center;">' . $page_links . '</div></div>';
2181
+ }
2182
+ }
2183
+
2184
+
2185
+ /**
2186
+ * Compares the users IP address to the list in the banned IPs in the settings page
2187
+ * @return BOOL
2188
+ */
2189
+ function wplc_is_user_banned_basic(){
2190
+ $banned_ip = get_option('WPLC_BANNED_IP_ADDRESSES');
2191
+ if($banned_ip){
2192
+ $banned_ip = maybe_unserialize($banned_ip);
2193
+ $banned = 0;
2194
+ if (is_array($banned_ip)) {
2195
+ foreach($banned_ip as $ip){
2196
+
2197
+ if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {
2198
+ $ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];
2199
+ } else {
2200
+ $ip_address = $_SERVER['REMOTE_ADDR'];
2201
+ }
2202
+
2203
+ if(isset($ip_address)){
2204
+ if($ip == $ip_address){
2205
+ $banned++;
2206
+ }
2207
+ } else {
2208
+ $banned = 0;
2209
+ }
2210
+ }
2211
+ } else {
2212
+ return 0;
2213
+ }
2214
+ } else {
2215
+ $banned = 0;
2216
+ }
2217
+ return $banned;
2218
+ }
2219
+
2220
+
2221
+
2222
+
2223
+ function wplc_return_animations_basic(){
2224
+
2225
+ $wplc_settings = get_option("WPLC_SETTINGS");
2226
+
2227
+ if ($wplc_settings["wplc_settings_align"] == 1) {
2228
+ $original_pos = "bottom_left";
2229
+ //$wplc_box_align = "left:100px; bottom:0px;";
2230
+ $wplc_box_align = "bottom:0px;";
2231
+ } else if ($wplc_settings["wplc_settings_align"] == 2) {
2232
+ $original_pos = "bottom_right";
2233
+ //$wplc_box_align = "right:100px; bottom:0px;";
2234
+ $wplc_box_align = "bottom:0px;";
2235
+ } else if ($wplc_settings["wplc_settings_align"] == 3) {
2236
+ $original_pos = "left";
2237
+ // $wplc_box_align = "left:0; bottom:100px;";
2238
+ $wplc_box_align = " bottom:100px;";
2239
+ $wplc_class = "wplc_left";
2240
+ } else if ($wplc_settings["wplc_settings_align"] == 4) {
2241
+ $original_pos = "right";
2242
+ // $wplc_box_align = "right:0; bottom:100px;";
2243
+ $wplc_box_align = "bottom:100px;";
2244
+ $wplc_class = "wplc_right";
2245
+ }
2246
+
2247
+ $animation_data = array();
2248
+
2249
+ if(isset($wplc_settings['wplc_animation']) && $wplc_settings['wplc_animation'] == 'animation-1'){
2250
+
2251
+ if($original_pos == 'bottom_right'){
2252
+ $wplc_starting_point = 'margin-bottom: -350px; right: 20px;';
2253
+ $wplc_animation = 'animation-1';
2254
+ } else if ($original_pos == 'bottom_left'){
2255
+ $wplc_starting_point = 'margin-bottom: -350px; left: 20px;';
2256
+ $wplc_animation = 'animation-1';
2257
+ } else if ($original_pos == 'left'){
2258
+ $wplc_starting_point = 'margin-bottom: -350px; left: 0px;';
2259
+ $wplc_box_align = "left:0; bottom:100px;";
2260
+ $wplc_animation = 'animation-1';
2261
+ } else if ($original_pos == 'right'){
2262
+ $wplc_starting_point = 'margin-bottom: -350px; right: 0px;';
2263
+ $wplc_animation = 'animation-1';
2264
+ $wplc_box_align = "right:0; bottom:100px;";
2265
+ }
2266
+
2267
+ $animation_data['animation'] = $wplc_animation;
2268
+ $animation_data['starting_point'] = $wplc_starting_point;
2269
+ $animation_data['box_align'] = $wplc_box_align;
2270
+
2271
+ } else if (isset($wplc_settings['wplc_animation']) && $wplc_settings['wplc_animation'] == 'animation-2'){
2272
+
2273
+ if($original_pos == 'bottom_right'){
2274
+ $wplc_starting_point = 'margin-bottom: 0px; right: -300px;';
2275
+ $wplc_animation = 'animation-2-br';
2276
+ } else if ($original_pos == 'bottom_left'){
2277
+ $wplc_starting_point = 'margin-bottom: 0px; left: -300px;';
2278
+ $wplc_animation = 'animation-2-bl';
2279
+ } else if ($original_pos == 'left'){
2280
+ $wplc_starting_point = 'margin-bottom: 0px; left: -999px;';
2281
+ $wplc_animation = 'animation-2-l';
2282
+ } else if ($original_pos == 'right'){
2283
+ $wplc_starting_point = 'margin-bottom: 0px; right: -999px;';
2284
+ $wplc_animation = 'animation-2-r';
2285
+ }
2286
+
2287
+ $animation_data['animation'] = $wplc_animation;
2288
+ $animation_data['starting_point'] = $wplc_starting_point;
2289
+ $animation_data['box_align'] = $wplc_box_align;
2290
+
2291
+ } else if (isset($wplc_settings['wplc_animation']) && $wplc_settings['wplc_animation'] == 'animation-3'){
2292
+
2293
+ $wplc_animation = 'animation-3';
2294
+
2295
+ if($original_pos == 'bottom_right'){
2296
+ $wplc_starting_point = 'margin-bottom: 0; right: 20px; display: none;';
2297
+ } else if ($original_pos == 'bottom_left'){
2298
+ $wplc_starting_point = 'margin-bottom: 0px; left: 20px; display: none;';
2299
+ } else if ($original_pos == 'left'){
2300
+ $wplc_starting_point = 'margin-bottom: 100px; left: 0px; display: none;';
2301
+ } else if ($original_pos == 'right'){
2302
+ $wplc_starting_point = 'margin-bottom: 100px; right: 0px; display: none;';
2303
+ }
2304
+
2305
+ $animation_data['animation'] = $wplc_animation;
2306
+ $animation_data['starting_point'] = $wplc_starting_point;
2307
+ $animation_data['box_align'] = $wplc_box_align;
2308
+
2309
+ } else if (isset($wplc_settings['wplc_animation']) && $wplc_settings['wplc_animation'] == 'animation-4'){
2310
+ // Dont use an animation
2311
+
2312
+ $wplc_animation = "animation-4";
2313
+
2314
+ if($original_pos == 'bottom_right'){
2315
+ $wplc_starting_point = 'margin-bottom: 0; right: 20px; display: none;';
2316
+ } else if ($original_pos == 'bottom_left'){
2317
+ $wplc_starting_point = 'margin-bottom: 0px; left: 20px; display: none;';
2318
+ } else if ($original_pos == 'left'){
2319
+ $wplc_starting_point = 'margin-bottom: 100px; left: 0px; display: none;';
2320
+ } else if ($original_pos == 'right'){
2321
+ $wplc_starting_point = 'margin-bottom: 100px; right: 0px; display: none;';
2322
+ }
2323
+
2324
+ $animation_data['animation'] = $wplc_animation;
2325
+ $animation_data['starting_point'] = $wplc_starting_point;
2326
+ $animation_data['box_align'] = $wplc_box_align;
2327
+
2328
+ } else {
2329
+
2330
+ if($original_pos == 'bottom_right'){
2331
+ $wplc_starting_point = 'margin-bottom: 0; right: 20px; display: none;';
2332
+ } else if ($original_pos == 'bottom_left'){
2333
+ $wplc_starting_point = 'margin-bottom: 0px; left: 20px; display: none;';
2334
+ } else if ($original_pos == 'left'){
2335
+ $wplc_starting_point = 'margin-bottom: 100px; left: 0px; display: none;';
2336
+ } else if ($original_pos == 'right'){
2337
+ $wplc_starting_point = 'margin-bottom: 100px; right: 0px; display: none;';
2338
+ }
2339
+
2340
+ $wplc_animation = 'none';
2341
+
2342
+ $animation_data['animation'] = $wplc_animation;
2343
+ $animation_data['starting_point'] = $wplc_starting_point;
2344
+ $animation_data['box_align'] = $wplc_box_align;
2345
+ }
2346
+
2347
+ return $animation_data;
2348
+ }
2349
+
2350
+
2351
+ add_action("wplc_advanced_settings_above_performance", "wplc_advanced_settings_above_performance_control", 10, 1);
2352
+ function wplc_advanced_settings_above_performance_control($wplc_settings){
2353
+ $elem_trig_action = isset($wplc_settings['wplc_elem_trigger_action']) ? $wplc_settings['wplc_elem_trigger_action'] : "0";
2354
+ $elem_trig_type = isset($wplc_settings['wplc_elem_trigger_type']) ? $wplc_settings['wplc_elem_trigger_type'] : "0";
2355
+ $elem_trig_id = isset($wplc_settings['wplc_elem_trigger_id']) ? $wplc_settings['wplc_elem_trigger_id'] : "";
2356
+
2357
+ echo "<tr>
2358
+ <td width='350'>
2359
+ ".__("Open chat window via", "wplivechat").":
2360
+ </td>
2361
+ <td>
2362
+ <select name='wplc_elem_trigger_action'>
2363
+ <option value='0' ".($elem_trig_action == "0" ? "selected" : "").">".__("Click", "wplivechat")."</option>
2364
+ <option value='1' ".($elem_trig_action == "1" ? "selected" : "").">".__("Hover", "wplivechat")."</option>
2365
+ </select>
2366
+ ".__("element with", "wplivechat").":
2367
+ <select name='wplc_elem_trigger_type'>
2368
+ <option value='0' ".($elem_trig_type == "0" ? "selected" : "").">".__("Class", "wplivechat")."</option>
2369
+ <option value='1' ".($elem_trig_type == "1" ? "selected" : "").">".__("ID", "wplivechat")."</option>
2370
+ </select>
2371
+ <input type='text' name='wplc_elem_trigger_id' value='".$elem_trig_id."'>
2372
+ </td>
2373
+ </tr>
2374
+ ";
2375
+ }
2376
+
2377
+ /**
2378
+ * Reverse of wplc_return_chat_id_by_rel
2379
+ */
2380
+ function wplc_return_chat_rel_by_id($cid) {
2381
+ global $wpdb;
2382
+ global $wplc_tblname_chats;
2383
+
2384
+ $results = $wpdb->get_results("SELECT * FROM $wplc_tblname_chats WHERE `id` = '$cid' LIMIT 1");
2385
+ if ($results) {
2386
+ foreach ($results as $result) {
2387
+ if (isset($result->rel)) {
2388
+ return $result->rel;
2389
+ } else {
2390
+ return $cid;
2391
+ }
2392
+ }
2393
+ } else {
2394
+ return $cid;
2395
+ }
2396
+
2397
+ }
2398
+
2399
+ /*
2400
+ * Returns total message count for a chat
2401
+ */
2402
+ function wplc_return_message_count_by_cid($cid) {
2403
+ global $wpdb;
2404
+ global $wplc_tblname_msgs;
2405
+
2406
+ $sql = "SELECT `id` FROM $wplc_tblname_msgs WHERE `chat_sess_id` = '$cid'";
2407
+ $results = $wpdb->get_results($sql);
2408
+
2409
+ $message_count = 0;
2410
+ foreach ($results as $result) {
2411
+ $message_count ++;
2412
+ }
2413
+
2414
+ return $message_count;
2415
+ }
2416
+
2417
+ function wplc_all_avatars() {
2418
+ $users = get_users(array(
2419
+ 'meta_key' => 'wplc_ma_agent',
2420
+ ));
2421
+ $avatars = array();
2422
+ foreach ($users as $user) {
2423
+ $avatars[$user->data->ID] = wplc_get_avatar($user->data->ID);
2424
+ }
2425
+ return $avatars;
2426
+ }
2427
+
2428
+ function wplc_get_avatar($id) {
2429
+ $wplc_settings = get_option("WPLC_SETTINGS");
2430
+ $user = get_user_by( 'id', $id );
2431
+
2432
+ if (isset($wplc_settings['wplc_avatar_source']) && $wplc_settings['wplc_avatar_source'] == 'gravatar') {
2433
+ return '//www.gravatar.com/avatar/' . md5( strtolower( trim( $user->data->user_email ) ) );
2434
+ } elseif (isset($wplc_settings['wplc_avatar_source']) && $wplc_settings['wplc_avatar_source'] == 'wp_avatar') {
2435
+ if (function_exists('get_wp_user_avatar')) {
2436
+ return get_wp_user_avatar_src($id);
2437
+ } else {
2438
+ return '//www.gravatar.com/avatar/' . md5( strtolower( trim( $user->data->user_email ) ) );
2439
+ }
2440
+ } else {
2441
+ return '//www.gravatar.com/avatar/' . md5( strtolower( trim( $user->data->user_email ) ) );
2442
+ }
2443
  }
includes/blocks/wplc-chat-box/block.js CHANGED
@@ -1,130 +1,130 @@
1
- /* BLOCK: WP Live Chat Support Chat Box */
2
-
3
- ( function() {
4
-
5
- var __ = wp.i18n.__;
6
- var el = wp.element.createElement;
7
- var children = wp.blocks.source.children;
8
- var registerBlockType = wp.blocks.registerBlockType;
9
-
10
- String.prototype.stripSlashes = function(){
11
- return this.replace(/\\(.)/mg, "$1");
12
- }
13
-
14
- var wplc_logo = ( wplc_settings.wplc_logo ) ? wplc_settings.wplc_logo : 'https://bleeper.io/app/assets/images/wplc_loading.png';
15
- var wplc_text = ( wplc_settings.wplc_text ) ? wplc_settings.wplc_text : 'Live Chat';
16
- var wplc_icon = ( wplc_settings.wplc_icon ) ? wplc_settings.wplc_icon : 'fa-commenting-o';
17
- var classes = ( wplc_settings.wplc_enabled == 0 ) ? ' disabled' : '';
18
- var icon_classes = ( wplc_settings.wplc_icon_enabled == 0 ) ? ' disabled' : '';
19
- var size_class = ' md';
20
- var default_template = '<!-- Default HTML --><div class="wplc_block"><span class="wplc_block_logo">{wplc_logo}</span><span class="wplc_block_text">{wplc_text}</span><span class="wplc_block_icon">{wplc_icon}</span></div>';
21
- var wplc_template = ( wplc_settings.wplc_custom_html ) ? wplc_settings.wplc_custom_html : default_template;
22
- wplc_template = wplc_template.stripSlashes();
23
-
24
- if ( wplc_settings.wplc_size == 1 ) {
25
- size_class = ' sm';
26
- } else if ( wplc_settings.wplc_size == 2 ) {
27
- size_class = ' md';
28
- } else if ( wplc_settings.wplc_size == 3 ) {
29
- size_class = ' lg';
30
- }
31
-
32
- var wplc_styles = {
33
- backgroundImage: 'url(' + wplc_logo + ')'
34
- }
35
-
36
- var placeholder_codes = ['wplc_logo', 'wplc_text', 'wplc_icon'],
37
- placeholder_values = ['<span class="wplc_block_logo" style="background-image: url(\'' + wplc_logo + '\');"></span>', wplc_text, '<i class="fa ' + wplc_icon + '"></i>'];
38
-
39
- for( var i = 0; i < placeholder_codes.length; i++ ) {
40
- wplc_template = wplc_template.replace(new RegExp('{' + placeholder_codes[i] + '}', 'gi'), placeholder_values[i]);
41
- }
42
-
43
- registerBlockType( 'wp-live-chat-support/wplc-chat-box', {
44
- title: __( 'WP Live Chat Trigger (WP Live Chat Support)', 'WPLC' ),
45
- icon: 'format-chat',
46
- category: 'common',
47
-
48
- edit: function( props ) {
49
- output_wplc_block_logo = el(
50
- 'span',
51
- { className: 'wplc_block_logo',
52
- style: wplc_styles
53
- }
54
- );
55
- output_wplc_block_text = el(
56
- 'span',
57
- { className: 'wplc_block_text' },
58
- wplc_text
59
- );
60
-
61
- icon = el(
62
- 'i',
63
- { className: 'fa fa-commenting-o' }
64
- );
65
-
66
- output_wplc_block_icon = el(
67
- 'span',
68
- { className: 'wplc_block_icon' + icon_classes },
69
- icon
70
- );
71
-
72
- output = el(
73
- 'span',
74
- { className: 'wplc_block' + classes + size_class },
75
- output_wplc_block_logo,
76
- output_wplc_block_text,
77
- output_wplc_block_icon
78
- );
79
-
80
- return el(
81
- 'div',
82
- { id: 'wplc-chat-box',
83
- className: classes,
84
- dangerouslySetInnerHTML: { __html: wplc_template }
85
- },
86
- );
87
- },
88
-
89
- save: function( props ) {
90
- output_wplc_block_logo = el(
91
- 'span',
92
- { className: 'wplc_block_logo',
93
- style: wplc_styles
94
- }
95
- );
96
- output_wplc_block_text = el(
97
- 'span',
98
- { className: 'wplc_block_text' },
99
- wplc_text
100
- );
101
-
102
- icon = el(
103
- 'i',
104
- { className: 'fa fa-commenting-o' }
105
- );
106
-
107
- output_wplc_block_icon = el(
108
- 'span',
109
- { className: 'wplc_block_icon' + icon_classes },
110
- icon
111
- );
112
-
113
- output = el(
114
- 'span',
115
- { className: 'wplc_block' + classes + size_class },
116
- output_wplc_block_logo,
117
- output_wplc_block_text,
118
- output_wplc_block_icon
119
- );
120
-
121
- return el(
122
- 'div',
123
- { id: 'wplc-chat-box',
124
- className: classes,
125
- dangerouslySetInnerHTML: { __html: wplc_template }
126
- }
127
- );
128
- },
129
- } );
130
- })();
1
+ /* BLOCK: WP Live Chat Support Chat Box */
2
+
3
+ ( function() {
4
+
5
+ var __ = wp.i18n.__;
6
+ var el = wp.element.createElement;
7
+ var children = wp.blocks.source.children;
8
+ var registerBlockType = wp.blocks.registerBlockType;
9
+
10
+ String.prototype.stripSlashes = function(){
11
+ return this.replace(/\\(.)/mg, "$1");
12
+ }
13
+
14
+ var wplc_logo = ( wplc_settings.wplc_logo ) ? wplc_settings.wplc_logo : 'https://bleeper.io/app/assets/images/wplc_loading.png';
15
+ var wplc_text = ( wplc_settings.wplc_text ) ? wplc_settings.wplc_text : 'Live Chat';
16
+ var wplc_icon = ( wplc_settings.wplc_icon ) ? wplc_settings.wplc_icon : 'fa-commenting-o';
17
+ var classes = ( wplc_settings.wplc_enabled == 0 ) ? ' disabled' : '';
18
+ var icon_classes = ( wplc_settings.wplc_icon_enabled == 0 ) ? ' disabled' : '';
19
+ var size_class = ' md';
20
+ var default_template = '<!-- Default HTML --><div class="wplc_block"><span class="wplc_block_logo">{wplc_logo}</span><span class="wplc_block_text">{wplc_text}</span><span class="wplc_block_icon">{wplc_icon}</span></div>';
21
+ var wplc_template = ( wplc_settings.wplc_custom_html ) ? wplc_settings.wplc_custom_html : default_template;
22
+ wplc_template = wplc_template.stripSlashes();
23
+
24
+ if ( wplc_settings.wplc_size == 1 ) {
25
+ size_class = ' sm';
26
+ } else if ( wplc_settings.wplc_size == 2 ) {
27
+ size_class = ' md';
28
+ } else if ( wplc_settings.wplc_size == 3 ) {
29
+ size_class = ' lg';
30
+ }
31
+
32
+ var wplc_styles = {
33
+ backgroundImage: 'url(' + wplc_logo + ')'
34
+ }
35
+
36
+ var placeholder_codes = ['wplc_logo', 'wplc_text', 'wplc_icon'],
37
+ placeholder_values = ['<span class="wplc_block_logo" style="background-image: url(\'' + wplc_logo + '\');"></span>', wplc_text, '<i class="fa ' + wplc_icon + '"></i>'];
38
+
39
+ for( var i = 0; i < placeholder_codes.length; i++ ) {
40
+ wplc_template = wplc_template.replace(new RegExp('{' + placeholder_codes[i] + '}', 'gi'), placeholder_values[i]);
41
+ }
42
+
43
+ registerBlockType( 'wp-live-chat-support/wplc-chat-box', {
44
+ title: __( 'WP Live Chat Trigger (WP Live Chat Support)', 'WPLC' ),
45
+ icon: 'format-chat',
46
+ category: 'common',
47
+
48
+ edit: function( props ) {
49
+ output_wplc_block_logo = el(
50
+ 'span',
51
+ { className: 'wplc_block_logo',
52
+ style: wplc_styles
53
+ }
54
+ );
55
+ output_wplc_block_text = el(
56
+ 'span',
57
+ { className: 'wplc_block_text' },
58
+ wplc_text
59
+ );
60
+
61
+ icon = el(
62
+ 'i',
63
+ { className: 'fa fa-commenting-o' }
64
+ );
65
+
66
+ output_wplc_block_icon = el(
67
+ 'span',
68
+ { className: 'wplc_block_icon' + icon_classes },
69
+ icon
70
+ );
71
+
72
+ output = el(
73
+ 'span',
74
+ { className: 'wplc_block' + classes + size_class },
75
+ output_wplc_block_logo,
76
+ output_wplc_block_text,
77
+ output_wplc_block_icon
78
+ );
79
+
80
+ return el(
81
+ 'div',
82
+ { id: 'wplc-chat-box',
83
+ className: classes,
84
+ dangerouslySetInnerHTML: { __html: wplc_template }
85
+ },
86
+ );
87
+ },
88
+
89
+ save: function( props ) {
90
+ output_wplc_block_logo = el(
91
+ 'span',
92
+ { className: 'wplc_block_logo',
93
+ style: wplc_styles
94
+ }
95
+ );
96
+ output_wplc_block_text = el(
97
+ 'span',
98
+ { className: 'wplc_block_text' },
99
+ wplc_text
100
+ );
101
+
102
+ icon = el(
103
+ 'i',
104
+ { className: 'fa fa-commenting-o' }
105
+ );
106
+
107
+ output_wplc_block_icon = el(
108
+ 'span',
109
+ { className: 'wplc_block_icon' + icon_classes },
110
+ icon
111
+ );
112
+
113
+ output = el(
114
+ 'span',
115
+ { className: 'wplc_block' + classes + size_class },
116
+ output_wplc_block_logo,
117
+ output_wplc_block_text,
118
+ output_wplc_block_icon
119
+ );
120
+
121
+ return el(
122
+ 'div',
123
+ { id: 'wplc-chat-box',
124
+ className: classes,
125
+ dangerouslySetInnerHTML: { __html: wplc_template }
126
+ }
127
+ );
128
+ },
129
+ } );
130
+ })();
includes/blocks/wplc-chat-box/editor.css CHANGED
@@ -1,90 +1,90 @@
1
- /* CSS for block-editor */
2
-
3
- .wplc_block {
4
- position: relative;
5
- display:inline-block;
6
- background: #32373c;
7
- color: #eee;
8
- border-radius: 3px;
9
- height: 35px;
10
- padding-left: 40px;
11
- margin: 5px 0 5px 0;
12
- transition: all .2s ease-in-out;
13
- cursor: pointer;
14
- border-bottom: 0px solid #111;
15
- font-size: 17px;
16
- line-height: 35px;
17
- }
18
-
19
- .wplc_block:hover {
20
- transform: translateY(-2px);
21
- }
22
-
23
- .wplc_block:after {
24
- content: "";
25
- position: absolute;
26
- display: block;
27
- height: 0px;
28
- bottom: 0;
29
- left: 0;
30
- width: 100%;
31
- background-color: #000;
32
- opacity: 0;
33
- transition: all .2s ease-in-out;
34
- }
35
-
36
- .wplc_block:hover:after {
37
- height: 3px;
38
- opacity: .2
39
- }
40
-
41
- .wplc_block.disabled:after {
42
- content: "Disabled";
43
- color:#fff;
44
- font-size: 17px;
45
- text-transform: uppercase;
46
- text-align: center;
47
- display: block;
48
- position: absolute;
49
- height: 100%;
50
- width: 100%;
51
- bottom: 0;
52
- left: 0;
53
- background: #ED832F;
54
- opacity: .9;
55
- }
56
-
57
- .wplc_block_logo {
58
- width: 35px;
59
- height: 35px;
60
- position: absolute;
61
- left: 0;
62
- background: #e7e7e7;
63
- display: inline-block;
64
- margin:0;
65
- background-size: cover;
66
- background-position: center;
67
- background-color:#ED832F !important;
68
- transition: all .2s ease-in-out;
69
- box-sizing: border-box;
70
- box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
71
- -webkit-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
72
- -moz-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
73
- }
74
-
75
- .wplc_block_text {
76
- display: inline-block;
77
- height: 100%;
78
- margin-right: 7px;
79
- }
80
-
81
- .wplc_block_icon {
82
- height: 100%;
83
- width: 35px;
84
- background: transparent;
85
- display: inline-block;
86
- }
87
-
88
- .wplc_block_icon.disabled {
89
- display: none;
90
  }
1
+ /* CSS for block-editor */
2
+
3
+ .wplc_block {
4
+ position: relative;
5
+ display:inline-block;
6
+ background: #32373c;
7
+ color: #eee;
8
+ border-radius: 3px;
9
+ height: 35px;
10
+ padding-left: 40px;
11
+ margin: 5px 0 5px 0;
12
+ transition: all .2s ease-in-out;
13
+ cursor: pointer;
14
+ border-bottom: 0px solid #111;
15
+ font-size: 17px;
16
+ line-height: 35px;
17
+ }
18
+
19
+ .wplc_block:hover {
20
+ transform: translateY(-2px);
21
+ }
22
+
23
+ .wplc_block:after {
24
+ content: "";
25
+ position: absolute;
26
+ display: block;
27
+ height: 0px;
28
+ bottom: 0;
29
+ left: 0;
30
+ width: 100%;
31
+ background-color: #000;
32
+ opacity: 0;
33
+ transition: all .2s ease-in-out;
34
+ }
35
+
36
+ .wplc_block:hover:after {
37
+ height: 3px;
38
+ opacity: .2
39
+ }
40
+
41
+ .wplc_block.disabled:after {
42
+ content: "Disabled";
43
+ color:#fff;
44
+ font-size: 17px;
45
+ text-transform: uppercase;
46
+ text-align: center;
47
+ display: block;
48
+ position: absolute;
49
+ height: 100%;
50
+ width: 100%;
51
+ bottom: 0;
52
+ left: 0;
53
+ background: #ED832F;
54
+ opacity: .9;
55
+ }
56
+
57
+ .wplc_block_logo {
58
+ width: 35px;
59
+ height: 35px;
60
+ position: absolute;
61
+ left: 0;
62
+ background: #e7e7e7;
63
+ display: inline-block;
64
+ margin:0;
65
+ background-size: cover;
66
+ background-position: center;
67
+ background-color:#ED832F !important;
68
+ transition: all .2s ease-in-out;
69
+ box-sizing: border-box;
70
+ box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
71
+ -webkit-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
72
+ -moz-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
73
+ }
74
+
75
+ .wplc_block_text {
76
+ display: inline-block;
77
+ height: 100%;
78
+ margin-right: 7px;
79
+ }
80
+
81
+ .wplc_block_icon {
82
+ height: 100%;
83
+ width: 35px;
84
+ background: transparent;
85
+ display: inline-block;
86
+ }
87
+
88
+ .wplc_block_icon.disabled {
89
+ display: none;
90
  }
includes/blocks/wplc-chat-box/index.php CHANGED
@@ -1,241 +1,242 @@
1
- <?php
2
- /**
3
- * BLOCK: WP Live Chat Support Chat box
4
- */
5
-
6
- if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
- }
9
-
10
- function wplc_gutenberg_block_settings() {
11
- add_filter('wplc_filter_setting_tabs','wplc_gutenberg_setting_tabs');
12
- add_action("wplc_hook_settings_page_more_tabs","wplc_gutenberg_settings_content");
13
- }
14
-
15
- add_action('admin_init', 'wplc_gutenberg_block_settings');
16
-
17
- function wplc_gutenberg_setting_tabs($tab_array) {
18
- $tab_array['gutenberg'] = array(
19
- 'href' => '#tabs-gutenberg',
20
- 'icon' => 'fa fa-commenting-o',
21
- 'label' => __('Gutenberg Blocks', 'wplivechat')
22
- );
23
- return $tab_array;
24
- }
25
-
26
- function wplc_gutenberg_settings_content() {
27
- $gutenberg_settings = get_option('wplc_gutenberg_settings');
28
-
29
- $gutenberg_enable = ( $gutenberg_settings['wplc_gutenberg_enable'] !== null ) ? $gutenberg_settings['wplc_gutenberg_enable'] : 1;
30
- $checked = ( @$gutenberg_enable == 1 ? 'checked' : '' );
31
- $gutenberg_size = ( $gutenberg_settings['wplc_gutenberg_size'] ) ? $gutenberg_settings['wplc_gutenberg_size'] : 2;
32
- $gutenberg_defail_logo = 'https://bleeper.io/app/assets/images/wplc_loading.png';
33
- $gutenberg_logo = ( $gutenberg_settings['wplc_gutenberg_logo'] == '' ) ? $gutenberg_defail_logo : $gutenberg_settings['wplc_gutenberg_logo'];
34
- $gutenberg_text = ( $gutenberg_settings['wplc_gutenberg_text'] ) ? $gutenberg_settings['wplc_gutenberg_text'] : 'Live Chat';
35
- $gutenberg_icon = ( $gutenberg_settings['wplc_gutenberg_icon'] ) ? $gutenberg_settings['wplc_gutenberg_icon'] : 'fa-commenting-o';
36
- $gutenberg_enable_icon = ( $gutenberg_settings['wplc_gutenberg_enable_icon'] !== null ) ? $gutenberg_settings['wplc_gutenberg_enable_icon'] : 1;
37
- $icon_checked = ( @$gutenberg_enable_icon == 1 ? 'checked' : '' );
38
- $gutenberg_custom_html = ( $gutenberg_settings['wplc_custom_html'] ) ? $gutenberg_settings['wplc_custom_html'] : '';
39
- ?>
40
-
41
- <div id="tabs-gutenberg">
42
- <h3><?php _e('Gutenberg Blocks', 'wplivechat') ?></h3>
43
- <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages'>
44
-
45
- <tr>
46
- <td width='300' valign='top'><?php _e('Enable Gutenberg Blocks', 'wplivechat') ?>:</td>
47
-
48
- <td>
49
- <input type="checkbox" id="activate_block" name="activate_block" <?php echo $checked ?>/>
50
- </td>
51
- </tr>
52
-
53
- <tr>
54
- <td width='300' valign='top'><?php _e('Gutenberg Block Size', 'wplivechat') ?>:</td>
55
- <td>
56
- <select id="wplc_gutenberg_size" name="wplc_gutenberg_size" value="1">
57
- <option <?php echo ($gutenberg_size == 1) ? 'selected' : ''; ?> value="1">Small</option>
58
- <option <?php echo ($gutenberg_size == 2) ? 'selected' : ''; ?> value="2">Medium</option>
59
- <option <?php echo ($gutenberg_size == 3) ? 'selected' : ''; ?> value="3">Large</option>
60
- </select>
61
- </td>
62
- </tr>
63
-
64
- <tr>
65
- <td width='300' valign='top'><?php _e('Block Logo', 'wplivechat') ?>:</td>
66
-
67
- <td>
68
- <input type="button" id="wplc_gutenberg_upload_logo" class="button button-primary" value="Upload Logo"/>
69
- <input type="button" id="wplc_gutenberg_remove_logo" class="button button-default" value="Reset Logo"/>
70
- <input type="hidden" id="wplc_gutenberg_default_logo" value="<?php echo $gutenberg_defail_logo; ?>" />
71
- <input type="hidden" id="wplc_gutenberg_logo" name="wplc_gutenberg_logo" value="<?php echo $gutenberg_logo; ?>"/>
72
- </td>
73
- </tr>
74
-
75
- <tr>
76
- <td width='300' valign='top'><?php _e('Block Text', 'wplivechat') ?>:</td>
77
-
78
- <td>
79
- <input type="text" id="wplc_gutenberg_text" name="wplc_gutenberg_text" placeholder="Block text" value="<?php echo $gutenberg_text ?>"/>
80
- </td>
81
- </tr>
82
-
83
- <tr>
84
- <td width='300' valign='top'><?php _e('Display Icon', 'wplivechat') ?>:<td>
85
- <input type="checkbox" id="wplc_gutenberg_enable_icon" name="wplc_gutenberg_enable_icon" <?php echo $icon_checked; ?>/>
86
- </td>
87
- </tr>
88
-
89
- <tr>
90
- <td width='300' valign='top'><?php _e('Block Icon', 'wplivechat') ?>:</td>
91
-
92
- <td>
93
- <input type="text" id="wplc_gutenberg_icon" name="wplc_gutenberg_icon" placeholder="Block icon" value="<?php echo $gutenberg_icon ?>"/>
94
- </td>
95
- </tr>
96
-
97
- <tr>
98
- <td width='300' valign='top'><?php _e("Block Preview", "wplivechat") ?>:</td>
99
-
100
- <td>
101
- <div id="wplc-chat-box" class="wplc_gutenberg_preview"></div>
102
- </td>
103
- </tr>
104
-
105
- <tr>
106
- <td width='300' valign='top'><?php _e('Custom HTML Template', 'wplivechat') ?>:
107
- <small><p><i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip"></i> You can use the following placeholders to add content dynamically:</p>
108
- <p><code class="wplc_code" title="Click to copy text">{wplc_logo}</code> - <?php _e('Displays the chosen logo', 'wplivechat'); ?></p>
109
- <p><code class="wplc_code" title="Click to copy text">{wplc_text}</code> - <?php _e('Displays the chosen custom text', 'wplivechat'); ?></p>
110
- <p><code class="wplc_code" title="Click to copy text">{wplc_icon}</code> - <?php _e('Displays the chosen icon', 'wplivechat'); ?></p></small>
111
- </td>
112
-
113
- <td>
114
- <div id='wplc_custom_html_editor'></div>
115
- <textarea name='wplc_custom_html' id='wplc_custom_html' style='display: none;' data-editor='css' rows='12'>
116
- <?php echo strip_tags( stripslashes( trim($gutenberg_custom_html))); ?>
117
- </textarea>
118
-
119
-
120
- <input type="button" id="wplc_gutenberg_reset_html" class="button button-default" value="Reset Default"/>
121
- <select id="wplc_custom_templates">
122
- <option selected value="0">Select a Template</option>
123
- <option value="template_default">Default - Dark</option>
124
- <option value="template_default_light">Default - Light</option>
125
- <option value="template_default_tooltip">Default - Tooltip</option>
126
- <option value="template_circle">Circle - Default</option>
127
- <option value="template_tooltip">Circle - Tooltip</option>
128
- <option value="template_circle_rotate">Circle - Rotating</option>
129
- <option value="template_chat_bubble">Chat Bubble</option>
130
-
131
- </select>
132
- </td>
133
- </tr>
134
- </table>
135
- </div>
136
-
137
- <?php
138
- }
139
-
140
- add_action('wplc_hook_admin_settings_save','wplc_gutenberg_save_settings');
141
-
142
- function wplc_gutenberg_save_settings() {
143
-
144
- if (isset($_POST['wplc_save_settings'])) {
145
-
146
- if (isset($_POST['activate_block'])) {
147
- $wplc_gutenberg_data['wplc_gutenberg_enable'] = 1;
148
- } else {
149
- $wplc_gutenberg_data['wplc_gutenberg_enable'] = 0;
150
- }
151
-
152
- if (isset($_POST['wplc_gutenberg_logo']) && $_POST['wplc_gutenberg_logo'] !== '0') {
153
- $wplc_gutenberg_data['wplc_gutenberg_logo'] = esc_attr($_POST['wplc_gutenberg_logo']);
154
- } else {
155
- $wplc_gutenberg_data['wplc_gutenberg_logo'] = 'https://bleeper.io/app/assets/images/wplc_loading.png';
156
- }
157
-
158
- if (isset($_POST['wplc_gutenberg_size']) && $_POST['wplc_gutenberg_size'] !== '0') {
159
- $wplc_gutenberg_data['wplc_gutenberg_size'] = esc_attr($_POST['wplc_gutenberg_size']);
160
- } else {
161
- $wplc_gutenberg_data['wplc_gutenberg_size'] = '2';
162
- }
163
-
164
- if (isset($_POST['wplc_gutenberg_text']) && $_POST['wplc_gutenberg_text'] !== '0') {
165
- $wplc_gutenberg_data['wplc_gutenberg_text'] = esc_attr($_POST['wplc_gutenberg_text']);
166
- } else {
167
- $wplc_gutenberg_data['wplc_gutenberg_text'] = 'Live Chat';
168
- }
169
-
170
- if (isset($_POST['wplc_gutenberg_icon']) && $_POST['wplc_gutenberg_icon'] !== '0') {
171
- $wplc_gutenberg_data['wplc_gutenberg_icon'] = esc_attr($_POST['wplc_gutenberg_icon']);
172
- } else {
173
- $wplc_gutenberg_data['wplc_gutenberg_icon'] = 'fa-commenting-o';
174
- }
175
-
176
- if (isset($_POST['wplc_gutenberg_enable_icon'])) {
177
- $wplc_gutenberg_data['wplc_gutenberg_enable_icon'] = 1;
178
- } else {
179
- $wplc_gutenberg_data['wplc_gutenberg_enable_icon'] = 0;
180
- }
181
-
182
- if (isset($_POST['wplc_custom_html']) && $_POST['wplc_custom_html'] !== '0') {
183
- $wplc_gutenberg_data['wplc_custom_html'] = esc_attr($_POST['wplc_custom_html']);
184
- } else {
185
- $default_html = '\n<div class="wplc_block">\n\t<span class="wplc_block_logo">{wplc_logo}</span>\n\t<span class="wplc_block_text">{wplc_text}</span>\n\t<span class="wplc_block_icon">{wplc_icon}</span>\n</div>';
186
-
187
- $wplc_gutenberg_data['wplc_custom_html'] = $default_html;
188
- }
189
-
190
- update_option('wplc_gutenberg_settings', $wplc_gutenberg_data);
191
- }
192
- }
193
-
194
- add_action( 'enqueue_block_editor_assets', 'wplc_chat_box_block_editor_assets' );
195
-
196
- function wplc_chat_box_block_editor_assets() {
197
- // Scripts
198
- wp_enqueue_script(
199
- 'wplc_chat_box',
200
- plugins_url( 'block.js', __FILE__ ),
201
- array( 'wp-blocks', 'wp-i18n', 'wp-element' ),
202
- filemtime( plugin_dir_path( __FILE__ ) . 'block.js' )
203
- );
204
-
205
- $gutenberg_settings = get_option( 'wplc_gutenberg_settings' );
206
- $gutenberg_logo = $gutenberg_settings['wplc_gutenberg_logo'];
207
- $settings['wplc_enabled'] = $gutenberg_settings['wplc_gutenberg_enable'];
208
- $settings['wplc_size'] = ( $gutenberg_settings['wplc_gutenberg_size'] ? esc_attr( $gutenberg_settings['wplc_gutenberg_size'] ) : 2 );
209
- $settings['wplc_logo'] = $gutenberg_logo;
210
- $settings['wplc_text'] = ( $gutenberg_settings['wplc_gutenberg_text'] ? esc_attr( $gutenberg_settings['wplc_gutenberg_text'] ) : __( 'Live Chat', 'wplivechat' ) );
211
-
212
- $settings['wplc_icon'] = ( $gutenberg_settings['wplc_gutenberg_icon'] ? esc_attr( $gutenberg_settings['wplc_gutenberg_icon'] ) : 'fa-commenting-o' );
213
- $settings['wplc_icon_enabled'] = $gutenberg_settings['wplc_gutenberg_enable_icon'];
214
- $settings['wplc_custom_html'] = $gutenberg_settings['wplc_custom_html'];
215
-
216
- wp_localize_script( 'wplc_chat_box', 'wplc_settings', $settings );
217
-
218
- // Styles
219
- wp_enqueue_style(
220
- 'wplc_chat_box-editor',
221
- plugins_url( 'editor.css', __FILE__ ),
222
- array( 'wp-edit-blocks' ),
223
- filemtime( plugin_dir_path( __FILE__ ) . 'editor.css' )
224
- );
225
- }
226
-
227
- add_action( 'enqueue_block_assets', 'wplc_chat_box_block_block_assets' );
228
-
229
- function wplc_chat_box_block_block_assets() {
230
- // Styles for front-end
231
- wp_enqueue_style(
232
- 'wplc_chat_box-front-end',
233
- plugins_url( 'style.css', __FILE__ ),
234
- array( 'wp-blocks' ),
235
- filemtime( plugin_dir_path( __FILE__ ) . 'style.css' )
236
- );
237
- wp_enqueue_style(
238
- 'wplc_chat_box-front-end-template', plugins_url( 'wplc_gutenberg_template_styles.css', __FILE__ ), array( 'wp-blocks' ),
239
- filemtime( plugin_dir_path( __FILE__ ) . 'wplc_gutenberg_template_styles.css' )
240
- );
241
- }
 
1
+ <?php
2
+ /**
3
+ * BLOCK: WP Live Chat Support Chat box
4
+ */
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) {
7
+ exit;
8
+ }
9
+
10
+ function wplc_gutenberg_block_settings() {
11
+ add_filter('wplc_filter_setting_tabs','wplc_gutenberg_setting_tabs');
12
+ add_action("wplc_hook_settings_page_more_tabs","wplc_gutenberg_settings_content");
13
+ }
14
+
15
+ add_action('admin_init', 'wplc_gutenberg_block_settings');
16
+
17
+ function wplc_gutenberg_setting_tabs($tab_array) {
18
+ $tab_array['gutenberg'] = array(
19
+ 'href' => '#tabs-gutenberg',
20
+ 'icon' => 'fa fa-commenting-o',
21
+ 'label' => __('Gutenberg Blocks', 'wplivechat')
22
+ );
23
+ return $tab_array;
24
+ }
25
+
26
+ function wplc_gutenberg_settings_content() {
27
+ $gutenberg_settings = get_option('wplc_gutenberg_settings');
28
+
29
+ $gutenberg_enable = ( $gutenberg_settings['wplc_gutenberg_enable'] !== null ) ? $gutenberg_settings['wplc_gutenberg_enable'] : 1;
30
+ $checked = ( @$gutenberg_enable == 1 ? 'checked' : '' );
31
+ $gutenberg_size = ( $gutenberg_settings['wplc_gutenberg_size'] ) ? $gutenberg_settings['wplc_gutenberg_size'] : 2;
32
+ $gutenberg_defail_logo = 'https://bleeper.io/app/assets/images/wplc_loading.png';
33
+ $gutenberg_logo = ( $gutenberg_settings['wplc_gutenberg_logo'] == '' ) ? $gutenberg_defail_logo : $gutenberg_settings['wplc_gutenberg_logo'];
34
+ $gutenberg_text = ( $gutenberg_settings['wplc_gutenberg_text'] ) ? $gutenberg_settings['wplc_gutenberg_text'] : 'Live Chat';
35
+ $gutenberg_icon = ( $gutenberg_settings['wplc_gutenberg_icon'] ) ? $gutenberg_settings['wplc_gutenberg_icon'] : 'fa-commenting-o';
36
+ $gutenberg_enable_icon = ( $gutenberg_settings['wplc_gutenberg_enable_icon'] !== null ) ? $gutenberg_settings['wplc_gutenberg_enable_icon'] : 1;
37
+ $icon_checked = ( @$gutenberg_enable_icon == 1 ? 'checked' : '' );
38
+ $gutenberg_custom_html = ( $gutenberg_settings['wplc_custom_html'] ) ? $gutenberg_settings['wplc_custom_html'] : '';
39
+ ?>
40
+
41
+ <div id="tabs-gutenberg">
42
+ <h3><?php _e('Gutenberg Blocks', 'wplivechat') ?></h3>
43
+ <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages'>
44
+
45
+ <tr>
46
+ <td width='300' valign='top'><?php _e('Enable Gutenberg Blocks', 'wplivechat') ?>:</td>
47
+
48
+ <td>
49
+ <input type="checkbox" id="activate_block" name="activate_block" <?php echo $checked ?>/>
50
+ </td>
51
+ </tr>
52
+
53
+ <tr>
54
+ <td width='300' valign='top'><?php _e('Gutenberg Block Size', 'wplivechat') ?>:</td>
55
+ <td>
56
+ <select id="wplc_gutenberg_size" name="wplc_gutenberg_size" value="1">
57
+ <option <?php echo ($gutenberg_size == 1) ? 'selected' : ''; ?> value="1">Small</option>
58
+ <option <?php echo ($gutenberg_size == 2) ? 'selected' : ''; ?> value="2">Medium</option>
59
+ <option <?php echo ($gutenberg_size == 3) ? 'selected' : ''; ?> value="3">Large</option>
60
+ </select>
61
+ </td>
62
+ </tr>
63
+
64
+ <tr>
65
+ <td width='300' valign='top'><?php _e('Block Logo', 'wplivechat') ?>:</td>
66
+
67
+ <td>
68
+ <input type="button" id="wplc_gutenberg_upload_logo" class="button button-primary" value="Upload Logo"/>
69
+ <input type="button" id="wplc_gutenberg_remove_logo" class="button button-default" value="Reset Logo"/>
70
+ <input type="hidden" id="wplc_gutenberg_default_logo" value="<?php echo $gutenberg_defail_logo; ?>" />
71
+ <input type="hidden" id="wplc_gutenberg_logo" name="wplc_gutenberg_logo" value="<?php echo $gutenberg_logo; ?>"/>
72
+ </td>
73
+ </tr>
74
+
75
+ <tr>
76
+ <td width='300' valign='top'><?php _e('Block Text', 'wplivechat') ?>:</td>
77
+
78
+ <td>
79
+ <input type="text" id="wplc_gutenberg_text" name="wplc_gutenberg_text" placeholder="Block text" value="<?php echo $gutenberg_text ?>"/>
80
+ </td>
81
+ </tr>
82
+
83
+ <tr>
84
+ <td width='300' valign='top'><?php _e('Display Icon', 'wplivechat') ?>:<td>
85
+ <input type="checkbox" id="wplc_gutenberg_enable_icon" name="wplc_gutenberg_enable_icon" <?php echo $icon_checked; ?>/>
86
+ </td>
87
+ </tr>
88
+
89
+ <tr>
90
+ <td width='300' valign='top'><?php _e('Block Icon', 'wplivechat') ?>:</td>
91
+
92
+ <td>
93
+ <input type="text" id="wplc_gutenberg_icon" name="wplc_gutenberg_icon" placeholder="Block icon" value="<?php echo $gutenberg_icon ?>"/>
94
+ </td>
95
+ </tr>
96
+
97
+ <tr>
98
+ <td width='300' valign='top'><?php _e("Block Preview", "wplivechat") ?>:</td>
99
+
100
+ <td>
101
+ <div id="wplc-chat-box" class="wplc_gutenberg_preview"></div>
102
+ </td>
103
+ </tr>
104
+
105
+ <tr>
106
+ <td width='300' valign='top'><?php _e('Custom HTML Template', 'wplivechat') ?>:
107
+ <small><p><i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip"></i> You can use the following placeholders to add content dynamically:</p>
108
+ <p><code class="wplc_code" title="Click to copy text">{wplc_logo}</code> - <?php _e('Displays the chosen logo', 'wplivechat'); ?></p>
109
+ <p><code class="wplc_code" title="Click to copy text">{wplc_text}</code> - <?php _e('Displays the chosen custom text', 'wplivechat'); ?></p>
110
+ <p><code class="wplc_code" title="Click to copy text">{wplc_icon}</code> - <?php _e('Displays the chosen icon', 'wplivechat'); ?></p></small>
111
+ </td>
112
+
113
+ <td>
114
+ <div id='wplc_custom_html_editor'></div>
115
+ <textarea name='wplc_custom_html' id='wplc_custom_html' style='display: none;' data-editor='css' rows='12'>
116
+ <?php echo strip_tags( stripslashes( trim($gutenberg_custom_html))); ?>
117
+ </textarea>
118
+
119
+
120
+ <input type="button" id="wplc_gutenberg_reset_html" class="button button-default" value="Reset Default"/>
121
+ <select id="wplc_custom_templates">
122
+ <option selected value="0">Select a Template</option>
123
+ <option value="template_default">Default - Dark</option>
124
+ <option value="template_default_light">Default - Light</option>
125
+ <option value="template_default_tooltip">Default - Tooltip</option>
126
+ <option value="template_circle">Circle - Default</option>
127
+ <option value="template_tooltip">Circle - Tooltip</option>
128
+ <option value="template_circle_rotate">Circle - Rotating</option>
129
+ <option value="template_chat_bubble">Chat Bubble</option>
130
+
131
+ </select>
132
+ </td>
133
+ </tr>
134
+ </table>
135
+ </div>
136
+
137
+ <?php
138
+ }
139
+
140
+ add_action('wplc_hook_admin_settings_save','wplc_gutenberg_save_settings');
141
+
142
+ function wplc_gutenberg_save_settings() {
143
+
144
+ if (isset($_POST['wplc_save_settings'])) {
145
+
146
+ if (isset($_POST['activate_block'])) {
147
+ $wplc_gutenberg_data['wplc_gutenberg_enable'] = 1;
148
+ } else {
149
+ $wplc_gutenberg_data['wplc_gutenberg_enable'] = 0;
150
+ }
151
+
152
+ if (isset($_POST['wplc_gutenberg_logo']) && $_POST['wplc_gutenberg_logo'] !== '0') {
153
+ $wplc_gutenberg_data['wplc_gutenberg_logo'] = esc_attr($_POST['wplc_gutenberg_logo']);
154
+ } else {
155
+ $wplc_gutenberg_data['wplc_gutenberg_logo'] = 'https://bleeper.io/app/assets/images/wplc_loading.png';
156
+ }
157
+
158
+ if (isset($_POST['wplc_gutenberg_size']) && $_POST['wplc_gutenberg_size'] !== '0') {
159
+ $wplc_gutenberg_data['wplc_gutenberg_size'] = esc_attr($_POST['wplc_gutenberg_size']);
160
+ } else {
161
+ $wplc_gutenberg_data['wplc_gutenberg_size'] = '2';
162
+ }
163
+
164
+ if (isset($_POST['wplc_gutenberg_text']) && $_POST['wplc_gutenberg_text'] !== '0') {
165
+ $wplc_gutenberg_data['wplc_gutenberg_text'] = esc_attr($_POST['wplc_gutenberg_text']);
166
+ } else {
167
+ $wplc_gutenberg_data['wplc_gutenberg_text'] = 'Live Chat';
168
+ }
169
+
170
+ if (isset($_POST['wplc_gutenberg_icon']) && $_POST['wplc_gutenberg_icon'] !== '0') {
171
+ $wplc_gutenberg_data['wplc_gutenberg_icon'] = esc_attr($_POST['wplc_gutenberg_icon']);
172
+ } else {
173
+ $wplc_gutenberg_data['wplc_gutenberg_icon'] = 'fa-commenting-o';
174
+ }
175
+
176
+ if (isset($_POST['wplc_gutenberg_enable_icon'])) {
177
+ $wplc_gutenberg_data['wplc_gutenberg_enable_icon'] = 1;
178
+ } else {
179
+ $wplc_gutenberg_data['wplc_gutenberg_enable_icon'] = 0;
180
+ }
181
+
182
+ if (isset($_POST['wplc_custom_html']) && $_POST['wplc_custom_html'] !== '0') {
183
+ $wplc_gutenberg_data['wplc_custom_html'] = esc_attr($_POST['wplc_custom_html']);
184
+ } else {
185
+ $default_html = '\n<div class="wplc_block">\n\t<span class="wplc_block_logo">{wplc_logo}</span>\n\t<span class="wplc_block_text">{wplc_text}</span>\n\t<span class="wplc_block_icon">{wplc_icon}</span>\n</div>';
186
+
187
+ $wplc_gutenberg_data['wplc_custom_html'] = $default_html;
188
+ }
189
+
190
+ update_option('wplc_gutenberg_settings', $wplc_gutenberg_data);
191
+ }
192
+ }
193
+
194
+ add_action( 'enqueue_block_editor_assets', 'wplc_chat_box_block_editor_assets' );
195
+
196
+ function wplc_chat_box_block_editor_assets() {
197
+ // Scripts
198
+ wp_enqueue_script(
199
+ 'wplc_chat_box',
200
+ plugins_url( 'block.js', __FILE__ ),
201
+ array( 'wp-blocks', 'wp-i18n', 'wp-element' ),
202
+ filemtime( plugin_dir_path( __FILE__ ) . 'block.js' )
203
+ );
204
+
205
+ $gutenberg_settings = get_option( 'wplc_gutenberg_settings' );
206
+ $gutenberg_logo = $gutenberg_settings['wplc_gutenberg_logo'];
207
+ $settings['wplc_typing'] = __("Type here","wplivechat");
208
+ $settings['wplc_enabled'] = $gutenberg_settings['wplc_gutenberg_enable'];
209
+ $settings['wplc_size'] = ( $gutenberg_settings['wplc_gutenberg_size'] ? esc_attr( $gutenberg_settings['wplc_gutenberg_size'] ) : 2 );
210
+ $settings['wplc_logo'] = $gutenberg_logo;
211
+ $settings['wplc_text'] = ( $gutenberg_settings['wplc_gutenberg_text'] ? esc_attr( $gutenberg_settings['wplc_gutenberg_text'] ) : __( 'Live Chat', 'wplivechat' ) );
212
+
213
+ $settings['wplc_icon'] = ( $gutenberg_settings['wplc_gutenberg_icon'] ? esc_attr( $gutenberg_settings['wplc_gutenberg_icon'] ) : 'fa-commenting-o' );
214
+ $settings['wplc_icon_enabled'] = $gutenberg_settings['wplc_gutenberg_enable_icon'];
215
+ $settings['wplc_custom_html'] = $gutenberg_settings['wplc_custom_html'];
216
+
217
+ wp_localize_script( 'wplc_chat_box', 'wplc_settings', $settings );
218
+
219
+ // Styles
220
+ wp_enqueue_style(
221
+ 'wplc_chat_box-editor',
222
+ plugins_url( 'editor.css', __FILE__ ),
223
+ array( 'wp-edit-blocks' ),
224
+ filemtime( plugin_dir_path( __FILE__ ) . 'editor.css' )
225
+ );
226
+ }
227
+
228
+ add_action( 'enqueue_block_assets', 'wplc_chat_box_block_block_assets' );
229
+
230
+ function wplc_chat_box_block_block_assets() {
231
+ // Styles for front-end
232
+ wp_enqueue_style(
233
+ 'wplc_chat_box-front-end',
234
+ plugins_url( 'style.css', __FILE__ ),
235
+ array( 'wp-blocks' ),
236
+ filemtime( plugin_dir_path( __FILE__ ) . 'style.css' )
237
+ );
238
+ wp_enqueue_style(
239
+ 'wplc_chat_box-front-end-template', plugins_url( 'wplc_gutenberg_template_styles.css', __FILE__ ), array( 'wp-blocks' ),
240
+ filemtime( plugin_dir_path( __FILE__ ) . 'wplc_gutenberg_template_styles.css' )
241
+ );
242
+ }
includes/blocks/wplc-chat-box/style.css CHANGED
@@ -1,149 +1,149 @@
1
- /* CSS for front-end block */
2
- #wplc-chat-box {
3
- width: fit-content;
4
- position: relative;
5
- cursor: pointer;
6
- }
7
-
8
- .wplc_block {
9
- position: relative;
10
- display:inline-block;
11
- background: #32373c;
12
- color: #eee;
13
- border-radius: 3px;
14
- height: 35px;
15
- padding-left: 45px;
16
- margin: 5px 0 5px 0;
17
- transition: all .2s ease-in-out;
18
- cursor: pointer;
19
- border-bottom: 0px solid #111;
20
- font-size: 17px;
21
- line-height: 35px;
22
- }
23
-
24
-
25
- .wplc_block:hover {
26
- transform: translateY(-2px);
27
- }
28
-
29
- .wplc_block:after {
30
- content: "";
31
- position: absolute;
32
- display: block;
33
- height: 0px;
34
- bottom: 0;
35
- left: 0;
36
- width: 100%;
37
- background-color: #000;
38
- opacity: 0;
39
- transition: all .2s ease-in-out;
40
- }
41
-
42
- .wplc_block:hover:after {
43
- height: 3px;
44
- opacity: .2;
45
- }
46
-
47
- #wplc-chat-box.disabled:first-child:after {
48
- content: "Disabled";
49
- color:#fff;
50
- font-size: 17px;
51
- text-transform: uppercase;
52
- text-align: center;
53
- display: block;
54
- position: absolute;
55
- height: 100%;
56
- width: 100%;
57
- bottom: 0;
58
- left: 0;
59
- background: #ED832F;
60
- opacity: .9;
61
- }
62
-
63
- .wplc_block_logo {
64
- width: 35px;
65
- height: 35px;
66
- position: absolute;
67
- left: 0;
68
- background: #e7e7e7;
69
- display: inline-block;
70
- margin:0;
71
- background-size: cover;
72
- background-position: center;
73
- background-color:#ED832F !important;
74
- transition: all .2s ease-in-out;
75
- box-sizing: border-box;
76
- box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
77
- -webkit-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
78
- -moz-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
79
- }
80
-
81
- .wplc_block_text {
82
- display: inline-block;
83
- height: 100%;
84
- margin-right: 7px;
85
- }
86
-
87
- .wplc_block_icon {
88
- height: 100%;
89
- width: 35px;
90
- background: transparent;
91
- display: inline-block;
92
- }
93
-
94
- .wplc_block_icon.disabled {
95
- display: none;
96
- }
97
-
98
- /* Block size styles: small */
99
- .wplc_block.sm {
100
- height: 25px;
101
- line-height: 25px;
102
- padding-left: 30px;
103
- font-size: 12px;
104
- }
105
-
106
- .wplc_block.sm:hover:after {
107
- height: 2px;
108
- opacity: .2;
109
- }
110
-
111
- .wplc_block.sm .wplc_block_logo {
112
- height: 25px;
113
- width: 25px;
114
- }
115
-
116
- .wplc_block.sm .wplc_block_text {
117
- margin-right: 7px;
118
- }
119
-
120
- .wplc_block.sm .wplc_block_icon {
121
- margin-right: 7px;
122
- width: 13px;
123
- }
124
-
125
- /* Block size styles: large */
126
- .wplc_block.lg {
127
- height: 80px;
128
- line-height: 80px;
129
- padding-left: 100px;
130
- font-size: 25px;
131
- }
132
-
133
- .wplc_block.lg:hover:after {
134
- height: 6px;
135
- opacity: .2;
136
- }
137
-
138
- .wplc_block.lg .wplc_block_logo {
139
- height: 80px;
140
- width: 80px;
141
- }
142
-
143
- .wplc_block.lg .wplc_block_text {
144
- margin-right: 13px;
145
- }
146
-
147
- .wplc_block.lg .wplc_block_icon {
148
- margin-right: 13px;
149
  }
1
+ /* CSS for front-end block */
2
+ #wplc-chat-box {
3
+ width: fit-content;
4
+ position: relative;
5
+ cursor: pointer;
6
+ }
7
+
8
+ .wplc_block {
9
+ position: relative;
10
+ display:inline-block;
11
+ background: #32373c;
12
+ color: #eee;
13
+ border-radius: 3px;
14
+ height: 35px;
15
+ padding-left: 45px;
16
+ margin: 5px 0 5px 0;
17
+ transition: all .2s ease-in-out;
18
+ cursor: pointer;
19
+ border-bottom: 0px solid #111;
20
+ font-size: 17px;
21
+ line-height: 35px;
22
+ }
23
+
24
+
25
+ .wplc_block:hover {
26
+ transform: translateY(-2px);
27
+ }
28
+
29
+ .wplc_block:after {
30
+ content: "";
31
+ position: absolute;
32
+ display: block;
33
+ height: 0px;
34
+ bottom: 0;
35
+ left: 0;
36
+ width: 100%;
37
+ background-color: #000;
38
+ opacity: 0;
39
+ transition: all .2s ease-in-out;
40
+ }
41
+
42
+ .wplc_block:hover:after {
43
+ height: 3px;
44
+ opacity: .2;
45
+ }
46
+
47
+ #wplc-chat-box.disabled:first-child:after {
48
+ content: "Disabled";
49
+ color:#fff;
50
+ font-size: 17px;
51
+ text-transform: uppercase;
52
+ text-align: center;
53
+ display: block;
54
+ position: absolute;
55
+ height: 100%;
56
+ width: 100%;
57
+ bottom: 0;
58
+ left: 0;
59
+ background: #ED832F;
60
+ opacity: .9;
61
+ }
62
+
63
+ .wplc_block_logo {
64
+ width: 35px;
65
+ height: 35px;
66
+ position: absolute;
67
+ left: 0;
68
+ background: #e7e7e7;
69
+ display: inline-block;
70
+ margin:0;
71
+ background-size: cover;
72
+ background-position: center;
73
+ background-color:#ED832F !important;
74
+ transition: all .2s ease-in-out;
75
+ box-sizing: border-box;
76
+ box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
77
+ -webkit-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
78
+ -moz-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
79
+ }
80
+
81
+ .wplc_block_text {
82
+ display: inline-block;
83
+ height: 100%;
84
+ margin-right: 7px;
85
+ }
86
+
87
+ .wplc_block_icon {
88
+ height: 100%;
89
+ width: 35px;
90
+ background: transparent;
91
+ display: inline-block;
92
+ }
93
+
94
+ .wplc_block_icon.disabled {
95
+ display: none;
96
+ }
97
+
98
+ /* Block size styles: small */
99
+ .wplc_block.sm {
100
+ height: 25px;
101
+ line-height: 25px;
102
+ padding-left: 30px;
103
+ font-size: 12px;
104
+ }
105
+
106
+ .wplc_block.sm:hover:after {
107
+ height: 2px;
108
+ opacity: .2;
109
+ }
110
+
111
+ .wplc_block.sm .wplc_block_logo {
112
+ height: 25px;
113
+ width: 25px;
114
+ }
115
+
116
+ .wplc_block.sm .wplc_block_text {
117
+ margin-right: 7px;
118
+ }
119
+
120
+ .wplc_block.sm .wplc_block_icon {
121
+ margin-right: 7px;
122
+ width: 13px;
123
+ }
124
+
125
+ /* Block size styles: large */
126
+ .wplc_block.lg {
127
+ height: 80px;
128
+ line-height: 80px;
129
+ padding-left: 100px;
130
+ font-size: 25px;
131
+ }
132
+
133
+ .wplc_block.lg:hover:after {
134
+ height: 6px;
135
+ opacity: .2;
136
+ }
137
+
138
+ .wplc_block.lg .wplc_block_logo {
139
+ height: 80px;
140
+ width: 80px;
141
+ }
142
+
143
+ .wplc_block.lg .wplc_block_text {
144
+ margin-right: 13px;
145
+ }
146
+
147
+ .wplc_block.lg .wplc_block_icon {
148
+ margin-right: 13px;
149
  }
includes/blocks/wplc-chat-box/wplc_gutenberg_template_styles.css CHANGED
@@ -1,366 +1,366 @@
1
- /* WPLC Gutenber Template Styles */
2
-
3
- #wplc-chat-box {
4
- width: fit-content;
5
- position: relative;
6
- cursor: pointer;
7
- }
8
-
9
- .wplc_block {
10
- position: relative;
11
- display:inline-block;
12
- background: #32373c;
13
- color: #eee;
14
- border-radius: 3px;
15
- height: 35px;
16
- padding-left: 45px;
17
- margin: 5px 0 5px 0;
18
- transition: all .2s ease-in-out;
19
- cursor: pointer;
20
- border-bottom: 0px solid #111;
21
- font-size: 17px;
22
- line-height: 35px;
23
- }
24
-
25
-
26
- .wplc_block:hover {
27
- transform: translateY(-2px);
28
- }
29
-
30
- .wplc_block:after {
31
- content: "";
32
- position: absolute;
33
- display: block;
34
- height: 0px;
35
- bottom: 0;
36
- left: 0;
37
- width: 100%;
38
- background-color: #000;
39
- opacity: 0;
40
- transition: all .2s ease-in-out;
41
- }
42
-
43
- .wplc_block:hover:after {
44
- height: 3px;
45
- opacity: .2;
46
- }
47
-
48
- #wplc-chat-box.disabled:first-child:after {
49
- content: "Disabled";
50
- color:#fff;
51
- font-size: 17px;
52
- text-transform: uppercase;
53
- text-align: center;
54
- display: block;
55
- position: absolute;
56
- height: 100%;
57
- width: 100%;
58
- bottom: 0;
59
- left: 0;
60
- background: #ED832F;
61
- opacity: .9;
62
- }
63
-
64
- .wplc_block_logo {
65
- width: 35px;
66
- height: 35px;
67
- position: absolute;
68
- left: 0;
69
- background: #e7e7e7;
70
- display: inline-block;
71
- margin:0;
72
- background-size: cover;
73
- background-position: center;
74
- background-color:#ED832F !important;
75
- transition: all .2s ease-in-out;
76
- box-sizing: border-box;
77
- box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
78
- -webkit-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
79
- -moz-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
80
- }
81
-
82
- .wplc_block_text {
83
- display: inline-block;
84
- height: 100%;
85
- margin-right: 7px;
86
- }
87
-
88
- .wplc_block_icon {
89
- height: 100%;
90
- width: 35px;
91
- background: transparent;
92
- display: inline-block;
93
- }
94
-
95
- .wplc_block_icon.disabled {
96
- display: none;
97
- }
98
-
99
- /* Block size styles: small */
100
- .wplc_block.sm {
101
- height: 25px;
102
- line-height: 25px;
103
- padding-left: 30px;
104
- font-size: 12px;
105
- }
106
-
107
- .wplc_block.sm:hover:after {
108
- height: 2px;
109
- opacity: .2;
110
- }
111
-
112
- .wplc_block.sm .wplc_block_logo {
113
- height: 25px;
114
- width: 25px;
115
- }
116
-
117
- .wplc_block.sm .wplc_block_text {
118
- margin-right: 7px;
119
- }
120
-
121
- .wplc_block.sm .wplc_block_icon {
122
- margin-right: 7px;
123
- width: 13px;
124
- }
125
-
126
- /* Block size styles: large */
127
- .wplc_block.lg {
128
- height: 80px;
129
- line-height: 80px;
130
- padding-left: 100px;
131
- font-size: 25px;
132
- }
133
-
134
- .wplc_block.lg:hover:after {
135
- height: 6px;
136
- opacity: .2;
137
- }
138
-
139
- .wplc_block.lg .wplc_block_logo {
140
- height: 80px;
141
- width: 80px;
142
- }
143
-
144
- .wplc_block.lg .wplc_block_text {
145
- margin-right: 13px;
146
- }
147
-
148
- .wplc_block.lg .wplc_block_icon {
149
- margin-right: 13px;
150
- }
151
- /* Custom Templates: Default - Light */
152
- .wplc_block.light {
153
- background: #ECEFF1;
154
- color: #555;
155
- border: 1px solid #ccc;
156
- }
157
-
158
- /* Custom Templates: Circle */
159
- .wplc_block.circle {
160
- background: transparent;
161
- width: 50px;
162
- height: 50px;
163
- padding: 0;
164
- position: relative;
165
- }
166
-
167
- .wplc_block.circle:after {
168
- display: none;
169
- }
170
-
171
- .wplc_block.circle .wplc_block_logo {
172
- position: relative;
173
- width: 50px;
174
- height: 50px;
175
- padding: 0;
176
- border-radius: 50%;
177
- }
178
-
179
- .wplc_block.sm.circle {
180
- background: transparent;
181
- width: 35px;
182
- height: 35px;
183
- padding: 0;
184
- }
185
-
186
- .wplc_block.sm.circle:after {
187
- display: none;
188
- }
189
-
190
- .wplc_block.sm.circle .wplc_block_logo {
191
- position: relative;
192
- width: 35px;
193
- height: 35px;
194
- padding: 0;
195
- border-radius: 50%;
196
- }
197
-
198
- .wplc_block.lg.circle {
199
- background: transparent;
200
- width: 65px;
201
- height: 65px;
202
- padding: 0;
203
- }
204
-
205
- .wplc_block.lg.circle:after {
206
- display: none;
207
- }
208
-
209
- .wplc_block.lg.circle .wplc_block_logo {
210
- position: relative;
211
- width: 65px;
212
- height: 65px;
213
- padding: 0;
214
- border-radius: 50%;
215
- }
216
-
217
- /* Custom Templates: Tooltip */
218
- .wplc_block:hover .wplc_block_tooltip {
219
- top: -62px;
220
- background: #333;
221
- color: #fff;
222
- opacity: .85;
223
- display: inline-block;
224
- }
225
-
226
- .wplc_block_tooltip {
227
- min-width: 100px;
228
- border-radius: 3px;
229
- color: transparent;
230
- position: absolute;
231
- line-height: 25px;
232
- padding: 10px;
233
- top: -50px;
234
- left: 0;
235
- opacity: 0;
236
- transition: opacity .2s ease-in-out, top .2s ease-in-out;
237
- }
238
-
239
- .wplc_block.circle:hover .wplc_block_tooltip {
240
- top: -75px;
241
- display: block;
242
- }
243
- .wplc_block.circle.sm:hover .wplc_block_tooltip {
244
- top: -50px;
245
- }
246
-
247
- .wplc_block.circle.lg:hover .wplc_block_tooltip {
248
- top: -100px;
249
- }
250
-
251
- /* Custom Templates: Chat Bubble */
252
- .wplc_block.chat_bubble:before {
253
- content: '';
254
- position: absolute;
255
- width: 0;
256
- height: 0;
257
- left: 0px;
258
- bottom: -10px;
259
- border: 8px solid;
260
- border-color: #32373c transparent transparent #32373c;
261
- }
262
-
263
- .wplc_block.chat_bubble:hover:after {
264
- content: '';
265
- position: absolute;
266
- width: 0;
267
- height: 0;
268
- }
269
-
270
- .wplc_block.chat_bubble {
271
- padding-left: 10px;
272
- padding-right: 40px;
273
- border-radius: 7px 7px 7px 0;
274
- }
275
-
276
- .wplc_block.chat_bubble .wplc_block_logo {
277
- border:none;
278
- right: 0px;
279
- left: initial;
280
- border-radius: 0 7px 7px 0;
281
- }
282
-
283
- .wplc_block.chat_bubble.sm {
284
- padding-left: 10px;
285
- padding-right: 25px;
286
- }
287
-
288
- .wplc_block.chat_bubble.lg {
289
- padding-left: 20px;
290
- padding-right: 80px;
291
- }
292
-
293
- /* Custom Templates: Rotating circle */
294
- .wplc_block.rotate {
295
- transform:rotate(0deg);
296
- }
297
-
298
- .wplc_block.rotate:hover {
299
- transition: all .3s ease-in-out;
300
- transform:rotate(-90deg);
301
- }
302
-
303
- .wplc_block.rotate .wplc_block_icon {
304
- position: relative;
305
- height: 100%;
306
- width: 100%;
307
- text-align: center;
308
- font-size: 30px;
309
- transform: rotate(90deg);
310
- line-height: 150%;
311
- }
312
-
313
- .wplc_block.rotate .wplc_block_logo {
314
- z-index: 10;
315
- position: absolute;
316
- }
317
- .wplc_block.rotate {
318
- border-radius: 50%;
319
- background: #32373c;
320
- }
321
-
322
- .wplc_block.rotate .wplc_block_logo:hover {
323
- opacity: 0;
324
- }
325
-
326
- .wplc_block.circle.rotate.lg .wplc_block_logo {
327
- padding: 0;
328
- margin: 0;
329
- position:absolute;
330
- }
331
-
332
- .wplc_block.circle.rotate.lg {
333
- background: #32373c;
334
- }
335
-
336
- .wplc_block.rotate.lg .wplc_block_icon {
337
- position: relative;
338
- height: 100%;
339
- width: 100%;
340
- text-align: center;
341
- font-size: 30px;
342
- transform: rotate(90deg);
343
- line-height: 225%;
344
- padding-right: 10px;
345
- }
346
-
347
- .wplc_block.circle.rotate.sm .wplc_block_logo {
348
- padding: 0;
349
- margin: 0;
350
- position:absolute;
351
- }
352
-
353
- .wplc_block.circle.rotate.sm {
354
- background: #32373c;
355
- }
356
-
357
- .wplc_block.rotate.sm .wplc_block_icon {
358
- position: relative;
359
- height: 100%;
360
- width: 100%;
361
- text-align: center;
362
- font-size: 20px;
363
- transform: rotate(90deg);
364
- line-height: 100%;
365
- right:5px;
366
  }
1
+ /* WPLC Gutenber Template Styles */
2
+
3
+ #wplc-chat-box {
4
+ width: fit-content;
5
+ position: relative;
6
+ cursor: pointer;
7
+ }
8
+
9
+ .wplc_block {
10
+ position: relative;
11
+ display:inline-block;
12
+ background: #32373c;
13
+ color: #eee;
14
+ border-radius: 3px;
15
+ height: 35px;
16
+ padding-left: 45px;
17
+ margin: 5px 0 5px 0;
18
+ transition: all .2s ease-in-out;
19
+ cursor: pointer;
20
+ border-bottom: 0px solid #111;
21
+ font-size: 17px;
22
+ line-height: 35px;
23
+ }
24
+
25
+
26
+ .wplc_block:hover {
27
+ transform: translateY(-2px);
28
+ }
29
+
30
+ .wplc_block:after {
31
+ content: "";
32
+ position: absolute;
33
+ display: block;
34
+ height: 0px;
35
+ bottom: 0;
36
+ left: 0;
37
+ width: 100%;
38
+ background-color: #000;
39
+ opacity: 0;
40
+ transition: all .2s ease-in-out;
41
+ }
42
+
43
+ .wplc_block:hover:after {
44
+ height: 3px;
45
+ opacity: .2;
46
+ }
47
+
48
+ #wplc-chat-box.disabled:first-child:after {
49
+ content: "Disabled";
50
+ color:#fff;
51
+ font-size: 17px;
52
+ text-transform: uppercase;
53
+ text-align: center;
54
+ display: block;
55
+ position: absolute;
56
+ height: 100%;
57
+ width: 100%;
58
+ bottom: 0;
59
+ left: 0;
60
+ background: #ED832F;
61
+ opacity: .9;
62
+ }
63
+
64
+ .wplc_block_logo {
65
+ width: 35px;
66
+ height: 35px;
67
+ position: absolute;
68
+ left: 0;
69
+ background: #e7e7e7;
70
+ display: inline-block;
71
+ margin:0;
72
+ background-size: cover;
73
+ background-position: center;
74
+ background-color:#ED832F !important;
75
+ transition: all .2s ease-in-out;
76
+ box-sizing: border-box;
77
+ box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
78
+ -webkit-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
79
+ -moz-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
80
+ }
81
+
82
+ .wplc_block_text {
83
+ display: inline-block;
84
+ height: 100%;
85
+ margin-right: 7px;
86
+ }
87
+
88
+ .wplc_block_icon {
89
+ height: 100%;
90
+ width: 35px;
91
+ background: transparent;
92
+ display: inline-block;
93
+ }
94
+
95
+ .wplc_block_icon.disabled {
96
+ display: none;
97
+ }
98
+
99
+ /* Block size styles: small */
100
+ .wplc_block.sm {
101
+ height: 25px;
102
+ line-height: 25px;
103
+ padding-left: 30px;
104
+ font-size: 12px;
105
+ }
106
+
107
+ .wplc_block.sm:hover:after {
108
+ height: 2px;
109
+ opacity: .2;
110
+ }
111
+
112
+ .wplc_block.sm .wplc_block_logo {
113
+ height: 25px;
114
+ width: 25px;
115
+ }
116
+
117
+ .wplc_block.sm .wplc_block_text {
118
+ margin-right: 7px;
119
+ }
120
+
121
+ .wplc_block.sm .wplc_block_icon {
122
+ margin-right: 7px;
123
+ width: 13px;
124
+ }
125
+
126
+ /* Block size styles: large */
127
+ .wplc_block.lg {
128
+ height: 80px;
129
+ line-height: 80px;
130
+ padding-left: 100px;
131
+ font-size: 25px;
132
+ }
133
+
134
+ .wplc_block.lg:hover:after {
135
+ height: 6px;
136
+ opacity: .2;
137
+ }
138
+
139
+ .wplc_block.lg .wplc_block_logo {
140
+ height: 80px;
141
+ width: 80px;
142
+ }
143
+
144
+ .wplc_block.lg .wplc_block_text {
145
+ margin-right: 13px;
146
+ }
147
+
148
+ .wplc_block.lg .wplc_block_icon {
149
+ margin-right: 13px;
150
+ }
151
+ /* Custom Templates: Default - Light */
152
+ .wplc_block.light {
153
+ background: #ECEFF1;
154
+ color: #555;
155
+ border: 1px solid #ccc;
156
+ }
157
+
158
+ /* Custom Templates: Circle */
159
+ .wplc_block.circle {
160
+ background: transparent;
161
+ width: 50px;
162
+ height: 50px;
163
+ padding: 0;
164
+ position: relative;
165
+ }
166
+
167
+ .wplc_block.circle:after {
168
+ display: none;
169
+ }
170
+
171
+ .wplc_block.circle .wplc_block_logo {
172
+ position: relative;
173
+ width: 50px;
174
+ height: 50px;
175
+ padding: 0;
176
+ border-radius: 50%;
177
+ }
178
+
179
+ .wplc_block.sm.circle {
180
+ background: transparent;
181
+ width: 35px;
182
+ height: 35px;
183
+ padding: 0;
184
+ }
185
+
186
+ .wplc_block.sm.circle:after {
187
+ display: none;
188
+ }
189
+
190
+ .wplc_block.sm.circle .wplc_block_logo {
191
+ position: relative;
192
+ width: 35px;
193
+ height: 35px;
194
+ padding: 0;
195
+ border-radius: 50%;
196
+ }
197
+
198
+ .wplc_block.lg.circle {
199
+ background: transparent;
200
+ width: 65px;
201
+ height: 65px;
202
+ padding: 0;
203
+ }
204
+
205
+ .wplc_block.lg.circle:after {
206
+ display: none;
207
+ }
208
+
209
+ .wplc_block.lg.circle .wplc_block_logo {
210
+ position: relative;
211
+ width: 65px;
212
+ height: 65px;
213
+ padding: 0;
214
+ border-radius: 50%;
215
+ }
216
+
217
+ /* Custom Templates: Tooltip */
218
+ .wplc_block:hover .wplc_block_tooltip {
219
+ top: -62px;
220
+ background: #333;
221
+ color: #fff;
222
+ opacity: .85;
223
+ display: inline-block;
224
+ }
225
+
226
+ .wplc_block_tooltip {
227
+ min-width: 100px;
228
+ border-radius: 3px;
229
+ color: transparent;
230
+ position: absolute;
231
+ line-height: 25px;
232
+ padding: 10px;
233
+ top: -50px;
234
+ left: 0;
235
+ opacity: 0;
236
+ transition: opacity .2s ease-in-out, top .2s ease-in-out;
237
+ }
238
+
239
+ .wplc_block.circle:hover .wplc_block_tooltip {
240
+ top: -75px;
241
+ display: block;
242
+ }
243
+ .wplc_block.circle.sm:hover .wplc_block_tooltip {
244
+ top: -50px;
245
+ }
246
+
247
+ .wplc_block.circle.lg:hover .wplc_block_tooltip {
248
+ top: -100px;
249
+ }
250
+
251
+ /* Custom Templates: Chat Bubble */
252
+ .wplc_block.chat_bubble:before {
253
+ content: '';
254
+ position: absolute;
255
+ width: 0;
256
+ height: 0;
257
+ left: 0px;
258
+ bottom: -10px;
259
+ border: 8px solid;
260
+ border-color: #32373c transparent transparent #32373c;
261
+ }
262
+
263
+ .wplc_block.chat_bubble:hover:after {
264
+ content: '';
265
+ position: absolute;
266
+ width: 0;
267
+ height: 0;
268
+ }
269
+
270
+ .wplc_block.chat_bubble {
271
+ padding-left: 10px;
272
+ padding-right: 40px;
273
+ border-radius: 7px 7px 7px 0;
274
+ }
275
+
276
+ .wplc_block.chat_bubble .wplc_block_logo {
277
+ border:none;
278
+ right: 0px;
279
+ left: initial;
280
+ border-radius: 0 7px 7px 0;
281
+ }
282
+
283
+ .wplc_block.chat_bubble.sm {
284
+ padding-left: 10px;
285
+ padding-right: 25px;
286
+ }
287
+
288
+ .wplc_block.chat_bubble.lg {
289
+ padding-left: 20px;
290
+ padding-right: 80px;
291
+ }
292
+
293
+ /* Custom Templates: Rotating circle */
294
+ .wplc_block.rotate {
295
+ transform:rotate(0deg);
296
+ }
297
+
298
+ .wplc_block.rotate:hover {
299
+ transition: all .3s ease-in-out;
300
+ transform:rotate(-90deg);
301
+ }
302
+
303
+ .wplc_block.rotate .wplc_block_icon {
304
+ position: relative;
305
+ height: 100%;
306
+ width: 100%;
307
+ text-align: center;
308
+ font-size: 30px;
309
+ transform: rotate(90deg);
310
+ line-height: 150%;
311
+ }
312
+
313
+ .wplc_block.rotate .wplc_block_logo {
314
+ z-index: 10;
315
+ position: absolute;
316
+ }
317
+ .wplc_block.rotate {
318
+ border-radius: 50%;
319
+ background: #32373c;
320
+ }
321
+
322
+ .wplc_block.rotate .wplc_block_logo:hover {
323
+ opacity: 0;
324
+ }
325
+
326
+ .wplc_block.circle.rotate.lg .wplc_block_logo {
327
+ padding: 0;
328
+ margin: 0;
329
+ position:absolute;
330
+ }
331
+
332
+ .wplc_block.circle.rotate.lg {
333
+ background: #32373c;
334
+ }
335
+
336
+ .wplc_block.rotate.lg .wplc_block_icon {
337
+ position: relative;
338
+ height: 100%;
339
+ width: 100%;
340
+ text-align: center;
341
+ font-size: 30px;
342
+ transform: rotate(90deg);
343
+ line-height: 225%;
344
+ padding-right: 10px;
345
+ }
346
+
347
+ .wplc_block.circle.rotate.sm .wplc_block_logo {
348
+ padding: 0;
349
+ margin: 0;
350
+ position:absolute;
351
+ }
352
+
353
+ .wplc_block.circle.rotate.sm {
354
+ background: #32373c;
355
+ }
356
+
357
+ .wplc_block.rotate.sm .wplc_block_icon {
358
+ position: relative;
359
+ height: 100%;
360
+ width: 100%;
361
+ text-align: center;
362
+ font-size: 20px;
363
+ transform: rotate(90deg);
364
+ line-height: 100%;
365
+ right:5px;
366
  }
includes/blocks/wplc-inline-chat-box/block.js CHANGED
@@ -1,127 +1,127 @@
1
- /* BLOCK: WP Live Chat Support - Inline Chat Box */
2
-
3
- ( function() {
4
- var __ = wp.i18n.__;
5
- var el = wp.element.createElement;
6
- var Editable = wp.blocks.Editable;
7
- var children = wp.blocks.source.children;
8
- var registerBlockType = wp.blocks.registerBlockType;
9
-
10
- var chat_preview_loader = '<div class="wplc_gutenberg_loader"></div>';
11
-
12
- registerBlockType( 'wp-live-chat-support/wplc-inline-chat-box', {
13
- title: __( 'WP Live Chat Box (WP Live Chat Support)', 'WPLC' ),
14
- icon: 'format-chat',
15
- category: 'common',
16
- attributes: {
17
- content: children( 'p' ),
18
- },
19
-
20
- edit: function( props ) {
21
-
22
- var content = props.attributes.content;
23
- var focus = props.focus;
24
-
25
- function onChangeContent( newContent ) {
26
- props.setAttributes( { content: newContent } );
27
- }
28
-
29
- jQuery(document).on('change', '.wplc_select_theme', function(){
30
- var id = $(this).val();
31
- onChangeContent( id );
32
- });
33
-
34
- theme_classes = 'wplc_' + content;
35
-
36
- element = el(
37
- 'h3',
38
- { },
39
- 'Live Chat Box (WP Live Chat Support)'
40
- );
41
-
42
- select_text = el(
43
- 'span',
44
- { },
45
- 'Select a style: '
46
- );
47
-
48
- icon = el(
49
- 'span',
50
- { className: "wplc_gutenberg_icon dashicons dashicons-format-chat" }
51
- );
52
-
53
- chat_box_preview = el(
54
- 'div',
55
- {
56
- className: 'wplc_gutenberg_preview',
57
- dangerouslySetInnerHTML: { __html: chat_preview_loader }
58
- }
59
- );
60
-
61
- var option_1 = el(
62
- 'option',
63
- { value: 'normal', selected: 'selected' },
64
- 'Normal'
65
- );
66
- var option_2 = el(
67
- 'option',
68
- { value: 'center' },
69
- 'Center'
70
- );
71
- var option_3 = el(
72
- 'option',
73
- { value: 'wide' },
74
- 'Wide'
75
- );
76
-
77
- var select = el(
78
- 'select',
79
- { className: 'wplc_select_theme' },
80
- option_1,
81
- option_2,
82
- option_3
83
- );
84
-
85
- var style = {
86
- display: 'none'
87
- }
88
-
89
- var editable_content = el(
90
- Editable,
91
- {
92
- tagName: 'p',
93
- className: 'wplc_selected_theme',
94
- value: content,
95
- onChange: onChangeContent,
96
- focus: focus,
97
- onFocus: props.setFocus,
98
- style: style
99
- },
100
- );
101
-
102
- return el(
103
- 'div',
104
- { id: 'wplc-inline-chat-box',
105
- className: theme_classes
106
- },
107
- element,
108
- select_text,
109
- select,
110
- editable_content,
111
- chat_box_preview
112
- );
113
- },
114
-
115
- save: function( props ) {
116
- var style_class = props.attributes.content;
117
- var content = '[wplc_live_chat style="' + style_class + '"]';
118
-
119
- return el(
120
- 'div',
121
- { id: 'wplc-inline-chat-box',
122
- dangerouslySetInnerHTML: { __html: content }
123
- }
124
- );
125
- },
126
- } );
127
- })();
1
+ /* BLOCK: WP Live Chat Support - Inline Chat Box */
2
+
3
+ ( function() {
4
+ var __ = wp.i18n.__;
5
+ var el = wp.element.createElement;
6
+ var Editable = wp.blocks.Editable;
7
+ var children = wp.blocks.source.children;
8
+ var registerBlockType = wp.blocks.registerBlockType;
9
+
10
+ var chat_preview_loader = '<div class="wplc_gutenberg_loader"></div>';
11
+
12
+ registerBlockType( 'wp-live-chat-support/wplc-inline-chat-box', {
13
+ title: __( 'WP Live Chat Box (WP Live Chat Support)', 'WPLC' ),
14
+ icon: 'format-chat',
15
+ category: 'common',
16
+ attributes: {
17
+ content: children( 'p' ),
18
+ },
19
+
20
+ edit: function( props ) {
21
+
22
+ var content = props.attributes.content;
23
+ var focus = props.focus;
24
+
25
+ function onChangeContent( newContent ) {
26
+ props.setAttributes( { content: newContent } );
27
+ }
28
+
29
+ jQuery(document).on('change', '.wplc_select_theme', function(){
30
+ var id = $(this).val();
31
+ onChangeContent( id );
32
+ });
33
+
34
+ theme_classes = 'wplc_' + content;
35
+
36
+ element = el(
37
+ 'h3',
38
+ { },
39
+ 'Live Chat Box (WP Live Chat Support)'
40
+ );
41
+
42
+ select_text = el(
43
+ 'span',
44
+ { },
45
+ 'Select a style: '
46
+ );
47
+
48
+ icon = el(
49
+ 'span',
50
+ { className: "wplc_gutenberg_icon dashicons dashicons-format-chat" }
51
+ );
52
+
53
+ chat_box_preview = el(
54
+ 'div',
55
+ {
56
+ className: 'wplc_gutenberg_preview',
57
+ dangerouslySetInnerHTML: { __html: chat_preview_loader }
58
+ }
59
+ );
60
+
61
+ var option_1 = el(
62
+ 'option',
63
+ { value: 'normal', selected: 'selected' },
64
+ 'Normal'
65
+ );
66
+ var option_2 = el(
67
+ 'option',
68
+ { value: 'center' },
69
+ 'Center'
70
+ );
71
+ var option_3 = el(
72
+ 'option',
73
+ { value: 'wide' },
74
+ 'Wide'
75
+ );
76
+
77
+ var select = el(
78
+ 'select',
79
+ { className: 'wplc_select_theme' },
80
+ option_1,
81
+ option_2,
82
+ option_3
83
+ );
84
+
85
+ var style = {
86
+ display: 'none'
87
+ }
88
+
89
+ var editable_content = el(
90
+ Editable,
91
+ {
92
+ tagName: 'p',
93
+ className: 'wplc_selected_theme',
94
+ value: content,
95
+ onChange: onChangeContent,
96
+ focus: focus,
97
+ onFocus: props.setFocus,
98
+ style: style
99
+ },
100
+ );
101
+
102
+ return el(
103
+ 'div',
104
+ { id: 'wplc-inline-chat-box',
105
+ className: theme_classes
106
+ },
107
+ element,
108
+ select_text,
109
+ select,
110
+ editable_content,
111
+ chat_box_preview
112
+ );
113
+ },
114
+
115
+ save: function( props ) {
116
+ var style_class = props.attributes.content;
117
+ var content = '[wplc_live_chat style="' + style_class + '"]';
118
+
119
+ return el(
120
+ 'div',
121
+ { id: 'wplc-inline-chat-box',
122
+ dangerouslySetInnerHTML: { __html: content }
123
+ }
124
+ );
125
+ },
126
+ } );
127
+ })();
includes/blocks/wplc-inline-chat-box/editor.css CHANGED
@@ -1,178 +1,178 @@
1
- /* Gutenberg Chat Box Styles */
2
- @keyframes wplc_fade_in {
3
- 0% { opacity: 0; padding-top: 20px; }
4
- 100% { opacity: 1; }
5
- }
6
-
7
- #wplc-inline-chat-box .wplc_gutenberg_icon {
8
- animation: wplc_fade_in .3s;
9
- color: #ff4d4d;
10
- display: block;
11
- margin: 30px auto;
12
- font-size: 50px;
13
- }
14
-
15
- .wplc_gutenberg_chat_box {
16
- border: 1px solid #eee;
17
- height: 500px;
18
- width: 320px;
19
- border-radius: 6px;
20
- position: relative;
21
- display: inline-block;
22
- margin-top: 0;
23
- }
24
-
25
- .wplc_gutenberg_button {
26
- width: 60px;
27
- height: 60px;
28
- background-size: cover;
29
- background-repeat: no-repeat;
30
- border-radius: 50%;
31
- margin-bottom: 10px;
32
- margin-right: 10px;
33
- display: inline-block;
34
- cursor: pointer;
35
- }
36
-
37
- .wplc_gutenberg_header {
38
- border-radius: 6px 6px 0 0;
39
- height: 80px;
40
- width: 100%;
41
- background: #ddd;
42
- }
43
-
44
- .wplc_gutenberg_text_box {
45
- position: absolute;
46
- bottom: 0;
47
- left: 0;
48
- width: 100%;
49
- height: 60px;
50
- background: #fff;
51
- border-bottom-right-radius: 10px;
52
- border-bottom-left-radius: 10px;
53
- box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
54
- }
55
-
56
- .wplc_gutenberg_avatar {
57
- display: inline-block;
58
- margin: 10px;
59
- margin-left: 35px;
60
- }
61
-
62
- .wplc_gutenberg_avatar img {
63
- border-radius: 50%;
64
-
65
- }
66
-
67
- .wplc_gutenberg_name {
68
- display: inline-block;
69
- bottom: 24px;
70
- font-weight: 600;
71
- color: #fff;
72
- position: absolute;
73
- }
74
-
75
- .wplc_gutenberg_header {
76
- position: relative;
77
- box-shadow: 0 5px 20px -2px rgba(0,0,0,.16);
78
- }
79
-
80
- .wplc_gutenberg_chevron {
81
- position: absolute;
82
- right: 10px;
83
- bottom: 10px;
84
- font-size: 24px;
85
- color: #fff;
86
- cursor: pointer;
87
- }
88
-
89
- .wplc_gutenberg_overlay_image {
90
- width: 100%;
91
- height: 100%;
92
- position: absolute;
93
- top: 0;
94
- left: 0;
95
- border-radius: 6px 6px 0 0;
96
- background-size: cover;
97
- background-repeat; no-repeat;
98
- opacity: .1;
99
- }
100
-
101
- .wplc_gutenberg_text_box {
102
- line-height: 60px;
103
- padding-left: 30px;
104
- color: #2b2b2b;
105
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
106
- font-weight: normal;
107
- font-size: 12px;
108
- }
109
-
110
- .wplc_gutenberg_body {
111
- width: 100%;
112
- height: 100%;
113
- background-size: cover;
114
- background-repeat: repeat;
115
- position: absolute;
116
- top: 0;
117
- left: 0;
118
- z-index: -1;
119
- }
120
-
121
- .wplc_gutenberg_loader {
122
- border: 7px solid #f3f3f3;
123
- border-top: 7px solid #ED832F;
124
- border-radius: 50%;
125
- width: 50px;
126
- height: 50px;
127
- animation: wplc_spin 2s linear infinite;
128
- display: block;
129
- margin: 0 auto;
130
- }
131
-
132
- @keyframes wplc_spin {
133
- 0% { transform: rotate(0deg); }
134
- 100% { transform: rotate(360deg); }
135
- }
136
-
137
- @keyframes wplc_fade_in {
138
- 0% { opacity: 0; padding-top:20px; }
139
- 100% { opacity: 1; }
140
- }
141
-
142
- .wplc_gutenberg_preview, .wplc_gutenberg_button, .wplc_gutenberg_chat_box {
143
- animation: wplc_fade_in .3s;
144
- }
145
-
146
- .wplc_gutenberg_button {
147
- transition: all 0.4s ease-in-out;
148
- margin-bottom: 0;
149
- }
150
-
151
- .wplc_select_theme {
152
- margin-bottom: 10px;
153
- width: 150px;
154
- display: block;
155
- }
156
-
157
- /* WPLC Gutenberg Themes/Layouts */
158
- /* Center */
159
- .wplc_center .wplc_gutenberg_chat_box {
160
- margin: 0 auto;
161
- display: block;
162
- }
163
-
164
- .wplc_center .wplc_gutenberg_button {
165
- margin: 0 auto;
166
- display: block;
167
- margin-bottom: 10px;
168
- }
169
-
170
- /* Wide */
171
- .wplc_wide .wplc_gutenberg_chat_box {
172
- width: 100%;
173
- margin-top: 0;
174
- }
175
-
176
- .wplc_wide .wplc_gutenberg_button {
177
- margin-bottom: 0;
178
  }
1
+ /* Gutenberg Chat Box Styles */
2
+ @keyframes wplc_fade_in {
3
+ 0% { opacity: 0; padding-top: 20px; }
4
+ 100% { opacity: 1; }
5
+ }
6
+
7
+ #wplc-inline-chat-box .wplc_gutenberg_icon {
8
+ animation: wplc_fade_in .3s;
9
+ color: #ff4d4d;
10
+ display: block;
11
+ margin: 30px auto;
12
+ font-size: 50px;
13
+ }
14
+
15
+ .wplc_gutenberg_chat_box {
16
+ border: 1px solid #eee;
17
+ height: 500px;
18
+ width: 320px;
19
+ border-radius: 6px;
20
+ position: relative;
21
+ display: inline-block;
22
+ margin-top: 0;
23
+ }
24
+
25
+ .wplc_gutenberg_button {
26
+ width: 60px;
27
+ height: 60px;
28
+ background-size: cover;
29
+ background-repeat: no-repeat;
30
+ border-radius: 50%;
31
+ margin-bottom: 10px;
32
+ margin-right: 10px;
33
+ display: inline-block;
34
+ cursor: pointer;
35
+ }
36
+
37
+ .wplc_gutenberg_header {
38
+ border-radius: 6px 6px 0 0;
39
+ height: 80px;
40
+ width: 100%;
41
+ background: #ddd;
42
+ }
43
+
44
+ .wplc_gutenberg_text_box {
45
+ position: absolute;
46
+ bottom: 0;
47
+ left: 0;
48
+ width: 100%;
49
+ height: 60px;
50
+ background: #fff;
51
+ border-bottom-right-radius: 10px;
52
+ border-bottom-left-radius: 10px;
53
+ box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
54
+ }
55
+
56
+ .wplc_gutenberg_avatar {
57
+ display: inline-block;
58
+ margin: 10px;
59
+ margin-left: 35px;
60
+ }
61
+
62
+ .wplc_gutenberg_avatar img {
63
+ border-radius: 50%;
64
+
65
+ }
66
+
67
+ .wplc_gutenberg_name {
68
+ display: inline-block;
69
+ bottom: 24px;
70
+ font-weight: 600;
71
+ color: #fff;
72
+ position: absolute;
73
+ }
74
+
75
+ .wplc_gutenberg_header {
76
+ position: relative;
77
+ box-shadow: 0 5px 20px -2px rgba(0,0,0,.16);
78
+ }
79
+
80
+ .wplc_gutenberg_chevron {
81
+ position: absolute;
82
+ right: 10px;
83
+ bottom: 10px;
84
+ font-size: 24px;
85
+ color: #fff;
86
+ cursor: pointer;
87
+ }
88
+
89
+ .wplc_gutenberg_overlay_image {
90
+ width: 100%;
91
+ height: 100%;
92
+ position: absolute;
93
+ top: 0;
94
+ left: 0;
95
+ border-radius: 6px 6px 0 0;
96
+ background-size: cover;
97
+ background-repeat; no-repeat;
98
+ opacity: .1;
99
+ }
100
+
101
+ .wplc_gutenberg_text_box {
102
+ line-height: 60px;
103
+ padding-left: 30px;
104
+ color: #2b2b2b;
105
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
106
+ font-weight: normal;
107
+ font-size: 12px;
108
+ }
109
+
110
+ .wplc_gutenberg_body {
111
+ width: 100%;
112
+ height: 100%;
113
+ background-size: cover;
114
+ background-repeat: repeat;
115
+ position: absolute;
116
+ top: 0;
117
+ left: 0;
118
+ z-index: -1;
119
+ }
120
+
121
+ .wplc_gutenberg_loader {
122
+ border: 7px solid #f3f3f3;
123
+ border-top: 7px solid #ED832F;
124
+ border-radius: 50%;
125
+ width: 50px;
126
+ height: 50px;
127
+ animation: wplc_spin 2s linear infinite;
128
+ display: block;
129
+ margin: 0 auto;
130
+ }
131
+
132
+ @keyframes wplc_spin {
133
+ 0% { transform: rotate(0deg); }
134
+ 100% { transform: rotate(360deg); }
135
+ }
136
+
137
+ @keyframes wplc_fade_in {
138
+ 0% { opacity: 0; padding-top:20px; }
139
+ 100% { opacity: 1; }
140
+ }
141
+
142
+ .wplc_gutenberg_preview, .wplc_gutenberg_button, .wplc_gutenberg_chat_box {
143
+ animation: wplc_fade_in .3s;
144
+ }
145
+
146
+ .wplc_gutenberg_button {
147
+ transition: all 0.4s ease-in-out;
148
+ margin-bottom: 0;
149
+ }
150
+
151
+ .wplc_select_theme {
152
+ margin-bottom: 10px;
153
+ width: 150px;
154
+ display: block;
155
+ }
156
+
157
+ /* WPLC Gutenberg Themes/Layouts */
158
+ /* Center */
159
+ .wplc_center .wplc_gutenberg_chat_box {
160
+ margin: 0 auto;
161
+ display: block;
162
+ }
163
+
164
+ .wplc_center .wplc_gutenberg_button {
165
+ margin: 0 auto;
166
+ display: block;
167
+ margin-bottom: 10px;
168
+ }
169
+
170
+ /* Wide */
171
+ .wplc_wide .wplc_gutenberg_chat_box {
172
+ width: 100%;
173
+ margin-top: 0;
174
+ }
175
+
176
+ .wplc_wide .wplc_gutenberg_button {
177
+ margin-bottom: 0;
178
  }
includes/blocks/wplc-inline-chat-box/index.php CHANGED
@@ -1,61 +1,61 @@
1
- <?php
2
- /**
3
- * BLOCK: WP Live Chat Support Chat box
4
- */
5
-
6
- if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
- }
9
-
10
- add_action( 'enqueue_block_editor_assets', 'wplc_inline_chat_box_block_editor_assets' );
11
-
12
- function wplc_inline_chat_box_block_editor_assets() {
13
- $agent_data['id'] = get_current_user_id();
14
- $agent_data['info'] = get_userdata( $agent_data['id'] );
15
- $agent_data['name'] = $agent_data['info']->display_name;
16
- $agent_data['email'] = md5($agent_data['info']->user_email);
17
-
18
- $wplc_settings = get_option("WPLC_SETTINGS");
19
- $style_settings['settings'] = get_option("WPLC_SETTINGS");
20
- $style_settings['color_1'] = $wplc_settings['wplc_settings_color1'];
21
-
22
- $wplc_images['background_image'] = plugins_url( '../../../images/bg/' . $wplc_settings['wplc_settings_bg'], __FILE__ );
23
- $wplc_images['open_icon'] = plugins_url( '../../../images/iconRetina.png', __FILE__ );
24
- $wplc_images['close_icon'] = plugins_url( '../../../images/iconCloseRetina.png', __FILE__ );
25
-
26
- // Scripts
27
- wp_enqueue_script( 'wplc_inline_chat_box',
28
- plugins_url( 'block.js', __FILE__ ),
29
- array( 'wp-blocks', 'wp-i18n', 'wp-element' ),
30
- filemtime( plugin_dir_path( __FILE__ ) . 'block.js' )
31
- );
32
-
33
- wp_localize_script( 'wplc_inline_chat_box', 'wplc_agent_info', $agent_data );
34
- wp_localize_script( 'wplc_inline_chat_box', 'wplc_styles', $style_settings );
35
- wp_localize_script( 'wplc_inline_chat_box', 'wplc_images', $wplc_images );
36
-
37
- wp_enqueue_script( 'wplc_chat_box_functions',
38
- plugins_url( 'wplc_functions.js', __FILE__ ),
39
- array( 'wp-blocks', 'wp-i18n', 'wp-element' )
40
- );
41
-
42
-
43
- // Styles
44
- wp_enqueue_style( 'wplc_inline_chat_box-editor',
45
- plugins_url( 'editor.css', __FILE__ ),
46
- array( 'wp-edit-blocks' ),
47
- filemtime( plugin_dir_path( __FILE__ ) . 'editor.css' )
48
- );
49
- }
50
-
51
- add_action( 'enqueue_block_assets', 'wplc_inline_chat_box_block_block_assets' );
52
-
53
- function wplc_inline_chat_box_block_block_assets() {
54
-
55
- // Styles for front-end
56
- wp_enqueue_style( 'wplc_inline_chat_box_front_end',
57
- plugins_url( 'style.css', __FILE__ ),
58
- array( 'wp-blocks' ),
59
- filemtime( plugin_dir_path( __FILE__ ) . 'style.css' )
60
- );
61
  }
1
+ <?php
2
+ /**
3
+ * BLOCK: WP Live Chat Support Chat box
4
+ */
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) {
7
+ exit;
8
+ }
9
+
10
+ add_action( 'enqueue_block_editor_assets', 'wplc_inline_chat_box_block_editor_assets' );
11
+
12
+ function wplc_inline_chat_box_block_editor_assets() {
13
+ $agent_data['id'] = get_current_user_id();
14
+ $agent_data['info'] = get_userdata( $agent_data['id'] );
15
+ $agent_data['name'] = $agent_data['info']->display_name;
16
+ $agent_data['email'] = md5($agent_data['info']->user_email);
17
+
18
+ $wplc_settings = get_option("WPLC_SETTINGS");
19
+ $style_settings['settings'] = get_option("WPLC_SETTINGS");
20
+ $style_settings['color_1'] = $wplc_settings['wplc_settings_color1'];
21
+
22
+ $wplc_images['background_image'] = plugins_url( '../../../images/bg/' . $wplc_settings['wplc_settings_bg'], __FILE__ );
23
+ $wplc_images['open_icon'] = plugins_url( '../../../images/iconRetina.png', __FILE__ );
24
+ $wplc_images['close_icon'] = plugins_url( '../../../images/iconCloseRetina.png', __FILE__ );
25
+
26
+ // Scripts
27
+ wp_enqueue_script( 'wplc_inline_chat_box',
28
+ plugins_url( 'block.js', __FILE__ ),
29
+ array( 'wp-blocks', 'wp-i18n', 'wp-element' ),
30
+ filemtime( plugin_dir_path( __FILE__ ) . 'block.js' )
31
+ );
32
+
33
+ wp_localize_script( 'wplc_inline_chat_box', 'wplc_agent_info', $agent_data );
34
+ wp_localize_script( 'wplc_inline_chat_box', 'wplc_styles', $style_settings );
35
+ wp_localize_script( 'wplc_inline_chat_box', 'wplc_images', $wplc_images );
36
+
37
+ wp_enqueue_script( 'wplc_chat_box_functions',
38
+ plugins_url( 'wplc_functions.js', __FILE__ ),
39
+ array( 'wp-blocks', 'wp-i18n', 'wp-element' )
40
+ );
41
+
42
+
43
+ // Styles
44
+ wp_enqueue_style( 'wplc_inline_chat_box-editor',
45
+ plugins_url( 'editor.css', __FILE__ ),
46
+ array( 'wp-edit-blocks' ),
47
+ filemtime( plugin_dir_path( __FILE__ ) . 'editor.css' )
48
+ );
49
+ }
50
+
51
+ add_action( 'enqueue_block_assets', 'wplc_inline_chat_box_block_block_assets' );
52
+
53
+ function wplc_inline_chat_box_block_block_assets() {
54
+
55
+ // Styles for front-end
56
+ wp_enqueue_style( 'wplc_inline_chat_box_front_end',
57
+ plugins_url( 'style.css', __FILE__ ),
58
+ array( 'wp-blocks' ),
59
+ filemtime( plugin_dir_path( __FILE__ ) . 'style.css' )
60
+ );
61
  }
includes/blocks/wplc-inline-chat-box/wplc_functions.js CHANGED
@@ -1,39 +1,39 @@
1
- jQuery(document).ready( function($){
2
-
3
- var chat_box_button = '<div class="wplc_gutenberg_button active" style="background-color: #' + wplc_styles.color_1 + '; background-image: url(' + wplc_images.close_icon + ');"></div>';
4
- var chatbox_preview_img = '<img class="wplc_gutenberg_avatar_img" style="max-width:inherit;" id="agent_grav_' + wplc_agent_info.id + '" title="' + wplc_agent_info.name + '" src="https://www.gravatar.com/avatar/' + wplc_agent_info.email + '?s=60" />';
5
- var chatbox_preview_overlay_image = '<div class="wplc_gutenberg_overlay_image" style="background-image: url(\'https://www.gravatar.com/avatar/' + wplc_agent_info.email + '?s=60\');"></div>';
6
- var chat_box_content = chat_box_button + '<div class="wplc_gutenberg_chat_box"><div class="wplc_gutenberg_header" style="background-color: #' + wplc_styles.color_1 + ' !important;"><span class="wplc_gutenberg_avatar">' + chatbox_preview_img + chatbox_preview_overlay_image + '</span><span class="wplc_gutenberg_name">' + wplc_agent_info.name + '</span><span class="wplc_gutenberg_chevron dashicons dashicons-arrow-up-alt2"></span></div><div class="wplc_gutenberg_body" style="background-image: url(' + wplc_images.background_image + ');"></div><div class="wplc_gutenberg_text_box"><span class="wplc_gutenberg_typing">'+bleeper_localized_strings[5]+'</span></div></div>';
7
-
8
- // Update select fields on page load
9
- $('#wplc-inline-chat-box .wplc_selected_theme').each(function(){
10
- var id = $(this).html();
11
- $(this).closest('#wplc-inline-chat-box').find('.wplc_select_theme').val(id);
12
- });
13
-
14
- $('.wplc_gutenberg_preview').html(chat_box_content);
15
-
16
- $('.wplc_gutenberg_button').css('transform', 'rotate(90deg)');
17
-
18
- $(document).on('click', '.wplc_gutenberg_button', function(){
19
- $(this).toggleClass('active');
20
- if ($(this).hasClass('active')) {
21
- wplc_gutenberg_close_chat_box(this, wplc_images.open_icon )
22
- } else {
23
-
24
- wplc_gutenberg_open_chat_box(this, wplc_images.close_icon)
25
- }
26
- });
27
- });
28
-
29
- function wplc_gutenberg_open_chat_box(button, icon) {
30
- jQuery(button).css('background-image', 'url(' + icon + ')');
31
- jQuery(button).css('transform', 'rotate(90deg)');
32
- jQuery(button).closest('.wplc_gutenberg_preview').find('.wplc_gutenberg_chat_box').show();
33
- }
34
-
35
- function wplc_gutenberg_close_chat_box(button, icon) {
36
- jQuery(button).css('background-image', 'url(' + icon + ')');
37
- jQuery(button).css('transform', 'rotate(0deg)');
38
- jQuery(button).closest('.wplc_gutenberg_preview').find('.wplc_gutenberg_chat_box').hide();
39
  }
1
+ jQuery(function($){
2
+
3
+ var chat_box_button = '<div class="wplc_gutenberg_button active" style="background-color: #' + wplc_styles.color_1 + '; background-image: url(' + wplc_images.close_icon + ');"></div>';
4
+ var chatbox_preview_img = '<img class="wplc_gutenberg_avatar_img" style="max-width:inherit;" id="agent_grav_' + wplc_agent_info.id + '" title="' + wplc_agent_info.name + '" src="https://www.gravatar.com/avatar/' + wplc_agent_info.email + '?s=60" />';
5
+ var chatbox_preview_overlay_image = '<div class="wplc_gutenberg_overlay_image" style="background-image: url(\'https://www.gravatar.com/avatar/' + wplc_agent_info.email + '?s=60\');"></div>';
6
+ var chat_box_content = chat_box_button + '<div class="wplc_gutenberg_chat_box"><div class="wplc_gutenberg_header" style="background-color: #' + wplc_styles.color_1 + ' !important;"><span class="wplc_gutenberg_avatar">' + chatbox_preview_img + chatbox_preview_overlay_image + '</span><span class="wplc_gutenberg_name">' + wplc_agent_info.name + '</span><span class="wplc_gutenberg_chevron dashicons dashicons-arrow-up-alt2"></span></div><div class="wplc_gutenberg_body" style="background-image: url(' + wplc_images.background_image + ');"></div><div class="wplc_gutenberg_text_box"><span class="wplc_gutenberg_typing">'+wplc_settings.wplc_typing+'</span></div></div>';
7
+
8
+ // Update select fields on page load
9
+ $('#wplc-inline-chat-box .wplc_selected_theme').each(function(){
10
+ var id = $(this).html();
11
+ $(this).closest('#wplc-inline-chat-box').find('.wplc_select_theme').val(id);
12
+ });
13
+
14
+ $('.wplc_gutenberg_preview').html(chat_box_content);
15
+
16
+ $('.wplc_gutenberg_button').css('transform', 'rotate(90deg)');
17
+
18
+ $(document).on('click', '.wplc_gutenberg_button', function(){
19
+ $(this).toggleClass('active');
20
+ if ($(this).hasClass('active')) {
21
+ wplc_gutenberg_close_chat_box(this, wplc_images.open_icon )
22
+ } else {
23
+
24
+ wplc_gutenberg_open_chat_box(this, wplc_images.close_icon)
25
+ }
26
+ });
27
+ });
28
+
29
+ function wplc_gutenberg_open_chat_box(button, icon) {
30
+ jQuery(button).css('background-image', 'url(' + icon + ')');
31
+ jQuery(button).css('transform', 'rotate(90deg)');
32
+ jQuery(button).closest('.wplc_gutenberg_preview').find('.wplc_gutenberg_chat_box').show();
33
+ }
34
+
35
+ function wplc_gutenberg_close_chat_box(button, icon) {
36
+ jQuery(button).css('background-image', 'url(' + icon + ')');
37
+ jQuery(button).css('transform', 'rotate(0deg)');
38
+ jQuery(button).closest('.wplc_gutenberg_preview').find('.wplc_gutenberg_chat_box').hide();
39
  }
includes/notification_control.php CHANGED
@@ -26,7 +26,7 @@ function wplc_filter_control_chat_notification_user_loaded($type,$cid,$data) {
26
  global $wplc_tblname_msgs;
27
 
28
 
29
- $msg = sprintf(__("User is browsing <small><a href='%s' target='_BLANK'>%s</a></small>","wplivechat"),$data['uri'],wplc_shortenurl($data['uri']));
30
 
31
  $wpdb->insert(
32
  $wplc_tblname_msgs,
26
  global $wplc_tblname_msgs;
27
 
28
 
29
+ $msg = sprintf(__("User is browsing <small><a href='%s' target='_BLANK'>%s</a></small>","wplivechat"),strip_tags($data['uri']),strip_tags(wplc_shortenurl($data['uri'])));
30
 
31
  $wpdb->insert(
32
  $wplc_tblname_msgs,
includes/settings_page.php CHANGED
@@ -1,1079 +1,1090 @@
1
- <style>
2
- .ui-tabs-vertical { }
3
- .ui-tabs-vertical .ui-tabs-nav {
4
- padding: .2em .1em .2em .2em;
5
- float: left;
6
- /* width: 10%; */
7
- max-width: 20%;
8
- min-width: 190px;
9
- }
10
- .ui-tabs-vertical .ui-tabs-nav li { clear: left; width: 100%; border-bottom-width: 1px !important; border-right-width: 0 !important; margin: 0 -1px .2em 0; }
11
- .ui-tabs-vertical .ui-tabs-nav li a { display:block; }
12
- .ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active { padding-bottom: 0; padding-right: .1em; border-right-width: 1px; }
13
- .ui-tabs-vertical .ui-tabs-panel {
14
- /* padding: 1em; */
15
- float: left;
16
- min-width: 67%;
17
- max-width: 67%;
18
- }
19
- textarea, input[type='text'], input[type='email'], input[type='password']{ width: 100% !important; }
20
- </style>
21
-
22
- <?php
23
- /**
24
- * Removes the ajax loader and forces the settings page to load as is after 3 seconds.
25
- *
26
- * This has been put here to counter any PHP fatal warnings that may be experienced on the settings page.
27
- *
28
- * Putting this in the wplc_tabs.js file will not work as that file is not loaded if there is a PHP fatal error
29
- */
30
- ?>
31
- <script>
32
- setTimeout( function() {
33
- jQuery("#wplc_settings_page_loader").remove();
34
- jQuery(".wrap").css('display','block');
35
- jQuery(".wplc_settings_save_notice").css('display','block');
36
- },3000);
37
- </script>
38
-
39
- <?php wplc_stats("settings");
40
-
41
-
42
- if (function_exists("wplc_string_check")) { wplc_string_check(); }
43
- $wplc_settings = get_option("WPLC_SETTINGS");
44
-
45
- ?>
46
-
47
- <?php
48
- if (get_option("WPLC_HIDE_CHAT") == true) {
49
- $wplc_hide_chat = "checked";
50
- } else {
51
- $wplc_hide_chat = "";
52
- };
53
-
54
- ?>
55
- <img src='<?php echo WPLC_BASIC_PLUGIN_URL.'images/ajax-loader.gif'; ?>' id='wplc_settings_page_loader' style='display: block; margin: 20px auto;' />
56
- <div class="wrap wplc_wrap" style='display: none;'>
57
-
58
- <style>
59
- .wplc_light_grey{
60
- color: #666;
61
- }
62
- </style>
63
- <div id="icon-edit" class="icon32 icon32-posts-post">
64
- <br>
65
- </div>
66
- <h2><?php _e("WP Live Chat Support Settings","wplivechat")?></h2>
67
- <?php
68
-
69
- $wplc_mail_type = get_option("wplc_mail_type");
70
- if (!isset($wplc_mail_type) || $wplc_mail_type == "" || !$wplc_mail_type) { $wplc_mail_type = "wp_mail"; }
71
- if (isset($wplc_settings["wplc_settings_align"])) { $wplc_settings_align[intval($wplc_settings["wplc_settings_align"])] = "SELECTED"; }
72
- if (isset($wplc_settings["wplc_settings_enabled"])) { $wplc_settings_enabled[intval($wplc_settings["wplc_settings_enabled"])] = "SELECTED"; }
73
- if (isset($wplc_settings["wplc_settings_fill"])) { $wplc_settings_fill = $wplc_settings["wplc_settings_fill"]; } else { $wplc_settings_fill = "ed832f"; }
74
- if (isset($wplc_settings["wplc_settings_font"])) { $wplc_settings_font = $wplc_settings["wplc_settings_font"]; } else { $wplc_settings_font = "FFFFFF"; }
75
- if (isset($wplc_settings["wplc_settings_color1"])) { $wplc_settings_color1 = $wplc_settings["wplc_settings_color1"]; } else { $wplc_settings_color1 = "ED832F"; }
76
- if (isset($wplc_settings["wplc_settings_color2"])) { $wplc_settings_color2 = $wplc_settings["wplc_settings_color2"]; } else { $wplc_settings_color2 = "FFFFFF"; }
77
- if (isset($wplc_settings["wplc_settings_color3"])) { $wplc_settings_color3 = $wplc_settings["wplc_settings_color3"]; } else { $wplc_settings_color3 = "EEEEEE"; }
78
- if (isset($wplc_settings["wplc_settings_color4"])) { $wplc_settings_color4 = $wplc_settings["wplc_settings_color4"]; } else { $wplc_settings_color4 = "666666"; }
79
- if (isset($wplc_settings["wplc_environment"])) { $wplc_environment[intval($wplc_settings["wplc_environment"])] = "SELECTED"; }
80
-
81
-
82
- if(get_option("WPLC_HIDE_CHAT") == true) { $wplc_hide_chat = "checked"; } else { $wplc_hide_chat = ""; };
83
-
84
- ?>
85
- <form action='' name='wplc_settings' method='POST' id='wplc_settings'>
86
-
87
- <div id="wplc_tabs">
88
- <ul>
89
- <?php
90
- $tab_array = array(
91
- 0 => array(
92
- "href" => "#tabs-1",
93
- "icon" => 'fa fa-gear',
94
- "label" => __("General Settings","wplivechat")
95
- ),
96
- 1 => array(
97
- "href" => "#tabs-2",
98
- "icon" => 'fa fa-envelope',
99
- "label" => __("Chat Box","wplivechat")
100
- ),
101
- 2 => array(
102
- "href" => "#tabs-3",
103
- "icon" => 'fa fa-book',
104
- "label" => __("Offline Messages","wplivechat")
105
- ),
106
- 3 => array(
107
- "href" => "#tabs-4",
108
- "icon" => 'fa fa-pencil',
109
- "label" => __("Styling","wplivechat")
110
- ),
111
- 4 => array(
112
- "href" => "#tabs-5",
113
- "icon" => 'fa fa-users',
114
- "label" => __("Agents","wplivechat")
115
- ),
116
- 5 => array(
117
- "href" => "#tabs-7",
118
- "icon" => 'fa fa-gavel',
119
- "label" => __("Blocked Visitors","wplivechat")
120
- )
121
- );
122
- $tabs_top = apply_filters("wplc_filter_setting_tabs",$tab_array);
123
-
124
- foreach ($tabs_top as $tab) {
125
- echo "<li><a href=\"".$tab['href']."\"><i class=\"".$tab['icon']."\"></i> ".$tab['label']."</a></li>";
126
- }
127
-
128
- ?>
129
-
130
- </ul>
131
- <div id="tabs-1">
132
- <h3><?php _e("General Settings",'wplivechat')?></h3>
133
- <table class='wp-list-table wplc_list_table widefat fixed striped pages' width='700'>
134
- <tr>
135
- <td width='350' valign='top'><?php _e("Chat enabled","wplivechat")?>: </td>
136
- <td>
137
- <select id='wplc_settings_enabled' name='wplc_settings_enabled'>
138
- <option value="1" <?php if (isset($wplc_settings_enabled[1])) { echo $wplc_settings_enabled[1]; } ?>><?php _e("Yes","wplivechat"); ?></option>
139
- <option value="2" <?php if (isset($wplc_settings_enabled[2])) { echo $wplc_settings_enabled[2]; }?>><?php _e("No","wplivechat"); ?></option>
140
- </select>
141
- </td>
142
- </tr>
143
- <?php /*
144
- <tr>
145
- <td width='200' valign='top'>
146
- <?php _e("Show the 'Powered by WP Live Chat Support' link", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e('Checking this will display a Powered by WP Live Chat Support link', 'wplivechat'); ?>"></i>
147
- </td>
148
- <td>
149
- <input type="checkbox" value="1" name="wplc_powered_by_link" <?php if (isset($wplc_settings['wplc_powered_by_link']) && $wplc_settings['wplc_powered_by_link'] == 1) { echo "checked"; } ?> />
150
- </td>
151
- </tr>
152
- */ ?>
153
-
154
- <!--
155
- <tr>
156
- <td width='400' valign='top'>
157
- <?php _e("Hide Chat", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Hides chat for 24hrs when user clicks X", "wplivechat") ?>"></i>
158
- </td>
159
- <td valign='top'>
160
- <input type="checkbox" name="wplc_hide_chat" value="true" <?php echo $wplc_hide_chat ?>/>
161
- </td>
162
- </tr>
163
- -->
164
- <tr>
165
- <td width='300' valign='top'>
166
- <?php _e("Required Chat Box Fields","wplivechat")?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Set default fields that will be displayed when users starting a chat", "wplivechat") ?>"></i>
167
- </td>
168
- <td valign='top'>
169
- <div class="wplc-require-user-info__item">
170
- <input type="radio" value="1" name="wplc_require_user_info" id="wplc_require_user_info_both" <?php if (isset($wplc_settings['wplc_require_user_info']) && $wplc_settings['wplc_require_user_info'] == '1') { echo "checked"; } ?> />
171
- <label for="wplc_require_user_info_both"><?php _e( 'Name and email', 'wplivechat' ); ?></label>
172
- </div>
173
- <div class="wplc-require-user-info__item">
174
- <input type="radio" value="email" name="wplc_require_user_info" id="wplc_require_user_info_email" <?php if (isset($wplc_settings['wplc_require_user_info']) && $wplc_settings['wplc_require_user_info'] == 'email') { echo "checked"; } ?> />
175
- <label for="wplc_require_user_info_email"><?php _e( 'Email', 'wplivechat' ); ?></label>
176
- </div>
177
- <div class="wplc-require-user-info__item">
178
- <input type="radio" value="name" name="wplc_require_user_info" id="wplc_require_user_info_name" <?php if (isset($wplc_settings['wplc_require_user_info']) && $wplc_settings['wplc_require_user_info'] == 'name') { echo "checked"; } ?> />
179
- <label for="wplc_require_user_info_name"><?php _e( 'Name', 'wplivechat' ); ?></label>
180
- </div>
181
- <div class="wplc-require-user-info__item">
182
- <input type="radio" value="0" name="wplc_require_user_info" id="wplc_require_user_info_none" <?php if (isset($wplc_settings['wplc_require_user_info']) && $wplc_settings['wplc_require_user_info'] == '0') { echo "checked"; } ?> />
183
- <label for="wplc_require_user_info_none"><?php _e( 'No fields', 'wplivechat' ); ?></label>
184
- </div>
185
- </td>
186
- </tr>
187
- <tr class="wplc-user-default-visitor-name__row">
188
- <td width='300' valign='top'>
189
- <?php _e("Default visitor name","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("This name will be displayed for all not logged in visitors", "wplivechat") ?>"></i>
190
- </td>
191
- <td valign='top'>
192
- <input type="text" name="wplc_user_default_visitor_name" id="wplc_user_default_visitor_name" value="<?php if ( isset( $wplc_settings['wplc_user_default_visitor_name'] ) ) { echo stripslashes( $wplc_settings['wplc_user_default_visitor_name'] ); } else { echo __( "Guest", "wplivechat" ); } ?>" />
193
- </td>
194
- </tr>
195
- <tr>
196
- <td width='300' valign='top'>
197
- <?php _e("Input Field Replacement Text","wplivechat")?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("This is the text that will show in place of the Name And Email fields", "wplivechat") ?>"></i>
198
- </td>
199
- <td valign='top'>
200
- <textarea cols="45" rows="5" name="wplc_user_alternative_text" ><?php if(isset($wplc_settings['wplc_user_alternative_text'])) { echo stripslashes($wplc_settings['wplc_user_alternative_text']); } ?></textarea>
201
- </td>
202
- </tr>
203
- <tr>
204
- <td width='300' valign='top'>
205
- <?php _e("Use Logged In User Details","wplivechat")?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("A user's Name and Email Address will be used by default if they are logged in.", "wplivechat") ?>"></i>
206
- </td>
207
- <td valign='top'>
208
- <input type="checkbox" value="1" name="wplc_loggedin_user_info" <?php if(isset($wplc_settings['wplc_loggedin_user_info']) && $wplc_settings['wplc_loggedin_user_info'] == 1 ) { echo "checked"; } ?> />
209
- </td>
210
- </tr>
211
- <tr>
212
- <td width='200' valign='top'>
213
- <?php _e("Enable On Mobile Devices","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Disabling this will mean that the Chat Box will not be displayed on mobile devices. (Smartphones and Tablets)", "wplivechat") ?>"></i>
214
- </td>
215
- <td valign='top'>
216
- <input type="checkbox" value="1" name="wplc_enabled_on_mobile" <?php if(isset($wplc_settings['wplc_enabled_on_mobile']) && $wplc_settings['wplc_enabled_on_mobile'] == 1 ) { echo "checked"; } ?> />
217
- </td>
218
- </tr>
219
- <!--<tr>
220
- <td width='350' valign='top'>
221
- <?php _e("Record a visitor's IP Address","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Disable this to enable anonymity for your visitors", "wplivechat") ?>"></i>
222
- </td>
223
- <td valign='top'>
224
- <input type="checkbox" value="1" name="wplc_record_ip_address" <?php if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1 ) { echo "checked"; } ?> />
225
- </td>
226
- </tr>-->
227
-
228
- <?php if( isset( $wplc_settings['wplc_use_node_server'] ) && intval( $wplc_settings['wplc_use_node_server'] ) == 1 ){ ?>
229
- <tr>
230
- <td width='300' valign='top'>
231
- <?php _e("Play a sound when there is a new visitor","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Disable this to mute the sound that is played when a new visitor arrives", "wplivechat") ?>"></i>
232
- </td>
233
- <td valign='top'>
234
- <input type="checkbox" value="1" name="wplc_enable_visitor_sound" <?php if(isset($wplc_settings['wplc_enable_visitor_sound']) && $wplc_settings['wplc_enable_visitor_sound'] == 1 ) { echo "checked"; } ?> />
235
- </td>
236
- </tr>
237
- <?php } ?>
238
- <tr>
239
- <td width='300' valign='top'>
240
- <?php _e("Play a sound when a new message is received","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Disable this to mute the sound that is played when a new chat message is received", "wplivechat") ?>"></i>
241
- </td>
242
- <td valign='top'>
243
- <input type="checkbox" value="1" name="wplc_enable_msg_sound" <?php if(isset($wplc_settings['wplc_enable_msg_sound']) && $wplc_settings['wplc_enable_msg_sound'] == 1 ) { echo "checked"; } ?> />
244
- </td>
245
- </tr>
246
-
247
- <tr>
248
- <td width='300' valign='top'>
249
- <?php _e("Enable Font Awesome set","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Disable this if you have Font Awesome set included with your theme", "wplivechat") ?>"></i>
250
- </td>
251
- <td valign='top'>
252
- <input type="checkbox" value="1" name="wplc_enable_font_awesome" <?php if(isset($wplc_settings['wplc_enable_font_awesome']) && $wplc_settings['wplc_enable_font_awesome'] == 1 ) { echo "checked"; } ?> />
253
- </td>
254
- </tr>
255
- <tr>
256
- <td width='300' valign='top'>
257
- <?php _e("Enable chat dashboard and notifications on all admin pages","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("This will load the chat dashboard on every admin page.", "wplivechat") ?>"></i>
258
- </td>
259
- <td valign='top'>
260
- <input type="checkbox" value="1" name="wplc_enable_all_admin_pages" <?php if(isset($wplc_settings['wplc_enable_all_admin_pages']) && $wplc_settings['wplc_enable_all_admin_pages'] == 1 ) { echo "checked"; } ?> />
261
- </td>
262
- </tr>
263
-
264
- <?php if (!function_exists("wplc_pro_activate")) { ?>
265
-
266
- <tr>
267
- <td width='300' valign='top'>
268
- <?php _e("Include chat window on the following pages","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Show the chat window on the following pages. Leave blank to show on all. (Use comma-separated Page ID's)", "wplivechat") ?>"></i>
269
- </td>
270
- <td valign='top'>
271
- <input type="text" readonly="readonly" />
272
- <small>
273
- <i>
274
- <?php _e("available in the","wplivechat")?>
275
- <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=include_pages" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
276
- <?php _e("only","wplivechat")?>
277
- </i>
278
- </small>
279
- </td>
280
- </tr>
281
- <tr>
282
- <td width='200' valign='top'>
283
- <?php _e("Exclude chat window on the following pages","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Do not show the chat window on the following pages. Leave blank to show on all. (Use comma-separated Page ID's)", "wplivechat") ?>"></i>
284
- </td>
285
- <td valign='top'>
286
- <input type="text" readonly="readonly"/>
287
- <small>
288
- <i>
289
- <?php _e("available in the","wplivechat")?>
290
- <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=exclude_pages" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
291
- <?php _e("only","wplivechat")?>
292
- </i>
293
- </small>
294
- </td>
295
- </tr>
296
-
297
- <tr class="wplc-exclude-post-types__row">
298
- <td width='200' valign='top'>
299
- <?php _e("Exclude chat window on selected post types","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Do not show the chat window on the following post types pages.", "wplivechat") ?>"></i>
300
- </td>
301
- <td valign='top'>
302
- <input type="text" readonly="readonly"/>
303
- <small>
304
- <i>
305
- <?php _e("available in the","wplivechat")?>
306
- <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=exclude_pages" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
307
- <?php _e("only","wplivechat")?>
308
- </i>
309
- </small>
310
- </td>
311
- </tr>
312
-
313
- <?php } ?>
314
- </table>
315
- <?php do_action('wplc_hook_admin_settings_main_settings_after'); ?>
316
-
317
-
318
- </div>
319
- <div id="tabs-2">
320
- <h3><?php _e("Chat Window Settings",'wplivechat')?></h3>
321
- <table class='wp-list-table wplc_list_table widefat fixed striped pages'>
322
- <tr>
323
- <td width='300' valign='top'><?php _e("Chat box alignment","wplivechat")?>:</td>
324
- <td>
325
- <select id='wplc_settings_align' name='wplc_settings_align'>
326
- <option value="1" <?php if (isset($wplc_settings_align[1])) { echo $wplc_settings_align[1]; } ?>><?php _e("Bottom left","wplivechat"); ?></option>
327
- <option value="2" <?php if (isset($wplc_settings_align[2])) { echo $wplc_settings_align[2]; } ?>><?php _e("Bottom right","wplivechat"); ?></option>
328
- <option value="3" <?php if (isset($wplc_settings_align[3])) { echo $wplc_settings_align[3]; } ?>><?php _e("Left","wplivechat"); ?></option>
329
- <option value="4" <?php if (isset($wplc_settings_align[4])) { echo $wplc_settings_align[4]; } ?>><?php _e("Right","wplivechat"); ?></option>
330
- </select>
331
- </td>
332
- </tr>
333
- <tr>
334
- <td width='300'>
335
- <?php _e("Auto Pop-up","wplivechat") ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Expand the chat box automatically (prompts the user to enter their name and email address).","wplivechat") ?>"></i>
336
- </td>
337
- <td>
338
- <input type="checkbox" name="wplc_auto_pop_up" value="1" <?php if(isset($wplc_settings['wplc_auto_pop_up']) && $wplc_settings['wplc_auto_pop_up'] == 1 ) { echo "checked"; } ?>/>
339
- </td>
340
- </tr>
341
-
342
-
343
-
344
-
345
- <?php if (!function_exists("wplc_pro_activate")) { ?>
346
- <tr>
347
- <td width='300'>
348
- <?php _e("Display typing indicator","wplivechat") ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Display a typing animation as soon as someone starts typing.","wplivechat") ?>"></i>
349
- </td>
350
- <td>
351
- <input type="checkbox" name="" value="" disabled />
352
- <small>
353
- <i>
354
- <?php _e("available in the","wplivechat")?>
355
- <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=typing" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
356
- <?php _e("only","wplivechat")?>
357
- </i>
358
- </small>
359
- </td>
360
- </tr>
361
- <tr>
362
- <tr>
363
-
364
- <td width='300' valign='top'>
365
- <?php _e("Name","wplivechat")?>:
366
- </td>
367
- <td>
368
- <input type='text' size='50' maxlength='50' disabled readonly value='admin' />
369
- <small>
370
- <i>
371
- <?php _e("available in the","wplivechat")?>
372
- <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=name" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
373
- <?php _e("only","wplivechat")?>
374
- </i>
375
- </small>
376
- </td>
377
- </tr>
378
- <!-- Chat Icon-->
379
- <tr>
380
- <td width='300' valign='top'>
381
- <?php _e("Icon","wplivechat")?>:
382
- </td>
383
- <td>
384
- <input id="wplc_pro_chat_button" type="button" value="<?php _e("Upload Image","wplivechat")?>" readonly disabled />
385
- <small>
386
- <i>
387
- <?php _e("available in the","wplivechat")?>
388
- <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=pic" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
389
- <?php _e("only","wplivechat")?>
390
- </i>
391
- </small>
392
- </td>
393
- </tr>
394
- <!-- Chat Pic-->
395
- <tr>
396
- <td width='300' valign='top'>
397
- <?php _e("Picture","wplivechat")?>:
398
- </td>
399
- <td>
400
- <input id="wplc_pro_pic_button" type="button" value="<?php _e("Upload Image","wplivechat")?>" readonly disabled />
401
- <small>
402
- <i>
403
- <?php _e("available in the","wplivechat")?>
404
- <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=pic" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
405
- <?php _e("only","wplivechat")?>
406
- </i>
407
- </small>
408
- </td>
409
- </tr>
410
- <!-- Chat Logo-->
411
- <tr>
412
- <td width='300' valign='top'>
413
- <?php _e("Logo","wplivechat")?>:
414
- </td>
415
- <td>
416
- <input id="wplc_pro_logo_button" type="button" value="<?php _e("Upload Image","wplivechat")?>" readonly disabled />
417
- <small>
418
- <i>
419
- <?php _e("available in the","wplivechat")?>
420
- <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=pic" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
421
- <?php _e("only","wplivechat")?>
422
- </i>
423
- </small>
424
- </td>
425
- </tr>
426
- <!-- Chat Delay-->
427
- <tr>
428
- <td width='300' valign='top'>
429
- <?php _e("Chat delay (seconds)","wplivechat")?>:
430
- </td>
431
- <td>
432
- <input type='text' size='50' maxlength='50' disabled readonly value='10' />
433
- <small>
434
- <i>
435
- <?php _e("available in the","wplivechat")?>
436
- <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=delay" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
437
- <?php _e("only","wplivechat")?>
438
- </i>
439
- </small>
440
- </td>
441
- </tr>
442
- <!-- Chat Notification if want to chat-->
443
- <tr>
444
- <td width='300' valign='top'>
445
- <?php _e("Chat notifications", "wplivechat") ?>:
446
- </td>
447
- <td>
448
- <input id='wplc_pro_chat_notification' name='wplc_pro_chat_notification' type='checkbox' value='yes' disabled="disabled" readonly/>
449
- <?php _e("Alert me via email as soon as someone wants to chat", "wplivechat") ?>
450
- <small>
451
- <i>
452
- <?php _e("available in the", "wplivechat") ?>
453
- <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=alert" title="<?php _e("Pro Add-on", "wplivechat") ?>" target="_BLANK"><?php _e("Pro Add-on", "wplivechat") ?></a>
454
- <?php _e("only", "wplivechat") ?>
455
- </i>
456
- </small>
457
- </td>
458
- </tr>
459
- <?php } ?>
460
-
461
- <!-- <tr>
462
- <td>
463
- <?php //_e("Display name and avatar in chat", "wplivechat") ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php //_e("Display the agent and user name above each message in the chat window.", "wplivechat") ?>"></i>
464
- </td>
465
- <td>
466
- <input type="checkbox" name="wplc_display_name" value="1" <?php //if (isset($wplc_settings['wplc_display_name']) && $wplc_settings['wplc_display_name'] == 1) {
467
- //echo "checked";
468
- //} ?>/>
469
- </td>
470
- </tr> -->
471
- <tr>
472
- <td>
473
- <?php _e("Display details in chat message", "wplivechat") ?>
474
- </td>
475
- <td> <!-- $wplc_settings['wplc_display_name'] Remember for backwards compat -->
476
- <?php if (isset($wplc_settings['wplc_show_name']) && $wplc_settings['wplc_show_name'] == 1) { $checked = "checked"; } else { $checked = ''; } ?>
477
- <input type="checkbox" name="wplc_show_name" value="1" <?php echo $checked; ?>/> <label><?php _e("Show Name", "wplivechat"); ?></label><br/>
478
- <?php if (isset($wplc_settings['wplc_show_avatar']) && $wplc_settings['wplc_show_avatar'] == 1) { $checked = "checked"; } else { $checked = ''; } ?>
479
- <input type="checkbox" name="wplc_show_avatar" value="1" <?php echo $checked; ?>/> <label><?php _e("Show Avatar", "wplivechat"); ?></label>
480
- </td>
481
- </tr>
482
- <tr>
483
- <td>
484
- <?php _e("Only show the chat window to users that are logged in", "wplivechat") ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("By checking this, only users that are logged in will be able to chat with you.", "wplivechat") ?>"></i>
485
- </td>
486
- <td>
487
- <input type="checkbox" name="wplc_display_to_loggedin_only" value="1" <?php
488
- if (isset($wplc_settings['wplc_display_to_loggedin_only']) && $wplc_settings['wplc_display_to_loggedin_only'] == 1) {
489
- echo "checked";
490
- }
491
- ?>/>
492
- </td>
493
- </tr>
494
- <tr>
495
- <td>
496
- <?php _e("Display a timestamp in the chat window", "wplivechat") ?>
497
- </td>
498
- <td>
499
- <?php if (isset($wplc_settings['wplc_show_date']) && $wplc_settings['wplc_show_date'] == 1) { $checked = "checked"; } else { $checked = ''; } ?>
500
- <input type="checkbox" name="wplc_show_date" value="1" <?php echo $checked; ?>/> <label><?php _e("Show Date", "wplivechat"); ?></label><br/>
501
- <?php if (isset($wplc_settings['wplc_show_time']) && $wplc_settings['wplc_show_time'] == 1) { $checked = "checked"; } else { $checked = ''; } ?>
502
- <input type="checkbox" name="wplc_show_time" value="1" <?php echo $checked; ?>/> <label><?php _e("Show Time", "wplivechat"); ?></label>
503
- </td>
504
- </tr>
505
- <tr>
506
- <td>
507
- <?php _e("Redirect user to thank you page when chat is ended", "wplivechat") ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("By checking this, users will be redirected to your thank you page when a chat is completed.", "wplivechat") ?>"></i>
508
- </td>
509
- <td>
510
- <input type="checkbox" name="wplc_redirect_to_thank_you_page" value="1" <?php echo (isset($wplc_settings['wplc_redirect_to_thank_you_page']) && $wplc_settings['wplc_redirect_to_thank_you_page'] == 1 ? "checked" : "" ); ?> />
511
- <input type="text" name="wplc_redirect_thank_you_url" value="<?php echo (isset($wplc_settings['wplc_redirect_thank_you_url']) ? urldecode($wplc_settings['wplc_redirect_thank_you_url']) : '' ); ?>" placeholder="<?php _e('Thank You Page URL', 'wplivechat'); ?>" />
512
- </td>
513
- </tr>
514
- <?php
515
- if(defined('WPLC_PRO_PLUGIN'))
516
- {
517
- ?>
518
- <tr>
519
- <td>
520
- <?php
521
- _e('Disable Emojis', 'wplivechat');
522
- ?>
523
- </td>
524
- <td>
525
- <input type="checkbox" name="wplc_disable_emojis"
526
- <?php
527
- if(!empty($wplc_settings['wplc_disable_emojis']))
528
- echo 'checked="checked"';
529
- ?>
530
- />
531
- </tr>
532
- <?php
533
- }
534
- ?>
535
- </table>
536
-
537
- <?php if(!function_exists("wplc_chat_social_div") && !function_exists("wplc_pro_activate")){ ?>
538
-
539
- <h3><?php _e("Social", 'wplivechat') ?></h3>
540
- <hr>
541
- <table class='wp-list-table wplc_list_table widefat fixed striped pages' >
542
- <tbody>
543
- <tr>
544
- <td width='300' valign='top'><?php _e("Facebook URL", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Link your Facebook page here. Leave blank to hide", "wplivechat") ?>"></i></td>
545
- <td>
546
- <input id='wplc_social_fb' name='wplc_social_fb' placeholder="<?php _e("Facebook URL...", "wplivechat") ?>" type='text' disabled/>
547
- <small>
548
- <i>
549
- <?php _e("available in the","wplivechat")?>
550
- <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=social_media" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
551
- <?php _e("only","wplivechat")?>
552
- </i>
553
- </small>
554
- </td>
555
- </tr>
556
- <tr>
557
- <td width='300' valign='top'><?php _e("Twitter URL", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Link your Twitter page here. Leave blank to hide", "wplivechat") ?>"></i></td>
558
- <td>
559
- <input id='wplc_social_tw' name='wplc_social_tw' placeholder="<?php _e("Twitter URL...", "wplivechat") ?>" type='text' disabled/>
560
- <small>
561
- <i>
562
- <?php _e("available in the","wplivechat")?>
563
- <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=social_media" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
564
- <?php _e("only","wplivechat")?>
565
- </i>
566
- </small>
567
- </td>
568
- </tr>
569
- </tbody>
570
- </table>
571
- <?php } ?>
572
-
573
-
574
-
575
- <?php do_action('wplc_hook_admin_settings_chat_box_settings_after'); ?>
576
-
577
- </div>
578
- <div id="tabs-3">
579
- <h3><?php _e("Offline Messages", 'wplivechat') ?></h3>
580
- <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='100%'>
581
- <tr>
582
- <td width='300'>
583
- <?php _e("Do not allow users to send offline messages", "wplivechat") ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("The chat window will be hidden when it is offline. Users will not be able to send offline messages to you", "wplivechat") ?>"></i>
584
- </td>
585
- <td>
586
- <input type="checkbox" name="wplc_hide_when_offline" value="1" <?php
587
- if (isset($wplc_settings['wplc_hide_when_offline']) && $wplc_settings['wplc_hide_when_offline'] == 1) {
588
- echo "checked";
589
- }
590
- ?>/>
591
- </td>
592
- </tr>
593
- <tr>
594
- <td width="300" valign="top"><?php _e("Offline Chat Box Title", "wplivechat") ?>:</td>
595
- <td>
596
- <input id="wplc_pro_na" name="wplc_pro_na" type="text" size="50" maxlength="50" class="regular-text" value="<?php if (isset($wplc_settings['wplc_pro_na'])) { echo stripslashes($wplc_settings['wplc_pro_na']); } ?>" /> <br />
597
-
598
-
599
- </td>
600
- </tr>
601
- <tr>
602
- <td width="300" valign="top"><?php _e("Offline Text Fields", "wplivechat") ?>:</td>
603
- <td>
604
- <input id="wplc_pro_offline1" name="wplc_pro_offline1" type="text" size="50" maxlength="150" class="regular-text" value="<?php if (isset($wplc_settings['wplc_pro_offline1'])) { echo stripslashes($wplc_settings['wplc_pro_offline1']); } ?>" /> <br />
605
- <input id="wplc_pro_offline2" name="wplc_pro_offline2" type="text" size="50" maxlength="50" class="regular-text" value="<?php if (isset($wplc_settings['wplc_pro_offline2'])) { echo stripslashes($wplc_settings['wplc_pro_offline2']); } ?>" /> <br />
606
- <input id="wplc_pro_offline3" name="wplc_pro_offline3" type="text" size="50" maxlength="150" class="regular-text" value="<?php if (isset($wplc_settings['wplc_pro_offline3'])) { echo stripslashes($wplc_settings['wplc_pro_offline3']); } ?>" /> <br />
607
-
608
-
609
- </td>
610
- </tr>
611
- <tr>
612
- <td width="300" valign="top"><?php _e("Offline Button Text", "wplivechat") ?>:</td>
613
- <td>
614
- <input id="wplc_pro_offline_btn" name="wplc_pro_offline_btn" type="text" size="50" maxlength="50" class="regular-text" value="<?php if (isset($wplc_settings['wplc_pro_offline_btn'])) { echo stripslashes($wplc_settings['wplc_pro_offline_btn']); } ?>" /> <br />
615
- </td>
616
- </tr>
617
- <tr>
618
- <td width="300" valign="top"><?php _e("Offline Send Button Text", "wplivechat") ?>:</td>
619
- <td>
620
- <input id="wplc_pro_offline_btn_send" name="wplc_pro_offline_btn_send" type="text" size="50" maxlength="50" class="regular-text" value="<?php if (isset($wplc_settings['wplc_pro_offline_btn_send'])) { echo stripslashes($wplc_settings['wplc_pro_offline_btn_send']); } ?>" /> <br />
621
- </td>
622
- </tr>
623
- <tr>
624
- <td width="300" valign="top"><?php _e("Custom fields", "wplivechat") ?>:</td>
625
- <td>
626
- <?php do_action( "wplc_hook_offline_custom_fields_integration_settings" ); ?>
627
- </td>
628
- </tr>
629
-
630
- </table>
631
-
632
- <h4><?php _e("Email settings", 'wplivechat') ?></h4>
633
-
634
-
635
- <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages'>
636
- <tr>
637
- <td width='300' valign='top'>
638
- <?php _e("Email Address", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Email address where offline messages are delivered to. Use comma separated email addresses to send to more than one email address", "wplivechat") ?>"></i>
639
- </td>
640
- <td>
641
- <input id="wplc_pro_chat_email_address" name="wplc_pro_chat_email_address" class="regular-text" type="text" value="<?php if (isset($wplc_settings['wplc_pro_chat_email_address'])) {
642
- echo $wplc_settings['wplc_pro_chat_email_address']; } ?>" />
643
- </td>
644
- </tr>
645
-
646
- <tr>
647
- <td width='300' valign='top'>
648
- <?php _e("Subject", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("User name will be appended to the end of the subject.", "wplivechat") ?>"></i>
649
- </td>
650
- <td>
651
- <input id="wplc_pro_chat_email_offline_subject" name="wplc_pro_chat_email_offline_subject" class="regular-text" type="text" value="<?php echo(isset($wplc_settings['wplc_pro_chat_email_offline_subject']) ? $wplc_settings['wplc_pro_chat_email_offline_subject'] : ""); ?>" placeholder="<?php echo __("WP Live Chat Support - Offline Message from ", "wplivechat"); ?>"/>
652
- </td>
653
- </tr>
654
-
655
- </table>
656
-
657
- <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages'>
658
- <tr>
659
- <td width="33%"><?php _e("Sending Method", "wplivechat") ?></td>
660
- <td width="33%" style="text-align: center;"><?php _e("WP Mail", "wplivechat") ?></td>
661
- <td width="33%" style="text-align: center;"><?php _e("PHP Mailer", "wplivechat") ?></td>
662
- </tr>
663
- <tr>
664
- <td></td>
665
- <td style="text-align: center;"><input class="wplc_mail_type_radio" type="radio" value="wp_mail" name="wplc_mail_type" <?php if ($wplc_mail_type == "wp_mail") {
666
- echo "checked";
667
- } ?>></td>
668
- <td style="text-align: center;"><input id="wpcl_mail_type_php" class="wplc_mail_type_radio" type="radio" value="php_mailer" name="wplc_mail_type" <?php if ($wplc_mail_type == "php_mailer") {
669
- echo "checked";
670
- } ?>></td>
671
- </tr>
672
- </table>
673
- <hr/>
674
- <table id="wplc_smtp_details" class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='100%'>
675
- <tr>
676
- <td width="300" valign="top">
677
- <?php _e("Host", "wplivechat") ?>:
678
- </td>
679
- <td>
680
- <input id="wplc_mail_host" name="wplc_mail_host" type="text" class="regular-text" value="<?php echo get_option("wplc_mail_host") ?>" placeholder="smtp.example.com" />
681
- </td>
682
- </tr>
683
- <tr>
684
- <td>
685
- <?php _e("Port", "wplivechat") ?>:
686
- </td>
687
- <td>
688
- <input id="wplc_mail_port" name="wplc_mail_port" type="text" class="regular-text" value="<?php echo get_option("wplc_mail_port") ?>" placeholder="25" />
689
- </td>
690
- </tr>
691
- <tr>
692
- <td>
693
- <?php _e("Username", "wplivechat") ?>:
694
- </td>
695
- <td>
696
- <input id="wplc_mail_username" name="wplc_mail_username" type="text" class="regular-text" value="<?php echo get_option("wplc_mail_username") ?>" placeholder="me@example.com" />
697
- </td>
698
- </tr>
699
- <tr>
700
- <td>
701
- <?php _e("Password", "wplivechat") ?>:
702
- </td>
703
- <td>
704
- <input id="wplc_mail_password" name="wplc_mail_password" type="password" class="regular-text" value="<?php echo get_option("wplc_mail_password") ?>" placeholder="Password" />
705
- </td>
706
- </tr>
707
- </table>
708
- <?php do_action('wplc_hook_admin_settings_offline_messages_settings_after'); ?>
709
- </div>
710
-
711
-
712
-
713
- <div id="tabs-4">
714
- <style>
715
- .wplc_theme_block img{
716
- border: 1px solid #CCC;
717
- border-radius: 5px;
718
- padding: 5px;
719
- margin: 5px;
720
- }
721
- .wplc_theme_single{
722
- width: 162px;
723
- height: 162px;
724
- text-align: center;
725
- display: inline-block;
726
- vertical-align: top;
727
- margin: 5px;
728
- }
729
- .wplc_animation_block div{
730
- display: inline-block;
731
- width: 150px;
732
- height: 150px;
733
- border: 1px solid #CCC;
734
- border-radius: 5px;
735
- text-align: center;
736
- margin: 10px;
737
- }
738
- .wplc_animation_block i{
739
- font-size: 3em;
740
- line-height: 150px;
741
- }
742
- .wplc_animation_block .wplc_red{
743
- color: #E31230;
744
- }
745
- .wplc_animation_block .wplc_orange{
746
- color: #EB832C;
747
- }
748
- .wplc_animation_active, .wplc_theme_active{
749
- box-shadow: 2px 2px 2px #666666;
750
- }
751
- </style>
752
- <style>
753
- .wplc_animation_block div{
754
- display: inline-block;
755
- width: 150px;
756
- height: 150px;
757
- border: 1px solid #CCC;
758
- border-radius: 5px;
759
- text-align: center;
760
- margin: 10px;
761
- }
762
- .wplc_animation_block i{
763
- font-size: 3em;
764
- line-height: 150px;
765
- }
766
- .wplc_animation_block .wplc_red{
767
- color: #E31230;
768
- }
769
- .wplc_animation_block .wplc_orange{
770
- color: #EB832C;
771
- }
772
- .wplc_animation_active{
773
- box-shadow: 2px 2px 2px #CCC;
774
- }
775
- </style>
776
- <h3><?php _e("Styling",'wplivechat')?></h3>
777
- <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages'>
778
-
779
-
780
- <tr style='margin-bottom: 10px;'>
781
- <td width='200'><label for=""><?php _e('Choose a theme', 'wplivechat'); ?></label></td>
782
- <td>
783
- <div class='wplc_theme_block'>
784
- <div class='wplc_theme_image' id=''>
785
- <div class='wplc_theme_single'>
786
- <img style='width:162px;' src='<?php echo WPLC_BASIC_PLUGIN_URL.'images/themes/newtheme-1.jpg'; ?>' title="<?php _e('Classic', 'wplivechat'); ?>" alt="<?php _e('Classic', 'wplivechat'); ?>" class='<?php if (isset($wplc_settings['wplc_newtheme']) && $wplc_settings['wplc_newtheme'] == 'theme-1') { echo 'wplc_theme_active'; } ?>' id='wplc_newtheme_1'/>
787
- <?php _e('Classic', 'wplivechat'); ?>
788
- </div>
789
- <div class='wplc_theme_single'>
790
- <img style='width:162px;' src='<?php echo WPLC_BASIC_PLUGIN_URL.'images/themes/newtheme-2.jpg'; ?>' title="<?php _e('Modern', 'wplivechat'); ?>" alt="<?php _e('Modern', 'wplivechat'); ?>" class='<?php if (isset($wplc_settings['wplc_newtheme']) && $wplc_settings['wplc_newtheme'] == 'theme-2') { echo 'wplc_theme_active'; } ?>' id='wplc_newtheme_2'/>
791
- <?php _e('Modern', 'wplivechat'); ?>
792
- </div>
793
-
794
- </div>
795
- </div>
796
- <input type="radio" name="wplc_newtheme" value="theme-1" class="wplc_hide_input" id="wplc_new_rb_theme_1" <?php if (isset($wplc_settings['wplc_newtheme']) && $wplc_settings['wplc_newtheme'] == 'theme-1') { echo 'checked'; } ?>/>
797
- <input type="radio" name="wplc_newtheme" value="theme-2" class="wplc_hide_input" id="wplc_new_rb_theme_2" <?php if (isset($wplc_settings['wplc_newtheme']) && $wplc_settings['wplc_newtheme'] == 'theme-2') { echo 'checked'; } ?>/>
798
-
799
- </td>
800
- </tr>
801
- <tr height="30">
802
- <td>&nbsp;</td>
803
- <td>&nbsp;</td>
804
- </tr>
805
-
806
- <tr style='margin-bottom: 10px;'>
807
- <td><label for=""><?php _e('Color Scheme', 'wplivechat'); ?></label></td>
808
- <td>
809
- <div class='wplc_theme_block'>
810
- <div class='wplc_palette'>
811
- <div class='wplc_palette_single'>
812
- <div class='wplc-palette-selection <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-default') { echo 'wplc_theme_active'; } ?>' id='wplc_theme_default'>
813
- <div class='wplc-palette-top' style='background-color:#ED832F;'></div>
814
- <div class='wplc-palette-top' style='background-color:#FFF;'></div>
815
- <div class='wplc-palette-top' style='background-color:#EEE;'></div>
816
- <div class='wplc-palette-top' style='background-color:#666;'></div>
817
- </div>
818
- </div>
819
-
820
- <div class='wplc_palette_single'>
821
- <div class='wplc-palette-selection <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-1') { echo 'wplc_theme_active'; } ?>' id='wplc_theme_1'>
822
- <div class='wplc-palette-top' style='background-color:#DB0000;'></div>
823
- <div class='wplc-palette-top' style='background-color:#FFF;'></div>
824
- <div class='wplc-palette-top' style='background-color:#000;'></div>
825
- <div class='wplc-palette-top' style='background-color:#666;'></div>
826
- </div>
827
- </div>
828
- <div class='wplc_palette_single'>
829
- <div class='wplc-palette-selection <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-2') { echo 'wplc_theme_active'; } ?>' id='wplc_theme_2'>
830
- <div class='wplc-palette-top' style='background-color:#000;'></div>
831
- <div class='wplc-palette-top' style='background-color:#FFF;'></div>
832
- <div class='wplc-palette-top' style='background-color:#888;'></div>
833
- <div class='wplc-palette-top' style='background-color:#666;'></div>
834
- </div>
835
- </div>
836
- <div class='wplc_palette_single'>
837
- <div class='wplc-palette-selection <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-3') { echo 'wplc_theme_active'; } ?>' id='wplc_theme_3'>
838
- <div class='wplc-palette-top' style='background-color:#B97B9D;'></div>
839
- <div class='wplc-palette-top' style='background-color:#FFF;'></div>
840
- <div class='wplc-palette-top' style='background-color:#EEE;'></div>
841
- <div class='wplc-palette-top' style='background-color:#5A0031;'></div>
842
- </div>
843
- </div>
844
- <div class='wplc_palette_single'>
845
- <div class='wplc-palette-selection <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-4') { echo 'wplc_theme_active'; } ?>' id='wplc_theme_4'>
846
- <div class='wplc-palette-top' style='background-color:#1A14DB;'></div>
847
- <div class='wplc-palette-top' style='background-color:#FDFDFF;'></div>
848
- <div class='wplc-palette-top' style='background-color:#7F7FB3;'></div>
849
- <div class='wplc-palette-top' style='background-color:#666;'></div>
850
- </div>
851
- </div>
852
- <div class='wplc_palette_single'>
853
- <div class='wplc-palette-selection <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-5') { echo 'wplc_theme_active'; } ?>' id='wplc_theme_5'>
854
- <div class='wplc-palette-top' style='background-color:#3DCC13;'></div>
855
- <div class='wplc-palette-top' style='background-color:#FDFDFF;'></div>
856
- <div class='wplc-palette-top' style='background-color:#EEE;'></div>
857
- <div class='wplc-palette-top' style='background-color:#666;'></div>
858
- </div>
859
- </div>
860
- <div class='wplc_palette_single'>
861
- <div class='wplc-palette-selection <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-6') { echo 'wplc_theme_active'; } ?>' id='wplc_theme_6'>
862
- <div class='wplc-palette-top' style='padding-top:3px'><?php _e("Choose","wplivechat"); ?></div>
863
- <div class='wplc-palette-top' style='padding-top:3px'><?php _e("Your","wplivechat"); ?></div>
864
- <div class='wplc-palette-top' style='padding-top:3px'><?php _e("Colors","wplivechat"); ?></div>
865
- <div class='wplc-palette-top' style='padding-top:3px'><?php _e("Below","wplivechat"); ?></div>
866
- </div>
867
- </div>
868
-
869
-
870
- </div>
871
- </div>
872
- <input type="radio" name="wplc_theme" value="theme-default" class="wplc_hide_input" id="wplc_rb_theme_default" <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-default') { echo 'checked'; } ?>/>
873
- <input type="radio" name="wplc_theme" value="theme-1" class="wplc_hide_input" id="wplc_rb_theme_1" <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-1') { echo 'checked'; } ?>/>
874
- <input type="radio" name="wplc_theme" value="theme-2" class="wplc_hide_input" id="wplc_rb_theme_2" <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-2') { echo 'checked'; } ?>/>
875
- <input type="radio" name="wplc_theme" value="theme-3" class="wplc_hide_input" id="wplc_rb_theme_3" <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-3') { echo 'checked'; } ?>/>
876
- <input type="radio" name="wplc_theme" value="theme-4" class="wplc_hide_input" id="wplc_rb_theme_4" <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-4') { echo 'checked'; } ?>/>
877
- <input type="radio" name="wplc_theme" value="theme-5" class="wplc_hide_input" id="wplc_rb_theme_5" <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-5') { echo 'checked'; } ?>/>
878
- <input type="radio" name="wplc_theme" value="theme-6" class="wplc_hide_input" id="wplc_rb_theme_6" <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-6') { echo 'checked'; } ?>/>
879
-
880
- </td>
881
- </tr>
882
-
883
- <tr>
884
- <td width='300' valign='top'><?php _e("Chat background","wplivechat")?>:</td>
885
- <td>
886
-
887
- <select id='wplc_settings_bg' name='wplc_settings_bg'>
888
- <option value="cloudy.jpg" <?php if (!isset($wplc_settings['wplc_settings_bg']) || ($wplc_settings['wplc_settings_bg'] == "cloudy.jpg") ) { echo "selected"; } ?>><?php _e("Cloudy","wplivechat"); ?></option>
889
- <option value="geometry.jpg" <?php if (isset($wplc_settings['wplc_settings_bg']) && $wplc_settings['wplc_settings_bg'] == "geometry.jpg") { echo "selected"; } ?>><?php _e("Geometry","wplivechat"); ?></option>
890
- <option value="tech.jpg" <?php if (isset($wplc_settings['wplc_settings_bg']) && $wplc_settings['wplc_settings_bg'] == "tech.jpg") { echo "selected"; } ?>><?php _e("Tech","wplivechat"); ?></option>
891
- <option value="social.jpg" <?php if (isset($wplc_settings['wplc_settings_bg']) && $wplc_settings['wplc_settings_bg'] == "social.jpg") { echo "selected"; } ?>><?php _e("Social","wplivechat"); ?></option>
892
- <option value="0" <?php if (isset($wplc_settings['wplc_settings_bg']) && $wplc_settings['wplc_settings_bg'] == "0") { echo "selected"; } ?>><?php _e("None","wplivechat"); ?></option>
893
- </select>
894
- </td>
895
- </tr>
896
- <tr>
897
- <td width='200' valign='top'><?php _e("Palette Color 1","wplivechat")?>:</td>
898
- <td>
899
- <input id="wplc_settings_color1" name="wplc_settings_color1" type="text" class="color" value="<?php if (isset($wplc_settings_color1)) { echo $wplc_settings_color1; } else { echo 'ED832F'; } ?>" />
900
- </td>
901
- </tr>
902
- <tr>
903
- <td width='200' valign='top'><?php _e("Palette Color 2","wplivechat")?>:</td>
904
- <td>
905
- <input id="wplc_settings_color2" name="wplc_settings_color2" type="text" class="color" value="<?php if (isset($wplc_settings_color2)) { echo $wplc_settings_color2; } else { echo 'FFFFFF'; } ?>" />
906
- </td>
907
- </tr>
908
- <tr>
909
- <td width='200' valign='top'><?php _e("Palette Color 3","wplivechat")?>:</td>
910
- <td>
911
- <input id="wplc_settings_color3" name="wplc_settings_color3" type="text" class="color" value="<?php if (isset($wplc_settings_color3)) { echo $wplc_settings_color3; } else { echo 'EEEEEE'; } ?>" />
912
- </td>
913
- </tr>
914
- <tr>
915
- <td width='200' valign='top'><?php _e("Palette Color 4","wplivechat")?>:</td>
916
- <td>
917
- <input id="wplc_settings_color4" name="wplc_settings_color4" type="text" class="color" value="<?php if (isset($wplc_settings_color4)) { echo $wplc_settings_color4; } else { echo '666666'; } ?>" />
918
- </td>
919
- </tr>
920
-
921
- <tr>
922
- <td width="200" valign="top"><?php _e("I'm using a localization plugin", "wplivechat") ?></td>
923
- <td>
924
- <input type="checkbox" name="wplc_using_localization_plugin" id="wplc_using_localization_plugin" value="1" <?php if (isset($wplc_settings['wplc_using_localization_plugin']) && $wplc_settings['wplc_using_localization_plugin'] == 1) { echo 'checked'; } ?>/>
925
- <br/><small><?php echo sprintf( __("Enable this if you are using a localization plugin. Should you wish to change the below strings with this option enabled, please visit the documentation %s", "wplivechat"), "<a href='https://wp-livechat.com/documentation/changing-strings-in-the-chat-window-when-using-a-localization-plugin/' target='_BLANK'>".__("here", "wplivechat") ); ?></small>
926
- </td>
927
- </tr>
928
-
929
- <tr style='height:30px;'><td></td><td></td></tr>
930
- <tr class="wplc_localization_strings">
931
- <td width="200" valign="top"><?php _e("First Section Text", "wplivechat") ?>:</td>
932
- <td>
933
- <input id="wplc_pro_fst1" name="wplc_pro_fst1" type="text" size="50" maxlength="50" class="regular-text" value="<?php echo stripslashes($wplc_settings['wplc_pro_fst1']) ?>" /> <br />
934
- <input id="wplc_pro_fst2" name="wplc_pro_fst2" type="text" size="50" maxlength="50" class="regular-text" value="<?php echo stripslashes($wplc_settings['wplc_pro_fst2']) ?>" /> <br />
935
- </td>
936
- </tr>
937
- <tr class="wplc_localization_strings">
938
- <td width="200" valign="top"><?php _e("Intro Text", "wplivechat") ?>:</td>
939
- <td>
940
- <input id="wplc_pro_intro" name="wplc_pro_intro" type="text" size="50" maxlength="150" class="regular-text" value="<?php echo stripslashes($wplc_settings['wplc_pro_intro']) ?>" /> <br />
941
- </td>
942
- </tr>
943
- <tr class="wplc_localization_strings">
944
- <td width="200" valign="top"><?php _e("Second Section Text", "wplivechat") ?>:</td>
945
- <td>
946
- <input id="wplc_pro_sst1" name="wplc_pro_sst1" type="text" size="50" maxlength="30" class="regular-text" value="<?php echo stripslashes($wplc_settings['wplc_pro_sst1']) ?>" /> <br />
947
- <input id="wplc_pro_sst2" name="wplc_pro_sst2" type="text" size="50" maxlength="70" class="regular-text" value="<?php echo stripslashes($wplc_settings['wplc_pro_sst2']) ?>" /> <br />
948
- </td>
949
- </tr>
950
- <tr class="wplc_localization_strings">
951
- <td width="200" valign="top"><?php _e("Reactivate Chat Section Text", "wplivechat") ?>:</td>
952
- <td>
953
- <input id="wplc_pro_tst1" name="wplc_pro_tst1" type="text" size="50" maxlength="50" class="regular-text" value="<?php echo stripslashes($wplc_settings['wplc_pro_tst1']) ?>" /> <br />
954
-
955
-
956
- </td>
957
- </tr>
958
- <?php /* removed as this has been replaced with the "welcome_msg" below
959
- <tr class="wplc_localization_strings">
960
- <td width="200" valign="top"><?php _e("User chat welcome", "wplivechat") ?>:</td>
961
- <td>
962
- <input id="wplc_user_welcome_chat" name="wplc_user_welcome_chat" type="text" size="50" maxlength="150" class="regular-text" value="<?php echo stripslashes($wplc_settings['wplc_user_welcome_chat']) ?>" /> <br />
963
- </td>
964
- </tr>
965
- */ ?>
966
- <tr class="wplc_localization_strings">
967
- <td width="200" valign="top"><?php _e("Welcome message", "wplivechat") ?>:</td>
968
- <td>
969
- <input id="wplc_welcome_msg" name="wplc_welcome_msg" type="text" size="50" maxlength="350" class="regular-text" value="<?php echo stripslashes($wplc_settings['wplc_welcome_msg']) ?>" /> <span class='description'><?php _e('This text is shown as soon as a user starts a chat and waits for an agent to join', 'wplivechat'); ?></span><br />
970
- </td>
971
- </tr>
972
- <tr class="wplc_localization_strings">
973
- <td width="200" valign="top"><?php _e("No answer", "wplivechat") ?>:</td>
974
- <td>
975
- <input id="wplc_user_no_answer" name="wplc_user_no_answer" type="text" size="50" maxlength="150" class="regular-text" value="<?php echo (isset($wplc_settings['wplc_user_no_answer']) ? stripslashes($wplc_settings['wplc_user_no_answer']) : __("There is No Answer. Please Try Again Later.","wplivechat")); ?>" /> <span class='description'><?php _e('This text is shown to the user when an agent has failed to answer a chat ', 'wplivechat'); ?></span><br />
976
- </td>
977
- </tr>
978
- <tr class="wplc_localization_strings">
979
- <td width="200" valign="top"><?php _e("Other text", "wplivechat") ?>:</td>
980
- <td>
981
- <input id="wplc_user_enter" name="wplc_user_enter" type="text" size="50" maxlength="150" class="regular-text" value="<?php echo stripslashes($wplc_settings['wplc_user_enter']) ?>" /><br />
982
- <input id="wplc_text_chat_ended" name="wplc_text_chat_ended" type="text" size="50" maxlength="150" class="regular-text" value="<?php echo ( empty( $wplc_settings['wplc_text_chat_ended'] ) ) ? stripslashes(__("The chat has been ended by the operator.", "wplivechat")) : stripslashes( $wplc_settings['wplc_text_chat_ended'] ) ?>" /> <br />
983
- </td>
984
- </tr>
985
- <!--
986
- <tr class="wplc_localization_strings">
987
- <td width="200" valign="top"><?php _e("Close Button Text", "wplivechat") ?>:</td>
988
- <td>
989
- <input id="wplc_close_btn_text" name="wplc_close_btn_text" type="text" size="50" maxlength="150" class="regular-text" value="<?php echo stripslashes($wplc_settings['wplc_close_btn_text']) ?>" /><br />
990
- </td>
991
- </tr>
992
- -->
993
-
994
- <tr>
995
- <th><label for=""><?php _e('Choose an animation', 'wplivechat'); ?></label></th>
996
-
997
- <td>
998
- <div class='wplc_animation_block'>
999
- <div class='wplc_animation_image <?php if (isset($wplc_settings['wplc_animation']) && $wplc_settings['wplc_animation'] == 'animation-1') {
1000
- echo 'wplc_animation_active';
1001
- } ?>' id='wplc_animation_1'>
1002
- <i class="fa fa-arrow-circle-up wplc_orange"></i>
1003
- <p><?php _e('Slide Up', 'wplivechat'); ?></p>
1004
- </div>
1005
- <div class='wplc_animation_image <?php if (isset($wplc_settings['wplc_animation']) && $wplc_settings['wplc_animation'] == 'animation-2') {
1006
- echo 'wplc_animation_active';
1007
- } ?>' id='wplc_animation_2'>
1008
- <i class="fa fa-arrows-h wplc_red"></i>
1009
- <p><?php _e('Slide From The Side', 'wplivechat'); ?></p>
1010
- </div>
1011
- <div class='wplc_animation_image <?php if (isset($wplc_settings['wplc_animation']) && $wplc_settings['wplc_animation'] == 'animation-3') {
1012
- echo 'wplc_animation_active';
1013
- } ?>' id='wplc_animation_3'>
1014
- <i class="fa fa-arrows-alt wplc_orange"></i>
1015
- <p><?php _e('Fade In', 'wplivechat'); ?></p>
1016
- </div>
1017
- <div class='wplc_animation_image <?php if ((isset($wplc_settings['wplc_animation']) && $wplc_settings['wplc_animation'] == 'animation-4') || !isset($wplc_settings['wplc_animation'])) {
1018
- echo 'wplc_animation_active';
1019
- } ?>' id='wplc_animation_4'>
1020
- <i class="fa fa-thumb-tack wplc_red"></i>
1021
- <p><?php _e('No Animation', 'wplivechat'); ?></p>
1022
- </div>
1023
- </div>
1024
- <input type="radio" name="wplc_animation" value="animation-1" class="wplc_hide_input" id="wplc_rb_animation_1" class='wplc_hide_input' <?php if (isset($wplc_settings['wplc_animation']) && $wplc_settings['wplc_animation'] == 'animation-1') {
1025
- echo 'checked';
1026
- } ?>/>
1027
- <input type="radio" name="wplc_animation" value="animation-2" class="wplc_hide_input" id="wplc_rb_animation_2" class='wplc_hide_input' <?php if (isset($wplc_settings['wplc_animation']) && $wplc_settings['wplc_animation'] == 'animation-2') {
1028
- echo 'checked';
1029
- } ?>/>
1030
- <input type="radio" name="wplc_animation" value="animation-3" class="wplc_hide_input" id="wplc_rb_animation_3" class='wplc_hide_input' <?php if (isset($wplc_settings['wplc_animation']) && $wplc_settings['wplc_animation'] == 'animation-3') {
1031
- echo 'checked';
1032
- } ?>/>
1033
- <input type="radio" name="wplc_animation" value="animation-4" class="wplc_hide_input" id="wplc_rb_animation_4" class='wplc_hide_input' <?php if (isset($wplc_settings['wplc_animation']) && $wplc_settings['wplc_animation'] == 'animation-4') {
1034
- echo 'checked';
1035
- } ?>/>
1036
- </td>
1037
- </tr>
1038
- </table>
1039
- </div>
1040
- <div id="tabs-5">
1041
-
1042
-
1043
- <?php do_action("wplc_hook_agents_settings"); ?>
1044
-
1045
-
1046
- </div>
1047
- <div id="tabs-7">
1048
- <h3><?php _e("Blocked Visitors - Based on IP Address", "wplivechat") ?></h3>
1049
- <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='100%'>
1050
- <tr>
1051
- <td>
1052
- <textarea name="wplc_ban_users_ip" style="width: 50%; min-height: 200px;" placeholder="<?php _e('Enter each IP Address you would like to block on a new line', 'wplivechat'); ?>" autocomplete="false"><?php
1053
- $ip_addresses = get_option('WPLC_BANNED_IP_ADDRESSES');
1054
- if($ip_addresses){
1055
- $ip_addresses = maybe_unserialize($ip_addresses);
1056
- if ($ip_addresses && is_array($ip_addresses)) {
1057
- foreach($ip_addresses as $ip){
1058
- echo $ip."\n";
1059
- }
1060
- }
1061
- }
1062
- ?></textarea>
1063
- <p class="description"><?php _e('Blocking a user\'s IP Address here will hide the chat window from them, preventing them from chatting with you. Each IP Address must be on a new line', 'wplivechat'); ?></p>
1064
- </td>
1065
- </tr>
1066
- </table>
1067
- </div>
1068
-
1069
-
1070
-
1071
- <?php do_action("wplc_hook_settings_page_more_tabs"); ?>
1072
-
1073
- </div>
1074
- <p class='submit'><input type='submit' name='wplc_save_settings' class='button-primary' value='<?php _e("Save Settings","wplivechat")?>' /></p>
1075
- </form>
1076
-
1077
- </div>
1078
-
1079
-
 
 
 
 
 
 
 
 
 
 
 
1
+ <style>
2
+ .ui-tabs-vertical { }
3
+ .ui-tabs-vertical .ui-tabs-nav {
4
+ padding: .2em .1em .2em .2em;
5
+ float: left;
6
+ /* width: 10%; */
7
+ max-width: 20%;
8
+ min-width: 190px;
9
+ }
10
+ .ui-tabs-vertical .ui-tabs-nav li { clear: left; width: 100%; border-bottom-width: 1px !important; border-right-width: 0 !important; margin: 0 -1px .2em 0; }
11
+ .ui-tabs-vertical .ui-tabs-nav li a { display:block; }
12
+ .ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active { padding-bottom: 0; padding-right: .1em; border-right-width: 1px; }
13
+ .ui-tabs-vertical .ui-tabs-panel {
14
+ /* padding: 1em; */
15
+ float: left;
16
+ min-width: 67%;
17
+ max-width: 67%;
18
+ }
19
+ textarea, input[type='text'], input[type='email'], input[type='password']{ width: 100% !important; }
20
+ </style>
21
+
22
+ <?php
23
+ /**
24
+ * Removes the ajax loader and forces the settings page to load as is after 3 seconds.
25
+ *
26
+ * This has been put here to counter any PHP fatal warnings that may be experienced on the settings page.
27
+ *
28
+ * Putting this in the wplc_tabs.js file will not work as that file is not loaded if there is a PHP fatal error
29
+ */
30
+ ?>
31
+ <script>
32
+ setTimeout( function() {
33
+ jQuery("#wplc_settings_page_loader").remove();
34
+ jQuery(".wrap").css('display','block');
35
+ jQuery(".wplc_settings_save_notice").css('display','block');
36
+ },3000);
37
+ </script>
38
+
39
+ <?php wplc_stats("settings");
40
+
41
+
42
+ if (function_exists("wplc_string_check")) { wplc_string_check(); }
43
+ $wplc_settings = get_option("WPLC_SETTINGS");
44
+
45
+ ?>
46
+
47
+ <?php
48
+ if (get_option("WPLC_HIDE_CHAT") == true) {
49
+ $wplc_hide_chat = "checked";
50
+ } else {
51
+ $wplc_hide_chat = "";
52
+ };
53
+
54
+ ?>
55
+ <img src='<?php echo WPLC_BASIC_PLUGIN_URL.'images/ajax-loader.gif'; ?>' id='wplc_settings_page_loader' style='display: block; margin: 20px auto;' />
56
+ <div class="wrap wplc_wrap" style='display: none;'>
57
+
58
+ <style>
59
+ .wplc_light_grey{
60
+ color: #666;
61
+ }
62
+ </style>
63
+ <div id="icon-edit" class="icon32 icon32-posts-post">
64
+ <br>
65
+ </div>
66
+ <h2><?php _e("WP Live Chat Support Settings","wplivechat")?></h2>
67
+ <?php
68
+
69
+ $wplc_mail_type = get_option("wplc_mail_type");
70
+ if (!isset($wplc_mail_type) || $wplc_mail_type == "" || !$wplc_mail_type) { $wplc_mail_type = "wp_mail"; }
71
+ if (isset($wplc_settings["wplc_settings_align"])) { $wplc_settings_align[intval($wplc_settings["wplc_settings_align"])] = "SELECTED"; }
72
+ if (isset($wplc_settings["wplc_settings_enabled"])) { $wplc_settings_enabled[intval($wplc_settings["wplc_settings_enabled"])] = "SELECTED"; }
73
+ if (isset($wplc_settings["wplc_settings_fill"])) { $wplc_settings_fill = $wplc_settings["wplc_settings_fill"]; } else { $wplc_settings_fill = "ed832f"; }
74
+ if (isset($wplc_settings["wplc_settings_font"])) { $wplc_settings_font = $wplc_settings["wplc_settings_font"]; } else { $wplc_settings_font = "FFFFFF"; }
75
+ if (isset($wplc_settings["wplc_settings_color1"])) { $wplc_settings_color1 = $wplc_settings["wplc_settings_color1"]; } else { $wplc_settings_color1 = "ED832F"; }
76
+ if (isset($wplc_settings["wplc_settings_color2"])) { $wplc_settings_color2 = $wplc_settings["wplc_settings_color2"]; } else { $wplc_settings_color2 = "FFFFFF"; }
77
+ if (isset($wplc_settings["wplc_settings_color3"])) { $wplc_settings_color3 = $wplc_settings["wplc_settings_color3"]; } else { $wplc_settings_color3 = "EEEEEE"; }
78
+ if (isset($wplc_settings["wplc_settings_color4"])) { $wplc_settings_color4 = $wplc_settings["wplc_settings_color4"]; } else { $wplc_settings_color4 = "666666"; }
79
+ if (isset($wplc_settings["wplc_environment"])) { $wplc_environment[intval($wplc_settings["wplc_environment"])] = "SELECTED"; }
80
+
81
+
82
+ if(get_option("WPLC_HIDE_CHAT") == true) { $wplc_hide_chat = "checked"; } else { $wplc_hide_chat = ""; };
83
+
84
+ ?>
85
+ <form action='' name='wplc_settings' method='POST' id='wplc_settings'>
86
+
87
+ <div id="wplc_tabs">
88
+ <ul>
89
+ <?php
90
+ $tab_array = array(
91
+ 0 => array(
92
+ "href" => "#tabs-1",
93
+ "icon" => 'fa fa-gear',
94
+ "label" => __("General Settings","wplivechat")
95
+ ),
96
+ 1 => array(
97
+ "href" => "#tabs-2",
98
+ "icon" => 'fa fa-envelope',
99
+ "label" => __("Chat Box","wplivechat")
100
+ ),
101
+ 2 => array(
102
+ "href" => "#tabs-3",
103
+ "icon" => 'fa fa-book',
104
+ "label" => __("Offline Messages","wplivechat")
105
+ ),
106
+ 3 => array(
107
+ "href" => "#tabs-4",
108
+ "icon" => 'fa fa-pencil',
109
+ "label" => __("Styling","wplivechat")
110
+ ),
111
+ 4 => array(
112
+ "href" => "#tabs-5",
113
+ "icon" => 'fa fa-users',
114
+ "label" => __("Agents","wplivechat")
115
+ ),
116
+ 5 => array(
117
+ "href" => "#tabs-7",
118
+ "icon" => 'fa fa-gavel',
119
+ "label" => __("Blocked Visitors","wplivechat")
120
+ )
121
+ );
122
+ $tabs_top = apply_filters("wplc_filter_setting_tabs",$tab_array);
123
+
124
+ foreach ($tabs_top as $tab) {
125
+ echo "<li><a href=\"".$tab['href']."\"><i class=\"".$tab['icon']."\"></i> ".$tab['label']."</a></li>";
126
+ }
127
+
128
+ ?>
129
+
130
+ </ul>
131
+ <div id="tabs-1">
132
+ <h3><?php _e("General Settings",'wplivechat')?></h3>
133
+ <table class='wp-list-table wplc_list_table widefat fixed striped pages' width='700'>
134
+ <tr>
135
+ <td width='350' valign='top'><?php _e("Chat enabled","wplivechat")?>: </td>
136
+ <td>
137
+ <select id='wplc_settings_enabled' name='wplc_settings_enabled'>
138
+ <option value="1" <?php if (isset($wplc_settings_enabled[1])) { echo $wplc_settings_enabled[1]; } ?>><?php _e("Yes","wplivechat"); ?></option>
139
+ <option value="2" <?php if (isset($wplc_settings_enabled[2])) { echo $wplc_settings_enabled[2]; }?>><?php _e("No","wplivechat"); ?></option>
140
+ </select>
141
+ </td>
142
+ </tr>
143
+ <?php /*
144
+ <tr>
145
+ <td width='200' valign='top'>
146
+ <?php _e("Show the 'Powered by WP Live Chat Support' link", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e('Checking this will display a Powered by WP Live Chat Support link', 'wplivechat'); ?>"></i>
147
+ </td>
148
+ <td>
149
+ <input type="checkbox" value="1" name="wplc_powered_by_link" <?php if (isset($wplc_settings['wplc_powered_by_link']) && $wplc_settings['wplc_powered_by_link'] == 1) { echo "checked"; } ?> />
150
+ </td>
151
+ </tr>
152
+ */ ?>
153
+
154
+ <!--
155
+ <tr>
156
+ <td width='400' valign='top'>
157
+ <?php _e("Hide Chat", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Hides chat for 24hrs when user clicks X", "wplivechat") ?>"></i>
158
+ </td>
159
+ <td valign='top'>
160
+ <input type="checkbox" name="wplc_hide_chat" value="true" <?php echo $wplc_hide_chat ?>/>
161
+ </td>
162
+ </tr>
163
+ -->
164
+ <tr>
165
+ <td width='300' valign='top'>
166
+ <?php _e("Required Chat Box Fields","wplivechat")?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Set default fields that will be displayed when users starting a chat", "wplivechat") ?>"></i>
167
+ </td>
168
+ <td valign='top'>
169
+ <div class="wplc-require-user-info__item">
170
+ <input type="radio" value="1" name="wplc_require_user_info" id="wplc_require_user_info_both" <?php if (isset($wplc_settings['wplc_require_user_info']) && $wplc_settings['wplc_require_user_info'] == '1') { echo "checked"; } ?> />
171
+ <label for="wplc_require_user_info_both"><?php _e( 'Name and email', 'wplivechat' ); ?></label>
172
+ </div>
173
+ <div class="wplc-require-user-info__item">
174
+ <input type="radio" value="email" name="wplc_require_user_info" id="wplc_require_user_info_email" <?php if (isset($wplc_settings['wplc_require_user_info']) && $wplc_settings['wplc_require_user_info'] == 'email') { echo "checked"; } ?> />
175
+ <label for="wplc_require_user_info_email"><?php _e( 'Email', 'wplivechat' ); ?></label>
176
+ </div>
177
+ <div class="wplc-require-user-info__item">
178
+ <input type="radio" value="name" name="wplc_require_user_info" id="wplc_require_user_info_name" <?php if (isset($wplc_settings['wplc_require_user_info']) && $wplc_settings['wplc_require_user_info'] == 'name') { echo "checked"; } ?> />
179
+ <label for="wplc_require_user_info_name"><?php _e( 'Name', 'wplivechat' ); ?></label>
180
+ </div>
181
+ <div class="wplc-require-user-info__item">
182
+ <input type="radio" value="0" name="wplc_require_user_info" id="wplc_require_user_info_none" <?php if (isset($wplc_settings['wplc_require_user_info']) && $wplc_settings['wplc_require_user_info'] == '0') { echo "checked"; } ?> />
183
+ <label for="wplc_require_user_info_none"><?php _e( 'No fields', 'wplivechat' ); ?></label>
184
+ </div>
185
+ </td>
186
+ </tr>
187
+ <tr class="wplc-user-default-visitor-name__row">
188
+ <td width='300' valign='top'>
189
+ <?php _e("Default visitor name","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("This name will be displayed for all not logged in visitors", "wplivechat") ?>"></i>
190
+ </td>
191
+ <td valign='top'>
192
+ <input type="text" name="wplc_user_default_visitor_name" id="wplc_user_default_visitor_name" value="<?php if ( isset( $wplc_settings['wplc_user_default_visitor_name'] ) ) { echo stripslashes( $wplc_settings['wplc_user_default_visitor_name'] ); } else { echo __( "Guest", "wplivechat" ); } ?>" />
193
+ </td>
194
+ </tr>
195
+ <tr>
196
+ <td width='300' valign='top'>
197
+ <?php _e("Input Field Replacement Text","wplivechat")?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("This is the text that will show in place of the Name And Email fields", "wplivechat") ?>"></i>
198
+ </td>
199
+ <td valign='top'>
200
+ <textarea cols="45" rows="5" name="wplc_user_alternative_text" ><?php if(isset($wplc_settings['wplc_user_alternative_text'])) { echo stripslashes($wplc_settings['wplc_user_alternative_text']); } ?></textarea>
201
+ </td>
202
+ </tr>
203
+ <tr>
204
+ <td width='300' valign='top'>
205
+ <?php _e("Use Logged In User Details","wplivechat")?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("A user's Name and Email Address will be used by default if they are logged in.", "wplivechat") ?>"></i>
206
+ </td>
207
+ <td valign='top'>
208
+ <input type="checkbox" value="1" name="wplc_loggedin_user_info" <?php if(isset($wplc_settings['wplc_loggedin_user_info']) && $wplc_settings['wplc_loggedin_user_info'] == 1 ) { echo "checked"; } ?> />
209
+ </td>
210
+ </tr>
211
+ <tr>
212
+ <td width='200' valign='top'>
213
+ <?php _e("Enable On Mobile Devices","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Disabling this will mean that the Chat Box will not be displayed on mobile devices. (Smartphones and Tablets)", "wplivechat") ?>"></i>
214
+ </td>
215
+ <td valign='top'>
216
+ <input type="checkbox" value="1" name="wplc_enabled_on_mobile" <?php if(isset($wplc_settings['wplc_enabled_on_mobile']) && $wplc_settings['wplc_enabled_on_mobile'] == 1 ) { echo "checked"; } ?> />
217
+ </td>
218
+ </tr>
219
+ <!--<tr>
220
+ <td width='350' valign='top'>
221
+ <?php _e("Record a visitor's IP Address","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Disable this to enable anonymity for your visitors", "wplivechat") ?>"></i>
222
+ </td>
223
+ <td valign='top'>
224
+ <input type="checkbox" value="1" name="wplc_record_ip_address" <?php if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1 ) { echo "checked"; } ?> />
225
+ </td>
226
+ </tr>-->
227
+
228
+ <?php if( isset( $wplc_settings['wplc_use_node_server'] ) && intval( $wplc_settings['wplc_use_node_server'] ) == 1 ){ ?>
229
+ <tr>
230
+ <td width='300' valign='top'>
231
+ <?php _e("Play a sound when there is a new visitor","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Disable this to mute the sound that is played when a new visitor arrives", "wplivechat") ?>"></i>
232
+ </td>
233
+ <td valign='top'>
234
+ <input type="checkbox" value="1" name="wplc_enable_visitor_sound" <?php if(isset($wplc_settings['wplc_enable_visitor_sound']) && $wplc_settings['wplc_enable_visitor_sound'] == 1 ) { echo "checked"; } ?> />
235
+ </td>
236
+ </tr>
237
+ <?php } ?>
238
+ <tr>
239
+ <td width='300' valign='top'>
240
+ <?php _e("Play a sound when a new message is received","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Disable this to mute the sound that is played when a new chat message is received", "wplivechat") ?>"></i>
241
+ </td>
242
+ <td valign='top'>
243
+ <input type="checkbox" value="1" name="wplc_enable_msg_sound" <?php if(isset($wplc_settings['wplc_enable_msg_sound']) && $wplc_settings['wplc_enable_msg_sound'] == 1 ) { echo "checked"; } ?> />
244
+ </td>
245
+ </tr>
246
+
247
+ <tr>
248
+ <td width='300' valign='top'>
249
+ <?php _e("Enable Font Awesome set","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Disable this if you have Font Awesome set included with your theme", "wplivechat") ?>"></i>
250
+ </td>
251
+ <td valign='top'>
252
+ <input type="checkbox" value="1" name="wplc_enable_font_awesome" <?php if(isset($wplc_settings['wplc_enable_font_awesome']) && $wplc_settings['wplc_enable_font_awesome'] == 1 ) { echo "checked"; } ?> />
253
+ </td>
254
+ </tr>
255
+ <tr>
256
+ <td width='300' valign='top'>
257
+ <?php _e("Enable chat dashboard and notifications on all admin pages","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("This will load the chat dashboard on every admin page.", "wplivechat") ?>"></i>
258
+ </td>
259
+ <td valign='top'>
260
+ <input type="checkbox" value="1" name="wplc_enable_all_admin_pages" <?php if(isset($wplc_settings['wplc_enable_all_admin_pages']) && $wplc_settings['wplc_enable_all_admin_pages'] == 1 ) { echo "checked"; } ?> />
261
+ </td>
262
+ </tr>
263
+
264
+ <?php if (!function_exists("wplc_pro_activate")) { ?>
265
+
266
+ <tr>
267
+ <td width='300' valign='top'>
268
+ <?php _e("Include chat window on the following pages","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Show the chat window on the following pages. Leave blank to show on all. (Use comma-separated Page ID's)", "wplivechat") ?>"></i>
269
+ </td>
270
+ <td valign='top'>
271
+ <input type="text" readonly="readonly" />
272
+ <small>
273
+ <i>
274
+ <?php _e("available in the","wplivechat")?>
275
+ <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=include_pages" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
276
+ <?php _e("only","wplivechat")?>
277
+ </i>
278
+ </small>
279
+ </td>
280
+ </tr>
281
+ <tr>
282
+ <td width='200' valign='top'>
283
+ <?php _e("Exclude chat window on the following pages","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Do not show the chat window on the following pages. Leave blank to show on all. (Use comma-separated Page ID's)", "wplivechat") ?>"></i>
284
+ </td>
285
+ <td valign='top'>
286
+ <input type="text" readonly="readonly"/>
287
+ <small>
288
+ <i>
289
+ <?php _e("available in the","wplivechat")?>
290
+ <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=exclude_pages" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
291
+ <?php _e("only","wplivechat")?>
292
+ </i>
293
+ </small>
294
+ </td>
295
+ </tr>
296
+
297
+ <tr class="wplc-exclude-post-types__row">
298
+ <td width='200' valign='top'>
299
+ <?php _e("Exclude chat window on selected post types","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Do not show the chat window on the following post types pages.", "wplivechat") ?>"></i>
300
+ </td>
301
+ <td valign='top'>
302
+ <input type="text" readonly="readonly"/>
303
+ <small>
304
+ <i>
305
+ <?php _e("available in the","wplivechat")?>
306
+ <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=exclude_pages" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
307
+ <?php _e("only","wplivechat")?>
308
+ </i>
309
+ </small>
310
+ </td>
311
+ </tr>
312
+
313
+ <?php } ?>
314
+ </table>
315
+ <?php do_action('wplc_hook_admin_settings_main_settings_after'); ?>
316
+
317
+
318
+ </div>
319
+ <div id="tabs-2">
320
+ <h3><?php _e("Chat Window Settings",'wplivechat')?></h3>
321
+ <table class='wp-list-table wplc_list_table widefat fixed striped pages'>
322
+ <tr>
323
+ <td width='300' valign='top'><?php _e("Chat box alignment","wplivechat")?>:</td>
324
+ <td>
325
+ <select id='wplc_settings_align' name='wplc_settings_align'>
326
+ <option value="1" <?php if (isset($wplc_settings_align[1])) { echo $wplc_settings_align[1]; } ?>><?php _e("Bottom left","wplivechat"); ?></option>
327
+ <option value="2" <?php if (isset($wplc_settings_align[2])) { echo $wplc_settings_align[2]; } ?>><?php _e("Bottom right","wplivechat"); ?></option>
328
+ <option value="3" <?php if (isset($wplc_settings_align[3])) { echo $wplc_settings_align[3]; } ?>><?php _e("Left","wplivechat"); ?></option>
329
+ <option value="4" <?php if (isset($wplc_settings_align[4])) { echo $wplc_settings_align[4]; } ?>><?php _e("Right","wplivechat"); ?></option>
330
+ </select>
331
+ </td>
332
+ </tr>
333
+ <tr>
334
+ <td width='300'>
335
+ <?php _e("Auto Pop-up","wplivechat") ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Expand the chat box automatically (prompts the user to enter their name and email address).","wplivechat") ?>"></i>
336
+ </td>
337
+ <td>
338
+ <input type="checkbox" name="wplc_auto_pop_up" value="1" <?php if(isset($wplc_settings['wplc_auto_pop_up']) && $wplc_settings['wplc_auto_pop_up'] == 1 ) { echo "checked"; } ?>/>
339
+ </td>
340
+ </tr>
341
+
342
+
343
+
344
+
345
+ <?php if (!function_exists("wplc_pro_activate")) { ?>
346
+ <tr>
347
+ <td width='300'>
348
+ <?php _e("Display typing indicator","wplivechat") ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Display a typing animation as soon as someone starts typing.","wplivechat") ?>"></i>
349
+ </td>
350
+ <td>
351
+ <input type="checkbox" name="" value="" disabled />
352
+ <small>
353
+ <i>
354
+ <?php _e("available in the","wplivechat")?>
355
+ <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=typing" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
356
+ <?php _e("only","wplivechat")?>
357
+ </i>
358
+ </small>
359
+ </td>
360
+ </tr>
361
+ <tr>
362
+ <tr>
363
+
364
+ <td width='300' valign='top'>
365
+ <?php _e("Name","wplivechat")?>:
366
+ </td>
367
+ <td>
368
+ <input type='text' size='50' maxlength='50' disabled readonly value='admin' />
369
+ <small>
370
+ <i>
371
+ <?php _e("available in the","wplivechat")?>
372
+ <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=name" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
373
+ <?php _e("only","wplivechat")?>
374
+ </i>
375
+ </small>
376
+ </td>
377
+ </tr>
378
+ <tr style="display: none;">
379
+ <td width='300'>
380
+ <?php _e("Avatar","wplivechat") ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Choose which picture to use as your avatar.","wplivechat") ?>"></i>
381
+ </td>
382
+ <td>
383
+ <select name="wplc_avatar_source">
384
+ <option value="gravatar" <?php echo (isset($wplc_settings['wplc_avatar_source']) && $wplc_settings['wplc_avatar_source'] == 'gravatar') ? 'selected' : ''; ?>>Gravatar</option>
385
+ <option value="wp_avatar" <?php echo (isset($wplc_settings['wplc_avatar_source']) && $wplc_settings['wplc_avatar_source'] == 'wp_avatar') ? 'selected' : ''; ?>>WP User Avatar</option>
386
+ </select>
387
+ </td>
388
+ </tr>
389
+ <!-- Chat Icon-->
390
+ <tr>
391
+ <td width='300' valign='top'>
392
+ <?php _e("Icon","wplivechat")?>:
393
+ </td>
394
+ <td>
395
+ <input id="wplc_pro_chat_button" type="button" value="<?php _e("Upload Image","wplivechat")?>" readonly disabled />
396
+ <small>
397
+ <i>
398
+ <?php _e("available in the","wplivechat")?>
399
+ <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=pic" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
400
+ <?php _e("only","wplivechat")?>
401
+ </i>
402
+ </small>
403
+ </td>
404
+ </tr>
405
+ <!-- Chat Pic-->
406
+ <tr>
407
+ <td width='300' valign='top'>
408
+ <?php _e("Picture","wplivechat")?>:
409
+ </td>
410
+ <td>
411
+ <input id="wplc_pro_pic_button" type="button" value="<?php _e("Upload Image","wplivechat")?>" readonly disabled />
412
+ <small>
413
+ <i>
414
+ <?php _e("available in the","wplivechat")?>
415
+ <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=pic" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
416
+ <?php _e("only","wplivechat")?>
417
+ </i>
418
+ </small>
419
+ </td>
420
+ </tr>
421
+ <!-- Chat Logo-->
422
+ <tr>
423
+ <td width='300' valign='top'>
424
+ <?php _e("Logo","wplivechat")?>:
425
+ </td>
426
+ <td>
427
+ <input id="wplc_pro_logo_button" type="button" value="<?php _e("Upload Image","wplivechat")?>" readonly disabled />
428
+ <small>
429
+ <i>
430
+ <?php _e("available in the","wplivechat")?>
431
+ <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=pic" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
432
+ <?php _e("only","wplivechat")?>
433
+ </i>
434
+ </small>
435
+ </td>
436
+ </tr>
437
+ <!-- Chat Delay-->
438
+ <tr>
439
+ <td width='300' valign='top'>
440
+ <?php _e("Chat delay (seconds)","wplivechat")?>:
441
+ </td>
442
+ <td>
443
+ <input type='text' size='50' maxlength='50' disabled readonly value='10' />
444
+ <small>
445
+ <i>
446
+ <?php _e("available in the","wplivechat")?>
447
+ <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=delay" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
448
+ <?php _e("only","wplivechat")?>
449
+ </i>
450
+ </small>
451
+ </td>
452
+ </tr>
453
+ <!-- Chat Notification if want to chat-->
454
+ <tr>
455
+ <td width='300' valign='top'>
456
+ <?php _e("Chat notifications", "wplivechat") ?>:
457
+ </td>
458
+ <td>
459
+ <input id='wplc_pro_chat_notification' name='wplc_pro_chat_notification' type='checkbox' value='yes' disabled="disabled" readonly/>
460
+ <?php _e("Alert me via email as soon as someone wants to chat", "wplivechat") ?>
461
+ <small>
462
+ <i>
463
+ <?php _e("available in the", "wplivechat") ?>
464
+ <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=alert" title="<?php _e("Pro Add-on", "wplivechat") ?>" target="_BLANK"><?php _e("Pro Add-on", "wplivechat") ?></a>
465
+ <?php _e("only", "wplivechat") ?>
466
+ </i>
467
+ </small>
468
+ </td>
469
+ </tr>
470
+ <?php } ?>
471
+
472
+ <!-- <tr>
473
+ <td>
474
+ <?php //_e("Display name and avatar in chat", "wplivechat") ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php //_e("Display the agent and user name above each message in the chat window.", "wplivechat") ?>"></i>
475
+ </td>
476
+ <td>
477
+ <input type="checkbox" name="wplc_display_name" value="1" <?php //if (isset($wplc_settings['wplc_display_name']) && $wplc_settings['wplc_display_name'] == 1) {
478
+ //echo "checked";
479
+ //} ?>/>
480
+ </td>
481
+ </tr> -->
482
+ <tr>
483
+ <td>
484
+ <?php _e("Display details in chat message", "wplivechat") ?>
485
+ </td>
486
+ <td> <!-- $wplc_settings['wplc_display_name'] Remember for backwards compat -->
487
+ <?php if (isset($wplc_settings['wplc_show_name']) && $wplc_settings['wplc_show_name'] == 1) { $checked = "checked"; } else { $checked = ''; } ?>
488
+ <input type="checkbox" name="wplc_show_name" value="1" <?php echo $checked; ?>/> <label><?php _e("Show Name", "wplivechat"); ?></label><br/>
489
+ <?php if (isset($wplc_settings['wplc_show_avatar']) && $wplc_settings['wplc_show_avatar'] == 1) { $checked = "checked"; } else { $checked = ''; } ?>
490
+ <input type="checkbox" name="wplc_show_avatar" value="1" <?php echo $checked; ?>/> <label><?php _e("Show Avatar", "wplivechat"); ?></label>
491
+ </td>
492
+ </tr>
493
+ <tr>
494
+ <td>
495
+ <?php _e("Only show the chat window to users that are logged in", "wplivechat") ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("By checking this, only users that are logged in will be able to chat with you.", "wplivechat") ?>"></i>
496
+ </td>
497
+ <td>
498
+ <input type="checkbox" name="wplc_display_to_loggedin_only" value="1" <?php
499
+ if (isset($wplc_settings['wplc_display_to_loggedin_only']) && $wplc_settings['wplc_display_to_loggedin_only'] == 1) {
500
+ echo "checked";
501
+ }
502
+ ?>/>
503
+ </td>
504
+ </tr>
505
+ <tr>
506
+ <td>
507
+ <?php _e("Display a timestamp in the chat window", "wplivechat") ?>
508
+ </td>
509
+ <td>
510
+ <?php if (isset($wplc_settings['wplc_show_date']) && $wplc_settings['wplc_show_date'] == 1) { $checked = "checked"; } else { $checked = ''; } ?>
511
+ <input type="checkbox" name="wplc_show_date" value="1" <?php echo $checked; ?>/> <label><?php _e("Show Date", "wplivechat"); ?></label><br/>
512
+ <?php if (isset($wplc_settings['wplc_show_time']) && $wplc_settings['wplc_show_time'] == 1) { $checked = "checked"; } else { $checked = ''; } ?>
513
+ <input type="checkbox" name="wplc_show_time" value="1" <?php echo $checked; ?>/> <label><?php _e("Show Time", "wplivechat"); ?></label>
514
+ </td>
515
+ </tr>
516
+ <tr>
517
+ <td>
518
+ <?php _e("Redirect user to thank you page when chat is ended", "wplivechat") ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("By checking this, users will be redirected to your thank you page when a chat is completed.", "wplivechat") ?>"></i>
519
+ </td>
520
+ <td>
521
+ <input type="checkbox" name="wplc_redirect_to_thank_you_page" value="1" <?php echo (isset($wplc_settings['wplc_redirect_to_thank_you_page']) && $wplc_settings['wplc_redirect_to_thank_you_page'] == 1 ? "checked" : "" ); ?> />
522
+ <input type="text" name="wplc_redirect_thank_you_url" value="<?php echo (isset($wplc_settings['wplc_redirect_thank_you_url']) ? urldecode($wplc_settings['wplc_redirect_thank_you_url']) : '' ); ?>" placeholder="<?php _e('Thank You Page URL', 'wplivechat'); ?>" />
523
+ </td>
524
+ </tr>
525
+ <?php
526
+ if(defined('WPLC_PRO_PLUGIN'))
527
+ {
528
+ ?>
529
+ <tr>
530
+ <td>
531
+ <?php
532
+ _e('Disable Emojis', 'wplivechat');
533
+ ?>
534
+ </td>
535
+ <td>
536
+ <input type="checkbox" name="wplc_disable_emojis"
537
+ <?php
538
+ if(!empty($wplc_settings['wplc_disable_emojis']))
539
+ echo 'checked="checked"';
540
+ ?>
541
+ />
542
+ </tr>
543
+ <?php
544
+ }
545
+ ?>
546
+ </table>
547
+
548
+ <?php if(!function_exists("wplc_chat_social_div") && !function_exists("wplc_pro_activate")){ ?>
549
+
550
+ <h3><?php _e("Social", 'wplivechat') ?></h3>
551
+ <hr>
552
+ <table class='wp-list-table wplc_list_table widefat fixed striped pages' >
553
+ <tbody>
554
+ <tr>
555
+ <td width='300' valign='top'><?php _e("Facebook URL", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Link your Facebook page here. Leave blank to hide", "wplivechat") ?>"></i></td>
556
+ <td>
557
+ <input id='wplc_social_fb' name='wplc_social_fb' placeholder="<?php _e("Facebook URL...", "wplivechat") ?>" type='text' disabled/>
558
+ <small>
559
+ <i>
560
+ <?php _e("available in the","wplivechat")?>
561
+ <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=social_media" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
562
+ <?php _e("only","wplivechat")?>
563
+ </i>
564
+ </small>
565
+ </td>
566
+ </tr>
567
+ <tr>
568
+ <td width='300' valign='top'><?php _e("Twitter URL", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Link your Twitter page here. Leave blank to hide", "wplivechat") ?>"></i></td>
569
+ <td>
570
+ <input id='wplc_social_tw' name='wplc_social_tw' placeholder="<?php _e("Twitter URL...", "wplivechat") ?>" type='text' disabled/>
571
+ <small>
572
+ <i>
573
+ <?php _e("available in the","wplivechat")?>
574
+ <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=social_media" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
575
+ <?php _e("only","wplivechat")?>
576
+ </i>
577
+ </small>
578
+ </td>
579
+ </tr>
580
+ </tbody>
581
+ </table>
582
+ <?php } ?>
583
+
584
+
585
+
586
+ <?php do_action('wplc_hook_admin_settings_chat_box_settings_after'); ?>
587
+
588
+ </div>
589
+ <div id="tabs-3">
590
+ <h3><?php _e("Offline Messages", 'wplivechat') ?></h3>
591
+ <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='100%'>
592
+ <tr>
593
+ <td width='300'>
594
+ <?php _e("Do not allow users to send offline messages", "wplivechat") ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("The chat window will be hidden when it is offline. Users will not be able to send offline messages to you", "wplivechat") ?>"></i>
595
+ </td>
596
+ <td>
597
+ <input type="checkbox" name="wplc_hide_when_offline" value="1" <?php
598
+ if (isset($wplc_settings['wplc_hide_when_offline']) && $wplc_settings['wplc_hide_when_offline'] == 1) {
599
+ echo "checked";
600
+ }
601
+ ?>/>
602
+ </td>
603
+ </tr>
604
+ <tr>
605
+ <td width="300" valign="top"><?php _e("Offline Chat Box Title", "wplivechat") ?>:</td>
606
+ <td>
607
+ <input id="wplc_pro_na" name="wplc_pro_na" type="text" size="50" maxlength="50" class="regular-text" value="<?php if (isset($wplc_settings['wplc_pro_na'])) { echo stripslashes($wplc_settings['wplc_pro_na']); } ?>" /> <br />
608
+
609
+
610
+ </td>
611
+ </tr>
612
+ <tr>
613
+ <td width="300" valign="top"><?php _e("Offline Text Fields", "wplivechat") ?>:</td>
614
+ <td>
615
+ <input id="wplc_pro_offline1" name="wplc_pro_offline1" type="text" size="50" maxlength="150" class="regular-text" value="<?php if (isset($wplc_settings['wplc_pro_offline1'])) { echo stripslashes($wplc_settings['wplc_pro_offline1']); } ?>" /> <br />
616
+ <input id="wplc_pro_offline2" name="wplc_pro_offline2" type="text" size="50" maxlength="50" class="regular-text" value="<?php if (isset($wplc_settings['wplc_pro_offline2'])) { echo stripslashes($wplc_settings['wplc_pro_offline2']); } ?>" /> <br />
617
+ <input id="wplc_pro_offline3" name="wplc_pro_offline3" type="text" size="50" maxlength="150" class="regular-text" value="<?php if (isset($wplc_settings['wplc_pro_offline3'])) { echo stripslashes($wplc_settings['wplc_pro_offline3']); } ?>" /> <br />
618
+
619
+
620
+ </td>
621
+ </tr>
622
+ <tr>
623
+ <td width="300" valign="top"><?php _e("Offline Button Text", "wplivechat") ?>:</td>
624
+ <td>
625
+ <input id="wplc_pro_offline_btn" name="wplc_pro_offline_btn" type="text" size="50" maxlength="50" class="regular-text" value="<?php if (isset($wplc_settings['wplc_pro_offline_btn'])) { echo stripslashes($wplc_settings['wplc_pro_offline_btn']); } ?>" /> <br />
626
+ </td>
627
+ </tr>
628
+ <tr>
629
+ <td width="300" valign="top"><?php _e("Offline Send Button Text", "wplivechat") ?>:</td>
630
+ <td>
631
+ <input id="wplc_pro_offline_btn_send" name="wplc_pro_offline_btn_send" type="text" size="50" maxlength="50" class="regular-text" value="<?php if (isset($wplc_settings['wplc_pro_offline_btn_send'])) { echo stripslashes($wplc_settings['wplc_pro_offline_btn_send']); } ?>" /> <br />
632
+ </td>
633
+ </tr>
634
+ <tr>
635
+ <td width="300" valign="top"><?php _e("Custom fields", "wplivechat") ?>:</td>
636
+ <td>
637
+ <?php do_action( "wplc_hook_offline_custom_fields_integration_settings" ); ?>
638
+ </td>
639
+ </tr>
640
+
641
+ </table>
642
+
643
+ <h4><?php _e("Email settings", 'wplivechat') ?></h4>
644
+
645
+
646
+ <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages'>
647
+ <tr>
648
+ <td width='300' valign='top'>
649
+ <?php _e("Email Address", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Email address where offline messages are delivered to. Use comma separated email addresses to send to more than one email address", "wplivechat") ?>"></i>
650
+ </td>
651
+ <td>
652
+ <input id="wplc_pro_chat_email_address" name="wplc_pro_chat_email_address" class="regular-text" type="text" value="<?php if (isset($wplc_settings['wplc_pro_chat_email_address'])) {
653
+ echo $wplc_settings['wplc_pro_chat_email_address']; } ?>" />
654
+ </td>
655
+ </tr>
656
+
657
+ <tr>
658
+ <td width='300' valign='top'>
659
+ <?php _e("Subject", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("User name will be appended to the end of the subject.", "wplivechat") ?>"></i>
660
+ </td>
661
+ <td>
662
+ <input id="wplc_pro_chat_email_offline_subject" name="wplc_pro_chat_email_offline_subject" class="regular-text" type="text" value="<?php echo(isset($wplc_settings['wplc_pro_chat_email_offline_subject']) ? $wplc_settings['wplc_pro_chat_email_offline_subject'] : ""); ?>" placeholder="<?php echo __("WP Live Chat Support - Offline Message from ", "wplivechat"); ?>"/>
663
+ </td>
664
+ </tr>
665
+
666
+ </table>
667
+
668
+ <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages'>
669
+ <tr>
670
+ <td width="33%"><?php _e("Sending Method", "wplivechat") ?></td>
671
+ <td width="33%" style="text-align: center;"><?php _e("WP Mail", "wplivechat") ?></td>
672
+ <td width="33%" style="text-align: center;"><?php _e("PHP Mailer", "wplivechat") ?></td>
673
+ </tr>
674
+ <tr>
675
+ <td></td>
676
+ <td style="text-align: center;"><input class="wplc_mail_type_radio" type="radio" value="wp_mail" name="wplc_mail_type" <?php if ($wplc_mail_type == "wp_mail") {
677
+ echo "checked";
678
+ } ?>></td>
679
+ <td style="text-align: center;"><input id="wpcl_mail_type_php" class="wplc_mail_type_radio" type="radio" value="php_mailer" name="wplc_mail_type" <?php if ($wplc_mail_type == "php_mailer") {
680
+ echo "checked";
681
+ } ?>></td>
682
+ </tr>
683
+ </table>
684
+ <hr/>
685
+ <table id="wplc_smtp_details" class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='100%'>
686
+ <tr>
687
+ <td width="300" valign="top">
688
+ <?php _e("Host", "wplivechat") ?>:
689
+ </td>
690
+ <td>
691
+ <input id="wplc_mail_host" name="wplc_mail_host" type="text" class="regular-text" value="<?php echo get_option("wplc_mail_host") ?>" placeholder="smtp.example.com" />
692
+ </td>
693
+ </tr>
694
+ <tr>
695
+ <td>
696
+ <?php _e("Port", "wplivechat") ?>:
697
+ </td>
698
+ <td>
699
+ <input id="wplc_mail_port" name="wplc_mail_port" type="text" class="regular-text" value="<?php echo get_option("wplc_mail_port") ?>" placeholder="25" />
700
+ </td>
701
+ </tr>
702
+ <tr>
703
+ <td>
704
+ <?php _e("Username", "wplivechat") ?>:
705
+ </td>
706
+ <td>
707
+ <input id="wplc_mail_username" name="wplc_mail_username" type="text" class="regular-text" value="<?php echo get_option("wplc_mail_username") ?>" placeholder="me@example.com" />
708
+ </td>
709
+ </tr>
710
+ <tr>
711
+ <td>
712
+ <?php _e("Password", "wplivechat") ?>:
713
+ </td>
714
+ <td>
715
+ <input id="wplc_mail_password" name="wplc_mail_password" type="password" class="regular-text" value="<?php echo get_option("wplc_mail_password") ?>" placeholder="Password" />
716
+ </td>
717
+ </tr>
718
+ </table>
719
+ <?php do_action('wplc_hook_admin_settings_offline_messages_settings_after'); ?>
720
+ </div>
721
+
722
+
723
+
724
+ <div id="tabs-4">
725
+ <style>
726
+ .wplc_theme_block img{
727
+ border: 1px solid #CCC;
728
+ border-radius: 5px;
729
+ padding: 5px;
730
+ margin: 5px;
731
+ }
732
+ .wplc_theme_single{
733
+ width: 162px;
734
+ height: 162px;
735
+ text-align: center;
736
+ display: inline-block;
737
+ vertical-align: top;
738
+ margin: 5px;
739
+ }
740
+ .wplc_animation_block div{
741
+ display: inline-block;
742
+ width: 150px;
743
+ height: 150px;
744
+ border: 1px solid #CCC;
745
+ border-radius: 5px;
746
+ text-align: center;
747
+ margin: 10px;
748
+ }
749
+ .wplc_animation_block i{
750
+ font-size: 3em;
751
+ line-height: 150px;
752
+ }
753
+ .wplc_animation_block .wplc_red{
754
+ color: #E31230;
755
+ }
756
+ .wplc_animation_block .wplc_orange{
757
+ color: #EB832C;
758
+ }
759
+ .wplc_animation_active, .wplc_theme_active{
760
+ box-shadow: 2px 2px 2px #666666;
761
+ }
762
+ </style>
763
+ <style>
764
+ .wplc_animation_block div{
765
+ display: inline-block;
766
+ width: 150px;
767
+ height: 150px;
768
+ border: 1px solid #CCC;
769
+ border-radius: 5px;
770
+ text-align: center;
771
+ margin: 10px;
772
+ }
773
+ .wplc_animation_block i{
774
+ font-size: 3em;
775
+ line-height: 150px;
776
+ }
777
+ .wplc_animation_block .wplc_red{
778
+ color: #E31230;
779
+ }
780
+ .wplc_animation_block .wplc_orange{
781
+ color: #EB832C;
782
+ }
783
+ .wplc_animation_active{
784
+ box-shadow: 2px 2px 2px #CCC;
785
+ }
786
+ </style>
787
+ <h3><?php _e("Styling",'wplivechat')?></h3>
788
+ <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages'>
789
+
790
+
791
+ <tr style='margin-bottom: 10px;'>
792
+ <td width='200'><label for=""><?php _e('Choose a theme', 'wplivechat'); ?></label></td>
793
+ <td>
794
+ <div class='wplc_theme_block'>
795
+ <div class='wplc_theme_image' id=''>
796
+ <div class='wplc_theme_single'>
797
+ <img style='width:162px;' src='<?php echo WPLC_BASIC_PLUGIN_URL.'images/themes/newtheme-1.jpg'; ?>' title="<?php _e('Classic', 'wplivechat'); ?>" alt="<?php _e('Classic', 'wplivechat'); ?>" class='<?php if (isset($wplc_settings['wplc_newtheme']) && $wplc_settings['wplc_newtheme'] == 'theme-1') { echo 'wplc_theme_active'; } ?>' id='wplc_newtheme_1'/>
798
+ <?php _e('Classic', 'wplivechat'); ?>
799
+ </div>
800
+ <div class='wplc_theme_single'>
801
+ <img style='width:162px;' src='<?php echo WPLC_BASIC_PLUGIN_URL.'images/themes/newtheme-2.jpg'; ?>' title="<?php _e('Modern', 'wplivechat'); ?>" alt="<?php _e('Modern', 'wplivechat'); ?>" class='<?php if (isset($wplc_settings['wplc_newtheme']) && $wplc_settings['wplc_newtheme'] == 'theme-2') { echo 'wplc_theme_active'; } ?>' id='wplc_newtheme_2'/>
802
+ <?php _e('Modern', 'wplivechat'); ?>
803
+ </div>
804
+
805
+ </div>
806
+ </div>
807
+ <input type="radio" name="wplc_newtheme" value="theme-1" class="wplc_hide_input" id="wplc_new_rb_theme_1" <?php if (isset($wplc_settings['wplc_newtheme']) && $wplc_settings['wplc_newtheme'] == 'theme-1') { echo 'checked'; } ?>/>
808
+ <input type="radio" name="wplc_newtheme" value="theme-2" class="wplc_hide_input" id="wplc_new_rb_theme_2" <?php if (isset($wplc_settings['wplc_newtheme']) && $wplc_settings['wplc_newtheme'] == 'theme-2') { echo 'checked'; } ?>/>
809
+
810
+ </td>
811
+ </tr>
812
+ <tr height="30">
813
+ <td>&nbsp;</td>
814
+ <td>&nbsp;</td>
815
+ </tr>
816
+
817
+ <tr style='margin-bottom: 10px;'>
818
+ <td><label for=""><?php _e('Color Scheme', 'wplivechat'); ?></label></td>
819
+ <td>
820
+ <div class='wplc_theme_block'>
821
+ <div class='wplc_palette'>
822
+ <div class='wplc_palette_single'>
823
+ <div class='wplc-palette-selection <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-default') { echo 'wplc_theme_active'; } ?>' id='wplc_theme_default'>
824
+ <div class='wplc-palette-top' style='background-color:#ED832F;'></div>
825
+ <div class='wplc-palette-top' style='background-color:#FFF;'></div>
826
+ <div class='wplc-palette-top' style='background-color:#EEE;'></div>
827
+ <div class='wplc-palette-top' style='background-color:#666;'></div>
828
+ </div>
829
+ </div>
830
+
831
+ <div class='wplc_palette_single'>
832
+ <div class='wplc-palette-selection <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-1') { echo 'wplc_theme_active'; } ?>' id='wplc_theme_1'>
833
+ <div class='wplc-palette-top' style='background-color:#DB0000;'></div>
834
+ <div class='wplc-palette-top' style='background-color:#FFF;'></div>
835
+ <div class='wplc-palette-top' style='background-color:#000;'></div>
836
+ <div class='wplc-palette-top' style='background-color:#666;'></div>
837
+ </div>
838
+ </div>
839
+ <div class='wplc_palette_single'>
840
+ <div class='wplc-palette-selection <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-2') { echo 'wplc_theme_active'; } ?>' id='wplc_theme_2'>
841
+ <div class='wplc-palette-top' style='background-color:#000;'></div>
842
+ <div class='wplc-palette-top' style='background-color:#FFF;'></div>
843
+ <div class='wplc-palette-top' style='background-color:#888;'></div>
844
+ <div class='wplc-palette-top' style='background-color:#666;'></div>
845
+ </div>
846
+ </div>
847
+ <div class='wplc_palette_single'>
848
+ <div class='wplc-palette-selection <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-3') { echo 'wplc_theme_active'; } ?>' id='wplc_theme_3'>
849
+ <div class='wplc-palette-top' style='background-color:#B97B9D;'></div>
850
+ <div class='wplc-palette-top' style='background-color:#FFF;'></div>
851
+ <div class='wplc-palette-top' style='background-color:#EEE;'></div>
852
+ <div class='wplc-palette-top' style='background-color:#5A0031;'></div>
853
+ </div>
854
+ </div>
855
+ <div class='wplc_palette_single'>
856
+ <div class='wplc-palette-selection <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-4') { echo 'wplc_theme_active'; } ?>' id='wplc_theme_4'>
857
+ <div class='wplc-palette-top' style='background-color:#1A14DB;'></div>
858
+ <div class='wplc-palette-top' style='background-color:#FDFDFF;'></div>
859
+ <div class='wplc-palette-top' style='background-color:#7F7FB3;'></div>
860
+ <div class='wplc-palette-top' style='background-color:#666;'></div>
861
+ </div>
862
+ </div>
863
+ <div class='wplc_palette_single'>
864
+ <div class='wplc-palette-selection <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-5') { echo 'wplc_theme_active'; } ?>' id='wplc_theme_5'>
865
+ <div class='wplc-palette-top' style='background-color:#3DCC13;'></div>
866
+ <div class='wplc-palette-top' style='background-color:#FDFDFF;'></div>
867
+ <div class='wplc-palette-top' style='background-color:#EEE;'></div>
868
+ <div class='wplc-palette-top' style='background-color:#666;'></div>
869
+ </div>
870
+ </div>
871
+ <div class='wplc_palette_single'>
872
+ <div class='wplc-palette-selection <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-6') { echo 'wplc_theme_active'; } ?>' id='wplc_theme_6'>
873
+ <div class='wplc-palette-top' style='padding-top:3px'><?php _e("Choose","wplivechat"); ?></div>
874
+ <div class='wplc-palette-top' style='padding-top:3px'><?php _e("Your","wplivechat"); ?></div>
875
+ <div class='wplc-palette-top' style='padding-top:3px'><?php _e("Colors","wplivechat"); ?></div>
876
+ <div class='wplc-palette-top' style='padding-top:3px'><?php _e("Below","wplivechat"); ?></div>
877
+ </div>
878
+ </div>
879
+
880
+
881
+ </div>
882
+ </div>
883
+ <input type="radio" name="wplc_theme" value="theme-default" class="wplc_hide_input" id="wplc_rb_theme_default" <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-default') { echo 'checked'; } ?>/>
884
+ <input type="radio" name="wplc_theme" value="theme-1" class="wplc_hide_input" id="wplc_rb_theme_1" <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-1') { echo 'checked'; } ?>/>
885
+ <input type="radio" name="wplc_theme" value="theme-2" class="wplc_hide_input" id="wplc_rb_theme_2" <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-2') { echo 'checked'; } ?>/>
886
+ <input type="radio" name="wplc_theme" value="theme-3" class="wplc_hide_input" id="wplc_rb_theme_3" <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-3') { echo 'checked'; } ?>/>
887
+ <input type="radio" name="wplc_theme" value="theme-4" class="wplc_hide_input" id="wplc_rb_theme_4" <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-4') { echo 'checked'; } ?>/>
888
+ <input type="radio" name="wplc_theme" value="theme-5" class="wplc_hide_input" id="wplc_rb_theme_5" <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-5') { echo 'checked'; } ?>/>
889
+ <input type="radio" name="wplc_theme" value="theme-6" class="wplc_hide_input" id="wplc_rb_theme_6" <?php if (isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-6') { echo 'checked'; } ?>/>
890
+
891
+ </td>
892
+ </tr>
893
+
894
+ <tr>
895
+ <td width='300' valign='top'><?php _e("Chat background","wplivechat")?>:</td>
896
+ <td>
897
+
898
+ <select id='wplc_settings_bg' name='wplc_settings_bg'>
899
+ <option value="cloudy.jpg" <?php if (!isset($wplc_settings['wplc_settings_bg']) || ($wplc_settings['wplc_settings_bg'] == "cloudy.jpg") ) { echo "selected"; } ?>><?php _e("Cloudy","wplivechat"); ?></option>
900
+ <option value="geometry.jpg" <?php if (isset($wplc_settings['wplc_settings_bg']) && $wplc_settings['wplc_settings_bg'] == "geometry.jpg") { echo "selected"; } ?>><?php _e("Geometry","wplivechat"); ?></option>
901
+ <option value="tech.jpg" <?php if (isset($wplc_settings['wplc_settings_bg']) && $wplc_settings['wplc_settings_bg'] == "tech.jpg") { echo "selected"; } ?>><?php _e("Tech","wplivechat"); ?></option>
902
+ <option value="social.jpg" <?php if (isset($wplc_settings['wplc_settings_bg']) && $wplc_settings['wplc_settings_bg'] == "social.jpg") { echo "selected"; } ?>><?php _e("Social","wplivechat"); ?></option>
903
+ <option value="0" <?php if (isset($wplc_settings['wplc_settings_bg']) && $wplc_settings['wplc_settings_bg'] == "0") { echo "selected"; } ?>><?php _e("None","wplivechat"); ?></option>
904
+ </select>
905
+ </td>
906
+ </tr>
907
+ <tr>
908
+ <td width='200' valign='top'><?php _e("Palette Color 1","wplivechat")?>:</td>
909
+ <td>
910
+ <input id="wplc_settings_color1" name="wplc_settings_color1" type="text" class="color" value="<?php if (isset($wplc_settings_color1)) { echo $wplc_settings_color1; } else { echo 'ED832F'; } ?>" />
911
+ </td>
912
+ </tr>
913
+ <tr>
914
+ <td width='200' valign='top'><?php _e("Palette Color 2","wplivechat")?>:</td>
915
+ <td>
916
+ <input id="wplc_settings_color2" name="wplc_settings_color2" type="text" class="color" value="<?php if (isset($wplc_settings_color2)) { echo $wplc_settings_color2; } else { echo 'FFFFFF'; } ?>" />
917
+ </td>
918
+ </tr>
919
+ <tr>
920
+ <td width='200' valign='top'><?php _e("Palette Color 3","wplivechat")?>:</td>
921
+ <td>
922
+ <input id="wplc_settings_color3" name="wplc_settings_color3" type="text" class="color" value="<?php if (isset($wplc_settings_color3)) { echo $wplc_settings_color3; } else { echo 'EEEEEE'; } ?>" />
923
+ </td>
924
+ </tr>
925
+ <tr>
926
+ <td width='200' valign='top'><?php _e("Palette Color 4","wplivechat")?>:</td>
927
+ <td>
928
+ <input id="wplc_settings_color4" name="wplc_settings_color4" type="text" class="color" value="<?php if (isset($wplc_settings_color4)) { echo $wplc_settings_color4; } else { echo '666666'; } ?>" />
929
+ </td>
930
+ </tr>
931
+
932
+ <tr>
933
+ <td width="200" valign="top"><?php _e("I'm using a localization plugin", "wplivechat") ?></td>
934
+ <td>
935
+ <input type="checkbox" name="wplc_using_localization_plugin" id="wplc_using_localization_plugin" value="1" <?php if (isset($wplc_settings['wplc_using_localization_plugin']) && $wplc_settings['wplc_using_localization_plugin'] == 1) { echo 'checked'; } ?>/>
936
+ <br/><small><?php echo sprintf( __("Enable this if you are using a localization plugin. Should you wish to change the below strings with this option enabled, please visit the documentation %s", "wplivechat"), "<a href='https://wp-livechat.com/documentation/changing-strings-in-the-chat-window-when-using-a-localization-plugin/' target='_BLANK'>".__("here", "wplivechat") ); ?></small>
937
+ </td>
938
+ </tr>
939
+
940
+ <tr style='height:30px;'><td></td><td></td></tr>
941
+ <tr class="wplc_localization_strings">
942
+ <td width="200" valign="top"><?php _e("First Section Text", "wplivechat") ?>:</td>
943
+ <td>
944
+ <input id="wplc_pro_fst1" name="wplc_pro_fst1" type="text" size="50" maxlength="50" class="regular-text" value="<?php echo stripslashes($wplc_settings['wplc_pro_fst1']) ?>" /> <br />
945
+ <input id="wplc_pro_fst2" name="wplc_pro_fst2" type="text" size="50" maxlength="50" class="regular-text" value="<?php echo stripslashes($wplc_settings['wplc_pro_fst2']) ?>" /> <br />
946
+ </td>
947
+ </tr>
948
+ <tr class="wplc_localization_strings">
949
+ <td width="200" valign="top"><?php _e("Intro Text", "wplivechat") ?>:</td>
950
+ <td>
951
+ <input id="wplc_pro_intro" name="wplc_pro_intro" type="text" size="50" maxlength="150" class="regular-text" value="<?php echo stripslashes($wplc_settings['wplc_pro_intro']) ?>" /> <br />
952
+ </td>
953
+ </tr>
954
+ <tr class="wplc_localization_strings">
955
+ <td width="200" valign="top"><?php _e("Second Section Text", "wplivechat") ?>:</td>
956
+ <td>
957
+ <input id="wplc_pro_sst1" name="wplc_pro_sst1" type="text" size="50" maxlength="30" class="regular-text" value="<?php echo stripslashes($wplc_settings['wplc_pro_sst1']) ?>" /> <br />
958
+ <input id="wplc_pro_sst2" name="wplc_pro_sst2" type="text" size="50" maxlength="70" class="regular-text" value="<?php echo stripslashes($wplc_settings['wplc_pro_sst2']) ?>" /> <br />
959
+ </td>
960
+ </tr>
961
+ <tr class="wplc_localization_strings">
962
+ <td width="200" valign="top"><?php _e("Reactivate Chat Section Text", "wplivechat") ?>:</td>
963
+ <td>
964
+ <input id="wplc_pro_tst1" name="wplc_pro_tst1" type="text" size="50" maxlength="50" class="regular-text" value="<?php echo stripslashes($wplc_settings['wplc_pro_tst1']) ?>" /> <br />
965
+
966
+
967
+ </td>
968
+ </tr>
969
+ <?php /* removed as this has been replaced with the "welcome_msg" below
970
+ <tr class="wplc_localization_strings">
971
+ <td width="200" valign="top"><?php _e("User chat welcome", "wplivechat") ?>:</td>
972
+ <td>
973
+ <input id="wplc_user_welcome_chat" name="wplc_user_welcome_chat" type="text" size="50" maxlength="150" class="regular-text" value="<?php echo stripslashes($wplc_settings['wplc_user_welcome_chat']) ?>" /> <br />
974
+ </td>
975
+ </tr>
976
+ */ ?>
977
+ <tr class="wplc_localization_strings">
978
+ <td width="200" valign="top"><?php _e("Welcome message", "wplivechat") ?>:</td>
979
+ <td>
980
+ <input id="wplc_welcome_msg" name="wplc_welcome_msg" type="text" size="50" maxlength="350" class="regular-text" value="<?php echo stripslashes($wplc_settings['wplc_welcome_msg']) ?>" /> <span class='description'><?php _e('This text is shown as soon as a user starts a chat and waits for an agent to join', 'wplivechat'); ?></span><br />
981
+ </td>
982
+ </tr>
983
+ <tr class="wplc_localization_strings">
984
+ <td width="200" valign="top"><?php _e("No answer", "wplivechat") ?>:</td>
985
+ <td>
986
+ <input id="wplc_user_no_answer" name="wplc_user_no_answer" type="text" size="50" maxlength="150" class="regular-text" value="<?php echo (isset($wplc_settings['wplc_user_no_answer']) ? stripslashes($wplc_settings['wplc_user_no_answer']) : __("There is No Answer. Please Try Again Later.","wplivechat")); ?>" /> <span class='description'><?php _e('This text is shown to the user when an agent has failed to answer a chat ', 'wplivechat'); ?></span><br />
987
+ </td>
988
+ </tr>
989
+ <tr class="wplc_localization_strings">
990
+ <td width="200" valign="top"><?php _e("Other text", "wplivechat") ?>:</td>
991
+ <td>
992
+ <input id="wplc_user_enter" name="wplc_user_enter" type="text" size="50" maxlength="150" class="regular-text" value="<?php echo stripslashes($wplc_settings['wplc_user_enter']) ?>" /><br />
993
+ <input id="wplc_text_chat_ended" name="wplc_text_chat_ended" type="text" size="50" maxlength="150" class="regular-text" value="<?php echo ( empty( $wplc_settings['wplc_text_chat_ended'] ) ) ? stripslashes(__("The chat has been ended by the operator.", "wplivechat")) : stripslashes( $wplc_settings['wplc_text_chat_ended'] ) ?>" /> <br />
994
+ </td>
995
+ </tr>
996
+ <!--
997
+ <tr class="wplc_localization_strings">
998
+ <td width="200" valign="top"><?php _e("Close Button Text", "wplivechat") ?>:</td>
999
+ <td>
1000
+ <input id="wplc_close_btn_text" name="wplc_close_btn_text" type="text" size="50" maxlength="150" class="regular-text" value="<?php echo stripslashes($wplc_settings['wplc_close_btn_text']) ?>" /><br />
1001
+ </td>
1002
+ </tr>
1003
+ -->
1004
+
1005
+ <tr>
1006
+ <th><label for=""><?php _e('Choose an animation', 'wplivechat'); ?></label></th>
1007
+
1008
+ <td>
1009
+ <div class='wplc_animation_block'>
1010
+ <div class='wplc_animation_image <?php if (isset($wplc_settings['wplc_animation']) && $wplc_settings['wplc_animation'] == 'animation-1') {
1011
+ echo 'wplc_animation_active';
1012
+ } ?>' id='wplc_animation_1'>
1013
+ <i class="fa fa-arrow-circle-up wplc_orange"></i>
1014
+ <p><?php _e('Slide Up', 'wplivechat'); ?></p>
1015
+ </div>
1016
+ <div class='wplc_animation_image <?php if (isset($wplc_settings['wplc_animation']) && $wplc_settings['wplc_animation'] == 'animation-2') {
1017
+ echo 'wplc_animation_active';
1018
+ } ?>' id='wplc_animation_2'>
1019
+ <i class="fa fa-arrows-h wplc_red"></i>
1020
+ <p><?php _e('Slide From The Side', 'wplivechat'); ?></p>
1021
+ </div>
1022
+ <div class='wplc_animation_image <?php if (isset($wplc_settings['wplc_animation']) && $wplc_settings['wplc_animation'] == 'animation-3') {
1023
+ echo 'wplc_animation_active';
1024
+ } ?>' id='wplc_animation_3'>
1025
+ <i class="fa fa-arrows-alt wplc_orange"></i>
1026
+ <p><?php _e('Fade In', 'wplivechat'); ?></p>
1027
+ </div>
1028
+ <div class='wplc_animation_image <?php if ((isset($wplc_settings['wplc_animation']) && $wplc_settings['wplc_animation'] == 'animation-4') || !isset($wplc_settings['wplc_animation'])) {
1029
+ echo 'wplc_animation_active';
1030
+ } ?>' id='wplc_animation_4'>
1031
+ <i class="fa fa-thumb-tack wplc_red"></i>
1032
+ <p><?php _e('No Animation', 'wplivechat'); ?></p>
1033
+ </div>
1034
+ </div>
1035
+ <input type="radio" name="wplc_animation" value="animation-1" class="wplc_hide_input" id="wplc_rb_animation_1" class='wplc_hide_input' <?php if (isset($wplc_settings['wplc_animation']) && $wplc_settings['wplc_animation'] == 'animation-1') {
1036
+ echo 'checked';
1037
+ } ?>/>
1038
+ <input type="radio" name="wplc_animation" value="animation-2" class="wplc_hide_input" id="wplc_rb_animation_2" class='wplc_hide_input' <?php if (isset($wplc_settings['wplc_animation']) && $wplc_settings['wplc_animation'] == 'animation-2') {
1039
+ echo 'checked';
1040
+ } ?>/>
1041
+ <input type="radio" name="wplc_animation" value="animation-3" class="wplc_hide_input" id="wplc_rb_animation_3" class='wplc_hide_input' <?php if (isset($wplc_settings['wplc_animation']) && $wplc_settings['wplc_animation'] == 'animation-3') {
1042
+ echo 'checked';
1043
+ } ?>/>
1044
+ <input type="radio" name="wplc_animation" value="animation-4" class="wplc_hide_input" id="wplc_rb_animation_4" class='wplc_hide_input' <?php if (isset($wplc_settings['wplc_animation']) && $wplc_settings['wplc_animation'] == 'animation-4') {
1045
+ echo 'checked';
1046
+ } ?>/>
1047
+ </td>
1048
+ </tr>
1049
+ </table>
1050
+ </div>
1051
+ <div id="tabs-5">
1052
+
1053
+
1054
+ <?php do_action("wplc_hook_agents_settings"); ?>
1055
+
1056
+
1057
+ </div>
1058
+ <div id="tabs-7">
1059
+ <h3><?php _e("Blocked Visitors - Based on IP Address", "wplivechat") ?></h3>
1060
+ <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='100%'>
1061
+ <tr>
1062
+ <td>
1063
+ <textarea name="wplc_ban_users_ip" style="width: 50%; min-height: 200px;" placeholder="<?php _e('Enter each IP Address you would like to block on a new line', 'wplivechat'); ?>" autocomplete="false"><?php
1064
+ $ip_addresses = get_option('WPLC_BANNED_IP_ADDRESSES');
1065
+ if($ip_addresses){
1066
+ $ip_addresses = maybe_unserialize($ip_addresses);
1067
+ if ($ip_addresses && is_array($ip_addresses)) {
1068
+ foreach($ip_addresses as $ip){
1069
+ echo $ip."\n";
1070
+ }
1071
+ }
1072
+ }
1073
+ ?></textarea>
1074
+ <p class="description"><?php _e('Blocking a user\'s IP Address here will hide the chat window from them, preventing them from chatting with you. Each IP Address must be on a new line', 'wplivechat'); ?></p>
1075
+ </td>
1076
+ </tr>
1077
+ </table>
1078
+ </div>
1079
+
1080
+
1081
+
1082
+ <?php do_action("wplc_hook_settings_page_more_tabs"); ?>
1083
+
1084
+ </div>
1085
+ <p class='submit'><input type='submit' name='wplc_save_settings' class='button-primary' value='<?php _e("Save Settings","wplivechat")?>' /></p>
1086
+ </form>
1087
+
1088
+ </div>
1089
+
1090
+
includes/shortcodes.php CHANGED
@@ -1,29 +1,29 @@
1
- <?php
2
-
3
- add_filter("init","wplc_test",10,4);
4
-
5
- function wplc_test() {
6
- add_shortcode('wplc_live_chat', 'wplc_live_chat_box_shortcode');
7
- }
8
-
9
- function wplc_live_chat_box_shortcode( $atts, $content = null ) {
10
- $wplc_settings = get_option("WPLC_SETTINGS");
11
- $logged_in = apply_filters("wplc_loggedin_filter",false);
12
- $wplc_using_locale = (isset($wplc_settings['wplc_using_localization_plugin']) && $wplc_settings['wplc_using_localization_plugin'] == 1) ? true : false;
13
-
14
- $wplc_chat_box_content = wplc_theme_control_function($wplc_settings, $logged_in, $wplc_using_locale, $_COOKIE['wplc_cid']);
15
-
16
- // get attributes
17
- $atts = shortcode_atts(
18
- array(
19
- 'style' => 'normal'
20
- ),
21
- $atts,
22
- 'wplc_live_chat'
23
- );
24
-
25
- $output = '<div class="wplc_live_chat_support_shortcode wplc_' . $atts['style'] . '">';
26
- $output .= $wplc_chat_box_content;
27
- $output .= '</div">';
28
- return $output;
29
  }
1
+ <?php
2
+
3
+ add_filter("init","wplc_test",10,4);
4
+
5
+ function wplc_test() {
6
+ add_shortcode('wplc_live_chat', 'wplc_live_chat_box_shortcode');
7
+ }
8
+
9
+ function wplc_live_chat_box_shortcode( $atts, $content = null ) {
10
+ $wplc_settings = get_option("WPLC_SETTINGS");
11
+ $logged_in = apply_filters("wplc_loggedin_filter",false);
12
+ $wplc_using_locale = (isset($wplc_settings['wplc_using_localization_plugin']) && $wplc_settings['wplc_using_localization_plugin'] == 1) ? true : false;
13
+
14
+ $wplc_chat_box_content = wplc_theme_control_function($wplc_settings, $logged_in, $wplc_using_locale, $_COOKIE['wplc_cid']);
15
+
16
+ // get attributes
17
+ $atts = shortcode_atts(
18
+ array(
19
+ 'style' => 'normal'
20
+ ),
21
+ $atts,
22
+ 'wplc_live_chat'
23
+ );
24
+
25
+ $output = '<div class="wplc_live_chat_support_shortcode wplc_' . $atts['style'] . '">';
26
+ $output .= $wplc_chat_box_content;
27
+ $output .= '</div">';
28
+ return $output;
29
  }
includes/update_control.class.php CHANGED
@@ -66,7 +66,7 @@ final class wplc_update_control {
66
  return $checked_data;
67
 
68
  if ( empty( $checked_data->checked[$this->wplc_api_slug . '/' . $this->wplc_api_slug . '.php'] ) ) {
69
- $plugin_data = get_plugin_data( trailingslashit( dirname( __FILE__, 3 ) ) . $this->wplc_api_slug . '/' . $this->wplc_api_slug . '.php' );
70
  if ( ! empty( $plugin_data['Version'] ) ) {
71
  $version = $plugin_data['Version'];
72
  } else {
66
  return $checked_data;
67
 
68
  if ( empty( $checked_data->checked[$this->wplc_api_slug . '/' . $this->wplc_api_slug . '.php'] ) ) {
69
+ $plugin_data = get_plugin_data( trailingslashit( dirname( dirname( dirname( __FILE__ ) ) ) ) . $this->wplc_api_slug . '/' . $this->wplc_api_slug . '.php' );
70
  if ( ! empty( $plugin_data['Version'] ) ) {
71
  $version = $plugin_data['Version'];
72
  } else {
includes/welcome_page.php CHANGED
@@ -1,160 +1,160 @@
1
- <?php //global $wpgmza_global_array; ?>
2
- <div class="wrap about-wrap">
3
- <p>&nbsp;</p>
4
- <h1 style='margin-right: 0;'><?php _e("Welcome to WP Live Chat Support v8","wplivechat"); ?> <div class="wplc-badge" style=' float: right; display: block; max-width: 20%; margin-left: 15%;'><img src='<?php echo WPLC_BASIC_PLUGIN_URL . "images/wplc-logo.png"; ?>' /></div></h1>
5
-
6
- <div class="about-text"><?php _e("WP Live Chat Support is the most cost effective, feature rich, amazingly supported and most positively reviewed live chat plugin on WordPress!","wplivechat"); ?></div>
7
-
8
- <a class="button-primary" style='padding:5px; padding-right:15px; padding-left:15px; height:inherit;' href="admin.php?page=wplivechat-menu&override=1"><?php echo __("Skip intro and start accepting chats","wplivechat"); ?></a>
9
- <p>&nbsp;</p>
10
-
11
- <?php
12
-
13
- if( !isset( $_GET['action'] ) ){
14
- $welcome_active = 'nav-tab-active';
15
- $credits_active = '';
16
- } else {
17
- if( $_GET['action'] == 'welcome' ){
18
- $welcome_active = 'nav-tab-active';
19
- $credits_active = '';
20
- } else if( $_GET['action'] == 'credits' ){
21
- $credits_active = 'nav-tab-active';
22
- $welcome_active = '';
23
- }
24
- }
25
-
26
- ?>
27
- <h2 class="nav-tab-wrapper wp-clearfix">
28
- <a href="admin.php?page=wplivechat-menu&action=welcome" class="nav-tab <?php echo $welcome_active; ?>"><?php _e("Welcome","wplivechat"); ?></a>
29
- <a href="admin.php?page=wplivechat-menu&action=credits" class="nav-tab <?php echo $credits_active; ?>"><?php _e("Credits","wplivechat"); ?></a>
30
-
31
- </h2>
32
- <?php if( !isset( $_GET['action'] ) || ( isset( $_GET['action'] ) && $_GET['action'] == 'welcome' ) ){ ?>
33
- <h2>What's new in Version 8?</h2>
34
- <center><img src='<?php echo WPLC_BASIC_PLUGIN_URL; ?>/images/performance.png' style='width:300px;' /></center>
35
- <div class="feature-section three-col">
36
- <div class="col">
37
- <div style='text-align: center;' ><i class="fa-4x fa fa-bolt" aria-hidden="true"></i><br/><h4><?php _e("Incredibly fast server","wplivechat"); ?></h4></div>
38
-
39
- <p style='text-align: center;'><?php _e("Use our server to handle the load and save 1000%+ on server resources!","wplivechat"); ?></p>
40
- </div>
41
- <div class="col">
42
- <div style='text-align: center;' ><i class="fa-4x fa fa-dashboard" aria-hidden="true"></i><br/><h4><?php _e("New Dashboard","wplivechat"); ?></h4></div>
43
- <p style='text-align: center;'><?php _e("Handle all your chats in one area, on any admin page.","wplivechat"); ?></p>
44
- </div>
45
- <div class="col">
46
- <div style='text-align: center;' ><i class="fa-4x far fa-smile" aria-hidden="true"></i><br/><h4><?php _e("Emojis!","wplivechat"); ?></h4></div>
47
- <p style='text-align: center;'><?php _e("Add a touch of your own personality with emojis!","wplivechat"); ?></p>
48
- </div>
49
- </div>
50
-
51
- <h2>New Pro features</h2>
52
- <div class="feature-section three-col">
53
- <div class="col">
54
- <div style='text-align: center;' ><i class="fa-4x fa fa-commenting-o" aria-hidden="true"></i><br/><h4><?php _e("Typing Preview","wplivechat"); ?></h4></div>
55
-
56
- <p style='text-align: center;'><?php _e("See what your customers are typing before they even send it!","wplivechat"); ?></p>
57
- </div>
58
- <div class="col">
59
- <div style='text-align: center;' ><i class="fa-4x fa fa-users" aria-hidden="true"></i><br/><h4><?php _e("Multiple Agents Per Chat","wplivechat"); ?></h4></div>
60
-
61
- <p style='text-align: center;'><?php _e("More than one agent can join and be involved in a chat.","wplivechat"); ?></p>
62
- </div>
63
- <div class="col">
64
- <div style='text-align: center;' ><i class="fa-4x fa fa-random" aria-hidden="true"></i><br/><h4><?php _e("Agent to Agent Chat","wplivechat"); ?></h4></div>
65
-
66
- <p style='text-align: center;'><?php _e( "Chat directly to other agents on our new dashboard.","wplivechat"); ?></p>
67
- </div>
68
- </div>
69
- <div class="feature-section three-col">
70
- <div class="col">
71
- <div style='text-align: center;' ><i class="fa-4x fa fa-eraser" aria-hidden="true"></i><br/><h4><?php _e("Edit Messages","wplivechat"); ?></h4></div>
72
-
73
- <p style='text-align: center;'><?php _e("Simply press the UP arrow or use the EDIT link to edit a message that you have already sent.","wplivechat"); ?></p>
74
- </div>
75
- <div class="col">
76
- <div style='text-align: center;' ><i class="fa-4x fa fa-heartbeat" aria-hidden="true"></i><br/><h4><?php _e("Event Monitoring","wplivechat"); ?></h4></div>
77
-
78
- <p style='text-align: center;'><?php _e("Know exactly what the user is doing in real time.","wplivechat"); ?></p>
79
- </div>
80
- <div class="col">
81
- <div style='text-align: center;' ><i class="fa-4x fa fa-apple" aria-hidden="true"></i><br/><h4><?php _e("iOS app","wplivechat"); ?></h4></div>
82
-
83
- <p style='text-align: center;'><?php _e( "The new iOS app is finally here!","wplivechat"); ?></p>
84
- </div>
85
- </div>
86
-
87
- <hr />
88
-
89
- <div class="feature-section normal clear" >
90
- <div class="changelog ">
91
- <!--<h2 style="font-size: 25px; text-align: left;"><?php _e('How did you find us?', 'wplivechat'); ?></h2>
92
- <form method="post" name="wplc_find_us_form" style="font-size: 16px;">
93
- <div style="text-align: left; width:275px;">
94
- <input type="radio" name="wplc_find_us" id="wordpress" value='repository'>
95
- <label for="wordpress">
96
- <?php _e('WordPress.org plugin repository ', 'wplivechat'); ?>
97
- </label>
98
- <br/>
99
- <input type='text' placeholder="<?php _e('Search Term', 'wplivechat'); ?>" name='wplc_nl_search_term' style='margin-top:5px; margin-left: 23px; width: 100% '>
100
- <br/>
101
- <input type="radio" name="wplc_find_us" id="search_engine" value='search_engine'>
102
- <label for="search_engine">
103
- <?php _e('Google or other search Engine', 'wplivechat'); ?>
104
- </label>
105
- <br/>
106
- <input type="radio" name="wplc_find_us" id="friend" value='friend'>
107
-
108
- <label for='friend'>
109
- <?php _e('Friend recommendation', 'wplivechat'); ?>
110
- </label>
111
- <br/>
112
- <input type="radio" name="wplc_find_us" id='other' value='other'>
113
-
114
- <label for='other'>
115
- <?php _e('Other', 'wplivechat'); ?>
116
- </label>
117
- <br/>
118
-
119
- <textarea placeholder="<?php _e('Please Explain', 'wplivechat'); ?>" style='margin-top:5px; margin-left: 23px; width: 100%' name='wplc_nl_findus_other_url'></textarea>
120
- </div>
121
- <div>
122
-
123
- </div>
124
- <div>
125
-
126
- </div>
127
- <div style='margin-top: 20px;'>
128
- <button name='action' value='wplc_submit_find_us' class="button-primary" style=""><?php _e('Submit', 'wplivechat'); ?></button> <a href='<?php echo admin_url("/admin.php?page=wplivechat-menu&override=1"); ?>'class="button"><?php _e('Skip', 'wplivechat'); ?></a>
129
- </div>
130
- </form>
131
- <br/><br/>
132
-
133
- <hr /> -->
134
-
135
- <div class="feature-section three-col">
136
- <div class='col'>
137
- <h4><?php _e("New to WP Live Chat Support?","wplivechat"); ?></h4>
138
- <p><?php _e("You may want to","wp-google-maps"); ?> <a href='https://wp-livechat.com/documentation/' target='_blank' title='Documentation'><?php _e("review our documentation","wplivechat"); ?></a> <?php _e("before you get started. If you're a tech-savvy individual, you may skip this step.","wplivechat"); ?></p>
139
- </div>
140
- <div class='col'>
141
- <h4><?php _e("Help me!","wplivechat"); ?></h4>
142
- <p><?php _e("Visit our","wplivechat"); ?> <a title='Support Desk' target='_blank' href='https://wp-livechat.com/contact-us/'><?php _e("Support Desk","wplivechat"); ?></a> <?php _e("for quick and friendly help. We'll answer your request within 24hours.","wplivechat"); ?></p>
143
- </div>
144
- <div class='col'>
145
- <h4><?php _e("Feedback","wp-google-maps"); ?></h4>
146
- <p><?php _e("We need you to help us make this plugin better.","wplivechat"); ?> <a href='https://wp-livechat.com/contact-us/' title='Feedback' target='_BLANK'><?php _e("Send us your feedback","wplivechat"); ?></a> <?php _e("and we'll act on it as soon as humanly possible.","wplivechat"); ?></p>
147
- </div>
148
- </div>
149
-
150
- <a class="button-primary" style='padding:5px; padding-right:15px; padding-left:15px; height:inherit;' href="admin.php?page=wplivechat-menu&override=1"><?php echo __("OK! Let's start","wplivechat"); ?></a>
151
-
152
- </div>
153
- </div>
154
-
155
- </div>
156
- <?php } else {
157
- $path = plugin_dir_path(__FILE__).'credits.php';
158
- include $path;
159
- }
160
  ?>
1
+ <?php //global $wpgmza_global_array; ?>
2
+ <div class="wrap about-wrap">
3
+ <p>&nbsp;</p>
4
+ <h1 style='margin-right: 0;'><?php _e("Welcome to WP Live Chat Support v8","wplivechat"); ?> <div class="wplc-badge" style=' float: right; display: block; max-width: 20%; margin-left: 15%;'><img src='<?php echo WPLC_BASIC_PLUGIN_URL . "images/wplc-logo.png"; ?>' /></div></h1>
5
+
6
+ <div class="about-text"><?php _e("WP Live Chat Support is the most cost effective, feature rich, amazingly supported and most positively reviewed live chat plugin on WordPress!","wplivechat"); ?></div>
7
+
8
+ <a class="button-primary" style='padding:5px; padding-right:15px; padding-left:15px; height:inherit;' href="admin.php?page=wplivechat-menu&override=1"><?php echo __("Skip intro and start accepting chats","wplivechat"); ?></a>
9
+ <p>&nbsp;</p>
10
+
11
+ <?php
12
+
13
+ if( !isset( $_GET['action'] ) ){
14
+ $welcome_active = 'nav-tab-active';
15
+ $credits_active = '';
16
+ } else {
17
+ if( $_GET['action'] == 'welcome' ){
18
+ $welcome_active = 'nav-tab-active';
19
+ $credits_active = '';
20
+ } else if( $_GET['action'] == 'credits' ){
21
+ $credits_active = 'nav-tab-active';
22
+ $welcome_active = '';
23
+ }
24
+ }
25
+
26
+ ?>
27
+ <h2 class="nav-tab-wrapper wp-clearfix">
28
+ <a href="admin.php?page=wplivechat-menu&action=welcome" class="nav-tab <?php echo $welcome_active; ?>"><?php _e("Welcome","wplivechat"); ?></a>
29
+ <a href="admin.php?page=wplivechat-menu&action=credits" class="nav-tab <?php echo $credits_active; ?>"><?php _e("Credits","wplivechat"); ?></a>
30
+
31
+ </h2>
32
+ <?php if( !isset( $_GET['action'] ) || ( isset( $_GET['action'] ) && $_GET['action'] == 'welcome' ) ){ ?>
33
+ <h2>What's new in Version 8?</h2>
34
+ <center><img src='<?php echo WPLC_BASIC_PLUGIN_URL; ?>/images/performance.png' style='width:300px;' /></center>
35
+ <div class="feature-section three-col">
36
+ <div class="col">
37
+ <div style='text-align: center;' ><i class="fa-4x fa fa-bolt" aria-hidden="true"></i><br/><h4><?php _e("Incredibly fast server","wplivechat"); ?></h4></div>
38
+
39
+ <p style='text-align: center;'><?php _e("Use our server to handle the load and save 1000%+ on server resources!","wplivechat"); ?></p>
40
+ </div>
41
+ <div class="col">
42
+ <div style='text-align: center;' ><i class="fa-4x fa fa-dashboard" aria-hidden="true"></i><br/><h4><?php _e("New Dashboard","wplivechat"); ?></h4></div>
43
+ <p style='text-align: center;'><?php _e("Handle all your chats in one area, on any admin page.","wplivechat"); ?></p>
44
+ </div>
45
+ <div class="col">
46
+ <div style='text-align: center;' ><i class="fa-4x far fa-smile" aria-hidden="true"></i><br/><h4><?php _e("Emojis!","wplivechat"); ?></h4></div>
47
+ <p style='text-align: center;'><?php _e("Add a touch of your own personality with emojis!","wplivechat"); ?></p>
48
+ </div>
49
+ </div>
50
+
51
+ <h2>New Pro features</h2>
52
+ <div class="feature-section three-col">
53
+ <div class="col">
54
+ <div style='text-align: center;' ><i class="fa-4x fa fa-commenting-o" aria-hidden="true"></i><br/><h4><?php _e("Typing Preview","wplivechat"); ?></h4></div>
55
+
56
+ <p style='text-align: center;'><?php _e("See what your customers are typing before they even send it!","wplivechat"); ?></p>
57
+ </div>
58
+ <div class="col">
59
+ <div style='text-align: center;' ><i class="fa-4x fa fa-users" aria-hidden="true"></i><br/><h4><?php _e("Multiple Agents Per Chat","wplivechat"); ?></h4></div>
60
+
61
+ <p style='text-align: center;'><?php _e("More than one agent can join and be involved in a chat.","wplivechat"); ?></p>
62
+ </div>
63
+ <div class="col">
64
+ <div style='text-align: center;' ><i class="fa-4x fa fa-random" aria-hidden="true"></i><br/><h4><?php _e("Agent to Agent Chat","wplivechat"); ?></h4></div>
65
+
66
+ <p style='text-align: center;'><?php _e( "Chat directly to other agents on our new dashboard.","wplivechat"); ?></p>
67
+ </div>
68
+ </div>
69
+ <div class="feature-section three-col">
70
+ <div class="col">
71
+ <div style='text-align: center;' ><i class="fa-4x fa fa-eraser" aria-hidden="true"></i><br/><h4><?php _e("Edit Messages","wplivechat"); ?></h4></div>
72
+
73
+ <p style='text-align: center;'><?php _e("Simply press the UP arrow or use the EDIT link to edit a message that you have already sent.","wplivechat"); ?></p>
74
+ </div>
75
+ <div class="col">
76
+ <div style='text-align: center;' ><i class="fa-4x fa fa-heartbeat" aria-hidden="true"></i><br/><h4><?php _e("Event Monitoring","wplivechat"); ?></h4></div>
77
+
78
+ <p style='text-align: center;'><?php _e("Know exactly what the user is doing in real time.","wplivechat"); ?></p>
79
+ </div>
80
+ <div class="col">
81
+ <div style='text-align: center;' ><i class="fa-4x fa fa-apple" aria-hidden="true"></i><br/><h4><?php _e("iOS app","wplivechat"); ?></h4></div>
82
+
83
+ <p style='text-align: center;'><?php _e( "The new iOS app is finally here!","wplivechat"); ?></p>
84
+ </div>
85
+ </div>
86
+
87
+ <hr />
88
+
89
+ <div class="feature-section normal clear" >
90
+ <div class="changelog ">
91
+ <!--<h2 style="font-size: 25px; text-align: left;"><?php _e('How did you find us?', 'wplivechat'); ?></h2>
92
+ <form method="post" name="wplc_find_us_form" style="font-size: 16px;">
93
+ <div style="text-align: left; width:275px;">
94
+ <input type="radio" name="wplc_find_us" id="wordpress" value='repository'>
95
+ <label for="wordpress">
96
+ <?php _e('WordPress.org plugin repository ', 'wplivechat'); ?>
97
+ </label>
98
+ <br/>
99
+ <input type='text' placeholder="<?php _e('Search Term', 'wplivechat'); ?>" name='wplc_nl_search_term' style='margin-top:5px; margin-left: 23px; width: 100% '>
100
+ <br/>
101
+ <input type="radio" name="wplc_find_us" id="search_engine" value='search_engine'>
102
+ <label for="search_engine">
103
+ <?php _e('Google or other search Engine', 'wplivechat'); ?>
104
+ </label>
105
+ <br/>
106
+ <input type="radio" name="wplc_find_us" id="friend" value='friend'>
107
+
108
+ <label for='friend'>
109
+ <?php _e('Friend recommendation', 'wplivechat'); ?>
110
+ </label>
111
+ <br/>
112
+ <input type="radio" name="wplc_find_us" id='other' value='other'>
113
+
114
+ <label for='other'>
115
+ <?php _e('Other', 'wplivechat'); ?>
116
+ </label>
117
+ <br/>
118
+
119
+ <textarea placeholder="<?php _e('Please Explain', 'wplivechat'); ?>" style='margin-top:5px; margin-left: 23px; width: 100%' name='wplc_nl_findus_other_url'></textarea>
120
+ </div>
121
+ <div>
122
+
123
+ </div>
124
+ <div>
125
+
126
+ </div>
127
+ <div style='margin-top: 20px;'>
128
+ <button name='action' value='wplc_submit_find_us' class="button-primary" style=""><?php _e('Submit', 'wplivechat'); ?></button> <a href='<?php echo admin_url("/admin.php?page=wplivechat-menu&override=1"); ?>'class="button"><?php _e('Skip', 'wplivechat'); ?></a>
129
+ </div>
130
+ </form>
131
+ <br/><br/>
132
+
133
+ <hr /> -->
134
+
135
+ <div class="feature-section three-col">
136
+ <div class='col'>
137
+ <h4><?php _e("New to WP Live Chat Support?","wplivechat"); ?></h4>
138
+ <p><?php _e("You may want to","wp-google-maps"); ?> <a href='https://wp-livechat.com/documentation/' target='_blank' title='Documentation'><?php _e("review our documentation","wplivechat"); ?></a> <?php _e("before you get started. If you're a tech-savvy individual, you may skip this step.","wplivechat"); ?></p>
139
+ </div>
140
+ <div class='col'>
141
+ <h4><?php _e("Help me!","wplivechat"); ?></h4>
142
+ <p><?php _e("Visit our","wplivechat"); ?> <a title='Support Desk' target='_blank' href='https://wp-livechat.com/contact-us/'><?php _e("Support Desk","wplivechat"); ?></a> <?php _e("for quick and friendly help. We'll answer your request within 24hours.","wplivechat"); ?></p>
143
+ </div>
144
+ <div class='col'>
145
+ <h4><?php _e("Feedback","wp-google-maps"); ?></h4>
146
+ <p><?php _e("We need you to help us make this plugin better.","wplivechat"); ?> <a href='https://wp-livechat.com/contact-us/' title='Feedback' target='_BLANK'><?php _e("Send us your feedback","wplivechat"); ?></a> <?php _e("and we'll act on it as soon as humanly possible.","wplivechat"); ?></p>
147
+ </div>
148
+ </div>
149
+
150
+ <a class="button-primary" style='padding:5px; padding-right:15px; padding-left:15px; height:inherit;' href="admin.php?page=wplivechat-menu&override=1"><?php echo __("OK! Let's start","wplivechat"); ?></a>
151
+
152
+ </div>
153
+ </div>
154
+
155
+ </div>
156
+ <?php } else {
157
+ $path = plugin_dir_path(__FILE__).'credits.php';
158
+ include $path;
159
+ }
160
  ?>
js/ace.js CHANGED
@@ -1,134 +1,134 @@
1
- /* ***** BEGIN LICENSE BLOCK *****
2
- * Distributed under the BSD license:
3
- *
4
- * Copyright (c) 2010, Ajax.org B.V.
5
- * All rights reserved.
6
- *
7
- * Redistribution and use in source and binary forms, with or without
8
- * modification, are permitted provided that the following conditions are met:
9
- * * Redistributions of source code must retain the above copyright
10
- * notice, this list of conditions and the following disclaimer.
11
- * * Redistributions in binary form must reproduce the above copyright
12
- * notice, this list of conditions and the following disclaimer in the
13
- * documentation and/or other materials provided with the distribution.
14
- * * Neither the name of Ajax.org B.V. nor the
15
- * names of its contributors may be used to endorse or promote products
16
- * derived from this software without specific prior written permission.
17
- *
18
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
22
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
- *
29
- * ***** END LICENSE BLOCK ***** */
30
-
31
- /**
32
- * The main class required to set up an Ace instance in the browser.
33
- *
34
- * @class Ace
35
- **/
36
-
37
- define(function(require, exports, module) {
38
- "use strict";
39
-
40
- require("./lib/fixoldbrowsers");
41
-
42
- var dom = require("./lib/dom");
43
- var event = require("./lib/event");
44
-
45
- var Editor = require("./editor").Editor;
46
- var EditSession = require("./edit_session").EditSession;
47
- var UndoManager = require("./undomanager").UndoManager;
48
- var Renderer = require("./virtual_renderer").VirtualRenderer;
49
-
50
- // The following require()s are for inclusion in the built ace file
51
- require("./worker/worker_client");
52
- require("./keyboard/hash_handler");
53
- require("./placeholder");
54
- require("./multi_select");
55
- require("./mode/folding/fold_mode");
56
- require("./theme/textmate");
57
- require("./ext/error_marker");
58
-
59
- exports.config = require("./config");
60
-
61
-
62
- /**
63
- * Provides access to require in packed noconflict mode
64
- * @param {String} moduleName
65
- * @returns {Object}
66
- **/
67
- exports.require = require;
68
- define = 'bob';
69
-
70
- if (typeof define === "function")
71
- exports.define = define;
72
-
73
- /**
74
- * Embeds the Ace editor into the DOM, at the element provided by `el`.
75
- * @param {String | DOMElement} el Either the id of an element, or the element itself
76
- * @param {Object } options Options for the editor
77
- *
78
- **/
79
- exports.edit = function(el, options) {
80
- if (typeof el == "string") {
81
- var _id = el;
82
- el = document.getElementById(_id);
83
- if (!el)
84
- throw new Error("ace.edit can't find div #" + _id);
85
- }
86
-
87
- if (el && el.env && el.env.editor instanceof Editor)
88
- return el.env.editor;
89
-
90
- var value = "";
91
- if (el && /input|textarea/i.test(el.tagName)) {
92
- var oldNode = el;
93
- value = oldNode.value;
94
- el = dom.createElement("pre");
95
- oldNode.parentNode.replaceChild(el, oldNode);
96
- } else if (el) {
97
- value = dom.getInnerText(el);
98
- el.innerHTML = "";
99
- }
100
-
101
- var doc = exports.createEditSession(value);
102
-
103
- var editor = new Editor(new Renderer(el), doc, options);
104
-
105
- var env = {
106
- document: doc,
107
- editor: editor,
108
- onResize: editor.resize.bind(editor, null)
109
- };
110
- if (oldNode) env.textarea = oldNode;
111
- event.addListener(window, "resize", env.onResize);
112
- editor.on("destroy", function() {
113
- event.removeListener(window, "resize", env.onResize);
114
- env.editor.container.env = null; // prevent memory leak on old ie
115
- });
116
- editor.container.env = editor.env = env;
117
- return editor;
118
- };
119
-
120
- /**
121
- * Creates a new [[EditSession]], and returns the associated [[Document]].
122
- * @param {Document | String} text {:textParam}
123
- * @param {TextMode} mode {:modeParam}
124
- *
125
- **/
126
- exports.createEditSession = function(text, mode) {
127
- var doc = new EditSession(text, mode);
128
- doc.setUndoManager(new UndoManager());
129
- return doc;
130
- };
131
- exports.EditSession = EditSession;
132
- exports.UndoManager = UndoManager;
133
- exports.version = "1.2.9";
134
- });
1
+ /* ***** BEGIN LICENSE BLOCK *****
2
+ * Distributed under the BSD license:
3
+ *
4
+ * Copyright (c) 2010, Ajax.org B.V.
5
+ * All rights reserved.
6
+ *
7
+ * Redistribution and use in source and binary forms, with or without
8
+ * modification, are permitted provided that the following conditions are met:
9
+ * * Redistributions of source code must retain the above copyright
10
+ * notice, this list of conditions and the following disclaimer.
11
+ * * Redistributions in binary form must reproduce the above copyright
12
+ * notice, this list of conditions and the following disclaimer in the
13
+ * documentation and/or other materials provided with the distribution.
14
+ * * Neither the name of Ajax.org B.V. nor the
15
+ * names of its contributors may be used to endorse or promote products
16
+ * derived from this software without specific prior written permission.
17
+ *
18
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
22
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
+ *
29
+ * ***** END LICENSE BLOCK ***** */
30
+
31
+ /**
32
+ * The main class required to set up an Ace instance in the browser.
33
+ *
34
+ * @class Ace
35
+ **/
36
+
37
+ define(function(require, exports, module) {
38
+ "use strict";
39
+
40
+ require("./lib/fixoldbrowsers");
41
+
42
+ var dom = require("./lib/dom");
43
+ var event = require("./lib/event");
44
+
45
+ var Editor = require("./editor").Editor;
46
+ var EditSession = require("./edit_session").EditSession;
47
+ var UndoManager = require("./undomanager").UndoManager;
48
+ var Renderer = require("./virtual_renderer").VirtualRenderer;
49
+
50
+ // The following require()s are for inclusion in the built ace file
51
+ require("./worker/worker_client");
52
+ require("./keyboard/hash_handler");
53
+ require("./placeholder");
54
+ require("./multi_select");
55
+ require("./mode/folding/fold_mode");
56
+ require("./theme/textmate");
57
+ require("./ext/error_marker");
58
+
59
+ exports.config = require("./config");
60
+
61
+
62
+ /**
63
+ * Provides access to require in packed noconflict mode
64
+ * @param {String} moduleName
65
+ * @returns {Object}
66
+ **/
67
+ exports.require = require;
68
+ define = 'bob';
69
+
70
+ if (typeof define === "function")
71
+ exports.define = define;
72
+
73
+ /**
74
+ * Embeds the Ace editor into the DOM, at the element provided by `el`.
75
+ * @param {String | DOMElement} el Either the id of an element, or the element itself
76
+ * @param {Object } options Options for the editor
77
+ *
78
+ **/
79
+ exports.edit = function(el, options) {
80
+ if (typeof el == "string") {
81
+ var _id = el;
82
+ el = document.getElementById(_id);
83
+ if (!el)
84
+ throw new Error("ace.edit can't find div #" + _id);
85
+ }
86
+
87
+ if (el && el.env && el.env.editor instanceof Editor)
88
+ return el.env.editor;
89
+
90
+ var value = "";
91
+ if (el && /input|textarea/i.test(el.tagName)) {
92
+ var oldNode = el;
93
+ value = oldNode.value;
94
+ el = dom.createElement("pre");
95
+ oldNode.parentNode.replaceChild(el, oldNode);
96
+ } else if (el) {
97
+ value = dom.getInnerText(el);
98
+ el.innerHTML = "";
99
+ }
100
+
101
+ var doc = exports.createEditSession(value);
102
+
103
+ var editor = new Editor(new Renderer(el), doc, options);
104
+
105
+ var env = {
106
+ document: doc,
107
+ editor: editor,
108
+ onResize: editor.resize.bind(editor, null)
109
+ };
110
+ if (oldNode) env.textarea = oldNode;
111
+ event.addListener(window, "resize", env.onResize);
112
+ editor.on("destroy", function() {
113
+ event.removeListener(window, "resize", env.onResize);
114
+ env.editor.container.env = null; // prevent memory leak on old ie
115
+ });
116
+ editor.container.env = editor.env = env;
117
+ return editor;
118
+ };
119
+
120
+ /**
121
+ * Creates a new [[EditSession]], and returns the associated [[Document]].
122
+ * @param {Document | String} text {:textParam}
123
+ * @param {TextMode} mode {:modeParam}
124
+ *
125
+ **/
126
+ exports.createEditSession = function(text, mode) {
127
+ var doc = new EditSession(text, mode);
128
+ doc.setUndoManager(new UndoManager());
129
+ return doc;
130
+ };
131
+ exports.EditSession = EditSession;
132
+ exports.UndoManager = UndoManager;
133
+ exports.version = "1.2.9";
134
+ });
js/fontawesome-iconpicker.js CHANGED
@@ -1,1025 +1,1025 @@
1
- (function(a) {
2
- if (typeof define === "function" && define.amd) {
3
- define([ "jquery" ], a);
4
- } else {
5
- a(jQuery);
6
- }
7
- })(function(a) {
8
- a.ui = a.ui || {};
9
- var b = a.ui.version = "1.12.1";
10
- (function() {
11
- var b, c = Math.max, d = Math.abs, e = /left|center|right/, f = /top|center|bottom/, g = /[\+\-]\d+(\.[\d]+)?%?/, h = /^\w+/, i = /%$/, j = a.fn.pos;
12
- function k(a, b, c) {
13
- return [ parseFloat(a[0]) * (i.test(a[0]) ? b / 100 : 1), parseFloat(a[1]) * (i.test(a[1]) ? c / 100 : 1) ];
14
- }
15
- function l(b, c) {
16
- return parseInt(a.css(b, c), 10) || 0;
17
- }
18
- function m(b) {
19
- var c = b[0];
20
- if (c.nodeType === 9) {
21
- return {
22
- width: b.width(),
23
- height: b.height(),
24
- offset: {
25
- top: 0,
26
- left: 0
27
- }
28
- };
29
- }
30
- if (a.isWindow(c)) {
31
- return {
32
- width: b.width(),
33
- height: b.height(),
34
- offset: {
35
- top: b.scrollTop(),
36
- left: b.scrollLeft()
37
- }
38
- };
39
- }
40
- if (c.preventDefault) {
41
- return {
42
- width: 0,
43
- height: 0,
44
- offset: {
45
- top: c.pageY,
46
- left: c.pageX
47
- }
48
- };
49
- }
50
- return {
51
- width: b.outerWidth(),
52
- height: b.outerHeight(),
53
- offset: b.offset()
54
- };
55
- }
56
- a.pos = {
57
- scrollbarWidth: function() {
58
- if (b !== undefined) {
59
- return b;
60
- }
61
- var c, d, e = a("<div " + "style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'>" + "<div style='height:100px;width:auto;'></div></div>"), f = e.children()[0];
62
- a("body").append(e);
63
- c = f.offsetWidth;
64
- e.css("overflow", "scroll");
65
- d = f.offsetWidth;
66
- if (c === d) {
67
- d = e[0].clientWidth;
68
- }
69
- e.remove();
70
- return b = c - d;
71
- },
72
- getScrollInfo: function(b) {
73
- var c = b.isWindow || b.isDocument ? "" : b.element.css("overflow-x"), d = b.isWindow || b.isDocument ? "" : b.element.css("overflow-y"), e = c === "scroll" || c === "auto" && b.width < b.element[0].scrollWidth, f = d === "scroll" || d === "auto" && b.height < b.element[0].scrollHeight;
74
- return {
75
- width: f ? a.pos.scrollbarWidth() : 0,
76
- height: e ? a.pos.scrollbarWidth() : 0
77
- };
78
- },
79
- getWithinInfo: function(b) {
80
- var c = a(b || window), d = a.isWindow(c[0]), e = !!c[0] && c[0].nodeType === 9, f = !d && !e;
81
- return {
82
- element: c,
83
- isWindow: d,
84
- isDocument: e,
85
- offset: f ? a(b).offset() : {
86
- left: 0,
87
- top: 0
88
- },
89
- scrollLeft: c.scrollLeft(),
90
- scrollTop: c.scrollTop(),
91
- width: c.outerWidth(),
92
- height: c.outerHeight()
93
- };
94
- }
95
- };
96
- a.fn.pos = function(b) {
97
- if (!b || !b.of) {
98
- return j.apply(this, arguments);
99
- }
100
- b = a.extend({}, b);
101
- var i, n, o, p, q, r, s = a(b.of), t = a.pos.getWithinInfo(b.within), u = a.pos.getScrollInfo(t), v = (b.collision || "flip").split(" "), w = {};
102
- r = m(s);
103
- if (s[0].preventDefault) {
104
- b.at = "left top";
105
- }
106
- n = r.width;
107
- o = r.height;
108
- p = r.offset;
109
- q = a.extend({}, p);
110
- a.each([ "my", "at" ], function() {
111
- var a = (b[this] || "").split(" "), c, d;
112
- if (a.length === 1) {
113
- a = e.test(a[0]) ? a.concat([ "center" ]) : f.test(a[0]) ? [ "center" ].concat(a) : [ "center", "center" ];
114
- }
115
- a[0] = e.test(a[0]) ? a[0] : "center";
116
- a[1] = f.test(a[1]) ? a[1] : "center";
117
- c = g.exec(a[0]);
118
- d = g.exec(a[1]);
119
- w[this] = [ c ? c[0] : 0, d ? d[0] : 0 ];
120
- b[this] = [ h.exec(a[0])[0], h.exec(a[1])[0] ];
121
- });
122
- if (v.length === 1) {
123
- v[1] = v[0];
124
- }
125
- if (b.at[0] === "right") {
126
- q.left += n;
127
- } else if (b.at[0] === "center") {
128
- q.left += n / 2;
129
- }
130
- if (b.at[1] === "bottom") {
131
- q.top += o;
132
- } else if (b.at[1] === "center") {
133
- q.top += o / 2;
134
- }
135
- i = k(w.at, n, o);
136
- q.left += i[0];
137
- q.top += i[1];
138
- return this.each(function() {
139
- var e, f, g = a(this), h = g.outerWidth(), j = g.outerHeight(), m = l(this, "marginLeft"), r = l(this, "marginTop"), x = h + m + l(this, "marginRight") + u.width, y = j + r + l(this, "marginBottom") + u.height, z = a.extend({}, q), A = k(w.my, g.outerWidth(), g.outerHeight());
140
- if (b.my[0] === "right") {
141
- z.left -= h;
142
- } else if (b.my[0] === "center") {
143
- z.left -= h / 2;
144
- }
145
- if (b.my[1] === "bottom") {
146
- z.top -= j;
147
- } else if (b.my[1] === "center") {
148
- z.top -= j / 2;
149
- }
150
- z.left += A[0];
151
- z.top += A[1];
152
- e = {
153
- marginLeft: m,
154
- marginTop: r
155
- };
156
- a.each([ "left", "top" ], function(c, d) {
157
- if (a.ui.pos[v[c]]) {
158
- a.ui.pos[v[c]][d](z, {
159
- targetWidth: n,
160
- targetHeight: o,
161
- elemWidth: h,
162
- elemHeight: j,
163
- collisionPosition: e,
164
- collisionWidth: x,
165
- collisionHeight: y,
166
- offset: [ i[0] + A[0], i[1] + A[1] ],
167
- my: b.my,
168
- at: b.at,
169
- within: t,
170
- elem: g
171
- });
172
- }
173
- });
174
- if (b.using) {
175
- f = function(a) {
176
- var e = p.left - z.left, f = e + n - h, i = p.top - z.top, k = i + o - j, l = {
177
- target: {
178
- element: s,
179
- left: p.left,
180
- top: p.top,
181
- width: n,
182
- height: o
183
- },
184
- element: {
185
- element: g,
186
- left: z.left,
187
- top: z.top,
188
- width: h,
189
- height: j
190
- },
191
- horizontal: f < 0 ? "left" : e > 0 ? "right" : "center",
192
- vertical: k < 0 ? "top" : i > 0 ? "bottom" : "middle"
193
- };
194
- if (n < h && d(e + f) < n) {
195
- l.horizontal = "center";
196
- }
197
- if (o < j && d(i + k) < o) {
198
- l.vertical = "middle";
199
- }
200
- if (c(d(e), d(f)) > c(d(i), d(k))) {
201
- l.important = "horizontal";
202
- } else {
203
- l.important = "vertical";
204
- }
205
- b.using.call(this, a, l);
206
- };
207
- }
208
- g.offset(a.extend(z, {
209
- using: f
210
- }));
211
- });
212
- };
213
- a.ui.pos = {
214
- _trigger: function(a, b, c, d) {
215
- if (b.elem) {
216
- b.elem.trigger({
217
- type: c,
218
- position: a,
219
- positionData: b,
220
- triggered: d
221
- });
222
- }
223
- },
224
- fit: {
225
- left: function(b, d) {
226
- a.ui.pos._trigger(b, d, "posCollide", "fitLeft");
227
- var e = d.within, f = e.isWindow ? e.scrollLeft : e.offset.left, g = e.width, h = b.left - d.collisionPosition.marginLeft, i = f - h, j = h + d.collisionWidth - g - f, k;
228
- if (d.collisionWidth > g) {
229
- if (i > 0 && j <= 0) {
230
- k = b.left + i + d.collisionWidth - g - f;
231
- b.left += i - k;
232
- } else if (j > 0 && i <= 0) {
233
- b.left = f;
234
- } else {
235
- if (i > j) {
236
- b.left = f + g - d.collisionWidth;
237
- } else {
238
- b.left = f;
239
- }
240
- }
241
- } else if (i > 0) {
242
- b.left += i;
243
- } else if (j > 0) {
244
- b.left -= j;
245
- } else {
246
- b.left = c(b.left - h, b.left);
247
- }
248
- a.ui.pos._trigger(b, d, "posCollided", "fitLeft");
249
- },
250
- top: function(b, d) {
251
- a.ui.pos._trigger(b, d, "posCollide", "fitTop");
252
- var e = d.within, f = e.isWindow ? e.scrollTop : e.offset.top, g = d.within.height, h = b.top - d.collisionPosition.marginTop, i = f - h, j = h + d.collisionHeight - g - f, k;
253
- if (d.collisionHeight > g) {
254
- if (i > 0 && j <= 0) {
255
- k = b.top + i + d.collisionHeight - g - f;
256
- b.top += i - k;
257
- } else if (j > 0 && i <= 0) {
258
- b.top = f;
259
- } else {
260
- if (i > j) {
261
- b.top = f + g - d.collisionHeight;
262
- } else {
263
- b.top = f;
264
- }
265
- }
266
- } else if (i > 0) {
267
- b.top += i;
268
- } else if (j > 0) {
269
- b.top -= j;
270
- } else {
271
- b.top = c(b.top - h, b.top);
272
- }
273
- a.ui.pos._trigger(b, d, "posCollided", "fitTop");
274
- }
275
- },
276
- flip: {
277
- left: function(b, c) {
278
- a.ui.pos._trigger(b, c, "posCollide", "flipLeft");
279
- var e = c.within, f = e.offset.left + e.scrollLeft, g = e.width, h = e.isWindow ? e.scrollLeft : e.offset.left, i = b.left - c.collisionPosition.marginLeft, j = i - h, k = i + c.collisionWidth - g - h, l = c.my[0] === "left" ? -c.elemWidth : c.my[0] === "right" ? c.elemWidth : 0, m = c.at[0] === "left" ? c.targetWidth : c.at[0] === "right" ? -c.targetWidth : 0, n = -2 * c.offset[0], o, p;
280
- if (j < 0) {
281
- o = b.left + l + m + n + c.collisionWidth - g - f;
282
- if (o < 0 || o < d(j)) {
283
- b.left += l + m + n;
284
- }
285
- } else if (k > 0) {
286
- p = b.left - c.collisionPosition.marginLeft + l + m + n - h;
287
- if (p > 0 || d(p) < k) {
288
- b.left += l + m + n;
289
- }
290
- }
291
- a.ui.pos._trigger(b, c, "posCollided", "flipLeft");
292
- },
293
- top: function(b, c) {
294
- a.ui.pos._trigger(b, c, "posCollide", "flipTop");
295
- var e = c.within, f = e.offset.top + e.scrollTop, g = e.height, h = e.isWindow ? e.scrollTop : e.offset.top, i = b.top - c.collisionPosition.marginTop, j = i - h, k = i + c.collisionHeight - g - h, l = c.my[1] === "top", m = l ? -c.elemHeight : c.my[1] === "bottom" ? c.elemHeight : 0, n = c.at[1] === "top" ? c.targetHeight : c.at[1] === "bottom" ? -c.targetHeight : 0, o = -2 * c.offset[1], p, q;
296
- if (j < 0) {
297
- q = b.top + m + n + o + c.collisionHeight - g - f;
298
- if (q < 0 || q < d(j)) {
299
- b.top += m + n + o;
300
- }
301
- } else if (k > 0) {
302
- p = b.top - c.collisionPosition.marginTop + m + n + o - h;
303
- if (p > 0 || d(p) < k) {
304
- b.top += m + n + o;
305
- }
306
- }
307
- a.ui.pos._trigger(b, c, "posCollided", "flipTop");
308
- }
309
- },
310
- flipfit: {
311
- left: function() {
312
- a.ui.pos.flip.left.apply(this, arguments);
313
- a.ui.pos.fit.left.apply(this, arguments);
314
- },
315
- top: function() {
316
- a.ui.pos.flip.top.apply(this, arguments);
317
- a.ui.pos.fit.top.apply(this, arguments);
318
- }
319
- }
320
- };
321
- (function() {
322
- var b, c, d, e, f, g = document.getElementsByTagName("body")[0], h = document.createElement("div");
323
- b = document.createElement(g ? "div" : "body");
324
- d = {
325
- visibility: "hidden",
326
- width: 0,
327
- height: 0,
328
- border: 0,
329
- margin: 0,
330
- background: "none"
331
- };
332
- if (g) {
333
- a.extend(d, {
334
- position: "absolute",
335
- left: "-1000px",
336
- top: "-1000px"
337
- });
338
- }
339
- for (f in d) {
340
- b.style[f] = d[f];
341
- }
342
- b.appendChild(h);
343
- c = g || document.documentElement;
344
- c.insertBefore(b, c.firstChild);
345
- h.style.cssText = "position: absolute; left: 10.7432222px;";
346
- e = a(h).offset().left;
347
- a.support.offsetFractions = e > 10 && e < 11;
348
- b.innerHTML = "";
349
- c.removeChild(b);
350
- })();
351
- })();
352
- var c = a.ui.position;
353
- });
354
-
355
- (function(a) {
356
- "use strict";
357
- if (typeof define === "function" && define.amd) {
358
- define([ "jquery" ], a);
359
- } else if (window.jQuery && !window.jQuery.fn.iconpicker) {
360
- a(window.jQuery);
361
- }
362
- })(function(a) {
363
- "use strict";
364
- var b = {
365
- isEmpty: function(a) {
366
- return a === false || a === "" || a === null || a === undefined;
367
- },
368
- isEmptyObject: function(a) {
369
- return this.isEmpty(a) === true || a.length === 0;
370
- },
371
- isElement: function(b) {
372
- return a(b).length > 0;
373
- },
374
- isString: function(a) {
375
- return typeof a === "string" || a instanceof String;
376
- },
377
- isArray: function(b) {
378
- return a.isArray(b);
379
- },
380
- inArray: function(b, c) {
381
- return a.inArray(b, c) !== -1;
382
- },
383
- throwError: function(a) {
384
- throw "Font Awesome Icon Picker Exception: " + a;
385
- }
386
- };
387
- var c = function(d, e) {
388
- this._id = c._idCounter++;
389
- this.element = a(d).addClass("iconpicker-element");
390
- this._trigger("iconpickerCreate");
391
- this.options = a.extend({}, c.defaultOptions, this.element.data(), e);
392
- this.options.templates = a.extend({}, c.defaultOptions.templates, this.options.templates);
393
- this.options.originalPlacement = this.options.placement;
394
- this.container = b.isElement(this.options.container) ? a(this.options.container) : false;
395
- if (this.container === false) {
396
- if (this.element.is(".dropdown-toggle")) {
397
- this.container = a("~ .dropdown-menu:first", this.element);
398
- } else {
399
- this.container = this.element.is("input,textarea,button,.btn") ? this.element.parent() : this.element;
400
- }
401
- }
402
- this.container.addClass("iconpicker-container");
403
- if (this.isDropdownMenu()) {
404
- this.options.templates.search = false;
405
- this.options.templates.buttons = false;
406
- this.options.placement = "inline";
407
- }
408
- this.input = this.element.is("input,textarea") ? this.element.addClass("iconpicker-input") : false;
409
- if (this.input === false) {
410
- this.input = this.container.find(this.options.input);
411
- if (!this.input.is("input,textarea")) {
412
- this.input = false;
413
- }
414
- }
415
- this.component = this.isDropdownMenu() ? this.container.parent().find(this.options.component) : this.container.find(this.options.component);
416
- if (this.component.length === 0) {
417
- this.component = false;
418
- } else {
419
- this.component.find("i").addClass("iconpicker-component");
420
- }
421
- this._createPopover();
422
- this._createIconpicker();
423
- if (this.getAcceptButton().length === 0) {
424
- this.options.mustAccept = false;
425
- }
426
- if (this.isInputGroup()) {
427
- this.container.parent().append(this.popover);
428
- } else {
429
- this.container.append(this.popover);
430
- }
431
- this._bindElementEvents();
432
- this._bindWindowEvents();
433
- this.update(this.options.selected);
434
- if (this.isInline()) {
435
- this.show();
436
- }
437
- this._trigger("iconpickerCreated");
438
- };
439
- c._idCounter = 0;
440
- c.defaultOptions = {
441
- title: false,
442
- selected: false,
443
- defaultValue: false,
444
- placement: "bottom",
445
- collision: "none",
446
- animation: true,
447
- hideOnSelect: false,
448
- showFooter: false,
449
- searchInFooter: false,
450
- mustAccept: false,
451
- selectedCustomClass: "bg-primary",
452
- icons: [],
453
- fullClassFormatter: function(a) {
454
- return "fa " + a;
455
- },
456
- input: "input,.iconpicker-input",
457
- inputSearch: false,
458
- container: false,
459
- component: ".input-group-addon,.iconpicker-component",
460
- templates: {
461
- popover: '<div class="iconpicker-popover popover"><div class="arrow"></div>' + '<div class="popover-title"></div><div class="popover-content"></div></div>',
462
- footer: '<div class="popover-footer"></div>',
463
- buttons: '<button class="iconpicker-btn iconpicker-btn-cancel btn btn-default btn-sm">Cancel</button>' + ' <button class="iconpicker-btn iconpicker-btn-accept btn btn-primary btn-sm">Accept</button>',
464
- search: '<input type="search" class="form-control iconpicker-search" placeholder="Type to filter" />',
465
- iconpicker: '<div class="iconpicker"><div class="iconpicker-items"></div></div>',
466
- iconpickerItem: '<a role="button" href="#" class="iconpicker-item"><i></i></a>'
467
- }
468
- };
469
- c.batch = function(b, c) {
470
- var d = Array.prototype.slice.call(arguments, 2);
471
- return a(b).each(function() {
472
- var b = a(this).data("iconpicker");
473
- if (!!b) {
474
- b[c].apply(b, d);
475
- }
476
- });
477
- };
478
- c.prototype = {
479
- constructor: c,
480
- options: {},
481
- _id: 0,
482
- _trigger: function(b, c) {
483
- c = c || {};
484
- this.element.trigger(a.extend({
485
- type: b,
486
- iconpickerInstance: this
487
- }, c));
488
- },
489
- _createPopover: function() {
490
- this.popover = a(this.options.templates.popover);
491
- var c = this.popover.find(".popover-title");
492
- if (!!this.options.title) {
493
- c.append(a('<div class="popover-title-text">' + this.options.title + "</div>"));
494
- }
495
- if (this.hasSeparatedSearchInput() && !this.options.searchInFooter) {
496
- c.append(this.options.templates.search);
497
- } else if (!this.options.title) {
498
- c.remove();
499
- }
500
- if (this.options.showFooter && !b.isEmpty(this.options.templates.footer)) {
501
- var d = a(this.options.templates.footer);
502
- if (this.hasSeparatedSearchInput() && this.options.searchInFooter) {
503
- d.append(a(this.options.templates.search));
504
- }
505
- if (!b.isEmpty(this.options.templates.buttons)) {
506
- d.append(a(this.options.templates.buttons));
507
- }
508
- this.popover.append(d);
509
- }
510
- if (this.options.animation === true) {
511
- this.popover.addClass("fade");
512
- }
513
- return this.popover;
514
- },
515
- _createIconpicker: function() {
516
- var b = this;
517
- this.iconpicker = a(this.options.templates.iconpicker);
518
- var c = function(c) {
519
- var d = a(this);
520
- if (d.is("i")) {
521
- d = d.parent();
522
- }
523
- b._trigger("iconpickerSelect", {
524
- iconpickerItem: d,
525
- iconpickerValue: b.iconpickerValue
526
- });
527
- if (b.options.mustAccept === false) {
528
- b.update(d.data("iconpickerValue"));
529
- b._trigger("iconpickerSelected", {
530
- iconpickerItem: this,
531
- iconpickerValue: b.iconpickerValue
532
- });
533
- } else {
534
- b.update(d.data("iconpickerValue"), true);
535
- }
536
- if (b.options.hideOnSelect && b.options.mustAccept === false) {
537
- b.hide();
538
- }
539
- c.preventDefault();
540
- return false;
541
- };
542
- for (var d in this.options.icons) {
543
- if (typeof this.options.icons[d] === "string") {
544
- var e = a(this.options.templates.iconpickerItem);
545
- e.find("i").addClass(this.options.fullClassFormatter(this.options.icons[d]));
546
- e.data("iconpickerValue", this.options.icons[d]).on("click.iconpicker", c);
547
- this.iconpicker.find(".iconpicker-items").append(e.attr("title", "." + this.options.icons[d]));
548
- }
549
- }
550
- this.popover.find(".popover-content").append(this.iconpicker);
551
- return this.iconpicker;
552
- },
553
- _isEventInsideIconpicker: function(b) {
554
- var c = a(b.target);
555
- if ((!c.hasClass("iconpicker-element") || c.hasClass("iconpicker-element") && !c.is(this.element)) && c.parents(".iconpicker-popover").length === 0) {
556
- return false;
557
- }
558
- return true;
559
- },
560
- _bindElementEvents: function() {
561
- var c = this;
562
- this.getSearchInput().on("keyup.iconpicker", function() {
563
- c.filter(a(this).val().toLowerCase());
564
- });
565
- this.getAcceptButton().on("click.iconpicker", function() {
566
- var a = c.iconpicker.find(".iconpicker-selected").get(0);
567
- c.update(c.iconpickerValue);
568
- c._trigger("iconpickerSelected", {
569
- iconpickerItem: a,
570
- iconpickerValue: c.iconpickerValue
571
- });
572
- if (!c.isInline()) {
573
- c.hide();
574
- }
575
- });
576
- this.getCancelButton().on("click.iconpicker", function() {
577
- if (!c.isInline()) {
578
- c.hide();
579
- }
580
- });
581
- this.element.on("focus.iconpicker", function(a) {
582
- c.show();
583
- a.stopPropagation();
584
- });
585
- if (this.hasComponent()) {
586
- this.component.on("click.iconpicker", function() {
587
- c.toggle();
588
- });
589
- }
590
- if (this.hasInput()) {
591
- this.input.on("keyup.iconpicker", function(d) {
592
- if (!b.inArray(d.keyCode, [ 38, 40, 37, 39, 16, 17, 18, 9, 8, 91, 93, 20, 46, 186, 190, 46, 78, 188, 44, 86 ])) {
593
- c.update();
594
- } else {
595
- c._updateFormGroupStatus(c.getValid(this.value) !== false);
596
- }
597
- if (c.options.inputSearch === true) {
598
- c.filter(a(this).val().toLowerCase());
599
- }
600
- });
601
- }
602
- },
603
- _bindWindowEvents: function() {
604
- var b = a(window.document);
605
- var c = this;
606
- var d = ".iconpicker.inst" + this._id;
607
- a(window).on("resize.iconpicker" + d + " orientationchange.iconpicker" + d, function(a) {
608
- if (c.popover.hasClass("in")) {
609
- c.updatePlacement();
610
- }
611
- });
612
- if (!c.isInline()) {
613
- b.on("mouseup" + d, function(a) {
614
- if (!c._isEventInsideIconpicker(a) && !c.isInline()) {
615
- c.hide();
616
- }
617
- a.stopPropagation();
618
- a.preventDefault();
619
- return false;
620
- });
621
- }
622
- return false;
623
- },
624
- _unbindElementEvents: function() {
625
- this.popover.off(".iconpicker");
626
- this.element.off(".iconpicker");
627
- if (this.hasInput()) {
628
- this.input.off(".iconpicker");
629
- }
630
- if (this.hasComponent()) {
631
- this.component.off(".iconpicker");
632
- }
633
- if (this.hasContainer()) {
634
- this.container.off(".iconpicker");
635
- }
636
- },
637
- _unbindWindowEvents: function() {
638
- a(window).off(".iconpicker.inst" + this._id);
639
- a(window.document).off(".iconpicker.inst" + this._id);
640
- },
641
- updatePlacement: function(b, c) {
642
- b = b || this.options.placement;
643
- this.options.placement = b;
644
- c = c || this.options.collision;
645
- c = c === true ? "flip" : c;
646
- var d = {
647
- at: "right bottom",
648
- my: "right top",
649
- of: this.hasInput() && !this.isInputGroup() ? this.input : this.container,
650
- collision: c === true ? "flip" : c,
651
- within: window
652
- };
653
- this.popover.removeClass("inline topLeftCorner topLeft top topRight topRightCorner " + "rightTop right rightBottom bottomRight bottomRightCorner " + "bottom bottomLeft bottomLeftCorner leftBottom left leftTop");
654
- if (typeof b === "object") {
655
- return this.popover.pos(a.extend({}, d, b));
656
- }
657
- switch (b) {
658
- case "inline":
659
- {
660
- d = false;
661
- }
662
- break;
663
-
664
- case "topLeftCorner":
665
- {
666
- d.my = "right bottom";
667
- d.at = "left top";
668
- }
669
- break;
670
-
671
- case "topLeft":
672
- {
673
- d.my = "left bottom";
674
- d.at = "left top";
675
- }
676
- break;
677
-
678
- case "top":
679
- {
680
- d.my = "center bottom";
681
- d.at = "center top";
682
- }
683
- break;
684
-
685
- case "topRight":
686
- {
687
- d.my = "right bottom";
688
- d.at = "right top";
689
- }
690
- break;
691
-
692
- case "topRightCorner":
693
- {
694
- d.my = "left bottom";
695
- d.at = "right top";
696
- }
697
- break;
698
-
699
- case "rightTop":
700
- {
701
- d.my = "left bottom";
702
- d.at = "right center";
703
- }
704
- break;
705
-
706
- case "right":
707
- {
708
- d.my = "left center";
709
- d.at = "right center";
710
- }
711
- break;
712
-
713
- case "rightBottom":
714
- {
715
- d.my = "left top";
716
- d.at = "right center";
717
- }
718
- break;
719
-
720
- case "bottomRightCorner":
721
- {
722
- d.my = "left top";
723
- d.at = "right bottom";
724
- }
725
- break;
726
-
727
- case "bottomRight":
728
- {
729
- d.my = "right top";
730
- d.at = "right bottom";
731
- }
732
- break;
733
-
734
- case "bottom":
735
- {
736
- d.my = "center top";
737
- d.at = "center bottom";
738
- }
739
- break;
740
-
741
- case "bottomLeft":
742
- {
743
- d.my = "left top";
744
- d.at = "left bottom";
745
- }
746
- break;
747
-
748
- case "bottomLeftCorner":
749
- {
750
- d.my = "right top";
751
- d.at = "left bottom";
752
- }
753
- break;
754
-
755
- case "leftBottom":
756
- {
757
- d.my = "right top";
758
- d.at = "left center";
759
- }
760
- break;
761
-
762
- case "left":
763
- {
764
- d.my = "right center";
765
- d.at = "left center";
766
- }
767
- break;
768
-
769
- case "leftTop":
770
- {
771
- d.my = "right bottom";
772
- d.at = "left center";
773
- }
774
- break;
775
-
776
- default:
777
- {
778
- return false;
779
- }
780
- break;
781
- }
782
- this.popover.css({
783
- display: this.options.placement === "inline" ? "" : "block"
784
- });
785
- if (d !== false) {
786
- this.popover.pos(d).css("maxWidth", a(window).width() - this.container.offset().left - 5);
787
- } else {
788
- this.popover.css({
789
- top: "auto",
790
- right: "auto",
791
- bottom: "auto",
792
- left: "auto",
793
- maxWidth: "none"
794
- });
795
- }
796
- this.popover.addClass(this.options.placement);
797
- return true;
798
- },
799
- _updateComponents: function() {
800
- this.iconpicker.find(".iconpicker-item.iconpicker-selected").removeClass("iconpicker-selected " + this.options.selectedCustomClass);
801
- if (this.iconpickerValue) {
802
- this.iconpicker.find("." + this.options.fullClassFormatter(this.iconpickerValue).replace(/ /g, ".")).parent().addClass("iconpicker-selected " + this.options.selectedCustomClass);
803
- }
804
- if (this.hasComponent()) {
805
- var a = this.component.find("i");
806
- if (a.length > 0) {
807
- a.attr("class", this.options.fullClassFormatter(this.iconpickerValue));
808
- } else {
809
- this.component.html(this.getHtml());
810
- }
811
- }
812
- },
813
- _updateFormGroupStatus: function(a) {
814
- if (this.hasInput()) {
815
- if (a !== false) {
816
- this.input.parents(".form-group:first").removeClass("has-error");
817
- } else {
818
- this.input.parents(".form-group:first").addClass("has-error");
819
- }
820
- return true;
821
- }
822
- return false;
823
- },
824
- getValid: function(c) {
825
- if (!b.isString(c)) {
826
- c = "";
827
- }
828
- var d = c === "";
829
- c = a.trim(c);
830
- if (b.inArray(c, this.options.icons) || d) {
831
- return c;
832
- }
833
- return false;
834
- },
835
- setValue: function(a) {
836
- var b = this.getValid(a);
837
- if (b !== false) {
838
- this.iconpickerValue = b;
839
- this._trigger("iconpickerSetValue", {
840
- iconpickerValue: b
841
- });
842
- return this.iconpickerValue;
843
- } else {
844
- this._trigger("iconpickerInvalid", {
845
- iconpickerValue: a
846
- });
847
- return false;
848
- }
849
- },
850
- getHtml: function() {
851
- return '<i class="' + this.options.fullClassFormatter(this.iconpickerValue) + '"></i>';
852
- },
853
- setSourceValue: function(a) {
854
- a = this.setValue(a);
855
- if (a !== false && a !== "") {
856
- if (this.hasInput()) {
857
- this.input.val(this.iconpickerValue);
858
- } else {
859
- this.element.data("iconpickerValue", this.iconpickerValue);
860
- }
861
- this._trigger("iconpickerSetSourceValue", {
862
- iconpickerValue: a
863
- });
864
- }
865
- return a;
866
- },
867
- getSourceValue: function(a) {
868
- a = a || this.options.defaultValue;
869
- var b = a;
870
- if (this.hasInput()) {
871
- b = this.input.val();
872
- } else {
873
- b = this.element.data("iconpickerValue");
874
- }
875
- if (b === undefined || b === "" || b === null || b === false) {
876
- b = a;
877
- }
878
- return b;
879
- },
880
- hasInput: function() {
881
- return this.input !== false;
882
- },
883
- isInputSearch: function() {
884
- return this.hasInput() && this.options.inputSearch === true;
885
- },
886
- isInputGroup: function() {
887
- return this.container.is(".input-group");
888
- },
889
- isDropdownMenu: function() {
890
- return this.container.is(".dropdown-menu");
891
- },
892
- hasSeparatedSearchInput: function() {
893
- return this.options.templates.search !== false && !this.isInputSearch();
894
- },
895
- hasComponent: function() {
896
- return this.component !== false;
897
- },
898
- hasContainer: function() {
899
- return this.container !== false;
900
- },
901
- getAcceptButton: function() {
902
- return this.popover.find(".iconpicker-btn-accept");
903
- },
904
- getCancelButton: function() {
905
- return this.popover.find(".iconpicker-btn-cancel");
906
- },
907
- getSearchInput: function() {
908
- return this.popover.find(".iconpicker-search");
909
- },
910
- filter: function(c) {
911
- if (b.isEmpty(c)) {
912
- this.iconpicker.find(".iconpicker-item").show();
913
- return a(false);
914
- } else {
915
- var d = [];
916
- this.iconpicker.find(".iconpicker-item").each(function() {
917
- var b = a(this);
918
- var e = b.attr("title").toLowerCase();
919
- var f = false;
920
- try {
921
- f = new RegExp(c, "g");
922
- } catch (a) {
923
- f = false;
924
- }
925
- if (f !== false && e.match(f)) {
926
- d.push(b);
927
- b.show();
928
- } else {
929
- b.hide();
930
- }
931
- });
932
- return d;
933
- }
934
- },
935
- show: function() {
936
- if (this.popover.hasClass("in")) {
937
- return false;
938
- }
939
- a.iconpicker.batch(a(".iconpicker-popover.in:not(.inline)").not(this.popover), "hide");
940
- this._trigger("iconpickerShow");
941
- this.updatePlacement();
942
- this.popover.addClass("in");
943
- setTimeout(a.proxy(function() {
944
- this.popover.css("display", this.isInline() ? "" : "block");
945
- this._trigger("iconpickerShown");
946
- }, this), this.options.animation ? 300 : 1);
947
- },
948
- hide: function() {
949
- if (!this.popover.hasClass("in")) {
950
- return false;
951
- }
952
- this._trigger("iconpickerHide");
953
- this.popover.removeClass("in");
954
- setTimeout(a.proxy(function() {
955
- this.popover.css("display", "none");
956
- this.getSearchInput().val("");
957
- this.filter("");
958
- this._trigger("iconpickerHidden");
959
- }, this), this.options.animation ? 300 : 1);
960
- },
961
- toggle: function() {
962
- if (this.popover.is(":visible")) {
963
- this.hide();
964
- } else {
965
- this.show(true);
966
- }
967
- },
968
- update: function(a, b) {
969
- a = a ? a : this.getSourceValue(this.iconpickerValue);
970
- this._trigger("iconpickerUpdate");
971
- if (b === true) {
972
- a = this.setValue(a);
973
- } else {
974
- a = this.setSourceValue(a);
975
- this._updateFormGroupStatus(a !== false);
976
- }
977
- if (a !== false) {
978
- this._updateComponents();
979
- }
980
- this._trigger("iconpickerUpdated");
981
- return a;
982
- },
983
- destroy: function() {
984
- this._trigger("iconpickerDestroy");
985
- this.element.removeData("iconpicker").removeData("iconpickerValue").removeClass("iconpicker-element");
986
- this._unbindElementEvents();
987
- this._unbindWindowEvents();
988
- a(this.popover).remove();
989
- this._trigger("iconpickerDestroyed");
990
- },
991
- disable: function() {
992
- if (this.hasInput()) {
993
- this.input.prop("disabled", true);
994
- return true;
995
- }
996
- return false;
997
- },
998
- enable: function() {
999
- if (this.hasInput()) {
1000
- this.input.prop("disabled", false);
1001
- return true;
1002
- }
1003
- return false;
1004
- },
1005
- isDisabled: function() {
1006
- if (this.hasInput()) {
1007
- return this.input.prop("disabled") === true;
1008
- }
1009
- return false;
1010
- },
1011
- isInline: function() {
1012
- return this.options.placement === "inline" || this.popover.hasClass("inline");
1013
- }
1014
- };
1015
- a.iconpicker = c;
1016
- a.fn.iconpicker = function(b) {
1017
- return this.each(function() {
1018
- var d = a(this);
1019
- if (!d.data("iconpicker")) {
1020
- d.data("iconpicker", new c(this, typeof b === "object" ? b : {}));
1021
- }
1022
- });
1023
- };
1024
- c.defaultOptions.icons = [ "fa-500px", "fa-adjust", "fa-adn", "fa-align-center", "fa-align-justify", "fa-align-left", "fa-align-right", "fa-amazon", "fa-ambulance", "fa-american-sign-language-interpreting", "fa-anchor", "fa-android", "fa-angellist", "fa-angle-double-down", "fa-angle-double-left", "fa-angle-double-right", "fa-angle-double-up", "fa-angle-down", "fa-angle-left", "fa-angle-right", "fa-angle-up", "fa-apple", "fa-archive", "fa-area-chart", "fa-arrow-circle-down", "fa-arrow-circle-left", "fa-arrow-circle-o-down", "fa-arrow-circle-o-left", "fa-arrow-circle-o-right", "fa-arrow-circle-o-up", "fa-arrow-circle-right", "fa-arrow-circle-up", "fa-arrow-down", "fa-arrow-left", "fa-arrow-right", "fa-arrow-up", "fa-arrows", "fa-arrows-alt", "fa-arrows-h", "fa-arrows-v", "fa-asl-interpreting", "fa-assistive-listening-systems", "fa-asterisk", "fa-at", "fa-audio-description", "fa-automobile", "fa-backward", "fa-balance-scale", "fa-ban", "fa-bandcamp", "fa-bank", "fa-bar-chart", "fa-bar-chart-o", "fa-barcode", "fa-bars", "fa-bath", "fa-bathtub", "fa-battery", "fa-battery-0", "fa-battery-1", "fa-battery-2", "fa-battery-3", "fa-battery-4", "fa-battery-empty", "fa-battery-full", "fa-battery-half", "fa-battery-quarter", "fa-battery-three-quarters", "fa-bed", "fa-beer", "fa-behance", "fa-behance-square", "fa-bell", "fa-bell-o", "fa-bell-slash", "fa-bell-slash-o", "fa-bicycle", "fa-binoculars", "fa-birthday-cake", "fa-bitbucket", "fa-bitbucket-square", "fa-bitcoin", "fa-black-tie", "fa-blind", "fa-bluetooth", "fa-bluetooth-b", "fa-bold", "fa-bolt", "fa-bomb", "fa-book", "fa-bookmark", "fa-bookmark-o", "fa-braille", "fa-briefcase", "fa-btc", "fa-bug", "fa-building", "fa-building-o", "fa-bullhorn", "fa-bullseye", "fa-bus", "fa-buysellads", "fa-cab", "fa-calculator", "fa-calendar", "fa-calendar-check-o", "fa-calendar-minus-o", "fa-calendar-o", "fa-calendar-plus-o", "fa-calendar-times-o", "fa-camera", "fa-camera-retro", "fa-car", "fa-caret-down", "fa-caret-left", "fa-caret-right", "fa-caret-square-o-down", "fa-caret-square-o-left", "fa-caret-square-o-right", "fa-caret-square-o-up", "fa-caret-up", "fa-cart-arrow-down", "fa-cart-plus", "fa-cc", "fa-cc-amex", "fa-cc-diners-club", "fa-cc-discover", "fa-cc-jcb", "fa-cc-mastercard", "fa-cc-paypal", "fa-cc-stripe", "fa-cc-visa", "fa-certificate", "fa-chain", "fa-chain-broken", "fa-check", "fa-check-circle", "fa-check-circle-o", "fa-check-square", "fa-check-square-o", "fa-chevron-circle-down", "fa-chevron-circle-left", "fa-chevron-circle-right", "fa-chevron-circle-up", "fa-chevron-down", "fa-chevron-left", "fa-chevron-right", "fa-chevron-up", "fa-child", "fa-chrome", "fa-circle", "fa-circle-o", "fa-circle-o-notch", "fa-circle-thin", "fa-clipboard", "fa-clock-o", "fa-clone", "fa-close", "fa-cloud", "fa-cloud-download", "fa-cloud-upload", "fa-cny", "fa-code", "fa-code-fork", "fa-codepen", "fa-codiepie", "fa-coffee", "fa-cog", "fa-cogs", "fa-columns", "fa-comment", "fa-comment-o", "fa-commenting", "fa-commenting-o", "fa-comments", "fa-comments-o", "fa-compass", "fa-compress", "fa-connectdevelop", "fa-contao", "fa-copy", "fa-copyright", "fa-creative-commons", "fa-credit-card", "fa-credit-card-alt", "fa-crop", "fa-crosshairs", "fa-css3", "fa-cube", "fa-cubes", "fa-cut", "fa-cutlery", "fa-dashboard", "fa-dashcube", "fa-database", "fa-deaf", "fa-deafness", "fa-dedent", "fa-delicious", "fa-desktop", "fa-deviantart", "fa-diamond", "fa-digg", "fa-dollar", "fa-dot-circle-o", "fa-download", "fa-dribbble", "fa-drivers-license", "fa-drivers-license-o", "fa-dropbox", "fa-drupal", "fa-edge", "fa-edit", "fa-eercast", "fa-eject", "fa-ellipsis-h", "fa-ellipsis-v", "fa-empire", "fa-envelope", "fa-envelope-o", "fa-envelope-open", "fa-envelope-open-o", "fa-envelope-square", "fa-envira", "fa-eraser", "fa-etsy", "fa-eur", "fa-euro", "fa-exchange", "fa-exclamation", "fa-exclamation-circle", "fa-exclamation-triangle", "fa-expand", "fa-expeditedssl", "fa-external-link", "fa-external-link-square", "fa-eye", "fa-eye-slash", "fa-eyedropper", "fa-fa", "fa-facebook", "fa-facebook-f", "fa-facebook-official", "fa-facebook-square", "fa-fast-backward", "fa-fast-forward", "fa-fax", "fa-feed", "fa-female", "fa-fighter-jet", "fa-file", "fa-file-archive-o", "fa-file-audio-o", "fa-file-code-o", "fa-file-excel-o", "fa-file-image-o", "fa-file-movie-o", "fa-file-o", "fa-file-pdf-o", "fa-file-photo-o", "fa-file-picture-o", "fa-file-powerpoint-o", "fa-file-sound-o", "fa-file-text", "fa-file-text-o", "fa-file-video-o", "fa-file-word-o", "fa-file-zip-o", "fa-files-o", "fa-film", "fa-filter", "fa-fire", "fa-fire-extinguisher", "fa-firefox", "fa-first-order", "fa-flag", "fa-flag-checkered", "fa-flag-o", "fa-flash", "fa-flask", "fa-flickr", "fa-floppy-o", "fa-folder", "fa-folder-o", "fa-folder-open", "fa-folder-open-o", "fa-font", "fa-font-awesome", "fa-fonticons", "fa-fort-awesome", "fa-forumbee", "fa-forward", "fa-foursquare", "fa-free-code-camp", "fa-frown-o", "fa-futbol-o", "fa-gamepad", "fa-gavel", "fa-gbp", "fa-ge", "fa-gear", "fa-gears", "fa-genderless", "fa-get-pocket", "fa-gg", "fa-gg-circle", "fa-gift", "fa-git", "fa-git-square", "fa-github", "fa-github-alt", "fa-github-square", "fa-gitlab", "fa-gittip", "fa-glass", "fa-glide", "fa-glide-g", "fa-globe", "fa-google", "fa-google-plus", "fa-google-plus-circle", "fa-google-plus-official", "fa-google-plus-square", "fa-google-wallet", "fa-graduation-cap", "fa-gratipay", "fa-grav", "fa-group", "fa-h-square", "fa-hacker-news", "fa-hand-grab-o", "fa-hand-lizard-o", "fa-hand-o-down", "fa-hand-o-left", "fa-hand-o-right", "fa-hand-o-up", "fa-hand-paper-o", "fa-hand-peace-o", "fa-hand-pointer-o", "fa-hand-rock-o", "fa-hand-scissors-o", "fa-hand-spock-o", "fa-hand-stop-o", "fa-hard-of-hearing", "fa-hashtag", "fa-hdd-o", "fa-header", "fa-headphones", "fa-heart", "fa-heart-o", "fa-heartbeat", "fa-history", "fa-home", "fa-hospital-o", "fa-hotel", "fa-hourglass", "fa-hourglass-1", "fa-hourglass-2", "fa-hourglass-3", "fa-hourglass-end", "fa-hourglass-half", "fa-hourglass-o", "fa-hourglass-start", "fa-houzz", "fa-html5", "fa-i-cursor", "fa-id-badge", "fa-id-card", "fa-id-card-o", "fa-ils", "fa-image", "fa-imdb", "fa-inbox", "fa-indent", "fa-industry", "fa-info", "fa-info-circle", "fa-inr", "fa-instagram", "fa-institution", "fa-internet-explorer", "fa-intersex", "fa-ioxhost", "fa-italic", "fa-joomla", "fa-jpy", "fa-jsfiddle", "fa-key", "fa-keyboard-o", "fa-krw", "fa-language", "fa-laptop", "fa-lastfm", "fa-lastfm-square", "fa-leaf", "fa-leanpub", "fa-legal", "fa-lemon-o", "fa-level-down", "fa-level-up", "fa-life-bouy", "fa-life-buoy", "fa-life-ring", "fa-life-saver", "fa-lightbulb-o", "fa-line-chart", "fa-link", "fa-linkedin", "fa-linkedin-square", "fa-linux", "fa-list", "fa-list-alt", "fa-list-ol", "fa-list-ul", "fa-location-arrow", "fa-lock", "fa-long-arrow-down", "fa-long-arrow-left", "fa-long-arrow-right", "fa-long-arrow-up", "fa-low-vision", "fa-magic", "fa-magnet", "fa-mail-forward", "fa-mail-reply", "fa-mail-reply-all", "fa-male", "fa-map", "fa-map-marker", "fa-map-o", "fa-map-pin", "fa-map-signs", "fa-mars", "fa-mars-double", "fa-mars-stroke", "fa-mars-stroke-h", "fa-mars-stroke-v", "fa-maxcdn", "fa-meanpath", "fa-medium", "fa-medkit", "fa-meetup", "fa-meh-o", "fa-mercury", "fa-microchip", "fa-microphone", "fa-microphone-slash", "fa-minus", "fa-minus-circle", "fa-minus-square", "fa-minus-square-o", "fa-mixcloud", "fa-mobile", "fa-mobile-phone", "fa-modx", "fa-money", "fa-moon-o", "fa-mortar-board", "fa-motorcycle", "fa-mouse-pointer", "fa-music", "fa-navicon", "fa-neuter", "fa-newspaper-o", "fa-object-group", "fa-object-ungroup", "fa-odnoklassniki", "fa-odnoklassniki-square", "fa-opencart", "fa-openid", "fa-opera", "fa-optin-monster", "fa-outdent", "fa-pagelines", "fa-paint-brush", "fa-paper-plane", "fa-paper-plane-o", "fa-paperclip", "fa-paragraph", "fa-paste", "fa-pause", "fa-pause-circle", "fa-pause-circle-o", "fa-paw", "fa-paypal", "fa-pencil", "fa-pencil-square", "fa-pencil-square-o", "fa-percent", "fa-phone", "fa-phone-square", "fa-photo", "fa-picture-o", "fa-pie-chart", "fa-pied-piper", "fa-pied-piper-alt", "fa-pied-piper-pp", "fa-pinterest", "fa-pinterest-p", "fa-pinterest-square", "fa-plane", "fa-play", "fa-play-circle", "fa-play-circle-o", "fa-plug", "fa-plus", "fa-plus-circle", "fa-plus-square", "fa-plus-square-o", "fa-podcast", "fa-power-off", "fa-print", "fa-product-hunt", "fa-puzzle-piece", "fa-qq", "fa-qrcode", "fa-question", "fa-question-circle", "fa-question-circle-o", "fa-quora", "fa-quote-left", "fa-quote-right", "fa-ra", "fa-random", "fa-ravelry", "fa-rebel", "fa-recycle", "fa-reddit", "fa-reddit-alien", "fa-reddit-square", "fa-refresh", "fa-registered", "fa-remove", "fa-renren", "fa-reorder", "fa-repeat", "fa-reply", "fa-reply-all", "fa-resistance", "fa-retweet", "fa-rmb", "fa-road", "fa-rocket", "fa-rotate-left", "fa-rotate-right", "fa-rouble", "fa-rss", "fa-rss-square", "fa-rub", "fa-ruble", "fa-rupee", "fa-s15", "fa-safari", "fa-save", "fa-scissors", "fa-scribd", "fa-search", "fa-search-minus", "fa-search-plus", "fa-sellsy", "fa-send", "fa-send-o", "fa-server", "fa-share", "fa-share-alt", "fa-share-alt-square", "fa-share-square", "fa-share-square-o", "fa-shekel", "fa-sheqel", "fa-shield", "fa-ship", "fa-shirtsinbulk", "fa-shopping-bag", "fa-shopping-basket", "fa-shopping-cart", "fa-shower", "fa-sign-in", "fa-sign-language", "fa-sign-out", "fa-signal", "fa-signing", "fa-simplybuilt", "fa-sitemap", "fa-skyatlas", "fa-skype", "fa-slack", "fa-sliders", "fa-slideshare", "fa-smile-o", "fa-snapchat", "fa-snapchat-ghost", "fa-snapchat-square", "fa-snowflake-o", "fa-soccer-ball-o", "fa-sort", "fa-sort-alpha-asc", "fa-sort-alpha-desc", "fa-sort-amount-asc", "fa-sort-amount-desc", "fa-sort-asc", "fa-sort-desc", "fa-sort-down", "fa-sort-numeric-asc", "fa-sort-numeric-desc", "fa-sort-up", "fa-soundcloud", "fa-space-shuttle", "fa-spinner", "fa-spoon", "fa-spotify", "fa-square", "fa-square-o", "fa-stack-exchange", "fa-stack-overflow", "fa-star", "fa-star-half", "fa-star-half-empty", "fa-star-half-full", "fa-star-half-o", "fa-star-o", "fa-steam", "fa-steam-square", "fa-step-backward", "fa-step-forward", "fa-stethoscope", "fa-sticky-note", "fa-sticky-note-o", "fa-stop", "fa-stop-circle", "fa-stop-circle-o", "fa-street-view", "fa-strikethrough", "fa-stumbleupon", "fa-stumbleupon-circle", "fa-subscript", "fa-subway", "fa-suitcase", "fa-sun-o", "fa-superpowers", "fa-superscript", "fa-support", "fa-table", "fa-tablet", "fa-tachometer", "fa-tag", "fa-tags", "fa-tasks", "fa-taxi", "fa-telegram", "fa-television", "fa-tencent-weibo", "fa-terminal", "fa-text-height", "fa-text-width", "fa-th", "fa-th-large", "fa-th-list", "fa-themeisle", "fa-thermometer", "fa-thermometer-0", "fa-thermometer-1", "fa-thermometer-2", "fa-thermometer-3", "fa-thermometer-4", "fa-thermometer-empty", "fa-thermometer-full", "fa-thermometer-half", "fa-thermometer-quarter", "fa-thermometer-three-quarters", "fa-thumb-tack", "fa-thumbs-down", "fa-thumbs-o-down", "fa-thumbs-o-up", "fa-thumbs-up", "fa-ticket", "fa-times", "fa-times-circle", "fa-times-circle-o", "fa-times-rectangle", "fa-times-rectangle-o", "fa-tint", "fa-toggle-down", "fa-toggle-left", "fa-toggle-off", "fa-toggle-on", "fa-toggle-right", "fa-toggle-up", "fa-trademark", "fa-train", "fa-transgender", "fa-transgender-alt", "fa-trash", "fa-trash-o", "fa-tree", "fa-trello", "fa-tripadvisor", "fa-trophy", "fa-truck", "fa-try", "fa-tty", "fa-tumblr", "fa-tumblr-square", "fa-turkish-lira", "fa-tv", "fa-twitch", "fa-twitter", "fa-twitter-square", "fa-umbrella", "fa-underline", "fa-undo", "fa-universal-access", "fa-university", "fa-unlink", "fa-unlock", "fa-unlock-alt", "fa-unsorted", "fa-upload", "fa-usb", "fa-usd", "fa-user", "fa-user-circle", "fa-user-circle-o", "fa-user-md", "fa-user-o", "fa-user-plus", "fa-user-secret", "fa-user-times", "fa-users", "fa-vcard", "fa-vcard-o", "fa-venus", "fa-venus-double", "fa-venus-mars", "fa-viacoin", "fa-viadeo", "fa-viadeo-square", "fa-video-camera", "fa-vimeo", "fa-vimeo-square", "fa-vine", "fa-vk", "fa-volume-control-phone", "fa-volume-down", "fa-volume-off", "fa-volume-up", "fa-warning", "fa-wechat", "fa-weibo", "fa-weixin", "fa-whatsapp", "fa-wheelchair", "fa-wheelchair-alt", "fa-wifi", "fa-wikipedia-w", "fa-window-close", "fa-window-close-o", "fa-window-maximize", "fa-window-minimize", "fa-window-restore", "fa-windows", "fa-won", "fa-wordpress", "fa-wpbeginner", "fa-wpexplorer", "fa-wpforms", "fa-wrench", "fa-xing", "fa-xing-square", "fa-y-combinator", "fa-y-combinator-square", "fa-yahoo", "fa-yc", "fa-yc-square", "fa-yelp", "fa-yen", "fa-yoast", "fa-youtube", "fa-youtube-play", "fa-youtube-square" ];
1025
  });
1
+ (function(a) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define([ "jquery" ], a);
4
+ } else {
5
+ a(jQuery);
6
+ }
7
+ })(function(a) {
8
+ a.ui = a.ui || {};
9
+ var b = a.ui.version = "1.12.1";
10
+ (function() {
11
+ var b, c = Math.max, d = Math.abs, e = /left|center|right/, f = /top|center|bottom/, g = /[\+\-]\d+(\.[\d]+)?%?/, h = /^\w+/, i = /%$/, j = a.fn.pos;
12
+ function k(a, b, c) {
13
+ return [ parseFloat(a[0]) * (i.test(a[0]) ? b / 100 : 1), parseFloat(a[1]) * (i.test(a[1]) ? c / 100 : 1) ];
14
+ }
15
+ function l(b, c) {
16
+ return parseInt(a.css(b, c), 10) || 0;
17
+ }
18
+ function m(b) {
19
+ var c = b[0];
20
+ if (c.nodeType === 9) {
21
+ return {
22
+ width: b.width(),
23
+ height: b.height(),
24
+ offset: {
25
+ top: 0,
26
+ left: 0
27
+ }
28
+ };
29
+ }
30
+ if (a.isWindow(c)) {
31
+ return {
32
+ width: b.width(),
33
+ height: b.height(),
34
+ offset: {
35
+ top: b.scrollTop(),
36
+ left: b.scrollLeft()
37
+ }
38
+ };
39
+ }
40
+ if (c.preventDefault) {
41
+ return {
42
+ width: 0,
43
+ height: 0,
44
+ offset: {
45
+ top: c.pageY,
46
+ left: c.pageX
47
+ }
48
+ };
49
+ }
50
+ return {
51
+ width: b.outerWidth(),
52
+ height: b.outerHeight(),
53
+ offset: b.offset()
54
+ };
55
+ }
56
+ a.pos = {
57
+ scrollbarWidth: function() {
58
+ if (b !== undefined) {
59
+ return b;
60
+ }
61
+ var c, d, e = a("<div " + "style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'>" + "<div style='height:100px;width:auto;'></div></div>"), f = e.children()[0];
62
+ a("body").append(e);
63
+ c = f.offsetWidth;
64
+ e.css("overflow", "scroll");
65
+ d = f.offsetWidth;
66
+ if (c === d) {
67
+ d = e[0].clientWidth;
68
+ }
69
+ e.remove();
70
+ return b = c - d;
71
+ },
72
+ getScrollInfo: function(b) {
73
+ var c = b.isWindow || b.isDocument ? "" : b.element.css("overflow-x"), d = b.isWindow || b.isDocument ? "" : b.element.css("overflow-y"), e = c === "scroll" || c === "auto" && b.width < b.element[0].scrollWidth, f = d === "scroll" || d === "auto" && b.height < b.element[0].scrollHeight;
74
+ return {
75
+ width: f ? a.pos.scrollbarWidth() : 0,
76
+ height: e ? a.pos.scrollbarWidth() : 0
77
+ };
78
+ },
79
+ getWithinInfo: function(b) {
80
+ var c = a(b || window), d = a.isWindow(c[0]), e = !!c[0] && c[0].nodeType === 9, f = !d && !e;
81
+ return {
82
+ element: c,
83
+ isWindow: d,
84
+ isDocument: e,
85
+ offset: f ? a(b).offset() : {
86
+ left: 0,
87
+ top: 0
88
+ },
89
+ scrollLeft: c.scrollLeft(),
90
+ scrollTop: c.scrollTop(),
91
+ width: c.outerWidth(),
92
+ height: c.outerHeight()
93
+ };
94
+ }
95
+ };
96
+ a.fn.pos = function(b) {
97
+ if (!b || !b.of) {
98
+ return j.apply(this, arguments);
99
+ }
100
+ b = a.extend({}, b);
101
+ var i, n, o, p, q, r, s = a(b.of), t = a.pos.getWithinInfo(b.within), u = a.pos.getScrollInfo(t), v = (b.collision || "flip").split(" "), w = {};
102
+ r = m(s);
103
+ if (s[0].preventDefault) {
104
+ b.at = "left top";
105
+ }
106
+ n = r.width;
107
+ o = r.height;
108
+ p = r.offset;
109
+ q = a.extend({}, p);
110
+ a.each([ "my", "at" ], function() {
111
+ var a = (b[this] || "").split(" "), c, d;
112
+ if (a.length === 1) {
113
+ a = e.test(a[0]) ? a.concat([ "center" ]) : f.test(a[0]) ? [ "center" ].concat(a) : [ "center", "center" ];
114
+ }
115
+ a[0] = e.test(a[0]) ? a[0] : "center";
116
+ a[1] = f.test(a[1]) ? a[1] : "center";
117
+ c = g.exec(a[0]);
118
+ d = g.exec(a[1]);
119
+ w[this] = [ c ? c[0] : 0, d ? d[0] : 0 ];
120
+ b[this] = [ h.exec(a[0])[0], h.exec(a[1])[0] ];
121
+ });
122
+ if (v.length === 1) {
123
+ v[1] = v[0];
124
+ }
125
+ if (b.at[0] === "right") {
126
+ q.left += n;
127
+ } else if (b.at[0] === "center") {
128
+ q.left += n / 2;
129
+ }
130
+ if (b.at[1] === "bottom") {
131
+ q.top += o;
132
+ } else if (b.at[1] === "center") {
133
+ q.top += o / 2;
134
+ }
135
+ i = k(w.at, n, o);
136
+ q.left += i[0];
137
+ q.top += i[1];
138
+ return this.each(function() {
139
+ var e, f, g = a(this), h = g.outerWidth(), j = g.outerHeight(), m = l(this, "marginLeft"), r = l(this, "marginTop"), x = h + m + l(this, "marginRight") + u.width, y = j + r + l(this, "marginBottom") + u.height, z = a.extend({}, q), A = k(w.my, g.outerWidth(), g.outerHeight());
140
+ if (b.my[0] === "right") {
141
+ z.left -= h;
142
+ } else if (b.my[0] === "center") {
143
+ z.left -= h / 2;
144
+ }
145
+ if (b.my[1] === "bottom") {
146
+ z.top -= j;
147
+ } else if (b.my[1] === "center") {
148
+ z.top -= j / 2;
149
+ }
150
+ z.left += A[0];
151
+ z.top += A[1];
152
+ e = {
153
+ marginLeft: m,
154
+ marginTop: r
155
+ };
156
+ a.each([ "left", "top" ], function(c, d) {
157
+ if (a.ui.pos[v[c]]) {
158
+ a.ui.pos[v[c]][d](z, {
159
+ targetWidth: n,
160
+ targetHeight: o,
161
+ elemWidth: h,
162
+ elemHeight: j,
163
+ collisionPosition: e,
164
+ collisionWidth: x,
165
+ collisionHeight: y,
166
+ offset: [ i[0] + A[0], i[1] + A[1] ],
167
+ my: b.my,
168
+ at: b.at,
169
+ within: t,
170
+ elem: g
171
+ });
172
+ }
173
+ });
174
+ if (b.using) {
175
+ f = function(a) {
176
+ var e = p.left - z.left, f = e + n - h, i = p.top - z.top, k = i + o - j, l = {
177
+ target: {
178
+ element: s,
179
+ left: p.left,
180
+ top: p.top,
181
+ width: n,
182
+ height: o
183
+ },
184
+ element: {
185
+ element: g,
186
+ left: z.left,
187
+ top: z.top,
188
+ width: h,
189
+ height: j
190
+ },
191
+ horizontal: f < 0 ? "left" : e > 0 ? "right" : "center",
192
+ vertical: k < 0 ? "top" : i > 0 ? "bottom" : "middle"
193
+ };
194
+ if (n < h && d(e + f) < n) {
195
+ l.horizontal = "center";
196
+ }
197
+ if (o < j && d(i + k) < o) {
198
+ l.vertical = "middle";
199
+ }
200
+ if (c(d(e), d(f)) > c(d(i), d(k))) {
201
+ l.important = "horizontal";
202
+ } else {
203
+ l.important = "vertical";
204
+ }
205
+ b.using.call(this, a, l);
206
+ };
207
+ }
208
+ g.offset(a.extend(z, {
209
+ using: f
210
+ }));
211
+ });
212
+ };
213
+ a.ui.pos = {
214
+ _trigger: function(a, b, c, d) {
215
+ if (b.elem) {
216
+ b.elem.trigger({
217
+ type: c,
218
+ position: a,
219
+ positionData: b,
220
+ triggered: d
221
+ });
222
+ }
223
+ },
224
+ fit: {
225
+ left: function(b, d) {
226
+ a.ui.pos._trigger(b, d, "posCollide", "fitLeft");
227
+ var e = d.within, f = e.isWindow ? e.scrollLeft : e.offset.left, g = e.width, h = b.left - d.collisionPosition.marginLeft, i = f - h, j = h + d.collisionWidth - g - f, k;
228
+ if (d.collisionWidth > g) {
229
+ if (i > 0 && j <= 0) {
230
+ k = b.left + i + d.collisionWidth - g - f;
231
+ b.left += i - k;
232
+ } else if (j > 0 && i <= 0) {
233
+ b.left = f;
234
+ } else {
235
+ if (i > j) {
236
+ b.left = f + g - d.collisionWidth;
237
+ } else {
238
+ b.left = f;
239
+ }
240
+ }
241
+ } else if (i > 0) {
242
+ b.left += i;
243
+ } else if (j > 0) {
244
+ b.left -= j;
245
+ } else {
246
+ b.left = c(b.left - h, b.left);
247
+ }
248
+ a.ui.pos._trigger(b, d, "posCollided", "fitLeft");
249
+ },
250
+ top: function(b, d) {
251
+ a.ui.pos._trigger(b, d, "posCollide", "fitTop");
252
+ var e = d.within, f = e.isWindow ? e.scrollTop : e.offset.top, g = d.within.height, h = b.top - d.collisionPosition.marginTop, i = f - h, j = h + d.collisionHeight - g - f, k;
253
+ if (d.collisionHeight > g) {
254
+ if (i > 0 && j <= 0) {
255
+ k = b.top + i + d.collisionHeight - g - f;
256
+ b.top += i - k;
257
+ } else if (j > 0 && i <= 0) {
258
+ b.top = f;
259
+ } else {
260
+ if (i > j) {
261
+ b.top = f + g - d.collisionHeight;
262
+ } else {
263
+ b.top = f;
264
+ }
265
+ }
266
+ } else if (i > 0) {
267
+ b.top += i;
268
+ } else if (j > 0) {
269
+ b.top -= j;
270
+ } else {
271
+ b.top = c(b.top - h, b.top);
272
+ }
273
+ a.ui.pos._trigger(b, d, "posCollided", "fitTop");
274
+ }
275
+ },
276
+ flip: {
277
+ left: function(b, c) {
278
+ a.ui.pos._trigger(b, c, "posCollide", "flipLeft");
279
+ var e = c.within, f = e.offset.left + e.scrollLeft, g = e.width, h = e.isWindow ? e.scrollLeft : e.offset.left, i = b.left - c.collisionPosition.marginLeft, j = i - h, k = i + c.collisionWidth - g - h, l = c.my[0] === "left" ? -c.elemWidth : c.my[0] === "right" ? c.elemWidth : 0, m = c.at[0] === "left" ? c.targetWidth : c.at[0] === "right" ? -c.targetWidth : 0, n = -2 * c.offset[0], o, p;
280
+ if (j < 0) {
281
+ o = b.left + l + m + n + c.collisionWidth - g - f;
282
+ if (o < 0 || o < d(j)) {
283
+ b.left += l + m + n;
284
+ }
285
+ } else if (k > 0) {
286
+ p = b.left - c.collisionPosition.marginLeft + l + m + n - h;
287
+ if (p > 0 || d(p) < k) {
288
+ b.left += l + m + n;
289
+ }
290
+ }
291
+ a.ui.pos._trigger(b, c, "posCollided", "flipLeft");
292
+ },
293
+ top: function(b, c) {
294
+ a.ui.pos._trigger(b, c, "posCollide", "flipTop");
295
+ var e = c.within, f = e.offset.top + e.scrollTop, g = e.height, h = e.isWindow ? e.scrollTop : e.offset.top, i = b.top - c.collisionPosition.marginTop, j = i - h, k = i + c.collisionHeight - g - h, l = c.my[1] === "top", m = l ? -c.elemHeight : c.my[1] === "bottom" ? c.elemHeight : 0, n = c.at[1] === "top" ? c.targetHeight : c.at[1] === "bottom" ? -c.targetHeight : 0, o = -2 * c.offset[1], p, q;
296
+ if (j < 0) {
297
+ q = b.top + m + n + o + c.collisionHeight - g - f;
298
+ if (q < 0 || q < d(j)) {
299
+ b.top += m + n + o;
300
+ }
301
+ } else if (k > 0) {
302
+ p = b.top - c.collisionPosition.marginTop + m + n + o - h;
303
+ if (p > 0 || d(p) < k) {
304
+ b.top += m + n + o;
305
+ }
306
+ }
307
+ a.ui.pos._trigger(b, c, "posCollided", "flipTop");
308
+ }
309
+ },
310
+ flipfit: {
311
+ left: function() {
312
+ a.ui.pos.flip.left.apply(this, arguments);
313
+ a.ui.pos.fit.left.apply(this, arguments);
314
+ },
315
+ top: function() {
316
+ a.ui.pos.flip.top.apply(this, arguments);
317
+ a.ui.pos.fit.top.apply(this, arguments);
318
+ }
319
+ }
320
+ };
321
+ (function() {
322
+ var b, c, d, e, f, g = document.getElementsByTagName("body")[0], h = document.createElement("div");
323
+ b = document.createElement(g ? "div" : "body");
324
+ d = {
325
+ visibility: "hidden",
326
+ width: 0,
327
+ height: 0,
328
+ border: 0,
329
+ margin: 0,
330
+ background: "none"
331
+ };
332
+ if (g) {
333
+ a.extend(d, {
334
+ position: "absolute",
335
+ left: "-1000px",
336
+ top: "-1000px"
337
+ });
338
+ }
339
+ for (f in d) {
340
+ b.style[f] = d[f];
341
+ }
342
+ b.appendChild(h);
343
+ c = g || document.documentElement;
344
+ c.insertBefore(b, c.firstChild);
345
+ h.style.cssText = "position: absolute; left: 10.7432222px;";
346
+ e = a(h).offset().left;
347
+ a.support.offsetFractions = e > 10 && e < 11;
348
+ b.innerHTML = "";
349
+ c.removeChild(b);
350
+ })();
351
+ })();
352
+ var c = a.ui.position;
353
+ });
354
+
355
+ (function(a) {
356
+ "use strict";
357
+ if (typeof define === "function" && define.amd) {
358
+ define([ "jquery" ], a);
359
+ } else if (window.jQuery && !window.jQuery.fn.iconpicker) {
360
+ a(window.jQuery);
361
+ }
362
+ })(function(a) {
363
+ "use strict";
364
+ var b = {
365
+ isEmpty: function(a) {
366
+ return a === false || a === "" || a === null || a === undefined;
367
+ },
368
+ isEmptyObject: function(a) {
369
+ return this.isEmpty(a) === true || a.length === 0;
370
+ },
371
+ isElement: function(b) {
372
+ return a(b).length > 0;
373
+ },
374
+ isString: function(a) {
375
+ return typeof a === "string" || a instanceof String;
376
+ },
377
+ isArray: function(b) {
378
+ return a.isArray(b);
379
+ },
380
+ inArray: function(b, c) {
381
+ return a.inArray(b, c) !== -1;
382
+ },
383
+ throwError: function(a) {
384
+ throw "Font Awesome Icon Picker Exception: " + a;
385
+ }
386
+ };
387
+ var c = function(d, e) {
388
+ this._id = c._idCounter++;
389
+ this.element = a(d).addClass("iconpicker-element");
390
+ this._trigger("iconpickerCreate");
391
+ this.options = a.extend({}, c.defaultOptions, this.element.data(), e);
392
+ this.options.templates = a.extend({}, c.defaultOptions.templates, this.options.templates);
393
+ this.options.originalPlacement = this.options.placement;
394
+ this.container = b.isElement(this.options.container) ? a(this.options.container) : false;
395
+ if (this.container === false) {
396
+ if (this.element.is(".dropdown-toggle")) {
397
+ this.container = a("~ .dropdown-menu:first", this.element);
398
+ } else {
399
+ this.container = this.element.is("input,textarea,button,.btn") ? this.element.parent() : this.element;
400
+ }
401
+ }
402
+ this.container.addClass("iconpicker-container");
403
+ if (this.isDropdownMenu()) {
404
+ this.options.templates.search = false;
405
+ this.options.templates.buttons = false;
406
+ this.options.placement = "inline";
407
+ }
408
+ this.input = this.element.is("input,textarea") ? this.element.addClass("iconpicker-input") : false;
409
+ if (this.input === false) {
410
+ this.input = this.container.find(this.options.input);
411
+ if (!this.input.is("input,textarea")) {
412
+ this.input = false;
413
+ }
414
+ }
415
+ this.component = this.isDropdownMenu() ? this.container.parent().find(this.options.component) : this.container.find(this.options.component);
416
+ if (this.component.length === 0) {
417
+ this.component = false;
418
+ } else {
419
+ this.component.find("i").addClass("iconpicker-component");
420
+ }
421
+ this._createPopover();
422
+ this._createIconpicker();
423
+ if (this.getAcceptButton().length === 0) {
424
+ this.options.mustAccept = false;
425
+ }
426
+ if (this.isInputGroup()) {
427
+ this.container.parent().append(this.popover);
428
+ } else {
429
+ this.container.append(this.popover);
430
+ }
431
+ this._bindElementEvents();
432
+ this._bindWindowEvents();
433
+ this.update(this.options.selected);
434
+ if (this.isInline()) {
435
+ this.show();
436
+ }
437
+ this._trigger("iconpickerCreated");
438
+ };
439
+ c._idCounter = 0;
440
+ c.defaultOptions = {
441
+ title: false,
442
+ selected: false,
443
+ defaultValue: false,
444
+ placement: "bottom",
445
+ collision: "none",
446
+ animation: true,
447
+ hideOnSelect: false,
448
+ showFooter: false,
449
+ searchInFooter: false,
450
+ mustAccept: false,
451
+ selectedCustomClass: "bg-primary",
452
+ icons: [],
453
+ fullClassFormatter: function(a) {
454
+ return "fa " + a;
455
+ },
456
+ input: "input,.iconpicker-input",
457
+ inputSearch: false,
458
+ container: false,
459
+ component: ".input-group-addon,.iconpicker-component",
460
+ templates: {
461
+ popover: '<div class="iconpicker-popover popover"><div class="arrow"></div>' + '<div class="popover-title"></div><div class="popover-content"></div></div>',
462
+ footer: '<div class="popover-footer"></div>',
463
+ buttons: '<button class="iconpicker-btn iconpicker-btn-cancel btn btn-default btn-sm">Cancel</button>' + ' <button class="iconpicker-btn iconpicker-btn-accept btn btn-primary btn-sm">Accept</button>',
464
+ search: '<input type="search" class="form-control iconpicker-search" placeholder="Type to filter" />',
465
+ iconpicker: '<div class="iconpicker"><div class="iconpicker-items"></div></div>',
466
+ iconpickerItem: '<a role="button" href="#" class="iconpicker-item"><i></i></a>'
467
+ }
468
+ };
469
+ c.batch = function(b, c) {
470
+ var d = Array.prototype.slice.call(arguments, 2);
471
+ return a(b).each(function() {
472
+ var b = a(this).data("iconpicker");
473
+ if (!!b) {
474
+ b[c].apply(b, d);
475
+ }
476
+ });
477
+ };
478
+ c.prototype = {
479
+ constructor: c,
480
+ options: {},
481
+ _id: 0,
482
+ _trigger: function(b, c) {
483
+ c = c || {};
484
+ this.element.trigger(a.extend({
485
+ type: b,
486
+ iconpickerInstance: this
487
+ }, c));
488
+ },
489
+ _createPopover: function() {
490
+ this.popover = a(this.options.templates.popover);
491
+ var c = this.popover.find(".popover-title");
492
+ if (!!this.options.title) {
493
+ c.append(a('<div class="popover-title-text">' + this.options.title + "</div>"));
494
+ }
495
+ if (this.hasSeparatedSearchInput() && !this.options.searchInFooter) {
496
+ c.append(this.options.templates.search);
497
+ } else if (!this.options.title) {
498
+ c.remove();
499
+ }
500
+ if (this.options.showFooter && !b.isEmpty(this.options.templates.footer)) {
501
+ var d = a(this.options.templates.footer);
502
+ if (this.hasSeparatedSearchInput() && this.options.searchInFooter) {
503
+ d.append(a(this.options.templates.search));
504
+ }
505
+ if (!b.isEmpty(this.options.templates.buttons)) {
506
+ d.append(a(this.options.templates.buttons));
507
+ }
508
+ this.popover.append(d);
509
+ }
510
+ if (this.options.animation === true) {
511
+ this.popover.addClass("fade");
512
+ }
513
+ return this.popover;
514
+ },
515
+ _createIconpicker: function() {
516
+ var b = this;
517
+ this.iconpicker = a(this.options.templates.iconpicker);
518
+ var c = function(c) {
519
+ var d = a(this);
520
+ if (d.is("i")) {
521
+ d = d.parent();
522
+ }
523
+ b._trigger("iconpickerSelect", {
524
+ iconpickerItem: d,
525
+ iconpickerValue: b.iconpickerValue
526
+ });
527
+ if (b.options.mustAccept === false) {
528
+ b.update(d.data("iconpickerValue"));
529
+ b._trigger("iconpickerSelected", {
530
+ iconpickerItem: this,
531
+ iconpickerValue: b.iconpickerValue
532
+ });
533
+ } else {
534
+ b.update(d.data("iconpickerValue"), true);
535
+ }
536
+ if (b.options.hideOnSelect && b.options.mustAccept === false) {
537
+ b.hide();
538
+ }
539
+ c.preventDefault();
540
+ return false;
541
+ };
542
+ for (var d in this.options.icons) {
543
+ if (typeof this.options.icons[d] === "string") {
544
+ var e = a(this.options.templates.iconpickerItem);
545
+ e.find("i").addClass(this.options.fullClassFormatter(this.options.icons[d]));
546
+ e.data("iconpickerValue", this.options.icons[d]).on("click.iconpicker", c);
547
+ this.iconpicker.find(".iconpicker-items").append(e.attr("title", "." + this.options.icons[d]));
548
+ }
549
+ }
550
+ this.popover.find(".popover-content").append(this.iconpicker);
551
+ return this.iconpicker;
552
+ },
553
+ _isEventInsideIconpicker: function(b) {
554
+ var c = a(b.target);
555
+ if ((!c.hasClass("iconpicker-element") || c.hasClass("iconpicker-element") && !c.is(this.element)) && c.parents(".iconpicker-popover").length === 0) {
556
+ return false;
557
+ }
558
+ return true;
559
+ },
560
+ _bindElementEvents: function() {
561
+ var c = this;
562
+ this.getSearchInput().on("keyup.iconpicker", function() {
563
+ c.filter(a(this).val().toLowerCase());
564
+ });
565
+ this.getAcceptButton().on("click.iconpicker", function() {
566
+ var a = c.iconpicker.find(".iconpicker-selected").get(0);
567
+ c.update(c.iconpickerValue);
568
+ c._trigger("iconpickerSelected", {
569
+ iconpickerItem: a,
570
+ iconpickerValue: c.iconpickerValue
571
+ });
572
+ if (!c.isInline()) {
573
+ c.hide();
574
+ }
575
+ });
576
+ this.getCancelButton().on("click.iconpicker", function() {
577
+ if (!c.isInline()) {
578
+ c.hide();
579
+ }
580
+ });
581
+ this.element.on("focus.iconpicker", function(a) {
582
+ c.show();
583
+ a.stopPropagation();
584
+ });
585
+ if (this.hasComponent()) {
586
+ this.component.on("click.iconpicker", function() {
587
+ c.toggle();
588
+ });
589
+ }
590
+ if (this.hasInput()) {
591
+ this.input.on("keyup.iconpicker", function(d) {
592
+ if (!b.inArray(d.keyCode, [ 38, 40, 37, 39, 16, 17, 18, 9, 8, 91, 93, 20, 46, 186, 190, 46, 78, 188, 44, 86 ])) {
593
+ c.update();
594
+ } else {
595
+ c._updateFormGroupStatus(c.getValid(this.value) !== false);
596
+ }
597
+ if (c.options.inputSearch === true) {
598
+ c.filter(a(this).val().toLowerCase());
599
+ }
600
+ });
601
+ }
602
+ },
603
+ _bindWindowEvents: function() {
604
+ var b = a(window.document);
605
+ var c = this;
606
+ var d = ".iconpicker.inst" + this._id;
607
+ a(window).on("resize.iconpicker" + d + " orientationchange.iconpicker" + d, function(a) {
608
+ if (c.popover.hasClass("in")) {
609
+ c.updatePlacement();
610
+ }
611
+ });
612
+ if (!c.isInline()) {
613
+ b.on("mouseup" + d, function(a) {
614
+ if (!c._isEventInsideIconpicker(a) && !c.isInline()) {
615
+ c.hide();
616
+ }
617
+ a.stopPropagation();
618
+ a.preventDefault();
619
+ return false;
620
+ });
621
+ }
622
+ return false;
623
+ },
624
+ _unbindElementEvents: function() {
625
+ this.popover.off(".iconpicker");
626
+ this.element.off(".iconpicker");
627
+ if (this.hasInput()) {
628
+ this.input.off(".iconpicker");
629
+ }
630
+ if (this.hasComponent()) {
631
+ this.component.off(".iconpicker");
632
+ }
633
+ if (this.hasContainer()) {
634
+ this.container.off(".iconpicker");
635
+ }
636
+ },
637
+ _unbindWindowEvents: function() {
638
+ a(window).off(".iconpicker.inst" + this._id);
639
+ a(window.document).off(".iconpicker.inst" + this._id);
640
+ },
641
+ updatePlacement: function(b, c) {
642
+ b = b || this.options.placement;
643
+ this.options.placement = b;
644
+ c = c || this.options.collision;
645
+ c = c === true ? "flip" : c;
646
+ var d = {
647
+ at: "right bottom",
648
+ my: "right top",
649
+ of: this.hasInput() && !this.isInputGroup() ? this.input : this.container,
650
+ collision: c === true ? "flip" : c,
651
+ within: window
652
+ };
653
+ this.popover.removeClass("inline topLeftCorner topLeft top topRight topRightCorner " + "rightTop right rightBottom bottomRight bottomRightCorner " + "bottom bottomLeft bottomLeftCorner leftBottom left leftTop");
654
+ if (typeof b === "object") {
655
+ return this.popover.pos(a.extend({}, d, b));
656
+ }
657
+ switch (b) {
658
+ case "inline":
659
+ {
660
+ d = false;
661
+ }
662
+ break;
663
+
664
+ case "topLeftCorner":
665
+ {
666
+ d.my = "right bottom";
667
+ d.at = "left top";
668
+ }
669
+ break;
670
+
671
+ case "topLeft":
672
+ {
673
+ d.my = "left bottom";
674
+ d.at = "left top";
675
+ }
676
+ break;
677
+
678
+ case "top":
679
+ {
680
+ d.my = "center bottom";
681
+ d.at = "center top";
682
+ }
683
+ break;
684
+
685
+ case "topRight":
686
+ {
687
+ d.my = "right bottom";
688
+ d.at = "right top";
689
+ }
690
+ break;
691
+
692
+ case "topRightCorner":
693
+ {
694
+ d.my = "left bottom";
695
+ d.at = "right top";
696
+ }
697
+ break;
698
+
699
+ case "rightTop":
700
+ {
701
+ d.my = "left bottom";
702
+ d.at = "right center";
703
+ }
704
+ break;
705
+
706
+ case "right":
707
+ {
708
+ d.my = "left center";
709
+ d.at = "right center";
710
+ }
711
+ break;
712
+
713
+ case "rightBottom":
714
+ {
715
+ d.my = "left top";
716
+ d.at = "right center";
717
+ }
718
+ break;
719
+
720
+ case "bottomRightCorner":
721
+ {
722
+ d.my = "left top";
723
+ d.at = "right bottom";
724
+ }
725
+ break;
726
+
727
+ case "bottomRight":
728
+ {
729
+ d.my = "right top";
730
+ d.at = "right bottom";
731
+ }
732
+ break;
733
+
734
+ case "bottom":
735
+ {
736
+ d.my = "center top";
737
+ d.at = "center bottom";
738
+ }
739
+ break;
740
+
741
+ case "bottomLeft":
742
+ {
743
+ d.my = "left top";
744
+ d.at = "left bottom";
745
+ }
746
+ break;
747
+
748
+ case "bottomLeftCorner":
749
+ {
750
+ d.my = "right top";
751
+ d.at = "left bottom";
752
+ }
753
+ break;
754
+
755
+ case "leftBottom":
756
+ {
757
+ d.my = "right top";
758
+ d.at = "left center";
759
+ }
760
+ break;
761
+
762
+ case "left":
763
+ {
764
+ d.my = "right center";
765
+ d.at = "left center";
766
+ }
767
+ break;
768
+
769
+ case "leftTop":
770
+ {
771
+ d.my = "right bottom";
772
+ d.at = "left center";
773
+ }
774
+ break;
775
+
776
+ default:
777
+ {
778
+ return false;
779
+ }
780
+ break;
781
+ }
782
+ this.popover.css({
783
+ display: this.options.placement === "inline" ? "" : "block"
784
+ });
785
+ if (d !== false) {
786
+ this.popover.pos(d).css("maxWidth", a(window).width() - this.container.offset().left - 5);
787
+ } else {
788
+ this.popover.css({
789
+ top: "auto",
790
+ right: "auto",
791
+ bottom: "auto",
792
+ left: "auto",
793
+ maxWidth: "none"
794
+ });
795
+ }
796
+ this.popover.addClass(this.options.placement);
797
+ return true;
798
+ },
799
+ _updateComponents: function() {
800
+ this.iconpicker.find(".iconpicker-item.iconpicker-selected").removeClass("iconpicker-selected " + this.options.selectedCustomClass);
801
+ if (this.iconpickerValue) {
802
+ this.iconpicker.find("." + this.options.fullClassFormatter(this.iconpickerValue).replace(/ /g, ".")).parent().addClass("iconpicker-selected " + this.options.selectedCustomClass);
803
+ }
804
+ if (this.hasComponent()) {
805
+ var a = this.component.find("i");
806
+ if (a.length > 0) {
807
+ a.attr("class", this.options.fullClassFormatter(this.iconpickerValue));
808
+ } else {
809
+ this.component.html(this.getHtml());
810
+ }
811
+ }
812
+ },
813
+ _updateFormGroupStatus: function(a) {
814
+ if (this.hasInput()) {
815
+ if (a !== false) {
816
+ this.input.parents(".form-group:first").removeClass("has-error");
817
+ } else {
818
+ this.input.parents(".form-group:first").addClass("has-error");
819
+ }
820
+ return true;
821
+ }
822
+ return false;
823
+ },
824
+ getValid: function(c) {
825
+ if (!b.isString(c)) {
826
+ c = "";
827
+ }
828
+ var d = c === "";
829
+ c = a.trim(c);
830
+ if (b.inArray(c, this.options.icons) || d) {
831
+ return c;
832
+ }
833
+ return false;
834
+ },
835
+ setValue: function(a) {
836
+ var b = this.getValid(a);
837
+ if (b !== false) {
838
+ this.iconpickerValue = b;
839
+ this._trigger("iconpickerSetValue", {
840
+ iconpickerValue: b
841
+ });
842
+ return this.iconpickerValue;
843
+ } else {
844
+ this._trigger("iconpickerInvalid", {
845
+ iconpickerValue: a
846
+ });
847
+ return false;
848
+ }
849
+ },
850
+ getHtml: function() {
851
+ return '<i class="' + this.options.fullClassFormatter(this.iconpickerValue) + '"></i>';
852
+ },
853
+ setSourceValue: function(a) {
854
+ a = this.setValue(a);
855
+ if (a !== false && a !== "") {
856
+ if (this.hasInput()) {
857
+ this.input.val(this.iconpickerValue);
858
+ } else {
859
+ this.element.data("iconpickerValue", this.iconpickerValue);
860
+ }
861
+ this._trigger("iconpickerSetSourceValue", {
862
+ iconpickerValue: a
863
+ });
864
+ }
865
+ return a;
866
+ },
867
+ getSourceValue: function(a) {
868
+ a = a || this.options.defaultValue;
869
+ var b = a;
870
+ if (this.hasInput()) {
871
+ b = this.input.val();
872
+ } else {
873
+ b = this.element.data("iconpickerValue");
874
+ }
875
+ if (b === undefined || b === "" || b === null || b === false) {
876
+ b = a;
877
+ }
878
+ return b;
879
+ },
880
+ hasInput: function() {
881
+ return this.input !== false;
882
+ },
883
+ isInputSearch: function() {
884
+ return this.hasInput() && this.options.inputSearch === true;
885
+ },
886
+ isInputGroup: function() {
887
+ return this.container.is(".input-group");
888
+ },
889
+ isDropdownMenu: function() {
890
+ return this.container.is(".dropdown-menu");
891
+ },
892
+ hasSeparatedSearchInput: function() {
893
+ return this.options.templates.search !== false && !this.isInputSearch();
894
+ },
895
+ hasComponent: function() {
896
+ return this.component !== false;
897
+ },
898
+ hasContainer: function() {
899
+ return this.container !== false;
900
+ },
901
+ getAcceptButton: function() {
902
+ return this.popover.find(".iconpicker-btn-accept");
903
+ },
904
+ getCancelButton: function() {
905
+ return this.popover.find(".iconpicker-btn-cancel");
906
+ },
907
+ getSearchInput: function() {
908
+ return this.popover.find(".iconpicker-search");
909
+ },
910
+ filter: function(c) {
911
+ if (b.isEmpty(c)) {
912
+ this.iconpicker.find(".iconpicker-item").show();
913
+ return a(false);
914
+ } else {
915
+ var d = [];
916
+ this.iconpicker.find(".iconpicker-item").each(function() {
917
+ var b = a(this);
918
+ var e = b.attr("title").toLowerCase();
919
+ var f = false;
920
+ try {
921
+ f = new RegExp(c, "g");
922
+ } catch (a) {
923
+ f = false;
924
+ }
925
+ if (f !== false && e.match(f)) {
926
+ d.push(b);
927
+ b.show();
928
+ } else {
929
+ b.hide();
930
+ }
931
+ });
932
+ return d;
933
+ }
934
+ },
935
+ show: function() {
936
+ if (this.popover.hasClass("in")) {
937
+ return false;
938
+ }
939
+ a.iconpicker.batch(a(".iconpicker-popover.in:not(.inline)").not(this.popover), "hide");
940
+ this._trigger("iconpickerShow");
941
+ this.updatePlacement();
942
+ this.popover.addClass("in");
943
+ setTimeout(a.proxy(function() {
944
+ this.popover.css("display", this.isInline() ? "" : "block");
945
+ this._trigger("iconpickerShown");
946
+ }, this), this.options.animation ? 300 : 1);
947
+ },
948
+ hide: function() {
949
+ if (!this.popover.hasClass("in")) {
950
+ return false;
951
+ }
952
+ this._trigger("iconpickerHide");
953
+ this.popover.removeClass("in");
954
+ setTimeout(a.proxy(function() {
955
+ this.popover.css("display", "none");
956
+ this.getSearchInput().val("");
957
+ this.filter("");
958
+ this._trigger("iconpickerHidden");
959
+ }, this), this.options.animation ? 300 : 1);
960
+ },
961
+ toggle: function() {
962
+ if (this.popover.is(":visible")) {
963
+ this.hide();
964
+ } else {
965
+ this.show(true);
966
+ }
967
+ },
968
+ update: function(a, b) {
969
+ a = a ? a : this.getSourceValue(this.iconpickerValue);
970
+ this._trigger("iconpickerUpdate");
971
+ if (b === true) {
972
+ a = this.setValue(a);
973
+ } else {
974
+ a = this.setSourceValue(a);
975
+ this._updateFormGroupStatus(a !== false);
976
+ }
977
+ if (a !== false) {
978
+ this._updateComponents();
979
+ }
980
+ this._trigger("iconpickerUpdated");
981
+ return a;
982
+ },
983
+ destroy: function() {
984
+ this._trigger("iconpickerDestroy");
985
+ this.element.removeData("iconpicker").removeData("iconpickerValue").removeClass("iconpicker-element");
986
+ this._unbindElementEvents();
987
+ this._unbindWindowEvents();
988
+ a(this.popover).remove();
989
+ this._trigger("iconpickerDestroyed");
990
+ },
991
+ disable: function() {
992
+ if (this.hasInput()) {
993
+ this.input.prop("disabled", true);
994
+ return true;
995
+ }
996
+ return false;
997
+ },
998
+ enable: function() {
999
+ if (this.hasInput()) {
1000
+ this.input.prop("disabled", false);
1001
+ return true;
1002
+ }
1003
+ return false;
1004
+ },
1005
+ isDisabled: function() {
1006
+ if (this.hasInput()) {
1007
+ return this.input.prop("disabled") === true;
1008
+ }
1009
+ return false;
1010
+ },
1011
+ isInline: function() {
1012
+ return this.options.placement === "inline" || this.popover.hasClass("inline");
1013
+ }
1014
+ };
1015
+ a.iconpicker = c;
1016
+ a.fn.iconpicker = function(b) {
1017
+ return this.each(function() {
1018
+ var d = a(this);
1019
+ if (!d.data("iconpicker")) {
1020
+ d.data("iconpicker", new c(this, typeof b === "object" ? b : {}));
1021
+ }
1022
+ });
1023
+ };
1024
+ c.defaultOptions.icons = [ "fa-500px", "fa-adjust", "fa-adn", "fa-align-center", "fa-align-justify", "fa-align-left", "fa-align-right", "fa-amazon", "fa-ambulance", "fa-american-sign-language-interpreting", "fa-anchor", "fa-android", "fa-angellist", "fa-angle-double-down", "fa-angle-double-left", "fa-angle-double-right", "fa-angle-double-up", "fa-angle-down", "fa-angle-left", "fa-angle-right", "fa-angle-up", "fa-apple", "fa-archive", "fa-area-chart", "fa-arrow-circle-down", "fa-arrow-circle-left", "fa-arrow-circle-o-down", "fa-arrow-circle-o-left", "fa-arrow-circle-o-right", "fa-arrow-circle-o-up", "fa-arrow-circle-right", "fa-arrow-circle-up", "fa-arrow-down", "fa-arrow-left", "fa-arrow-right", "fa-arrow-up", "fa-arrows", "fa-arrows-alt", "fa-arrows-h", "fa-arrows-v", "fa-asl-interpreting", "fa-assistive-listening-systems", "fa-asterisk", "fa-at", "fa-audio-description", "fa-automobile", "fa-backward", "fa-balance-scale", "fa-ban", "fa-bandcamp", "fa-bank", "fa-bar-chart", "fa-bar-chart-o", "fa-barcode", "fa-bars", "fa-bath", "fa-bathtub", "fa-battery", "fa-battery-0", "fa-battery-1", "fa-battery-2", "fa-battery-3", "fa-battery-4", "fa-battery-empty", "fa-battery-full", "fa-battery-half", "fa-battery-quarter", "fa-battery-three-quarters", "fa-bed", "fa-beer", "fa-behance", "fa-behance-square", "fa-bell", "fa-bell-o", "fa-bell-slash", "fa-bell-slash-o", "fa-bicycle", "fa-binoculars", "fa-birthday-cake", "fa-bitbucket", "fa-bitbucket-square", "fa-bitcoin", "fa-black-tie", "fa-blind", "fa-bluetooth", "fa-bluetooth-b", "fa-bold", "fa-bolt", "fa-bomb", "fa-book", "fa-bookmark", "fa-bookmark-o", "fa-braille", "fa-briefcase", "fa-btc", "fa-bug", "fa-building", "fa-building-o", "fa-bullhorn", "fa-bullseye", "fa-bus", "fa-buysellads", "fa-cab", "fa-calculator", "fa-calendar", "fa-calendar-check-o", "fa-calendar-minus-o", "fa-calendar-o", "fa-calendar-plus-o", "fa-calendar-times-o", "fa-camera", "fa-camera-retro", "fa-car", "fa-caret-down", "fa-caret-left", "fa-caret-right", "fa-caret-square-o-down", "fa-caret-square-o-left", "fa-caret-square-o-right", "fa-caret-square-o-up", "fa-caret-up", "fa-cart-arrow-down", "fa-cart-plus", "fa-cc", "fa-cc-amex", "fa-cc-diners-club", "fa-cc-discover", "fa-cc-jcb", "fa-cc-mastercard", "fa-cc-paypal", "fa-cc-stripe", "fa-cc-visa", "fa-certificate", "fa-chain", "fa-chain-broken", "fa-check", "fa-check-circle", "fa-check-circle-o", "fa-check-square", "fa-check-square-o", "fa-chevron-circle-down", "fa-chevron-circle-left", "fa-chevron-circle-right", "fa-chevron-circle-up", "fa-chevron-down", "fa-chevron-left", "fa-chevron-right", "fa-chevron-up", "fa-child", "fa-chrome", "fa-circle", "fa-circle-o", "fa-circle-o-notch", "fa-circle-thin", "fa-clipboard", "fa-clock-o", "fa-clone", "fa-close", "fa-cloud", "fa-cloud-download", "fa-cloud-upload", "fa-cny", "fa-code", "fa-code-fork", "fa-codepen", "fa-codiepie", "fa-coffee", "fa-cog", "fa-cogs", "fa-columns", "fa-comment", "fa-comment-o", "fa-commenting", "fa-commenting-o", "fa-comments", "fa-comments-o", "fa-compass", "fa-compress", "fa-connectdevelop", "fa-contao", "fa-copy", "fa-copyright", "fa-creative-commons", "fa-credit-card", "fa-credit-card-alt", "fa-crop", "fa-crosshairs", "fa-css3", "fa-cube", "fa-cubes", "fa-cut", "fa-cutlery", "fa-dashboard", "fa-dashcube", "fa-database", "fa-deaf", "fa-deafness", "fa-dedent", "fa-delicious", "fa-desktop", "fa-deviantart", "fa-diamond", "fa-digg", "fa-dollar", "fa-dot-circle-o", "fa-download", "fa-dribbble", "fa-drivers-license", "fa-drivers-license-o", "fa-dropbox", "fa-drupal", "fa-edge", "fa-edit", "fa-eercast", "fa-eject", "fa-ellipsis-h", "fa-ellipsis-v", "fa-empire", "fa-envelope", "fa-envelope-o", "fa-envelope-open", "fa-envelope-open-o", "fa-envelope-square", "fa-envira", "fa-eraser", "fa-etsy", "fa-eur", "fa-euro", "fa-exchange", "fa-exclamation", "fa-exclamation-circle", "fa-exclamation-triangle", "fa-expand", "fa-expeditedssl", "fa-external-link", "fa-external-link-square", "fa-eye", "fa-eye-slash", "fa-eyedropper", "fa-fa", "fa-facebook", "fa-facebook-f", "fa-facebook-official", "fa-facebook-square", "fa-fast-backward", "fa-fast-forward", "fa-fax", "fa-feed", "fa-female", "fa-fighter-jet", "fa-file", "fa-file-archive-o", "fa-file-audio-o", "fa-file-code-o", "fa-file-excel-o", "fa-file-image-o", "fa-file-movie-o", "fa-file-o", "fa-file-pdf-o", "fa-file-photo-o", "fa-file-picture-o", "fa-file-powerpoint-o", "fa-file-sound-o", "fa-file-text", "fa-file-text-o", "fa-file-video-o", "fa-file-word-o", "fa-file-zip-o", "fa-files-o", "fa-film", "fa-filter", "fa-fire", "fa-fire-extinguisher", "fa-firefox", "fa-first-order", "fa-flag", "fa-flag-checkered", "fa-flag-o", "fa-flash", "fa-flask", "fa-flickr", "fa-floppy-o", "fa-folder", "fa-folder-o", "fa-folder-open", "fa-folder-open-o", "fa-font", "fa-font-awesome", "fa-fonticons", "fa-fort-awesome", "fa-forumbee", "fa-forward", "fa-foursquare", "fa-free-code-camp", "fa-frown-o", "fa-futbol-o", "fa-gamepad", "fa-gavel", "fa-gbp", "fa-ge", "fa-gear", "fa-gears", "fa-genderless", "fa-get-pocket", "fa-gg", "fa-gg-circle", "fa-gift", "fa-git", "fa-git-square", "fa-github", "fa-github-alt", "fa-github-square", "fa-gitlab", "fa-gittip", "fa-glass", "fa-glide", "fa-glide-g", "fa-globe", "fa-google", "fa-google-plus", "fa-google-plus-circle", "fa-google-plus-official", "fa-google-plus-square", "fa-google-wallet", "fa-graduation-cap", "fa-gratipay", "fa-grav", "fa-group", "fa-h-square", "fa-hacker-news", "fa-hand-grab-o", "fa-hand-lizard-o", "fa-hand-o-down", "fa-hand-o-left", "fa-hand-o-right", "fa-hand-o-up", "fa-hand-paper-o", "fa-hand-peace-o", "fa-hand-pointer-o", "fa-hand-rock-o", "fa-hand-scissors-o", "fa-hand-spock-o", "fa-hand-stop-o", "fa-hard-of-hearing", "fa-hashtag", "fa-hdd-o", "fa-header", "fa-headphones", "fa-heart", "fa-heart-o", "fa-heartbeat", "fa-history", "fa-home", "fa-hospital-o", "fa-hotel", "fa-hourglass", "fa-hourglass-1", "fa-hourglass-2", "fa-hourglass-3", "fa-hourglass-end", "fa-hourglass-half", "fa-hourglass-o", "fa-hourglass-start", "fa-houzz", "fa-html5", "fa-i-cursor", "fa-id-badge", "fa-id-card", "fa-id-card-o", "fa-ils", "fa-image", "fa-imdb", "fa-inbox", "fa-indent", "fa-industry", "fa-info", "fa-info-circle", "fa-inr", "fa-instagram", "fa-institution", "fa-internet-explorer", "fa-intersex", "fa-ioxhost", "fa-italic", "fa-joomla", "fa-jpy", "fa-jsfiddle", "fa-key", "fa-keyboard-o", "fa-krw", "fa-language", "fa-laptop", "fa-lastfm", "fa-lastfm-square", "fa-leaf", "fa-leanpub", "fa-legal", "fa-lemon-o", "fa-level-down", "fa-level-up", "fa-life-bouy", "fa-life-buoy", "fa-life-ring", "fa-life-saver", "fa-lightbulb-o", "fa-line-chart", "fa-link", "fa-linkedin", "fa-linkedin-square", "fa-linux", "fa-list", "fa-list-alt", "fa-list-ol", "fa-list-ul", "fa-location-arrow", "fa-lock", "fa-long-arrow-down", "fa-long-arrow-left", "fa-long-arrow-right", "fa-long-arrow-up", "fa-low-vision", "fa-magic", "fa-magnet", "fa-mail-forward", "fa-mail-reply", "fa-mail-reply-all", "fa-male", "fa-map", "fa-map-marker", "fa-map-o", "fa-map-pin", "fa-map-signs", "fa-mars", "fa-mars-double", "fa-mars-stroke", "fa-mars-stroke-h", "fa-mars-stroke-v", "fa-maxcdn", "fa-meanpath", "fa-medium", "fa-medkit", "fa-meetup", "fa-meh-o", "fa-mercury", "fa-microchip", "fa-microphone", "fa-microphone-slash", "fa-minus", "fa-minus-circle", "fa-minus-square", "fa-minus-square-o", "fa-mixcloud", "fa-mobile", "fa-mobile-phone", "fa-modx", "fa-money", "fa-moon-o", "fa-mortar-board", "fa-motorcycle", "fa-mouse-pointer", "fa-music", "fa-navicon", "fa-neuter", "fa-newspaper-o", "fa-object-group", "fa-object-ungroup", "fa-odnoklassniki", "fa-odnoklassniki-square", "fa-opencart", "fa-openid", "fa-opera", "fa-optin-monster", "fa-outdent", "fa-pagelines", "fa-paint-brush", "fa-paper-plane", "fa-paper-plane-o", "fa-paperclip", "fa-paragraph", "fa-paste", "fa-pause", "fa-pause-circle", "fa-pause-circle-o", "fa-paw", "fa-paypal", "fa-pencil", "fa-pencil-square", "fa-pencil-square-o", "fa-percent", "fa-phone", "fa-phone-square", "fa-photo", "fa-picture-o", "fa-pie-chart", "fa-pied-piper", "fa-pied-piper-alt", "fa-pied-piper-pp", "fa-pinterest", "fa-pinterest-p", "fa-pinterest-square", "fa-plane", "fa-play", "fa-play-circle", "fa-play-circle-o", "fa-plug", "fa-plus", "fa-plus-circle", "fa-plus-square", "fa-plus-square-o", "fa-podcast", "fa-power-off", "fa-print", "fa-product-hunt", "fa-puzzle-piece", "fa-qq", "fa-qrcode", "fa-question", "fa-question-circle", "fa-question-circle-o", "fa-quora", "fa-quote-left", "fa-quote-right", "fa-ra", "fa-random", "fa-ravelry", "fa-rebel", "fa-recycle", "fa-reddit", "fa-reddit-alien", "fa-reddit-square", "fa-refresh", "fa-registered", "fa-remove", "fa-renren", "fa-reorder", "fa-repeat", "fa-reply", "fa-reply-all", "fa-resistance", "fa-retweet", "fa-rmb", "fa-road", "fa-rocket", "fa-rotate-left", "fa-rotate-right", "fa-rouble", "fa-rss", "fa-rss-square", "fa-rub", "fa-ruble", "fa-rupee", "fa-s15", "fa-safari", "fa-save", "fa-scissors", "fa-scribd", "fa-search", "fa-search-minus", "fa-search-plus", "fa-sellsy", "fa-send", "fa-send-o", "fa-server", "fa-share", "fa-share-alt", "fa-share-alt-square", "fa-share-square", "fa-share-square-o", "fa-shekel", "fa-sheqel", "fa-shield", "fa-ship", "fa-shirtsinbulk", "fa-shopping-bag", "fa-shopping-basket", "fa-shopping-cart", "fa-shower", "fa-sign-in", "fa-sign-language", "fa-sign-out", "fa-signal", "fa-signing", "fa-simplybuilt", "fa-sitemap", "fa-skyatlas", "fa-skype", "fa-slack", "fa-sliders", "fa-slideshare", "fa-smile-o", "fa-snapchat", "fa-snapchat-ghost", "fa-snapchat-square", "fa-snowflake-o", "fa-soccer-ball-o", "fa-sort", "fa-sort-alpha-asc", "fa-sort-alpha-desc", "fa-sort-amount-asc", "fa-sort-amount-desc", "fa-sort-asc", "fa-sort-desc", "fa-sort-down", "fa-sort-numeric-asc", "fa-sort-numeric-desc", "fa-sort-up", "fa-soundcloud", "fa-space-shuttle", "fa-spinner", "fa-spoon", "fa-spotify", "fa-square", "fa-square-o", "fa-stack-exchange", "fa-stack-overflow", "fa-star", "fa-star-half", "fa-star-half-empty", "fa-star-half-full", "fa-star-half-o", "fa-star-o", "fa-steam", "fa-steam-square", "fa-step-backward", "fa-step-forward", "fa-stethoscope", "fa-sticky-note", "fa-sticky-note-o", "fa-stop", "fa-stop-circle", "fa-stop-circle-o", "fa-street-view", "fa-strikethrough", "fa-stumbleupon", "fa-stumbleupon-circle", "fa-subscript", "fa-subway", "fa-suitcase", "fa-sun-o", "fa-superpowers", "fa-superscript", "fa-support", "fa-table", "fa-tablet", "fa-tachometer", "fa-tag", "fa-tags", "fa-tasks", "fa-taxi", "fa-telegram", "fa-television", "fa-tencent-weibo", "fa-terminal", "fa-text-height", "fa-text-width", "fa-th", "fa-th-large", "fa-th-list", "fa-themeisle", "fa-thermometer", "fa-thermometer-0", "fa-thermometer-1", "fa-thermometer-2", "fa-thermometer-3", "fa-thermometer-4", "fa-thermometer-empty", "fa-thermometer-full", "fa-thermometer-half", "fa-thermometer-quarter", "fa-thermometer-three-quarters", "fa-thumb-tack", "fa-thumbs-down", "fa-thumbs-o-down", "fa-thumbs-o-up", "fa-thumbs-up", "fa-ticket", "fa-times", "fa-times-circle", "fa-times-circle-o", "fa-times-rectangle", "fa-times-rectangle-o", "fa-tint", "fa-toggle-down", "fa-toggle-left", "fa-toggle-off", "fa-toggle-on", "fa-toggle-right", "fa-toggle-up", "fa-trademark", "fa-train", "fa-transgender", "fa-transgender-alt", "fa-trash", "fa-trash-o", "fa-tree", "fa-trello", "fa-tripadvisor", "fa-trophy", "fa-truck", "fa-try", "fa-tty", "fa-tumblr", "fa-tumblr-square", "fa-turkish-lira", "fa-tv", "fa-twitch", "fa-twitter", "fa-twitter-square", "fa-umbrella", "fa-underline", "fa-undo", "fa-universal-access", "fa-university", "fa-unlink", "fa-unlock", "fa-unlock-alt", "fa-unsorted", "fa-upload", "fa-usb", "fa-usd", "fa-user", "fa-user-circle", "fa-user-circle-o", "fa-user-md", "fa-user-o", "fa-user-plus", "fa-user-secret", "fa-user-times", "fa-users", "fa-vcard", "fa-vcard-o", "fa-venus", "fa-venus-double", "fa-venus-mars", "fa-viacoin", "fa-viadeo", "fa-viadeo-square", "fa-video-camera", "fa-vimeo", "fa-vimeo-square", "fa-vine", "fa-vk", "fa-volume-control-phone", "fa-volume-down", "fa-volume-off", "fa-volume-up", "fa-warning", "fa-wechat", "fa-weibo", "fa-weixin", "fa-whatsapp", "fa-wheelchair", "fa-wheelchair-alt", "fa-wifi", "fa-wikipedia-w", "fa-window-close", "fa-window-close-o", "fa-window-maximize", "fa-window-minimize", "fa-window-restore", "fa-windows", "fa-won", "fa-wordpress", "fa-wpbeginner", "fa-wpexplorer", "fa-wpforms", "fa-wrench", "fa-xing", "fa-xing-square", "fa-y-combinator", "fa-y-combinator-square", "fa-yahoo", "fa-yc", "fa-yc-square", "fa-yelp", "fa-yen", "fa-yoast", "fa-youtube", "fa-youtube-play", "fa-youtube-square" ];
1025
  });
js/themes/classic.js CHANGED
@@ -1,167 +1,168 @@
1
- jQuery(document).on("wplc_minimize_chat", function( e ) {
2
- jQuery('#wp-live-chat').height("");
3
- if(jQuery("#wp-live-chat").attr("original_pos") === "bottom_right"){
4
- jQuery("#wp-live-chat").css("left", "");
5
- jQuery("#wp-live-chat").css("bottom", "0");
6
- jQuery("#wp-live-chat").css("right", "100px");
7
- } else if(jQuery("#wp-live-chat").attr("original_pos") === "bottom_left"){
8
- jQuery("#wp-live-chat").css("left", "100px");
9
- jQuery("#wp-live-chat").css("bottom", "0");
10
- jQuery("#wp-live-chat").css("right", "");
11
- } else if(jQuery("#wp-live-chat").attr("original_pos") === "left"){
12
- jQuery("#wp-live-chat").css("left", "0");
13
- jQuery("#wp-live-chat").css("bottom", "100px");
14
- jQuery("#wp-live-chat").css("width", "");
15
- jQuery("#wp-live-chat").css("height", "");
16
- } else if(jQuery("#wp-live-chat").attr("original_pos") === "right"){
17
- jQuery("#wp-live-chat").css("left", "");
18
- jQuery("#wp-live-chat").css("right", "0");
19
- jQuery("#wp-live-chat").css("bottom", "100px");
20
- jQuery("#wp-live-chat").css("width", "");
21
- jQuery("#wp-live-chat").css("height", "");
22
- }
23
- jQuery('#wp-live-chat').addClass("wplc_close");
24
- jQuery('#wp-live-chat').removeClass("wplc_open");
25
- //jQuery("#wp-live-chat").css(jQuery("#wp-live-chat").attr("original_pos"), "100px");
26
- jQuery("#wp-live-chat").css("top", "");
27
- jQuery("#wp-live-chat-1").show();
28
- jQuery("#wp-live-chat-1").css('cursor', 'pointer');
29
- jQuery("#wp-live-chat-2").hide();
30
- jQuery("#wp-live-chat-3").hide();
31
- jQuery("#wp-live-chat-4").hide();
32
- jQuery("#wplc_social_holder").hide();
33
- jQuery("#nifty_ratings_holder").hide();
34
- jQuery("#wp-live-chat-react").hide();
35
- jQuery("#wp-live-chat-minimize").hide();
36
- });
37
- jQuery(document).on("click", "#wp-live-chat", function( e ){
38
-
39
- });
40
-
41
- jQuery(document).on("wplc_start_chat", function( e ) {
42
- jQuery("#wp-live-chat-2-inner").hide("slow");
43
- /* changed in version 7 as we now allow users to start typing immediately */
44
- /* jQuery("#wp-live-chat-3").show(); */
45
- jQuery.event.trigger({type: "wplc_open_chat_1"});
46
- jQuery.event.trigger({type: "wplc_open_chat_2", wplc_online: wplc_online});
47
- });
48
- jQuery(document).on( "wplc_open_chat_1", function( e ) {
49
-
50
- jQuery('#wp-live-chat').removeClass("wplc_close");
51
- jQuery('#wp-live-chat').addClass("wplc_open");
52
- jQuery("#wp-live-chat-react").hide();
53
- jQuery("#wp-live-chat-header").css('cursor', 'all-scroll');
54
- Cookies.set('wplc_hide', "", { expires: 1, path: '/' });
55
- jQuery("#wp-live-chat-minimize").show();
56
-
57
- /* set the width again as jQuery sometimes messes this up completely. */
58
- if(jQuery("#wp-live-chat").attr("original_pos") === "left"){
59
- jQuery("#wp-live-chat").css("width", "280px");
60
- jQuery("#wp-live-chat").css("height", "auto !important");
61
- } else if(jQuery("#wp-live-chat").attr("original_pos") === "right"){
62
- jQuery("#wp-live-chat").css("width", "280px");
63
- jQuery("#wp-live-chat").css("height", "auto !important");
64
- }
65
-
66
-
67
- jQuery(function() {
68
- jQuery( "#wp-live-chat" ).draggable({
69
- handle: "#wp-live-chat-header",
70
- drag: function( event, ui ) {
71
- jQuery(this).css("right","");
72
- jQuery(this).css("bottom","inherit");
73
- }
74
- });
75
- });
76
-
77
-
78
- });
79
-
80
-
81
- jQuery(document).on( "wplc_open_chat_2", function( e ) {
82
-
83
- jQuery("#wp-live-chat-2").hide();
84
-
85
- if(!jQuery("#wp-live-chat").hasClass("wplc_open")){
86
- jQuery("#wplc_chatmsg").focus();
87
- }
88
-
89
- jQuery("#wp-live-chat-header").addClass("active");
90
- jQuery("#wp-live-chat").addClass("mobile-active");
91
-
92
- wplc_chat_status = Cookies.get('wplc_chat_status');
93
- if (typeof e.wplc_online !== "undefined" && e.wplc_online === true) {
94
- jQuery("#wp-live-chat-4").show();
95
- jQuery("#wplc_social_holder").show();
96
- jQuery("#nifty_ratings_holder").show();
97
- jQuery("#wp-live-chat-1").css("cursor","pointer");
98
- } else if (e.wplc_online === false) {
99
- jQuery("#wp-live-chat-2").show();
100
- jQuery("#wp-live-chat").css("height","auto !important");
101
- jQuery("#wp-live-chat-4").hide();
102
- jQuery("#wplc_social_holder").hide();
103
- jQuery("#nifty_ratings_holder").hide();
104
- jQuery("#wp-live-chat-1").css("cursor","pointer");
105
- }
106
-
107
- jQuery("#wp-live-chat-3").hide();
108
- jQuery("#wp-live-chat-close").hide();
109
- //jQuery("#wp-live-chat-minimize").css("right","23px");
110
- Cookies.set('wplc_minimize', "", { expires: 1, path: '/' });
111
- });
112
-
113
- jQuery(document).ready(function() {
114
- //opens chat when clicked on top bar
115
- jQuery("body").on("click", "#wp-live-chat-1", function() {
116
- //jQuery.event.trigger({type: "wplc_open_chat"});
117
- });
118
- jQuery("body").on("click", ".wplc_retry_chat", function() {
119
- Cookies.set('wplc_chat_status', 5);
120
- jQuery("#wplc_chatbox").html("");
121
- jQuery("#wp-live-chat-4").fadeOut();
122
- jQuery("#wp-live-chat-2").fadeIn();
123
- jQuery("#wp-live-chat-2-inner").fadeIn();
124
- wplc_shown_welcome = false;
125
- });
126
- jQuery("body").on("click", "#speeching_button", function() {
127
- jQuery("#wplc_hovercard").hide();
128
- wplc_is_chat_open = true;
129
- jQuery.event.trigger({type: "wplc_open_chat"});
130
- jQuery("#wp-live-chat-minimize").show();
131
-
132
- });
133
-
134
- jQuery("body").on("click", "#wplc_hovercard_min", function(){
135
- jQuery("#wplc_hovercard").fadeOut();
136
- });
137
-
138
- jQuery("body").on("click", "#wp-live-chat-header", function(){
139
- jQuery("#wplc_hovercard").hide();
140
- jQuery("#wp-live-chat").css("height","");
141
- jQuery("#wplc-chat-alert").removeClass('is-active');
142
- });
143
-
144
- jQuery("body").on("click", "#wp-live-chat-header", function(){
145
- //if (!wplc_is_chat_open) {
146
-
147
- if (jQuery(this).hasClass('active')) {
148
- jQuery(this).removeClass('active');
149
- jQuery.event.trigger({type: "wplc_minimize_chat"});
150
-
151
- Cookies.set('wplc_minimize', "yes", { expires: 1, path: '/' });
152
-
153
- } else {
154
- //jQuery(this).addClass('active');
155
- jQuery.event.trigger({type: "wplc_open_chat"});
156
- jQuery("#wp-live-chat-minimize").show();
157
-
158
- Cookies.set('wplc_minimize', "", { expires: 1, path: '/' });
159
-
160
- }
161
-
162
-
163
-
164
- //}
165
- });
166
-
167
- });
 
1
+ jQuery(document).on("wplc_minimize_chat", function( e ) {
2
+ jQuery('#wp-live-chat').height("");
3
+ if(jQuery("#wp-live-chat").attr("original_pos") === "bottom_right"){
4
+ jQuery("#wp-live-chat").css("left", "");
5
+ jQuery("#wp-live-chat").css("bottom", "0");
6
+ jQuery("#wp-live-chat").css("right", "100px");
7
+ } else if(jQuery("#wp-live-chat").attr("original_pos") === "bottom_left"){
8
+ jQuery("#wp-live-chat").css("left", "100px");
9
+ jQuery("#wp-live-chat").css("bottom", "0");
10
+ jQuery("#wp-live-chat").css("right", "");
11
+ } else if(jQuery("#wp-live-chat").attr("original_pos") === "left"){
12
+ jQuery("#wp-live-chat").css("left", "0");
13
+ jQuery("#wp-live-chat").css("bottom", "100px");
14
+ jQuery("#wp-live-chat").css("width", "");
15
+ jQuery("#wp-live-chat").css("height", "");
16
+ } else if(jQuery("#wp-live-chat").attr("original_pos") === "right"){
17
+ jQuery("#wp-live-chat").css("left", "");
18
+ jQuery("#wp-live-chat").css("right", "0");
19
+ jQuery("#wp-live-chat").css("bottom", "100px");
20
+ jQuery("#wp-live-chat").css("width", "");
21
+ jQuery("#wp-live-chat").css("height", "");
22
+ }
23
+ jQuery('#wp-live-chat').addClass("wplc_close");
24
+ jQuery('#wp-live-chat').removeClass("wplc_open");
25
+ //jQuery("#wp-live-chat").css(jQuery("#wp-live-chat").attr("original_pos"), "100px");
26
+ jQuery("#wp-live-chat").css("top", "");
27
+ jQuery("#wp-live-chat-1").show();
28
+ jQuery("#wp-live-chat-1").css('cursor', 'pointer');
29
+ jQuery("#wp-live-chat-2").hide();
30
+ jQuery("#wp-live-chat-3").hide();
31
+ jQuery("#wp-live-chat-4").hide();
32
+ jQuery("#wplc_social_holder").hide();
33
+ jQuery("#nifty_ratings_holder").hide();
34
+ jQuery("#wp-live-chat-react").hide();
35
+ jQuery("#wp-live-chat-minimize").hide();
36
+ });
37
+ jQuery(document).on("click", "#wp-live-chat", function( e ){
38
+
39
+ });
40
+
41
+ jQuery(document).on("wplc_start_chat", function( e ) {
42
+ jQuery("#wp-live-chat-2-inner").hide("slow");
43
+ /* changed in version 7 as we now allow users to start typing immediately */
44
+ /* jQuery("#wp-live-chat-3").show(); */
45
+ jQuery.event.trigger({type: "wplc_open_chat_1"});
46
+ jQuery.event.trigger({type: "wplc_open_chat_2", wplc_online: wplc_online});
47
+ });
48
+ jQuery(document).on( "wplc_open_chat_1", function( e ) {
49
+
50
+ jQuery('#wp-live-chat').removeClass("wplc_close");
51
+ jQuery('#wp-live-chat').addClass("wplc_open");
52
+ jQuery("#wp-live-chat-react").hide();
53
+ jQuery("#wp-live-chat-header").css('cursor', 'all-scroll');
54
+ Cookies.set('wplc_hide', "", { expires: 1, path: '/' });
55
+ jQuery("#wp-live-chat-minimize").show();
56
+
57
+ /* set the width again as jQuery sometimes messes this up completely. */
58
+ if(jQuery("#wp-live-chat").attr("original_pos") === "left"){
59
+ jQuery("#wp-live-chat").css("width", "280px");
60
+ jQuery("#wp-live-chat").css("height", "auto !important");
61
+ } else if(jQuery("#wp-live-chat").attr("original_pos") === "right"){
62
+ jQuery("#wp-live-chat").css("width", "280px");
63
+ jQuery("#wp-live-chat").css("height", "auto !important");
64
+ }
65
+
66
+
67
+ jQuery(function() {
68
+ jQuery( "#wp-live-chat" ).draggable({
69
+ handle: "#wp-live-chat-header",
70
+ drag: function( event, ui ) {
71
+ jQuery(this).css("right","");
72
+ jQuery(this).css("bottom","inherit");
73
+ }
74
+ });
75
+ });
76
+
77
+
78
+ });
79
+
80
+
81
+ jQuery(document).on( "wplc_open_chat_2", function( e ) {
82
+
83
+ jQuery("#wp-live-chat-2").hide();
84
+
85
+ if(!jQuery("#wp-live-chat").hasClass("wplc_open")){
86
+ jQuery("#wplc_chatmsg").focus();
87
+ }
88
+
89
+ jQuery("#wp-live-chat-header").addClass("active");
90
+ jQuery("#wp-live-chat").addClass("mobile-active");
91
+
92
+ wplc_chat_status = Cookies.get('wplc_chat_status');
93
+ if (typeof e.wplc_online !== "undefined" && e.wplc_online === true) {
94
+ jQuery("#wp-live-chat-4").show();
95
+ jQuery("#wplc_social_holder").show();
96
+ jQuery("#nifty_ratings_holder").show();
97
+ jQuery("#wp-live-chat-1").css("cursor","pointer");
98
+ } else if (e.wplc_online === false) {
99
+ jQuery("#wp-live-chat-2").show();
100
+ jQuery("#wp-live-chat").css("height","auto !important");
101
+ jQuery("#wp-live-chat-4").hide();
102
+ jQuery("#wplc_social_holder").hide();
103
+ jQuery("#nifty_ratings_holder").hide();
104
+ jQuery("#wp-live-chat-1").css("cursor","pointer");
105
+ }
106
+
107
+ jQuery("#wp-live-chat-3").hide();
108
+ jQuery("#wp-live-chat-close").hide();
109
+ //jQuery("#wp-live-chat-minimize").css("right","23px");
110
+ Cookies.set('wplc_minimize', "", { expires: 1, path: '/' });
111
+ });
112
+
113
+ jQuery(function() {
114
+ //opens chat when clicked on top bar
115
+ jQuery("body").on("click", "#wp-live-chat-1", function() {
116
+ //jQuery.event.trigger({type: "wplc_open_chat"});
117
+ });
118
+ jQuery("body").on("click", ".wplc_retry_chat", function() {
119
+ Cookies.set('wplc_chat_status', 5);
120
+ jQuery("#wplc_chatbox").html("");
121
+ jQuery("#wp-live-chat-4").fadeOut();
122
+ jQuery("#wp-live-chat-2").fadeIn();
123
+ jQuery("#wp-live-chat-2-inner").fadeIn();
124
+ wplc_shown_welcome = false;
125
+ });
126
+ jQuery("body").on("click", "#speeching_button", function() {
127
+ jQuery("#wplc_hovercard").hide();
128
+ wplc_is_chat_open = true;
129
+ jQuery.event.trigger({type: "wplc_open_chat"});
130
+ jQuery("#wp-live-chat-minimize").show();
131
+
132
+ });
133
+
134
+ jQuery("body").on("click", "#wplc_hovercard_min", function(){
135
+ jQuery("#wplc_hovercard").fadeOut();
136
+ });
137
+
138
+ jQuery("body").on("click", "#wp-live-chat-header", function(){
139
+ jQuery("#wplc_hovercard").hide();
140
+ jQuery("#wp-live-chat").css("height","");
141
+ jQuery("#wplc-chat-alert").removeClass('is-active');
142
+ jQuery('#wplc_gdpr_end_chat_notice_container').hide();
143
+ });
144
+
145
+ jQuery("body").on("click", "#wp-live-chat-header", function(){
146
+ //if (!wplc_is_chat_open) {
147
+
148
+ if (jQuery(this).hasClass('active')) {
149
+ jQuery(this).removeClass('active');
150
+ jQuery.event.trigger({type: "wplc_minimize_chat"});
151
+
152
+ Cookies.set('wplc_minimize', "yes", { expires: 1, path: '/' });
153
+
154
+ } else {
155
+ //jQuery(this).addClass('active');
156
+ jQuery.event.trigger({type: "wplc_open_chat"});
157
+ jQuery("#wp-live-chat-minimize").show();
158
+
159
+ Cookies.set('wplc_minimize', "", { expires: 1, path: '/' });
160
+
161
+ }
162
+
163
+
164
+
165
+ //}
166
+ });
167
+
168
+ });
js/themes/modern.js CHANGED
@@ -1,474 +1,476 @@
1
- jQuery(document).on("bleeper_agent_disconnected", function(e) {
2
- var taid = jQuery(".wplc_agent_info").attr('aid');
3
- if (taid == e.ndata.aid) {
4
- jQuery(".wplc_agent_info").html("");
5
- wplc_animate_agent_header_down();
6
- jQuery("#wplc_chatbox").css("top","18px");
7
- }
8
- });
9
- jQuery(document).on("bleeper_agent_left", function(e) {
10
- var taid = jQuery(".wplc_agent_info").attr('aid');
11
- if (taid == e.ndata.agent) {
12
- jQuery(".wplc_agent_info").html("");
13
- wplc_animate_agent_header_down();
14
- jQuery("#wplc_chatbox").css("top","18px");
15
- }
16
- });
17
-
18
-
19
- jQuery(document).on("wplc_minimize_chat", function( e ) {
20
- wplc_is_chat_open = false;
21
- jQuery('#wp-live-chat').height("");
22
- if(jQuery("#wp-live-chat").attr("original_pos") === "bottom_right"){
23
- jQuery("#wp-live-chat").css("left", "");
24
- jQuery("#wp-live-chat").css("bottom", "0");
25
- jQuery("#wp-live-chat").css("right", "20px");
26
- } else if(jQuery("#wp-live-chat").attr("original_pos") === "bottom_left"){
27
- jQuery("#wp-live-chat").css("left", "20px");
28
- jQuery("#wp-live-chat").css("bottom", "0");
29
- jQuery("#wp-live-chat").css("right", "");
30
- } else if(jQuery("#wp-live-chat").attr("original_pos") === "left"){
31
- jQuery("#wp-live-chat").css("left", "20px");
32
- jQuery("#wp-live-chat").css("bottom", "100px");
33
- } else if(jQuery("#wp-live-chat").attr("original_pos") === "right"){
34
- //jQuery("#wp-live-chat").css("left", "");
35
- //jQuery("#wp-live-chat").css("right", "0");
36
- //jQuery("#wp-live-chat").css("bottom", "100px");
37
- //jQuery("#wp-live-chat").css("width", "");
38
- }
39
- jQuery('#wp-live-chat').addClass("wplc_close");
40
- jQuery('#wp-live-chat').removeClass("wplc_open");
41
- //jQuery("#wp-live-chat").css(jQuery("#wp-live-chat").attr("original_pos"), "100px");
42
- jQuery("#wp-live-chat").css("top", "");
43
- jQuery("#wp-live-chat").css("height", "");
44
- jQuery("#wp-live-chat-1").show();
45
- jQuery("#wp-live-chat-1").css('cursor', 'pointer');
46
- jQuery("#wp-live-chat-2").hide();
47
- jQuery("#wp-live-chat-3").hide();
48
- jQuery("#wp-live-chat-4").hide();
49
- jQuery("#wplc_social_holder").hide();
50
- jQuery("#nifty_ratings_holder").hide();
51
- jQuery("#nifty_ratings_holder").hide();
52
- jQuery("#wp-live-chat-react").hide();
53
- jQuery("#wp-live-chat-minimize").hide();
54
-
55
- jQuery("#wp-live-chat-header").show();
56
-
57
- });
58
-
59
- jQuery(document).on("wplc_start_chat", function( e ) {
60
- jQuery("#wp-live-chat-2-inner").hide("slow");
61
- /* changed in version 7 as we now allow users to start typing immediately */
62
- /* jQuery("#wp-live-chat-3").show(); */
63
- jQuery.event.trigger({type: "wplc_open_chat_1"});
64
- jQuery.event.trigger({type: "wplc_open_chat_2", wplc_online: wplc_online});
65
-
66
- });
67
-
68
- jQuery(document).on( "wplc_open_chat_1", function( e ) {
69
- jQuery('#wp-live-chat').removeClass("wplc_close");
70
- jQuery('#wp-live-chat').addClass("wplc_open");
71
- jQuery("#wp-live-chat-react").hide();
72
-
73
- //jQuery("#wp-live-chat-header").hide();
74
-
75
- Cookies.set('wplc_hide', "", { expires: 1, path: '/' });
76
- jQuery("#wp-live-chat-minimize").show();
77
-
78
-
79
-
80
-
81
- });
82
- jQuery(document).on("wplc_agent_joined", function(e) {
83
-
84
- var temail = '';
85
- var tname = '';
86
- var taid = '';
87
- var ta_tagline = '';
88
- var ta_bio = '';
89
- var ta_social_links = '';
90
-
91
- if (typeof e.ndata.other.email !== "undefined") { temail = e.ndata.other.email; }
92
- if (typeof e.ndata.other.name !== "undefined") { tname = e.ndata.other.name; }
93
- if (typeof e.ndata.other.aid !== "undefined") { taid = parseInt(e.ndata.other.aid); }
94
- if (typeof e.ndata.other.agent_tagline !== "undefined") { ta_tagline = e.ndata.other.agent_tagline; }
95
- if (typeof e.ndata.other.agent_bio !== "undefined") { ta_bio = e.ndata.other.agent_bio; }
96
- if (typeof e.ndata.other.social_links !== "undefined") { ta_social_links = e.ndata.other.social_links; }
97
-
98
- //Ensure this agent ID is valid before proceeding
99
- if(!isNaN(taid)){
100
-
101
- jQuery(".wplc_no_answer").remove();
102
-
103
- jQuery(".admin_chat_name").html(tname);
104
- wplc_node_pair_name = tname;
105
- wplc_agent_name = tname;
106
-
107
- var timageurl = 'https://www.gravatar.com/avatar/'+temail;
108
-
109
- if(jQuery(".wplc_agent_info").html().trim() === "" || typeof jQuery(".wplc_agent_info").attr("aid") === "undefined"){
110
- //No Agents have joined yet
111
- jQuery(".wplc_agent_info").html('');
112
- jQuery(".wplc_agent_info").attr("aid",taid);
113
-
114
- if ( ! jQuery( '#agent_grav_'+taid ).length ) {
115
- jQuery('<p/>', {
116
- 'class': '',
117
- 'style': 'text-align:center;',
118
- html: '<img class="img-thumbnail img-circle wplc_thumb32 wplc_agent_involved" style="max-width:inherit;" id="agent_grav_'+taid+'" title="'+tname+'" src="'+timageurl+'?s=60" /><br /><span class="wplc_agent_name wplc-color-2">'+tname+'</span>'+ta_tagline+ta_bio+ta_social_links
119
- }).appendTo('.wplc_agent_info');
120
-
121
- jQuery('<span/>', {
122
- 'class': 'bleeper_pullup down',
123
- html: '<i class="fa fa-angle-up"></i>'
124
-
125
- }).appendTo('.wplc_agent_info');
126
- }
127
-
128
- var csst = "url(https://www.gravatar.com/avatar/20a6e5c8b75ce87f4896f46ed6f49832?s=60);";
129
-
130
- jQuery("#wplc_chatbox_header_bg").css('background-image', 'url('+timageurl+'?s=380)');
131
- jQuery("#wplc_chatbox").css("top",
132
- jQuery("#wplc_chatbox_header").height()+18+"px"
133
- );
134
-
135
- } else {
136
-
137
- var wplc_tracked_agents = jQuery(".wplc_agent_info").attr("aid");
138
- var wplc_tracked_agents_object = wplc_tracked_agents.split(",");
139
-
140
- var wplc_tracked_agent_match = false; //No duplicates found yet
141
- for(var i in wplc_tracked_agents_object){
142
- var wplc_indexed_agent_id = parseInt(wplc_tracked_agents_object[i]);
143
-
144
- if(wplc_indexed_agent_id === taid){
145
- //Match - This agent is already being tracked
146
- wplc_tracked_agent_match = true;
147
- }
148
- }
149
-
150
- if(!wplc_tracked_agent_match) {
151
- //Agent is not being tracked yet
152
- wplc_tracked_agents += "," + taid;
153
- jQuery(".wplc_agent_info").attr("aid", wplc_tracked_agents);
154
-
155
- //Update Names
156
- var wplc_current_agent_names = jQuery(".wplc_agent_name").text();
157
- jQuery(".wplc_agent_name").text(wplc_current_agent_names + ", " + tname);
158
-
159
- //Hide the tagline, it is not needed for two agents in my opinion - Dylan Auty
160
- jQuery(".wplc_agent_tagline").hide();
161
-
162
- //Hide social links, it is too cluttered to add more here
163
- jQuery(".wplc_agent_social_links").hide();
164
-
165
- //Change the way the images are displayed
166
- jQuery("img.wplc_agent_involved").removeClass("wplc_thumb32").addClass("wplc_thumb16_stacked");
167
-
168
- //Add the new agents image as well
169
- var wplc_new_agent_grav = '<img class="img-thumbnail img-circle wplc_thumb16_stacked wplc_agent_involved" style="max-width:inherit;" id="agent_grav_'+taid+'" title="'+tname+'" src="'+timageurl+'?s=60" />';
170
- jQuery(wplc_new_agent_grav).insertAfter("img.wplc_agent_involved:last");
171
-
172
- //Update the height of the header
173
- jQuery("#wplc_chatbox_header").css("max-height", jQuery("#wplc_chatbox_header").outerHeight());
174
- jQuery("#wplc_chatbox").css("top", jQuery("#wplc_chatbox_header").height()+"px"); //Final update incase anything has changes
175
-
176
-
177
- jQuery("#wplc_chatbox_header_bg").css("background-image", "none");
178
- }
179
-
180
- }
181
- }
182
-
183
-
184
- });
185
-
186
- jQuery(document).on("bleeper_build_involved_agents_header", function(e){
187
- if(typeof e.ndata !== "undefined"){
188
- if(typeof e.ndata.chatid !== "undefined" && typeof e.ndata.agents !== "undefined"){
189
- if(e.ndata.chatid === chatid){
190
- var agent_match = e.ndata.agents;
191
- for(var i in agent_match){
192
- var current_agent = agent_match[i];
193
-
194
- if(typeof wplc_agent_data[current_agent] !== "undefined"){
195
- wplc_agent_data[current_agent].md5;
196
- wplc_agent_data[current_agent].name;
197
-
198
- var other = {
199
- email: wplc_agent_data[current_agent].md5,
200
- name: wplc_agent_data[current_agent].name,
201
- aid: current_agent
202
- };
203
-
204
- jQuery.event.trigger({type: "wplc_agent_joined", ndata: {other: other}});
205
- }
206
- }
207
- }
208
- }
209
- }
210
- });
211
-
212
-
213
- jQuery(document).on("wplc_animation_done", function(e) {
214
-
215
- jQuery("#nifty_text_editor_holder").remove();
216
- jQuery("#wplc_msg_notice").remove();
217
- jQuery("#wp-live-chat-minimize").remove();
218
-
219
- jQuery("#wplc_logo").prependTo("#wplc_chatbox_header");
220
-
221
-
222
-
223
-
224
-
225
- if (jQuery("wplc_chatbox").hasClass("wplc-shrink")) {
226
- /**
227
- * The +18px is to compensate for the 18px of padding at the bottom of the header box
228
- */
229
- jQuery("#wplc_chatbox").css("top",
230
- jQuery("#wplc_chatbox_header").height()+18+"px"
231
- );
232
- jQuery("#wplc_logo").show();
233
- } else {
234
- /**
235
- * The +18px is to compensate for the 18px of padding at the bottom of the header box
236
- */
237
- jQuery("#wplc_chatbox").css("top",
238
- jQuery("#wplc_chatbox_header").height()+18+"px"
239
- );
240
- jQuery("#wplc_logo").hide();
241
- }
242
- jQuery("#wplc_chatbox").css("bottom", "0");
243
-
244
-
245
-
246
- });
247
- jQuery(document).on( "wplc_open_chat_2", function( e ) {
248
-
249
- wplc_chat_status = Cookies.get('wplc_chat_status');
250
-
251
-
252
- if (Cookies.get('wplc_minimize') === 'yes' && !jQuery("#wp-live-chat-header").hasClass("active")) { } else {
253
-
254
- jQuery("#wp-live-chat-1").hide();
255
- jQuery("#wp-live-chat-2-inner").hide();
256
-
257
- jQuery("#wp-live-chat-2").show();
258
-
259
- if(!jQuery("#wp-live-chat-header").hasClass("active")){
260
- jQuery("#wplc_chatmsg").focus();
261
- }
262
-
263
- jQuery("#wp-live-chat-header").addClass("active");
264
- jQuery("#wp-live-chat").addClass("mobile-active");
265
-
266
-
267
- wplc_chat_status = Cookies.get('wplc_chat_status');
268
-
269
- if (typeof e.wplc_online !== "undefined" && e.wplc_online === true) {
270
- jQuery("#wp-live-chat-4").show();
271
- jQuery("#wplc_social_holder").show();
272
- jQuery("#nifty_ratings_holder").show();
273
- jQuery.event.trigger({type: "wplc_animation_done"});
274
-
275
-
276
- }
277
- setTimeout(function() {
278
- wplc_scroll_to_bottom();
279
- },1000);
280
-
281
- jQuery("#wp-live-chat-3").hide();
282
- jQuery("#wplc_chatmsg").focus();
283
- jQuery("#wp-live-chat-minimize").css("right","23px");
284
- Cookies.set('wplc_minimize', "", { expires: 1, path: '/' });
285
- }
286
-
287
-
288
- });
289
-
290
-
291
-
292
- var wplc_leave_window_alone = false;
293
- var wplc_currently_animating_agent_header = false;
294
-
295
- jQuery(document).ready(function() {
296
-
297
-
298
- jQuery("body").on("mousewheel", "#wplc_chatbox", function(turn, delta){
299
-
300
- if (delta == 1) {
301
- /**
302
- * The +18px is to compensate for the 18px of padding at the bottom of the header box
303
- */
304
-
305
- wplc_animate_agent_header_up();
306
-
307
- } else {
308
- // going down
309
- /**
310
- * The +18px is to compensate for the 18px of padding at the bottom of the header box
311
- */
312
- wplc_animate_agent_header_down();
313
-
314
- }
315
-
316
- });
317
-
318
- jQuery("body").on("click", ".bleeper_pullup", function() {
319
- if (jQuery(".bleeper_pullup").hasClass('down')) {
320
- wplc_animate_agent_header_down();
321
-
322
- } else {
323
- wplc_animate_agent_header_up();
324
-
325
- }
326
- });
327
-
328
-
329
- //opens chat when clicked on top bar
330
- jQuery("body").on("click", "#wp-live-chat-header", function() {
331
-
332
-
333
- });
334
-
335
-
336
- jQuery("body").on("click", ".wplc_retry_chat", function() {
337
- jQuery("#wplc_chatbox").html("");
338
- jQuery("#wp-live-chat-4").fadeOut();
339
- Cookies.remove('wplc_chat_status');
340
- jQuery("#wp-live-chat-2-inner").fadeIn();
341
- wplc_shown_welcome = false;
342
- });
343
-
344
-
345
- jQuery("body").on("click", "#wp-live-chat-header", function(){
346
- //if (!wplc_is_chat_open) {
347
-
348
- if (jQuery(this).hasClass('active')) {
349
- jQuery("#wplc_hovercard").fadeOut("fast");
350
- jQuery("#wp-live-chat-2").fadeOut("fast");
351
- jQuery(this).removeClass('active');
352
- jQuery.event.trigger({type: "wplc_minimize_chat"});
353
-
354
- Cookies.set('wplc_minimize', "yes", { expires: 1, path: '/' });
355
-
356
- } else {
357
- jQuery("#wplc_hovercard").fadeIn('fast');
358
- jQuery(this).addClass('active');
359
-
360
- wplc_chat_status = Cookies.get('wplc_chat_status');
361
- nc_status = Cookies.get('nc_status');
362
- if (parseInt(wplc_chat_status) == 3 || parseInt(wplc_chat_status) == 2 || parseInt(wplc_chat_status) == 0 || parseInt(wplc_chat_status) == 12 || parseInt(wplc_chat_status) == 10 || nc_status === 'active') {
363
-
364
- jQuery("#bleeper_bell").hide();
365
-
366
- jQuery("#speeching_button").click();
367
- }
368
-
369
- //Cookies.set('wplc_minimize', "", { expires: 1, path: '/' });
370
-
371
- }
372
-
373
-
374
-
375
- //}
376
- });
377
- jQuery("body").on("click", "#wplc_hovercard_min", function() {
378
- jQuery("#wplc_hovercard").fadeOut('fast');
379
- });
380
- jQuery("body").on("click", "#speeching_button", function() {
381
- jQuery("#wplc_hovercard").fadeOut("fast");
382
- jQuery("#wplc-chat-alert").removeClass('is-active');
383
- wplc_is_chat_open = true;
384
- jQuery.event.trigger({type: "wplc_open_chat"});
385
-
386
- });
387
- jQuery("body").on("click", "#wp-live-chat-minimize", function() {
388
-
389
- jQuery("#wp-live-chat-header").removeClass('active');
390
- });
391
-
392
-
393
-
394
-
395
-
396
-
397
-
398
-
399
-
400
- });
401
-
402
-
403
-
404
- function wplc_animate_agent_header_up() {
405
- if(!wplc_currently_animating_agent_header && jQuery("#wplc_chatbox_header").hasClass("wplc-shrink") && jQuery('#wplc_chatbox_header .wplc_agent_info:first-child').html() !== ""){
406
- wplc_currently_animating_agent_header = true;
407
- jQuery("#wplc_chatbox_header").removeClass("wplc-shrink");
408
-
409
- jQuery("#wplc_chatbox_header").animate(
410
- { maxHeight: "280px", },
411
- {
412
- duration: 700,
413
- complete: function() {
414
- // Animation complete
415
-
416
- jQuery("#wplc_logo").show();
417
- wplc_currently_animating_agent_header = false;
418
-
419
- jQuery("#wplc_chatbox_header").css("max-height", jQuery("#wplc_chatbox_header").outerHeight());
420
- jQuery("#wplc_chatbox").css("top", jQuery("#wplc_chatbox_header").height()+18+"px"); //Final update incase anything has changes
421
-
422
-
423
- },
424
- progress: function() {
425
- jQuery("#wplc_chatbox").css("top", jQuery("#wplc_chatbox_header").height()+18+"px"); //Live movement updates
426
-
427
- }
428
- }
429
- );
430
- }
431
- jQuery(".bleeper_pullup").removeClass('up');
432
- jQuery(".bleeper_pullup").addClass('down');
433
- jQuery(".bleeper_pullup").html("<i class='fa fa-angle-up'></i>");
434
- jQuery(".bleeper_pullup").css('bottom','5px');
435
- }
436
- function wplc_animate_agent_header_down() {
437
- if(!wplc_currently_animating_agent_header && !jQuery("#wplc_chatbox_header").hasClass("wplc-shrink") && jQuery('#wplc_chatbox_header .wplc_agent_info:first-child').html() !== ""){
438
- wplc_currently_animating_agent_header = true;
439
-
440
- jQuery("#wplc_chatbox_header").addClass("wplc-shrink");
441
-
442
- jQuery("#wplc_chatbox").css("top", "50px");
443
-
444
-
445
- jQuery("#wplc_chatbox_header").animate(
446
- { height: "50px", maxHeight: "50px"},
447
- {
448
- duration: 200,
449
- start: function(){
450
- jQuery("#wplc_logo").hide();
451
-
452
- },
453
- complete: function() {
454
- // Animation complete
455
- wplc_currently_animating_agent_header = false;
456
-
457
- jQuery("#wplc_chatbox_header").css("max-height", "50px");
458
- jQuery("#wplc_chatbox_header").css("height", "auto");
459
-
460
- //jQuery("#wplc_chatbox").css("top", jQuery("#wplc_chatbox_header").height()+18+"px");
461
-
462
-
463
- }
464
- }
465
- );
466
-
467
- }
468
- jQuery(".bleeper_pullup").removeClass('down');
469
- jQuery(".bleeper_pullup").addClass('up');
470
- jQuery(".bleeper_pullup").html("<i class='fa fa-angle-down'></i>");
471
- jQuery(".bleeper_pullup").css('bottom','0px');
472
- }
473
-
 
 
474
  !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
1
+ jQuery(document).on("bleeper_agent_disconnected", function(e) {
2
+ var taid = jQuery(".wplc_agent_info").attr('aid');
3
+ if (taid == e.ndata.aid) {
4
+ jQuery(".wplc_agent_info").html("");
5
+ wplc_animate_agent_header_down();
6
+ jQuery("#wplc_chatbox").css("top","18px");
7
+ }
8
+ });
9
+ jQuery(document).on("bleeper_agent_left", function(e) {
10
+ var taid = jQuery(".wplc_agent_info").attr('aid');
11
+ if (taid == e.ndata.agent) {
12
+ jQuery(".wplc_agent_info").html("");
13
+ wplc_animate_agent_header_down();
14
+ jQuery("#wplc_chatbox").css("top","18px");
15
+ }
16
+ });
17
+
18
+
19
+ jQuery(document).on("wplc_minimize_chat", function( e ) {
20
+ wplc_is_chat_open = false;
21
+ jQuery('#wp-live-chat').height("");
22
+ if(jQuery("#wp-live-chat").attr("original_pos") === "bottom_right"){
23
+ jQuery("#wp-live-chat").css("left", "");
24
+ jQuery("#wp-live-chat").css("bottom", "0");
25
+ jQuery("#wp-live-chat").css("right", "20px");
26
+ } else if(jQuery("#wp-live-chat").attr("original_pos") === "bottom_left"){
27
+ jQuery("#wp-live-chat").css("left", "20px");
28
+ jQuery("#wp-live-chat").css("bottom", "0");
29
+ jQuery("#wp-live-chat").css("right", "");
30
+ } else if(jQuery("#wp-live-chat").attr("original_pos") === "left"){
31
+ jQuery("#wp-live-chat").css("left", "20px");
32
+ jQuery("#wp-live-chat").css("bottom", "100px");
33
+ } else if(jQuery("#wp-live-chat").attr("original_pos") === "right"){
34
+ //jQuery("#wp-live-chat").css("left", "");
35
+ //jQuery("#wp-live-chat").css("right", "0");
36
+ //jQuery("#wp-live-chat").css("bottom", "100px");
37
+ //jQuery("#wp-live-chat").css("width", "");
38
+ }
39
+ jQuery('#wp-live-chat').addClass("wplc_close");
40
+ jQuery('#wp-live-chat').removeClass("wplc_open");
41
+ //jQuery("#wp-live-chat").css(jQuery("#wp-live-chat").attr("original_pos"), "100px");
42
+ jQuery("#wp-live-chat").css("top", "");
43
+ jQuery("#wp-live-chat").css("height", "");
44
+ jQuery("#wp-live-chat-1").show();
45
+ jQuery("#wp-live-chat-1").css('cursor', 'pointer');
46
+ jQuery("#wp-live-chat-2").hide();
47
+ jQuery("#wp-live-chat-3").hide();
48
+ jQuery("#wp-live-chat-4").hide();
49
+ jQuery("#wplc_social_holder").hide();
50
+ jQuery("#nifty_ratings_holder").hide();
51
+ jQuery("#nifty_ratings_holder").hide();
52
+ jQuery("#wp-live-chat-react").hide();
53
+ jQuery("#wp-live-chat-minimize").hide();
54
+
55
+ jQuery("#wp-live-chat-header").show();
56
+
57
+ });
58
+
59
+ jQuery(document).on("wplc_start_chat", function( e ) {
60
+ jQuery("#wp-live-chat-2-inner").hide("slow");
61
+ /* changed in version 7 as we now allow users to start typing immediately */
62
+ /* jQuery("#wp-live-chat-3").show(); */
63
+ jQuery.event.trigger({type: "wplc_open_chat_1"});
64
+ jQuery.event.trigger({type: "wplc_open_chat_2", wplc_online: wplc_online});
65
+
66
+ });
67
+
68
+ jQuery(document).on( "wplc_open_chat_1", function( e ) {
69
+ jQuery('#wp-live-chat').removeClass("wplc_close");
70
+ jQuery('#wp-live-chat').addClass("wplc_open");
71
+ jQuery("#wp-live-chat-react").hide();
72
+
73
+ //jQuery("#wp-live-chat-header").hide();
74
+
75
+ Cookies.set('wplc_hide', "", { expires: 1, path: '/' });
76
+ jQuery("#wp-live-chat-minimize").show();
77
+
78
+
79
+
80
+
81
+ });
82
+ jQuery(document).on("wplc_agent_joined", function(e) {
83
+
84
+ var temail = '';
85
+ var tname = '';
86
+ var taid = '';
87
+ var ta_tagline = '';
88
+ var ta_bio = '';
89
+ var ta_social_links = '';
90
+
91
+ if (typeof e.ndata.other.email !== "undefined") { temail = e.ndata.other.email; }
92
+ if (typeof e.ndata.other.name !== "undefined") { tname = e.ndata.other.name; }
93
+ if (typeof e.ndata.other.aid !== "undefined") { taid = parseInt(e.ndata.other.aid); }
94
+ if (typeof e.ndata.other.agent_tagline !== "undefined") { ta_tagline = e.ndata.other.agent_tagline; }
95
+ if (typeof e.ndata.other.agent_bio !== "undefined") { ta_bio = e.ndata.other.agent_bio; }
96
+ if (typeof e.ndata.other.social_links !== "undefined") { ta_social_links = e.ndata.other.social_links; }
97
+
98
+ //Ensure this agent ID is valid before proceeding
99
+ if(!isNaN(taid)){
100
+
101
+ jQuery(".wplc_no_answer").remove();
102
+
103
+ jQuery(".admin_chat_name").html(tname);
104
+ wplc_node_pair_name = tname;
105
+ wplc_agent_name = tname;
106
+
107
+ var timageurl = wplc_user_avatars[taid];
108
+
109
+ if(jQuery(".wplc_agent_info").html().trim() === "" || typeof jQuery(".wplc_agent_info").attr("aid") === "undefined"){
110
+ //No Agents have joined yet
111
+ jQuery(".wplc_agent_info").html('');
112
+ jQuery(".wplc_agent_info").attr("aid",taid);
113
+
114
+ if ( ! jQuery( '#agent_grav_'+taid ).length ) {
115
+ jQuery('<p/>', {
116
+ 'class': '',
117
+ 'style': 'text-align:center;',
118
+ html: '<img class="img-thumbnail img-circle wplc_thumb32 wplc_agent_involved" style="max-width:inherit;" id="agent_grav_'+taid+'" title="'+tname+'" src="'+timageurl+'?s=60" /><br /><span class="wplc_agent_name wplc-color-2">'+tname+'</span>'+ta_tagline+ta_bio+ta_social_links
119
+ }).appendTo('.wplc_agent_info');
120
+
121
+ jQuery('<span/>', {
122
+ 'class': 'bleeper_pullup down',
123
+ html: '<i class="fa fa-angle-up"></i>'
124
+
125
+ }).appendTo('.wplc_agent_info');
126
+ }
127
+
128
+ var csst = "url(https://www.gravatar.com/avatar/20a6e5c8b75ce87f4896f46ed6f49832?s=60);";
129
+
130
+ jQuery("#wplc_chatbox_header_bg").css('background-image', 'url('+timageurl+'?s=380)');
131
+ jQuery("#wplc_chatbox").css("top",
132
+ jQuery("#wplc_chatbox_header").height()+18+"px"
133
+ );
134
+
135
+ } else {
136
+
137
+ var wplc_tracked_agents = jQuery(".wplc_agent_info").attr("aid");
138
+ var wplc_tracked_agents_object = wplc_tracked_agents.split(",");
139
+
140
+ var wplc_tracked_agent_match = false; //No duplicates found yet
141
+ for(var i in wplc_tracked_agents_object){
142
+ var wplc_indexed_agent_id = parseInt(wplc_tracked_agents_object[i]);
143
+
144
+ if(wplc_indexed_agent_id === taid){
145
+ //Match - This agent is already being tracked
146
+ wplc_tracked_agent_match = true;
147
+ }
148
+ }
149
+
150
+ if(!wplc_tracked_agent_match) {
151
+ //Agent is not being tracked yet
152
+ wplc_tracked_agents += "," + taid;
153
+ jQuery(".wplc_agent_info").attr("aid", wplc_tracked_agents);
154
+
155
+ //Update Names
156
+ var wplc_current_agent_names = jQuery(".wplc_agent_name").text();
157
+ jQuery(".wplc_agent_name").text(wplc_current_agent_names + ", " + tname);
158
+
159
+ //Hide the tagline, it is not needed for two agents in my opinion - Dylan Auty
160
+ jQuery(".wplc_agent_tagline").hide();
161
+
162
+ //Hide social links, it is too cluttered to add more here
163
+ jQuery(".wplc_agent_social_links").hide();
164
+
165
+ //Change the way the images are displayed
166
+ jQuery("img.wplc_agent_involved").removeClass("wplc_thumb32").addClass("wplc_thumb16_stacked");
167
+
168
+ //Add the new agents image as well
169
+ var wplc_new_agent_grav = '<img class="img-thumbnail img-circle wplc_thumb16_stacked wplc_agent_involved" style="max-width:inherit;" id="agent_grav_'+taid+'" title="'+tname+'" src="'+timageurl+'?s=60" />';
170
+ jQuery(wplc_new_agent_grav).insertAfter("img.wplc_agent_involved:last");
171
+
172
+ //Update the height of the header
173
+ jQuery("#wplc_chatbox_header").css("max-height", jQuery("#wplc_chatbox_header").outerHeight());
174
+ jQuery("#wplc_chatbox").css("top", jQuery("#wplc_chatbox_header").height()+"px"); //Final update incase anything has changes
175
+
176
+
177
+ jQuery("#wplc_chatbox_header_bg").css("background-image", "none");
178
+ }
179
+
180
+ }
181
+ }
182
+
183
+
184
+ });
185
+
186
+ jQuery(document).on("bleeper_build_involved_agents_header", function(e){
187
+ if(typeof e.ndata !== "undefined"){
188
+ if(typeof e.ndata.chatid !== "undefined" && typeof e.ndata.agents !== "undefined"){
189
+ if(e.ndata.chatid === chatid){
190
+ var agent_match = e.ndata.agents;
191
+ for(var i in agent_match){
192
+ var current_agent = agent_match[i];
193
+
194
+ if(typeof wplc_agent_data[current_agent] !== "undefined"){
195
+ wplc_agent_data[current_agent].md5;
196
+ wplc_agent_data[current_agent].name;
197
+
198
+ var other = {
199
+ email: wplc_agent_data[current_agent].md5,
200
+ name: wplc_agent_data[current_agent].name,
201
+ aid: current_agent
202
+ };
203
+
204
+ jQuery.event.trigger({type: "wplc_agent_joined", ndata: {other: other}});
205
+ }
206
+ }
207
+ }
208
+ }
209
+ }
210
+ });
211
+
212
+
213
+ jQuery(document).on("wplc_animation_done", function(e) {
214
+
215
+ jQuery("#nifty_text_editor_holder").remove();
216
+ jQuery("#wplc_msg_notice").remove();
217
+ jQuery("#wp-live-chat-minimize").remove();
218
+
219
+ jQuery("#wplc_logo").prependTo("#wplc_chatbox_header");
220
+
221
+
222
+
223
+
224
+
225
+ if (jQuery("wplc_chatbox").hasClass("wplc-shrink")) {
226
+ /**
227
+ * The +18px is to compensate for the 18px of padding at the bottom of the header box
228
+ */
229
+ jQuery("#wplc_chatbox").css("top",
230
+ jQuery("#wplc_chatbox_header").height()+18+"px"
231
+ );
232
+ jQuery("#wplc_logo").show();
233
+ } else {
234
+ /**
235
+ * The +18px is to compensate for the 18px of padding at the bottom of the header box
236
+ */
237
+ jQuery("#wplc_chatbox").css("top",
238
+ jQuery("#wplc_chatbox_header").height()+18+"px"
239
+ );
240
+ jQuery("#wplc_logo").hide();
241
+ }
242
+ jQuery("#wplc_chatbox").css("bottom", "0");
243
+
244
+
245
+
246
+ });
247
+ jQuery(document).on( "wplc_open_chat_2", function( e ) {
248
+
249
+ wplc_chat_status = Cookies.get('wplc_chat_status');
250
+
251
+
252
+ if (Cookies.get('wplc_minimize') === 'yes' && !jQuery("#wp-live-chat-header").hasClass("active")) { } else {
253
+
254
+ jQuery("#wp-live-chat-1").hide();
255
+ jQuery("#wp-live-chat-2-inner").hide();
256
+
257
+ jQuery("#wp-live-chat-2").show();
258
+
259
+ if(!jQuery("#wp-live-chat-header").hasClass("active")){
260
+ jQuery("#wplc_chatmsg").focus();
261
+ }
262
+
263
+ jQuery("#wp-live-chat-header").addClass("active");
264
+ jQuery("#wp-live-chat").addClass("mobile-active");
265
+
266
+
267
+ wplc_chat_status = Cookies.get('wplc_chat_status');
268
+
269
+ if (typeof e.wplc_online !== "undefined" && e.wplc_online === true) {
270
+ jQuery("#wp-live-chat-4").show();
271
+ jQuery("#wplc_social_holder").show();
272
+ jQuery("#nifty_ratings_holder").show();
273
+ jQuery.event.trigger({type: "wplc_animation_done"});
274
+
275
+
276
+ }
277
+ setTimeout(function() {
278
+ wplc_scroll_to_bottom();
279
+ },1000);
280
+
281
+ jQuery("#wp-live-chat-3").hide();
282
+ jQuery("#wplc_chatmsg").focus();
283
+ jQuery("#wp-live-chat-minimize").css("right","23px");
284
+ Cookies.set('wplc_minimize', "", { expires: 1, path: '/' });
285
+ }
286
+
287
+
288
+ });
289
+
290
+
291
+
292
+ var wplc_leave_window_alone = false;
293
+ var wplc_currently_animating_agent_header = false;
294
+
295
+ jQuery(function() {
296
+
297
+
298
+ jQuery("body").on("mousewheel", "#wplc_chatbox", function(turn, delta){
299
+
300
+ if (delta == 1) {
301
+ /**
302
+ * The +18px is to compensate for the 18px of padding at the bottom of the header box
303
+ */
304
+
305
+ wplc_animate_agent_header_up();
306
+
307
+ } else {
308
+ // going down
309
+ /**
310
+ * The +18px is to compensate for the 18px of padding at the bottom of the header box
311
+ */
312
+ wplc_animate_agent_header_down();
313
+
314
+ }
315
+
316
+ });
317
+
318
+ jQuery("body").on("click", ".bleeper_pullup", function() {
319
+ if (jQuery(".bleeper_pullup").hasClass('down')) {
320
+ wplc_animate_agent_header_down();
321
+
322
+ } else {
323
+ wplc_animate_agent_header_up();
324
+
325
+ }
326
+ });
327
+
328
+
329
+ //opens chat when clicked on top bar
330
+ jQuery("body").on("click", "#wp-live-chat-header", function() {
331
+
332
+
333
+ });
334
+
335
+
336
+ jQuery("body").on("click", ".wplc_retry_chat", function() {
337
+ jQuery("#wplc_chatbox").html("");
338
+ jQuery("#wp-live-chat-4").fadeOut();
339
+ Cookies.remove('wplc_chat_status');
340
+ jQuery("#wp-live-chat-2-inner").fadeIn();
341
+ wplc_shown_welcome = false;
342
+ });
343
+
344
+
345
+ jQuery("body").on("click", "#wp-live-chat-header", function(){
346
+ //if (!wplc_is_chat_open) {
347
+
348
+ if (jQuery(this).hasClass('active')) {
349
+ jQuery("#wplc_hovercard").fadeOut("fast");
350
+ jQuery("#wp-live-chat-2").fadeOut("fast");
351
+ jQuery(this).removeClass('active');
352
+ jQuery.event.trigger({type: "wplc_minimize_chat"});
353
+
354
+ Cookies.set('wplc_minimize', "yes", { expires: 1, path: '/' });
355
+
356
+ } else {
357
+ jQuery("#wplc_hovercard").fadeIn('fast');
358
+ jQuery(this).addClass('active');
359
+
360
+ wplc_chat_status = Cookies.get('wplc_chat_status');
361
+ nc_status = Cookies.get('nc_status');
362
+ if (parseInt(wplc_chat_status) == 3 || parseInt(wplc_chat_status) == 2 || parseInt(wplc_chat_status) == 0 || parseInt(wplc_chat_status) == 12 || parseInt(wplc_chat_status) == 10 || nc_status === 'active') {
363
+
364
+ jQuery("#bleeper_bell").hide();
365
+
366
+ jQuery("#speeching_button").click();
367
+ }
368
+
369
+ //Cookies.set('wplc_minimize', "", { expires: 1, path: '/' });
370
+
371
+ }
372
+
373
+ jQuery('#wplc_gdpr_end_chat_notice_container').hide();
374
+
375
+
376
+
377
+ //}
378
+ });
379
+ jQuery("body").on("click", "#wplc_hovercard_min", function() {
380
+ jQuery("#wplc_hovercard").fadeOut('fast');
381
+ });
382
+ jQuery("body").on("click", "#speeching_button", function() {
383
+ jQuery("#wplc_hovercard").fadeOut("fast");
384
+ jQuery("#wplc-chat-alert").removeClass('is-active');
385
+ wplc_is_chat_open = true;
386
+ jQuery.event.trigger({type: "wplc_open_chat"});
387
+
388
+ });
389
+ jQuery("body").on("click", "#wp-live-chat-minimize", function() {
390
+
391
+ jQuery("#wp-live-chat-header").removeClass('active');
392
+ });
393
+
394
+
395
+
396
+
397
+
398
+
399
+
400
+
401
+
402
+ });
403
+
404
+
405
+
406
+ function wplc_animate_agent_header_up() {
407
+ if(!wplc_currently_animating_agent_header && jQuery("#wplc_chatbox_header").hasClass("wplc-shrink") && jQuery('#wplc_chatbox_header .wplc_agent_info:first-child').html() !== ""){
408
+ wplc_currently_animating_agent_header = true;
409
+ jQuery("#wplc_chatbox_header").removeClass("wplc-shrink");
410
+
411
+ jQuery("#wplc_chatbox_header").animate(
412
+ { maxHeight: "280px", },
413
+ {
414
+ duration: 700,
415
+ complete: function() {
416
+ // Animation complete
417
+
418
+ jQuery("#wplc_logo").show();
419
+ wplc_currently_animating_agent_header = false;
420
+
421
+ jQuery("#wplc_chatbox_header").css("max-height", jQuery("#wplc_chatbox_header").outerHeight());
422
+ jQuery("#wplc_chatbox").css("top", jQuery("#wplc_chatbox_header").height()+18+"px"); //Final update incase anything has changes
423
+
424
+
425
+ },
426
+ progress: function() {
427
+ jQuery("#wplc_chatbox").css("top", jQuery("#wplc_chatbox_header").height()+18+"px"); //Live movement updates
428
+
429
+ }
430
+ }
431
+ );
432
+ }
433
+ jQuery(".bleeper_pullup").removeClass('up');
434
+ jQuery(".bleeper_pullup").addClass('down');
435
+ jQuery(".bleeper_pullup").html("<i class='fa fa-angle-up'></i>");
436
+ jQuery(".bleeper_pullup").css('bottom','5px');
437
+ }
438
+ function wplc_animate_agent_header_down() {
439
+ if(!wplc_currently_animating_agent_header && !jQuery("#wplc_chatbox_header").hasClass("wplc-shrink") && jQuery('#wplc_chatbox_header .wplc_agent_info:first-child').html() !== ""){
440
+ wplc_currently_animating_agent_header = true;
441
+
442
+ jQuery("#wplc_chatbox_header").addClass("wplc-shrink");
443
+
444
+ jQuery("#wplc_chatbox").css("top", "50px");
445
+
446
+
447
+ jQuery("#wplc_chatbox_header").animate(
448
+ { height: "50px", maxHeight: "50px"},
449
+ {
450
+ duration: 200,
451
+ start: function(){
452
+ jQuery("#wplc_logo").hide();
453
+
454
+ },
455
+ complete: function() {
456
+ // Animation complete
457
+ wplc_currently_animating_agent_header = false;
458
+
459
+ jQuery("#wplc_chatbox_header").css("max-height", "50px");
460
+ jQuery("#wplc_chatbox_header").css("height", "auto");
461
+
462
+ //jQuery("#wplc_chatbox").css("top", jQuery("#wplc_chatbox_header").height()+18+"px");
463
+
464
+
465
+ }
466
+ }
467
+ );
468
+
469
+ }
470
+ jQuery(".bleeper_pullup").removeClass('down');
471
+ jQuery(".bleeper_pullup").addClass('up');
472
+ jQuery(".bleeper_pullup").html("<i class='fa fa-angle-down'></i>");
473
+ jQuery(".bleeper_pullup").css('bottom','0px');
474
+ }
475
+
476
  !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
js/wplc-admin-modal.js CHANGED
@@ -5,7 +5,7 @@ var wplc_modal_cancel_callback = null;
5
  var wplc_modal_confirm_closes_modal = true;
6
 
7
  jQuery(function(){
8
- jQuery(document).ready(function(){
9
  jQuery("body").on("click", ".wplc_modal_trigger_open", function(){
10
  var current_modal_id = jQuery(this).attr("modal_id");
11
  jQuery("#wplc_modal_" + current_modal_id).fadeIn();
@@ -61,7 +61,7 @@ function wplc_modal_remove_callback(){
61
 
62
  (function($) {
63
 
64
- $(document).ready(function(event) {
65
  if(!window.wdtEmojiBundle)
66
  return;
67
 
5
  var wplc_modal_confirm_closes_modal = true;
6
 
7
  jQuery(function(){
8
+ jQuery(function(){
9
  jQuery("body").on("click", ".wplc_modal_trigger_open", function(){
10
  var current_modal_id = jQuery(this).attr("modal_id");
11
  jQuery("#wplc_modal_" + current_modal_id).fadeIn();
61
 
62
  (function($) {
63
 
64
+ $(function(event) {
65
  if(!window.wdtEmojiBundle)
66
  return;
67
 
js/wplc-admin-pointers.js CHANGED
@@ -36,7 +36,7 @@ wp_button_pointer_array[5] = {
36
  };
37
 
38
 
39
- jQuery(document).ready( function($) {
40
 
41
  jQuery('body').on("click", ".wplc_initiate_chat", function (e) {
42
  e.preventDefault();
36
  };
37
 
38
 
39
+ jQuery(function($) {
40
 
41
  jQuery('body').on("click", ".wplc_initiate_chat", function (e) {
42
  e.preventDefault();
js/wplc_admin_dynamic_translations.js CHANGED
@@ -1,9 +1,9 @@
1
- jQuery(function(){
2
- jQuery(document).on("bleeper_dom_ready", function(e) {
3
- if(typeof wplc_dynamic_translation_array !== "undefined"){
4
- for(var index in wplc_dynamic_translation_array){
5
- jQuery("#" + index).html(wplc_dynamic_translation_array[index]);
6
- }
7
- }
8
- });
9
  });
1
+ jQuery(function(){
2
+ jQuery(document).on("bleeper_dom_ready", function(e) {
3
+ if(typeof wplc_dynamic_translation_array !== "undefined"){
4
+ for(var index in wplc_dynamic_translation_array){
5
+ jQuery("#" + index).html(wplc_dynamic_translation_array[index]);
6
+ }
7
+ }
8
+ });
9
  });
js/wplc_admin_popup.js CHANGED
@@ -1,15 +1,15 @@
1
- (function($) {
2
-
3
- $(document).ready(function(event) {
4
- var container = "#wpbody";
5
-
6
- if($("#editor.gutenberg__editor").length)
7
- container = "#editor.gutenberg__editor";
8
-
9
- $(".floating-right-toolbar i").draggable({
10
- snap: container,
11
- containment: container // This prevents the icon from being dragged into the header, where it becomes invisible
12
- });
13
- });
14
-
15
  })(jQuery);
1
+ (function($) {
2
+
3
+ $(function(event) {
4
+ var container = "#wpbody";
5
+
6
+ if($("#editor.gutenberg__editor").length)
7
+ container = "#editor.gutenberg__editor";
8
+
9
+ $(".floating-right-toolbar i").draggable({
10
+ snap: container,
11
+ containment: container // This prevents the icon from being dragged into the header, where it becomes invisible
12
+ });
13
+ });
14
+
15
  })(jQuery);
js/wplc_error_handling.js CHANGED
@@ -1,5 +1,5 @@
1
- /* developed to stop other plugins and themes erroneous code from stopping our plugin from working */
2
- window.onerror = function (errorMsg, url, lineNumber, column, errorObj) {
3
- if (window.console) { console.log('Error: ' + errorMsg + ' \nScript: ' + url + ' \nLine: ' + lineNumber + ' \nColumn: ' + column + ' \nStackTrace: ' + errorObj); }
4
- return true;
5
- }
1
+ /* developed to stop other plugins and themes erroneous code from stopping our plugin from working */
2
+ window.onerror = function (errorMsg, url, lineNumber, column, errorObj) {
3
+ if (window.console) { console.log('Error: ' + errorMsg + ' \nScript: ' + url + ' \nLine: ' + lineNumber + ' \nColumn: ' + column + ' \nStackTrace: ' + errorObj); }
4
+ return true;
5
+ }
js/wplc_gutenberg.js CHANGED
@@ -1,201 +1,201 @@
1
- // Gutenberg functions
2
- jQuery(document).ready(function($){
3
-
4
- var sizes = ['sm','md','lg'];
5
-
6
- // Initate settings
7
- initiate_gutenberg_settings();
8
-
9
- $('#wplc_gutenberg_size').on('change', function() {
10
- $('.wplc_block').removeClass('sm').removeClass('md').removeClass('lg');
11
- $('.wplc_block').addClass(sizes[$(this).val()-1]);
12
- });
13
-
14
- $('#wplc_gutenberg_icon').on('change', function() {
15
- var fontawesome_class = 'fa ' + $(this).val().replace(/\./g, "");
16
- $('.wplc_block_icon i').removeClass().addClass(fontawesome_class);
17
- });
18
-
19
- $('.iconpicker-item').on('click', function() {
20
- var fontawesome_class = 'fa ' + $(this).attr('title').replace(/\./g, "");
21
- $('.wplc_block_icon i').removeClass().addClass(fontawesome_class);
22
- });
23
-
24
- $('#wplc_gutenberg_text').on('change', function() {
25
- var text = $(this).val();
26
- $('.wplc_block_text').html(text);
27
- });
28
-
29
- $('#activate_block').on('change', function() {
30
- if ($(this).is(':checked')) {
31
- $('.wplc_block').removeClass('disabled');
32
- } else {
33
- $('.wplc_block').addClass('disabled');
34
- }
35
- });
36
-
37
- $('#wplc_gutenberg_enable_icon').on('change', function() {
38
- if ($(this).is(':checked')) {
39
- $('.wplc_block_icon').show();
40
- $('#wplc_gutenberg_icon').removeAttr('disabled');
41
- } else {
42
- $('.wplc_block_icon').hide();
43
- $('#wplc_gutenberg_icon').attr('disabled', 'disabled');
44
- }
45
- });
46
-
47
- $('.wplc_code').on('click', function(){
48
- var $temp = $('<input>');
49
- $('body').append($temp);
50
- $temp.val($(this).text()).select();
51
- document.execCommand('copy');
52
- $temp.remove();
53
- $(this).closest('p').append('<p class="wplc_copied_message">'+ $(this).text() + ' copied to clipboard.</p>').find('.wplc_copied_message').fadeOut( 'slow' );
54
- });
55
-
56
- // Allow users to upload a logo image
57
- var media_uploader;
58
- $('#wplc_gutenberg_upload_logo').on( 'click', function(e) {
59
-
60
- e.preventDefault();
61
-
62
- if ( media_uploader ) {
63
- media_uploader.open();
64
- return;
65
- }
66
-
67
- media_uploader = wp.media.frames.file_frame = wp.media({
68
- title: 'Select a Logo',
69
- button: {
70
- text: 'Select Logo'
71
- },
72
- multiple: false
73
- });
74
-
75
- media_uploader.on( 'select', function() {
76
- attachment = media_uploader.state().get( 'selection' ).first().toJSON();
77
- $('#wplc_gutenberg_logo').val(attachment.url);
78
- $('.wplc_block_logo').css('background-image', 'url(' + attachment.url + ')');
79
- });
80
-
81
- media_uploader.open();
82
-
83
- });
84
-
85
- $('#wplc_gutenberg_remove_logo').on('click', function(e) {
86
- e.preventDefault();
87
- if (confirm("Are you sure you want to reset the logo to the default logo?")) {
88
- $('#wplc_gutenberg_logo').val($('#wplc_gutenberg_default_logo').val());
89
- $('.wplc_block_logo').css('background-image', 'url("' + $('#wplc_gutenberg_default_logo').val() + '")');
90
- }
91
- return;
92
- });
93
-
94
- function initiate_gutenberg_settings() {
95
- // Editor
96
- var editor_js = ace.edit( 'wplc_custom_js_editor' );
97
- editor_js.setTheme( 'ace/theme/monokai' );
98
- editor_js.getSession().setMode( 'ace/mode/javascript' );
99
- editor_js.setValue( $('#wplc_custom_js').val(), 1 );
100
- editor_js.getSession().on("change", function () {
101
- $('#wplc_custom_js').val( editor_js.getSession().getValue() );
102
- });
103
-
104
- var editor_css = ace.edit( 'wplc_custom_css_editor' );
105
- editor_css.setTheme( 'ace/theme/monokai' );
106
- editor_css.getSession().setMode( 'ace/mode/css' );
107
- editor_css.setValue( $('#wplc_custom_css').val(), 1 );
108
- editor_css.getSession().on("change", function () {
109
- $('#wplc_custom_css').val( editor_css.getSession().getValue() );
110
- });
111
-
112
- var editor_html = ace.edit( 'wplc_custom_html_editor' );
113
- editor_html.$blockScrolling = Infinity;
114
- editor_html.setTheme( 'ace/theme/monokai' );
115
- editor_html.getSession().setMode( 'ace/mode/html' );
116
- editor_html.setValue( $.trim($('#wplc_custom_html').val()), 1 );
117
- editor_html.getSession().on("change", function () {
118
- $('#wplc_custom_html').val( editor_html.getSession().getValue() );
119
- });
120
-
121
- if ($.trim(editor_html.getSession().getValue()) == '') {
122
- editor_html.setValue( $.trim(default_html), 1 );
123
- }
124
-
125
- $('#wplc_gutenberg_reset_html').on('click', function() {
126
- editor_html.setValue( $.trim(default_html), 1 );
127
- });
128
-
129
- $('#wplc_settings').on('submit', function(){
130
- if ($.trim(editor_html.getSession().getValue()) == '' ) {
131
- editor_html.setValue( default_html, 1 );
132
- }
133
- });
134
-
135
- // Predefined Templates
136
- wplc_gutenberg_templates( editor_html );
137
-
138
- // Initiate FontAwesome Icon Picker
139
- $('#wplc_gutenberg_icon').iconpicker({
140
- placement: 'bottomRight'
141
- });
142
-
143
- $('.wplc_block').removeClass('sm').removeClass('md').removeClass('lg');
144
- $('.wplc_block').addClass(sizes[$('#wplc_gutenberg_size').val()-1]);
145
-
146
- if ($('#wplc_gutenberg_enable_icon').is(':checked')) {
147
- $('.wplc_block_icon').show();
148
- $('#wplc_gutenberg_icon').removeAttr('disabled');
149
- } else {
150
- $('.wplc_block_icon').hide();
151
- $('#wplc_gutenberg_icon').attr('disabled', 'disabled');
152
- }
153
-
154
- if ($('#activate_block').is(':checked')) {
155
- $('.wplc_block').removeClass('disabled');
156
- } else {
157
- $('.wplc_block').addClass('disabled');
158
- }
159
- }
160
-
161
- function wplc_gutenberg_templates( editor ) {
162
-
163
- var templates = new Array();
164
- templates['template_default'] = '<!-- Default Template - Dark -->\n<div class="wplc_block">\n\t<span class="wplc_block_logo">{wplc_logo}</span>\n\t<span class="wplc_block_text">{wplc_text}</span>\n\t<span class="wplc_block_icon">{wplc_icon}</span>\n</div>';
165
- templates['template_default_tooltip'] = '<!-- Default - Tooltip -->\n<!-- Hover over the block to see the tooltip -->\n<div class="wplc_block">\n\t<span class="wplc_block_tooltip">Want to chat?</span>\n\t<span class="wplc_block_logo">{wplc_logo}</span>\n\t<span class="wplc_block_text">{wplc_text}</span>\n\t<span class="wplc_block_icon">{wplc_icon}</span>\n</div>';
166
- templates['template_default_light'] = '<!-- Default - Light Template -->\n<div class="wplc_block light">\n\t<span class="wplc_block_logo">{wplc_logo}</span>\n\t<span class="wplc_block_text">{wplc_text}</span>\n\t<span class="wplc_block_icon">{wplc_icon}</span>\n</div>';
167
- templates['template_tooltip'] = '<!-- Cricle - Tooltip Template -->\n<!-- Hover over the block to see the tooltip -->\n<div class="wplc_block circle">\n\t<span class="wplc_block_tooltip">Chat with us!</span>\n\t<span class="wplc_block_logo">{wplc_logo}</span>\n</div>';
168
- templates['template_circle'] = '<!-- Circle Template -->\n<div class="wplc_block circle">\n\t<span class="wplc_block_logo">{wplc_logo}</span>\n</div>';
169
- templates['template_chat_bubble'] = '<!-- Chat Bubble Template -->\n<div class="wplc_block chat_bubble">\n\t<span class="wplc_block_logo">{wplc_logo}</span>\n\t<span class="wplc_block_text">{wplc_text}</span>\n</div>';
170
- templates['template_circle_rotate'] = '<!-- Circle - Rotating Template -->\n<!-- Hover over the icon to see it rotate -->\n<div class="wplc_block circle rotate">\n\t<span class="wplc_block_logo">{wplc_logo}</span>\n\t<span class="wplc_block_icon">{wplc_icon}</span>\n</div>';
171
-
172
- var current_template = wplc_gutenberg_filter_template( editor.getSession().getValue() );
173
-
174
- $(document).find('.wplc_gutenberg_preview').html(current_template);
175
- var sizes = ['sm','md','lg'];
176
-
177
- $('#wplc_custom_templates').on('change', function(){
178
- if ($(this).val() !== '0') {
179
- var template = wplc_gutenberg_filter_template( $.trim(templates[$(this).val()]) );
180
- template = template.replace('wplc_block', 'wplc_block ' + sizes[$(document).find('#wplc_gutenberg_size').val()-1]);
181
- editor.setValue( template, 1 );
182
- $(document).find('.wplc_gutenberg_preview').html(template);
183
- }
184
- });
185
- }
186
-
187
- function wplc_gutenberg_filter_template( template ) {
188
- var logo = $(document).find('#wplc_gutenberg_logo').val();
189
- var text = $(document).find('#wplc_gutenberg_text').val();
190
- var icon = $(document).find('#wplc_gutenberg_icon').val();
191
- var placeholder_codes = ['wplc_logo', 'wplc_text', 'wplc_icon'],
192
- placeholder_values = ['<span class="wplc_block_logo" style="background-image: url(\'' + logo + '\');"></span>', text, '<i class="fa ' + icon + '"></i>'];
193
-
194
- for( var i = 0; i < placeholder_codes.length; i++ ) {
195
- template = template.replace(new RegExp('{' + placeholder_codes[i] + '}', 'gi'), placeholder_values[i]);
196
- }
197
-
198
- return template;
199
- }
200
-
201
  });
1
+ // Gutenberg functions
2
+ jQuery(function($){
3
+
4
+ var sizes = ['sm','md','lg'];
5
+
6
+ // Initate settings
7
+ initiate_gutenberg_settings();
8
+
9
+ $('#wplc_gutenberg_size').on('change', function() {
10
+ $('.wplc_block').removeClass('sm').removeClass('md').removeClass('lg');
11
+ $('.wplc_block').addClass(sizes[$(this).val()-1]);
12
+ });
13
+
14
+ $('#wplc_gutenberg_icon').on('change', function() {
15
+ var fontawesome_class = 'fa ' + $(this).val().replace(/\./g, "");
16
+ $('.wplc_block_icon i').removeClass().addClass(fontawesome_class);
17
+ });
18
+
19
+ $('.iconpicker-item').on('click', function() {
20
+ var fontawesome_class = 'fa ' + $(this).attr('title').replace(/\./g, "");
21
+ $('.wplc_block_icon i').removeClass().addClass(fontawesome_class);
22
+ });
23
+
24
+ $('#wplc_gutenberg_text').on('change', function() {
25
+ var text = $(this).val();
26
+ $('.wplc_block_text').html(text);
27
+ });
28
+
29
+ $('#activate_block').on('change', function() {
30
+ if ($(this).is(':checked')) {
31
+ $('.wplc_block').removeClass('disabled');
32
+ } else {
33
+ $('.wplc_block').addClass('disabled');
34
+ }
35
+ });
36
+
37
+ $('#wplc_gutenberg_enable_icon').on('change', function() {
38
+ if ($(this).is(':checked')) {
39
+ $('.wplc_block_icon').show();
40
+ $('#wplc_gutenberg_icon').removeAttr('disabled');
41
+ } else {
42
+ $('.wplc_block_icon').hide();
43
+ $('#wplc_gutenberg_icon').attr('disabled', 'disabled');
44
+ }
45
+ });
46
+
47
+ $('.wplc_code').on('click', function(){
48
+ var $temp = $('<input>');
49
+ $('body').append($temp);
50
+ $temp.val($(this).text()).select();
51
+ document.execCommand('copy');
52
+ $temp.remove();
53
+ $(this).closest('p').append('<p class="wplc_copied_message">'+ $(this).text() + ' copied to clipboard.</p>').find('.wplc_copied_message').fadeOut( 'slow' );
54
+ });
55
+
56
+ // Allow users to upload a logo image
57
+ var media_uploader;
58
+ $('#wplc_gutenberg_upload_logo').on( 'click', function(e) {
59
+
60
+ e.preventDefault();
61
+
62
+ if ( media_uploader ) {
63
+ media_uploader.open();
64
+ return;
65
+ }
66
+
67
+ media_uploader = wp.media.frames.file_frame = wp.media({
68
+ title: 'Select a Logo',
69
+ button: {
70
+ text: 'Select Logo'
71
+ },
72
+ multiple: false
73
+ });
74
+
75
+ media_uploader.on( 'select', function() {
76
+ attachment = media_uploader.state().get( 'selection' ).first().toJSON();
77
+ $('#wplc_gutenberg_logo').val(attachment.url);
78
+ $('.wplc_block_logo').css('background-image', 'url(' + attachment.url + ')');
79
+ });
80
+
81
+ media_uploader.open();
82
+
83
+ });
84
+
85
+ $('#wplc_gutenberg_remove_logo').on('click', function(e) {
86
+ e.preventDefault();
87
+ if (confirm("Are you sure you want to reset the logo to the default logo?")) {
88
+ $('#wplc_gutenberg_logo').val($('#wplc_gutenberg_default_logo').val());
89
+ $('.wplc_block_logo').css('background-image', 'url("' + $('#wplc_gutenberg_default_logo').val() + '")');
90
+ }
91
+ return;
92
+ });
93
+
94
+ function initiate_gutenberg_settings() {
95
+ // Editor
96
+ var editor_js = ace.edit( 'wplc_custom_js_editor' );
97
+ editor_js.setTheme( 'ace/theme/monokai' );
98
+ editor_js.getSession().setMode( 'ace/mode/javascript' );
99
+ editor_js.setValue( $('#wplc_custom_js').val(), 1 );
100
+ editor_js.getSession().on("change", function () {
101
+ $('#wplc_custom_js').val( editor_js.getSession().getValue() );
102
+ });
103
+
104
+ var editor_css = ace.edit( 'wplc_custom_css_editor' );
105
+ editor_css.setTheme( 'ace/theme/monokai' );
106
+ editor_css.getSession().setMode( 'ace/mode/css' );
107
+ editor_css.setValue( $('#wplc_custom_css').val(), 1 );
108
+ editor_css.getSession().on("change", function () {
109
+ $('#wplc_custom_css').val( editor_css.getSession().getValue() );
110
+ });
111
+
112
+ var editor_html = ace.edit( 'wplc_custom_html_editor' );
113
+ editor_html.$blockScrolling = Infinity;
114
+ editor_html.setTheme( 'ace/theme/monokai' );
115
+ editor_html.getSession().setMode( 'ace/mode/html' );
116
+ editor_html.setValue( $.trim($('#wplc_custom_html').val()), 1 );
117
+ editor_html.getSession().on("change", function () {
118
+ $('#wplc_custom_html').val( editor_html.getSession().getValue() );
119
+ });
120
+
121
+ if ($.trim(editor_html.getSession().getValue()) == '') {
122
+ editor_html.setValue( $.trim(default_html), 1 );
123
+ }
124
+
125
+ $('#wplc_gutenberg_reset_html').on('click', function() {
126
+ editor_html.setValue( $.trim(default_html), 1 );
127
+ });
128
+
129
+ $('#wplc_settings').on('submit', function(){
130
+ if ($.trim(editor_html.getSession().getValue()) == '' ) {
131
+ editor_html.setValue( default_html, 1 );
132
+ }
133
+ });
134
+
135
+ // Predefined Templates
136
+ wplc_gutenberg_templates( editor_html );
137
+
138
+ // Initiate FontAwesome Icon Picker
139
+ $('#wplc_gutenberg_icon').iconpicker({
140
+ placement: 'bottomRight'
141
+ });
142
+
143
+ $('.wplc_block').removeClass('sm').removeClass('md').removeClass('lg');
144
+ $('.wplc_block').addClass(sizes[$('#wplc_gutenberg_size').val()-1]);
145
+
146
+ if ($('#wplc_gutenberg_enable_icon').is(':checked')) {
147
+ $('.wplc_block_icon').show();
148
+ $('#wplc_gutenberg_icon').removeAttr('disabled');
149
+ } else {
150
+ $('.wplc_block_icon').hide();
151
+ $('#wplc_gutenberg_icon').attr('disabled', 'disabled');
152
+ }
153
+
154
+ if ($('#activate_block').is(':checked')) {
155
+ $('.wplc_block').removeClass('disabled');
156
+ } else {
157
+ $('.wplc_block').addClass('disabled');
158
+ }
159
+ }
160
+
161
+ function wplc_gutenberg_templates( editor ) {
162
+
163
+ var templates = new Array();
164
+ templates['template_default'] = '<!-- Default Template - Dark -->\n<div class="wplc_block">\n\t<span class="wplc_block_logo">{wplc_logo}</span>\n\t<span class="wplc_block_text">{wplc_text}</span>\n\t<span class="wplc_block_icon">{wplc_icon}</span>\n</div>';
165
+ templates['template_default_tooltip'] = '<!-- Default - Tooltip -->\n<!-- Hover over the block to see the tooltip -->\n<div class="wplc_block">\n\t<span class="wplc_block_tooltip">Want to chat?</span>\n\t<span class="wplc_block_logo">{wplc_logo}</span>\n\t<span class="wplc_block_text">{wplc_text}</span>\n\t<span class="wplc_block_icon">{wplc_icon}</span>\n</div>';
166
+ templates['template_default_light'] = '<!-- Default - Light Template -->\n<div class="wplc_block light">\n\t<span class="wplc_block_logo">{wplc_logo}</span>\n\t<span class="wplc_block_text">{wplc_text}</span>\n\t<span class="wplc_block_icon">{wplc_icon}</span>\n</div>';
167
+ templates['template_tooltip'] = '<!-- Cricle - Tooltip Template -->\n<!-- Hover over the block to see the tooltip -->\n<div class="wplc_block circle">\n\t<span class="wplc_block_tooltip">Chat with us!</span>\n\t<span class="wplc_block_logo">{wplc_logo}</span>\n</div>';
168
+ templates['template_circle'] = '<!-- Circle Template -->\n<div class="wplc_block circle">\n\t<span class="wplc_block_logo">{wplc_logo}</span>\n</div>';
169
+ templates['template_chat_bubble'] = '<!-- Chat Bubble Template -->\n<div class="wplc_block chat_bubble">\n\t<span class="wplc_block_logo">{wplc_logo}</span>\n\t<span class="wplc_block_text">{wplc_text}</span>\n</div>';
170
+ templates['template_circle_rotate'] = '<!-- Circle - Rotating Template -->\n<!-- Hover over the icon to see it rotate -->\n<div class="wplc_block circle rotate">\n\t<span class="wplc_block_logo">{wplc_logo}</span>\n\t<span class="wplc_block_icon">{wplc_icon}</span>\n</div>';
171
+
172
+ var current_template = wplc_gutenberg_filter_template( editor.getSession().getValue() );
173
+
174
+ $(document).find('.wplc_gutenberg_preview').html(current_template);
175
+ var sizes = ['sm','md','lg'];
176
+
177
+ $('#wplc_custom_templates').on('change', function(){
178
+ if ($(this).val() !== '0') {
179
+ var template = wplc_gutenberg_filter_template( $.trim(templates[$(this).val()]) );
180
+ template = template.replace('wplc_block', 'wplc_block ' + sizes[$(document).find('#wplc_gutenberg_size').val()-1]);
181
+ editor.setValue( template, 1 );
182
+ $(document).find('.wplc_gutenberg_preview').html(template);
183
+ }
184
+ });
185
+ }
186
+
187
+ function wplc_gutenberg_filter_template( template ) {
188
+ var logo = $(document).find('#wplc_gutenberg_logo').val();
189
+ var text = $(document).find('#wplc_gutenberg_text').val();
190
+ var icon = $(document).find('#wplc_gutenberg_icon').val();
191
+ var placeholder_codes = ['wplc_logo', 'wplc_text', 'wplc_icon'],
192
+ placeholder_values = ['<span class="wplc_block_logo" style="background-image: url(\'' + logo + '\');"></span>', text, '<i class="fa ' + icon + '"></i>'];
193
+
194
+ for( var i = 0; i < placeholder_codes.length; i++ ) {
195
+ template = template.replace(new RegExp('{' + placeholder_codes[i] + '}', 'gi'), placeholder_values[i]);
196
+ }
197
+
198
+ return template;
199
+ }
200
+
201
  });
js/wplc_heartbeat.js CHANGED
@@ -1,25 +1,25 @@
1
- (function( $ ) {
2
- "use strict";
3
- $(function() {
4
- $( document ).on( 'heartbeat-send', function( e, data ) {
5
- data['client'] = 'wplc_heartbeat';
6
- });
7
-
8
-
9
- var wplc_set_transient = null;
10
-
11
- wplc_set_transient = setInterval(function () {
12
- wpcl_admin_set_transient();
13
- }, 60000);
14
- wpcl_admin_set_transient();
15
- function wpcl_admin_set_transient() {
16
- var data = {
17
- action: 'wplc_admin_set_transient',
18
- security: wplc_transient_nonce
19
-
20
- };
21
- if (typeof ajaxurl === "undefined" && typeof wplc_ajaxurl !== "undefined") { var ajaxurl = wplc_ajaxurl; }
22
- $.post(ajaxurl, data, function (response) {});
23
- }
24
- });
25
  }( jQuery ));
1
+ (function( $ ) {
2
+ "use strict";
3
+ $(function() {
4
+ $( document ).on( 'heartbeat-send', function( e, data ) {
5
+ data['client'] = 'wplc_heartbeat';
6
+ });
7
+
8
+
9
+ var wplc_set_transient = null;
10
+
11
+ wplc_set_transient = setInterval(function () {
12
+ wpcl_admin_set_transient();
13
+ }, 60000);
14
+ wpcl_admin_set_transient();
15
+ function wpcl_admin_set_transient() {
16
+ var data = {
17
+ action: 'wplc_admin_set_transient',
18
+ security: wplc_transient_nonce
19
+
20
+ };
21
+ if (typeof ajaxurl === "undefined" && typeof wplc_ajaxurl !== "undefined") { var ajaxurl = wplc_ajaxurl; }
22
+ $.post(ajaxurl, data, function (response) {});
23
+ }
24
+ });
25
  }( jQuery ));
js/wplc_lead_forms.js CHANGED
@@ -1,7 +1,7 @@
1
- jQuery("#nimble_lead_form").change(function() {
2
- jQuery("#nimble_survey").prop('selectedIndex',0);
3
- });
4
-
5
- jQuery("#nimble_survey").change(function() {
6
- jQuery("#nimble_lead_form").prop('selectedIndex',0);
7
  });
1
+ jQuery("#nimble_lead_form").change(function() {
2
+ jQuery("#nimble_survey").prop('selectedIndex',0);
3
+ });
4
+
5
+ jQuery("#nimble_survey").change(function() {
6
+ jQuery("#nimble_lead_form").prop('selectedIndex',0);
7
  });
js/wplc_node_offline_mode_controller.js CHANGED
@@ -1,16 +1,16 @@
1
- jQuery(function(){
2
- jQuery(document).on("bleeper_connect", function(e) {
3
- setTimeout(function(){
4
- var wplc_offline_prompt_title = jQuery("#wplc_offline_mode_prompt").text();
5
- var wplc_offline_prompt_body = jQuery("#wplc_offline_mode_prompt_container").html();
6
- jQuery("#wplc_offline_mode_prompt_container").hide();
7
- jQuery(".nifty_admin_overlay").fadeIn();
8
- niftyShowDialog(wplc_offline_prompt_title, "", "", function(){}, function(){});
9
-
10
- jQuery(".nifty_admin_chat_prompt_message").html(wplc_offline_prompt_body);
11
- jQuery('.nifty_admin_chat_prompt_actions').hide();
12
-
13
- jQuery('.nifty_admin_chat_prompt').css("width", "50%");
14
- }, 1500);
15
- })
16
  });
1
+ jQuery(function(){
2
+ jQuery(document).on("bleeper_connect", function(e) {
3
+ setTimeout(function(){
4
+ var wplc_offline_prompt_title = jQuery("#wplc_offline_mode_prompt").text();
5
+ var wplc_offline_prompt_body = jQuery("#wplc_offline_mode_prompt_container").html();
6
+ jQuery("#wplc_offline_mode_prompt_container").hide();
7
+ jQuery(".nifty_admin_overlay").fadeIn();
8
+ niftyShowDialog(wplc_offline_prompt_title, "", "", function(){}, function(){});
9
+
10
+ jQuery(".nifty_admin_chat_prompt_message").html(wplc_offline_prompt_body);
11
+ jQuery('.nifty_admin_chat_prompt_actions').hide();
12
+
13
+ jQuery('.nifty_admin_chat_prompt').css("width", "50%");
14
+ }, 1500);
15
+ })
16
  });
js/wplc_server.js CHANGED
@@ -1,1096 +1,1105 @@
1
- /*
2
- * Hanldes Message transportation within WPLC
3
- */
4
- var gifExtensionPattern = new RegExp(/\.(gif)\b/);
5
-
6
- var wplc_server_method = null;
7
- var wplc_supress_server_logs = true; //We are now surpressing server logs
8
- var wplc_node_socket = null; //Will not be set unless
9
- var wplc_node_send_queue = new Array();
10
- var wplc_node_message_receiver = null;
11
- var wplc_node_message_restart_handler = null;
12
- var wplc_node_client_event_logger = null;
13
- var wplc_node_sockets_ready = false;
14
- var wplc_transport_prepared = false;
15
-
16
- var wplc_node_async_array = new Array(); //Array which will be sent to our async URL for storage
17
- var wplc_node_async_send_rate = 1; //Amount of messages that need to be present before we sent the async request
18
- var wplc_node_async_cookie_check_complete = false;
19
-
20
- var wplc_node_port_open = true; //This can be set to false to prevent any future data being sent
21
- var wplc_node_is_client_typing = false;
22
- var wplc_node_is_pair_typing_indicator_visible = false;
23
- var wplc_node_pair_name = "";
24
-
25
- var wplc_node_switch_ajax_complete = false;
26
- var wplc_node_retry_count = 0;
27
-
28
- var wplc_msg_history = new Array();
29
-
30
- var wplc_xhr; //XHR global (allows us to abort previous AJAX request when the agent flips between screens quickly)
31
-
32
-
33
-
34
- function WPLCServer(){
35
- var wplc_server_ref = this;
36
- //Default to ajax until chat starts
37
- wplc_server_method = WPLCServer.Ajax;
38
- wplc_server_ref.send = wplc_server_method.send;
39
-
40
- wplc_server_ref.isInSocketMode = wplc_server_method.isInSocketMode;
41
- wplc_server_ref.isPreparingSocketMode = wplc_server_method.isPreparingSocketMode;
42
- wplc_server_ref.transportPrepared = wplc_server_method.transportPrepared;
43
- wplc_server_ref.asyncStorage = wplc_server_method.asyncStorage;
44
- wplc_server_ref.forceClosePort = wplc_server_method.forceClosePort;
45
- wplc_server_ref.sendMessage = wplc_server_method.sendMessage;
46
-
47
-
48
- wplc_server_ref.prepareTransport = function(callback, messageHandler, restartHandler, clientEventLog){
49
- wplc_server_log("-------------------");
50
- wplc_server_log("Preparing Transport");
51
- if(typeof wplc_use_node_server !== "undefined" && wplc_use_node_server === "true"){
52
- if(window.WebSocket){
53
- //Sockets are supported
54
- wplc_server_method = WPLCServer.Socket;
55
- wplc_server_log("Socket Mode");
56
- } else {
57
- wplc_server_method = WPLCServer.Ajax;
58
- wplc_server_log("Ajax Mode");
59
- }
60
- } else {
61
- wplc_server_method = WPLCServer.Ajax;
62
- wplc_server_log("Ajax Mode");
63
- }
64
-
65
- wplc_server_method.init(function(){
66
- wplc_server_ref.send = wplc_server_method.send;
67
- wplc_server_ref.isInSocketMode = wplc_server_method.isInSocketMode;
68
- wplc_server_ref.isPreparingSocketMode = wplc_server_method.isPreparingSocketMode;
69
- wplc_server_ref.transportPrepared = wplc_server_method.transportPrepared;
70
- wplc_server_ref.asyncStorage = wplc_server_method.asyncStorage;
71
- wplc_server_ref.forceClosePort = wplc_server_method.forceClosePort;
72
- wplc_server_ref.sendMessage = wplc_server_method.sendMessage;
73
-
74
- if(typeof callback === "function"){
75
- callback();
76
- }
77
- }, messageHandler, function(){
78
- wplc_server_method = WPLCServer.Ajax;
79
- wplc_server_log("Ajax Mode - Fail Over");
80
-
81
- wplc_server_ref.send = wplc_server_method.send;
82
- wplc_server_ref.isInSocketMode = wplc_server_method.isInSocketMode;
83
- wplc_server_ref.isPreparingSocketMode = function(){ return false; };
84
- wplc_server_ref.transportPrepared = wplc_server_method.transportPrepared;
85
- wplc_server_ref.asyncStorage = wplc_server_method.asyncStorage;
86
- wplc_server_ref.forceClosePort = wplc_server_method.forceClosePort;
87
- wplc_server_ref.sendMessage = wplc_server_method.sendMessage;
88
-
89
- if(typeof wplc_ajaxurl !== "undefined" && typeof wplc_nonce !== "undefined" && typeof wplc_cid !== "undefined"){
90
- var wplc_fail_over_data = {
91
- action: 'wplc_node_switch_to_ajax',
92
- security: wplc_nonce,
93
- cid: wplc_cid
94
- };
95
-
96
- jQuery.ajax({
97
- url : wplc_ajaxurl,
98
- data : wplc_fail_over_data,
99
- type : "POST",
100
- timeout : 120000,
101
- success : function(response){
102
- wplc_server_log("Ajax Mode Enabled");
103
- },
104
- error : function(error, exception){
105
- wplc_server_log("Chat Fail Over Could Not Be Setup");
106
- },
107
- complete : function(response){
108
- if(typeof callback === "function"){
109
- callback();
110
- }
111
- }
112
- });
113
- }
114
- }, restartHandler, clientEventLog);
115
-
116
- wplc_server_log("Transport Prepared");
117
- wplc_server_log("-------------------");
118
- wplc_transport_prepared = true;
119
- }
120
-
121
- wplc_server_ref.browserIsSocketReady = function(){
122
- if(typeof wplc_use_node_server !== "undefined" && wplc_use_node_server === "true"){
123
- if(window.WebSocket){
124
- return true;
125
- } else {
126
- return false;
127
- }
128
- } else {
129
- return false;
130
- }
131
- }
132
- }
133
-
134
- WPLCServer.Socket = {
135
- /*
136
- init : function(callback, messageHandler, failOver, restartHandler, clientEventLog){
137
- wplc_node_message_receiver = (typeof messageHandler !== "undefined" && typeof messageHandler === "function") ? messageHandler : false;
138
- wplc_node_message_restart_handler = (typeof restartHandler !== "undefined" && typeof restartHandler === "function") ? restartHandler : false;
139
- wplc_node_client_event_logger = (typeof clientEventLog !== "undefined" && typeof clientEventLog === "function") ? clientEventLog : false;
140
-
141
- wplc_server_log("Socket Init");
142
- //wplc_node_socket = new WebSocket('wss://wp-livechat.us-2.evennode.com');
143
-
144
-
145
- if(wplc_node_async_cookie_check_complete !== true){
146
- //Check if there are any messages we forgot to send via async
147
- if(typeof Cookies !== "undefined" && typeof Cookies === "function"){
148
- var wplc_node_async_cookie_data = Cookies.getJSON("wplc_server_async_storage");
149
- if(typeof wplc_node_async_cookie_data !== "undefined" && wplc_node_async_cookie_data !== "undefined" && wplc_node_async_cookie_data !== undefined && wplc_node_async_cookie_data !== null){
150
- wplc_server_log("Async Cookies Found -> Sync...");
151
- wplc_node_parse_async_from_object(wplc_node_async_cookie_data, function(){
152
- wplc_node_async_cookie_check_complete = true;
153
- });
154
- }
155
- }
156
- }
157
-
158
- wplc_node_socket.onerror = function(event){
159
- wplc_server_error("Could not connect to server. Changing transport method.");
160
- if(typeof failOver === "function" && wplc_node_sockets_ready !== true){
161
- failOver();
162
- wplc_node_switch_ajax_complete = true;
163
- if(typeof wplc_node_client_event_logger !== "undefined" && typeof wplc_node_client_event_logger === "function"){
164
- wplc_node_client_event_logger("Connection Error - Switching methods");
165
- }
166
- }
167
- }
168
-
169
- wplc_node_socket.onopen = function(event) {
170
- wplc_server_log("This socket is open");
171
- wplc_node_sockets_ready = true; //Sockets are available and ready for use
172
- if(typeof callback === "function"){
173
- callback();
174
- }
175
- }
176
-
177
- wplc_node_socket.onmessage = function(event){
178
- if(typeof wplc_node_message_receiver === "function" && wplc_node_message_receiver !== false && wplc_node_message_receiver !== null){
179
- //Delegate to handler
180
- if(wplc_node_port_open){
181
- wplc_node_message_receiver(event.data);
182
- wplc_node_global_message_receiver(event.data);
183
- }
184
- }
185
-
186
- }
187
-
188
- wplc_node_socket.onclose = function(event) {
189
- wplc_server_log("This socket is closed");
190
- if (typeof wplc_node_message_restart_handler === "function") {
191
- if (wplc_node_retry_count < 5 && wplc_node_switch_ajax_complete !== true) {
192
- setTimeout(function(){
193
- wplc_node_message_restart_handler(event.data);
194
- wplc_node_retry_count++;
195
- if(typeof wplc_node_client_event_logger !== "undefined" && typeof wplc_node_client_event_logger === "function"){
196
- wplc_node_client_event_logger("Connection Error - Retrying in 5 seconds...");
197
- }
198
- }, 5000);
199
- } else {
200
- if(wplc_node_retry_count >= 5){
201
- if(typeof wplc_node_client_event_logger !== "undefined" && typeof wplc_node_client_event_logger === "function"){
202
- wplc_node_client_event_logger("Connection Error - Please refresh your browser");
203
- }
204
- }
205
- }
206
- }
207
- }
208
-
209
-
210
- },
211
- send : function (wplc_send_url, wplc_send_data, wplc_send_type, wplc_send_timeout, wplc_send_success_callback, wplc_send_fail_callback, wplc_send_complete_callback){
212
- wplc_origin_url = wplc_send_url.replace("/wp-admin/admin-ajax.php", "");
213
- wplc_send_data.origin_url = wplc_origin_url;
214
- wplc_socket_send(wplc_send_data, wplc_send_success_callback, wplc_send_fail_callback, wplc_send_complete_callback);
215
-
216
- if(wplc_node_async_cookie_check_complete){
217
- //Now lets update the sync quick
218
- wplc_socket_async_storage_handler(wplc_send_url, wplc_send_data, wplc_send_timeout);
219
- wplc_node_async_cookie_check_complete = false; //Stop infinite loop
220
- }
221
- },
222
- isInSocketMode : function (){
223
- return wplc_node_sockets_ready;
224
- },
225
- isPreparingSocketMode : function(){
226
- var preparing = false;
227
- if(typeof wplc_use_node_server !== "undefined" && wplc_use_node_server === "true"){
228
- if(window.WebSocket){
229
- preparing = true;
230
- }
231
- }
232
-
233
- return preparing;
234
- },
235
- transportPrepared : function(){
236
- return wplc_transport_prepared;
237
- },
238
- asyncStorage : function(wplc_send_url, wplc_send_data, wplc_send_timeout){
239
- wplc_node_async_array.push(wplc_send_data.msg);
240
-
241
- if(typeof Cookies !== "undefined" && typeof Cookies === "function"){
242
- Cookies.set('wplc_server_async_storage', JSON.stringify(wplc_node_async_array), { expires: 1, path: '/' });
243
- }
244
-
245
- if(wplc_node_async_array.length >= wplc_node_async_send_rate){
246
- wplc_socket_async_storage_handler(wplc_send_url, wplc_send_data, wplc_send_timeout);
247
- }
248
- },
249
- forceClosePort : function(){
250
- wplc_node_port_open = false;
251
- },
252
- sendMessage : function(wplc_send_url, wplc_send_data, wplc_send_type, wplc_send_timeout, wplc_send_success_callback, wplc_send_fail_callback, wplc_send_complete_callback){
253
- wplc_origin_url = wplc_send_url.replace("/wp-admin/admin-ajax.php", "");
254
- wplc_send_data.origin_url = wplc_origin_url;
255
- wplc_socket_add_to_queue(wplc_send_data, wplc_send_success_callback, wplc_send_fail_callback, wplc_send_complete_callback);
256
- } */
257
-
258
- };
259
-
260
- WPLCServer.Ajax = {
261
- init : function(callback, messageHandler, failOver, restartHandler, clientEventLog){
262
- wplc_server_log("Ajax Init");
263
- if(typeof callback === "function"){
264
- callback();
265
- }
266
- },
267
- send : function (wplc_send_url, wplc_send_data, wplc_send_type, wplc_send_timeout, wplc_send_success_callback, wplc_send_fail_callback, wplc_send_complete_callback){
268
- jQuery.ajax({
269
- url : wplc_send_url,
270
- data : wplc_send_data,
271
- type : wplc_send_type,
272
- timeout : wplc_send_timeout,
273
- success : function(response){
274
- if(typeof wplc_send_success_callback === "function"){
275
- if(typeof wplc_send_data['action'] !== "undefined" && wplc_send_data['action'] !== "wplc_start_chat"){ //Is this the start?
276
- wplc_send_success_callback(response);
277
- } else {
278
- //Check if we are going to go into socket mode after this?
279
- if(typeof wplc_use_node_server !== "undefined" && wplc_use_node_server === "true"){
280
- if(window.WebSocket){
281
- wplc_send_success_callback(response); //Send the data if we are going to sockets after this
282
- }
283
- }
284
- }
285
- }
286
- },
287
- error : function(error, exception){
288
- if(typeof wplc_send_fail_callback === "function"){
289
- wplc_send_fail_callback(error, exception);
290
- }
291
- },
292
- complete : function(response){
293
- if(typeof wplc_send_complete_callback === "function"){
294
- wplc_send_complete_callback(response, wplc_send_data);
295
- }
296
- }
297
- });
298
- },
299
- isInSocketMode : function (){
300
- return wplc_node_sockets_ready;
301
- },
302
- isPreparingSocketMode : function(){
303
- var preparing = false;
304
- if(typeof wplc_use_node_server !== "undefined" && wplc_use_node_server === "true"){
305
- if(window.WebSocket){
306
- preparing = true;
307
- }
308
- }
309
-
310
- return preparing;
311
- },
312
- transportPrepared : function(){
313
- return wplc_transport_prepared;
314
- },
315
- asyncStorage : function(wplc_send_url, wplc_send_data, wplc_send_timeout){
316
- //Do nothing -> Ajax handles
317
- },
318
- forceClosePort : function(){
319
- //Do Nothing ajax doesnt use socket ports
320
- },
321
- sendMessage : function(wplc_send_url, wplc_send_data, wplc_send_type, wplc_send_timeout, wplc_send_success_callback, wplc_send_fail_callback, wplc_send_complete_callback){
322
- WPLCServer.Ajax.send(wplc_send_url, wplc_send_data, wplc_send_type, wplc_send_timeout, wplc_send_success_callback, wplc_send_fail_callback, wplc_send_complete_callback);
323
- }
324
- };
325
-
326
-
327
- function wplc_server_log(msg){
328
- if(wplc_supress_server_logs !== true && window.console){
329
- console.log("WPLC SERVER: " + msg);
330
- }
331
- }
332
-
333
- function wplc_server_error(msg){
334
- if(window.console){
335
- console.error("WPLC SERVER ERROR: " + msg);
336
- }
337
- }
338
-
339
- function wplc_socket_send(data, success, fail, complete){
340
- if(wplc_node_port_open){
341
- wplc_socket_add_to_queue(data, success, fail, complete);
342
-
343
- //if(data.action !== "wplc_user_send_msg" && data.action !== "wplc_admin_send_msg"){
344
- var wplc_current_queue_item = wplc_socket_get_next_in_queue();
345
- if(wplc_current_queue_item !== false){
346
- if(typeof wplc_node_socket !== "undefined" && wplc_node_socket !== null){
347
- if(wplc_node_socket.readyState !== WebSocket.CONNECTING && wplc_node_socket.readyState !== WebSocket.CLOSING && wplc_node_socket.readyState !== WebSocket.CLOSED){
348
- wplc_current_queue_item.data.is_typing = typeof wplc_node_is_client_typing !== "undefined" ? wplc_node_is_client_typing : false;
349
- wplc_node_socket.send(JSON.stringify(wplc_current_queue_item.data));
350
-
351
- if(typeof wplc_current_queue_item.success === "function"){
352
- wplc_current_queue_item.success();
353
- }
354
- } else {
355
- //Try again in a sec just now -> Add it to the queue
356
- setTimeout(function(){
357
- wplc_socket_send(data, success, fail, complete);
358
- }, 500);
359
- }
360
- } else {
361
- setTimeout(function(){
362
- //Try again in a sec just now -> Add it to the queue
363
- wplc_socket_send(data, success, fail, complete);
364
- }, 500);
365
- }
366
- }
367
- //}
368
- }
369
- }
370
-
371
- function wplc_sanitize_attributes( str ){
372
- var wplc_allowed_attributes = "onload,onclick,alert,onerror,dalert";
373
- var allowed_attr = wplc_allowed_attributes.split(",");
374
- for( i = 0; i < allowed_attr.length; i++ ){
375
- str = str.replace(allowed_attr[i], '');
376
- }
377
-
378
- return str;
379
- }
380
-
381
- function wplc_socket_add_to_queue(data, success, fail, complete){
382
- if(typeof data.server_token === "undefined"){
383
- if(typeof bleeper_api_key !== "undefined"){
384
- data.server_token = bleeper_api_key;
385
- } else {
386
- wplc_server_error("No Server Token Present, Something will go wrong");
387
- }
388
- }
389
-
390
-
391
- var queue_item = {
392
- data: data,
393
- success: success,
394
- fail: fail,
395
- complete: complete
396
- }
397
-
398
- if(wplc_node_send_queue.length > 0){
399
- var last_item = wplc_node_send_queue[wplc_node_send_queue.length - 1];
400
- if(JSON.stringify(last_item.data) !== JSON.stringify(data)){
401
- wplc_node_send_queue.push(queue_item);
402
- }
403
- } else {
404
- wplc_node_send_queue.push(queue_item);
405
- }
406
- }
407
-
408
- function wplc_socket_get_next_in_queue(){
409
- if(wplc_node_send_queue.length > 0){
410
- return wplc_node_send_queue.shift();
411
- } else {
412
- return false;
413
- }
414
- }
415
-
416
- function wplc_rest_api(type, wplc_send_data, wplc_send_timeout, next) {
417
-
418
- if (typeof wplc_xhr !== "undefined" && typeof wplc_xhr.abort() !== "undefined") { wplc_xhr.abort(); }
419
- if (typeof next === "undefined" || next === null) { next = function() {}; }
420
- var wplc_node_ajax_action = type;
421
- //Send the data to the Async
422
- if(typeof wplc_restapi_enabled !== "undefined" && parseInt(wplc_restapi_enabled) === 1 && typeof wplc_restapi_endpoint !== "undefined"){
423
- //REST API is ready to rumble
424
-
425
- var anti_cache = Date.now();
426
-
427
- wplc_send_url = wplc_restapi_endpoint + "/" + type + "?nocache="+anti_cache;
428
-
429
-
430
-
431
- var prepared_data = wplc_send_data;
432
-
433
- var x = {
434
- action : wplc_node_ajax_action,
435
- relay_action : wplc_send_data.action,
436
- chat_id : wplc_send_data.cid,
437
- security : wplc_send_data.security,
438
- message : wplc_send_data.msg,
439
- server_token : wplc_restapi_token,
440
- wplc_extra_data:document.wplc_extra_data,
441
- wplc_data : wplc_send_data
442
- };
443
-
444
-
445
- prepared_data.server_token = wplc_restapi_token;
446
- prepared_data.token = wplc_restapi_token; /* backwards compat */
447
- if (typeof prepared_data.wplc_extra_data === "undefined") {
448
- prepared_data.wplc_extra_data = document.wplc_extra_data;
449
- }
450
- prepared_data._wpnonce = wplc_restapi_nonce;
451
-
452
- wplc_xhr = jQuery.ajax({
453
- url : wplc_send_url,
454
- data : prepared_data,
455
- type : "POST",
456
- timeout : wplc_send_timeout,
457
- success : function(response){
458
- wplc_server_log("REST SEND = SUCCESS");
459
- next(response);
460
- },
461
- error : function(error, exception){
462
- wplc_server_log("REST SEND = FAIL");
463
- next();
464
- },
465
- complete : function(response){
466
- next(response);
467
- }
468
- });
469
- } else {
470
- wplc_server_log("NO REST API :(");
471
- next();
472
- }
473
-
474
- }
475
-
476
- function wplc_socket_async_storage_handler(wplc_send_url, wplc_send_data, wplc_send_timeout){
477
- var wplc_node_ajax_action = "wplc_node_async_storage_ajax";
478
- //Send the data to the Async
479
- if(typeof wplc_restapi_enabled !== "undefined" && parseInt(wplc_restapi_enabled) === 1 && typeof wplc_restapi_endpoint !== "undefined"){
480
- //REST API is ready to rumble
481
- wplc_send_url = wplc_restapi_endpoint + "/async_storage";
482
- } else {
483
- //Ajax time! Cause the Rest she Left
484
- }
485
-
486
- var prepared_data = {
487
- action : wplc_node_ajax_action,
488
- relay_action : wplc_send_data.action,
489
- chat_id : wplc_send_data.cid,
490
- security : wplc_send_data.security,
491
- messages : JSON.stringify(wplc_node_async_array),
492
- wplc_extra_data:document.wplc_extra_data
493
- };
494
-
495
- if(typeof bleeper_api_key !== "undefined"){
496
- prepared_data.server_token = bleeper_api_key;
497
- }
498
-
499
- /*
500
- wplc_node_async_array = new Array(); //Clearing the storage array before the next data can be sent through
501
- if(typeof Cookies !== "undefined" && typeof Cookies === "function"){
502
- Cookies.remove('wplc_server_async_storage'); //Clear the cookies now so that we don't do this again.
503
- }
504
- */
505
- jQuery.ajax({
506
- url : wplc_send_url,
507
- data : prepared_data,
508
- type : "POST",
509
- timeout : wplc_send_timeout,
510
- success : function(response){
511
- wplc_server_log("ASYNC STORAGE = SUCCESS");
512
- },
513
- error : function(error, exception){
514
- wplc_server_log("ASYNC STORAGE = FAIL");
515
- },
516
- complete : function(response){
517
-
518
- }
519
- });
520
- }
521
-
522
- function wplc_json_validator(str) {
523
- try {
524
- JSON.parse(str);
525
- } catch (e) {
526
- return false;
527
- }
528
- return true;
529
- }
530
-
531
- function wplc_node_parse_async_from_object(obj, complete){
532
- for(var i in obj){
533
- if(obj.hasOwnProperty(i)){
534
- wplc_node_async_array.push(obj[i]);
535
- }
536
- }
537
-
538
- if(typeof complete === "function"){
539
- complete();
540
- }
541
- }
542
-
543
- function wplc_node_global_message_receiver(data){
544
- if(data){
545
- if (typeof data !== "object") {
546
- data = JSON.parse(data);
547
- }
548
- }
549
-
550
- if(typeof data['pair_name'] !== "undefined"){
551
- if(data['pair_name'] !== wplc_node_pair_name){
552
- wplc_node_pair_name = data['pair_name'];
553
- }
554
- }
555
-
556
- if(typeof data['pair_typing'] !== "undefined"){
557
-
558
- if(data['pair_typing'] === true || data['pair_typing'] === "true"){
559
- if(wplc_node_is_pair_typing_indicator_visible === false){
560
- if (jQuery("#wplc_user_typing").length>0) { } else {
561
- jQuery(".typing_indicator").html("<span id='wplc_user_typing'>"+wplc_node_pair_name+" "+wplc_localized_string_is_typing_single+"</span>");
562
- jQuery(".typing_indicator").addClass("typing_indicator_active");
563
- }
564
- }
565
- wplc_node_is_pair_typing_indicator_visible = true;
566
- } else {
567
- if(wplc_node_is_pair_typing_indicator_visible === true){
568
- if (jQuery("#wplc_user_typing").length>0) {
569
- jQuery("#wplc_user_typing").fadeOut("slow").remove();
570
- jQuery(".typing_indicator").removeClass("typing_indicator_active");
571
- }
572
- }
573
- wplc_node_is_pair_typing_indicator_visible = false;
574
- }
575
-
576
- }
577
- }
578
- String.prototype.wplcStripSlashes = function(){
579
- return this.replace(/\\(.)/mg, "$1");
580
- }
581
-
582
- function wplc_add_date_and_time(the_message,originates) {
583
-
584
- if (parseInt(originates) === 1 || parseInt(originates) === 2) {
585
-
586
- var time_msg = '';
587
-
588
- /* identfy the timestamp */
589
- if (typeof the_message.other === "undefined" || typeof the_message.other.datetime === "undefined" || the_message.other === false) {
590
- /* only run if it hasnt got a timestamp in the .other.datetime key */
591
- if (typeof the_message.timestamp !== "undefined") {
592
- /* most likely came from node as node */
593
-
594
- if (typeof the_message.other !== "object") { the_message.other = {}; }
595
- the_message.other.datetime = the_message.timestamp;
596
-
597
- }
598
- }
599
-
600
- if (typeof the_message.other === "undefined" || typeof the_message.other.datetime === "undefined") {
601
- /* there is no datetime so return nothing */
602
- return '';
603
- } else {
604
- if (typeof wplc_show_chat_detail !== "undefined") {
605
-
606
- var datetimestamp = the_message.other.hasOwnProperty( 'datetimeUTC' ) ? the_message.other.datetimeUTC : the_message.other.datetime;
607
- var dateTime = new Date( parseInt( datetimestamp ) * 1000 );
608
-
609
- if ( typeof wplc_show_chat_detail.date !== 'undefined' && '1' === wplc_show_chat_detail.date ) {
610
-
611
- var date_format = typeof wplc_datetime_format !== 'undefined' && wplc_datetime_format.hasOwnProperty( 'date_format' ) ? wplc_datetime_format.date_format : 'n/d';
612
- var date_month = dateTime.getMonth();
613
- var date_day = dateTime.getDate();
614
- var date_months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
615
- var date_days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
616
- var date_day_no = dateTime.getDay();
617
- var date_year = dateTime.getFullYear();
618
-
619
- time_msg += date_format
620
- .replace( /S/g, '%S%' )
621
- .replace( /D/g, '%D%' )
622
- .replace( /l/g, '%l%' )
623
- .replace( /F/g, '%F%' )
624
- .replace( /M/g, '%M%' )
625
- .replace( /j/g, date_day )
626
- .replace( /d/g, date_day < 10 ? '0' + date_day : date_day )
627
- .replace( /w/g, date_day_no )
628
- .replace( /n/g, date_month + 1 )
629
- .replace( /m/g, date_month + 1 < 10 ? '0' + ( date_month + 1 ) : date_month + 1 )
630
- .replace( /Y/g, date_year )
631
- .replace( /y/g, date_year.toString().substr( 2, 2 ) )
632
- .replace( /%S%/g, 1 === date_day ? 'st' : ( 2 === date_day ? 'nd' : ( 3 === date_day ? 'rd' : 'th' ) ) )
633
- .replace( /%D%/g, date_days[ date_day_no ].substr( 0, 3 ) )
634
- .replace( /%l%/g, date_days[ date_day_no ] )
635
- .replace( /%F%/g, date_months[ date_month ] )
636
- .replace( /%M%/g, date_months[ date_month ].substr( 0, 3 ) ) + ' ';
637
-
638
- }
639
- if ( typeof wplc_show_chat_detail.time !== "undefined" && '1' === wplc_show_chat_detail.time ) {
640
-
641
- var time_format = typeof wplc_datetime_format !== 'undefined' && wplc_datetime_format.hasOwnProperty( 'time_format' ) ? wplc_datetime_format.time_format : 'H:i';
642
- var time_hours_12 = dateTime.getHours() > 12 ? dateTime.getHours() - 12 : ( dateTime.getHours() < 1 ? 12 : dateTime.getHours() );
643
- var time_hours_24 = dateTime.getHours();
644
- var time_am_pm = time_hours_24 > 11 ? 'pm' : 'am';
645
- var time_minutes = dateTime.getMinutes();
646
-
647
- time_msg += time_format
648
- .replace( /g/g, time_hours_12 )
649
- .replace( /h/g, time_hours_12 < 10 ? '0' + time_hours_12 : time_hours_12 )
650
- .replace( /G/g, time_hours_24 )
651
- .replace( /H/g, time_hours_24 < 10 ? '0' + time_hours_24 : time_hours_24 )
652
- .replace( /i/g, time_minutes < 10 ? '0' + time_minutes : time_minutes )
653
- .replace( /a/g, time_am_pm.toLowerCase() )
654
- .replace( /A/g, time_am_pm.toUpperCase() );
655
-
656
- }
657
- if (time_msg !== '') {
658
- if (parseInt(originates) === 1) { aoru_class = 'wplc-msg-float-left'; } else { aoru_class = 'wplc-msg-float-right'; }
659
- time_msg = '<span class="timedate '+aoru_class+'">'+time_msg+'</span>';
660
- }
661
- }
662
-
663
-
664
- return time_msg;
665
- }
666
- } else {
667
- return '';
668
- }
669
-
670
- }
671
-
672
- function wplc_get_chat_person_name_msg_field(name) {
673
- try {
674
- return '<span class="wplc-chat-person-name">' + name + ': </span>';
675
- } catch(err) {
676
- //console.log("Could not wplc_get_chat_person_name_msg_field() " + err);
677
- }
678
- }
679
-
680
- /**
681
- * Removes undesired strings from a message which contains a GIF URL and returns only the gif url
682
- * @param {*} message_content
683
- */
684
- function getCleanedGif(message_content) {
685
- if (typeof(message_content) !== "undefined") {
686
- var msgParts = message_content.split(" ");
687
-
688
- if (typeof(msgParts) !== "undefined") {
689
-
690
- for (var i = 0; i < msgParts.length; i++) {
691
- var msgPart = msgParts[i];
692
-
693
- if (typeof(msgPart) !== "undefined") {
694
-
695
- if (gifExtensionPattern.test(msgPart)) {
696
- var cleanedGifUrl = msgPart.replace("href=", "");
697
- cleanedGifUrl = cleanedGifUrl.replace(/\"/g, "");
698
-
699
- return cleanedGifUrl;
700
- }
701
- }
702
- }
703
- }
704
- }
705
-
706
- return "";
707
- }
708
-
709
- /**
710
- * Pushes the message object to the chat box
711
- *
712
- * @param {object} the_message The message object
713
- * @param {string} aoru a for Agent, u for User
714
- * @return void
715
- */
716
- function wplc_push_message_to_chatbox(the_message, aoru, next) {
717
-
718
- /**
719
- * First check if we have processed this message already, by comparing the ID
720
- *
721
- * Some system notifications may not come through with an ID so we can accept those.
722
- */
723
- var add_message = true;
724
- if (typeof the_message.mid !== "undefined" && aoru === "u") {
725
- if (parseInt(the_message.mid) === 0 || the_message.mid === null) {
726
- add_message = true;
727
- } else {
728
- if (typeof wplc_msg_history[the_message.mid] !== "undefined") {
729
- /* we have this message already */
730
- add_message = false;
731
- } else {
732
- /* add this to our history */
733
- wplc_msg_history[the_message.mid] = true;
734
- }
735
- }
736
- }
737
- if (add_message) {
738
- if (typeof the_message.originates !== "undefined" && the_message.originates !== null && the_message.originates !== "null"){
739
- var message_class = "";
740
- var grav_hash = "";
741
- var message_grav = "";
742
- var message_from = "";
743
- var message_content = "";
744
- var message_aid;
745
-
746
- var message_edit_string = "";
747
-
748
- var audioPattern = new RegExp(/blob.wav/);
749
- var isAudioPattern = false;
750
-
751
- if (parseInt(the_message.originates) === 1) {
752
- //From Admin
753
-
754
- /* Define which agent it was sent from */
755
- if (typeof the_message.other !== "undefined" && typeof the_message.other.aid !== "undefined") {
756
- message_aid = the_message.other.aid.toString(); /* set it to a string because wp_localize doesnt know how to set keys as integers */
757
- } else if (typeof the_message.other !== "undefined" && typeof the_message.other.agent_id !== "undefined") {
758
- /* cloud server uses "agent_id" instead of "aid" */
759
- message_aid = the_message.other.agent_id.toString();
760
- } else {
761
- message_aid = false;
762
- }
763
- message_class = "wplc-admin-message wplc-color-bg-4 wplc-color-2 wplc-color-border-4";
764
-
765
- // If it is audio message
766
- isAudioPattern = audioPattern.test(the_message.msg);
767
- if (isAudioPattern) {
768
- message_class += " wplc-user-message-audio";
769
- }
770
-
771
- if (aoru === 'u') {
772
-
773
- /* message came from admin, intended for user */
774
- if (message_aid !== false && typeof wplc_agent_data !== "undefined" && typeof wplc_agent_data[message_aid] !== "undefined") {
775
- /* we know who the agent was that sent this message (v7.1.00+) */
776
- if (typeof wplc_show_chat_detail !== "undefined") {
777
- if (typeof wplc_show_chat_detail.avatar !== "undefined" && wplc_show_chat_detail.avatar === "1") { message_grav = (typeof wplc_agent_data[message_aid].md5 !== "undefined" ? "<img src='//www.gravatar.com/avatar/"+wplc_agent_data[message_aid].md5+"?s=80' class='wplc-admin-message-avatar' />" : ""); }
778
- if (typeof wplc_show_chat_detail.name !== "undefined" && wplc_show_chat_detail.name === "1") { message_from = (typeof wplc_agent_data[message_aid].name !== "undefined" ? wplc_get_chat_person_name_msg_field(wplc_agent_data[message_aid].name) : ""); }
779
- }
780
-
781
- } else {
782
- /* we do'nt know which agent sent this message, so lets set it as the current user instead (backwards compat) */
783
- if (typeof wplc_show_chat_detail !== "undefined") {
784
- if (typeof wplc_show_chat_detail.avatar !== "undefined" && wplc_show_chat_detail.avatar === "1") { message_grav = (typeof wplc_current_agent.email !== "undefined" ? "<img src='//www.gravatar.com/avatar/"+wplc_current_agent.email+"?s=80' class='wplc-admin-message-avatar' />" : ""); }
785
- if (typeof wplc_show_chat_detail.name !== "undefined" && wplc_show_chat_detail.name === "1") { message_from = (typeof wplc_current_agent.name !== "undefined" ? wplc_get_chat_person_name_msg_field(wplc_current_agent.name) : ""); }
786
- }
787
- }
788
- } else {
789
-
790
- if(typeof agent_id !== "undefined" && typeof message_aid !== "undefined"){
791
- if(parseInt(agent_id) === parseInt(message_aid)){
792
- //I own this message
793
- message_edit_string = "<span class='bleeper-edit-message' style='display:none;'>Edit</span>";
794
-
795
- }
796
- }
797
-
798
- if (message_aid !== false && typeof wplc_agent_data !== "undefined" && typeof wplc_agent_data[message_aid] !== "undefined") {
799
-
800
- /* we know who the agent was that sent this message (v7.1.00+) */
801
- if (typeof wplc_show_chat_detail !== "undefined") {
802
- if (typeof wplc_show_chat_detail.avatar !== "undefined" && wplc_show_chat_detail.avatar === "1") { message_grav = (typeof wplc_agent_data[message_aid].md5 !== "undefined" ? "<img src='//www.gravatar.com/avatar/"+wplc_agent_data[message_aid].md5+"?s=80' class='wplc-admin-message-avatar' />" : ""); }
803
- if (typeof wplc_show_chat_detail.name !== "undefined" && wplc_show_chat_detail.name === "1") { message_from = (typeof wplc_agent_data[message_aid].name !== "undefined" ? wplc_get_chat_person_name_msg_field(wplc_agent_data[message_aid].name) : ""); }
804
- }
805
-
806
- } else {
807
- if (typeof wplc_show_chat_detail.avatar !== "undefined" && wplc_show_chat_detail.avatar === "1") {
808
- message_grav = (typeof wplc_admin_agent_email !== "undefined" ? "<img src='//www.gravatar.com/avatar/"+wplc_admin_agent_email+"?s=80' class='wplc-admin-message-avatar' />" : "");
809
- }
810
- if (typeof wplc_show_chat_detail.name !== "undefined" && wplc_show_chat_detail.name === "1") {
811
- message_from = (typeof wplc_admin_agent_name !== "undefined" ? wplc_get_chat_person_name_msg_field(wplc_admin_agent_name) : "");
812
- }
813
- }
814
- }
815
-
816
- message_content = the_message.msg.wplcStripSlashes();
817
- wplc_new_message_sound = true;
818
-
819
- } else if (parseInt(the_message.originates) === 0 || parseInt(the_message.originates) === 3) {
820
- //System Notification
821
- message_class = "wplc_system_notification wplc-color-4";
822
- message_content = the_message.msg;
823
- if (typeof the_message.other.ntype !== "undefined") {
824
- if (the_message.other.ntype === "joined") {
825
- jQuery.event.trigger({type: "wplc_agent_joined", ndata:the_message});
826
- }
827
- }
828
-
829
- } else {
830
- /* most likely from the user */
831
- message_class = "wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1";
832
-
833
- isAudioPattern = audioPattern.test(the_message.msg);
834
- if (isAudioPattern) {
835
- message_class += " wplc-user-message-audio";
836
- }
837
-
838
- if (aoru === 'u') {
839
- message_edit_string = "<span class='bleeper-edit-message' style='display:none;'>Edit</span>";
840
-
841
- if (jQuery(wplc_email).val() !== "") {
842
- message_grav = md5(jQuery(wplc_email).val());
843
-
844
- } else {
845
- if (typeof visitor_list !== "undefined" && typeof visitor_list[active_chatid] !== "undefined" && typeof visitor_list[active_chatid].email !== "undefined") {
846
- message_grav = md5(visitor_list[active_chatid].email);
847
- } else {
848
- if(typeof wplc_cookie_email !== "undefined" && wplc_cookie_email !== ""){
849
- message_grav = md5(wplc_cookie_email);
850
- } else {
851
- message_grav = 'x';
852
- }
853
- }
854
- }
855
-
856
- message_grav = "<img src='//www.gravatar.com/avatar/" + message_grav + "?s=80' class='wplc-user-message-avatar' />";
857
- if (typeof Cookies.get("wplc_name") === "undefined") {
858
- message_from = wplc_get_chat_person_name_msg_field("Guest");
859
- } else {
860
- message_from = wplc_get_chat_person_name_msg_field(Cookies.get("wplc_name"));
861
- }
862
- } else {
863
- if (typeof wplc_chat_email !== "undefined") {
864
- message_grav = wplc_chat_email;
865
-
866
- } else {
867
- if (typeof visitor_list !== "undefined" && typeof visitor_list[active_chatid] !== "undefined" && typeof visitor_list[active_chatid].email !== "undefined") {
868
- message_grav = md5(visitor_list[active_chatid].email);
869
- } else {
870
- if(typeof wplc_cookie_email !== "undefined" && wplc_cookie_email !== ""){
871
- message_grav = md5(wplc_cookie_email);
872
- } else {
873
- message_grav = 'x';
874
- }
875
- }
876
- }
877
- message_grav = "<img src='//www.gravatar.com/avatar/" + message_grav + "?s=80' class='wplc-user-message-avatar' />";
878
- if (typeof wplc_chat_name !== "undefined") {
879
- message_from = wplc_get_chat_person_name_msg_field(wplc_chat_name);
880
- }
881
- }
882
- message_content = the_message.msg.wplcStripSlashes();
883
- }
884
-
885
- if (typeof the_message.other !== "undefined" && typeof the_message.other.from_an_agent !== "undefined"){
886
- if(the_message.other.from_an_agent === true || the_message.other.from_an_agent === "true"){
887
- //Cannot edit this
888
- message_edit_string = "";
889
- }
890
- }
891
- message_class += " message_"+the_message.mid;
892
-
893
- if (message_content !== ""){
894
- message_content = wplc_sanitize_attributes(message_content);
895
-
896
- // If it is audio message
897
- isAudioPattern = audioPattern.test(message_content);
898
-
899
- // Open the HTML of a message
900
- var concatenated_message = "<span class='" + message_class + "' mid='"+the_message.mid+"'>";
901
-
902
- if (typeof wplc_show_chat_detail !== "undefined") {
903
-
904
- if (typeof wplc_show_chat_detail.avatar !== "undefined" && wplc_show_chat_detail.avatar === "1") {
905
- concatenated_message += message_grav;
906
- }
907
-
908
- // Add a wrapper for the person name and the message, this wrapper is necessary to implement the UI of the admin chat
909
- if (isAudioPattern) {
910
- concatenated_message += "<div class='wplc-msg-content wplc-msg-content-audio' mid='" + the_message.mid + "'>";
911
- } else {
912
- concatenated_message += "<div class='wplc-msg-content' mid='"+the_message.mid+"'>";
913
- }
914
-
915
- if (isAudioPattern) {
916
- concatenated_message += "<span class='wplc-msg-content-audio-icon'></span>";
917
- } else if (typeof wplc_show_chat_detail.name !== "undefined" && wplc_show_chat_detail.name === "1") {
918
- concatenated_message += message_from;
919
- }
920
- } else {
921
- // Add a wrapper for the person name and the message, this wrapper is necessary to implement the UI of the admin chat
922
- concatenated_message += "<div class='wplc-msg-content'>";
923
- }
924
-
925
- var original_message = message_content;
926
- if (isAudioPattern) {
927
- message_content = "<a href='" + message_content + "' target='_blank'>" + (typeof wplc_visitor_voice !== 'undefined' && typeof wplc_visitor_voice.play_sound !== 'undefined' ? wplc_visitor_voice.play_sound : 'Open Voice Note') + "</a>";
928
- } else if (typeof niftyFormatParser !== "undefined"){
929
- message_content = niftyFormatParser(message_content);
930
- }
931
-
932
- // If it is a GIF message
933
- if (gifExtensionPattern.test(message_content)) {
934
- cleanedGif = getCleanedGif(message_content);
935
- concatenated_message += "<span class='messageBody' data-message='"+ cleanedGif +"'><img src='"+ cleanedGif + "' class='gif-img'/></span>"+ message_edit_string;
936
- } else if (isAudioPattern) {
937
- // If it is audio pattern
938
- concatenated_message += "<span class='messageBody'>"+message_content+"</span>";
939
- } else {
940
- // If it is a regular message
941
- concatenated_message += "<span class='messageBody' data-message='" + original_message + "'>"+message_content+"</span>"+ message_edit_string;
942
- }
943
-
944
- // Close the person name/message wrapper, if it was added
945
- concatenated_message += "</div>";
946
-
947
- // Close the HTML of a message
948
- concatenated_message += "</span>";
949
- concatenated_message += wplc_add_date_and_time(the_message,the_message.originates);
950
-
951
- if (aoru === 'u') {
952
- wplc_chat_box_elemn = "#wplc_chatbox";
953
- } else {
954
-
955
- if (typeof bleeper_remote_enabled !== "undefined"){
956
- wplc_chat_box_elemn = "#messages";
957
- } else {
958
- wplc_chat_box_elemn = "#admin_chat_box_area_"+wplc_cid;
959
- }
960
- }
961
-
962
-
963
- jQuery(wplc_chat_box_elemn).append(concatenated_message);
964
-
965
- }
966
- }
967
- }
968
- next();
969
- }
970
-
971
- jQuery(function(){
972
- jQuery(document).ready(function(){
973
- var wplc_node_searchTimeout;
974
-
975
- jQuery("body").on("keydown","#wplc_chatmsg, #wplc_admin_chatmsg", function(e) {
976
- if(typeof wplc_node_sockets_ready !== "undefined" && wplc_node_sockets_ready === true){
977
- if(typeof wplc_node_is_client_typing !== "undefined"){
978
- if (e.which <= 90 && e.which >= 48) {
979
- if (wplc_node_is_client_typing) {
980
- wplc_node_renew_typing();
981
- return;
982
- }
983
- wplc_node_is_client_typing = true;
984
-
985
- wplc_node_searchTimeout = setTimeout(wplc_node_clear_typing, 1000);
986
- }
987
- }
988
- }
989
- });
990
-
991
- jQuery("body").on("click", "#wplc_na_msg_btn", function() {
992
- var wplc_is_gdpr_enabled = jQuery(this).attr('data-wplc-gdpr-enabled');
993
- if(typeof wplc_is_gdpr_enabled !== "undefined" && (wplc_is_gdpr_enabled === 'true' )){
994
- var wplc_gdpr_opt_in_checked = jQuery("#wplc_chat_gdpr_opt_in").is(':checked');
995
- if(typeof wplc_gdpr_opt_in_checked === "undefined" || wplc_gdpr_opt_in_checked === false){
996
- /* GDPR requirements not met */
997
- jQuery("#wplc_chat_gdpr_opt_in").addClass('incomplete');
998
- return false;
999
- }
1000
- jQuery("#wplc_chat_gdpr_opt_in").removeClass('incomplete');
1001
- }
1002
-
1003
- var wplc_name = jQuery("#wplc_name").val();
1004
- var wplc_email = jQuery("#wplc_email").val();
1005
- var wplc_msg = jQuery("#wplc_message").val();
1006
- var wplc_domain = jQuery("#wplc_domain_offline").val();
1007
- var ip_address = jQuery("#wplc_ip_address").val();
1008
-
1009
- if (wplc_name.length <= 0) { alert(wplc_error_messages.valid_name); return false; }
1010
- if (wplc_email.length <= 0) { alert(wplc_error_messages.valid_email); return false; }
1011
- var testEmail = /^[A-Z0-9._%+-]+@([A-Z0-9-]+\.)+[A-Z]{2,12}$/i;
1012
- if (!testEmail.test(wplc_email)){
1013
- alert(wplc_error_messages.valid_email); return false;
1014
- }
1015
- if (wplc_msg.length <= 0) { alert(wplc_error_messages.empty_message); return false; }
1016
- jQuery("#wp-live-chat-2-info").hide();
1017
- jQuery("#wplc_message_div").html(wplc_offline_msg);
1018
-
1019
- wplc_cid = Cookies.get('wplc_cid');
1020
-
1021
- var data = {
1022
- action: 'wplc_user_send_offline_message',
1023
- security: wplc_nonce,
1024
- cid: wplc_cid,
1025
- name: wplc_name,
1026
- email: wplc_email,
1027
- msg: wplc_msg,
1028
- ip: ip_address,
1029
- domain: wplc_domain,
1030
- wplc_extra_data:wplc_extra_data
1031
- };
1032
-
1033
- jQuery.post(wplc_ajaxurl_site, data, function(response) {
1034
- jQuery("#wplc_message_div").html(wplc_offline_msg3);
1035
- });
1036
- if (typeof wplc_enable_ga !== "undefined" && wplc_enable_ga === '1') {
1037
- if (typeof ga !== "undefined") {
1038
- ga('send', {
1039
- hitType: 'event',
1040
- eventCategory: 'WP_Live_Chat_Support',
1041
- eventAction: 'Event',
1042
- eventLabel: 'User Send Offline Message'
1043
- });
1044
- }
1045
- }
1046
- });
1047
-
1048
-
1049
- function wplc_node_renew_typing() {
1050
- clearTimeout(wplc_node_searchTimeout);
1051
- wplc_node_searchTimeout = setTimeout(wplc_node_clear_typing, 1000);
1052
- }
1053
- function wplc_node_clear_typing() {
1054
- wplc_node_is_client_typing = false;
1055
- clearTimeout(wplc_node_searchTimeout);
1056
- }
1057
- });
1058
- });
1059
-
1060
- var wplc_generate_system_notification_object = function(msg,other,originates) {
1061
- the_message = {};
1062
- the_message.originates = originates;
1063
- the_message.msg = msg;
1064
- the_message.other = other;
1065
- var wplc_d = new Date();
1066
- the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
1067
- return the_message;
1068
- }
1069
-
1070
- function wplc_display_system_notification(message) {
1071
- message_output = '<div id="bleeper_notification_message" class="wplc-color-bg-1 wplc-color-2">' + message.msg + '</div>';
1072
-
1073
- if (jQuery('#bleeper_notification_message').length == 0) {
1074
- jQuery('#wp-live-chat-4').prepend(message_output);
1075
- }
1076
- }
1077
-
1078
- function wplc_clear_system_notification() {
1079
- if (jQuery('#bleeper_notification_message').length !== 0) {
1080
- jQuery('#bleeper_notification_message').remove();
1081
- }
1082
- }
1083
-
1084
- /*
1085
- * Updates the message element with a new message.
1086
- * - mid: Message ID which is appended to class selector as .message_{mid}
1087
- * - message: The html/text to insert into this container
1088
- * - inner_container_class: Optional, used to select the first child of the class type within the primary message container
1089
- * Nice for selecting the 'messageBody' class specifically
1090
- */
1091
- function wplc_update_message_element_by_mid(mid, message, inner_container_class){
1092
- var element_selector = ".message_" + mid;
1093
- element_selector += (typeof inner_container_class !== "undefined" && inner_container_class !== false) ? (" ." + inner_container_class) : "";
1094
-
1095
- jQuery(element_selector).html(message);
 
 
 
 
 
 
 
 
 
1096
  }
1
+ /*
2
+ * Hanldes Message transportation within WPLC
3
+ */
4
+ var gifExtensionPattern = new RegExp(/\.(gif)\b/);
5
+
6
+ var wplc_server_method = null;
7
+ var wplc_supress_server_logs = true; //We are now surpressing server logs
8
+ var wplc_node_socket = null; //Will not be set unless
9
+ var wplc_node_send_queue = new Array();
10
+ var wplc_node_message_receiver = null;
11
+ var wplc_node_message_restart_handler = null;
12
+ var wplc_node_client_event_logger = null;
13
+ var wplc_node_sockets_ready = false;
14
+ var wplc_transport_prepared = false;
15
+
16
+ var wplc_node_async_array = new Array(); //Array which will be sent to our async URL for storage
17
+ var wplc_node_async_send_rate = 1; //Amount of messages that need to be present before we sent the async request
18
+ var wplc_node_async_cookie_check_complete = false;
19
+
20
+ var wplc_node_port_open = true; //This can be set to false to prevent any future data being sent
21
+ var wplc_node_is_client_typing = false;
22
+ var wplc_node_is_pair_typing_indicator_visible = false;
23
+ var wplc_node_pair_name = "";
24
+
25
+ var wplc_node_switch_ajax_complete = false;
26
+ var wplc_node_retry_count = 0;
27
+
28
+ var wplc_msg_history = new Array();
29
+
30
+ var wplc_xhr; //XHR global (allows us to abort previous AJAX request when the agent flips between screens quickly)
31
+
32
+
33
+
34
+ function WPLCServer(){
35
+ var wplc_server_ref = this;
36
+ //Default to ajax until chat starts
37
+ wplc_server_method = WPLCServer.Ajax;
38
+ wplc_server_ref.send = wplc_server_method.send;
39
+
40
+ wplc_server_ref.isInSocketMode = wplc_server_method.isInSocketMode;
41
+ wplc_server_ref.isPreparingSocketMode = wplc_server_method.isPreparingSocketMode;
42
+ wplc_server_ref.transportPrepared = wplc_server_method.transportPrepared;
43
+ wplc_server_ref.asyncStorage = wplc_server_method.asyncStorage;
44
+ wplc_server_ref.forceClosePort = wplc_server_method.forceClosePort;
45
+ wplc_server_ref.sendMessage = wplc_server_method.sendMessage;
46
+
47
+
48
+ wplc_server_ref.prepareTransport = function(callback, messageHandler, restartHandler, clientEventLog){
49
+ wplc_server_log("-------------------");
50
+ wplc_server_log("Preparing Transport");
51
+ if(typeof wplc_use_node_server !== "undefined" && wplc_use_node_server === "true"){
52
+ if(window.WebSocket){
53
+ //Sockets are supported
54
+ wplc_server_method = WPLCServer.Socket;
55
+ wplc_server_log("Socket Mode");
56
+ } else {
57
+ wplc_server_method = WPLCServer.Ajax;
58
+ wplc_server_log("Ajax Mode");
59
+ }
60
+ } else {
61
+ wplc_server_method = WPLCServer.Ajax;
62
+ wplc_server_log("Ajax Mode");
63
+ }
64
+
65
+ wplc_server_method.init(function(){
66
+ wplc_server_ref.send = wplc_server_method.send;
67
+ wplc_server_ref.isInSocketMode = wplc_server_method.isInSocketMode;
68
+ wplc_server_ref.isPreparingSocketMode = wplc_server_method.isPreparingSocketMode;
69
+ wplc_server_ref.transportPrepared = wplc_server_method.transportPrepared;
70
+ wplc_server_ref.asyncStorage = wplc_server_method.asyncStorage;
71
+ wplc_server_ref.forceClosePort = wplc_server_method.forceClosePort;
72
+ wplc_server_ref.sendMessage = wplc_server_method.sendMessage;
73
+
74
+ if(typeof callback === "function"){
75
+ callback();
76
+ }
77
+ }, messageHandler, function(){
78
+ wplc_server_method = WPLCServer.Ajax;
79
+ wplc_server_log("Ajax Mode - Fail Over");
80
+
81
+ wplc_server_ref.send = wplc_server_method.send;
82
+ wplc_server_ref.isInSocketMode = wplc_server_method.isInSocketMode;
83
+ wplc_server_ref.isPreparingSocketMode = function(){ return false; };
84
+ wplc_server_ref.transportPrepared = wplc_server_method.transportPrepared;
85
+ wplc_server_ref.asyncStorage = wplc_server_method.asyncStorage;
86
+ wplc_server_ref.forceClosePort = wplc_server_method.forceClosePort;
87
+ wplc_server_ref.sendMessage = wplc_server_method.sendMessage;
88
+
89
+ if(typeof wplc_ajaxurl !== "undefined" && typeof wplc_nonce !== "undefined" && typeof wplc_cid !== "undefined"){
90
+ var wplc_fail_over_data = {
91
+ action: 'wplc_node_switch_to_ajax',
92
+ security: wplc_nonce,
93
+ cid: wplc_cid
94
+ };
95
+
96
+ jQuery.ajax({
97
+ url : wplc_ajaxurl,
98
+ data : wplc_fail_over_data,
99
+ type : "POST",
100
+ timeout : 120000,
101
+ success : function(response){
102
+ wplc_server_log("Ajax Mode Enabled");
103
+ },
104
+ error : function(error, exception){
105
+ wplc_server_log("Chat Fail Over Could Not Be Setup");
106
+ },
107
+ complete : function(response){
108
+ if(typeof callback === "function"){
109
+ callback();
110
+ }
111
+ }
112
+ });
113
+ }
114
+ }, restartHandler, clientEventLog);
115
+
116
+ wplc_server_log("Transport Prepared");
117
+ wplc_server_log("-------------------");
118
+ wplc_transport_prepared = true;
119
+ }
120
+
121
+ wplc_server_ref.browserIsSocketReady = function(){
122
+ if(typeof wplc_use_node_server !== "undefined" && wplc_use_node_server === "true"){
123
+ if(window.WebSocket){
124
+ return true;
125
+ } else {
126
+ return false;
127
+ }
128
+ } else {
129
+ return false;
130
+ }
131
+ }
132
+ }
133
+
134
+ WPLCServer.Socket = {
135
+ /*
136
+ init : function(callback, messageHandler, failOver, restartHandler, clientEventLog){
137
+ wplc_node_message_receiver = (typeof messageHandler !== "undefined" && typeof messageHandler === "function") ? messageHandler : false;
138
+ wplc_node_message_restart_handler = (typeof restartHandler !== "undefined" && typeof restartHandler === "function") ? restartHandler : false;
139
+ wplc_node_client_event_logger = (typeof clientEventLog !== "undefined" && typeof clientEventLog === "function") ? clientEventLog : false;
140
+
141
+ wplc_server_log("Socket Init");
142
+ //wplc_node_socket = new WebSocket('wss://wp-livechat.us-2.evennode.com');
143
+
144
+
145
+ if(wplc_node_async_cookie_check_complete !== true){
146
+ //Check if there are any messages we forgot to send via async
147
+ if(typeof Cookies !== "undefined" && typeof Cookies === "function"){
148
+ var wplc_node_async_cookie_data = Cookies.getJSON("wplc_server_async_storage");
149
+ if(typeof wplc_node_async_cookie_data !== "undefined" && wplc_node_async_cookie_data !== "undefined" && wplc_node_async_cookie_data !== undefined && wplc_node_async_cookie_data !== null){
150
+ wplc_server_log("Async Cookies Found -> Sync...");
151
+ wplc_node_parse_async_from_object(wplc_node_async_cookie_data, function(){
152
+ wplc_node_async_cookie_check_complete = true;
153
+ });
154
+ }
155
+ }
156
+ }
157
+
158
+ wplc_node_socket.onerror = function(event){
159
+ wplc_server_error("Could not connect to server. Changing transport method.");
160
+ if(typeof failOver === "function" && wplc_node_sockets_ready !== true){
161
+ failOver();
162
+ wplc_node_switch_ajax_complete = true;
163
+ if(typeof wplc_node_client_event_logger !== "undefined" && typeof wplc_node_client_event_logger === "function"){
164
+ wplc_node_client_event_logger("Connection Error - Switching methods");
165
+ }
166
+ }
167
+ }
168
+
169
+ wplc_node_socket.onopen = function(event) {
170
+ wplc_server_log("This socket is open");
171
+ wplc_node_sockets_ready = true; //Sockets are available and ready for use
172
+ if(typeof callback === "function"){
173
+ callback();
174
+ }
175
+ }
176
+
177
+ wplc_node_socket.onmessage = function(event){
178
+ if(typeof wplc_node_message_receiver === "function" && wplc_node_message_receiver !== false && wplc_node_message_receiver !== null){
179
+ //Delegate to handler
180
+ if(wplc_node_port_open){
181
+ wplc_node_message_receiver(event.data);
182
+ wplc_node_global_message_receiver(event.data);
183
+ }
184
+ }
185
+
186
+ }
187
+
188
+ wplc_node_socket.onclose = function(event) {
189
+ wplc_server_log("This socket is closed");
190
+ if (typeof wplc_node_message_restart_handler === "function") {
191
+ if (wplc_node_retry_count < 5 && wplc_node_switch_ajax_complete !== true) {
192
+ setTimeout(function(){
193
+ wplc_node_message_restart_handler(event.data);
194
+ wplc_node_retry_count++;
195
+ if(typeof wplc_node_client_event_logger !== "undefined" && typeof wplc_node_client_event_logger === "function"){
196
+ wplc_node_client_event_logger("Connection Error - Retrying in 5 seconds...");
197
+ }
198
+ }, 5000);
199
+ } else {
200
+ if(wplc_node_retry_count >= 5){
201
+ if(typeof wplc_node_client_event_logger !== "undefined" && typeof wplc_node_client_event_logger === "function"){
202
+ wplc_node_client_event_logger("Connection Error - Please refresh your browser");
203
+ }
204
+ }
205
+ }
206
+ }
207
+ }
208
+
209
+
210
+ },
211
+ send : function (wplc_send_url, wplc_send_data, wplc_send_type, wplc_send_timeout, wplc_send_success_callback, wplc_send_fail_callback, wplc_send_complete_callback){
212
+ wplc_origin_url = wplc_send_url.replace("/wp-admin/admin-ajax.php", "");
213
+ wplc_send_data.origin_url = wplc_origin_url;
214
+ wplc_socket_send(wplc_send_data, wplc_send_success_callback, wplc_send_fail_callback, wplc_send_complete_callback);
215
+
216
+ if(wplc_node_async_cookie_check_complete){
217
+ //Now lets update the sync quick
218
+ wplc_socket_async_storage_handler(wplc_send_url, wplc_send_data, wplc_send_timeout);
219
+ wplc_node_async_cookie_check_complete = false; //Stop infinite loop
220
+ }
221
+ },
222
+ isInSocketMode : function (){
223
+ return wplc_node_sockets_ready;
224
+ },
225
+ isPreparingSocketMode : function(){
226
+ var preparing = false;
227
+ if(typeof wplc_use_node_server !== "undefined" && wplc_use_node_server === "true"){
228
+ if(window.WebSocket){
229
+ preparing = true;
230
+ }
231
+ }
232
+
233
+ return preparing;
234
+ },
235
+ transportPrepared : function(){
236
+ return wplc_transport_prepared;
237
+ },
238
+ asyncStorage : function(wplc_send_url, wplc_send_data, wplc_send_timeout){
239
+ wplc_node_async_array.push(wplc_send_data.msg);
240
+
241
+ if(typeof Cookies !== "undefined" && typeof Cookies === "function"){
242
+ Cookies.set('wplc_server_async_storage', JSON.stringify(wplc_node_async_array), { expires: 1, path: '/' });
243
+ }
244
+
245
+ if(wplc_node_async_array.length >= wplc_node_async_send_rate){
246
+ wplc_socket_async_storage_handler(wplc_send_url, wplc_send_data, wplc_send_timeout);
247
+ }
248
+ },
249
+ forceClosePort : function(){
250
+ wplc_node_port_open = false;
251
+ },
252
+ sendMessage : function(wplc_send_url, wplc_send_data, wplc_send_type, wplc_send_timeout, wplc_send_success_callback, wplc_send_fail_callback, wplc_send_complete_callback){
253
+ wplc_origin_url = wplc_send_url.replace("/wp-admin/admin-ajax.php", "");
254
+ wplc_send_data.origin_url = wplc_origin_url;
255
+ wplc_socket_add_to_queue(wplc_send_data, wplc_send_success_callback, wplc_send_fail_callback, wplc_send_complete_callback);
256
+ } */
257
+
258
+ };
259
+
260
+ WPLCServer.Ajax = {
261
+ init : function(callback, messageHandler, failOver, restartHandler, clientEventLog){
262
+ wplc_server_log("Ajax Init");
263
+ if(typeof callback === "function"){
264
+ callback();
265
+ }
266
+ },
267
+ send : function (wplc_send_url, wplc_send_data, wplc_send_type, wplc_send_timeout, wplc_send_success_callback, wplc_send_fail_callback, wplc_send_complete_callback){
268
+ jQuery.ajax({
269
+ url : wplc_send_url,
270
+ data : wplc_send_data,
271
+ type : wplc_send_type,
272
+ timeout : wplc_send_timeout,
273
+ success : function(response){
274
+ if(typeof wplc_send_success_callback === "function"){
275
+ if(typeof wplc_send_data['action'] !== "undefined" && wplc_send_data['action'] !== "wplc_start_chat"){ //Is this the start?
276
+ wplc_send_success_callback(response);
277
+ } else {
278
+ //Check if we are going to go into socket mode after this?
279
+ if(typeof wplc_use_node_server !== "undefined" && wplc_use_node_server === "true"){
280
+ if(window.WebSocket){
281
+ wplc_send_success_callback(response); //Send the data if we are going to sockets after this
282
+ }
283
+ }
284
+ }
285
+ }
286
+ },
287
+ error : function(error, exception){
288
+ if(typeof wplc_send_fail_callback === "function"){
289
+ wplc_send_fail_callback(error, exception);
290
+ }
291
+ },
292
+ complete : function(response){
293
+ if(typeof wplc_send_complete_callback === "function"){
294
+ wplc_send_complete_callback(response, wplc_send_data);
295
+ }
296
+ }
297
+ });
298
+ },
299
+ isInSocketMode : function (){
300
+ return wplc_node_sockets_ready;
301
+ },
302
+ isPreparingSocketMode : function(){
303
+ var preparing = false;
304
+ if(typeof wplc_use_node_server !== "undefined" && wplc_use_node_server === "true"){
305
+ if(window.WebSocket){
306
+ preparing = true;
307
+ }
308
+ }
309
+
310
+ return preparing;
311
+ },
312
+ transportPrepared : function(){
313
+ return wplc_transport_prepared;
314
+ },
315
+ asyncStorage : function(wplc_send_url, wplc_send_data, wplc_send_timeout){
316
+ //Do nothing -> Ajax handles
317
+ },
318
+ forceClosePort : function(){
319
+ //Do Nothing ajax doesnt use socket ports
320
+ },
321
+ sendMessage : function(wplc_send_url, wplc_send_data, wplc_send_type, wplc_send_timeout, wplc_send_success_callback, wplc_send_fail_callback, wplc_send_complete_callback){
322
+ WPLCServer.Ajax.send(wplc_send_url, wplc_send_data, wplc_send_type, wplc_send_timeout, wplc_send_success_callback, wplc_send_fail_callback, wplc_send_complete_callback);
323
+ }
324
+ };
325
+
326
+
327
+ function wplc_server_log(msg){
328
+ if(wplc_supress_server_logs !== true && window.console){
329
+ console.log("WPLC SERVER: " + msg);
330
+ }
331
+ }
332
+
333
+ function wplc_server_error(msg){
334
+ if(window.console){
335
+ console.error("WPLC SERVER ERROR: " + msg);
336
+ }
337
+ }
338
+
339
+ function wplc_socket_send(data, success, fail, complete){
340
+ if(wplc_node_port_open){
341
+ wplc_socket_add_to_queue(data, success, fail, complete);
342
+
343
+ //if(data.action !== "wplc_user_send_msg" && data.action !== "wplc_admin_send_msg"){
344
+ var wplc_current_queue_item = wplc_socket_get_next_in_queue();
345
+ if(wplc_current_queue_item !== false){
346
+ if(typeof wplc_node_socket !== "undefined" && wplc_node_socket !== null){
347
+ if(wplc_node_socket.readyState !== WebSocket.CONNECTING && wplc_node_socket.readyState !== WebSocket.CLOSING && wplc_node_socket.readyState !== WebSocket.CLOSED){
348
+ wplc_current_queue_item.data.is_typing = typeof wplc_node_is_client_typing !== "undefined" ? wplc_node_is_client_typing : false;
349
+ wplc_node_socket.send(JSON.stringify(wplc_current_queue_item.data));
350
+
351
+ if(typeof wplc_current_queue_item.success === "function"){
352
+ wplc_current_queue_item.success();
353
+ }
354
+ } else {
355
+ //Try again in a sec just now -> Add it to the queue
356
+ setTimeout(function(){
357
+ wplc_socket_send(data, success, fail, complete);
358
+ }, 500);
359
+ }
360
+ } else {
361
+ setTimeout(function(){
362
+ //Try again in a sec just now -> Add it to the queue
363
+ wplc_socket_send(data, success, fail, complete);
364
+ }, 500);
365
+ }
366
+ }
367
+ //}
368
+ }
369
+ }
370
+
371
+ function wplc_sanitize_attributes( str ){
372
+ var wplc_allowed_attributes = "onload,onclick,alert,onerror,dalert";
373
+ var allowed_attr = wplc_allowed_attributes.split(",");
374
+ for( i = 0; i < allowed_attr.length; i++ ){
375
+ str = str.replace(allowed_attr[i], '');
376
+ }
377
+
378
+ return str;
379
+ }
380
+
381
+ function wplc_socket_add_to_queue(data, success, fail, complete){
382
+ if(typeof data.server_token === "undefined"){
383
+ if(typeof bleeper_api_key !== "undefined"){
384
+ data.server_token = bleeper_api_key;
385
+ } else {
386
+ wplc_server_error("No Server Token Present, Something will go wrong");
387
+ }
388
+ }
389
+
390
+
391
+ var queue_item = {
392
+ data: data,
393
+ success: success,
394
+ fail: fail,
395
+ complete: complete
396
+ }
397
+
398
+ if(wplc_node_send_queue.length > 0){
399
+ var last_item = wplc_node_send_queue[wplc_node_send_queue.length - 1];
400
+ if(JSON.stringify(last_item.data) !== JSON.stringify(data)){
401
+ wplc_node_send_queue.push(queue_item);
402
+ }
403
+ } else {
404
+ wplc_node_send_queue.push(queue_item);
405
+ }
406
+ }
407
+
408
+ function wplc_socket_get_next_in_queue(){
409
+ if(wplc_node_send_queue.length > 0){
410
+ return wplc_node_send_queue.shift();
411
+ } else {
412
+ return false;
413
+ }
414
+ }
415
+
416
+ function wplc_rest_api(type, wplc_send_data, wplc_send_timeout, next) {
417
+
418
+ if (typeof wplc_xhr !== "undefined" && typeof wplc_xhr.abort() !== "undefined") { wplc_xhr.abort(); }
419
+ if (typeof next === "undefined" || next === null) { next = function() {}; }
420
+ var wplc_node_ajax_action = type;
421
+ //Send the data to the Async
422
+ if(typeof wplc_restapi_enabled !== "undefined" && parseInt(wplc_restapi_enabled) === 1 && typeof wplc_restapi_endpoint !== "undefined"){
423
+ //REST API is ready to rumble
424
+
425
+ var anti_cache = Date.now();
426
+
427
+ wplc_send_url = wplc_restapi_endpoint + "/" + type + "?nocache="+anti_cache;
428
+
429
+
430
+
431
+ var prepared_data = wplc_send_data;
432
+
433
+ var x = {
434
+ action : wplc_node_ajax_action,
435
+ relay_action : wplc_send_data.action,
436
+ chat_id : wplc_send_data.cid,
437
+ security : wplc_send_data.security,
438
+ message : wplc_send_data.msg,
439
+ server_token : wplc_restapi_token,
440
+ wplc_extra_data:document.wplc_extra_data,
441
+ wplc_data : wplc_send_data
442
+ };
443
+
444
+
445
+ prepared_data.server_token = wplc_restapi_token;
446
+ prepared_data.token = wplc_restapi_token; /* backwards compat */
447
+ if (typeof prepared_data.wplc_extra_data === "undefined") {
448
+ prepared_data.wplc_extra_data = document.wplc_extra_data;
449
+ }
450
+ prepared_data._wpnonce = wplc_restapi_nonce;
451
+
452
+ wplc_xhr = jQuery.ajax({
453
+ url : wplc_send_url,
454
+ data : prepared_data,
455
+ type : "POST",
456
+ timeout : wplc_send_timeout,
457
+ success : function(response){
458
+ wplc_server_log("REST SEND = SUCCESS");
459
+ next(response);
460
+ },
461
+ error : function(error, exception){
462
+ wplc_server_log("REST SEND = FAIL");
463
+ next();
464
+ },
465
+ complete : function(response){
466
+ next(response);
467
+ }
468
+ });
469
+ } else {
470
+ wplc_server_log("NO REST API :(");
471
+ next();
472
+ }
473
+
474
+ }
475
+
476
+ function wplc_socket_async_storage_handler(wplc_send_url, wplc_send_data, wplc_send_timeout){
477
+ var wplc_node_ajax_action = "wplc_node_async_storage_ajax";
478
+ //Send the data to the Async
479
+ if(typeof wplc_restapi_enabled !== "undefined" && parseInt(wplc_restapi_enabled) === 1 && typeof wplc_restapi_endpoint !== "undefined"){
480
+ //REST API is ready to rumble
481
+ wplc_send_url = wplc_restapi_endpoint + "/async_storage";
482
+ } else {
483
+ //Ajax time! Cause the Rest she Left
484
+ }
485
+
486
+ var prepared_data = {
487
+ action : wplc_node_ajax_action,
488
+ relay_action : wplc_send_data.action,
489
+ chat_id : wplc_send_data.cid,
490
+ security : wplc_send_data.security,
491
+ messages : JSON.stringify(wplc_node_async_array),
492
+ wplc_extra_data:document.wplc_extra_data
493
+ };
494
+
495
+ if(typeof bleeper_api_key !== "undefined"){
496
+ prepared_data.server_token = bleeper_api_key;
497
+ }
498
+
499
+ /*
500
+ wplc_node_async_array = new Array(); //Clearing the storage array before the next data can be sent through
501
+ if(typeof Cookies !== "undefined" && typeof Cookies === "function"){
502
+ Cookies.remove('wplc_server_async_storage'); //Clear the cookies now so that we don't do this again.
503
+ }
504
+ */
505
+ jQuery.ajax({
506
+ url : wplc_send_url,
507
+ data : prepared_data,
508
+ type : "POST",
509
+ timeout : wplc_send_timeout,
510
+ success : function(response){
511
+ wplc_server_log("ASYNC STORAGE = SUCCESS");
512
+ },
513
+ error : function(error, exception){
514
+ wplc_server_log("ASYNC STORAGE = FAIL");
515
+ },
516
+ complete : function(response){
517
+
518
+ }
519
+ });
520
+ }
521
+
522
+ function wplc_json_validator(str) {
523
+ try {
524
+ JSON.parse(str);
525
+ } catch (e) {
526
+ return false;
527
+ }
528
+ return true;
529
+ }
530
+
531
+ function wplc_node_parse_async_from_object(obj, complete){
532
+ for(var i in obj){
533
+ if(obj.hasOwnProperty(i)){
534
+ wplc_node_async_array.push(obj[i]);
535
+ }
536
+ }
537
+
538
+ if(typeof complete === "function"){
539
+ complete();
540
+ }
541
+ }
542
+
543
+ function wplc_node_global_message_receiver(data){
544
+ if(data){
545
+ if (typeof data !== "object") {
546
+ data = JSON.parse(data);
547
+ }
548
+ }
549
+
550
+ if(typeof data['pair_name'] !== "undefined"){
551
+ if(data['pair_name'] !== wplc_node_pair_name){
552
+ wplc_node_pair_name = data['pair_name'];
553
+ }
554
+ }
555
+
556
+ if(typeof data['pair_typing'] !== "undefined"){
557
+
558
+ if(data['pair_typing'] === true || data['pair_typing'] === "true"){
559
+ if(wplc_node_is_pair_typing_indicator_visible === false){
560
+ if (jQuery("#wplc_user_typing").length>0) { } else {
561
+ jQuery(".typing_indicator").html("<span id='wplc_user_typing'>"+wplc_node_pair_name+" "+wplc_localized_string_is_typing_single+"</span>");
562
+ jQuery(".typing_indicator").addClass("typing_indicator_active");
563
+ }
564
+ }
565
+ wplc_node_is_pair_typing_indicator_visible = true;
566
+ } else {
567
+ if(wplc_node_is_pair_typing_indicator_visible === true){
568
+ if (jQuery("#wplc_user_typing").length>0) {
569
+ jQuery("#wplc_user_typing").fadeOut("slow").remove();
570
+ jQuery(".typing_indicator").removeClass("typing_indicator_active");
571
+ }
572
+ }
573
+ wplc_node_is_pair_typing_indicator_visible = false;
574
+ }
575
+
576
+ }
577
+ }
578
+ String.prototype.wplcStripSlashes = function(){
579
+ return this.replace(/\\(.)/mg, "$1");
580
+ }
581
+
582
+ function wplc_add_date_and_time(the_message,originates) {
583
+
584
+ if (parseInt(originates) === 1 || parseInt(originates) === 2) {
585
+
586
+ var time_msg = '';
587
+
588
+ /* identfy the timestamp */
589
+ if (typeof the_message.other === "undefined" || typeof the_message.other.datetime === "undefined" || the_message.other === false) {
590
+ /* only run if it hasnt got a timestamp in the .other.datetime key */
591
+ if (typeof the_message.timestamp !== "undefined") {
592
+ /* most likely came from node as node */
593
+
594
+ if (typeof the_message.other !== "object") { the_message.other = {}; }
595
+ the_message.other.datetime = the_message.timestamp;
596
+
597
+ }
598
+ }
599
+
600
+ if (typeof the_message.other === "undefined" || typeof the_message.other.datetime === "undefined") {
601
+ /* there is no datetime so return nothing */
602
+ return '';
603
+ } else {
604
+ if (typeof wplc_show_chat_detail !== "undefined") {
605
+
606
+ var datetimestamp = the_message.other.hasOwnProperty( 'datetimeUTC' ) ? the_message.other.datetimeUTC : the_message.other.datetime;
607
+ var dateTime = new Date( parseInt( datetimestamp ) * 1000 );
608
+
609
+ if ( typeof wplc_show_chat_detail.date !== 'undefined' && '1' === wplc_show_chat_detail.date ) {
610
+
611
+ var date_format = typeof wplc_datetime_format !== 'undefined' && wplc_datetime_format.hasOwnProperty( 'date_format' ) ? wplc_datetime_format.date_format : 'n/d';
612
+ var date_month = dateTime.getMonth();
613
+ var date_day = dateTime.getDate();
614
+ var date_months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
615
+ var date_days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
616
+ var date_day_no = dateTime.getDay();
617
+ var date_year = dateTime.getFullYear();
618
+
619
+ time_msg += date_format
620
+ .replace( /S/g, '%S%' )
621
+ .replace( /D/g, '%D%' )
622
+ .replace( /l/g, '%l%' )
623
+ .replace( /F/g, '%F%' )
624
+ .replace( /M/g, '%M%' )
625
+ .replace( /j/g, date_day )
626
+ .replace( /d/g, date_day < 10 ? '0' + date_day : date_day )
627
+ .replace( /w/g, date_day_no )
628
+ .replace( /n/g, date_month + 1 )
629
+ .replace( /m/g, date_month + 1 < 10 ? '0' + ( date_month + 1 ) : date_month + 1 )
630
+ .replace( /Y/g, date_year )
631
+ .replace( /y/g, date_year.toString().substr( 2, 2 ) )
632
+ .replace( /%S%/g, 1 === date_day ? 'st' : ( 2 === date_day ? 'nd' : ( 3 === date_day ? 'rd' : 'th' ) ) )
633
+ .replace( /%D%/g, date_days[ date_day_no ].substr( 0, 3 ) )
634
+ .replace( /%l%/g, date_days[ date_day_no ] )
635
+ .replace( /%F%/g, date_months[ date_month ] )
636
+ .replace( /%M%/g, date_months[ date_month ].substr( 0, 3 ) ) + ' ';
637
+
638
+ }
639
+ if ( typeof wplc_show_chat_detail.time !== "undefined" && '1' === wplc_show_chat_detail.time ) {
640
+
641
+ var time_format = typeof wplc_datetime_format !== 'undefined' && wplc_datetime_format.hasOwnProperty( 'time_format' ) ? wplc_datetime_format.time_format : 'H:i';
642
+ var time_hours_12 = dateTime.getHours() > 12 ? dateTime.getHours() - 12 : ( dateTime.getHours() < 1 ? 12 : dateTime.getHours() );
643
+ var time_hours_24 = dateTime.getHours();
644
+ var time_am_pm = time_hours_24 > 11 ? 'pm' : 'am';
645
+ var time_minutes = dateTime.getMinutes();
646
+
647
+ time_msg += time_format
648
+ .replace( /g/g, time_hours_12 )
649
+ .replace( /h/g, time_hours_12 < 10 ? '0' + time_hours_12 : time_hours_12 )
650
+ .replace( /G/g, time_hours_24 )
651
+ .replace( /H/g, time_hours_24 < 10 ? '0' + time_hours_24 : time_hours_24 )
652
+ .replace( /i/g, time_minutes < 10 ? '0' + time_minutes : time_minutes )
653
+ .replace( /a/g, time_am_pm.toLowerCase() )
654
+ .replace( /A/g, time_am_pm.toUpperCase() );
655
+
656
+ }
657
+ if (time_msg !== '') {
658
+ if (parseInt(originates) === 1) { aoru_class = 'wplc-msg-float-left'; } else { aoru_class = 'wplc-msg-float-right'; }
659
+ time_msg = '<span class="timedate '+aoru_class+'">'+time_msg+'</span>';
660
+ }
661
+ }
662
+
663
+
664
+ return time_msg;
665
+ }
666
+ } else {
667
+ return '';
668
+ }
669
+
670
+ }
671
+
672
+ function wplc_get_chat_person_name_msg_field(name) {
673
+ try {
674
+ return '<span class="wplc-chat-person-name">' + name + ': </span>';
675
+ } catch(err) {
676
+ //console.log("Could not wplc_get_chat_person_name_msg_field() " + err);
677
+ }
678
+ }
679
+
680
+ /**
681
+ * Removes undesired strings from a message which contains a GIF URL and returns only the gif url
682
+ * @param {*} message_content
683
+ */
684
+ function getCleanedGif(message_content) {
685
+ if (typeof(message_content) !== "undefined") {
686
+ var msgParts = message_content.split(" ");
687
+
688
+ if (typeof(msgParts) !== "undefined") {
689
+
690
+ for (var i = 0; i < msgParts.length; i++) {
691
+ var msgPart = msgParts[i];
692
+
693
+ if (typeof(msgPart) !== "undefined") {
694
+
695
+ if (gifExtensionPattern.test(msgPart)) {
696
+ var cleanedGifUrl = msgPart.replace("href=", "");
697
+ cleanedGifUrl = cleanedGifUrl.replace(/\"/g, "");
698
+
699
+ return cleanedGifUrl;
700
+ }
701
+ }
702
+ }
703
+ }
704
+ }
705
+
706
+ return "";
707
+ }
708
+
709
+ /**
710
+ * Pushes the message object to the chat box
711
+ *
712
+ * @param {object} the_message The message object
713
+ * @param {string} aoru a for Agent, u for User
714
+ * @return void
715
+ */
716
+ function wplc_push_message_to_chatbox(the_message, aoru, next) {
717
+
718
+ /**
719
+ * First check if we have processed this message already, by comparing the ID
720
+ *
721
+ * Some system notifications may not come through with an ID so we can accept those.
722
+ */
723
+ var add_message = true;
724
+ if (typeof the_message.mid !== "undefined" && aoru === "u") {
725
+ if (parseInt(the_message.mid) === 0 || the_message.mid === null) {
726
+ add_message = true;
727
+ } else {
728
+ if (typeof wplc_msg_history[the_message.mid] !== "undefined") {
729
+ /* we have this message already */
730
+ add_message = false;
731
+ } else {
732
+ /* add this to our history */
733
+ wplc_msg_history[the_message.mid] = true;
734
+ }
735
+ }
736
+ }
737
+ if (add_message) {
738
+ if (typeof the_message.originates !== "undefined" && the_message.originates !== null && the_message.originates !== "null"){
739
+ var message_class = "";
740
+ var grav_hash = "";
741
+ var message_grav = "";
742
+ var message_from = "";
743
+ var message_content = "";
744
+ var message_aid;
745
+
746
+ var message_edit_string = "";
747
+
748
+ var audioPattern = new RegExp(/blob.wav/);
749
+ var isAudioPattern = false;
750
+
751
+ if (parseInt(the_message.originates) === 1) {
752
+ //From Admin
753
+
754
+ /* Define which agent it was sent from */
755
+ if (typeof the_message.other !== "undefined" && typeof the_message.other.aid !== "undefined") {
756
+ message_aid = the_message.other.aid.toString(); /* set it to a string because wp_localize doesnt know how to set keys as integers */
757
+ } else if (typeof the_message.other !== "undefined" && typeof the_message.other.agent_id !== "undefined") {
758
+ /* cloud server uses "agent_id" instead of "aid" */
759
+ message_aid = the_message.other.agent_id.toString();
760
+ } else {
761
+ message_aid = false;
762
+ }
763
+ message_class = "wplc-admin-message wplc-color-bg-4 wplc-color-2 wplc-color-border-4";
764
+
765
+ // If it is audio message
766
+ isAudioPattern = audioPattern.test(the_message.msg);
767
+ if (isAudioPattern) {
768
+ message_class += " wplc-user-message-audio";
769
+ }
770
+
771
+ if (aoru === 'u') {
772
+
773
+ /* message came from admin, intended for user */
774
+ if (message_aid !== false && typeof wplc_agent_data !== "undefined" && typeof wplc_agent_data[message_aid] !== "undefined") {
775
+ /* we know who the agent was that sent this message (v7.1.00+) */
776
+ if (typeof wplc_show_chat_detail !== "undefined") {
777
+ if (typeof wplc_show_chat_detail.avatar !== "undefined" && wplc_show_chat_detail.avatar === "1") { message_grav = (typeof wplc_agent_data[message_aid].md5 !== "undefined" ? "<img src='"+wplc_user_avatars[message_aid]+"?s=80' class='wplc-admin-message-avatar' />" : ""); }
778
+ if (typeof wplc_show_chat_detail.name !== "undefined" && wplc_show_chat_detail.name === "1") { message_from = (typeof wplc_agent_data[message_aid].name !== "undefined" ? wplc_get_chat_person_name_msg_field(wplc_agent_data[message_aid].name) : ""); }
779
+ }
780
+
781
+ } else {
782
+ /* we do'nt know which agent sent this message, so lets set it as the current user instead (backwards compat) */
783
+ if (typeof wplc_show_chat_detail !== "undefined") {
784
+ if (typeof wplc_show_chat_detail.avatar !== "undefined" && wplc_show_chat_detail.avatar === "1") { message_grav = (typeof wplc_current_agent.email !== "undefined" ? "<img src='"+wplc_user_avatars[message_aid]+"?s=80' class='wplc-admin-message-avatar' />" : ""); }
785
+ if (typeof wplc_show_chat_detail.name !== "undefined" && wplc_show_chat_detail.name === "1") { message_from = (typeof wplc_current_agent.name !== "undefined" ? wplc_get_chat_person_name_msg_field(wplc_current_agent.name) : ""); }
786
+ }
787
+ }
788
+ } else {
789
+
790
+ if(typeof agent_id !== "undefined" && typeof message_aid !== "undefined"){
791
+ if(parseInt(agent_id) === parseInt(message_aid)){
792
+ //I own this message
793
+ message_edit_string = "<span class='bleeper-edit-message' style='display:none;'>Edit</span>";
794
+
795
+ }
796
+ }
797
+
798
+ if (message_aid !== false && typeof wplc_agent_data !== "undefined" && typeof wplc_agent_data[message_aid] !== "undefined") {
799
+
800
+ /* we know who the agent was that sent this message (v7.1.00+) */
801
+ if (typeof wplc_show_chat_detail !== "undefined") {
802
+ if (typeof wplc_show_chat_detail.avatar !== "undefined" && wplc_show_chat_detail.avatar === "1") { message_grav = (typeof wplc_agent_data[message_aid].md5 !== "undefined" ? "<img src='//www.gravatar.com/avatar/"+wplc_agent_data[message_aid].md5+"?s=80' class='wplc-admin-message-avatar' />" : ""); }
803
+ if (typeof wplc_show_chat_detail.name !== "undefined" && wplc_show_chat_detail.name === "1") { message_from = (typeof wplc_agent_data[message_aid].name !== "undefined" ? wplc_get_chat_person_name_msg_field(wplc_agent_data[message_aid].name) : ""); }
804
+ }
805
+
806
+ } else {
807
+ if (typeof wplc_show_chat_detail.avatar !== "undefined" && wplc_show_chat_detail.avatar === "1") {
808
+ message_grav = (typeof wplc_admin_agent_email !== "undefined" ? "<img src='//www.gravatar.com/avatar/"+wplc_admin_agent_email+"?s=80' class='wplc-admin-message-avatar' />" : "");
809
+ }
810
+ if (typeof wplc_show_chat_detail.name !== "undefined" && wplc_show_chat_detail.name === "1") {
811
+ message_from = (typeof wplc_admin_agent_name !== "undefined" ? wplc_get_chat_person_name_msg_field(wplc_admin_agent_name) : "");
812
+ }
813
+ }
814
+ }
815
+
816
+ message_content = the_message.msg.wplcStripSlashes();
817
+ wplc_new_message_sound = true;
818
+
819
+ } else if (parseInt(the_message.originates) === 0 || parseInt(the_message.originates) === 3) {
820
+ //System Notification
821
+ message_class = "wplc_system_notification wplc-color-4";
822
+ message_content = the_message.msg;
823
+ if (typeof the_message.other.ntype !== "undefined") {
824
+ if (the_message.other.ntype === "joined") {
825
+ jQuery.event.trigger({type: "wplc_agent_joined", ndata:the_message});
826
+ }
827
+ }
828
+
829
+ } else {
830
+ /* most likely from the user */
831
+ message_class = "wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1";
832
+
833
+ isAudioPattern = audioPattern.test(the_message.msg);
834
+ if (isAudioPattern) {
835
+ message_class += " wplc-user-message-audio";
836
+ }
837
+
838
+ if (aoru === 'u') {
839
+ message_edit_string = "<span class='bleeper-edit-message' style='display:none;'>Edit</span>";
840
+
841
+ if (jQuery(wplc_email).val() !== "") {
842
+ message_grav = md5(jQuery(wplc_email).val());
843
+
844
+ } else {
845
+ if (typeof visitor_list !== "undefined" && typeof visitor_list[active_chatid] !== "undefined" && typeof visitor_list[active_chatid].email !== "undefined") {
846
+ message_grav = md5(visitor_list[active_chatid].email);
847
+ } else {
848
+ if(typeof wplc_cookie_email !== "undefined" && wplc_cookie_email !== ""){
849
+ message_grav = md5(wplc_cookie_email);
850
+ } else {
851
+ message_grav = 'x';
852
+ }
853
+ }
854
+ }
855
+
856
+ message_grav = "<img src='//www.gravatar.com/avatar/" + message_grav + "?s=80' class='wplc-user-message-avatar' />";
857
+ if (typeof Cookies.get("wplc_name") === "undefined") {
858
+ message_from = wplc_get_chat_person_name_msg_field("Guest");
859
+ } else {
860
+ message_from = wplc_get_chat_person_name_msg_field(Cookies.get("wplc_name"));
861
+ }
862
+ } else {
863
+ if (typeof wplc_chat_email !== "undefined") {
864
+ message_grav = wplc_chat_email;
865
+
866
+ } else {
867
+ if (typeof visitor_list !== "undefined" && typeof visitor_list[active_chatid] !== "undefined" && typeof visitor_list[active_chatid].email !== "undefined") {
868
+ message_grav = md5(visitor_list[active_chatid].email);
869
+ } else {
870
+ if(typeof wplc_cookie_email !== "undefined" && wplc_cookie_email !== ""){
871
+ message_grav = md5(wplc_cookie_email);
872
+ } else {
873
+ message_grav = 'x';
874
+ }
875
+ }
876
+ }
877
+ message_grav = "<img src='//www.gravatar.com/avatar/" + message_grav + "?s=80' class='wplc-user-message-avatar' />";
878
+ if (typeof wplc_chat_name !== "undefined") {
879
+ message_from = wplc_get_chat_person_name_msg_field(wplc_chat_name);
880
+ }
881
+ }
882
+ message_content = the_message.msg.wplcStripSlashes();
883
+ }
884
+
885
+ if (typeof the_message.other !== "undefined" && typeof the_message.other.from_an_agent !== "undefined"){
886
+ if(the_message.other.from_an_agent === true || the_message.other.from_an_agent === "true"){
887
+ //Cannot edit this
888
+ message_edit_string = "";
889
+ }
890
+ }
891
+ message_class += " message_"+the_message.mid;
892
+
893
+ if (message_content !== ""){
894
+ message_content = wplc_sanitize_attributes(message_content);
895
+
896
+ // If it is audio message
897
+ isAudioPattern = audioPattern.test(message_content);
898
+
899
+ // Open the HTML of a message
900
+ var concatenated_message = "<span class='" + message_class + "' mid='"+the_message.mid+"'>";
901
+
902
+ if (typeof wplc_show_chat_detail !== "undefined") {
903
+
904
+ if (typeof wplc_show_chat_detail.avatar !== "undefined" && wplc_show_chat_detail.avatar === "1") {
905
+ concatenated_message += message_grav;
906
+ }
907
+
908
+ // Add a wrapper for the person name and the message, this wrapper is necessary to implement the UI of the admin chat
909
+ if (isAudioPattern) {
910
+ concatenated_message += "<div class='wplc-msg-content wplc-msg-content-audio' mid='" + the_message.mid + "'>";
911
+ } else {
912
+ concatenated_message += "<div class='wplc-msg-content' mid='"+the_message.mid+"'>";
913
+ }
914
+
915
+ if (isAudioPattern) {
916
+ concatenated_message += "<span class='wplc-msg-content-audio-icon'></span>";
917
+ } else if (typeof wplc_show_chat_detail.name !== "undefined" && wplc_show_chat_detail.name === "1") {
918
+ concatenated_message += message_from;
919
+ }
920
+ } else {
921
+ // Add a wrapper for the person name and the message, this wrapper is necessary to implement the UI of the admin chat
922
+ concatenated_message += "<div class='wplc-msg-content'>";
923
+ }
924
+
925
+ var original_message = message_content;
926
+ if (isAudioPattern) {
927
+ message_content = "<a href='" + message_content + "' target='_blank'>" + (typeof wplc_visitor_voice !== 'undefined' && typeof wplc_visitor_voice.play_sound !== 'undefined' ? wplc_visitor_voice.play_sound : 'Open Voice Note') + "</a>";
928
+ } else if (typeof niftyFormatParser !== "undefined"){
929
+ if(typeof the_message.other !== 'undefined' && typeof the_message.other.ignore_style_tags !== 'undefined' && the_message.other.ignore_style_tags === true){
930
+ //Don't nifty parse this
931
+ } else {
932
+ message_content = niftyFormatParser(message_content);
933
+ }
934
+ }
935
+
936
+ //Cleanup the original message
937
+ var original_message_stripper = document.createElement("DIV");
938
+ original_message_stripper.innerHTML = original_message;
939
+ original_message = original_message_stripper.textContent || original_message_stripper.innerText || "";
940
+
941
+ // If it is a GIF message
942
+ if (gifExtensionPattern.test(message_content)) {
943
+ cleanedGif = getCleanedGif(message_content);
944
+ concatenated_message += "<span class='messageBody' data-message='"+ cleanedGif +"'><img src='"+ cleanedGif + "' class='gif-img'/></span>"+ message_edit_string;
945
+ } else if (isAudioPattern) {
946
+ // If it is audio pattern
947
+ concatenated_message += "<span class='messageBody'>"+message_content+"</span>";
948
+ } else {
949
+ // If it is a regular message
950
+ concatenated_message += "<span class='messageBody' data-message='" + original_message + "'>"+message_content+"</span>"+ message_edit_string;
951
+ }
952
+
953
+ // Close the person name/message wrapper, if it was added
954
+ concatenated_message += "</div>";
955
+
956
+ // Close the HTML of a message
957
+ concatenated_message += "</span>";
958
+ concatenated_message += wplc_add_date_and_time(the_message,the_message.originates);
959
+
960
+ if (aoru === 'u') {
961
+ wplc_chat_box_elemn = "#wplc_chatbox";
962
+ } else {
963
+
964
+ if (typeof bleeper_remote_enabled !== "undefined"){
965
+ wplc_chat_box_elemn = "#messages";
966
+ } else {
967
+ wplc_chat_box_elemn = "#admin_chat_box_area_"+wplc_cid;
968
+ }
969
+ }
970
+
971
+
972
+ jQuery(wplc_chat_box_elemn).append(concatenated_message);
973
+
974
+ }
975
+ }
976
+ }
977
+ next();
978
+ }
979
+
980
+ jQuery(function(){
981
+ jQuery(function(){
982
+ var wplc_node_searchTimeout;
983
+
984
+ jQuery("body").on("keydown","#wplc_chatmsg, #wplc_admin_chatmsg", function(e) {
985
+ if(typeof wplc_node_sockets_ready !== "undefined" && wplc_node_sockets_ready === true){
986
+ if(typeof wplc_node_is_client_typing !== "undefined"){
987
+ if (e.which <= 90 && e.which >= 48) {
988
+ if (wplc_node_is_client_typing) {
989
+ wplc_node_renew_typing();
990
+ return;
991
+ }
992
+ wplc_node_is_client_typing = true;
993
+
994
+ wplc_node_searchTimeout = setTimeout(wplc_node_clear_typing, 1000);
995
+ }
996
+ }
997
+ }
998
+ });
999
+
1000
+ jQuery("body").on("click", "#wplc_na_msg_btn", function() {
1001
+ var wplc_is_gdpr_enabled = jQuery(this).attr('data-wplc-gdpr-enabled');
1002
+ if(typeof wplc_is_gdpr_enabled !== "undefined" && (wplc_is_gdpr_enabled === 'true' )){
1003
+ var wplc_gdpr_opt_in_checked = jQuery("#wplc_chat_gdpr_opt_in").is(':checked');
1004
+ if(typeof wplc_gdpr_opt_in_checked === "undefined" || wplc_gdpr_opt_in_checked === false){
1005
+ /* GDPR requirements not met */
1006
+ jQuery("#wplc_chat_gdpr_opt_in").addClass('incomplete');
1007
+ return false;
1008
+ }
1009
+ jQuery("#wplc_chat_gdpr_opt_in").removeClass('incomplete');
1010
+ }
1011
+
1012
+ var wplc_name = jQuery("#wplc_name").val();
1013
+ var wplc_email = jQuery("#wplc_email").val();
1014
+ var wplc_msg = jQuery("#wplc_message").val();
1015
+ var wplc_domain = jQuery("#wplc_domain_offline").val();
1016
+ var ip_address = jQuery("#wplc_ip_address").val();
1017
+
1018
+ if (wplc_name.length <= 0) { alert(wplc_error_messages.valid_name); return false; }
1019
+ if (wplc_email.length <= 0) { alert(wplc_error_messages.valid_email); return false; }
1020
+ var testEmail = /^[A-Z0-9._%+-]+@([A-Z0-9-]+\.)+[A-Z]{2,12}$/i;
1021
+ if (!testEmail.test(wplc_email)){
1022
+ alert(wplc_error_messages.valid_email); return false;
1023
+ }
1024
+ if (wplc_msg.length <= 0) { alert(wplc_error_messages.empty_message); return false; }
1025
+ jQuery("#wp-live-chat-2-info").hide();
1026
+ jQuery("#wplc_message_div").html(wplc_offline_msg);
1027
+
1028
+ wplc_cid = Cookies.get('wplc_cid');
1029
+
1030
+ var data = {
1031
+ action: 'wplc_user_send_offline_message',
1032
+ security: wplc_nonce,
1033
+ cid: wplc_cid,
1034
+ name: wplc_name,
1035
+ email: wplc_email,
1036
+ msg: wplc_msg,
1037
+ ip: ip_address,
1038
+ domain: wplc_domain,
1039
+ wplc_extra_data:wplc_extra_data
1040
+ };
1041
+
1042
+ jQuery.post(wplc_ajaxurl_site, data, function(response) {
1043
+ jQuery("#wplc_message_div").html(wplc_offline_msg3);
1044
+ });
1045
+ if (typeof wplc_enable_ga !== "undefined" && wplc_enable_ga === '1') {
1046
+ if (typeof ga !== "undefined") {
1047
+ ga('send', {
1048
+ hitType: 'event',
1049
+ eventCategory: 'WP_Live_Chat_Support',
1050
+ eventAction: 'Event',
1051
+ eventLabel: 'User Send Offline Message'
1052
+ });
1053
+ }
1054
+ }
1055
+ });
1056
+
1057
+
1058
+ function wplc_node_renew_typing() {
1059
+ clearTimeout(wplc_node_searchTimeout);
1060
+ wplc_node_searchTimeout = setTimeout(wplc_node_clear_typing, 1000);
1061
+ }
1062
+ function wplc_node_clear_typing() {
1063
+ wplc_node_is_client_typing = false;
1064
+ clearTimeout(wplc_node_searchTimeout);
1065
+ }
1066
+ });
1067
+ });
1068
+
1069
+ var wplc_generate_system_notification_object = function(msg,other,originates) {
1070
+ the_message = {};
1071
+ the_message.originates = originates;
1072
+ the_message.msg = msg;
1073
+ the_message.other = other;
1074
+ var wplc_d = new Date();
1075
+ the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
1076
+ return the_message;
1077
+ }
1078
+
1079
+ function wplc_display_system_notification(message) {
1080
+ message_output = '<div id="bleeper_notification_message" class="wplc-color-bg-1 wplc-color-2">' + message.msg + '</div>';
1081
+
1082
+ if (jQuery('#bleeper_notification_message').length == 0) {
1083
+ jQuery('#wp-live-chat-4').prepend(message_output);
1084
+ }
1085
+ }
1086
+
1087
+ function wplc_clear_system_notification() {
1088
+ if (jQuery('#bleeper_notification_message').length !== 0) {
1089
+ jQuery('#bleeper_notification_message').remove();
1090
+ }
1091
+ }
1092
+
1093
+ /*
1094
+ * Updates the message element with a new message.
1095
+ * - mid: Message ID which is appended to class selector as .message_{mid}
1096
+ * - message: The html/text to insert into this container
1097
+ * - inner_container_class: Optional, used to select the first child of the class type within the primary message container
1098
+ * Nice for selecting the 'messageBody' class specifically
1099
+ */
1100
+ function wplc_update_message_element_by_mid(mid, message, inner_container_class){
1101
+ var element_selector = ".message_" + mid;
1102
+ element_selector += (typeof inner_container_class !== "undefined" && inner_container_class !== false) ? (" ." + inner_container_class) : "";
1103
+
1104
+ jQuery(element_selector).html(message);
1105
  }
js/wplc_surveys.js CHANGED
@@ -1,24 +1,24 @@
1
- var orig_title_wplc;
2
- jQuery(document).on("wplc_end_chat bleeper_chat_ended_notification", function( e ) {
3
- if (typeof wplc_extra_div_enabled !== "undefined" && wplc_extra_div_enabled === "1") {
4
- jQuery("#wp-live-chat-4").hide();
5
- jQuery("#wplc-extra-div").show();
6
- orig_title_wplc = jQuery("#wplc_first_message").html();
7
- jQuery("#wplc_first_message").html(wplc_end_chat_string);
8
- jQuery("#nimblesquirrel_div").attr('style', 'width: 100% !important');
9
- }
10
-
11
- });
12
-
13
-
14
- jQuery(document).on("wplc_minimize_chat", function( e ) {
15
- if (typeof wplc_extra_div_enabled !== "undefined" && wplc_extra_div_enabled === "1") {
16
- jQuery("#wplc-extra-div").hide();
17
- jQuery("#wplc_first_message").html(orig_title_wplc);
18
- }
19
- });
20
-
21
-
22
- jQuery(document).on("click", "#wp-live-chat-header", function() {
23
- jQuery("#nimblesquirrel_div").attr('style', 'width: 100% !important');
24
- });
1
+ var orig_title_wplc;
2
+ jQuery(document).on("wplc_end_chat bleeper_chat_ended_notification", function( e ) {
3
+ if (typeof wplc_extra_div_enabled !== "undefined" && wplc_extra_div_enabled === "1") {
4
+ jQuery("#wp-live-chat-4").hide();
5
+ jQuery("#wplc-extra-div").show();
6
+ orig_title_wplc = jQuery("#wplc_first_message").html();
7
+ jQuery("#wplc_first_message").html(wplc_end_chat_string);
8
+ jQuery("#nimblesquirrel_div").attr('style', 'width: 100% !important');
9
+ }
10
+
11
+ });
12
+
13
+
14
+ jQuery(document).on("wplc_minimize_chat", function( e ) {
15
+ if (typeof wplc_extra_div_enabled !== "undefined" && wplc_extra_div_enabled === "1") {
16
+ jQuery("#wplc-extra-div").hide();
17
+ jQuery("#wplc_first_message").html(orig_title_wplc);
18
+ }
19
+ });
20
+
21
+
22
+ jQuery(document).on("click", "#wp-live-chat-header", function() {
23
+ jQuery("#nimblesquirrel_div").attr('style', 'width: 100% !important');
24
+ });
js/wplc_tabs.js CHANGED
@@ -1,267 +1,267 @@
1
- jQuery("document").ready(function() {
2
-
3
- function storeActiveTab(event, ui)
4
- {
5
- if(!window.sessionStorage)
6
- return;
7
-
8
- sessionStorage.setItem(
9
- "wplc-tabs-index",
10
- jQuery(event.target).tabs("option", "active")
11
- );
12
- }
13
-
14
- function recallActiveTab()
15
- {
16
- if(!window.sessionStorage)
17
- return 0;
18
-
19
- var active = sessionStorage.getItem("wplc-tabs-index");
20
-
21
- if(isNaN(active))
22
- active = 0;
23
-
24
- return active;
25
- }
26
-
27
-
28
- if(jQuery("input[type=radio][name='wplc_mail_type']:checked").val() === "php_mailer"){
29
- jQuery("#wplc_smtp_details").show();
30
- } else {
31
- jQuery("#wplc_smtp_details").hide();
32
- }
33
-
34
- jQuery('.wplc_mail_type_radio').click(
35
- function(e){
36
- if (jQuery(this).is(':checked') && jQuery(this).val() === "php_mailer"){
37
- jQuery("#wplc_smtp_details").show();
38
- } else {
39
- jQuery("#wplc_smtp_details").hide();
40
- }
41
- });
42
-
43
-
44
-
45
- jQuery("#wplc_tabs").tabs({
46
- create: function(event, ui)
47
- {
48
- jQuery("#wplc_settings_page_loader").remove();
49
- jQuery(".wrap").fadeIn();
50
- jQuery(".wplc_settings_save_notice").fadeIn();
51
- },
52
- active: recallActiveTab(),
53
- activate: storeActiveTab
54
- }).addClass( "ui-tabs-vertical ui-helper-clearfix" );
55
-
56
- jQuery( "#wplc_tabs li" ).removeClass( "ui-corner-top" ).addClass( "ui-corner-left" );
57
-
58
-
59
-
60
- jQuery(".wplc_hide_input").hide();
61
-
62
- jQuery("#wplc_animation_1").click(function() {
63
- jQuery("#wplc_rb_animation_1").attr('checked', true);
64
- jQuery("#wplc_rb_animation_2").attr('checked', false);
65
- jQuery("#wplc_rb_animation_3").attr('checked', false);
66
- jQuery("#wplc_rb_animation_4").attr('checked', false);
67
- jQuery("#wplc_animation_1").addClass("wplc_animation_active");
68
- jQuery("#wplc_animation_2").removeClass("wplc_animation_active");
69
- jQuery("#wplc_animation_3").removeClass("wplc_animation_active");
70
- jQuery("#wplc_animation_4").removeClass("wplc_animation_active");
71
- });
72
-
73
- jQuery("#wplc_animation_2").click(function() {
74
- jQuery("#wplc_rb_animation_1").attr('checked', false);
75
- jQuery("#wplc_rb_animation_2").attr('checked', true);
76
- jQuery("#wplc_rb_animation_3").attr('checked', false);
77
- jQuery("#wplc_rb_animation_4").attr('checked', false);
78
- jQuery("#wplc_animation_1").removeClass("wplc_animation_active");
79
- jQuery("#wplc_animation_2").addClass("wplc_animation_active");
80
- jQuery("#wplc_animation_3").removeClass("wplc_animation_active");
81
- jQuery("#wplc_animation_4").removeClass("wplc_animation_active");
82
- });
83
-
84
- jQuery("#wplc_animation_3").click(function() {
85
- jQuery("#wplc_rb_animation_1").attr('checked', false);
86
- jQuery("#wplc_rb_animation_2").attr('checked', false);
87
- jQuery("#wplc_rb_animation_3").attr('checked', true);
88
- jQuery("#wplc_rb_animation_4").attr('checked', false);
89
- jQuery("#wplc_animation_1").removeClass("wplc_animation_active");
90
- jQuery("#wplc_animation_2").removeClass("wplc_animation_active");
91
- jQuery("#wplc_animation_3").addClass("wplc_animation_active");
92
- jQuery("#wplc_animation_4").removeClass("wplc_animation_active");
93
- });
94
-
95
- jQuery("#wplc_animation_4").click(function() {
96
- jQuery("#wplc_rb_animation_1").attr('checked', false);
97
- jQuery("#wplc_rb_animation_2").attr('checked', false);
98
- jQuery("#wplc_rb_animation_3").attr('checked', false);
99
- jQuery("#wplc_rb_animation_4").attr('checked', true);
100
- jQuery("#wplc_animation_1").removeClass("wplc_animation_active");
101
- jQuery("#wplc_animation_2").removeClass("wplc_animation_active");
102
- jQuery("#wplc_animation_3").removeClass("wplc_animation_active");
103
- jQuery("#wplc_animation_4").addClass("wplc_animation_active");
104
- });
105
-
106
-
107
- /* Themes */
108
- jQuery("#wplc_newtheme_1").click(function() {
109
- jQuery("#wplc_new_rb_theme_1").attr('checked', true);
110
- jQuery("#wplc_new_rb_theme_2").attr('checked', false);
111
- jQuery("#wplc_newtheme_1").addClass("wplc_theme_active");
112
- jQuery("#wplc_newtheme_2").removeClass("wplc_theme_active");
113
- });
114
-
115
- jQuery("#wplc_newtheme_2").click(function() {
116
- jQuery("#wplc_new_rb_theme_1").attr('checked', false);
117
- jQuery("#wplc_new_rb_theme_2").attr('checked', true);
118
- jQuery("#wplc_newtheme_1").removeClass("wplc_theme_active");
119
- jQuery("#wplc_newtheme_2").addClass("wplc_theme_active");
120
- });
121
-
122
-
123
- /* Colour Schemes */
124
-
125
- jQuery("#wplc_theme_default").click(function() {
126
- jQuery("#wplc_rb_theme_default").attr('checked', true);
127
- jQuery("#wplc_rb_theme_1").attr('checked', false);
128
- jQuery("#wplc_rb_theme_2").attr('checked', false);
129
- jQuery("#wplc_rb_theme_3").attr('checked', false);
130
- jQuery("#wplc_rb_theme_4").attr('checked', false);
131
- jQuery("#wplc_rb_theme_5").attr('checked', false);
132
- jQuery("#wplc_rb_theme_6").attr('checked', false);
133
- jQuery("#wplc_theme_default").addClass("wplc_theme_active");
134
- jQuery("#wplc_theme_1").removeClass("wplc_theme_active");
135
- jQuery("#wplc_theme_2").removeClass("wplc_theme_active");
136
- jQuery("#wplc_theme_3").removeClass("wplc_theme_active");
137
- jQuery("#wplc_theme_4").removeClass("wplc_theme_active");
138
- jQuery("#wplc_theme_5").removeClass("wplc_theme_active");
139
- jQuery("#wplc_theme_6").removeClass("wplc_theme_active");
140
- });
141
-
142
- jQuery("#wplc_theme_1").click(function() {
143
- jQuery("#wplc_rb_theme_default").attr('checked', false);
144
- jQuery("#wplc_rb_theme_1").attr('checked', true);
145
- jQuery("#wplc_rb_theme_2").attr('checked', false);
146
- jQuery("#wplc_rb_theme_3").attr('checked', false);
147
- jQuery("#wplc_rb_theme_4").attr('checked', false);
148
- jQuery("#wplc_rb_theme_5").attr('checked', false);
149
- jQuery("#wplc_rb_theme_6").attr('checked', false);
150
- jQuery("#wplc_theme_default").removeClass("wplc_theme_active");
151
- jQuery("#wplc_theme_1").addClass("wplc_theme_active");
152
- jQuery("#wplc_theme_2").removeClass("wplc_theme_active");
153
- jQuery("#wplc_theme_3").removeClass("wplc_theme_active");
154
- jQuery("#wplc_theme_4").removeClass("wplc_theme_active");
155
- jQuery("#wplc_theme_5").removeClass("wplc_theme_active");
156
- jQuery("#wplc_theme_6").removeClass("wplc_theme_active");
157
- });
158
-
159
- jQuery("#wplc_theme_2").click(function() {
160
- jQuery("#wplc_rb_theme_default").attr('checked', false);
161
- jQuery("#wplc_rb_theme_1").attr('checked', false);
162
- jQuery("#wplc_rb_theme_2").attr('checked', true);
163
- jQuery("#wplc_rb_theme_3").attr('checked', false);
164
- jQuery("#wplc_rb_theme_4").attr('checked', false);
165
- jQuery("#wplc_rb_theme_5").attr('checked', false);
166
- jQuery("#wplc_rb_theme_6").attr('checked', false);
167
- jQuery("#wplc_theme_default").removeClass("wplc_theme_active");
168
- jQuery("#wplc_theme_1").removeClass("wplc_theme_active");
169
- jQuery("#wplc_theme_2").addClass("wplc_theme_active");
170
- jQuery("#wplc_theme_3").removeClass("wplc_theme_active");
171
- jQuery("#wplc_theme_4").removeClass("wplc_theme_active");
172
- jQuery("#wplc_theme_5").removeClass("wplc_theme_active");
173
- jQuery("#wplc_theme_6").removeClass("wplc_theme_active");
174
- });
175
-
176
- jQuery("#wplc_theme_3").click(function() {
177
- jQuery("#wplc_rb_theme_default").attr('checked', false);
178
- jQuery("#wplc_rb_theme_1").attr('checked', false);
179
- jQuery("#wplc_rb_theme_2").attr('checked', false);
180
- jQuery("#wplc_rb_theme_3").attr('checked', true);
181
- jQuery("#wplc_rb_theme_4").attr('checked', false);
182
- jQuery("#wplc_rb_theme_5").attr('checked', false);
183
- jQuery("#wplc_rb_theme_6").attr('checked', false);
184
- jQuery("#wplc_theme_default").removeClass("wplc_theme_active");
185
- jQuery("#wplc_theme_1").removeClass("wplc_theme_active");
186
- jQuery("#wplc_theme_2").removeClass("wplc_theme_active");
187
- jQuery("#wplc_theme_3").addClass("wplc_theme_active");
188
- jQuery("#wplc_theme_4").removeClass("wplc_theme_active");
189
- jQuery("#wplc_theme_5").removeClass("wplc_theme_active");
190
- jQuery("#wplc_theme_6").removeClass("wplc_theme_active");
191
- });
192
-
193
- jQuery("#wplc_theme_4").click(function() {
194
- jQuery("#wplc_rb_theme_default").attr('checked', false);
195
- jQuery("#wplc_rb_theme_1").attr('checked', false);
196
- jQuery("#wplc_rb_theme_2").attr('checked', false);
197
- jQuery("#wplc_rb_theme_3").attr('checked', false);
198
- jQuery("#wplc_rb_theme_4").attr('checked', true);
199
- jQuery("#wplc_rb_theme_5").attr('checked', false);
200
- jQuery("#wplc_rb_theme_6").attr('checked', false);
201
- jQuery("#wplc_theme_default").removeClass("wplc_theme_active");
202
- jQuery("#wplc_theme_1").removeClass("wplc_theme_active");
203
- jQuery("#wplc_theme_2").removeClass("wplc_theme_active");
204
- jQuery("#wplc_theme_3").removeClass("wplc_theme_active");
205
- jQuery("#wplc_theme_4").addClass("wplc_theme_active");
206
- jQuery("#wplc_theme_5").removeClass("wplc_theme_active");
207
- jQuery("#wplc_theme_6").removeClass("wplc_theme_active");
208
- });
209
-
210
- jQuery("#wplc_theme_5").click(function() {
211
- jQuery("#wplc_rb_theme_default").attr('checked', false);
212
- jQuery("#wplc_rb_theme_1").attr('checked', false);
213
- jQuery("#wplc_rb_theme_2").attr('checked', false);
214
- jQuery("#wplc_rb_theme_3").attr('checked', false);
215
- jQuery("#wplc_rb_theme_4").attr('checked', false);
216
- jQuery("#wplc_rb_theme_5").attr('checked', true);
217
- jQuery("#wplc_rb_theme_6").attr('checked', false);
218
- jQuery("#wplc_theme_default").removeClass("wplc_theme_active");
219
- jQuery("#wplc_theme_1").removeClass("wplc_theme_active");
220
- jQuery("#wplc_theme_2").removeClass("wplc_theme_active");
221
- jQuery("#wplc_theme_3").removeClass("wplc_theme_active");
222
- jQuery("#wplc_theme_4").removeClass("wplc_theme_active");
223
- jQuery("#wplc_theme_5").addClass("wplc_theme_active");
224
- jQuery("#wplc_theme_6").removeClass("wplc_theme_active");
225
- });
226
-
227
- jQuery("#wplc_theme_6").click(function() {
228
- jQuery("#wplc_rb_theme_default").attr('checked', false);
229
- jQuery("#wplc_rb_theme_1").attr('checked', false);
230
- jQuery("#wplc_rb_theme_2").attr('checked', false);
231
- jQuery("#wplc_rb_theme_3").attr('checked', false);
232
- jQuery("#wplc_rb_theme_4").attr('checked', false);
233
- jQuery("#wplc_rb_theme_5").attr('checked', false);
234
- jQuery("#wplc_rb_theme_6").attr('checked', true);
235
- jQuery("#wplc_theme_default").removeClass("wplc_theme_active");
236
- jQuery("#wplc_theme_1").removeClass("wplc_theme_active");
237
- jQuery("#wplc_theme_2").removeClass("wplc_theme_active");
238
- jQuery("#wplc_theme_3").removeClass("wplc_theme_active");
239
- jQuery("#wplc_theme_4").removeClass("wplc_theme_active");
240
- jQuery("#wplc_theme_5").removeClass("wplc_theme_active");
241
- jQuery("#wplc_theme_6").addClass("wplc_theme_active");
242
- });
243
-
244
-
245
-
246
-
247
-
248
- jQuery(function () {
249
- jQuery(".wplc_settings_tooltip").tooltip({
250
- position: {
251
- my: "left+15 center",
252
- at: "right center",
253
-
254
- },
255
- template: '<div class="tooltip wplc_tooltip_control"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
256
- onShow: function(){
257
- var $trigger = this.getTrigger();
258
- var offset = $trigger.offset();
259
- this.getTip().css({
260
- 'top' : offset.top,
261
- 'left' : offset.left
262
- });
263
- }
264
- });
265
- });
266
-
267
- });
1
+ jQuery(function() {
2
+
3
+ function storeActiveTab(event, ui)
4
+ {
5
+ if(!window.sessionStorage)
6
+ return;
7
+
8
+ sessionStorage.setItem(
9
+ "wplc-tabs-index",
10
+ jQuery(event.target).tabs("option", "active")
11
+ );
12
+ }
13
+
14
+ function recallActiveTab()
15
+ {
16
+ if(!window.sessionStorage)
17
+ return 0;
18
+
19
+ var active = sessionStorage.getItem("wplc-tabs-index");
20
+
21
+ if(isNaN(active))
22
+ active = 0;
23
+
24
+ return active;
25
+ }
26
+
27
+
28
+ if(jQuery("input[type=radio][name='wplc_mail_type']:checked").val() === "php_mailer"){
29
+ jQuery("#wplc_smtp_details").show();
30
+ } else {
31
+ jQuery("#wplc_smtp_details").hide();
32
+ }
33
+
34
+ jQuery('.wplc_mail_type_radio').click(
35
+ function(e){
36
+ if (jQuery(this).is(':checked') && jQuery(this).val() === "php_mailer"){
37
+ jQuery("#wplc_smtp_details").show();
38
+ } else {
39
+ jQuery("#wplc_smtp_details").hide();
40
+ }
41
+ });
42
+
43
+
44
+
45
+ jQuery("#wplc_tabs").tabs({
46
+ create: function(event, ui)
47
+ {
48
+ jQuery("#wplc_settings_page_loader").remove();
49
+ jQuery(".wrap").fadeIn();
50
+ jQuery(".wplc_settings_save_notice").fadeIn();
51
+ },
52
+ active: recallActiveTab(),
53
+ activate: storeActiveTab
54
+ }).addClass( "ui-tabs-vertical ui-helper-clearfix" );
55
+
56
+ jQuery( "#wplc_tabs li" ).removeClass( "ui-corner-top" ).addClass( "ui-corner-left" );
57
+
58
+
59
+
60
+ jQuery(".wplc_hide_input").hide();
61
+
62
+ jQuery("#wplc_animation_1").click(function() {
63
+ jQuery("#wplc_rb_animation_1").attr('checked', true);
64
+ jQuery("#wplc_rb_animation_2").attr('checked', false);
65
+ jQuery("#wplc_rb_animation_3").attr('checked', false);
66
+ jQuery("#wplc_rb_animation_4").attr('checked', false);
67
+ jQuery("#wplc_animation_1").addClass("wplc_animation_active");
68
+ jQuery("#wplc_animation_2").removeClass("wplc_animation_active");
69
+ jQuery("#wplc_animation_3").removeClass("wplc_animation_active");
70
+ jQuery("#wplc_animation_4").removeClass("wplc_animation_active");
71
+ });
72
+
73
+ jQuery("#wplc_animation_2").click(function() {
74
+ jQuery("#wplc_rb_animation_1").attr('checked', false);
75
+ jQuery("#wplc_rb_animation_2").attr('checked', true);
76
+ jQuery("#wplc_rb_animation_3").attr('checked', false);
77
+ jQuery("#wplc_rb_animation_4").attr('checked', false);
78
+ jQuery("#wplc_animation_1").removeClass("wplc_animation_active");
79
+ jQuery("#wplc_animation_2").addClass("wplc_animation_active");
80
+ jQuery("#wplc_animation_3").removeClass("wplc_animation_active");
81
+ jQuery("#wplc_animation_4").removeClass("wplc_animation_active");
82
+ });
83
+
84
+ jQuery("#wplc_animation_3").click(function() {
85
+ jQuery("#wplc_rb_animation_1").attr('checked', false);
86
+ jQuery("#wplc_rb_animation_2").attr('checked', false);
87
+ jQuery("#wplc_rb_animation_3").attr('checked', true);
88
+ jQuery("#wplc_rb_animation_4").attr('checked', false);
89
+ jQuery("#wplc_animation_1").removeClass("wplc_animation_active");
90
+ jQuery("#wplc_animation_2").removeClass("wplc_animation_active");
91
+ jQuery("#wplc_animation_3").addClass("wplc_animation_active");
92
+ jQuery("#wplc_animation_4").removeClass("wplc_animation_active");
93
+ });
94
+
95
+ jQuery("#wplc_animation_4").click(function() {
96
+ jQuery("#wplc_rb_animation_1").attr('checked', false);
97
+ jQuery("#wplc_rb_animation_2").attr('checked', false);
98
+ jQuery("#wplc_rb_animation_3").attr('checked', false);
99
+ jQuery("#wplc_rb_animation_4").attr('checked', true);
100
+ jQuery("#wplc_animation_1").removeClass("wplc_animation_active");
101
+ jQuery("#wplc_animation_2").removeClass("wplc_animation_active");
102
+ jQuery("#wplc_animation_3").removeClass("wplc_animation_active");
103
+ jQuery("#wplc_animation_4").addClass("wplc_animation_active");
104
+ });
105
+
106
+
107
+ /* Themes */
108
+ jQuery("#wplc_newtheme_1").click(function() {
109
+ jQuery("#wplc_new_rb_theme_1").attr('checked', true);
110
+ jQuery("#wplc_new_rb_theme_2").attr('checked', false);
111
+ jQuery("#wplc_newtheme_1").addClass("wplc_theme_active");
112
+ jQuery("#wplc_newtheme_2").removeClass("wplc_theme_active");
113
+ });
114
+
115
+ jQuery("#wplc_newtheme_2").click(function() {
116
+ jQuery("#wplc_new_rb_theme_1").attr('checked', false);
117
+ jQuery("#wplc_new_rb_theme_2").attr('checked', true);
118
+ jQuery("#wplc_newtheme_1").removeClass("wplc_theme_active");
119
+ jQuery("#wplc_newtheme_2").addClass("wplc_theme_active");
120
+ });
121
+
122
+
123
+ /* Colour Schemes */
124
+
125
+ jQuery("#wplc_theme_default").click(function() {
126
+ jQuery("#wplc_rb_theme_default").attr('checked', true);
127
+ jQuery("#wplc_rb_theme_1").attr('checked', false);
128
+ jQuery("#wplc_rb_theme_2").attr('checked', false);
129
+ jQuery("#wplc_rb_theme_3").attr('checked', false);
130
+ jQuery("#wplc_rb_theme_4").attr('checked', false);
131
+ jQuery("#wplc_rb_theme_5").attr('checked', false);
132
+ jQuery("#wplc_rb_theme_6").attr('checked', false);
133
+ jQuery("#wplc_theme_default").addClass("wplc_theme_active");
134
+ jQuery("#wplc_theme_1").removeClass("wplc_theme_active");
135
+ jQuery("#wplc_theme_2").removeClass("wplc_theme_active");
136
+ jQuery("#wplc_theme_3").removeClass("wplc_theme_active");
137
+ jQuery("#wplc_theme_4").removeClass("wplc_theme_active");
138
+ jQuery("#wplc_theme_5").removeClass("wplc_theme_active");
139
+ jQuery("#wplc_theme_6").removeClass("wplc_theme_active");
140
+ });
141
+
142
+ jQuery("#wplc_theme_1").click(function() {
143
+ jQuery("#wplc_rb_theme_default").attr('checked', false);
144
+ jQuery("#wplc_rb_theme_1").attr('checked', true);
145
+ jQuery("#wplc_rb_theme_2").attr('checked', false);
146
+ jQuery("#wplc_rb_theme_3").attr('checked', false);
147
+ jQuery("#wplc_rb_theme_4").attr('checked', false);
148
+ jQuery("#wplc_rb_theme_5").attr('checked', false);
149
+ jQuery("#wplc_rb_theme_6").attr('checked', false);
150
+ jQuery("#wplc_theme_default").removeClass("wplc_theme_active");
151
+ jQuery("#wplc_theme_1").addClass("wplc_theme_active");
152
+ jQuery("#wplc_theme_2").removeClass("wplc_theme_active");
153
+ jQuery("#wplc_theme_3").removeClass("wplc_theme_active");
154
+ jQuery("#wplc_theme_4").removeClass("wplc_theme_active");
155
+ jQuery("#wplc_theme_5").removeClass("wplc_theme_active");
156
+ jQuery("#wplc_theme_6").removeClass("wplc_theme_active");
157
+ });
158
+
159
+ jQuery("#wplc_theme_2").click(function() {
160
+ jQuery("#wplc_rb_theme_default").attr('checked', false);
161
+ jQuery("#wplc_rb_theme_1").attr('checked', false);
162
+ jQuery("#wplc_rb_theme_2").attr('checked', true);
163
+ jQuery("#wplc_rb_theme_3").attr('checked', false);
164
+ jQuery("#wplc_rb_theme_4").attr('checked', false);
165
+ jQuery("#wplc_rb_theme_5").attr('checked', false);
166
+ jQuery("#wplc_rb_theme_6").attr('checked', false);
167
+ jQuery("#wplc_theme_default").removeClass("wplc_theme_active");
168
+ jQuery("#wplc_theme_1").removeClass("wplc_theme_active");
169
+ jQuery("#wplc_theme_2").addClass("wplc_theme_active");
170
+ jQuery("#wplc_theme_3").removeClass("wplc_theme_active");
171
+ jQuery("#wplc_theme_4").removeClass("wplc_theme_active");
172
+ jQuery("#wplc_theme_5").removeClass("wplc_theme_active");
173
+ jQuery("#wplc_theme_6").removeClass("wplc_theme_active");
174
+ });
175
+
176
+ jQuery("#wplc_theme_3").click(function() {
177
+ jQuery("#wplc_rb_theme_default").attr('checked', false);
178
+ jQuery("#wplc_rb_theme_1").attr('checked', false);
179
+ jQuery("#wplc_rb_theme_2").attr('checked', false);
180
+ jQuery("#wplc_rb_theme_3").attr('checked', true);
181
+ jQuery("#wplc_rb_theme_4").attr('checked', false);
182
+ jQuery("#wplc_rb_theme_5").attr('checked', false);
183
+ jQuery("#wplc_rb_theme_6").attr('checked', false);
184
+ jQuery("#wplc_theme_default").removeClass("wplc_theme_active");
185
+ jQuery("#wplc_theme_1").removeClass("wplc_theme_active");
186
+ jQuery("#wplc_theme_2").removeClass("wplc_theme_active");
187
+ jQuery("#wplc_theme_3").addClass("wplc_theme_active");
188
+ jQuery("#wplc_theme_4").removeClass("wplc_theme_active");
189
+ jQuery("#wplc_theme_5").removeClass("wplc_theme_active");
190
+ jQuery("#wplc_theme_6").removeClass("wplc_theme_active");
191
+ });
192
+
193
+ jQuery("#wplc_theme_4").click(function() {
194
+ jQuery("#wplc_rb_theme_default").attr('checked', false);
195
+ jQuery("#wplc_rb_theme_1").attr('checked', false);
196
+ jQuery("#wplc_rb_theme_2").attr('checked', false);
197
+ jQuery("#wplc_rb_theme_3").attr('checked', false);
198
+ jQuery("#wplc_rb_theme_4").attr('checked', true);
199
+ jQuery("#wplc_rb_theme_5").attr('checked', false);
200
+ jQuery("#wplc_rb_theme_6").attr('checked', false);
201
+ jQuery("#wplc_theme_default").removeClass("wplc_theme_active");
202
+ jQuery("#wplc_theme_1").removeClass("wplc_theme_active");
203
+ jQuery("#wplc_theme_2").removeClass("wplc_theme_active");
204
+ jQuery("#wplc_theme_3").removeClass("wplc_theme_active");
205
+ jQuery("#wplc_theme_4").addClass("wplc_theme_active");
206
+ jQuery("#wplc_theme_5").removeClass("wplc_theme_active");
207
+ jQuery("#wplc_theme_6").removeClass("wplc_theme_active");
208
+ });
209
+
210
+ jQuery("#wplc_theme_5").click(function() {
211
+ jQuery("#wplc_rb_theme_default").attr('checked', false);
212
+ jQuery("#wplc_rb_theme_1").attr('checked', false);
213
+ jQuery("#wplc_rb_theme_2").attr('checked', false);
214
+ jQuery("#wplc_rb_theme_3").attr('checked', false);
215
+ jQuery("#wplc_rb_theme_4").attr('checked', false);
216
+ jQuery("#wplc_rb_theme_5").attr('checked', true);
217
+ jQuery("#wplc_rb_theme_6").attr('checked', false);
218
+ jQuery("#wplc_theme_default").removeClass("wplc_theme_active");
219
+ jQuery("#wplc_theme_1").removeClass("wplc_theme_active");
220
+ jQuery("#wplc_theme_2").removeClass("wplc_theme_active");
221
+ jQuery("#wplc_theme_3").removeClass("wplc_theme_active");
222
+ jQuery("#wplc_theme_4").removeClass("wplc_theme_active");
223
+ jQuery("#wplc_theme_5").addClass("wplc_theme_active");
224
+ jQuery("#wplc_theme_6").removeClass("wplc_theme_active");
225
+ });
226
+
227
+ jQuery("#wplc_theme_6").click(function() {
228
+ jQuery("#wplc_rb_theme_default").attr('checked', false);
229
+ jQuery("#wplc_rb_theme_1").attr('checked', false);
230
+ jQuery("#wplc_rb_theme_2").attr('checked', false);
231
+ jQuery("#wplc_rb_theme_3").attr('checked', false);
232
+ jQuery("#wplc_rb_theme_4").attr('checked', false);
233
+ jQuery("#wplc_rb_theme_5").attr('checked', false);
234
+ jQuery("#wplc_rb_theme_6").attr('checked', true);
235
+ jQuery("#wplc_theme_default").removeClass("wplc_theme_active");
236
+ jQuery("#wplc_theme_1").removeClass("wplc_theme_active");
237
+ jQuery("#wplc_theme_2").removeClass("wplc_theme_active");
238
+ jQuery("#wplc_theme_3").removeClass("wplc_theme_active");
239
+ jQuery("#wplc_theme_4").removeClass("wplc_theme_active");
240
+ jQuery("#wplc_theme_5").removeClass("wplc_theme_active");
241
+ jQuery("#wplc_theme_6").addClass("wplc_theme_active");
242
+ });
243
+
244
+
245
+
246
+
247
+
248
+ jQuery(function () {
249
+ jQuery(".wplc_settings_tooltip").tooltip({
250
+ position: {
251
+ my: "left+15 center",
252
+ at: "right center",
253
+
254
+ },
255
+ template: '<div class="tooltip wplc_tooltip_control"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
256
+ onShow: function(){
257
+ var $trigger = this.getTrigger();
258
+ var offset = $trigger.offset();
259
+ this.getTip().css({
260
+ 'top' : offset.top,
261
+ 'left' : offset.left
262
+ });
263
+ }
264
+ });
265
+ });
266
+
267
+ });
js/wplc_transcript.js CHANGED
@@ -1,60 +1,60 @@
1
- jQuery('body').on('click', '#chatTranscriptTitle, #wplc_admin_email_transcript, .endChat', sendTranscript);
2
-
3
- function sendTranscript(event) {
4
- var data = {};
5
- var isCloseChatClicked = false;
6
- if (jQuery(event.target).hasClass('endChat')) {
7
- isCloseChatClicked = true;
8
- data.el = 'endChat';
9
- }
10
- if (jQuery('#chatTranscriptTitle').length) {
11
- if (!isCloseChatClicked) {
12
- jQuery("#chatTranscriptTitle").addClass('is-disabled');
13
- }
14
- var cur_id = jQuery('#chatCloseTitle').attr('cid');
15
- data.action = 'wplc_et_admin_email_transcript';
16
- data.security = wplc_transcript_nonce.ajax_nonce;
17
- data.cid = cur_id;
18
- jQuery.post(ajaxurl, data, function(response) {
19
- if (typeof response === 'string' && response.length < 1) {
20
- return;
21
- }
22
- returned_data = JSON.parse(response);
23
- if (returned_data.constructor === Object) {
24
- jQuery('.nifty_admin_chat_prompt, .nifty_admin_overlay').css('display', 'block');
25
- jQuery('#nifty_admin_chat_prompt_confirm').css('display', 'none');
26
- jQuery('.nifty_admin_chat_prompt_title').html(wplc_transcript_nonce.string_title);
27
- jQuery('#nifty_admin_chat_prompt_cancel').html(wplc_transcript_nonce.string_close);
28
- if (returned_data.errorstring) {
29
- jQuery('.nifty_admin_chat_prompt_message').html(wplc_transcript_nonce.string_error1);
30
- } else {
31
- jQuery('.nifty_admin_chat_prompt_message').html(wplc_transcript_nonce.string_chat_emailed);
32
- }
33
- }
34
- });
35
- } else {
36
- if (!isCloseChatClicked) {
37
- jQuery(".wplc_admin_email_transcript").hide();
38
- html = "<span class='wplc_et_loading'><em>" + wplc_transcript_nonce.string_loading + "</em></span>";
39
- jQuery(".wplc_admin_email_transcript").after(html);
40
- }
41
- var cur_id = jQuery(this).attr("cid");
42
- data.action = 'wplc_et_admin_email_transcript';
43
- data.security = wplc_transcript_nonce.ajax_nonce;
44
- data.cid = cur_id;
45
- jQuery.post(ajaxurl, data, function (response) {
46
- returned_data = JSON.parse(response);
47
- if (returned_data.constructor === Object) {
48
- if (returned_data.errorstring) {
49
- jQuery(".wplc_admin_email_transcript").after("<p><strong>" + wplc_transcript_nonce.string_error1 + "</strong></p>");
50
- } else {
51
- jQuery(".wplc_et_loading").hide();
52
-
53
- html = "<span class=''>" + wplc_transcript_nonce.string_chat_emailed + "</span>";
54
- jQuery("#wplc_admin_email_transcript").after(html);
55
- jQuery("#wplc_admin_email_transcript").hide();
56
- }
57
- }
58
- });
59
- }
60
  }
1
+ jQuery('body').on('click', '#chatTranscriptTitle, #wplc_admin_email_transcript, .endChat', sendTranscript);
2
+
3
+ function sendTranscript(event) {
4
+ var data = {};
5
+ var isCloseChatClicked = false;
6
+ if (jQuery(event.target).hasClass('endChat')) {
7
+ isCloseChatClicked = true;
8
+ data.el = 'endChat';
9
+ }
10
+ if (jQuery('#chatTranscriptTitle').length) {
11
+ if (!isCloseChatClicked) {
12
+ jQuery("#chatTranscriptTitle").addClass('is-disabled');
13
+ }
14
+ var cur_id = jQuery('#chatCloseTitle').attr('cid');
15
+ data.action = 'wplc_et_admin_email_transcript';
16
+ data.security = wplc_transcript_nonce.ajax_nonce;
17
+ data.cid = cur_id;
18
+ jQuery.post(ajaxurl, data, function(response) {
19
+ if (typeof response === 'string' && response.length < 1) {
20
+ return;
21
+ }
22
+ returned_data = JSON.parse(response);
23
+ if (returned_data.constructor === Object) {
24
+ jQuery('.nifty_admin_chat_prompt, .nifty_admin_overlay').css('display', 'block');
25
+ jQuery('#nifty_admin_chat_prompt_confirm').css('display', 'none');
26
+ jQuery('.nifty_admin_chat_prompt_title').html(wplc_transcript_nonce.string_title);
27
+ jQuery('#nifty_admin_chat_prompt_cancel').html(wplc_transcript_nonce.string_close);
28
+ if (returned_data.errorstring) {
29
+ jQuery('.nifty_admin_chat_prompt_message').html(wplc_transcript_nonce.string_error1);
30
+ } else {
31
+ jQuery('.nifty_admin_chat_prompt_message').html(wplc_transcript_nonce.string_chat_emailed);
32
+ }
33
+ }
34
+ });
35
+ } else {
36
+ if (!isCloseChatClicked) {
37
+ jQuery(".wplc_admin_email_transcript").hide();
38
+ html = "<span class='wplc_et_loading'><em>" + wplc_transcript_nonce.string_loading + "</em></span>";
39
+ jQuery(".wplc_admin_email_transcript").after(html);
40
+ }
41
+ var cur_id = jQuery(this).attr("cid");
42
+ data.action = 'wplc_et_admin_email_transcript';
43
+ data.security = wplc_transcript_nonce.ajax_nonce;
44
+ data.cid = cur_id;
45
+ jQuery.post(ajaxurl, data, function (response) {
46
+ returned_data = JSON.parse(response);
47
+ if (returned_data.constructor === Object) {
48
+ if (returned_data.errorstring) {
49
+ jQuery(".wplc_admin_email_transcript").after("<p><strong>" + wplc_transcript_nonce.string_error1 + "</strong></p>");
50
+ } else {
51
+ jQuery(".wplc_et_loading").hide();
52
+
53
+ html = "<span class=''>" + wplc_transcript_nonce.string_chat_emailed + "</span>";
54
+ jQuery("#wplc_admin_email_transcript").after(html);
55
+ jQuery("#wplc_admin_email_transcript").hide();
56
+ }
57
+ }
58
+ });
59
+ }
60
  }
js/wplc_u.js CHANGED
@@ -1,976 +1,976 @@
1
- /*
2
- * Cookie Status
3
- *
4
- * 1 - complete - user has left site
5
- * 2 - pending - user waiting for chat to be answered by admin
6
- * 3 - active chat - user and admin are chatting
7
- * 4 - deleted
8
- * 5 - browsing - no data has been inputted
9
- * 6 - requesting chat - admin has requested a chat with user
10
- * 7 - timed out - visitor has timed out
11
- * 8 - complete but now browsing again
12
- * 9 - user closed chat before starting chat
13
- * 10 - user minimized active chat
14
- * 11 - user moved on to another page (session variable is different)
15
- * 12 - user has not been answered after sending chat request and is still active
16
- *
17
- */
18
- var wplc_is_chat_open = false;
19
- var wplc_online = false;
20
- var wplc_agent_name = "";
21
- var msg_history = new Array();
22
- var wplc_is_minimized = false; /* global to hold whether or not the chat box is minimized */
23
-
24
- var wplc_retry_interval = null;
25
-
26
- var wplc_run = true;
27
-
28
- var wplc_server = null;
29
- wplc_server = new WPLCServer();
30
-
31
- var wplc_server_last_loop_data = null;
32
-
33
- var wplc_shown_welcome = false;
34
-
35
- var wplc_current_agent = false;
36
-
37
- /* node support */
38
- var ns_obj = {};
39
-
40
-
41
- /* node variable mapping */
42
- var welcome_message = '';
43
-
44
- var wplc_session_variable = new Date().getTime();
45
- var wplc_cid;
46
- var wplc_check_hide_cookie;
47
- var wplc_chat_status = "";
48
- var wplc_cookie_name = "";
49
- var wplc_cookie_email = "";
50
- var wplc_init_chat_box_check = true;
51
- var wplc_cid = null;
52
-
53
- var initial_data = {};
54
- var wplc_fist_run = true;
55
- var wplc_long_poll_delay = 1500;
56
-
57
- jQuery(document).ready(function() {
58
-
59
- /* Gutenberg functions */
60
- jQuery('.wp-block-wp-live-chat-support-wplc-chat-box').on('click',function(){
61
- jQuery("#wplc_hovercard").fadeOut("fast");
62
- jQuery("#wplc-chat-alert").removeClass('is-active');
63
- wplc_is_chat_open = true;
64
- jQuery.event.trigger({type: "wplc_open_chat"});
65
- });
66
-
67
- wplc_map_node_variables();
68
-
69
- /* preload the images */
70
- wplc_preload();
71
-
72
- wplc_cid = Cookies.get('wplc_cid');
73
-
74
- if(typeof wplc_cid === 'undefined'){
75
- wplc_cid = null;
76
- } else {
77
- wplc_cid = Cookies.get('wplc_cid');
78
- }
79
-
80
- wplc_check_hide_cookie = Cookies.get('wplc_hide');
81
- wplc_check_minimize_cookie = Cookies.get('wplc_minimize');
82
- wplc_chat_status = Cookies.get('wplc_chat_status');
83
- wplc_cookie_name = Cookies.get('wplc_name');
84
- wplc_cookie_email = Cookies.get('wplc_email');
85
- // Always start on 5 - ajax will then return chat status if active
86
-
87
- Cookies.set('wplc_chat_status', 5, { expires: 1, path: '/' });
88
- wplc_chat_status = 5;
89
- //if (typeof wplc_chat_status !== "undefined" && parseInt(wplc_chat_status) === 3) { } else {
90
-
91
- //}
92
-
93
- //Preflight check for WPML integration
94
- var wplc_wpml_body_language = jQuery("html").attr("lang");
95
- if(typeof wplc_wpml_body_language !== "undefined"){
96
- if(wplc_wpml_body_language.indexOf("-") !== -1){
97
- wplc_wpml_body_language = wplc_wpml_body_language.substr(0, wplc_wpml_body_language.indexOf("-"));
98
- }
99
- Cookies.set('_icl_current_language', wplc_wpml_body_language, { expires: 1, path: '/' });
100
- }
101
-
102
- var data = {
103
- action: 'wplc_get_chat_box',
104
- security: wplc_nonce,
105
- cid: wplc_cid
106
- };
107
-
108
- jQuery.ajax({
109
- url: wplc_ajaxurl_site,
110
- data:data,
111
- type:"POST",
112
- success: function(response) {
113
- /* inject html */
114
- if(response){
115
- if (response === "0") { if (window.console) { console.log('WP Live Chat Support Return Error'); } wplc_run = false; return; }
116
- response = JSON.parse(response);
117
-
118
-
119
- jQuery( "body" ).append( response['cbox']);
120
-
121
- wplc_listenForScrollEvent(jQuery("#wplc_chatbox"));
122
-
123
- if( typeof wplc_cookie_name == 'undefined' || typeof wplc_cookie_email == 'undefined' ){
124
-
125
- var wplc_cookie_name = jQuery( jQuery.parseHTML( response['cbox'] ) ).find( "#wplc_name" ).val();
126
- var wplc_cookie_email = jQuery( jQuery.parseHTML( response['cbox'] ) ).find( "#wplc_email" ).val();
127
-
128
- }
129
-
130
-
131
-
132
- /* is an agent online? */
133
- if (response['online'] === false) {
134
- wplc_run = false;
135
- wplc_online = false;
136
- ns_obj.o = '0';
137
-
138
- } else {
139
- wplc_online = true;
140
- ns_obj.o = '1';
141
- }
142
-
143
-
144
-
145
- if (wplc_filter_run_override !== "1" || wplc_online === false) { wplc_run = false; } else { /* we can run */ }
146
-
147
-
148
- /* has this user been assigned an agent? */
149
- if (typeof response['type'] === "undefined") {
150
- wplc_shown_welcome = false;
151
- } else {
152
- if (response['type'] === "returning") {
153
- wplc_shown_welcome = true;
154
- /* set the agent vars so we can access them on the fly */
155
- if (typeof response['agent_data'] !== "undefined") {
156
- wplc_current_agent = response['agent_data'];
157
- }
158
- } else {
159
- wplc_shown_welcome = false;
160
- }
161
-
162
- }
163
-
164
-
165
- /*Support mobile loggin*/
166
- var wplc_mobile_check = false;
167
- if(typeof wplc_is_mobile !== "undefined" && (wplc_is_mobile === "true" || wplc_is_mobile === true)){
168
- wplc_mobile_check = true;
169
- }
170
-
171
- /* start long polling */
172
- var data = {
173
- action: 'wplc_call_to_server_visitor',
174
- security: wplc_nonce,
175
- cid:wplc_cid,
176
- wplc_name: wplc_cookie_name,
177
- wplc_email: wplc_cookie_email,
178
- status:wplc_chat_status,
179
- wplcsession:wplc_session_variable,
180
- wplc_is_mobile: wplc_mobile_check,
181
- wplc_extra_data:wplc_extra_data
182
- };
183
-
184
- if(wplc_server.browserIsSocketReady()){
185
- data.socket = true;
186
-
187
- /* load node relay code */
188
- var nc = document.createElement("script");
189
- nc.type = "text/javascript";
190
- nc.async = true;
191
- nc.src = "https://bleeper.io/app/assets/js/bleeper-dev.js";
192
- //nc.src = "http://127.0.0.1/nick-bleeper-dev.js";
193
-
194
- document.getElementsByTagName("head")[0].appendChild(nc);
195
-
196
- }
197
-
198
- initial_data = data;
199
- // ajax long polling function
200
- if (wplc_filter_run_override !== "1" || wplc_online === false) {
201
-
202
- wplc_call_to_server_chat(data,true,true);
203
- } else {
204
-
205
- wplc_call_to_server_chat(data,true,false);
206
- }
207
-
208
- if(wplc_cid !== null && wplc_init_chat_box_check == true && wplc_init_chat_box !== false){
209
-
210
- wplc_init_chat_box(wplc_cid,wplc_chat_status);
211
- } else {
212
- //Node and offline
213
- if(typeof wplc_use_node_server !== "undefined" && (wplc_use_node_server === "true" || wplc_use_node_server === true)){
214
-
215
- if(wplc_check_hide_cookie != "yes"){
216
- wplc_dc = setTimeout(function (){
217
- wplc_cbox_animation();
218
- }, parseInt(window.wplc_delay));
219
- }
220
- }
221
- }
222
-
223
-
224
- }
225
-
226
- }
227
-
228
- });
229
-
230
- /**
231
- * Preload images from the localized variable
232
- * @return void
233
- */
234
- function wplc_preload() {
235
- var images = [];
236
- if (typeof wplc_preload_images !== "undefined" && typeof wplc_preload_images === "object" ) {
237
- var wplc_i = 0;
238
- for (var key in wplc_preload_images) {
239
- if (wplc_preload_images.hasOwnProperty(key)) {
240
- images[wplc_i] = new Image();
241
- images[wplc_i].src = wplc_preload_images[key];
242
- wplc_i++;
243
- }
244
- }
245
- }
246
- }
247
-
248
-
249
- /**
250
- * Detect if the chatbox is being scrolled.
251
- *
252
- * This had to be created as jQuery does not allow the scroll event to bubble up the DOM tree.
253
- *
254
- * Thank you Bikal Basnet (https://stackoverflow.com/questions/16505182/bind-scroll-event-to-dynamic-div)
255
- *
256
- * @param object el The element in question
257
- */
258
- function wplc_listenForScrollEvent(el) {
259
- el.on("scroll", function(){
260
- el.trigger("wplc-custom-scroll");
261
- })
262
-
263
- }
264
-
265
-
266
-
267
- jQuery("body").on('keyup', '#wplc_email, #wplc_name', function (e) {
268
- if (e.keyCode == 13) {
269
- jQuery("#wplc_start_chat_btn").trigger("click")
270
- }
271
- });
272
-
273
- jQuery("body").on("click", "#wplc_end_chat_button", function(e){
274
- var data = {
275
- security: wplc_nonce,
276
- chat_id: wplc_cid,
277
- agent_id: 0
278
- };
279
-
280
- wplc_rest_api('end_chat', data, 12000, null);
281
-
282
- jQuery.event.trigger({type: "wplc_end_chat_as_user"});
283
- });
284
-
285
- jQuery("body").on("click", "#wplc_gdpr_download_data_button", function(e){
286
- var wplc_init_nonce = jQuery(this).attr('data-wplc-init-nonce');
287
- var wplc_gdpr_last_cid = jQuery(this).attr('data-wplc-last-cid');
288
-
289
- if(typeof wplc_gdpr_last_cid !== 'undefined'){
290
- var reference_href = window.location.href;
291
- reference_href = reference_href.indexOf("?") !== -1 ? reference_href.substr(0, reference_href.indexOf("?")) : reference_href;
292
- var download_url = reference_href + "?wplc_action=wplc_gdpr_download_chat_json&wplc_cid=" + wplc_gdpr_last_cid + "&wplc_init_nonce=" + wplc_init_nonce;
293
- window.open(download_url);
294
- }
295
- });
296
-
297
- jQuery("body").on("click", "#wplc_gdpr_remove_data_button", function(e){
298
- var current_button = jQuery(this);
299
-
300
- var wplc_rest_nonce = current_button.attr('data-wplc-rest-nonce');
301
- var wplc_gdpr_rest_url = current_button.attr('data-wplc-rest-url');
302
- var wplc_gdpr_last_cid = current_button.attr('data-wplc-last-cid');
303
-
304
- current_button.text('Processing...');
305
-
306
- if(typeof wplc_gdpr_last_cid !== 'undefined'){
307
-
308
- jQuery.ajax({
309
- url: wplc_gdpr_rest_url + "/delete_chat",
310
- data: {
311
- wplc_cid: wplc_gdpr_last_cid,
312
- _wpnonce: wplc_rest_nonce
313
- },
314
- type:"POST",
315
- complete: function() {
316
- current_button.text('Complete');
317
- }
318
- });
319
- }
320
-
321
- });
322
-
323
- jQuery(document).on("wplc_update_gdpr_last_chat_id", function(e) {
324
- jQuery('#wplc_gdpr_remove_data_button,#wplc_gdpr_download_data_button').attr('data-wplc-last-cid', wplc_cid);
325
- });
326
-
327
-
328
-
329
- // Fix conflict with Responsive Lighbox plugin
330
- setTimeout(function () {
331
- if (jQuery('html').hasClass('nivo-lightbox-notouch') || jQuery('a[rel*="lightbox"]').length) {
332
- jQuery("body").on("keyup", function (event) {
333
- if (event.keyCode === 13) {
334
- jQuery("#wplc_send_msg").trigger("click");
335
- }
336
- });
337
- }
338
- }, 5000);
339
-
340
- if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
341
- setTimeout(function () {
342
- var liveChat4 = jQuery('#wp-live-chat-4');
343
- var liveChat = jQuery('#wp-live-chat');
344
- if (!liveChat.hasClass('classic')) {
345
- jQuery('body').on('click', function (event) {
346
- if (liveChat.hasClass('mobile-active')) {
347
- if (event.target.id !== 'wplc_chatmsg' && event.target.className !== 'wdt-emoji-picker') {
348
- liveChat4.removeClass('is-full-height');
349
- } else {
350
- liveChat4.addClass('is-full-height');
351
- }
352
- }
353
- });
354
- } else {
355
- jQuery('body').on('click', function (event) {
356
- if (liveChat.hasClass('mobile-active')) {
357
- if (event.target.id !== 'wplc_chatmsg' && event.target.className !== 'wdt-emoji-picker') {
358
- liveChat.removeClass('is-full-height');
359
- } else {
360
- liveChat.addClass('is-full-height');
361
- }
362
- }
363
- });
364
- }
365
- }, 500);
366
- }
367
- });
368
-
369
-
370
- function wplc_map_node_variables() {
371
- if (typeof wplc_welcome_msg !== "undefined") {
372
- welcome_message = wplc_welcome_msg;
373
- }
374
- }
375
-
376
- /**
377
- * This instantly sends the user the welcome message (i.e. to wait for any agent and start typing so long)
378
- *
379
- *
380
- */
381
- function wplc_send_welcome_message() {
382
- if(wplc_welcome_msg !== "" && !wplc_shown_welcome){
383
- message_class = "wplc_system_notification wplc-color-4";
384
- var concatenated_message = "<span class='" + message_class + "'>";
385
- concatenated_message += wplc_welcome_msg;
386
- concatenated_message += "</span>";
387
-
388
- if(typeof niftyFormatParser !== "undefined"){
389
- jQuery("#wplc_chatbox").append(niftyFormatParser(concatenated_message));
390
- } else{
391
- jQuery("#wplc_chatbox").append(concatenated_message);
392
- }
393
- wplc_scroll_to_bottom();
394
-
395
- wplc_shown_welcome = true;
396
- }
397
-
398
- }
399
-
400
- jQuery(document).ready(function(){
401
- if (wplc_online) {
402
- jQuery(document).on('click', '#wp-live-chat-header', function() {
403
- jQuery('#speeching_button').html(wplc_pro_sst1);
404
- jQuery('#wplc_name').val(wplc_user_default_visitor_name);
405
- })
406
- } else {
407
- jQuery('#wplc_na_msg_btn').val(wplc_pro_offline_btn_send);
408
- }
409
- })
410
-
411
- /**
412
- * Scrolls the chat box to the bottom
413
- *
414
- */
415
- function wplc_scroll_to_bottom() {
416
- var height = jQuery('#wplc_chatbox')[0].scrollHeight;
417
- jQuery('#wplc_chatbox').scrollTop(height);
418
- }
419
-
420
-
421
-
422
- function wplc_user_message_receiver(data){
423
- if(typeof wplc_loop_response_handler !== "undefined" && typeof wplc_loop_response_handler === "function"){
424
- wplc_loop_response_handler(data, wplc_server_last_loop_data);
425
- data = JSON.parse(data);
426
- if(typeof data['status'] !== "undefined"){
427
- delete wplc_server_last_loop_data.status;
428
- }
429
-
430
- if(data.keep_alive === true){
431
-
432
- setTimeout(function(){
433
- wplc_server_last_loop_data.status = wplc_chat_status;
434
- wplc_call_to_server_chat(wplc_server_last_loop_data);
435
- },100);
436
- }
437
- }
438
- }
439
-
440
- function wplc_user_retry_handler(data){
441
- var tstatus = Cookies.get("wplc_chat_status");
442
-
443
- if (tstatus !== "undefined") {
444
- if(tstatus !== 8 || tstatus !== 1){
445
- wplc_retry_interval = setTimeout(function(){
446
-
447
- wplc_server.prepareTransport(function(){
448
- //Transport ready...
449
- wplc_server_last_loop_data.status = parseInt(tstatus); //Set to existing status
450
- wplc_call_to_server_chat(wplc_server_last_loop_data);
451
- }, wplc_user_message_receiver, wplc_user_retry_handler, wplc_log_connection_error);
452
-
453
-
454
- },500);
455
- }
456
-
457
- }
458
- }
459
-
460
- function wplc_call_to_server_chat(data,first_run,short_poll) {
461
-
462
- if (typeof wplc_use_node_server !== "undefined" && wplc_use_node_server === "true") {
463
- //not sending to WP
464
- return;
465
- } else {
466
-
467
-
468
- if (typeof first_run === "undefined") { first_run = false; };
469
- if (typeof short_poll === "undefined") { short_poll = false; };
470
- data.first_run = first_run;
471
- data.short_poll = short_poll;
472
-
473
- if(typeof Cookies.get('wplc_name') !== "undefined"){
474
- data.msg_from_print = Cookies.get('wplc_name');
475
- }
476
-
477
- wplc_server_last_loop_data = data;
478
-
479
- wplc_server.send(wplc_ajaxurl, data, "POST", 120000,
480
- function(response) {
481
- wplc_long_poll_delay = 1500;
482
- wplc_loop_response_handler(response, data);
483
- },
484
- function(jqXHR, exception) {
485
- wplc_long_poll_delay = 5000;
486
-
487
- if (jqXHR.status == 404) {
488
- wplc_log_connection_error('Error: Requested page not found. [404]');
489
- wplc_run = false;
490
- } else if (jqXHR.status == 500) {
491
- wplc_log_connection_error('Error: Internal Server Error [500].');
492
- wplc_log_connection_error('Retrying in 5 seconds...');
493
- wplc_run = true;
494
- } else if (exception === 'parsererror') {
495
- wplc_log_connection_error('Error: Requested JSON parse failed.');
496
- wplc_run = false;
497
- } else if (exception === 'abort') {
498
- wplc_log_connection_error('Error: Ajax request aborted.');
499
- wplc_run = false;
500
- } else {
501
- wplc_log_connection_error('Error: Uncaught Error.\n' + jqXHR.responseText);
502
- wplc_log_connection_error('Retrying in 5 seconds...');
503
- wplc_run = true;
504
- }
505
- },
506
- function(response){
507
- if (wplc_run) {
508
- if(wplc_server.isInSocketMode() === false && wplc_server.isPreparingSocketMode() === false){
509
- setTimeout(function() {
510
- wplc_call_to_server_chat(data,false,false);
511
- }, wplc_long_poll_delay);
512
- } else if ((wplc_server.isInSocketMode() === false && wplc_server.isPreparingSocketMode() === true) && (typeof wplc_transport_prepared !== "undefined" && wplc_transport_prepared === false)) {
513
- /* Allows for initiate chat to work on the node server */
514
- if (typeof wplc_use_node_server !== "undefined" && wplc_use_node_server === "true") {
515
- /* do not run this if using not the node jedi */
516
- setTimeout(function() {
517
- wplc_call_to_server_chat(data,false,true);
518
- }, 7500);
519
- }
520
- } else {
521
- if(typeof response !== "undefined" && typeof response.responseText !== "undefined" && response.responseText !== ""){
522
- var response_data = JSON.parse(response.responseText);
523
- if (typeof wplc_transport_prepared !== "undefined") {
524
- if(wplc_transport_prepared !== true && (parseInt(response_data.status) === 3 || parseInt(response_data.status) === 2)){
525
- //Transport is unprepared and the user has returned to the page with a status 3/2
526
- wplc_server.prepareTransport(function(){
527
- wplc_call_to_server_chat(data,false,false);
528
- }, wplc_user_message_receiver, wplc_user_retry_handler, wplc_log_connection_error);
529
- }
530
- }
531
- }
532
- }
533
- }
534
- }
535
- );
536
- }
537
-
538
- };
539
-
540
- function wplc_loop_response_handler(response, data){
541
- if(response){
542
- if (response === "0") { if (window.console) { console.log('WP Live Chat Support Return Error'); } wplc_run = false; return; }
543
- if (typeof response !== "object") {
544
- response = JSON.parse(response);
545
- }
546
-
547
- data['action_2'] = "";
548
- if(typeof response['wplc_name'] !== "undefined"){ data['wplc_name'] = response['wplc_name']; /* Cookies.set('wplc_name', response['wplc_name'], { expires: 1, path: '/' });*/ }
549
- if(typeof response['wplc_email'] !== "undefined"){ data['wplc_email'] = response['wplc_email']; /* Cookies.set('wplc_email', response['wplc_email'], { expires: 1, path: '/' }); */ }
550
- if(typeof response['cid'] !== "undefined"){ data['cid'] = response['cid']; Cookies.set('wplc_cid', response['cid'], { expires: 1, path: '/' }); }
551
- if(typeof response['aname'] !== "undefined") { wplc_agent_name = response['aname']; }
552
- if(typeof response['cid'] !== "undefined" && wplc_cid !== jQuery.trim(response['cid'])){ wplc_cid = jQuery.trim(response['cid']); jQuery("#wplc_cid").val(wplc_cid); }
553
- if(typeof response['status'] !== "undefined" && parseInt(wplc_chat_status) !== parseInt(response['status'])){
554
- wplc_chat_status = response['status'];
555
- Cookies.set('wplc_chat_status', null, { path: '/' });
556
- Cookies.set('wplc_chat_status', wplc_chat_status, { expires: 1, path: '/' });
557
- }
558
-
559
- /* Trigger for handling responses */
560
- jQuery.event.trigger({type: "wplc_user_chat_loop",response:response});
561
-
562
- /* Process status changes */
563
- if(data['status'] == response['status']){
564
-
565
- if(data['status'] == 5 && wplc_init_chat_box_check === true && wplc_init_chat_box !== false){ // open chat box on load
566
- wplc_init_chat_box(data['cid'], data['status']);
567
- }
568
- if((response['status'] == 3 || response['status'] == 2) && response['data'] != null){ // if active and data is returned
569
- wplc_run = true;
570
- var wplc_new_message_sound = false;
571
- if (typeof response['data'] === "object") {
572
-
573
- for (var index in response['data']) {
574
- if(typeof response['data'][index] !== "object"){
575
- if (typeof msg_history[index] === "undefined") {
576
- //Not from node
577
- /* we dont have this message */
578
- msg_history[index] = true;
579
-
580
- msg_to_parse = response['data'][index].wplcStripSlashes();
581
-
582
- if(typeof niftyFormatParser !== "undefined"){
583
- jQuery("#wplc_chatbox").append(niftyFormatParser(msg_to_parse));
584
- } else{
585
-
586
- jQuery("#wplc_chatbox").append(response['data'][index].wplcStripSlashes());
587
- }
588
-
589
- wplc_new_message_sound = true;
590
-
591
- } else {
592
- /* we already have this message */
593
- }
594
- } else {
595
- var the_message = response['data'][index];
596
- the_message.mid = index;
597
- wplc_push_message_to_chatbox(the_message,'u', function() {
598
- wplc_scroll_to_bottom();
599
- });
600
-
601
- wplc_new_message_sound = true;
602
- }
603
- }
604
- }
605
- else {
606
- /* backwards compatibility - response['data'] is a string */
607
- if(typeof niftyFormatParser !== "undefined"){
608
- jQuery("#wplc_chatbox").append(niftyFormatParser(response['data'].wplcStripSlashes()));
609
- } else{
610
- jQuery("#wplc_chatbox").append(response['data'].wplcStripSlashes());
611
-
612
- }
613
- wplc_new_message_sound = true;
614
- }
615
-
616
- if(wplc_new_message_sound){
617
- wplc_scroll_to_bottom();
618
- if (typeof wplc_enable_ding !== 'undefined' && wplc_enable_ding === "1") {
619
- new Audio(wplc_plugin_url+'ding.mp3').play();
620
- }
621
- }
622
- }
623
-
624
- } else {
625
- data['status'] = wplc_chat_status;
626
- Cookies.set('wplc_chat_status', wplc_chat_status, { expires: 1, path: '/' });
627
- if(response['status'] == 0 || response['status'] == 12){ // no answer from admin
628
- jQuery("#wp-live-chat-3").hide();
629
- if (typeof response['data'] !== "undefined") {
630
- jQuery("#wplc_chatbox").append(response['data'].wplcStripSlashes()+"<hr />");
631
- }
632
-
633
- }
634
- else if(response['status'] == 8){ // chat has been ended by admin
635
- wplc_run = false;
636
-
637
- document.getElementById('wplc_chatmsg').disabled = true;
638
- wplc_shown_welcome = false;
639
-
640
- the_message = wplc_generate_system_notification_object(wplc_error_messages.chat_ended_by_operator, {}, 0);
641
- wplc_push_message_to_chatbox(the_message,'u', function() {
642
- wplc_scroll_to_bottom();
643
- });
644
-
645
-
646
- /*
647
- if(typeof response['data'] === "object") {
648
- for (var index in response['data']) {
649
- if(typeof response['data'][index] === "object"){
650
-
651
- var the_message = response['data'][index];
652
- if(typeof the_message.originates !== "undefined"){
653
- var message_class = "";
654
- var message_content = "";
655
-
656
- if (parseInt(the_message.originates) === 0){
657
- //System Notification
658
- message_class = "wplc_system_notification wplc-color-4";
659
- message_content = the_message.msg;
660
- if(message_content !== ""){
661
- var concatenated_message = "<span class='" + message_class + "'>";
662
- concatenated_message += message_content;
663
- concatenated_message += "</span>";
664
-
665
- if(typeof niftyFormatParser !== "undefined"){
666
- jQuery("#wplc_chatbox").append(niftyFormatParser(concatenated_message));
667
- } else{
668
- jQuery("#wplc_chatbox").append(concatenated_message);
669
- }
670
- }
671
- }
672
- }
673
- }
674
- }
675
- } else {
676
- //Backwards Compat
677
- jQuery("#wplc_chatbox").append("<em>"+response['data']+"</em><br />");
678
- }*/
679
-
680
-
681
-
682
-
683
-
684
- jQuery.event.trigger({type: "wplc_end_chat"});
685
-
686
- }
687
- else if(parseInt(response['status']) == 11){ /* use moved on to another page (perhaps in another tab so close this instance */
688
- jQuery("#wp-live-chat").css({ "display" : "none" });
689
- wplc_run = false;
690
- }
691
- else if(parseInt(response['status']) == 3 || parseInt(response['status']) == 2 || parseInt(response['status']) == 10){ // re-initialize chat
692
- wplc_run = true;
693
- if(parseInt(response['status']) == 3) { // only if not minimized open aswell
694
- /* HERE NODE */
695
-
696
- if (typeof wplc_use_node_server !== "undefined" && wplc_use_node_server === "true") {
697
- /* do not run this if using not the node jedi */
698
-
699
- if (typeof wplc_transport_prepared !== "undefined" && wplc_transport_prepared === false) {
700
- wplc_server.prepareTransport(function(){
701
- wplc_call_to_server_chat(wplc_server_last_loop_data,false,false);
702
- }, wplc_user_message_receiver, wplc_user_retry_handler, wplc_log_connection_error);
703
- }
704
- }
705
- if (!wplc_is_minimized) {
706
- if (!wplc_is_chat_open) {
707
- wplc_cbox_animation();
708
- setTimeout(function() {
709
- open_chat(0);
710
- },1500);
711
- }
712
- }
713
-
714
-
715
- if(jQuery('#wp-live-chat').hasClass('wplc_left') === true || jQuery('#wp-live-chat').hasClass('wplc_right') === true){
716
- //jQuery('#wp-live-chat').height("400px");
717
- }
718
- }
719
- if(parseInt(response['status']) == 10) { // only if not minimized open aswell
720
- wplc_run = true;
721
- open_chat(0);
722
-
723
- }
724
- if(response['data'] != null){ // append messages to chat area
725
- if (typeof response['data'] === "object") {
726
-
727
- for (var index in response['data']) {
728
- wplc_new_message_sound = false;
729
- if(typeof response['data'][index] !== "object"){
730
-
731
- if (typeof msg_history[index] === "undefined") {
732
- /* we dont have this message */
733
- msg_history[index] = true;
734
- if(typeof niftyFormatParser !== "undefined"){
735
- jQuery("#wplc_chatbox").append(niftyFormatParser(response['data'][index].wplcStripSlashes()));
736
- } else{
737
- jQuery("#wplc_chatbox").append(response['data'][index].wplcStripSlashes());
738
- }
739
-
740
- wplc_new_message_sound = true;
741
- } else {
742
- /* we already have this message */
743
- }
744
- } else {
745
- var the_message = response['data'][index];
746
- the_message.mid = index;
747
- wplc_push_message_to_chatbox(the_message,'u', function() {
748
- wplc_scroll_to_bottom();
749
- });
750
-
751
-
752
- }
753
-
754
- if(wplc_new_message_sound){
755
- if (response['alert']) {
756
- jQuery('#wplc-chat-alert').addClass('is-active');
757
- }
758
- wplc_scroll_to_bottom();
759
- if (typeof wplc_enable_ding !== 'undefined' && wplc_enable_ding === "1") {
760
- new Audio(wplc_plugin_url+'ding.mp3').play();
761
- }
762
- }
763
- }
764
- }
765
- else {
766
- /* backwards compatibility - response['data'] is a string */
767
- if(typeof niftyFormatParser !== "undefined"){
768
- jQuery("#wplc_chatbox").append(niftyFormatParser(response['data'].wplcStripSlashes()));
769
- } else{
770
- jQuery("#wplc_chatbox").append(response['data'].wplcStripSlashes());
771
-
772
- }
773
- }
774
-
775
- if(response['data']){
776
- wplc_scroll_to_bottom();
777
-
778
- }
779
- }
780
- }
781
- }
782
- }
783
- }
784
-
785
-
786
-
787
- function wplc_log_connection_error(error){
788
- if (window.console) { console.log(error); }
789
-
790
- jQuery("#wplc_chatbox").append("<small>" + error + "</small><br>");
791
- wplc_scroll_to_bottom();
792
- }
793
-
794
- function wplc_display_error(error) {
795
-
796
- the_message = {};
797
- the_message.originates = 2;
798
- the_message.msg = error;
799
- the_message.other = {};
800
- var wplc_d = new Date();
801
- the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
802
- wplc_push_message_to_chatbox(the_message,'u', function() {
803
- wplc_scroll_to_bottom();
804
- });
805
-
806
-
807
-
808
- }
809
-
810
- var wplc_init_chat_box = function(cid, status){
811
- if(wplc_chat_status == 9 && wplc_check_hide_cookie == "yes"){
812
- } else if (wplc_chat_status === 3) {
813
- wplc_cbox_animation();
814
- } else {
815
-
816
- if(wplc_check_hide_cookie != "yes"){
817
- wplc_dc = setTimeout(function (){
818
- wplc_cbox_animation();
819
- }, parseInt(window.wplc_delay));
820
- }
821
- }
822
- wplc_init_chat_box = false;
823
- jQuery.event.trigger({type: "wplc_init_complete"});
824
- }
825
-
826
- function wplc_cbox_animation() {
827
- /*
828
- * 1- Slide Up
829
- * 2- Slide Across (Left/Right)
830
- * 3- Slide Down
831
- * 4- Fade In
832
- */
833
-
834
-
835
- var wplc_window_id = jQuery("#wp-live-chat");
836
-
837
- var wplc_theme_chosen = jQuery(wplc_window_id).attr('wplc_animation');
838
-
839
- switch(wplc_theme_chosen){
840
- case 'none':
841
- jQuery(wplc_window_id).css('display', 'block');
842
- break;
843
- case 'animation-1':
844
- // Slide Up
845
- jQuery(wplc_window_id).animate({'marginBottom' : '0px'}, 1000);
846
- break;
847
- case 'animation-2-bl':
848
- // Slide Accross from left
849
- jQuery(wplc_window_id).animate({'left' : '20px'}, 1000);
850
- break;
851
- case 'animation-2-br':
852
- // Slide Accross from right
853
- jQuery(wplc_window_id).animate({'right' : '20px'}, 1000);
854
- break;
855
- case 'animation-2-l':
856
- // Slide Accross from left
857
- jQuery(wplc_window_id).animate({"left" : '0px'}, 1000);
858
- break;
859
- case 'animation-2-r':
860
-
861
- // Slide Accross from right
862
- jQuery(wplc_window_id).animate({'right' : '0px'}, 1000);
863
- break;
864
- case 'animation-3':
865
- // Fade In
866
- jQuery(wplc_window_id).fadeIn('slow');
867
- case 'animation-4':
868
- jQuery(wplc_window_id).css('display', 'block');
869
- break;
870
- default:
871
- jQuery(wplc_window_id).css('display', 'block');
872
- break;
873
- }
874
-
875
- //jQuery("#wp-live-chat").css({ "display" : "block" });
876
- if(jQuery("#wp-live-chat").attr('wplc-auto-pop-up') === "1"){
877
-
878
- var wplc_force_must_min = Cookies.get('wplc_minimize');
879
- if(wplc_force_must_min === 'yes'){
880
- /* User has actively chosen to minimize the chat, leave it alone */
881
- } else {
882
- setTimeout(function(){
883
- open_chat(0);
884
- },1000);
885
- /**
886
- * Adding this fixes the bug that stops the chat window from opening when an agent initialises a chat with a user
887
- *
888
- * Reasoning: when running open_chat(), wplc_is_chat_open is set to TRUE at the end of the function, and stops any future request to open_chat();
889
- *
890
- */
891
- wplc_is_chat_open = false;
892
- }
893
- }
894
-
895
- jQuery.event.trigger({type: "wplc_animation_done"});
896
- }
897
-
898
-
899
- function wplc_sound(source,volume,loop) {
900
- this.source=source;
901
- this.volume=volume;
902
- this.loop=loop;
903
- var son;
904
- this.son=son;
905
- this.finish=false;
906
- this.stop=function()
907
- {
908
- document.body.removeChild(this.son);
909
- }
910
- this.start=function()
911
- {
912
- if(this.finish)return false;
913
- this.son=document.createElement("embed");
914
- this.son.setAttribute("src",this.source);
915
- this.son.setAttribute("hidden","true");
916
- this.son.setAttribute("volume",this.volume);
917
- this.son.setAttribute("autostart","true");
918
- this.son.setAttribute("loop",this.loop);
919
- document.body.appendChild(this.son);
920
- }
921
- this.remove=function()
922
- {
923
- document.body.removeChild(this.son);
924
- this.finish=true;
925
- }
926
- this.init=function(volume,loop)
927
- {
928
- this.finish=false;
929
- this.volume=volume;
930
- this.loop=loop;
931
- }
932
- }
933
-
934
-
935
- function wplc_strip(str) {
936
- str=str.replace(/<br>/gi, "\n");
937
- str=str.replace(/<p.*>/gi, "\n");
938
- str=str.replace(/<a.*href="(.*?)".*>(.*?)<\/a>/gi, " $2 ($1) ");
939
- str=str.replace(/<(?:.|\s)*?>/g, "");
940
-
941
- str=str.replace('iframe', "");
942
- str=str.replace('src', "");
943
- str=str.replace('href', "");
944
- str=str.replace('<', "");
945
- str=str.replace('>', "");
946
-
947
- /* remove the last carriage return from the text area output */
948
- str=str.replace(/\n$/, "")
949
-
950
- return str;
951
- }
952
-
953
- (function($) {
954
-
955
- $(document).ready(function(event) {
956
-
957
- if(!window.wdtEmojiBundle)
958
- return;
959
-
960
- $(document.body).on("click", function(event) {
961
-
962
- // If click event isn't on the emoji window, or the emoji open button, close the emoji window
963
- if($(event.target).closest(".wdt-emoji-picker, .wdt-emoji-popup").length == 0 && !(
964
- event.target.parentNode == null && $(event.target).hasClass("fa-smile-o")
965
- ))
966
- wdtEmojiBundle.close();
967
-
968
- });
969
-
970
- // Close emoji window on scroll
971
- $(window).scroll(function(event) {
972
- wdtEmojiBundle.close();
973
- });
974
- });
975
-
976
- })(jQuery);
1
+ /*
2
+ * Cookie Status
3
+ *
4
+ * 1 - complete - user has left site
5
+ * 2 - pending - user waiting for chat to be answered by admin
6
+ * 3 - active chat - user and admin are chatting
7
+ * 4 - deleted
8
+ * 5 - browsing - no data has been inputted
9
+ * 6 - requesting chat - admin has requested a chat with user
10
+ * 7 - timed out - visitor has timed out
11
+ * 8 - complete but now browsing again
12
+ * 9 - user closed chat before starting chat
13
+ * 10 - user minimized active chat
14
+ * 11 - user moved on to another page (session variable is different)
15
+ * 12 - user has not been answered after sending chat request and is still active
16
+ *
17
+ */
18
+ var wplc_is_chat_open = false;
19
+ var wplc_online = false;
20
+ var wplc_agent_name = "";
21
+ var msg_history = new Array();
22
+ var wplc_is_minimized = false; /* global to hold whether or not the chat box is minimized */
23
+
24
+ var wplc_retry_interval = null;
25
+
26
+ var wplc_run = true;
27
+
28
+ var wplc_server = null;
29
+ wplc_server = new WPLCServer();
30
+
31
+ var wplc_server_last_loop_data = null;
32
+
33
+ var wplc_shown_welcome = false;
34
+
35
+ var wplc_current_agent = false;
36
+
37
+ /* node support */
38
+ var ns_obj = {};
39
+
40
+
41
+ /* node variable mapping */
42
+ var welcome_message = '';
43
+
44
+ var wplc_session_variable = new Date().getTime();
45
+ var wplc_cid;
46
+ var wplc_check_hide_cookie;
47
+ var wplc_chat_status = "";
48
+ var wplc_cookie_name = "";
49
+ var wplc_cookie_email = "";
50
+ var wplc_init_chat_box_check = true;
51
+ var wplc_cid = null;
52
+
53
+ var initial_data = {};
54
+ var wplc_fist_run = true;
55
+ var wplc_long_poll_delay = 1500;
56
+
57
+ jQuery(function() {
58
+
59
+ /* Gutenberg functions */
60
+ jQuery('.wp-block-wp-live-chat-support-wplc-chat-box').on('click',function(){
61
+ jQuery("#wplc_hovercard").fadeOut("fast");
62
+ jQuery("#wplc-chat-alert").removeClass('is-active');
63
+ wplc_is_chat_open = true;
64
+ jQuery.event.trigger({type: "wplc_open_chat"});
65
+ });
66
+
67
+ wplc_map_node_variables();
68
+
69
+ /* preload the images */
70
+ wplc_preload();
71
+
72
+ wplc_cid = Cookies.get('wplc_cid');
73
+
74
+ if(typeof wplc_cid === 'undefined'){
75
+ wplc_cid = null;
76
+ } else {
77
+ wplc_cid = Cookies.get('wplc_cid');
78
+ }
79
+
80
+ wplc_check_hide_cookie = Cookies.get('wplc_hide');
81
+ wplc_check_minimize_cookie = Cookies.get('wplc_minimize');
82
+ wplc_chat_status = Cookies.get('wplc_chat_status');
83
+ wplc_cookie_name = Cookies.get('wplc_name');
84
+ wplc_cookie_email = Cookies.get('wplc_email');
85
+ // Always start on 5 - ajax will then return chat status if active
86
+
87
+ Cookies.set('wplc_chat_status', 5, { expires: 1, path: '/' });
88
+ wplc_chat_status = 5;
89
+ //if (typeof wplc_chat_status !== "undefined" && parseInt(wplc_chat_status) === 3) { } else {
90
+
91
+ //}
92
+
93
+ //Preflight check for WPML integration
94
+ var wplc_wpml_body_language = jQuery("html").attr("lang");
95
+ if(typeof wplc_wpml_body_language !== "undefined"){
96
+ if(wplc_wpml_body_language.indexOf("-") !== -1){
97
+ wplc_wpml_body_language = wplc_wpml_body_language.substr(0, wplc_wpml_body_language.indexOf("-"));
98
+ }
99
+ Cookies.set('_icl_current_language', wplc_wpml_body_language, { expires: 1, path: '/' });
100
+ }
101
+
102
+ var data = {
103
+ action: 'wplc_get_chat_box',
104
+ security: wplc_nonce,
105
+ cid: wplc_cid
106
+ };
107
+
108
+ jQuery.ajax({
109
+ url: wplc_ajaxurl_site,
110
+ data:data,
111
+ type:"POST",
112
+ success: function(response) {
113
+ /* inject html */
114
+ if(response){
115
+ if (response === "0") { if (window.console) { console.log('WP Live Chat Support Return Error'); } wplc_run = false; return; }
116
+ response = JSON.parse(response);
117
+
118
+
119
+ jQuery( "body" ).append( response['cbox']);
120
+
121
+ wplc_listenForScrollEvent(jQuery("#wplc_chatbox"));
122
+
123
+ if( typeof wplc_cookie_name == 'undefined' || typeof wplc_cookie_email == 'undefined' ){
124
+
125
+ var wplc_cookie_name = jQuery( jQuery.parseHTML( response['cbox'] ) ).find( "#wplc_name" ).val();
126
+ var wplc_cookie_email = jQuery( jQuery.parseHTML( response['cbox'] ) ).find( "#wplc_email" ).val();
127
+
128
+ }
129
+
130
+
131
+
132
+ /* is an agent online? */
133
+ if (response['online'] === false) {
134
+ wplc_run = false;
135
+ wplc_online = false;
136
+ ns_obj.o = '0';
137
+
138
+ } else {
139
+ wplc_online = true;
140
+ ns_obj.o = '1';
141
+ }
142
+
143
+
144
+
145
+ if (wplc_filter_run_override !== "1" || wplc_online === false) { wplc_run = false; } else { /* we can run */ }
146
+
147
+
148
+ /* has this user been assigned an agent? */
149
+ if (typeof response['type'] === "undefined") {
150
+ wplc_shown_welcome = false;
151
+ } else {
152
+ if (response['type'] === "returning") {
153
+ wplc_shown_welcome = true;
154
+ /* set the agent vars so we can access them on the fly */
155
+ if (typeof response['agent_data'] !== "undefined") {
156
+ wplc_current_agent = response['agent_data'];
157
+ }
158
+ } else {
159
+ wplc_shown_welcome = false;
160
+ }
161
+
162
+ }
163
+
164
+
165
+ /*Support mobile loggin*/
166
+ var wplc_mobile_check = false;
167
+ if(typeof wplc_is_mobile !== "undefined" && (wplc_is_mobile === "true" || wplc_is_mobile === true)){
168
+ wplc_mobile_check = true;
169
+ }
170
+
171
+ /* start long polling */
172
+ var data = {
173
+ action: 'wplc_call_to_server_visitor',
174
+ security: wplc_nonce,
175
+ cid:wplc_cid,
176
+ wplc_name: wplc_cookie_name,
177
+ wplc_email: wplc_cookie_email,
178
+ status:wplc_chat_status,
179
+ wplcsession:wplc_session_variable,
180
+ wplc_is_mobile: wplc_mobile_check,
181
+ wplc_extra_data:wplc_extra_data
182
+ };
183
+
184
+ if(wplc_server.browserIsSocketReady()){
185
+ data.socket = true;
186
+
187
+ /* load node relay code */
188
+ var nc = document.createElement("script");
189
+ nc.type = "text/javascript";
190
+ nc.async = true;
191
+ nc.src = "https://bleeper.io/app/assets/js/bleeper-dev.js";
192
+ //nc.src = "http://127.0.0.1/nick-bleeper-dev.js";
193
+
194
+ document.getElementsByTagName("head")[0].appendChild(nc);
195
+
196
+ }
197
+
198
+ initial_data = data;
199
+ // ajax long polling function
200
+ if (wplc_filter_run_override !== "1" || wplc_online === false) {
201
+
202
+ wplc_call_to_server_chat(data,true,true);
203
+ } else {
204
+
205
+ wplc_call_to_server_chat(data,true,false);
206
+ }
207
+
208
+ if(wplc_cid !== null && wplc_init_chat_box_check == true && wplc_init_chat_box !== false){
209
+
210
+ wplc_init_chat_box(wplc_cid,wplc_chat_status);
211
+ } else {
212
+ //Node and offline
213
+ if(typeof wplc_use_node_server !== "undefined" && (wplc_use_node_server === "true" || wplc_use_node_server === true)){
214
+
215
+ if(wplc_check_hide_cookie != "yes"){
216
+ wplc_dc = setTimeout(function (){
217
+ wplc_cbox_animation();
218
+ }, parseInt(window.wplc_delay));
219
+ }
220
+ }
221
+ }
222
+
223
+
224
+ }
225
+
226
+ }
227
+
228
+ });
229
+
230
+ /**
231
+ * Preload images from the localized variable
232
+ * @return void
233
+ */
234
+ function wplc_preload() {
235
+ var images = [];
236
+ if (typeof wplc_preload_images !== "undefined" && typeof wplc_preload_images === "object" ) {
237
+ var wplc_i = 0;
238
+ for (var key in wplc_preload_images) {
239
+ if (wplc_preload_images.hasOwnProperty(key)) {
240
+ images[wplc_i] = new Image();
241
+ images[wplc_i].src = wplc_preload_images[key];
242
+ wplc_i++;
243
+ }
244
+ }
245
+ }
246
+ }
247
+
248
+
249
+ /**
250
+ * Detect if the chatbox is being scrolled.
251
+ *
252
+ * This had to be created as jQuery does not allow the scroll event to bubble up the DOM tree.
253
+ *
254
+ * Thank you Bikal Basnet (https://stackoverflow.com/questions/16505182/bind-scroll-event-to-dynamic-div)
255
+ *
256
+ * @param object el The element in question
257
+ */
258
+ function wplc_listenForScrollEvent(el) {
259
+ el.on("scroll", function(){
260
+ el.trigger("wplc-custom-scroll");
261
+ })
262
+
263
+ }
264
+
265
+
266
+
267
+ jQuery("body").on('keyup', '#wplc_email, #wplc_name', function (e) {
268
+ if (e.keyCode == 13) {
269
+ jQuery("#wplc_start_chat_btn").trigger("click")
270
+ }
271
+ });
272
+
273
+ jQuery("body").on("click", "#wplc_end_chat_button", function(e){
274
+ var data = {
275
+ security: wplc_nonce,
276
+ chat_id: wplc_cid,
277
+ agent_id: 0
278
+ };
279
+
280
+ wplc_rest_api('end_chat', data, 12000, null);
281
+
282
+ jQuery.event.trigger({type: "wplc_end_chat_as_user"});
283
+ });
284
+
285
+ jQuery("body").on("click", "#wplc_gdpr_download_data_button", function(e){
286
+ var wplc_init_nonce = jQuery(this).attr('data-wplc-init-nonce');
287
+ var wplc_gdpr_last_cid = jQuery(this).attr('data-wplc-last-cid');
288
+
289
+ if(typeof wplc_gdpr_last_cid !== 'undefined'){
290
+ var reference_href = window.location.href;
291
+ reference_href = reference_href.indexOf("?") !== -1 ? reference_href.substr(0, reference_href.indexOf("?")) : reference_href;
292
+ var download_url = reference_href + "?wplc_action=wplc_gdpr_download_chat_json&wplc_cid=" + wplc_gdpr_last_cid + "&wplc_init_nonce=" + wplc_init_nonce;
293
+ window.open(download_url);
294
+ }
295
+ });
296
+
297
+ jQuery("body").on("click", "#wplc_gdpr_remove_data_button", function(e){
298
+ var current_button = jQuery(this);
299
+
300
+ var wplc_rest_nonce = current_button.attr('data-wplc-rest-nonce');
301
+ var wplc_gdpr_rest_url = current_button.attr('data-wplc-rest-url');
302
+ var wplc_gdpr_last_cid = current_button.attr('data-wplc-last-cid');
303
+
304
+ current_button.text('Processing...');
305
+
306
+ if(typeof wplc_gdpr_last_cid !== 'undefined'){
307
+
308
+ jQuery.ajax({
309
+ url: wplc_gdpr_rest_url + "/delete_chat",
310
+ data: {
311
+ wplc_cid: wplc_gdpr_last_cid,
312
+ _wpnonce: wplc_rest_nonce
313
+ },
314
+ type:"POST",
315
+ complete: function() {
316
+ current_button.text('Complete');
317
+ }
318
+ });
319
+ }
320
+
321
+ });
322
+
323
+ jQuery(document).on("wplc_update_gdpr_last_chat_id", function(e) {
324
+ jQuery('#wplc_gdpr_remove_data_button,#wplc_gdpr_download_data_button').attr('data-wplc-last-cid', wplc_cid);
325
+ });
326
+
327
+
328
+
329
+ // Fix conflict with Responsive Lighbox plugin
330
+ setTimeout(function () {
331
+ if (jQuery('html').hasClass('nivo-lightbox-notouch') || jQuery('a[rel*="lightbox"]').length) {
332
+ jQuery("body").on("keyup", function (event) {
333
+ if (event.keyCode === 13) {
334
+ jQuery("#wplc_send_msg").trigger("click");
335
+ }
336
+ });
337
+ }
338
+ }, 5000);
339
+
340
+ if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
341
+ setTimeout(function () {
342
+ var liveChat4 = jQuery('#wp-live-chat-4');
343
+ var liveChat = jQuery('#wp-live-chat');
344
+ if (!liveChat.hasClass('classic')) {
345
+ jQuery('body').on('click', function (event) {
346
+ if (liveChat.hasClass('mobile-active')) {
347
+ if (event.target.id !== 'wplc_chatmsg' && event.target.className !== 'wdt-emoji-picker') {
348
+ liveChat4.removeClass('is-full-height');
349
+ } else {
350
+ liveChat4.addClass('is-full-height');
351
+ }
352
+ }
353
+ });
354
+ } else {
355
+ jQuery('body').on('click', function (event) {
356
+ if (liveChat.hasClass('mobile-active')) {
357
+ if (event.target.id !== 'wplc_chatmsg' && event.target.className !== 'wdt-emoji-picker') {
358
+ liveChat.removeClass('is-full-height');
359
+ } else {
360
+ liveChat.addClass('is-full-height');
361
+ }
362
+ }
363
+ });
364
+ }
365
+ }, 500);
366
+ }
367
+ });
368
+
369
+
370
+ function wplc_map_node_variables() {
371
+ if (typeof wplc_welcome_msg !== "undefined") {
372
+ welcome_message = wplc_welcome_msg;
373
+ }
374
+ }
375
+
376
+ /**
377
+ * This instantly sends the user the welcome message (i.e. to wait for any agent and start typing so long)
378
+ *
379
+ *
380
+ */
381
+ function wplc_send_welcome_message() {
382
+ if(wplc_welcome_msg !== "" && !wplc_shown_welcome){
383
+ message_class = "wplc_system_notification wplc-color-4";
384
+ var concatenated_message = "<span class='" + message_class + "'>";
385
+ concatenated_message += wplc_welcome_msg;
386
+ concatenated_message += "</span>";
387
+
388
+ if(typeof niftyFormatParser !== "undefined"){
389
+ jQuery("#wplc_chatbox").append(niftyFormatParser(concatenated_message));
390
+ } else{
391
+ jQuery("#wplc_chatbox").append(concatenated_message);
392
+ }
393
+ wplc_scroll_to_bottom();
394
+
395
+ wplc_shown_welcome = true;
396
+ }
397
+
398
+ }
399
+
400
+ jQuery(function(){
401
+ if (wplc_online) {
402
+ jQuery(document).on('click', '#wp-live-chat-header', function() {
403
+ jQuery('#speeching_button').html(wplc_pro_sst1);
404
+ jQuery('#wplc_name').val(wplc_user_default_visitor_name);
405
+ })
406
+ } else {
407
+ jQuery('#wplc_na_msg_btn').val(wplc_pro_offline_btn_send);
408
+ }
409
+ })
410
+
411
+ /**
412
+ * Scrolls the chat box to the bottom
413
+ *
414
+ */
415
+ function wplc_scroll_to_bottom() {
416
+ var height = jQuery('#wplc_chatbox')[0].scrollHeight;
417
+ jQuery('#wplc_chatbox').scrollTop(height);
418
+ }
419
+
420
+
421
+
422
+ function wplc_user_message_receiver(data){
423
+ if(typeof wplc_loop_response_handler !== "undefined" && typeof wplc_loop_response_handler === "function"){
424
+ wplc_loop_response_handler(data, wplc_server_last_loop_data);
425
+ data = JSON.parse(data);
426
+ if(typeof data['status'] !== "undefined"){
427
+ delete wplc_server_last_loop_data.status;
428
+ }
429
+
430
+ if(data.keep_alive === true){
431
+
432
+ setTimeout(function(){
433
+ wplc_server_last_loop_data.status = wplc_chat_status;
434
+ wplc_call_to_server_chat(wplc_server_last_loop_data);
435
+ },100);
436
+ }
437
+ }
438
+ }
439
+
440
+ function wplc_user_retry_handler(data){
441
+ var tstatus = Cookies.get("wplc_chat_status");
442
+
443
+ if (tstatus !== "undefined") {
444
+ if(tstatus !== 8 || tstatus !== 1){
445
+ wplc_retry_interval = setTimeout(function(){
446
+
447
+ wplc_server.prepareTransport(function(){
448
+ //Transport ready...
449
+ wplc_server_last_loop_data.status = parseInt(tstatus); //Set to existing status
450
+ wplc_call_to_server_chat(wplc_server_last_loop_data);
451
+ }, wplc_user_message_receiver, wplc_user_retry_handler, wplc_log_connection_error);
452
+
453
+
454
+ },500);
455
+ }
456
+
457
+ }
458
+ }
459
+
460
+ function wplc_call_to_server_chat(data,first_run,short_poll) {
461
+
462
+ if (typeof wplc_use_node_server !== "undefined" && wplc_use_node_server === "true") {
463
+ //not sending to WP
464
+ return;
465
+ } else {
466
+
467
+
468
+ if (typeof first_run === "undefined") { first_run = false; };
469
+ if (typeof short_poll === "undefined") { short_poll = false; };
470
+ data.first_run = first_run;
471
+ data.short_poll = short_poll;
472
+
473
+ if(typeof Cookies.get('wplc_name') !== "undefined"){
474
+ data.msg_from_print = Cookies.get('wplc_name');
475
+ }
476
+
477
+ wplc_server_last_loop_data = data;
478
+
479
+ wplc_server.send(wplc_ajaxurl, data, "POST", 120000,
480
+ function(response) {
481
+ wplc_long_poll_delay = 1500;
482
+ wplc_loop_response_handler(response, data);
483
+ },
484
+ function(jqXHR, exception) {
485
+ wplc_long_poll_delay = 5000;
486
+
487
+ if (jqXHR.status == 404) {
488
+ wplc_log_connection_error('Error: Requested page not found. [404]');
489
+ wplc_run = false;
490
+ } else if (jqXHR.status == 500) {
491
+ wplc_log_connection_error('Error: Internal Server Error [500].');
492
+ wplc_log_connection_error('Retrying in 5 seconds...');
493
+ wplc_run = true;
494
+ } else if (exception === 'parsererror') {
495
+ wplc_log_connection_error('Error: Requested JSON parse failed.');
496
+ wplc_run = false;
497
+ } else if (exception === 'abort') {
498
+ wplc_log_connection_error('Error: Ajax request aborted.');
499
+ wplc_run = false;
500
+ } else {
501
+ wplc_log_connection_error('Error: Uncaught Error.\n' + jqXHR.responseText);
502
+ wplc_log_connection_error('Retrying in 5 seconds...');
503
+ wplc_run = true;
504
+ }
505
+ },
506
+ function(response){
507
+ if (wplc_run) {
508
+ if(wplc_server.isInSocketMode() === false && wplc_server.isPreparingSocketMode() === false){
509
+ setTimeout(function() {
510
+ wplc_call_to_server_chat(data,false,false);
511
+ }, wplc_long_poll_delay);
512
+ } else if ((wplc_server.isInSocketMode() === false && wplc_server.isPreparingSocketMode() === true) && (typeof wplc_transport_prepared !== "undefined" && wplc_transport_prepared === false)) {
513
+ /* Allows for initiate chat to work on the node server */
514
+ if (typeof wplc_use_node_server !== "undefined" && wplc_use_node_server === "true") {
515
+ /* do not run this if using not the node jedi */
516
+ setTimeout(function() {
517
+ wplc_call_to_server_chat(data,false,true);
518
+ }, 7500);
519
+ }
520
+ } else {
521
+ if(typeof response !== "undefined" && typeof response.responseText !== "undefined" && response.responseText !== ""){
522
+ var response_data = JSON.parse(response.responseText);
523
+ if (typeof wplc_transport_prepared !== "undefined") {
524
+ if(wplc_transport_prepared !== true && (parseInt(response_data.status) === 3 || parseInt(response_data.status) === 2)){
525
+ //Transport is unprepared and the user has returned to the page with a status 3/2
526
+ wplc_server.prepareTransport(function(){
527
+ wplc_call_to_server_chat(data,false,false);
528
+ }, wplc_user_message_receiver, wplc_user_retry_handler, wplc_log_connection_error);
529
+ }
530
+ }
531
+ }
532
+ }
533
+ }
534
+ }
535
+ );
536
+ }
537
+
538
+ };
539
+
540
+ function wplc_loop_response_handler(response, data){
541
+ if(response){
542
+ if (response === "0") { if (window.console) { console.log('WP Live Chat Support Return Error'); } wplc_run = false; return; }
543
+ if (typeof response !== "object") {
544
+ response = JSON.parse(response);
545
+ }
546
+
547
+ data['action_2'] = "";
548
+ if(typeof response['wplc_name'] !== "undefined"){ data['wplc_name'] = response['wplc_name']; /* Cookies.set('wplc_name', response['wplc_name'], { expires: 1, path: '/' });*/ }
549
+ if(typeof response['wplc_email'] !== "undefined"){ data['wplc_email'] = response['wplc_email']; /* Cookies.set('wplc_email', response['wplc_email'], { expires: 1, path: '/' }); */ }
550
+ if(typeof response['cid'] !== "undefined"){ data['cid'] = response['cid']; Cookies.set('wplc_cid', response['cid'], { expires: 1, path: '/' }); }
551
+ if(typeof response['aname'] !== "undefined") { wplc_agent_name = response['aname']; }
552
+ if(typeof response['cid'] !== "undefined" && wplc_cid !== jQuery.trim(response['cid'])){ wplc_cid = jQuery.trim(response['cid']); jQuery("#wplc_cid").val(wplc_cid); }
553
+ if(typeof response['status'] !== "undefined" && parseInt(wplc_chat_status) !== parseInt(response['status'])){
554
+ wplc_chat_status = response['status'];
555
+ Cookies.set('wplc_chat_status', null, { path: '/' });
556
+ Cookies.set('wplc_chat_status', wplc_chat_status, { expires: 1, path: '/' });
557
+ }
558
+
559
+ /* Trigger for handling responses */
560
+ jQuery.event.trigger({type: "wplc_user_chat_loop",response:response});
561
+
562
+ /* Process status changes */
563
+ if(data['status'] == response['status']){
564
+
565
+ if(data['status'] == 5 && wplc_init_chat_box_check === true && wplc_init_chat_box !== false){ // open chat box on load
566
+ wplc_init_chat_box(data['cid'], data['status']);
567
+ }
568
+ if((response['status'] == 3 || response['status'] == 2) && response['data'] != null){ // if active and data is returned
569
+ wplc_run = true;
570
+ var wplc_new_message_sound = false;
571
+ if (typeof response['data'] === "object") {
572
+
573
+ for (var index in response['data']) {
574
+ if(typeof response['data'][index] !== "object"){
575
+ if (typeof msg_history[index] === "undefined") {
576
+ //Not from node
577
+ /* we dont have this message */
578
+ msg_history[index] = true;
579
+
580
+ msg_to_parse = response['data'][index].wplcStripSlashes();
581
+
582
+ if(typeof niftyFormatParser !== "undefined"){
583
+ jQuery("#wplc_chatbox").append(niftyFormatParser(msg_to_parse));
584
+ } else{
585
+
586
+ jQuery("#wplc_chatbox").append(response['data'][index].wplcStripSlashes());
587
+ }
588
+
589
+ wplc_new_message_sound = true;
590
+
591
+ } else {
592
+ /* we already have this message */
593
+ }
594
+ } else {
595
+ var the_message = response['data'][index];
596
+ the_message.mid = index;
597
+ wplc_push_message_to_chatbox(the_message,'u', function() {
598
+ wplc_scroll_to_bottom();
599
+ });
600
+
601
+ wplc_new_message_sound = true;
602
+ }
603
+ }
604
+ }
605
+ else {
606
+ /* backwards compatibility - response['data'] is a string */
607
+ if(typeof niftyFormatParser !== "undefined"){
608
+ jQuery("#wplc_chatbox").append(niftyFormatParser(response['data'].wplcStripSlashes()));
609
+ } else{
610
+ jQuery("#wplc_chatbox").append(response['data'].wplcStripSlashes());
611
+
612
+ }
613
+ wplc_new_message_sound = true;
614
+ }
615
+
616
+ if(wplc_new_message_sound){
617
+ wplc_scroll_to_bottom();
618
+ if (typeof wplc_enable_ding !== 'undefined' && wplc_enable_ding === "1") {
619
+ new Audio(wplc_plugin_url+'ding.mp3').play();
620
+ }
621
+ }
622
+ }
623
+
624
+ } else {
625
+ data['status'] = wplc_chat_status;
626
+ Cookies.set('wplc_chat_status', wplc_chat_status, { expires: 1, path: '/' });
627
+ if(response['status'] == 0 || response['status'] == 12){ // no answer from admin
628
+ jQuery("#wp-live-chat-3").hide();
629
+ if (typeof response['data'] !== "undefined") {
630
+ jQuery("#wplc_chatbox").append(response['data'].wplcStripSlashes()+"<hr />");
631
+ }
632
+
633
+ }
634
+ else if(response['status'] == 8){ // chat has been ended by admin
635
+ wplc_run = false;
636
+
637
+ document.getElementById('wplc_chatmsg').disabled = true;
638
+ wplc_shown_welcome = false;
639
+
640
+ the_message = wplc_generate_system_notification_object(wplc_error_messages.chat_ended_by_operator, {}, 0);
641
+ wplc_push_message_to_chatbox(the_message,'u', function() {
642
+ wplc_scroll_to_bottom();
643
+ });
644
+
645
+
646
+ /*
647
+ if(typeof response['data'] === "object") {
648
+ for (var index in response['data']) {
649
+ if(typeof response['data'][index] === "object"){
650
+
651
+ var the_message = response['data'][index];
652
+ if(typeof the_message.originates !== "undefined"){
653
+ var message_class = "";
654
+ var message_content = "";
655
+
656
+ if (parseInt(the_message.originates) === 0){
657
+ //System Notification
658
+ message_class = "wplc_system_notification wplc-color-4";
659
+ message_content = the_message.msg;
660
+ if(message_content !== ""){
661
+ var concatenated_message = "<span class='" + message_class + "'>";
662
+ concatenated_message += message_content;
663
+ concatenated_message += "</span>";
664
+
665
+ if(typeof niftyFormatParser !== "undefined"){
666
+ jQuery("#wplc_chatbox").append(niftyFormatParser(concatenated_message));
667
+ } else{
668
+ jQuery("#wplc_chatbox").append(concatenated_message);
669
+ }
670
+ }
671
+ }
672
+ }
673
+ }
674
+ }
675
+ } else {
676
+ //Backwards Compat
677
+ jQuery("#wplc_chatbox").append("<em>"+response['data']+"</em><br />");
678
+ }*/
679
+
680
+
681
+
682
+
683
+
684
+ jQuery.event.trigger({type: "wplc_end_chat"});
685
+
686
+ }
687
+ else if(parseInt(response['status']) == 11){ /* use moved on to another page (perhaps in another tab so close this instance */
688
+ jQuery("#wp-live-chat").css({ "display" : "none" });
689
+ wplc_run = false;
690
+ }
691
+ else if(parseInt(response['status']) == 3 || parseInt(response['status']) == 2 || parseInt(response['status']) == 10){ // re-initialize chat
692
+ wplc_run = true;
693
+ if(parseInt(response['status']) == 3) { // only if not minimized open aswell
694
+ /* HERE NODE */
695
+
696
+ if (typeof wplc_use_node_server !== "undefined" && wplc_use_node_server === "true") {
697
+ /* do not run this if using not the node jedi */
698
+
699
+ if (typeof wplc_transport_prepared !== "undefined" && wplc_transport_prepared === false) {
700
+ wplc_server.prepareTransport(function(){
701
+ wplc_call_to_server_chat(wplc_server_last_loop_data,false,false);
702
+ }, wplc_user_message_receiver, wplc_user_retry_handler, wplc_log_connection_error);
703
+ }
704
+ }
705
+ if (!wplc_is_minimized) {
706
+ if (!wplc_is_chat_open) {
707
+ wplc_cbox_animation();
708
+ setTimeout(function() {
709
+ open_chat(0);
710
+ },1500);
711
+ }
712
+ }
713
+
714
+
715
+ if(jQuery('#wp-live-chat').hasClass('wplc_left') === true || jQuery('#wp-live-chat').hasClass('wplc_right') === true){
716
+ //jQuery('#wp-live-chat').height("400px");
717
+ }
718
+ }
719
+ if(parseInt(response['status']) == 10) { // only if not minimized open aswell
720
+ wplc_run = true;
721
+ open_chat(0);
722
+
723
+ }
724
+ if(response['data'] != null){ // append messages to chat area
725
+ if (typeof response['data'] === "object") {
726
+
727
+ for (var index in response['data']) {
728
+ wplc_new_message_sound = false;
729
+ if(typeof response['data'][index] !== "object"){
730
+
731
+ if (typeof msg_history[index] === "undefined") {
732
+ /* we dont have this message */
733
+ msg_history[index] = true;
734
+ if(typeof niftyFormatParser !== "undefined"){
735
+ jQuery("#wplc_chatbox").append(niftyFormatParser(response['data'][index].wplcStripSlashes()));
736
+ } else{
737
+ jQuery("#wplc_chatbox").append(response['data'][index].wplcStripSlashes());
738
+ }
739
+
740
+ wplc_new_message_sound = true;
741
+ } else {
742
+ /* we already have this message */
743
+ }
744
+ } else {
745
+ var the_message = response['data'][index];
746
+ the_message.mid = index;
747
+ wplc_push_message_to_chatbox(the_message,'u', function() {
748
+ wplc_scroll_to_bottom();
749
+ });
750
+
751
+
752
+ }
753
+
754
+ if(wplc_new_message_sound){
755
+ if (response['alert']) {
756
+ jQuery('#wplc-chat-alert').addClass('is-active');
757
+ }
758
+ wplc_scroll_to_bottom();
759
+ if (typeof wplc_enable_ding !== 'undefined' && wplc_enable_ding === "1") {
760
+ new Audio(wplc_plugin_url+'ding.mp3').play();
761
+ }
762
+ }
763
+ }
764
+ }
765
+ else {
766
+ /* backwards compatibility - response['data'] is a string */
767
+ if(typeof niftyFormatParser !== "undefined"){
768
+ jQuery("#wplc_chatbox").append(niftyFormatParser(response['data'].wplcStripSlashes()));
769
+ } else{
770
+ jQuery("#wplc_chatbox").append(response['data'].wplcStripSlashes());
771
+
772
+ }
773
+ }
774
+
775
+ if(response['data']){
776
+ wplc_scroll_to_bottom();
777
+
778
+ }
779
+ }
780
+ }
781
+ }
782
+ }
783
+ }
784
+
785
+
786
+
787
+ function wplc_log_connection_error(error){
788
+ if (window.console) { console.log(error); }
789
+
790
+ jQuery("#wplc_chatbox").append("<small>" + error + "</small><br>");
791
+ wplc_scroll_to_bottom();
792
+ }
793
+
794
+ function wplc_display_error(error) {
795
+
796
+ the_message = {};
797
+ the_message.originates = 2;
798
+ the_message.msg = error;
799
+ the_message.other = {};
800
+ var wplc_d = new Date();
801
+ the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
802
+ wplc_push_message_to_chatbox(the_message,'u', function() {
803
+ wplc_scroll_to_bottom();
804
+ });
805
+
806
+
807
+
808
+ }
809
+
810
+ var wplc_init_chat_box = function(cid, status){
811
+ if(wplc_chat_status == 9 && wplc_check_hide_cookie == "yes"){
812
+ } else if (wplc_chat_status === 3) {
813
+ wplc_cbox_animation();
814
+ } else {
815
+
816
+ if(wplc_check_hide_cookie != "yes"){
817
+ wplc_dc = setTimeout(function (){
818
+ wplc_cbox_animation();
819
+ }, parseInt(window.wplc_delay));
820
+ }
821
+ }
822
+ wplc_init_chat_box = false;
823
+ jQuery.event.trigger({type: "wplc_init_complete"});
824
+ }
825
+
826
+ function wplc_cbox_animation() {
827
+ /*
828
+ * 1- Slide Up
829
+ * 2- Slide Across (Left/Right)
830
+ * 3- Slide Down
831
+ * 4- Fade In
832
+ */
833
+
834
+
835
+ var wplc_window_id = jQuery("#wp-live-chat");
836
+
837
+ var wplc_theme_chosen = jQuery(wplc_window_id).attr('wplc_animation');
838
+
839
+ switch(wplc_theme_chosen){
840
+ case 'none':
841
+ jQuery(wplc_window_id).css('display', 'block');
842
+ break;
843
+ case 'animation-1':
844
+ // Slide Up
845
+ jQuery(wplc_window_id).animate({'marginBottom' : '0px'}, 1000);
846
+ break;
847
+ case 'animation-2-bl':
848
+ // Slide Accross from left
849
+ jQuery(wplc_window_id).animate({'left' : '20px'}, 1000);
850
+ break;
851
+ case 'animation-2-br':
852
+ // Slide Accross from right
853
+ jQuery(wplc_window_id).animate({'right' : '20px'}, 1000);
854
+ break;
855
+ case 'animation-2-l':
856
+ // Slide Accross from left
857
+ jQuery(wplc_window_id).animate({"left" : '0px'}, 1000);
858
+ break;
859
+ case 'animation-2-r':
860
+
861
+ // Slide Accross from right
862
+ jQuery(wplc_window_id).animate({'right' : '0px'}, 1000);
863
+ break;
864
+ case 'animation-3':
865
+ // Fade In
866
+ jQuery(wplc_window_id).fadeIn('slow');
867
+ case 'animation-4':
868
+ jQuery(wplc_window_id).css('display', 'block');
869
+ break;
870
+ default:
871
+ jQuery(wplc_window_id).css('display', 'block');
872
+ break;
873
+ }
874
+
875
+ //jQuery("#wp-live-chat").css({ "display" : "block" });
876
+ if(jQuery("#wp-live-chat").attr('wplc-auto-pop-up') === "1"){
877
+
878
+ var wplc_force_must_min = Cookies.get('wplc_minimize');
879
+ if(wplc_force_must_min === 'yes'){
880
+ /* User has actively chosen to minimize the chat, leave it alone */
881
+ } else {
882
+ setTimeout(function(){
883
+ open_chat(0);
884
+ },1000);
885
+ /**
886
+ * Adding this fixes the bug that stops the chat window from opening when an agent initialises a chat with a user
887
+ *
888
+ * Reasoning: when running open_chat(), wplc_is_chat_open is set to TRUE at the end of the function, and stops any future request to open_chat();
889
+ *
890
+ */
891
+ wplc_is_chat_open = false;
892
+ }
893
+ }
894
+
895
+ jQuery.event.trigger({type: "wplc_animation_done"});
896
+ }
897
+
898
+
899
+ function wplc_sound(source,volume,loop) {
900
+ this.source=source;
901
+ this.volume=volume;
902
+ this.loop=loop;
903
+ var son;
904
+ this.son=son;
905
+ this.finish=false;
906
+ this.stop=function()
907
+ {
908
+ document.body.removeChild(this.son);
909
+ }
910
+ this.start=function()
911
+ {
912
+ if(this.finish)return false;
913
+ this.son=document.createElement("embed");
914
+ this.son.setAttribute("src",this.source);
915
+ this.son.setAttribute("hidden","true");
916
+ this.son.setAttribute("volume",this.volume);
917
+ this.son.setAttribute("autostart","true");
918
+ this.son.setAttribute("loop",this.loop);
919
+ document.body.appendChild(this.son);
920
+ }
921
+ this.remove=function()
922
+ {
923
+ document.body.removeChild(this.son);
924
+ this.finish=true;
925
+ }
926
+ this.init=function(volume,loop)
927
+ {
928
+ this.finish=false;
929
+ this.volume=volume;
930
+ this.loop=loop;
931
+ }
932
+ }
933
+
934
+
935
+ function wplc_strip(str) {
936
+ str=str.replace(/<br>/gi, "\n");
937
+ str=str.replace(/<p.*>/gi, "\n");
938
+ str=str.replace(/<a.*href="(.*?)".*>(.*?)<\/a>/gi, " $2 ($1) ");
939
+ str=str.replace(/<(?:.|\s)*?>/g, "");
940
+
941
+ str=str.replace('iframe', "");
942
+ str=str.replace('src', "");
943
+ str=str.replace('href', "");
944
+ str=str.replace('<', "");
945
+ str=str.replace('>', "");
946
+
947
+ /* remove the last carriage return from the text area output */
948
+ str=str.replace(/\n$/, "")
949
+
950
+ return str;
951
+ }
952
+
953
+ (function($) {
954
+
955
+ $(function(event) {
956
+
957
+ if(!window.wdtEmojiBundle)
958
+ return;
959
+
960
+ $(document.body).on("click", function(event) {
961
+
962
+ // If click event isn't on the emoji window, or the emoji open button, close the emoji window
963
+ if($(event.target).closest(".wdt-emoji-picker, .wdt-emoji-popup").length == 0 && !(
964
+ event.target.parentNode == null && $(event.target).hasClass("fa-smile-o")
965
+ ))
966
+ wdtEmojiBundle.close();
967
+
968
+ });
969
+
970
+ // Close emoji window on scroll
971
+ $(window).scroll(function(event) {
972
+ wdtEmojiBundle.close();
973
+ });
974
+ });
975
+
976
+ })(jQuery);
js/wplc_u.min.js CHANGED
@@ -1 +1 @@
1
- var wplc_is_chat_open=!1;jQuery(document).ready(function(){function n(a,c,e){"undefined"==typeof c&&(c=!1),"undefined"==typeof e&&(e=!1),a.first_run=c,a.short_poll=e,jQuery.ajax({url:wplc_ajaxurl,data:a,type:"POST",success:function(c){if(k=1500,c){if("0"===c)return window.console&&console.log("WP Live Chat Support Return Error"),void(l=!1);if(c=JSON.parse(c),a.wplc_name=c.wplc_name,a.wplc_email=c.wplc_email,a.action_2="",a.cid=c.cid,Cookies.set("wplc_cid",c.cid,{expires:1,path:"/"}),Cookies.set("wplc_name",c.wplc_name,{expires:1,path:"/"}),Cookies.set("wplc_email",c.wplc_email,{expires:1,path:"/"}),b=jQuery.trim(c.cid),d=c.status,Cookies.set("wplc_chat_status",null,{path:"/"}),Cookies.set("wplc_chat_status",d,{expires:1,path:"/"}),jQuery.event.trigger({type:"wplc_user_chat_loop",response:c}),a.status==c.status){if(5==a.status&&g===!0&&q!==!1&&q(a.cid,a.status),3==c.status&&null!=c.data&&(l=!0,"undefined"!=typeof niftyFormatParser?jQuery("#wplc_chatbox").append(niftyFormatParser(c.data.wplcStripSlashes())):jQuery("#wplc_chatbox").append(c.data.wplcStripSlashes()),c.data)){var e=jQuery("#wplc_chatbox")[0].scrollHeight;jQuery("#wplc_chatbox").scrollTop(e),"undefined"!=typeof wplc_enable_ding&&"1"===wplc_enable_ding&&new Audio(wplc_plugin_url+"/wp-live-chat-support/ding.mp3").play()}}else if(a.status=d,Cookies.set("wplc_chat_status",d,{expires:1,path:"/"}),0==c.status)jQuery("#wp-live-chat-3").hide(),jQuery("#wp-live-chat-react").show().empty().append("<center>"+c.data+"</center>");else if(8==c.status){l=!1,jQuery("#wp-live-chat-minimize").show(),document.getElementById("wplc_chatmsg").disabled=!0,jQuery("#wplc_chatbox").append("<em>"+c.data+"</em><br />");var e=jQuery("#wplc_chatbox")[0].scrollHeight;jQuery("#wplc_chatbox").scrollTop(e),jQuery.event.trigger({type:"wplc_end_chat"})}else if(11==parseInt(c.status))jQuery("#wp-live-chat").css({display:"none"}),l=!1;else if((3==parseInt(c.status)||10==parseInt(c.status))&&(l=!0,jQuery("#wplc_cid").val(b),3==parseInt(c.status)&&(s(0),jQuery("#wp-live-chat").hasClass("wplc_left")!==!0&&jQuery("#wp-live-chat").hasClass("wplc_right")!==!0||jQuery("#wp-live-chat").height("400px")),10==parseInt(c.status)&&(l=!0,s(0)),null!=c.data&&("undefined"!=typeof niftyFormatParser?jQuery("#wplc_chatbox").append(niftyFormatParser(c.data.wplcStripSlashes())):jQuery("#wplc_chatbox").append(c.data.wplcStripSlashes()),c.data))){var e=jQuery("#wplc_chatbox")[0].scrollHeight;jQuery("#wplc_chatbox").scrollTop(e)}}},error:function(a,b){k=5e3,404==a.status?(o("Error: Requested page not found. [404]"),l=!1):500==a.status?(o("Error: Internal Server Error [500]."),o("Retrying in 5 seconds..."),l=!0):"parsererror"===b?(o("Error: Requested JSON parse failed."),l=!1):"abort"===b?(o("Error: Ajax request aborted."),l=!1):(o("Error: Uncaught Error.\n"+a.responseText),o("Retrying in 5 seconds..."),l=!0)},complete:function(b){l&&setTimeout(function(){n(a,!1,!1)},k)},timeout:12e4})}function o(a){window.console&&console.log(a),jQuery("#wplc_chatbox").append("<small>"+a+"</small><br>");var b=jQuery("#wplc_chatbox")[0].scrollHeight;jQuery("#wplc_chatbox").scrollTop(b)}function q(a,b){9==d&&"yes"==c||"yes"!=c&&(wplc_dc=setTimeout(function(){var a=jQuery("#wp-live-chat"),b=jQuery(a).attr("wplc_animation");switch(b){case"none":jQuery(a).css("display","block");break;case"animation-1":jQuery(a).animate({marginBottom:"0px"},1e3);break;case"animation-2-bl":jQuery(a).animate({left:"100px"},1e3);break;case"animation-2-br":jQuery(a).animate({right:"100px"},1e3);break;case"animation-2-l":jQuery(a).animate({left:"0px"},1e3);break;case"animation-2-r":jQuery(a).animate({right:"0px"},1e3);break;case"animation-3":jQuery(a).fadeIn("slow");case"animation-4":jQuery(a).css("display","block");break;default:jQuery(a).css("display","block")}"1"===jQuery("#wp-live-chat").attr("wplc-auto-pop-up")&&s(0),jQuery.event.trigger({type:"wplc_animation_done"})},parseInt(window.wplc_delay))),q=!1}function s(a){if(jQuery.event.trigger({type:"wplc_open_chat_1"}),d=Cookies.get("wplc_chat_status"),3==parseInt(d)){jQuery.event.trigger({type:"wplc_open_chat_2",wplc_online:h}),Cookies.set("wplc_had_chat",!0,{path:"/"});var c={action:"wplc_user_maximize_chat",security:wplc_nonce,cid:b};jQuery.post(wplc_ajaxurl,c,function(a){})}else if(10==parseInt(d))jQuery("#wp-live-chat-minimize").trigger("click");else if(5==d||9==d||8==d){if(jQuery("#wp-live-chat-2").is(":visible")===!1&&jQuery("#wp-live-chat-4").is(":visible")===!1){jQuery("#wp-live-chat-2").show();var e=Cookies.get("wplc_name");"no email set"!==Cookies.get("wplc_email")&&e.indexOf("user")>=0&&(jQuery("#wplc_name").val(Cookies.get("wplc_name")),jQuery("#wplc_email").val(Cookies.get("wplc_email")))}}else if(2==d)jQuery("#wp-live-chat-3").show();else if(1==d){jQuery("#wp-live-chat-4").show(),jQuery("#wplc_social_holder").show(),jQuery("#nifty_ratings_holder").show(),jQuery.event.trigger({type:"wplc_animation_done"}),jQuery("#wplc_chatbox").append("The chat has been ended by the operator.<br />");var f=jQuery("#wplc_chatbox")[0].scrollHeight;jQuery("#wplc_chatbox").scrollTop(f),jQuery("#wp-live-chat-minimize").hide(),document.getElementById("wplc_chatmsg").disabled=!0}}function t(a){return a=a.replace(/<br>/gi,"\n"),a=a.replace(/<p.*>/gi,"\n"),a=a.replace(/<a.*href="(.*?)".*>(.*?)<\/a>/gi," $2 ($1) "),a=a.replace(/<(?:.|\s)*?>/g,""),a=a.replace("iframe",""),a=a.replace("src",""),a=a.replace("href",""),a=a.replace("<",""),a=a.replace(">","")}function u(a,b){"undefined"!=typeof d.length&&d.length>0&&(10!==parseInt(d)&&7!==parseInt(d)||Cookies.set("wplc_chat_status",3,{expires:1,path:"/"}),0===parseInt(d)&&Cookies.set("wplc_chat_status",5,{expires:1,path:"/"}),8===parseInt(d)&&Cookies.set("wplc_chat_status",5,{expires:1,path:"/"})),b()}var b,c,a=(new Date).getTime(),d="",e="",f="",g=!0,b=null,h=!1,i={},k=1500;b=Cookies.get("wplc_cid"),b="undefined"==typeof b?null:Cookies.get("wplc_cid"),c=Cookies.get("wplc_hide"),wplc_check_minimize_cookie=Cookies.get("wplc_minimize"),d=Cookies.get("wplc_chat_status"),e=Cookies.get("wplc_name"),f=Cookies.get("wplc_email"),Cookies.set("wplc_chat_status",5,{expires:1,path:"/"}),d=5;var l=!0,m={action:"wplc_get_chat_box",security:wplc_nonce};if(jQuery.ajax({url:wplc_ajaxurl_site,data:m,type:"POST",success:function(c){if(c){if("0"===c)return window.console&&console.log("WP Live Chat Support Return Error"),void(l=!1);if(c=JSON.parse(c),jQuery("body").append(c.cbox),"undefined"==typeof e||"undefined"==typeof f)var e=jQuery(jQuery.parseHTML(c.cbox)).find("#wplc_name").val(),f=jQuery(jQuery.parseHTML(c.cbox)).find("#wplc_email").val();c.online===!1?(l=!1,h=!1):h=!0,"1"===wplc_filter_run_override&&h!==!1||(l=!1);var j=!1;"undefined"==typeof wplc_is_mobile||"true"!==wplc_is_mobile&&wplc_is_mobile!==!0||(j=!0);var k={action:"wplc_call_to_server_visitor",security:wplc_nonce,cid:b,wplc_name:e,wplc_email:f,status:d,wplcsession:a,wplc_is_mobile:j,wplc_extra_data:wplc_extra_data};i=k,"1"!==wplc_filter_run_override||h===!1?n(k,!0,!0):n(k,!0,!1),null!==b&&1==g&&q!==!1&&q(b,d)}}}),jQuery("#wp-live-chat [placeholder]").focus(function(){var a=jQuery(this);a.val()==a.attr("placeholder")&&(a.val(""),a.removeClass("placeholder"))}).blur(function(){var a=jQuery(this);""!=a.val()&&a.val()!=a.attr("placeholder")||(a.addClass("placeholder"),a.val(a.attr("placeholder")))}).blur(),jQuery("body").on("click","#wp-live-chat-minimize",function(){if(jQuery.event.trigger({type:"wplc_minimize_chat"}),Cookies.set("wplc_minimize","yes",{expires:1,path:"/"}),d=Cookies.get("wplc_chat_status"),5!=d&&10!=d&&9!=d&&8!=d){var a={action:"wplc_user_minimize_chat",security:wplc_nonce,cid:b};jQuery.post(wplc_ajaxurl,a,function(a){})}}),jQuery("body").on("click","#wp-live-chat-close",function(){if(jQuery("#wp-live-chat").hide(),jQuery("#wp-live-chat-1").hide(),jQuery("#wp-live-chat-2").hide(),jQuery("#wp-live-chat-3").hide(),jQuery("#wp-live-chat-4").hide(),jQuery("#wplc_social_holder").hide(),jQuery("#nifty_ratings_holder").hide(),jQuery("#wp-live-chat-react").hide(),jQuery("#wp-live-chat-minimize").hide(),"undefined"!=typeof wplc_hide_chat&&""!==wplc_hide_chat&&null!==wplc_hide_chat)Cookies.set("wplc_hide",wplc_hide_chat,{expires:1,path:"/"});else{var a=new Date,c=2;a.setTime(a.getTime()+60*c*1e3),Cookies.set("wplc_hide","yes",{expires:a,path:"/"})}var e={action:"wplc_user_close_chat",security:wplc_nonce,cid:b,status:d};jQuery.post(wplc_ajaxurl,e,function(a){})}),jQuery("body").on("click",".wp-live-chat-now",function(){s(0)}),jQuery("body").on("click","#wplc_start_chat_btn",function(){var c=jQuery("#wplc_name").val(),d=jQuery("#wplc_email").val();if(c.length<=0)return alert("Please enter your name"),!1;if(d.length<=0)return alert("Please enter your email address"),!1;if("1"!==jQuery("#wplc_email").attr("wplc_hide")){var e=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(!e.test(d))return alert("Please Enter a Valid Email Address"),!1}l=!0,"1"===wplc_filter_run_override||h===!1||(i.status=2,n(i,!1,!1)),jQuery.event.trigger({type:"wplc_start_chat"});var f=new Date;if(f.setTime(f.getTime()+12e4),b=Cookies.get("wplc_cid"),"undefined"!=typeof b&&null!==b)var g={action:"wplc_start_chat",security:wplc_nonce,name:c,email:d,cid:b,wplcsession:a,wplc_extra_data:wplc_extra_data};else var g={action:"wplc_start_chat",security:wplc_nonce,name:c,email:d,wplcsession:a,wplc_extra_data:wplc_extra_data};jQuery.post(wplc_ajaxurl,g,function(a){Cookies.set("wplc_chat_status",2,{expires:f,path:"/"}),Cookies.set("wplc_name",c,{path:"/"}),Cookies.set("wplc_email",d,{path:"/"}),b=jQuery.trim(a)})}),jQuery("body").on("click","#wplc_na_msg_btn",function(){var a=jQuery("#wplc_name").val(),c=jQuery("#wplc_email").val(),d=jQuery("#wplc_message").val(),e=jQuery("#wplc_domain_offline").val(),f=jQuery("#wplc_ip_address").val();if(a.length<=0)return alert("Please enter your name"),!1;if(c.length<=0)return alert("Please enter your email address"),!1;var g=/^[A-Z0-9._%+-]+@([A-Z0-9-]+\.)+[A-Z]{2,4}$/i;if(!g.test(c))return alert("Please Enter a Valid Email Address"),!1;if(d.length<=0)return alert("Please enter a message"),!1;jQuery("#wp-live-chat-2-info").hide(),jQuery("#wplc_message_div").html(wplc_offline_msg),b=Cookies.get("wplc_cid");var h={action:"wplc_user_send_offline_message",security:wplc_nonce,cid:b,name:a,email:c,msg:d,ip:f,domain:e,wplc_extra_data:wplc_extra_data};jQuery.post(wplc_ajaxurl_site,h,function(a){jQuery("#wplc_message_div").html(wplc_offline_msg3)})}),jQuery("body").on("keyup","#wplc_chatmsg",function(a){13===a.keyCode&&jQuery("#wplc_send_msg").trigger("click")}),jQuery("body").on("click","#wplc_send_msg",function(){var a=jQuery("#wplc_cid").val(),b=t(document.getElementById("wplc_chatmsg").value),c=jQuery("#wplc_name").val();"undefined"!=typeof c&&null!=c&&""!=c||(c=Cookies.get("wplc_name"));var d=jQuery("#wplc_email").val();"undefined"!=typeof d&&null!=d&&""!=d||(d=Cookies.get("wplc_email")),jQuery("#wplc_chatmsg").val("");var e=b;"undefined"!=typeof niftyFormatParser&&(e=niftyFormatParser(e)),"display"==wplc_display_name?wplc_gravatar_image.length>1?jQuery("#wplc_chatbox").append("<span class='wplc-user-message xcvxxcv wplc-color-bg-1 wplc-color-2 wplc-color-border-1'>"+wplc_gravatar_image+" <strong>"+c+"</strong>: "+e+"</span><br /><div class='wplc-clear-float-message'></div>"):jQuery("#wplc_chatbox").append("<span class='wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1'><img src='//www.gravatar.com/avatar/"+md5(d)+"?s=30' class='wplc-user-message-avatar' /> <strong>"+c+"</strong>: "+e+"</span><br /><div class='wplc-clear-float-message'></div>"):jQuery("#wplc_chatbox").append("<span class='wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1'>"+e+"</span><div class='wplc-clear-float-message'></div>");var f=jQuery("#wplc_chatbox")[0].scrollHeight;jQuery("#wplc_chatbox").scrollTop(f);var g={action:"wplc_user_send_msg",security:wplc_nonce,cid:a,msg:b,wplc_extra_data:wplc_extra_data};jQuery.post(wplc_ajaxurl,g,function(a){})}),jQuery(document).on("wplc_open_chat",function(a){d=Cookies.get("wplc_chat_status");u(status,function(){s()})}),String.prototype.wplcStripSlashes=function(){return this.replace(/\\(.)/gm,"$1")},"undefined"!=typeof wplc_elem_trigger_id&&""!==wplc_elem_trigger_id){var v=0,w=0;"undefined"!=typeof wplc_elem_trigger_action&&""!==wplc_elem_trigger_action&&(v=parseInt(wplc_elem_trigger_action)),"undefined"!=typeof wplc_elem_trigger_type&&""!==wplc_elem_trigger_type&&(w=parseInt(wplc_elem_trigger_type)),jQuery((1===w?"#":".")+wplc_elem_trigger_id).on(1===v?"mouseenter":"click",function(){s(0)})}});
1
+ var wplc_is_chat_open=!1;jQuery(function(){function n(a,c,e){"undefined"==typeof c&&(c=!1),"undefined"==typeof e&&(e=!1),a.first_run=c,a.short_poll=e,jQuery.ajax({url:wplc_ajaxurl,data:a,type:"POST",success:function(c){if(k=1500,c){if("0"===c)return window.console&&console.log("WP Live Chat Support Return Error"),void(l=!1);if(c=JSON.parse(c),a.wplc_name=c.wplc_name,a.wplc_email=c.wplc_email,a.action_2="",a.cid=c.cid,Cookies.set("wplc_cid",c.cid,{expires:1,path:"/"}),Cookies.set("wplc_name",c.wplc_name,{expires:1,path:"/"}),Cookies.set("wplc_email",c.wplc_email,{expires:1,path:"/"}),b=jQuery.trim(c.cid),d=c.status,Cookies.set("wplc_chat_status",null,{path:"/"}),Cookies.set("wplc_chat_status",d,{expires:1,path:"/"}),jQuery.event.trigger({type:"wplc_user_chat_loop",response:c}),a.status==c.status){if(5==a.status&&g===!0&&q!==!1&&q(a.cid,a.status),3==c.status&&null!=c.data&&(l=!0,"undefined"!=typeof niftyFormatParser?jQuery("#wplc_chatbox").append(niftyFormatParser(c.data.wplcStripSlashes())):jQuery("#wplc_chatbox").append(c.data.wplcStripSlashes()),c.data)){var e=jQuery("#wplc_chatbox")[0].scrollHeight;jQuery("#wplc_chatbox").scrollTop(e),"undefined"!=typeof wplc_enable_ding&&"1"===wplc_enable_ding&&new Audio(wplc_plugin_url+"/wp-live-chat-support/ding.mp3").play()}}else if(a.status=d,Cookies.set("wplc_chat_status",d,{expires:1,path:"/"}),0==c.status)jQuery("#wp-live-chat-3").hide(),jQuery("#wp-live-chat-react").show().empty().append("<center>"+c.data+"</center>");else if(8==c.status){l=!1,jQuery("#wp-live-chat-minimize").show(),document.getElementById("wplc_chatmsg").disabled=!0,jQuery("#wplc_chatbox").append("<em>"+c.data+"</em><br />");var e=jQuery("#wplc_chatbox")[0].scrollHeight;jQuery("#wplc_chatbox").scrollTop(e),jQuery.event.trigger({type:"wplc_end_chat"})}else if(11==parseInt(c.status))jQuery("#wp-live-chat").css({display:"none"}),l=!1;else if((3==parseInt(c.status)||10==parseInt(c.status))&&(l=!0,jQuery("#wplc_cid").val(b),3==parseInt(c.status)&&(s(0),jQuery("#wp-live-chat").hasClass("wplc_left")!==!0&&jQuery("#wp-live-chat").hasClass("wplc_right")!==!0||jQuery("#wp-live-chat").height("400px")),10==parseInt(c.status)&&(l=!0,s(0)),null!=c.data&&("undefined"!=typeof niftyFormatParser?jQuery("#wplc_chatbox").append(niftyFormatParser(c.data.wplcStripSlashes())):jQuery("#wplc_chatbox").append(c.data.wplcStripSlashes()),c.data))){var e=jQuery("#wplc_chatbox")[0].scrollHeight;jQuery("#wplc_chatbox").scrollTop(e)}}},error:function(a,b){k=5e3,404==a.status?(o("Error: Requested page not found. [404]"),l=!1):500==a.status?(o("Error: Internal Server Error [500]."),o("Retrying in 5 seconds..."),l=!0):"parsererror"===b?(o("Error: Requested JSON parse failed."),l=!1):"abort"===b?(o("Error: Ajax request aborted."),l=!1):(o("Error: Uncaught Error.\n"+a.responseText),o("Retrying in 5 seconds..."),l=!0)},complete:function(b){l&&setTimeout(function(){n(a,!1,!1)},k)},timeout:12e4})}function o(a){window.console&&console.log(a),jQuery("#wplc_chatbox").append("<small>"+a+"</small><br>");var b=jQuery("#wplc_chatbox")[0].scrollHeight;jQuery("#wplc_chatbox").scrollTop(b)}function q(a,b){9==d&&"yes"==c||"yes"!=c&&(wplc_dc=setTimeout(function(){var a=jQuery("#wp-live-chat"),b=jQuery(a).attr("wplc_animation");switch(b){case"none":jQuery(a).css("display","block");break;case"animation-1":jQuery(a).animate({marginBottom:"0px"},1e3);break;case"animation-2-bl":jQuery(a).animate({left:"100px"},1e3);break;case"animation-2-br":jQuery(a).animate({right:"100px"},1e3);break;case"animation-2-l":jQuery(a).animate({left:"0px"},1e3);break;case"animation-2-r":jQuery(a).animate({right:"0px"},1e3);break;case"animation-3":jQuery(a).fadeIn("slow");case"animation-4":jQuery(a).css("display","block");break;default:jQuery(a).css("display","block")}"1"===jQuery("#wp-live-chat").attr("wplc-auto-pop-up")&&s(0),jQuery.event.trigger({type:"wplc_animation_done"})},parseInt(window.wplc_delay))),q=!1}function s(a){if(jQuery.event.trigger({type:"wplc_open_chat_1"}),d=Cookies.get("wplc_chat_status"),3==parseInt(d)){jQuery.event.trigger({type:"wplc_open_chat_2",wplc_online:h}),Cookies.set("wplc_had_chat",!0,{path:"/"});var c={action:"wplc_user_maximize_chat",security:wplc_nonce,cid:b};jQuery.post(wplc_ajaxurl,c,function(a){})}else if(10==parseInt(d))jQuery("#wp-live-chat-minimize").trigger("click");else if(5==d||9==d||8==d){if(jQuery("#wp-live-chat-2").is(":visible")===!1&&jQuery("#wp-live-chat-4").is(":visible")===!1){jQuery("#wp-live-chat-2").show();var e=Cookies.get("wplc_name");"no email set"!==Cookies.get("wplc_email")&&e.indexOf("user")>=0&&(jQuery("#wplc_name").val(Cookies.get("wplc_name")),jQuery("#wplc_email").val(Cookies.get("wplc_email")))}}else if(2==d)jQuery("#wp-live-chat-3").show();else if(1==d){jQuery("#wp-live-chat-4").show(),jQuery("#wplc_social_holder").show(),jQuery("#nifty_ratings_holder").show(),jQuery.event.trigger({type:"wplc_animation_done"}),jQuery("#wplc_chatbox").append("The chat has been ended by the operator.<br />");var f=jQuery("#wplc_chatbox")[0].scrollHeight;jQuery("#wplc_chatbox").scrollTop(f),jQuery("#wp-live-chat-minimize").hide(),document.getElementById("wplc_chatmsg").disabled=!0}}function t(a){return a=a.replace(/<br>/gi,"\n"),a=a.replace(/<p.*>/gi,"\n"),a=a.replace(/<a.*href="(.*?)".*>(.*?)<\/a>/gi," $2 ($1) "),a=a.replace(/<(?:.|\s)*?>/g,""),a=a.replace("iframe",""),a=a.replace("src",""),a=a.replace("href",""),a=a.replace("<",""),a=a.replace(">","")}function u(a,b){"undefined"!=typeof d.length&&d.length>0&&(10!==parseInt(d)&&7!==parseInt(d)||Cookies.set("wplc_chat_status",3,{expires:1,path:"/"}),0===parseInt(d)&&Cookies.set("wplc_chat_status",5,{expires:1,path:"/"}),8===parseInt(d)&&Cookies.set("wplc_chat_status",5,{expires:1,path:"/"})),b()}var b,c,a=(new Date).getTime(),d="",e="",f="",g=!0,b=null,h=!1,i={},k=1500;b=Cookies.get("wplc_cid"),b="undefined"==typeof b?null:Cookies.get("wplc_cid"),c=Cookies.get("wplc_hide"),wplc_check_minimize_cookie=Cookies.get("wplc_minimize"),d=Cookies.get("wplc_chat_status"),e=Cookies.get("wplc_name"),f=Cookies.get("wplc_email"),Cookies.set("wplc_chat_status",5,{expires:1,path:"/"}),d=5;var l=!0,m={action:"wplc_get_chat_box",security:wplc_nonce};if(jQuery.ajax({url:wplc_ajaxurl_site,data:m,type:"POST",success:function(c){if(c){if("0"===c)return window.console&&console.log("WP Live Chat Support Return Error"),void(l=!1);if(c=JSON.parse(c),jQuery("body").append(c.cbox),"undefined"==typeof e||"undefined"==typeof f)var e=jQuery(jQuery.parseHTML(c.cbox)).find("#wplc_name").val(),f=jQuery(jQuery.parseHTML(c.cbox)).find("#wplc_email").val();c.online===!1?(l=!1,h=!1):h=!0,"1"===wplc_filter_run_override&&h!==!1||(l=!1);var j=!1;"undefined"==typeof wplc_is_mobile||"true"!==wplc_is_mobile&&wplc_is_mobile!==!0||(j=!0);var k={action:"wplc_call_to_server_visitor",security:wplc_nonce,cid:b,wplc_name:e,wplc_email:f,status:d,wplcsession:a,wplc_is_mobile:j,wplc_extra_data:wplc_extra_data};i=k,"1"!==wplc_filter_run_override||h===!1?n(k,!0,!0):n(k,!0,!1),null!==b&&1==g&&q!==!1&&q(b,d)}}}),jQuery("#wp-live-chat [placeholder]").focus(function(){var a=jQuery(this);a.val()==a.attr("placeholder")&&(a.val(""),a.removeClass("placeholder"))}).blur(function(){var a=jQuery(this);""!=a.val()&&a.val()!=a.attr("placeholder")||(a.addClass("placeholder"),a.val(a.attr("placeholder")))}).blur(),jQuery("body").on("click","#wp-live-chat-minimize",function(){if(jQuery.event.trigger({type:"wplc_minimize_chat"}),Cookies.set("wplc_minimize","yes",{expires:1,path:"/"}),d=Cookies.get("wplc_chat_status"),5!=d&&10!=d&&9!=d&&8!=d){var a={action:"wplc_user_minimize_chat",security:wplc_nonce,cid:b};jQuery.post(wplc_ajaxurl,a,function(a){})}}),jQuery("body").on("click","#wp-live-chat-close",function(){if(jQuery("#wp-live-chat").hide(),jQuery("#wp-live-chat-1").hide(),jQuery("#wp-live-chat-2").hide(),jQuery("#wp-live-chat-3").hide(),jQuery("#wp-live-chat-4").hide(),jQuery("#wplc_social_holder").hide(),jQuery("#nifty_ratings_holder").hide(),jQuery("#wp-live-chat-react").hide(),jQuery("#wp-live-chat-minimize").hide(),"undefined"!=typeof wplc_hide_chat&&""!==wplc_hide_chat&&null!==wplc_hide_chat)Cookies.set("wplc_hide",wplc_hide_chat,{expires:1,path:"/"});else{var a=new Date,c=2;a.setTime(a.getTime()+60*c*1e3),Cookies.set("wplc_hide","yes",{expires:a,path:"/"})}var e={action:"wplc_user_close_chat",security:wplc_nonce,cid:b,status:d};jQuery.post(wplc_ajaxurl,e,function(a){})}),jQuery("body").on("click",".wp-live-chat-now",function(){s(0)}),jQuery("body").on("click","#wplc_start_chat_btn",function(){var c=jQuery("#wplc_name").val(),d=jQuery("#wplc_email").val();if(c.length<=0)return alert("Please enter your name"),!1;if(d.length<=0)return alert("Please enter your email address"),!1;if("1"!==jQuery("#wplc_email").attr("wplc_hide")){var e=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(!e.test(d))return alert("Please Enter a Valid Email Address"),!1}l=!0,"1"===wplc_filter_run_override||h===!1||(i.status=2,n(i,!1,!1)),jQuery.event.trigger({type:"wplc_start_chat"});var f=new Date;if(f.setTime(f.getTime()+12e4),b=Cookies.get("wplc_cid"),"undefined"!=typeof b&&null!==b)var g={action:"wplc_start_chat",security:wplc_nonce,name:c,email:d,cid:b,wplcsession:a,wplc_extra_data:wplc_extra_data};else var g={action:"wplc_start_chat",security:wplc_nonce,name:c,email:d,wplcsession:a,wplc_extra_data:wplc_extra_data};jQuery.post(wplc_ajaxurl,g,function(a){Cookies.set("wplc_chat_status",2,{expires:f,path:"/"}),Cookies.set("wplc_name",c,{path:"/"}),Cookies.set("wplc_email",d,{path:"/"}),b=jQuery.trim(a)})}),jQuery("body").on("click","#wplc_na_msg_btn",function(){var a=jQuery("#wplc_name").val(),c=jQuery("#wplc_email").val(),d=jQuery("#wplc_message").val(),e=jQuery("#wplc_domain_offline").val(),f=jQuery("#wplc_ip_address").val();if(a.length<=0)return alert("Please enter your name"),!1;if(c.length<=0)return alert("Please enter your email address"),!1;var g=/^[A-Z0-9._%+-]+@([A-Z0-9-]+\.)+[A-Z]{2,4}$/i;if(!g.test(c))return alert("Please Enter a Valid Email Address"),!1;if(d.length<=0)return alert("Please enter a message"),!1;jQuery("#wp-live-chat-2-info").hide(),jQuery("#wplc_message_div").html(wplc_offline_msg),b=Cookies.get("wplc_cid");var h={action:"wplc_user_send_offline_message",security:wplc_nonce,cid:b,name:a,email:c,msg:d,ip:f,domain:e,wplc_extra_data:wplc_extra_data};jQuery.post(wplc_ajaxurl_site,h,function(a){jQuery("#wplc_message_div").html(wplc_offline_msg3)})}),jQuery("body").on("keyup","#wplc_chatmsg",function(a){13===a.keyCode&&jQuery("#wplc_send_msg").trigger("click")}),jQuery("body").on("click","#wplc_send_msg",function(){var a=jQuery("#wplc_cid").val(),b=t(document.getElementById("wplc_chatmsg").value),c=jQuery("#wplc_name").val();"undefined"!=typeof c&&null!=c&&""!=c||(c=Cookies.get("wplc_name"));var d=jQuery("#wplc_email").val();"undefined"!=typeof d&&null!=d&&""!=d||(d=Cookies.get("wplc_email")),jQuery("#wplc_chatmsg").val("");var e=b;"undefined"!=typeof niftyFormatParser&&(e=niftyFormatParser(e)),"display"==wplc_display_name?wplc_gravatar_image.length>1?jQuery("#wplc_chatbox").append("<span class='wplc-user-message xcvxxcv wplc-color-bg-1 wplc-color-2 wplc-color-border-1'>"+wplc_gravatar_image+" <strong>"+c+"</strong>: "+e+"</span><br /><div class='wplc-clear-float-message'></div>"):jQuery("#wplc_chatbox").append("<span class='wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1'><img src='//www.gravatar.com/avatar/"+md5(d)+"?s=30' class='wplc-user-message-avatar' /> <strong>"+c+"</strong>: "+e+"</span><br /><div class='wplc-clear-float-message'></div>"):jQuery("#wplc_chatbox").append("<span class='wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1'>"+e+"</span><div class='wplc-clear-float-message'></div>");var f=jQuery("#wplc_chatbox")[0].scrollHeight;jQuery("#wplc_chatbox").scrollTop(f);var g={action:"wplc_user_send_msg",security:wplc_nonce,cid:a,msg:b,wplc_extra_data:wplc_extra_data};jQuery.post(wplc_ajaxurl,g,function(a){})}),jQuery(document).on("wplc_open_chat",function(a){d=Cookies.get("wplc_chat_status");u(status,function(){s()})}),String.prototype.wplcStripSlashes=function(){return this.replace(/\\(.)/gm,"$1")},"undefined"!=typeof wplc_elem_trigger_id&&""!==wplc_elem_trigger_id){var v=0,w=0;"undefined"!=typeof wplc_elem_trigger_action&&""!==wplc_elem_trigger_action&&(v=parseInt(wplc_elem_trigger_action)),"undefined"!=typeof wplc_elem_trigger_type&&""!==wplc_elem_trigger_type&&(w=parseInt(wplc_elem_trigger_type)),jQuery((1===w?"#":".")+wplc_elem_trigger_id).on(1===v?"mouseenter":"click",function(){s(0)})}});
js/wplc_u_admin.js CHANGED
@@ -1,566 +1,566 @@
1
- var wplc_ajaxurl = wplc_ajaxurl;
2
- var data = {
3
- action: 'wplc_admin_long_poll',
4
- security: wplc_ajax_nonce,
5
- wplc_list_visitors_data: false,
6
- wplc_update_admin_chat_table: false,
7
- wplc_extra_data: wplc_extra_data
8
- };
9
- var wplc_pending_refresh = null;
10
- var current_chat_ids = new Object();
11
- var chat_count = 0;
12
- var wplc_run = true;
13
- var ringer_cnt = 0;
14
- var orig_title = document.getElementsByTagName("title")[0].innerHTML;
15
-
16
- var wplc_notification_icon_url = wplc_notification_icon;
17
-
18
- var wplc_poll_delay = 1500;
19
-
20
- var bleeper_favico_noti = '../wp-content/plugins/wp-live-chat-support/images/48px_n.png';
21
- var bleeper_favico = '../wp-content/plugins/wp-live-chat-support/images/48px.png';
22
-
23
-
24
- Object.size = function(obj) {
25
- var size = 0, key;
26
- for (key in obj) {
27
- if (obj.hasOwnProperty(key)) size++;
28
- }
29
- return size;
30
- };
31
- function wplc_notify_agent() {
32
-
33
-
34
- if (typeof wplc_wav_file !== 'undefined') {
35
- new Audio(wplc_wav_file).play()
36
- }
37
-
38
-
39
- if (ringer_cnt <= 0) {
40
- wplc_desktop_notification();
41
- }
42
- ringer_cnt++;
43
-
44
- if (ringer_cnt > 1) {
45
- clearInterval(wplc_pending_refresh);
46
- wplc_title_alerts4 = setTimeout(function () {
47
- document.title = orig_title;
48
- }, 4000);
49
- return;
50
- }
51
-
52
- document.title = "** CHAT REQUEST **";
53
-