WP Live Chat Support - Version 8.1.0

Version Description

Huge update with over 300 changes that include: Bugfixes, Vulnerability Fixes & Plugin Security, Plugin Optimization & Rebranding Updates. We suggest you remove any existing installations of this plugin and install 8.0.38 fresh.

=

Download this release

Release Info

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

Code changes from version 8.0.35 to 8.1.0

Files changed (118) hide show
  1. ajax/agent.php +328 -0
  2. ajax.php → ajax/user.php +67 -149
  3. audio/ding.mp3 +0 -0
  4. audio/ring.wav +0 -0
  5. config.php +1 -1
  6. css/admin-chat-box-style.min.css +0 -1
  7. css/admin-chat-style.css +6 -6
  8. css/admin-chat-style.min.css +0 -1
  9. css/admin_styles.css +639 -350
  10. css/admin_styles.min.css +0 -1
  11. css/chat-style.css +1195 -923
  12. css/chat-style.min.css +0 -1
  13. css/chat_dashboard/admin_style.css +21 -27
  14. css/chat_dashboard/admin_style_modern.css +48 -56
  15. css/chat_styles_pro.css +7 -7
  16. css/chat_styles_pro.min.css +0 -1
  17. css/cta_animations/bounce.min.css +0 -1
  18. css/cta_animations/pop.min.css +0 -1
  19. css/cta_animations/ripple.min.css +0 -1
  20. css/fontawesome-iconpicker.css +1 -1
  21. css/node_history_styles.css +19 -21
  22. css/node_history_styles.min.css +0 -1
  23. css/remote_dash_styles.css +48 -40
  24. css/remote_dash_styles.min.css +0 -1
  25. css/support-css.css +43 -1
  26. css/support-css.min.css +0 -1
  27. css/themes/classic.css +10 -10
  28. css/themes/classic.min.css +0 -1
  29. css/themes/modern.css +72 -113
  30. css/themes/modern.min.css +0 -1
  31. css/themes/position-bottom-left.min.css +0 -1
  32. css/themes/position-bottom-right.min.css +0 -1
  33. css/themes/position-left.min.css +0 -1
  34. css/themes/position-right.min.css +0 -1
  35. css/themes/theme-1.css +4 -4
  36. css/themes/theme-1.min.css +0 -1
  37. css/themes/theme-2.css +4 -4
  38. css/themes/theme-2.min.css +0 -1
  39. css/themes/theme-3.min.css +0 -1
  40. css/themes/theme-4.css +4 -4
  41. css/themes/theme-4.min.css +0 -1
  42. css/themes/theme-5.css +4 -4
  43. css/themes/theme-5.min.css +0 -1
  44. css/themes/theme-default.css +12 -12
  45. css/themes/theme-default.min.css +0 -1
  46. css/toastr.min.css +0 -1
  47. css/voice_note_admin.min.css +0 -1
  48. css/voice_notes_user.min.css +0 -1
  49. css/wplc-survey-style-before.css +0 -18
  50. css/wplc-survey-style-before.min.css +0 -1
  51. css/wplc-survey-style.css +0 -26
  52. css/wplc-survey-style.min.css +0 -1
  53. css/wplc_gif_integration.min.css +0 -1
  54. css/wplc_gutenberg_template_styles.min.css +0 -1
  55. css/wplc_styles_admin_pro.css +10 -0
  56. css/wplc_styles_admin_pro.min.css +0 -1
  57. css/wplc_styles_pro.css +18 -18
  58. css/wplc_styles_pro.min.css +0 -1
  59. css/wplcstyle.css +253 -249
  60. css/wplcstyle.min.css +0 -1
  61. functions.php +1563 -1803
  62. images/48px.png +0 -0
  63. images/48px_n.png +0 -0
  64. images/Survey_Box_Standard.jpg +0 -0
  65. images/codecabin.png +0 -0
  66. images/iconmicro.png +0 -0
  67. images/logo-for-chat-box.jpg +0 -0
  68. images/picture-for-chat-box.jpg +0 -0
  69. images/support.png +0 -0
  70. images/tcx48_n.png +0 -0
  71. images/tcx48px.png +0 -0
  72. images/wplc-logo.png +0 -0
  73. images/wplc_dashboard_department_selector.png +0 -0
  74. images/wplc_loading.png +0 -0
  75. images/wplc_notification_icon.png +0 -0
  76. includes/blocks/wplc-chat-box/block.js +1 -1
  77. includes/blocks/wplc-chat-box/editor.css +2 -2
  78. includes/blocks/wplc-chat-box/index.php +65 -49
  79. includes/blocks/wplc-chat-box/style.css +2 -2
  80. includes/blocks/wplc-chat-box/wplc_gutenberg_template_styles.css +2 -2
  81. includes/blocks/wplc-inline-chat-box/block.js +121 -121
  82. includes/blocks/wplc-inline-chat-box/editor.css +1 -1
  83. includes/blocks/wplc-inline-chat-box/index.php +65 -60
  84. includes/dashboard_page.php +79 -33
  85. includes/documentation_suggestions.php +0 -155
  86. includes/js/wplc_user_triggers.js +2 -2
  87. includes/notification_control.php +52 -77
  88. includes/settings_page.php +291 -424
  89. includes/shortcodes.php +12 -11
  90. includes/surveys.php +0 -391
  91. includes/templates/documentation-suggestion-item.html +0 -1
  92. includes/templates/documentation-suggestion.html +0 -1
  93. includes/wplc_agent_data.php +62 -270
  94. includes/wplc_custom_fields.php +64 -62
  95. includes/wplc_data_triggers.php +34 -25
  96. includes/wplc_departments.php +28 -42
  97. includes/wplc_roi.php +59 -25
  98. includes/wplc_transfer_chats.php +61 -67
  99. js/agent_status.js +0 -10
  100. js/bleeper_action_events.js +0 -155
  101. js/bleeper_action_events.min.js +0 -1
  102. js/media.js +1 -2
  103. js/nimblesquirrel.js +0 -1
  104. js/quick_responses.js +1 -1
  105. js/tcx_action_events.js +16 -0
  106. js/themes/classic.min.js +0 -1
  107. js/themes/modern.js +28 -68
  108. js/themes/modern.min.js +0 -1
  109. js/triggers.js +1 -1
  110. js/vendor/wdt-emoji/sheets/{sheet_apple_64_indexed_128.png → sheet-apple-64-indexed-128.png} +0 -0
  111. js/vendor/wdt-emoji/wdt-emoji-bundle.min.js +1 -1
  112. js/vendor/wdt-emoji/wdt-emoji-concat.min.js +1 -1
  113. js/wplc_admin_dynamic_translations.js +1 -1
  114. js/wplc_admin_editor.js +2 -75
  115. js/wplc_admin_pro.js +1 -60
  116. js/wplc_admin_pro_events.js +55 -51
  117. js/wplc_admin_pro_features.js +5 -3
  118. js/wplc_agent_node.js +2921 -4059
ajax/agent.php ADDED
@@ -0,0 +1,328 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ die();
5
+ }
6
+
7
+
8
+ add_action('wp_ajax_wplc_admin_long_poll', 'wplc_init_agent_ajax_callback');
9
+ add_action('wp_ajax_wplc_admin_long_poll_chat', 'wplc_init_agent_ajax_callback');
10
+ add_action('wp_ajax_wplc_admin_accept_chat', 'wplc_init_agent_ajax_callback');
11
+ add_action('wp_ajax_wplc_admin_close_chat', 'wplc_init_agent_ajax_callback');
12
+ add_action('wp_ajax_wplc_admin_send_msg', 'wplc_init_agent_ajax_callback');
13
+
14
+
15
+ function wplc_init_agent_ajax_callback() {
16
+
17
+ if(wplc_ic_check_if_user_is_agent() === "not_user_agent") {
18
+ $array['error'] = 1;
19
+ echo json_encode($array);
20
+ die();
21
+ }
22
+
23
+ if (!check_ajax_referer( 'wplc', 'security' )) {
24
+ die();
25
+ }
26
+
27
+ $wplc_settings = wplc_get_options();
28
+ $iterations = $wplc_settings['wplc_iterations'];
29
+
30
+ /* time in microseconds between long poll loop (lower number = higher resource usage) */
31
+ define('WPLC_DELAY_BETWEEN_LOOPS', $wplc_settings['wplc_delay_between_loops']);
32
+ /* this needs to take into account the previous constants so that we dont run out of time, which in turn returns a 503 error */
33
+ define('WPLC_TIMEOUT', ((WPLC_DELAY_BETWEEN_LOOPS * $iterations) / 1000000)*2);
34
+
35
+ /* 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 */
36
+ session_write_close();
37
+
38
+ // check input vars and sanitize once
39
+ $cid = 0;
40
+ if (!empty($_POST['cid'])) {
41
+ $cid=sanitize_text_field($_POST['cid']);
42
+ }
43
+
44
+ $action='';
45
+ if (!empty($_POST['action'])){
46
+ $action=sanitize_text_field($_POST['action']);
47
+ }
48
+
49
+ $status=0;
50
+ if (!empty($_POST['status'])) {
51
+ $status=intval($_POST['status']);
52
+ }
53
+
54
+ $name='';
55
+ if (!empty($_POST['wplc_name'])){
56
+ $name=substr(sanitize_text_field($_POST['wplc_name']),0,40);
57
+ }
58
+
59
+ $email='';
60
+ if (!empty($_POST['wplc_email'])){
61
+ $email=substr(sanitize_text_field($_POST['wplc_email']),0,40);
62
+ }
63
+
64
+ $is_mobile='';
65
+ if (!empty($_POST['wplc_is_mobile'])){
66
+ $is_mobile=intval($_POST['wplc_is_mobile']);
67
+ }
68
+
69
+ $old_chat_data='';
70
+ if (!empty($_POST['wplc_update_admin_chat_table'])) {
71
+ $old_chat_data=sanitize_text_field(stripslashes($_POST['wplc_update_admin_chat_table']));
72
+ if ($old_chat_data=='false') {
73
+ $old_chat_data=false;
74
+ }
75
+ }
76
+
77
+ $wplcsession='';
78
+ if (!empty($_POST['wplcsession'])) {
79
+ $wplcsession=sanitize_text_field($_POST['wplcsession']);
80
+ }
81
+
82
+ $first_run=isset($_POST['first_run']) && intval($_POST['first_run']) == 1;
83
+ $short_poll=isset($_POST['short_poll']) && sanitize_text_field($_POST['short_poll']) == "true";
84
+
85
+ // check actions
86
+
87
+ switch($action) {
88
+
89
+ case 'wplc_admin_long_poll':
90
+ if (defined('WPLC_TIMEOUT')) { @set_time_limit(WPLC_TIMEOUT); } else { @set_time_limit(120); }
91
+ $i = 1;
92
+
93
+ while ($i <= $iterations) {
94
+ if ($i %round($iterations/2) == 0) {
95
+ wplc_update_chat_statuses();
96
+ }
97
+
98
+ $pending = wplc_check_pending_chats();
99
+ $new_chat_data = wplc_list_chats($_POST);
100
+
101
+ if ($new_chat_data == "false") { $new_chat_data = false; }
102
+
103
+ if ($new_chat_data !== $old_chat_data) {
104
+ $array['old_chat_data'] = $old_chat_data;
105
+ $array['wplc_update_admin_chat_table'] = $new_chat_data;
106
+ $array['pending'] = $pending;
107
+ $array['action'] = "wplc_update_chat_list";
108
+ }
109
+
110
+ if (isset($array)) {
111
+ echo json_encode($array);
112
+ break;
113
+ }
114
+ if (defined('WPLC_DELAY_BETWEEN_LOOPS')) { usleep(WPLC_DELAY_BETWEEN_LOOPS); } else { usleep(500000); }
115
+ $i++;
116
+ }
117
+ break;
118
+
119
+ case 'wplc_admin_long_poll_chat':
120
+ if (defined('WPLC_TIMEOUT')) { @set_time_limit(WPLC_TIMEOUT); } else { @set_time_limit(120); }
121
+ $i = 1;
122
+ $cdata = wplc_get_chat_data($cid);
123
+ $array = array();
124
+ while ($i <= $iterations) {
125
+ $array = apply_filters("wplc_filter_admin_long_poll_chat_loop_iteration", $array, $_POST, $i, $cdata);
126
+ if ($array) {
127
+ echo json_encode($array);
128
+ break;
129
+ }
130
+ if (defined('WPLC_DELAY_BETWEEN_LOOPS')) { usleep(WPLC_DELAY_BETWEEN_LOOPS); } else { usleep(500000); }
131
+ $i++;
132
+ }
133
+ break;
134
+
135
+ case 'wplc_admin_accept_chat':
136
+ wplc_admin_accept_chat($cid);
137
+ break;
138
+
139
+ case 'wplc_admin_close_chat':
140
+ wplc_change_chat_status($cid, 1);
141
+ echo 'done';
142
+ break;
143
+
144
+ case 'wplc_admin_send_msg':
145
+ $chat_msg = $_POST['msg'];
146
+ $wplc_rec_msg = wplc_record_chat_msg("2", $cid, $chat_msg);
147
+ if ($wplc_rec_msg) {
148
+ echo 'sent';
149
+ } else {
150
+ echo "There was an error sending your chat message. Please contact support";
151
+ }
152
+ break;
153
+
154
+ //User Ajax
155
+
156
+ case 'wplc_call_to_server_visitor':
157
+ $wplc_settings = wplc_get_options();
158
+ if (defined('WPLC_TIMEOUT')) { @set_time_limit(WPLC_TIMEOUT); } else { @set_time_limit(120); }
159
+ $i = 1;
160
+ $array = array("check" => false);
161
+ $array['debug'] = "";
162
+ $cdata = false;
163
+
164
+ if (!empty($cid)) {
165
+ /* get agent ID */
166
+ $cdata = wplc_get_chat_data($cid,__LINE__);
167
+ $from = __("Admin","wplivechat"); /* set default */
168
+ $array['aname'] = apply_filters("wplc_filter_admin_from", $from, $cid, $cdata);
169
+ }
170
+
171
+ while ($i <= $iterations) {
172
+
173
+ if ($i %round($iterations/2) == 0) {
174
+ wplc_update_chat_statuses();
175
+ }
176
+
177
+ if (empty($cid)) {
178
+ $cid = wplc_log_user_on_page($name, $email, $wplcsession, $is_mobile);
179
+ $array['cid'] = $cid;
180
+ $array['status'] = wplc_return_chat_status($cid);
181
+ $array['wplc_name'] = $name;
182
+ $array['wplc_email'] = $email;
183
+ $array['check'] = true;
184
+ } else {
185
+ // echo 2;
186
+ $new_status = wplc_return_chat_status($cid);
187
+ $array['wplc_name'] = $name;
188
+ $array['wplc_email'] = $email;
189
+ $array['cid'] = $cid;
190
+ $array['aid'] = $cid;
191
+ $array = apply_filters("wplc_filter_user_long_poll_chat_loop_iteration", $array, $_POST, $i, $cdata);
192
+
193
+ if ($new_status == $status) { // if status matches do the following
194
+ if ($status!=2) {
195
+ /* check if session_variable is different? if yes then stop this script completely. */
196
+ if (!empty($wplcsession) && $i > 1) {
197
+ $wplc_session_variable = $wplcsession;
198
+ $current_session_variable = wplc_return_chat_session_variable($cid);
199
+ if ($current_session_variable != "" && $current_session_variable != $wplc_session_variable) {
200
+ /* stop this script */
201
+ $array['status'] = 11;
202
+ echo json_encode($array);
203
+ die();
204
+ }
205
+ }
206
+ if ($i == 1) {
207
+ if ($status != 12) {
208
+ /* 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 */
209
+ wplc_update_user_on_page($cid, $status, $wplcsession);
210
+ }
211
+ }
212
+ }
213
+
214
+ if ($status == 0 || $status == 12 ) { // browsing - user tried to chat but admin didn't answer so turn back to browsing
215
+ $array['status'] = 12;
216
+ } else if ($status == 3 || $status == 10) {
217
+ $messages = wplc_return_user_chat_messages($cid, $wplc_settings, $cdata);
218
+ if ( $status == 10 ) {
219
+ $array['alert'] = true;
220
+ }
221
+ if ($messages) {
222
+ wplc_mark_as_read_user_chat_messages($cid);
223
+ $array['status'] = 3;
224
+ $array['data'] = $messages;
225
+ $array['check'] = true;
226
+ }
227
+ } else if ($status == 2) {
228
+ $messages = wplc_return_user_chat_messages($cid, $wplc_settings, $cdata);
229
+ $array['debug'] = "we are here ".__LINE__;
230
+ if ($messages) {
231
+ wplc_mark_as_read_user_chat_messages($cid);
232
+ $array['status'] = 2;
233
+ $array['data'] = $messages;
234
+ $array['check'] = true;
235
+ }
236
+ } else if ($new_status == 12) { // no answer from admin, for the second+ time.
237
+ $array['data'] = wplc_return_no_answer_string($cid);
238
+ $array['check'] = true;
239
+ $array['preformatted'] = true;
240
+ @do_action("wplc_hook_missed_chat",array("cid" => $cid, "name" => $name, "email" => $email));
241
+ }
242
+
243
+ /* check if this is part of the first run */
244
+ if ($first_run) {
245
+ /* if yes, then send data now and dont wait for all iterations to complete */
246
+ if (!isset($array['status'])) { $array['status'] = $new_status; }
247
+ $array['check'] = true;
248
+ } else if ($short_poll) {
249
+ /* if yes, then send data now and dont wait for all iterations to complete */
250
+ if (!isset($array['status'])) { $array['status'] = $new_status; }
251
+ $array['check'] = true;
252
+ }
253
+ } else { // statuses do not match
254
+ $array['debug'] = $array['debug']. ' Doesnt match '.$new_status.' '.$status;
255
+ $array['status'] = $new_status;
256
+ if ($new_status == 1) { // completed
257
+ wplc_update_user_on_page($cid, 8, $wplcsession);
258
+ $array['check'] = true;
259
+ $array['status'] = 8;
260
+ $array['data'] = array();
261
+ $array['data'][9999] = array();
262
+ $array['data'][9999]['msg'] = __("Admin has closed and ended the chat","wplivechat");
263
+ } else if ($new_status == 2) { // pending
264
+ $array['debug'] = "we are here ".__LINE__;
265
+ $array['check'] = true;
266
+ $array['wplc_name'] = wplc_return_chat_name($cid);
267
+ $array['wplc_email'] = wplc_return_chat_email($cid);
268
+ $messages = wplc_return_chat_messages($cid, false, true, $wplc_settings, $cdata, 'array', false);
269
+ if ($messages) {
270
+ $array['data'] = $messages;
271
+ }
272
+ } else if ($new_status == 3) { // active
273
+ $array['data'] = null;
274
+ $array['check'] = true;
275
+
276
+ if ($status == 5 || $status == 3) {
277
+ $array['sound'] = false;
278
+ $messages = wplc_return_chat_messages($cid, false, true, $wplc_settings, $cdata, 'array', false);
279
+ if ($messages){
280
+ $array['data'] = $messages;
281
+ }
282
+ }
283
+ } else if ($new_status == 7) { // timed out
284
+ wplc_update_user_on_page($cid, 5, $wplcsession);
285
+ } else if ($new_status == 9) { // user closed chat without inputting or starting a chat
286
+ $array['check'] = true;
287
+ } else if ($new_status == 12) { // no answer from admin
288
+ $array['data'] = wplc_return_no_answer_string($cid);
289
+ $array['check'] = true;
290
+ $array['preformatted'] = true;
291
+ wplc_update_user_on_page($cid, 12, $wplcsession);
292
+ @do_action("wplc_hook_missed_chat",array("cid" => $cid ,"name" => $name,"email" => $email));
293
+ } else if ($new_status == 10) { // minimized active chat
294
+ $array['check'] = true;
295
+ if ($status == 5) {
296
+ $messages = wplc_return_chat_messages($cid, false, true, $wplc_settings, $cdata, 'array', false);
297
+ if ($messages){
298
+ $array['data'] = $messages;
299
+ }
300
+ }
301
+ }
302
+
303
+ /* check if this is part of the first run */
304
+ if ($first_run) {
305
+ /* if yes, then send data now and dont wait for all iterations to complete */
306
+ if (!isset($array['status'])) { $array['status'] = $new_status; }
307
+ $array['check'] = true;
308
+ } else if ($short_poll) {
309
+ /* if yes, then send data now and dont wait for all iterations to complete */
310
+ if (!isset($array['status'])) { $array['status'] = $new_status; }
311
+ $array['check'] = true;
312
+ }
313
+ $array = apply_filters("wplc_filter_wplc_call_to_server_visitor_new_status_check", $array);
314
+ }
315
+ } // !empty($cid)
316
+
317
+ if ($array['check'] == true) {
318
+ echo json_encode($array);
319
+ break;
320
+ }
321
+ $i++;
322
+ if (defined('WPLC_DELAY_BETWEEN_LOOPS')) { usleep(WPLC_DELAY_BETWEEN_LOOPS); } else { usleep(500000); }
323
+ }
324
+ break;
325
+
326
+ } // switch
327
+ die();
328
+ }
ajax.php → ajax/user.php RENAMED
@@ -4,11 +4,6 @@
4
  die();
5
  }
6
 
7
- add_action('wp_ajax_wplc_admin_long_poll', 'wplc_init_ajax_callback');
8
- add_action('wp_ajax_wplc_admin_long_poll_chat', 'wplc_init_ajax_callback');
9
- add_action('wp_ajax_wplc_admin_accept_chat', 'wplc_init_ajax_callback');
10
- add_action('wp_ajax_wplc_admin_close_chat', 'wplc_init_ajax_callback');
11
- add_action('wp_ajax_wplc_admin_send_msg', 'wplc_init_ajax_callback');
12
  add_action('wp_ajax_wplc_call_to_server_visitor', 'wplc_init_ajax_callback');
13
  add_action('wp_ajax_wplc_user_close_chat', 'wplc_init_ajax_callback');
14
  add_action('wp_ajax_wplc_user_minimize_chat', 'wplc_init_ajax_callback');
@@ -23,40 +18,20 @@
23
  add_action('wp_ajax_nopriv_wplc_user_send_msg', 'wplc_init_ajax_callback');
24
  add_action('wp_ajax_wplc_get_chat_box', 'wplc_init_ajax_callback');
25
  add_action('wp_ajax_nopriv_wplc_get_chat_box', 'wplc_init_ajax_callback');
26
-
27
- function wplc_init_ajax_callback() {
28
 
29
- $check = is_user_logged_in() ? check_ajax_referer( 'wplc', 'security' ) : 1;
30
 
31
- if ($check == 1) {
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
- $iterations = $wplc_iterations;
 
 
53
 
54
- /* time in microseconds between updating the user on the page within the DB (lower number = higher resource usage) */
55
- define('WPLC_DELAY_BETWEEN_UPDATES', $wplc_delay_between_updates);
56
  /* time in microseconds between long poll loop (lower number = higher resource usage) */
57
- define('WPLC_DELAY_BETWEEN_LOOPS', $wplc_delay_between_loops);
58
  /* this needs to take into account the previous constants so that we dont run out of time, which in turn returns a 503 error */
59
- define('WPLC_TIMEOUT', (((WPLC_DELAY_BETWEEN_UPDATES + WPLC_DELAY_BETWEEN_LOOPS)) * $iterations) / 1000000);
60
 
61
  /* 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 */
62
  session_write_close();
@@ -67,20 +42,23 @@
67
  if (!empty($_POST['cid'])) {
68
  $cid=sanitize_text_field($_POST['cid']);
69
  }
70
-
71
  $action='';
72
  if (!empty($_POST['action'])){
73
  $action=sanitize_text_field($_POST['action']);
74
  }
75
 
76
- $name = "Guest";
77
- if (isset( $_POST['wplc_name'] ) && !empty($_POST['wplc_name'])) {
78
- $name = sanitize_text_field($_POST['wplc_name']);
 
 
 
79
  }
80
 
81
  $email = "no email set";
82
- if (isset( $_POST['wplc_email'] ) && !empty($_POST['wplc_email'])) {
83
- $email = sanitize_text_field($_POST['wplc_email']);
84
  }
85
 
86
  $status=0;
@@ -98,14 +76,6 @@
98
  $chat_status = intval($_POST['chat_status']);
99
  }
100
 
101
- $old_chat_data='';
102
- if (!empty($_POST['wplc_update_admin_chat_table'])) {
103
- $old_chat_data=sanitize_text_field(stripslashes($_POST['wplc_update_admin_chat_table']));
104
- if ($old_chat_data=='false'){
105
- $old_chat_data=false;
106
- }
107
- }
108
-
109
  $wplcsession='';
110
  if (!empty($_POST['wplcsession'])) {
111
  $wplcsession=sanitize_text_field($_POST['wplcsession']);
@@ -121,89 +91,16 @@
121
  case 'wplc_get_chat_box':
122
  $continue = apply_filters("wplc_version_check_continue", true);
123
  if ($continue === true) {
124
- echo wplc_output_box_5100($cid);
125
  } else {
126
  echo boolval($continue);
127
  }
128
  break;
129
 
130
- case 'wplc_admin_long_poll':
131
- if (defined('WPLC_TIMEOUT')) { @set_time_limit(WPLC_TIMEOUT); } else { @set_time_limit(120); }
132
- $i = 1;
133
- $wplc_current_user = get_current_user_id();
134
-
135
- /* If user is either an agent or an admin, access the page. */
136
- if( !get_user_meta( $wplc_current_user, 'wplc_ma_agent', true )) {
137
- $array['error'] = 1;
138
- echo json_encode($array);
139
- die();
140
- }
141
-
142
- while ($i <= $iterations) {
143
- if($i %round($iterations/2) == 0) {
144
- wplc_update_chat_statuses();
145
- }
146
-
147
- $pending = wplc_check_pending_chats();
148
- $new_chat_data = wplc_list_chats($_POST);
149
-
150
- if ($new_chat_data == "false") { $new_chat_data = false; }
151
-
152
- if($new_chat_data !== $old_chat_data){
153
- $array['old_chat_data'] = $old_chat_data;
154
- $array['wplc_update_admin_chat_table'] = $new_chat_data;
155
- $array['pending'] = $pending;
156
- $array['action'] = "wplc_update_chat_list";
157
- }
158
-
159
- if (isset($array)) {
160
- echo json_encode($array);
161
- break;
162
- }
163
- if (defined('WPLC_DELAY_BETWEEN_LOOPS')) { usleep(WPLC_DELAY_BETWEEN_LOOPS); } else { usleep(500000); }
164
- $i++;
165
- }
166
- break;
167
-
168
- case 'wplc_admin_long_poll_chat':
169
- if (defined('WPLC_TIMEOUT')) { @set_time_limit(WPLC_TIMEOUT); } else { @set_time_limit(120); }
170
- $i = 1;
171
- $cdata = wplc_get_chat_data($cid);
172
- $array = array();
173
- while ($i <= $iterations) {
174
- $array = apply_filters("wplc_filter_admin_long_poll_chat_loop_iteration", $array, $_POST, $i, $cdata);
175
- if ($array) {
176
- echo json_encode($array);
177
- break;
178
- }
179
- if (defined('WPLC_DELAY_BETWEEN_LOOPS')) { usleep(WPLC_DELAY_BETWEEN_LOOPS); } else { usleep(500000); }
180
- $i++;
181
- }
182
- break;
183
-
184
- case 'wplc_admin_accept_chat':
185
- wplc_admin_accept_chat($cid);
186
- break;
187
-
188
- case 'wplc_admin_close_chat':
189
- wplc_change_chat_status($cid, 1);
190
- echo 'done';
191
- break;
192
-
193
- case 'wplc_admin_send_msg':
194
- $chat_msg = wp_filter_post_kses(strip_tags($_POST['msg'], '<a><p><img><hr>'));
195
- $wplc_rec_msg = wplc_record_chat_msg("2", $cid, $chat_msg);
196
- if ($wplc_rec_msg) {
197
- echo 'sent';
198
- } else {
199
- echo "There was an error sending your chat message. Please contact support";
200
- }
201
- break;
202
-
203
- //User Ajax
204
 
205
  case 'wplc_call_to_server_visitor':
206
- $wplc_settings = get_option("WPLC_SETTINGS");
 
207
  if (defined('WPLC_TIMEOUT')) { @set_time_limit(WPLC_TIMEOUT); } else { @set_time_limit(120); }
208
  $i = 1;
209
  $array = array("check" => false);
@@ -230,7 +127,10 @@
230
  $array['status'] = wplc_return_chat_status($cid);
231
  $array['wplc_name'] = $name;
232
  $array['wplc_email'] = $email;
233
- $array['check'] = true;
 
 
 
234
  } else {
235
  // echo 2;
236
  $new_status = wplc_return_chat_status($cid);
@@ -291,6 +191,7 @@
291
  else if ($new_status == 12) { // no answer from admin, for the second+ time.
292
  $array['data'] = wplc_return_no_answer_string($cid);
293
  $array['check'] = true;
 
294
  @do_action("wplc_hook_missed_chat",array("cid" => $cid, "name" => $name, "email" => $email));
295
  }
296
 
@@ -347,6 +248,7 @@
347
  else if ($new_status == 12) { // no answer from admin
348
  $array['data'] = wplc_return_no_answer_string($cid);
349
  $array['check'] = true;
 
350
  wplc_update_user_on_page($cid, 12, $wplcsession);
351
  @do_action("wplc_hook_missed_chat",array("cid" => $cid ,"name" => $name,"email" => $email));
352
  }
@@ -381,48 +283,64 @@
381
  $i++;
382
  if (defined('WPLC_DELAY_BETWEEN_LOOPS')) { usleep(WPLC_DELAY_BETWEEN_LOOPS); } else { usleep(500000); }
383
  }
 
384
  break;
385
 
386
  case 'wplc_user_close_chat':
387
- if ($status == 5) {
388
- wplc_change_chat_status($cid, 9);
389
- } else if ($status == 3) {
390
- wplc_change_chat_status($cid, 8);
391
- }
 
 
 
392
  break;
393
 
394
  case 'wplc_user_minimize_chat':
 
395
  wplc_change_chat_status($cid, 10);
 
396
  break;
397
 
398
  case 'wplc_user_maximize_chat':
 
399
  wplc_change_chat_status($cid, $chat_status);
 
400
  break;
401
 
402
  case 'wplc_user_send_msg':
403
- $chat_msg = wp_filter_post_kses(strip_tags($_POST['msg'], '<p><a><img><hr>'));
404
- $wplc_rec_msg = wplc_record_chat_msg("1", $cid, $chat_msg);
405
- if ($wplc_rec_msg) {
406
- echo 'sent';
407
- } else {
408
- echo "There was an error sending your chat message. Please contact support";
409
- }
 
 
 
 
410
  break;
411
 
412
  case 'wplc_start_chat':
413
- if (!empty($cid)) {
414
- if ($name && $email) {
415
- echo wplc_user_initiate_chat($name, $email, $cid, $wplcsession); // echo the chat session id
416
- } else {
417
- echo "error2";
418
- }
419
- } else {
420
- if ($name && $email) {
421
- echo wplc_user_initiate_chat($name, $email, null, $wplcsession); // echo the chat session id
422
- } else {
423
- echo "error2";
424
- }
425
- }
 
 
 
 
426
  break;
427
  } // switch
428
  } // if
4
  die();
5
  }
6
 
 
 
 
 
 
7
  add_action('wp_ajax_wplc_call_to_server_visitor', 'wplc_init_ajax_callback');
8
  add_action('wp_ajax_wplc_user_close_chat', 'wplc_init_ajax_callback');
9
  add_action('wp_ajax_wplc_user_minimize_chat', 'wplc_init_ajax_callback');
18
  add_action('wp_ajax_nopriv_wplc_user_send_msg', 'wplc_init_ajax_callback');
19
  add_action('wp_ajax_wplc_get_chat_box', 'wplc_init_ajax_callback');
20
  add_action('wp_ajax_nopriv_wplc_get_chat_box', 'wplc_init_ajax_callback');
21
+
 
22
 
23
+ function wplc_init_ajax_callback() {
24
 
25
+ $check = check_ajax_referer( 'wplc', 'security' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
 
27
+ if ($check == 1) {
28
+ $wplc_settings = wplc_get_options();
29
+ $iterations = $wplc_settings['wplc_iterations'];
30
 
 
 
31
  /* time in microseconds between long poll loop (lower number = higher resource usage) */
32
+ define('WPLC_DELAY_BETWEEN_LOOPS', $wplc_settings['wplc_delay_between_loops']);
33
  /* this needs to take into account the previous constants so that we dont run out of time, which in turn returns a 503 error */
34
+ define('WPLC_TIMEOUT', ((WPLC_DELAY_BETWEEN_LOOPS * $iterations) / 1000000)*2);
35
 
36
  /* 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 */
37
  session_write_close();
42
  if (!empty($_POST['cid'])) {
43
  $cid=sanitize_text_field($_POST['cid']);
44
  }
45
+
46
  $action='';
47
  if (!empty($_POST['action'])){
48
  $action=sanitize_text_field($_POST['action']);
49
  }
50
 
51
+ $name = $wplc_settings['wplc_user_default_visitor_name'];
52
+ if (isset( $_POST['name'] ) && !empty($_POST['name'])) {
53
+ $name = trim(strip_tags(sanitize_text_field($_POST['name'])));
54
+ if (empty($name)) {
55
+ $wplc_settings['wplc_user_default_visitor_name'];
56
+ }
57
  }
58
 
59
  $email = "no email set";
60
+ if (isset( $_POST['email'] ) && !empty($_POST['email'])) {
61
+ $email = strip_tags(sanitize_text_field($_POST['email']));
62
  }
63
 
64
  $status=0;
76
  $chat_status = intval($_POST['chat_status']);
77
  }
78
 
 
 
 
 
 
 
 
 
79
  $wplcsession='';
80
  if (!empty($_POST['wplcsession'])) {
81
  $wplcsession=sanitize_text_field($_POST['wplcsession']);
91
  case 'wplc_get_chat_box':
92
  $continue = apply_filters("wplc_version_check_continue", true);
93
  if ($continue === true) {
94
+ $outputbox = wplc_output_box_5100($cid);
95
  } else {
96
  echo boolval($continue);
97
  }
98
  break;
99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
 
101
  case 'wplc_call_to_server_visitor':
102
+
103
+ $wplc_settings = wplc_get_options();
104
  if (defined('WPLC_TIMEOUT')) { @set_time_limit(WPLC_TIMEOUT); } else { @set_time_limit(120); }
105
  $i = 1;
106
  $array = array("check" => false);
127
  $array['status'] = wplc_return_chat_status($cid);
128
  $array['wplc_name'] = $name;
129
  $array['wplc_email'] = $email;
130
+ $array['check'] = true;
131
+ if ( !isset($_SESSION['wplc_session_chat_session_id']) ) {
132
+ $_SESSION['wplc_session_chat_session_id'] = intval($cid);
133
+ }
134
  } else {
135
  // echo 2;
136
  $new_status = wplc_return_chat_status($cid);
191
  else if ($new_status == 12) { // no answer from admin, for the second+ time.
192
  $array['data'] = wplc_return_no_answer_string($cid);
193
  $array['check'] = true;
194
+ $array['preformatted'] = true;
195
  @do_action("wplc_hook_missed_chat",array("cid" => $cid, "name" => $name, "email" => $email));
196
  }
197
 
248
  else if ($new_status == 12) { // no answer from admin
249
  $array['data'] = wplc_return_no_answer_string($cid);
250
  $array['check'] = true;
251
+ $array['preformatted'] = true;
252
  wplc_update_user_on_page($cid, 12, $wplcsession);
253
  @do_action("wplc_hook_missed_chat",array("cid" => $cid ,"name" => $name,"email" => $email));
254
  }
283
  $i++;
284
  if (defined('WPLC_DELAY_BETWEEN_LOOPS')) { usleep(WPLC_DELAY_BETWEEN_LOOPS); } else { usleep(500000); }
285
  }
286
+
287
  break;
288
 
289
  case 'wplc_user_close_chat':
290
+ if(wplc_check_user_request($cid)) {
291
+ if ($status == 5) {
292
+ wplc_change_chat_status($cid, 9);
293
+ } else if ($status == 3) {
294
+ wplc_change_chat_status($cid, 8);
295
+ }
296
+ do_action("wplc_end_session_chat_id");
297
+ }
298
  break;
299
 
300
  case 'wplc_user_minimize_chat':
301
+ if(wplc_check_user_request($cid)) {
302
  wplc_change_chat_status($cid, 10);
303
+ }
304
  break;
305
 
306
  case 'wplc_user_maximize_chat':
307
+ if(wplc_check_user_request($cid)) {
308
  wplc_change_chat_status($cid, $chat_status);
309
+ }
310
  break;
311
 
312
  case 'wplc_user_send_msg':
313
+ if(wplc_check_user_request($cid)) {
314
+ $chat_msg = $_POST['msg'];
315
+ $wplc_rec_msg = wplc_record_chat_msg("1", $cid, $chat_msg);
316
+ if ($wplc_rec_msg) {
317
+ echo 'sent';
318
+ } else {
319
+ echo "There was an error sending your chat message. Please contact support";
320
+ }
321
+ }else {
322
+ echo "Invalid Chat ID";
323
+ }
324
  break;
325
 
326
  case 'wplc_start_chat':
327
+ if ( !isset($_SESSION['wplc_session_chat_session_id']) ) {
328
+ if (!empty($cid)) {
329
+ if ($name && $email) {
330
+ $new_cid = wplc_user_initiate_chat($name, $email, $cid, $wplcsession); // echo the chat session id
331
+ do_action("wplc_set_session_chat_id", $new_cid );
332
+ echo $new_cid;
333
+ } else {
334
+ echo "error2";
335
+ }
336
+ } else {
337
+ if ($name && $email) {
338
+ echo wplc_user_initiate_chat($name, $email, null, $wplcsession); // echo the chat session id
339
+ } else {
340
+ echo "error2";
341
+ }
342
+ }
343
+ }
344
  break;
345
  } // switch
346
  } // if
audio/ding.mp3 DELETED
Binary file
audio/ring.wav DELETED
Binary file
config.php CHANGED
@@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
7
  exit;
8
  }
9
 
10
- define('WPLC_PLUGIN_VERSION', "8.0.35");
11
  define('WPLC_PLUGIN_DIR', dirname(__FILE__));
12
  define('WPLC_PLUGIN_URL', plugins_url( '/', __FILE__ ) );
13
  define('WPLC_PLUGIN', plugin_basename( __FILE__ ) );
7
  exit;
8
  }
9
 
10
+ define('WPLC_PLUGIN_VERSION', "8.1.0");
11
  define('WPLC_PLUGIN_DIR', dirname(__FILE__));
12
  define('WPLC_PLUGIN_URL', plugins_url( '/', __FILE__ ) );
13
  define('WPLC_PLUGIN', plugin_basename( __FILE__ ) );
css/admin-chat-box-style.min.css DELETED
@@ -1 +0,0 @@
1
- #wpcontent{margin-left:10px}.typing_indicator{height:11px;margin-left:10px;font-style:italic;color:grey!important}.admin_chat_box_inner span.timedate{clear:both;position:relative;font-size:.8em;font-style:italic}.wplc-msg-float-left{left:32px;float:left}.wplc-msg-float-right{right:32px;float:right}.typing_indicator{background:inherit!important}.wplc-admin-message-avatar,.wplc-user-message-avatar{max-width:29px;max-height:29px}.admin_chat_box_inner_bottom .typing_indicator{background-color:transparent!important;color:#333!important}
 
css/admin-chat-style.css CHANGED
@@ -33,13 +33,13 @@
33
  }
34
 
35
  /* Join chat button */
36
- #nifty_wrapper .bleeper_join_chat_div button {
37
  position: relative;
38
  left: 33.3%;
39
  top: 15px;
40
  width: 33.3%;
41
- background-color: #ed832f;
42
- border: 1px solid #e2731b;
43
  color: #fafafa;
44
  font-weight: 600;
45
  font-size: 1.2em;
@@ -222,7 +222,7 @@
222
  height:auto;
223
  font-size:1.2em;
224
  }
225
- span.bleeper-edit-message {
226
  display: inline-block;
227
  position: relative;
228
  left: 0px;
@@ -247,7 +247,7 @@ span.bleeper-edit-message {
247
  position: relative;
248
  float: right;
249
  max-width: calc(100% - 190px);
250
- background-color:#ED832F;
251
  color:#ffffff;
252
  border-radius: 6px;
253
  }
@@ -255,7 +255,7 @@ span.bleeper-edit-message {
255
  top: 11px;
256
  right: -7px;
257
  border-width: 6px 0px 6px 7px;
258
- border-color: transparent #EB832C;
259
  }
260
  #nifty_wrapper .messages .wplc-admin-message .wplc-admin-message-avatar {
261
  display: block;
33
  }
34
 
35
  /* Join chat button */
36
+ #nifty_wrapper .tcx_join_chat_div button {
37
  position: relative;
38
  left: 33.3%;
39
  top: 15px;
40
  width: 33.3%;
41
+ background-color: #0596d4;
42
+ border: 1px solid #0596d4;
43
  color: #fafafa;
44
  font-weight: 600;
45
  font-size: 1.2em;
222
  height:auto;
223
  font-size:1.2em;
224
  }
225
+ span.tcx-edit-message {
226
  display: inline-block;
227
  position: relative;
228
  left: 0px;
247
  position: relative;
248
  float: right;
249
  max-width: calc(100% - 190px);
250
+ background-color:#0596d4;
251
  color:#ffffff;
252
  border-radius: 6px;
253
  }
255
  top: 11px;
256
  right: -7px;
257
  border-width: 6px 0px 6px 7px;
258
+ border-color: transparent #0596d4;
259
  }
260
  #nifty_wrapper .messages .wplc-admin-message .wplc-admin-message-avatar {
261
  display: block;
css/admin-chat-style.min.css DELETED
@@ -1 +0,0 @@
1
- #nifty_wrapper .user_header_wrapper_info{display:block;position:relative;top:-8px;float:left;width:60%!important;height:calc(100% + 1px);padding:8px;overflow-x:hidden;overflow-y:auto;font-size:.9em;line-height:1em;background-color:#fefefe;border-radius:3px}#nifty_wrapper .user_header_wrapper_info h3{font-size:1.5em;margin-top:0;margin-bottom:8px}#nifty_wrapper .user_header_wrapper_info h4{font-size:1.3em;margin-bottom:8px}#nifty_wrapper .user_header_wrapper_info p{font-size:1em;margin-bottom:0}#nifty_wrapper .bleeper_join_chat_div button{position:relative;left:33.3%;top:15px;width:33.3%;background-color:#ed832f;border:1px solid #e2731b;color:#fafafa;font-weight:600;font-size:1.2em}@media(max-width:767px){#nifty_wrapper .user_header_wrapper_info h3,#nifty_wrapper .user_header_wrapper_info h4,#nifty_wrapper .user_header_wrapper_info p{line-height:1}#nifty_wrapper .user_header_wrapper_info h3{font-size:1em}#nifty_wrapper .user_header_wrapper_info h4{font-size:.9em}#nifty_wrapper .user_header_wrapper_info p{font-size:.9em}#nifty_wrapper .user_header_wrapper_info h3 a,#nifty_wrapper .user_header_wrapper_info h4 a,#nifty_wrapper .user_header_wrapper_info p a{display:block;margin-top:0;word-wrap:break-word;line-height:1em}#nifty_wrapper .user_header_wrapper_info .chatInfoArea-Email:before{display:inline-block;position:relative;left:0;top:0;margin-right:5px;content:"email: "}#nifty_wrapper .eventbox{position:absolute;right:-3px;top:80px}#nifty_wrapper span.minChat{margin-top:-5px}}@media(max-width:500px){#nifty_wrapper .user_header_wrapper_img{display:none}#nifty_wrapper .user_header_wrapper_info{width:56%!important;border:1px solid #f1f1f1;background-color:#fcfcfc}}#nifty_wrapper span.minChat{margin-top:0}#nifty_wrapper .chatArea .messages{background-size:cover;border:1px solid #e6e6e6}#nifty_wrapper .timedate{display:none}#nifty_wrapper .messages .wplc_system_notification{display:block;position:relative;top:0;width:100%}#nifty_wrapper .messages .wplc_system_notification .messageBody{display:block;position:relative;left:0;top:7px;width:100%;margin-top:10px;margin-bottom:10px;padding:10px;background-color:#fafafa;border:1px solid #e6e6e6;border-radius:5px;color:#555;line-height:1.2em}#nifty_wrapper .messages .wplc_system_notification .messageBody .wplc_system_notification{display:inline-block;position:relative;left:0;top:0;width:auto;height:auto;margin-top:0;margin-bottom:0;background-color:transparent;border:none;border-radius:0}#nifty_wrapper .messages .wplc_system_notification .messageBody .chat_time{display:block;position:relative;left:0;top:0;width:100%;margin-bottom:5px;font-size:.9em;font-weight:600;color:#555}#nifty_wrapper ul.messages{padding-bottom:35px}#nifty_wrapper .messages .wplc-admin-message,#nifty_wrapper .messages .wplc-user-message{display:block;position:relative;width:100%;height:auto;clear:both}#nifty_wrapper .messages .wplc-admin-message::before,#nifty_wrapper .messages .wplc-user-message::before{display:none}#nifty_wrapper .messages .wplc-admin-message .wplc-msg-content,#nifty_wrapper .messages .wplc-user-message .wplc-msg-content{margin-top:2px;margin-bottom:2px;padding:10px}#nifty_wrapper .messages .wplc-admin-message .wplc-msg-content:after,#nifty_wrapper .messages .wplc-user-message .wplc-msg-content:before{display:block;position:absolute;width:0;border-style:solid;content:""}#nifty_wrapper .messages .wplc-user-message .wplc-msg-content .wplc-admin-message .messageBody,#nifty_wrapper .messages .wplc-user-message .wplc-msg-content .wplc-chat-person-name,#nifty_wrapper .messages .wplc-user-message .wplc-msg-content .wplc-user-message .messageBody{display:inline-block;position:relative;left:0;top:0}#nifty_wrapper .messages .wplc-admin-message .wplc-admin-message-avatar,#nifty_wrapper .messages .wplc-user-message .wplc-user-message-avatar{border-radius:50%}#nifty_wrapper .messages .wplc-user-message .wplc-msg-content .wplc-chat-person-name{margin-right:10px}#nifty_wrapper .chatArea span.messageBody{display:inline-block!important;position:relative;top:0;width:auto;max-width:100%;height:auto;font-size:1.2em}span.bleeper-edit-message{display:inline-block;position:relative;left:0;width:auto;height:auto;margin-left:20px;margin-right:0;margin-top:0;font-size:1.1em;color:#fff;font-weight:500;text-decoration:underline;font-style:italic}#nifty_wrapper .messages .wplc-admin-message{padding-right:12px}#nifty_wrapper .messages .wplc-admin-message .wplc-msg-content{display:inline-block;position:relative;float:right;max-width:calc(100% - 190px);background-color:#ed832f;color:#fff;border-radius:6px}#nifty_wrapper .messages .wplc-admin-message .wplc-msg-content:after{top:11px;right:-7px;border-width:6px 0 6px 7px;border-color:transparent #eb832c}#nifty_wrapper .messages .wplc-admin-message .wplc-admin-message-avatar{display:block;position:relative;float:right}#nifty_wrapper .messages .wplc-user-message{padding-left:0!important}#nifty_wrapper .messages .wplc-user-message .wplc-msg-content{display:inline-block;position:relative;top:0;left:0;width:auto;max-width:calc(100% - 250px);background-color:rgba(90,90,90,.94);color:#fff;border-radius:3px}#nifty_wrapper .messages .wplc-user-message .wplc-msg-content:before{top:15px;left:-7px;border-width:6px 7px 6px 0;border-color:transparent #646464}#nifty_wrapper .messages .wplc-user-message .wplc-user-message-avatar{display:inline-block;position:relative;left:0;top:0;margin-right:10px}#nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp,#nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp{display:block;position:absolute;z-index:1;width:auto;height:auto;padding-top:6px;padding-bottom:6px;padding-left:10px;padding-right:10px;background-color:rgba(39,36,36,.94);border-radius:5px;color:#fafafa;font-size:.8em!important}#nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp:before,#nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp:before{display:block;position:absolute;top:9px;width:0;border-color:transparent #272424;border-style:solid;content:""}#nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp:before{left:-7px;border-width:6px 7px 6px 0}#nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp:before{right:-7px;border-width:6px 0 6px 7px}#nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp,#nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp.only-hours{float:left;top:0}#nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp{left:-200px}#nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp.only-hours{left:-80px}#nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp{float:right;top:0}#nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp{right:-200px}#nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp.only-hours{right:-80px}@media(max-width:767px){#nifty_wrapper .messages .wplc-admin-message .wplc-msg-content{max-width:calc(100% - 100px)}#nifty_wrapper .messages .wplc-user-message .wplc-msg-content{max-width:calc(100% - 135px)}#nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp{left:-100px}#nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp,#nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp{max-width:130px}#nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp{left:-100px}#nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp{right:-100px}#nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp.only-hours{right:-80px}}#nifty_wrapper #quick_response_drawer_handle{z-index:1}#nifty_wrapper .eventbox-wrapper{overflow-y:auto;height:calc(100% - 61px);width:356px;border-bottom-right-radius:5px;border-bottom-left-radius:5px}.wdt-emoji-popup{z-index:5;height:300px;margin-top:45px}.wdt-emoji-popup .wdt-credit{display:block;position:relative;left:0;top:0;padding-right:15px;color:#dcdcdc;text-align:right}#quick_response_drawer_container{display:block;position:absolute;float:right;left:auto!important;right:23px;bottom:0;top:48vh!important;width:57%;max-height:180px;padding:10px;background:#fff;overflow-y:auto;border-radius:2px;box-shadow:0 0 10px 1px rgba(0,0,0,.1)}#chatTranscriptTitle{display:block!important}#chatTranscriptTitle.is-disabled{color:currentColor;cursor:not-allowed;opacity:.5;text-decoration:none}
 
css/admin_styles.css CHANGED
@@ -1,469 +1,758 @@
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
  }
316
-
317
  /* Dashboard Page Styles */
318
  #wplc_dashboard_container {
319
- box-sizing: border-box;
320
  }
321
  .wplc_panel_col {
322
- display: inline-block !important;
323
- box-sizing: border-box;
324
- vertical-align: top;
325
- padding: 15px;
326
- margin: 0 !important;
327
  }
328
-
329
  .wplc_col_12 {
330
- width: 100%;
331
  }
332
-
333
  .wplc_col_6 {
334
- width: 50%;
335
  }
336
-
337
  .wplc_col_4 {
338
- width: 32%;
339
  }
340
-
341
  .wplc_dashboard_row {
342
- white-space: nowrap;
343
-
344
  }
345
  .wplc-center {
346
- text-align: center;
347
  }
348
  span.smaller {
349
- font-size: 0.7em;
350
  }
351
  span.wplc-stat {
352
- font-size: 4em;
353
  }
354
-
355
  .wplc_material_panel {
356
- background: #fff;
357
- box-sizing: border-box;
358
- padding: 10px;
359
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.00), 0 1px 15px rgba(0, 0, 0, 0.04);
360
- border-radius: 2px;
361
- overflow: auto;
362
- max-width: 100%;
363
- width: 100%;
364
- white-space: normal;
365
  }
366
-
367
  .wplc_panel_title {
368
- margin-top: 0;
369
  }
370
-
371
  .wplc_panel_row {
372
- display: block !important;
373
- width: 100% !important;
374
  }
375
-
376
  .wplc_panel_row iframe {
377
- display: block !important;
378
  }
379
-
380
- .wplc_post,
381
- .wplc_post_excerpt{
382
- width: 100%;
383
- max-width: 100%;
384
  }
385
- .wplc_post_readmore a,
386
- .wplc_readmore{
387
- color: orange !important;
388
- text-decoration: none;
389
  }
390
-
391
- .wplc_post_readmore a:hover,
392
- .wplc_readmore:hover {
393
- text-decoration: underline;
394
  }
395
-
396
  .wplc_readmore {
397
- padding: 10px;
398
- padding-top: 0;
399
- display: block;
400
  }
401
-
402
  .wplc_post {
403
- border-bottom: 1px solid #eee;
404
- padding: 10px 0;
405
- box-sizing: border-box;
406
  }
407
-
408
-
409
  .wplc_post:last-of-type {
410
- border: none !important;
411
  }
412
-
413
  .wplc_post_title {
414
- font-weight: 800;
415
- color: #656565;
416
- font-size: 14px;
417
  }
418
-
419
  .wplc_panel_row {
420
- padding: 10px;
421
- box-sizing: border-box;
422
  }
423
-
424
  .wplc_panel_inner_title {
425
- font-weight: 800;
426
- font-size: 15px;
427
- margin-bottom: 10px;
428
- display: block;
429
  }
430
  .wplc_incident {
431
- border-bottom: 1px solid #eee;
432
- padding: 10px 0;
433
  }
434
-
435
  .wplc_incident_info {
436
- margin-top: 10px !important;
437
  }
438
-
439
-
440
- .wplc_incident_value,
441
- .wplc_module_value{
442
-
443
- text-transform: capitalize;
444
  }
445
-
446
  #wplc_dashboard_page_title {
447
- padding: 15px;
448
- padding-bottom: 0;
449
  }
450
-
451
- #wplc_settings input[type=button]:not(.button),
452
- #wplc_settings button:not(.button) {
453
- background: #e6e6e6;
454
- border: none;
455
- border-radius: 5px;
456
- padding: 7px 7px
457
  }
458
-
459
- #wplc_tabs li a:focus{
460
- box-shadow: none !important;
461
  }
462
-
463
  .tooltip {
464
- background: #5f5f5f;
465
- color: #fff;
466
- padding: 3px;
467
- border-radius: 5px;
468
- box-shadow: 0 0 5px 5px #33333308;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
469
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  /**
2
  * Settings
3
  */
4
 
5
  #wplc_settings .tooltip {
6
+ background-color: #333;
7
+ color: #eee;
8
+ padding: 15px;
9
+ border-radius: 15px;
10
+ opacity: 0.8;
11
  }
 
12
  #wplc_settings .form-table td {
13
+ font-size: 13px !important;
14
+ line-height: 1.5em !important;
15
  }
 
 
16
  .wplc-extension-label-box {
17
+ display: block;
18
+ overflow: auto;
19
+ clear: both;
20
  }
21
  .wplc-extension-label {
22
+ display: block;
23
+ float: left;
24
+ padding: 5px;
25
+ margin-right: 5px;
26
+ font-size: 0.8em;
27
+ background-color: #bbb;
28
+ color: #FFF;
29
+ webkit-border-radius: 5px;
30
+ -moz-border-radius: 5px;
31
+ border-radius: 5px;
32
  }
 
 
33
  #wplc_tabs {
34
+ box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
35
+ -webkit-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
36
+ -moz-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
37
+ -o-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
38
  }
 
 
39
  .wplc-extension {
40
+ float: left;
41
+ margin: 0 1% 1% 0;
42
+ background: #fff;
43
+ border: 1px solid #ccc;
44
+ width: 320px;
45
+ padding: 14px;
46
+ height: 370px;
47
+ position: relative;
 
 
48
  }
49
  .wplc-extension h3 {
50
+ margin: 0 0 8px;
51
+ font-size: 13px;
 
52
  }
 
53
  .wplc-extension .button-secondary {
54
+ position: absolute;
55
+ bottom: 14px;
56
+ left: 14px;
57
  }
58
  .wplc-plugin {
59
+ height: 250px;
60
  }
 
 
61
  .wplc_header_vh {
62
+ font-size: 16px;
63
+ padding: 0 0 0 0px;
64
+ color: #FFF;
65
+ }
66
+ .wplc_headerspan_v {
67
+ min-width: 120px;
68
+ width: 20%;
69
+ display: block;
70
+ }
71
+ .wplc_headerspan_nr {
72
+ min-width: 60px;
73
+ width: 10%;
74
+ display: block;
75
+ }
76
+ .wplc_headerspan_dev {
77
+ min-width: 60px;
78
+ width: 10%;
79
+ display: block;
80
+ }
81
+ .wplc_headerspan_d {
82
+ min-width: 300px;
83
+ width: 40%;
84
+ display: block;
85
+ }
86
+ .wplc_headerspan_d a {
87
+ font-style: italic;
88
+ }
89
+ .wplc_headerspan_t {
90
+ min-width: 60px;
91
+ width: 9%;
92
+ display: block;
93
+ }
94
+ .wplc_headerspan_s {
95
+ min-width: 100px;
96
+ width: 15%;
97
+ display: block;
98
+ }
99
+ .wplc_headerspan_a {
100
+ min-width: 100px;
101
+ width: 15%;
102
+ display: block;
103
+ }
104
  .wplc_chat_ul_header {
105
+ clear: both;
106
+ overflow: auto;
107
+ display: block;
108
+ padding: 10px;
109
+ background-color:#373737;
110
+ border-radius:5px;
111
  }
 
 
112
  .relevant_extension p {
113
+ margin-top: 2px;
114
  }
115
  .relevant_extension h3 {
116
+ margin-bottom: 2px;
117
  }
118
  .relevant_extension {
119
+ width: 49% !important;
120
+ height: 125px !important;
121
+ opacity: 0.5;
122
  }
123
  .relevant_extension:hover {
124
+ opacity: 1.0;
125
  }
 
 
126
  .relevant_extension .button-secondary {
127
+ right: 10px !important;
128
+ left: initial !important;
129
+ }
130
+ .relevant_extension img {
131
+ margin-right: 10px;
132
  }
133
 
134
+ @media (min-width:320px) {
135
+ /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */
136
+ .relevant_extension {
137
+ width: 85% !important;
138
+ height: 145px !important;
139
+ opacity: 0.5;
140
+ }
141
  .relevant_extension img {
142
+ width: 105px;
143
+ }
144
+ .wplc-extension .wp-post-image {
145
+ height: auto;
146
+ }
147
  }
148
 
149
+ @media (min-width:480px) {
150
+ /* smartphones, Android phones, landscape iPhone */
151
+ .relevant_extension {
152
+ width: 94% !important;
153
+ height: 125px !important;
154
+ opacity: 0.5;
155
+ }
156
+ .relevant_extension img {
157
+ width: 105px;
158
+ }
159
+ .wplc-extension .wp-post-image {
160
+ height: auto;
161
+ }
162
+ }
163
 
164
+ @media (min-width:600px) {
165
+ /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */
166
+ .relevant_extension {
167
+ width: 94% !important;
168
+ height: 125px !important;
169
+ opacity: 0.5;
170
+ }
171
+ .relevant_extension img {
172
+ width: 105px;
173
+ }
174
+ .wplc-extension .wp-post-image {
175
+ height: auto;
176
+ }
177
+ }
178
 
179
+ @media (min-width:801px) {
180
+ /* tablet, landscape iPad, lo-res laptops ands desktops */
181
+ .relevant_extension {
182
+ width: 43% !important;
183
+ height: 145px !important;
184
+ opacity: 0.5;
185
+ }
186
+ .relevant_extension img {
187
+ width: 95px;
188
+ }
189
+ .wplc-extension .wp-post-image {
190
+ height: auto;
191
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  }
193
 
194
+ @media (min-width:1025px) {
195
+ /* big landscape tablets, laptops, and desktops */
196
+ .relevant_extension {
197
+ width: 44% !important;
198
+ height: 125px !important;
199
+ opacity: 0.5;
200
+ }
201
+ .relevant_extension img {
202
+ width: 125px;
203
+ }
204
+ .wplc-extension .wp-post-image {
205
+ height: auto;
206
+ }
207
+ }
208
 
209
+ @media (min-width:1281px) {
210
+ /* hi-res laptops and desktops */
211
+ .relevant_extension {
212
+ width: 32% !important;
213
+ height: 125px !important;
214
+ opacity: 0.5;
215
+ }
216
+ .relevant_extension img {
217
+ width: 110px;
218
+ }
219
+ .wplc-extension .wp-post-image {
220
+ height: auto;
221
+ }
222
+ }
223
  .wplc-palette-selection {
224
+ border: 1px solid #CCC;
225
+ border-radius: 5px;
226
+ padding: 5px;
227
+ margin: 5px;
228
+ height: 100%;
 
229
  }
 
230
  .wplc_palette_single {
231
+ margin: 5px;
232
+ margin-top: 15px;
233
+ width: 162px;
234
+ height: 122px;
235
+ text-align: center;
236
+ display: inline-block;
237
+ vertical-align: top;
238
+ cursor: pointer;
239
+ }
240
+ .wplc-palette-top {
241
+ display: block;
242
+ width: 100%;
243
+ height: 25%;
244
+ }
245
  #wplc_tabs .ui-tabs-anchor {
246
+ width: 100%;
247
  }
 
 
 
248
  /* Gutenberg styles */
249
  #tabs-gutenberg input[type='button'] {
250
+ cursor: pointer;
251
  }
 
252
  #wplc_custom_js_editor, #wplc_custom_css_editor, #wplc_custom_html_editor {
253
+ width: 560px;
254
+ height: 285px;
255
+ margin: 10px 0 10px 0;
256
  }
 
257
  #wplc_gutenberg_icon {
258
+ cursor: pointer;
259
  }
 
260
  .wplc_code {
261
+ cursor: pointer;
262
+ transition: all .2s ease-in-out;
263
+ border-radius: 3px;
264
+ color: #696969;
265
  }
 
266
  .wplc_code:hover {
267
+ background: #d7d7d7;
268
  }
 
269
  .wplc_code:focus, .wplc_code:active {
270
+ background: #018add;
271
+ color: #fff;
272
+ }
273
+ .wplc_agent_container ul {
274
+ display: block;
275
+ overflow: auto;
276
+ }
277
+ .wplc_agent_container li {
278
+ display: block;
279
+ float: left;
280
+ text-align: center;
281
+ border: 1px solid #CCC;
282
+ width: 150px;
283
+ height: 320px;
284
+ padding: 10px;
285
+ border-radius: 5px;
286
+ margin: 10px;
287
+ box-shadow: 2px 2px 2px #CCC;
288
+ overflow: auto;
289
+ }
290
+ .wplc_agent_container img {
291
+ border-radius: 100px;
292
  }
293
+ .wplc_agent_container h3 {
294
+ font: bold 12px/16px Arial;
295
+ padding: 0 0 0 0px;
296
+ color: #C2BBBE;
297
+ display: block;
298
+ text-transform: uppercase;
 
 
 
 
 
 
 
 
 
 
 
 
 
299
  }
300
+ .wplc_agent_container small {
301
+ word-wrap: break-word;
302
+ display: block;
303
+ }
304
+ .wplc_agent_container select {
305
+ width: 120px;
306
  }
 
 
 
 
 
 
 
 
 
 
 
307
  .initiate_upsell {
308
+ position: absolute;
309
+ bottom: 0;
310
+ padding: 10px;
311
+ border-top: 1px solid #ccc;
312
+ width: 100%;
313
+ background-color: #fff;
314
  }
 
315
  /* Dashboard Page Styles */
316
  #wplc_dashboard_container {
317
+ box-sizing: border-box;
318
  }
319
  .wplc_panel_col {
320
+ display: inline-block;
321
+ box-sizing: border-box;
322
+ vertical-align: top;
323
+ padding: 15px;
324
+ margin: 0 !important;
325
  }
 
326
  .wplc_col_12 {
327
+ width: 100%;
328
  }
 
329
  .wplc_col_6 {
330
+ width: 50%;
331
  }
 
332
  .wplc_col_4 {
333
+ width: 32%;
334
  }
 
335
  .wplc_dashboard_row {
336
+ white-space: nowrap;
 
337
  }
338
  .wplc-center {
339
+ text-align: center;
340
  }
341
  span.smaller {
342
+ font-size: 0.7em;
343
  }
344
  span.wplc-stat {
345
+ font-size: 4em;
346
  }
 
347
  .wplc_material_panel {
348
+ background: #fff;
349
+ box-sizing: border-box;
350
+ padding: 10px;
351
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.00), 0 1px 15px rgba(0, 0, 0, 0.04);
352
+ border-radius: 2px;
353
+ overflow: auto;
354
+ max-width: 100%;
355
+ width: 100%;
356
+ white-space: normal;
357
  }
 
358
  .wplc_panel_title {
359
+ margin-top: 0;
360
  }
 
361
  .wplc_panel_row {
362
+ display: block !important;
363
+ width: 100% !important;
364
  }
 
365
  .wplc_panel_row iframe {
366
+ display: block !important;
367
  }
368
+ .wplc_post, .wplc_post_excerpt {
369
+ width: 100%;
370
+ max-width: 100%;
 
 
371
  }
372
+ .wplc_post_readmore a, .wplc_readmore {
373
+ color: #0596d4 !important;
374
+ text-decoration: none;
 
375
  }
376
+ .wplc_post_readmore a:hover, .wplc_readmore:hover {
377
+ text-decoration: underline;
 
 
378
  }
 
379
  .wplc_readmore {
380
+ padding: 10px;
381
+ padding-top: 0;
382
+ display: block;
383
  }
 
384
  .wplc_post {
385
+ border-bottom: 1px solid #eee;
386
+ padding: 10px 0;
387
+ box-sizing: border-box;
388
  }
 
 
389
  .wplc_post:last-of-type {
390
+ border: none !important;
391
  }
 
392
  .wplc_post_title {
393
+ font-weight: 800;
394
+ color: #656565;
395
+ font-size: 14px;
396
  }
 
397
  .wplc_panel_row {
398
+ padding: 10px;
399
+ box-sizing: border-box;
400
  }
 
401
  .wplc_panel_inner_title {
402
+ font-weight: 800;
403
+ font-size: 15px;
404
+ margin-bottom: 10px;
405
+ display: block;
406
  }
407
  .wplc_incident {
408
+ border-bottom: 1px solid #eee;
409
+ padding: 10px 0;
410
  }
 
411
  .wplc_incident_info {
412
+ margin-top: 10px !important;
413
  }
414
+ .wplc_incident_value, .wplc_module_value {
415
+ text-transform: capitalize;
 
 
 
 
416
  }
 
417
  #wplc_dashboard_page_title {
418
+ padding: 15px;
419
+ padding-bottom: 0;
420
  }
421
+ #wplc_settings input[type=button]:not(.button), #wplc_settings button:not(.button) {
422
+ background: #e6e6e6;
423
+ border: none;
424
+ border-radius: 5px;
425
+ padding: 7px 7px
 
 
426
  }
427
+ #wplc_tabs li a:focus {
428
+ box-shadow: none !important;
 
429
  }
 
430
  .tooltip {
431
+ background: #5f5f5f;
432
+ color: #fff;
433
+ padding: 3px;
434
+ border-radius: 5px;
435
+ box-shadow: 0 0 5px 5px #33333308;
436
+ }
437
+ /*
438
+ * Dashboard
439
+ */
440
+
441
+ .wplc-dashboard-item {
442
+ width: 18%;
443
+ }
444
+ .wplc_dashboard_stats_table td {
445
+ padding: 5px;
446
+ }
447
+ .wplc_dashboard_stats_table tr:nth-child(odd) {
448
+ background-color: #f2f2f2;
449
+ }
450
+ .wplc_dashboard_stats_table tr:nth-child(even) {
451
+ background-color: #f9f9f9;
452
+ }
453
+ .wplc_dashboard_stats_table tr:first-child {
454
+ background-color: #666!important;
455
+ padding-top: 0;
456
+ }
457
+ .wplc-dashboard-stats-title {
458
+ font-size: 14px;
459
+ font-weight: bold;
460
+ padding: 4px;
461
+ text-align: right;
462
+ color: #FFF;
463
+ }
464
+ .wplc-dashboard-stats-sub-title {
465
+ font-size: 14px;
466
+ padding: 4px;
467
+ color: #FFF;
468
+ }
469
+ .wplc-dashboard-stats-side-title {
470
+ font-size: 14px;
471
+ padding: 2px;
472
+ }
473
+
474
+ @media(min-width:701px) {
475
+ .wplc_dashboard_buttons_outer {
476
+ width: 50%;
477
+ }
478
+ .wplc-dashboard-stats {
479
+ width: 48%;
480
+ }
481
+ .wplc_dashboard_button_item a {
482
+ font-size: 110%;
483
+ }
484
+ }
485
+ .wplc_dashboard_button_item {
486
+ display: flex;
487
+ flex-direction: row;
488
+ flex-wrap: wrap;
489
+ justify-content: space-between;
490
+ }
491
+ .wplc_dashboard_button_item a {
492
+ flex-basis: 24%;
493
+ }
494
+ .wplc_dashboard_button_item a {
495
+ padding: 15px 0;
496
+ box-sizing: border-box;
497
+ margin-bottom: 15px;
498
+ transition: .5s;
499
+ background: #0596d4;
500
+ color: #FFF;
501
+ text-decoration: none;
502
+ position: relative;
503
+ justify-content: center;
504
+ flex-direction: column;
505
+ text-align: center;
506
+ display: flex;
507
+ }
508
+ .wplc_dashboard_button_item a:hover {
509
+ background: #00a5eb;
510
+ }
511
+ .wplc_dashboard_button_item a:after {
512
+ background: none repeat scroll 0 0 transparent;
513
+ bottom: 0;
514
+ content: "";
515
+ display: block;
516
+ height: 2px;
517
+ left: 50%;
518
+ position: absolute;
519
+ background: #3ac4ff;
520
+ transition: width 0.3s ease 0s, left 0.3s ease 0s;
521
+ width: 0;
522
+ }
523
+ .wplc_dashboard_button_item a:hover:after {
524
+ width: 100%;
525
+ left: 0;
526
+ }
527
+
528
+ @media(max-width:700px) {
529
+ .wplc_panel_col {
530
+ display: block;
531
+ }
532
+ }
533
+ .wplc_panel_heading {
534
+ background-color: #333;
535
+ color: #FFF;
536
+ font-size: 16px;
537
+ padding: 7px;
538
+ font-weight: bold;
539
  }
540
+ #wplc_blog_posts {
541
+ padding: 15px 25px 15px 25px;
542
+ }
543
+ .wplc_dashboard_activity {
544
+ text-align: center;
545
+ }
546
+ .wplc_dashboard_activity_numbers {
547
+ color: #0596d4;
548
+ }
549
+ .wplc_dashboard_button_item .fa {
550
+ font-size: 120%;
551
+ margin-bottom: 4px;
552
+ }
553
+ .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active, a.ui-button:active, .ui-button:active, .ui-button.ui-state-active:hover {
554
+ border: 1px solid #0596d4;
555
+ background: #0596d4;
556
+ margin-bottom: 2px!important;
557
+ }
558
+ .ui-widget-header {
559
+ border: none;
560
+ background: none;
561
+ }
562
+ #wplc_tabs {
563
+ padding: 10px;
564
+ }
565
+ .wplc_wrap h2 {
566
+ margin-bottom: 12px!important;
567
+ }
568
+ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default, .ui-button, html .ui-button.ui-state-disabled:hover, html .ui-button.ui-state-disabled:active {
569
+ border: 1px solid #e5e5e5;
570
+ }
571
+ .wplc_on_premise_heading {
572
+ padding:15px;
573
+ width:990px;
574
+ margin:0 auto;
575
+ }
576
+ .wplc_on_premise_heading h2{
577
+ display:inline-block;
578
+ }
579
+
580
+
581
+ .wplc_chat_on_premise_header{
582
+ display:flex;
583
+ background-color:#373737;
584
+ color:#FFF;
585
+ padding:10px;
586
+ }
587
+
588
+ @media(max-width:600px){
589
+ .wplc_chat_on_premise_header{
590
+ display:none;
591
+ }
592
+ }
593
+ .wplc_header_v{
594
+ flex-basis: 12%;
595
+ align-self: center;
596
+ }
597
+ .wplc_header_t{
598
+ flex-basis: 10%;
599
+ align-self: center;
600
+ }
601
+ .wplc_header_nr{
602
+ flex-basis: 10%;
603
+ align-self: center;
604
+ }
605
+ .wplc_header_dev{
606
+ flex-basis: 10%;
607
+ align-self: center;
608
+ }
609
+ .wplc_header_d{
610
+ flex-basis: 30%;
611
+ align-self: center;
612
+ }
613
+ .wplc_header_s{
614
+ flex-basis: 13%;
615
+ align-self: center;
616
+ }
617
+ .wplc_header_a{
618
+ flex-basis: 15%;
619
+ align-self: center;
620
+ }
621
+ #wplc_admin_chat_area_new{
622
+ position:relative;
623
+ }
624
+
625
+ .wplc_header_v_m,
626
+ .wplc_header_t_m,
627
+ .wplc_header_nr_m,
628
+ .wplc_header_dev_m,
629
+ .wplc_header_d_m,
630
+ .wplc_header_s_m{
631
+ display:none;
632
+ font-weight: bold;
633
+ }
634
+
635
+ @media(max-width:600px){
636
+ .wplc_header_v,
637
+ .wplc_header_t,
638
+ .wplc_header_nr,
639
+ .wplc_header_dev,
640
+ .wplc_header_d,
641
+ .wplc_header_s,
642
+ .wplc_header_a{
643
+ display:block;
644
+ padding-top:5px;
645
+ padding-bottom:5px;
646
+ }
647
+
648
+ .wplc_header_v_m,
649
+ .wplc_header_t_m,
650
+ .wplc_header_nr_m,
651
+ .wplc_header_dev_m,
652
+ .wplc_header_d_m,
653
+ .wplc_header_s_m{
654
+ display:inline-block;
655
+ }
656
+ }
657
+ /*
658
+ #wplc_admin_chat_area_new::after{
659
+ content:"";
660
+ width: 0;
661
+ height: 0;
662
+ border-style: solid;
663
+ border-width: 45px 27px 0 27px;
664
+ border-color: #ffffff transparent transparent transparent;
665
+ position: absolute;
666
+ right: 46px;
667
+ bottom: -43px;
668
+ }
669
+ */
670
+ @media(min-width:600px){
671
+ .wplc_p_cul{
672
+ display:flex!important;
673
+ }
674
+ .wplc_header_t{
675
+ text-align:center;
676
+ }
677
+ .wplc_header_nr{
678
+ text-align:center;
679
+ }
680
+ .wplc_header_dev{
681
+ text-align:center;
682
+ }
683
+ .wplc_header_s{
684
+ text-align:center;
685
+ }
686
+ .wplc_header_a{
687
+ text-align:center;
688
+ }
689
+ }
690
+ #wplc_chat_ul {
691
+ min-height:60px;
692
+ }
693
+
694
+ .wplc_p_cul:last-child {
695
+ border-bottom:none!important;
696
+ }
697
+ .wplc_chat_on_premise_no_visitors {
698
+ text-align:center;
699
+ padding:10px;
700
+ font-size:120%;
701
+ }
702
+ .wplc_list_table {
703
+ margin-bottom:15px;
704
+ margin-top: .5em;
705
+ }
706
+ .wplc_on_premise_chat_window_header{
707
+ display:flex;
708
+ margin-bottom: 5px;
709
+ }
710
+
711
+ .wplc_on_premise_chat_window h2{
712
+ background: #0596d4;
713
+ margin-top: 0;
714
+ padding: 7px;
715
+ color: #FFF;
716
+ margin-bottom: 3px;
717
+ border-radius: 2px;
718
+ font-weight: normal;
719
+ font-size: 16px;
720
+ display:inline-block;
721
+ }
722
+
723
+ .wplc_on_premise_chat_box_user_info {
724
+ position: relative;
725
+ display: flex;
726
+ margin-bottom: 10px;
727
+ }
728
+ .wplc_on_premise_chat_box_user_info_avatar{
729
+ width:50px;
730
+ padding-right:10px;
731
+ }
732
+ .wplc_on_premise_chat_box_user_info_details{
733
+ flex-basis:100%;
734
+ }
735
+ .wplc_on_premise_chat_box_user_info_rating{
736
+ flex-basis:15%;
737
+ margin-left:auto!important;
738
+ align-self: flex-end;
739
+ }
740
+
741
+ .wplc_on_premise_chat_quick_response{
742
+ margin-left: auto!important;
743
+ padding-top:5px;
744
+ }
745
+
746
+ #wplc_admin_email_transcript{
747
+ margin-left:3px;
748
+ }
749
+
750
+ .wplc_uploaded_file span {
751
+ padding-left: 8px;
752
+ }
753
+
754
+ .wplc_servermode_description {
755
+ margin: 16px;
756
+ padding: 16px;
757
+ border: 1px dotted #aaa;
758
+ }
css/admin_styles.min.css DELETED
@@ -1 +0,0 @@
1
- #wplc_settings .tooltip{background-color:#333;color:#eee;padding:15px;border-radius:15px;opacity:.8}#wplc_settings .form-table td{font-size:13px!important;line-height:1.5em!important}.wplc-extension-label-box{display:block;overflow:auto;clear:both}.wplc-extension-label{display:block;float:left;padding:5px;margin-right:5px;font-size:.8em;background-color:#bbb;color:#fff;webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}#wplc_tabs{box-shadow:0 0 40px 1px rgba(0,0,0,.07);-webkit-box-shadow:0 0 40px 1px rgba(0,0,0,.07);-moz-box-shadow:0 0 40px 1px rgba(0,0,0,.07);-o-box-shadow:0 0 40px 1px rgba(0,0,0,.07)}.wplc-extension{float:left;margin:0 1% 1% 0;background:#fff;border:1px solid #ccc;width:320px;padding:14px;height:370px;position:relative}.wplc-extension h3{margin:0 0 8px;font-size:13px}.wplc-extension .button-secondary{position:absolute;bottom:14px;left:14px}.wplc-plugin{height:250px}.wplc_header_vh{font:bold 14px/26px Arial;padding:0;color:#c2bbbe;display:block;text-transform:uppercase;display:block}.wplc_headerspan_v{min-width:120px;width:20%;display:block}.wplc_headerspan_nr{min-width:60px;width:10%;display:block}.wplc_headerspan_dev{min-width:60px;width:10%;display:block}.wplc_headerspan_d{min-width:200px;width:30%;display:block}.wplc_headerspan_d a{font-style:italic}.wplc_headerspan_t{min-width:60px;width:9%;display:block}.wplc_headerspan_s{min-width:80px;width:12%;display:block}.wplc_headerspan_a{min-width:100px;width:15%;display:block}.wplc_chat_ul_header{clear:both;overflow:auto;display:block;padding:10px}.relevant_extension p{margin-top:2px}.relevant_extension h3{margin-bottom:2px}.relevant_extension{width:49%!important;height:125px!important;opacity:.5}.relevant_extension:hover{opacity:1}.relevant_extension .button-secondary{right:10px!important;left:initial!important}.relevant_extension img{margin-right:10px}@media (min-width:320px){.relevant_extension{width:85%!important;height:145px!important;opacity:.5}.relevant_extension img{width:105px}.wplc-extension .wp-post-image{height:auto}}@media (min-width:480px){.relevant_extension{width:94%!important;height:125px!important;opacity:.5}.relevant_extension img{width:105px}.wplc-extension .wp-post-image{height:auto}}@media (min-width:600px){.relevant_extension{width:94%!important;height:125px!important;opacity:.5}.relevant_extension img{width:105px}.wplc-extension .wp-post-image{height:auto}}@media (min-width:801px){.relevant_extension{width:43%!important;height:145px!important;opacity:.5}.relevant_extension img{width:95px}.wplc-extension .wp-post-image{height:auto}}@media (min-width:1025px){.relevant_extension{width:44%!important;height:125px!important;opacity:.5}.relevant_extension img{width:125px}.wplc-extension .wp-post-image{height:auto}}@media (min-width:1281px){.relevant_extension{width:32%!important;height:125px!important;opacity:.5}.relevant_extension img{width:110px}.wplc-extension .wp-post-image{height:auto}}.wplc-palette-selection{border:1px solid #ccc;border-radius:5px;padding:5px;margin:5px;height:100%}.wplc_palette_single{margin:5px;margin-top:15px;width:162px;height:122px;text-align:center;display:inline-block;vertical-align:top;cursor:pointer}.wplc-palette-top{display:block;width:100%;height:25%}#wplc_tabs .ui-tabs-anchor{width:100%}#tabs-gutenberg input[type=button]{cursor:pointer}#wplc_custom_css_editor,#wplc_custom_html_editor,#wplc_custom_js_editor{width:560px;height:285px;margin:10px 0 10px 0}#wplc_gutenberg_icon{cursor:pointer}.wplc_code{cursor:pointer;transition:all .2s ease-in-out;border-radius:3px;color:#696969}.wplc_code:hover{background:#d7d7d7}.wplc_code:active,.wplc_code:focus{background:#018add;color:#fff}.wplc_agent_container ul{display:block;overflow:auto}.wplc_agent_container li{display:block;float:left;text-align:center;border:1px solid #ccc;width:150px;height:310px;padding:10px;border-radius:5px;margin:10px;box-shadow:2px 2px 2px #ccc;overflow:auto}.wplc_agent_container img{border-radius:100px}.wplc_agent_container h3{font:bold 12px/16px Arial;padding:0;color:#c2bbbe;display:block;height:40px;text-transform:uppercase}.wplc_agent_container small{word-wrap:break-word;display:block;height:50px}.wplc_agent_container select{width:120px}.initiate_upsell{position:absolute;bottom:0;padding:10px;border-top:1px solid #ccc;width:100%;background-color:#fff}#wplc_dashboard_container{box-sizing:border-box}.wplc_panel_col{display:inline-block!important;box-sizing:border-box;vertical-align:top;padding:15px;margin:0!important}.wplc_col_12{width:100%}.wplc_col_6{width:50%}.wplc_col_4{width:32%}.wplc_dashboard_row{white-space:nowrap}.wplc-center{text-align:center}span.smaller{font-size:.7em}span.wplc-stat{font-size:4em}.wplc_material_panel{background:#fff;box-sizing:border-box;padding:10px;box-shadow:0 1px 3px transparent,0 1px 15px rgba(0,0,0,.04);border-radius:2px;overflow:auto;max-width:100%;width:100%;white-space:normal}.wplc_panel_title{margin-top:0}.wplc_panel_row{display:block!important;width:100%!important}.wplc_panel_row iframe{display:block!important}.wplc_post,.wplc_post_excerpt{width:100%;max-width:100%}.wplc_post_readmore a,.wplc_readmore{color:orange!important;text-decoration:none}.wplc_post_readmore a:hover,.wplc_readmore:hover{text-decoration:underline}.wplc_readmore{padding:10px;padding-top:0;display:block}.wplc_post{border-bottom:1px solid #eee;padding:10px 0;box-sizing:border-box}.wplc_post:last-of-type{border:none!important}.wplc_post_title{font-weight:800;color:#656565;font-size:14px}.wplc_panel_row{padding:10px;box-sizing:border-box}.wplc_panel_inner_title{font-weight:800;font-size:15px;margin-bottom:10px;display:block}.wplc_incident{border-bottom:1px solid #eee;padding:10px 0}.wplc_incident_info{margin-top:10px!important}.wplc_incident_value,.wplc_module_value{text-transform:capitalize}#wplc_dashboard_page_title{padding:15px;padding-bottom:0}#wplc_settings button:not(.button),#wplc_settings input[type=button]:not(.button){background:#e6e6e6;border:none;border-radius:5px;padding:7px 7px}
 
css/chat-style.css CHANGED
@@ -1,923 +1,1195 @@
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
+ #admin_chat_box {
2
+ display: block;
3
+ overflow: auto;
4
+ clear: both;
5
+ padding: 20px;
6
+ -webkit-border-radius: 5px;
7
+ -moz-border-radius: 5px;
8
+ border-radius: 5px;
9
+ border: 1px solid #ccc;
10
+ background-color: #fff;
11
+ }
12
+ .wplc-sub-item-email-string {
13
+ white-space: nowrap;
14
+ display: inline-block;
15
+ width: 120px; /* IE6 needs any width */
16
+ overflow: hidden; /* "overflow" value must be different from visible"*/
17
+ -o-text-overflow: ellipsis; /* Opera < 11*/
18
+ text-overflow: ellipsis; /* IE, Safari (WebKit), Opera >= 11, FF > 6 */
19
+ }
20
+ .admin_chat_box {
21
+ -webkit-border-radius: 5px;
22
+ -moz-border-radius: 5px;
23
+ border-radius: 5px;
24
+ border: 1px solid #ccc;
25
+ display: block;
26
+ background-color: white;
27
+ /*height:315px;*/
28
+ background-color: #ffffff;
29
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#CCC), to(#FFF));
30
+ background-image: -webkit-linear-gradient(top, #CCC, #FFF);
31
+ background-image: -moz-linear-gradient(top, #CCC, #FFF);
32
+ background-image: -o-linear-gradient(top, #CCC, #FFF);
33
+ background-image: linear-gradient(to bottom, #CCC, #FFF);
34
+ }
35
+ .chat_response_box {
36
+ }
37
+ .admin_chat_box_inner {
38
+ height: 210px;
39
+ padding: 10px;
40
+ overflow: scroll;
41
+ overflow-x: hidden;
42
+ background-color: #FFF;
43
+ }
44
+ .admin_chat_box_inner_bottom {
45
+ /*height:60px;*/
46
+ width: 100%;
47
+ border-top: 1px solid #ccc;
48
+ display: block;
49
+ overflow: auto;
50
+ }
51
+ .admin_chat_quick_controls {
52
+ display:flex;
53
+ }
54
+ .admin_visitor_info {
55
+ float: left;
56
+ width: 47%;
57
+ padding-left: 15px;
58
+ min-width: 250px;
59
+ }
60
+ #wplc_admin_chatmsg {
61
+ width: 95%;
62
+ margin: 0 auto;
63
+ margin-top: 10px;
64
+ display: block;
65
+ height: 50px;
66
+ padding: 10px;
67
+ -webkit-border-radius: 5px;
68
+ -moz-border-radius: 5px;
69
+ border-radius: 5px;
70
+ border: 1px solid #ccc;
71
+ }
72
+ .admin_chat_img {
73
+ -webkit-border-radius: 5px;
74
+ -moz-border-radius: 5px;
75
+ border-radius: 5px;
76
+ }
77
+ .admin_chat_box .admin_chat_box_inner {
78
+ background: url('../images/bg/cloudy.jpg') repeat;
79
+ background-size: cover;
80
+ }
81
+ .wplc-admin-message {
82
+ padding: 10px;
83
+ -webkit-border-radius: 2px;
84
+ -moz-border-radius: 2px;
85
+ border-radius: 2px;
86
+ border: 1px solid #ccc;
87
+ margin-top: 2px;
88
+ background-color: #EEE;
89
+ display: inline-block;
90
+ float: left;
91
+ clear: both;
92
+ margin-bottom: 3px;
93
+ word-wrap: break-word;
94
+ max-width: 96%;
95
+ }
96
+ .wplc-user-message {
97
+ padding: 10px;
98
+ -webkit-border-radius: 2px;
99
+ -moz-border-radius: 2px;
100
+ border-radius: 2px;
101
+ border: 1px solid #ffdb99;
102
+ margin-top: 2px;
103
+ background-color: #fff6ef;
104
+ color: #000;
105
+ display: inline-block;
106
+ float: right;
107
+ clear: both;
108
+ margin-bottom: 3px;
109
+ word-wrap: break-word;
110
+ max-width: 96%;
111
+ position: relative;
112
+ right: 35px;
113
+ max-width: 71%;
114
+ }
115
+ .wplc-admin-message {
116
+ padding: 10px;
117
+ -webkit-border-radius: 2px;
118
+ -moz-border-radius: 2px;
119
+ border-radius: 2px;
120
+ border: 1px solid #373737;
121
+ margin-top: 2px;
122
+ background-color: #373737;
123
+ display: inline-block;
124
+ float: left;
125
+ clear: both;
126
+ margin-bottom: 3px;
127
+ position: relative;
128
+ left: 32px;
129
+ color: #FFF;
130
+ max-width: 82%;
131
+ word-wrap: break-word;
132
+ max-width: 71%;
133
+ }
134
+ .wplc-admin-message .wplc-admin-message-avatar {
135
+ border-radius: 25px;
136
+ position: absolute;
137
+ left: -37px;
138
+ top: 3px;
139
+ }
140
+ .wplc-user-message:before {
141
+ display: block;
142
+ width: 0;
143
+ top: 15px;
144
+ bottom: auto;
145
+ left: auto;
146
+ right: -7px;
147
+ border-width: 6px 0 6px 7px;
148
+ border-color: transparent #ffdb99;
149
+ content: "";
150
+ position: absolute;
151
+ border-style: solid;
152
+ }
153
+ .wplc-admin-message:before {
154
+ display: block;
155
+ width: 0;
156
+ top: 15px;
157
+ bottom: auto;
158
+ left: auto;
159
+ left: -7px;
160
+ border-width: 6px 7px 6px 0;
161
+ border-color: transparent #373737;
162
+ content: "";
163
+ position: absolute;
164
+ border-style: solid;
165
+ }
166
+ .wplc-user-message img.wplc-user-message-avatar {
167
+ border-radius: 25px;
168
+ position: absolute;
169
+ right: -37px;
170
+ top: 3px;
171
+ }
172
+ .wplc-user-message hr, .wplc-admin-message hr {
173
+ margin-bottom: 0px !important;
174
+ }
175
+ /* ./Messages */
176
+
177
+ .chat_time {
178
+ display: block;
179
+ width: 100%;
180
+ text-align: center;
181
+ font-size: 0.8em;
182
+ color: #ccc;
183
+ clear: both;
184
+ }
185
+
186
+ /*.admin_visitor_advanced_info {
187
+ clear:both;
188
+ font-size:0.9em;
189
+ margin-top:20px;
190
+
191
+ }*/
192
+ .admin_visitor_advanced_info .part1 {
193
+ color: #3b3b3b;
194
+ }
195
+ .admin_visitor_advanced_info .part2 {
196
+ color: #949494;
197
+ }
198
+ .admin_chat_name {
199
+ font-size: 1.3em;
200
+ display: block;
201
+ clear: right;
202
+ font-weight: bold;
203
+ margin-bottom: 5px;
204
+ }
205
+ .admin_chat_email {
206
+ font-size: 1em;
207
+ display: block;
208
+ clear: right;
209
+ }
210
+ .end_chat_div {
211
+ font-size: 10px;
212
+ margin-left: auto!important;
213
+ }
214
+ /* New Dashboard Layout */
215
+ .wplc_admin_dashboard_container {
216
+ width: 80%;
217
+ margin: 0 auto;
218
+ }
219
+ #wplc_admin_chat_area {
220
+ width: 65%;
221
+ display: inline-block;
222
+ background-color: #FFF;
223
+ float: left;
224
+ /*padding: 10px;*/
225
+ box-shadow: 1px 1px 3px #ccc;
226
+ }
227
+ #wplc_admin_visitor_area {
228
+ width: 30%;
229
+ display: inline-block;
230
+ background-color: #FFF;
231
+ float: right;
232
+ box-shadow: 1px 1px 3px #ccc;
233
+ }
234
+ .wplc_visitor_container {
235
+ padding: 10px;
236
+ }
237
+ .wplc_visitor_container h1 {
238
+ text-align: center;
239
+ line-height: 22px;
240
+ }
241
+ .wplc_chats_container h2 {
242
+ padding: 10px;
243
+ }
244
+ .wplc_chat_section {
245
+ width: 33.33%;
246
+ display: table-cell;
247
+ vertical-align: middle;
248
+ }
249
+ .wplc_agent_actions {
250
+ text-align: center;
251
+ }
252
+ .wplc_single_chat {
253
+ width: 100%;
254
+ display: inline-block;
255
+ border: 1px solid #EEE;
256
+ border-radius: 5px;
257
+ box-shadow: 1px 1px 21px #EEE;
258
+ margin: 8px auto;
259
+ padding: 10px;
260
+ }
261
+ .wplc_single_chat .wplc_user_image {
262
+ width: 30%;
263
+ display: inline-block;
264
+ float: left;
265
+ }
266
+ .wplc_user_meta_data {
267
+ width: 70%;
268
+ display: inline-block;
269
+ }
270
+ .wplc_single_chat .wplc_user_image img {
271
+ border-radius: 100px;
272
+ }
273
+ .wplc_single_visitor {
274
+ border-bottom: 1px solid #ccc;
275
+ padding: 20px;
276
+ }
277
+ .wplc_single_visitor .wplc_chat_status {
278
+ }
279
+ .wplc_single_visitor .wplc_user_image {
280
+ width: 120px;
281
+ display: inline-block;
282
+ margin-right: 10px;
283
+ }
284
+ .wplc_single_visitor .wplc_user_image img {
285
+ border-radius: 100px;
286
+ }
287
+ .wplc_single_visitor .wplc_user_meta_data {
288
+ display: inline-block;
289
+ vertical-align: top;
290
+ }
291
+ .wplc_single_visitor .wplc_user_name {
292
+ }
293
+ .wplc_single_visitor .wplc_user_name h3 {
294
+ margin: 0;
295
+ padding: 0;
296
+ }
297
+ .wplc_single_visitor h3.ui-accordion .ui-accordion-icons {
298
+ margin: 0;
299
+ padding-left: 0;
300
+ }
301
+ .wplc_single_visitor .wplc_user_name h3 i {
302
+ padding: 0 10px;
303
+ }
304
+ .wplc_active {
305
+ color: green;
306
+ }
307
+ .wplc_pending {
308
+ color: orange;
309
+ }
310
+ .wplc_closed {
311
+ color: red;
312
+ }
313
+ .wplc_single_visitor .wplc_user_email {
314
+ }
315
+ .wplc_single_visitor .wplc_user_ip {
316
+ }
317
+ .wplc_single_visitor .wplc_current_page a {
318
+ width: 100%;
319
+ }
320
+ .wplc_single_visitor .wplc_actions {
321
+ }
322
+ .wplc_icon_message {
323
+ font-size: 10px;
324
+ font-weight: normal;
325
+ }
326
+ .wplc_page_title {
327
+ text-align: center;
328
+ }
329
+ .wplc_page_title h1 {
330
+ font-size: 3em;
331
+ }
332
+ .wplc_visitor_icon {
333
+ padding-right: 10px;
334
+ }
335
+
336
+ @media all and (max-width: 550px) {
337
+ #wplc_admin_chat_area {
338
+ width: 100%;
339
+ padding: 0;
340
+ margin: 0 0 10px 0;
341
+ }
342
+ #wplc_admin_visitor_area {
343
+ width: 100%;
344
+ }
345
+ #wplc_admin_chat_area p {
346
+ padding: 10px
347
+ }
348
+ }
349
+
350
+ @media all and (max-width: 1440px) {
351
+ .wplc_single_chat .wplc_user_image {
352
+ width: 100%;
353
+ display: block;
354
+ text-align: center;
355
+ }
356
+ .wplc_user_meta_data {
357
+ width: 100%;
358
+ display: block;
359
+ text-align: center;
360
+ }
361
+ }
362
+
363
+ @media all and (max-width: 1200px) {
364
+ .wplc_chat_section.section_1 {
365
+ display: inline-block;
366
+ width: 100%;
367
+ padding: 10px;
368
+ }
369
+ }
370
+
371
+ @media all and (max-width: 850px) {
372
+ .wplc_chat_section.section_2 {
373
+ display: inline-block;
374
+ width: 100%;
375
+ padding: 10px;
376
+ }
377
+ .admin_visitor_advanced_info {
378
+ clear: both;
379
+ }
380
+ }
381
+ .wplc_admin_dashboard_container p {
382
+ padding: 0 5px;
383
+ }
384
+ .toplevel_page_wplivechat-menu .wp-pointer-content h3 {
385
+ background-color: #0596d4;
386
+ border: 1px solid #0596d4;
387
+ }
388
+ .toplevel_page_wplivechat-menu .wp-pointer-content h3:before {
389
+ color: #0596d4;
390
+ }
391
+ #wplc_admin_chat_holder {
392
+ margin: 0 auto;
393
+ display: block;
394
+ clear: both;
395
+ margin-top:25px!important;
396
+ }
397
+ @media(max-width:600px){
398
+ #wplc_admin_chat_holder{
399
+ margin:auto;
400
+ }
401
+ }
402
+ #wplc_admin_chat_area_new {
403
+ font-size: 13px;
404
+ display: block;
405
+ background-color: #FFF;
406
+ border-radius: 4px;
407
+ box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
408
+ }
409
+
410
+ .wplc_chat_vis_count_box {
411
+ border-radius: 4px;
412
+ display: flex;
413
+ align-items: center;
414
+ justify-content: center;
415
+ }
416
+ .wplc_vis_online, .wplc_agents_online {
417
+ text-align: center;
418
+ font-family: Arial;
419
+ line-height:35px;
420
+ font-weight:bold;
421
+ }
422
+ #wplc_admin_chat_area_new li {
423
+ background: none;
424
+ padding: 0 2px 0 0;
425
+ list-style: none;
426
+ margin: 0;
427
+ }
428
+ #wplc_chat_ul {
429
+ clear: both;
430
+ overflow: auto;
431
+ display: block;
432
+ }
433
+ .wplc_p_cul {
434
+ padding: 10px;
435
+ clear: both;
436
+ display: block;
437
+ overflow: auto;
438
+ border-bottom:1px solid #eee!important;
439
+ margin-bottom:10px;
440
+ }
441
+ .wplc_p_cul:hover {
442
+ border-radius: 4px;
443
+ }
444
+ .wplc_status_box {
445
+ padding: 3px;
446
+ border-radius: 4px;
447
+ color: white;
448
+ font-size: 11px;
449
+ }
450
+ .wplc-agent-info {
451
+ font: bold 12px/24px Arial;
452
+ color: #C2BBBE;
453
+ text-transform: uppercase;
454
+ display: block;
455
+ }
456
+ .wplc_agents_online {
457
+ }
458
+ .wplc_type_new {
459
+ background-color: #E1734A;
460
+ }
461
+ .wplc_type_returning {
462
+ background-color: #0596d4;
463
+ }
464
+ .wplc_status_1 {
465
+ background-color: #CCCCCC;
466
+ }
467
+ .wplc_status_4 {
468
+ background-color: #CCCCCC;
469
+ }
470
+ .wplc_status_8 {
471
+ background-color: #CCCCCC;
472
+ }
473
+ .wplc_status_5 {
474
+ background-color: #B3D24B;
475
+ }
476
+ .wplc_status_2 {
477
+ background-color: #3278CD;
478
+ }
479
+ .wplc_status_3 {
480
+ background-color: #3278CD;
481
+ }
482
+ .wplc_status_6 {
483
+ background-color: red;
484
+ }
485
+ .wplc_status_7 {
486
+ background-color: #BFBCBB;
487
+ }
488
+ .wplc_status_9 {
489
+ background-color: #BFBCBB;
490
+ }
491
+ .browser-tag {
492
+ font-size: 10px;
493
+ }
494
+ .browser-tag img {
495
+ top: 3px;
496
+ position: relative
497
+ }
498
+ .wplc-sub-item-header {
499
+ color: #333;
500
+ }
501
+
502
+ @media (min-width:320px) {
503
+ #wplc_admin_chat_holder {
504
+ width: 98%;
505
+ }
506
+ #wplc_admin_chat_area_new {
507
+ float: none;
508
+ display: block;
509
+ margin: 0 auto;
510
+ }
511
+
512
+ .wplc_headerspan_t {
513
+ display: none;
514
+ }
515
+ .wplc_headerspan_nr {
516
+ display: none;
517
+ }
518
+ .wplc_chat_ul_header {
519
+ display: none;
520
+ }
521
+ .wplc_p_cul {
522
+ border-bottom: 1px solid #ccc;
523
+ }
524
+ #wplc_admin_chat_area_new li {
525
+ float: none;
526
+ }
527
+ .wplc_headerspan_a, .wplc_headerspan_d, .wplc_headerspan_v, .wplc_headerspan_s {
528
+ margin: 5px auto;
529
+ text-align: center;
530
+ }
531
+
532
+ }
533
+
534
+ @media (min-width:481px) {
535
+ #wplc_admin_chat_holder {
536
+ width: 98%;
537
+ }
538
+ #wplc_admin_chat_area_new {
539
+ float: none;
540
+ display: block;
541
+ margin: 0 auto;
542
+ }
543
+
544
+ .wplc_headerspan_t {
545
+ display: none;
546
+ }
547
+ .wplc_headerspan_nr {
548
+ display: none;
549
+ }
550
+ .wplc_chat_ul_header {
551
+ display: none;
552
+ }
553
+ .wplc_p_cul {
554
+ border-bottom: 1px solid #ccc;
555
+ }
556
+ #wplc_admin_chat_area_new li {
557
+ float: none;
558
+ }
559
+ .wplc_headerspan_a, .wplc_headerspan_d, .wplc_headerspan_v, .wplc_headerspan_s {
560
+ margin: 5px auto;
561
+ text-align: center;
562
+ }
563
+
564
+ .wplc-sub-item-email-string {
565
+ white-space: nowrap;
566
+ width: 100%; /* IE6 needs any width */
567
+ overflow: hidden; /* "overflow" value must be different from visible"*/
568
+ -o-text-overflow: ellipsis; /* Opera < 11*/
569
+ text-overflow: ellipsis; /* IE, Safari (WebKit), Opera >= 11, FF > 6 */
570
+ }
571
+ }
572
+
573
+ @media (min-width:641px) {
574
+
575
+ #wplc_admin_chat_area_new {
576
+ float: none;
577
+ display: block;
578
+ margin: 0 auto;
579
+ }
580
+
581
+ .wplc_headerspan_t {
582
+ display: block;
583
+ }
584
+ .wplc_headerspan_nr {
585
+ display: none;
586
+ }
587
+ .wplc_chat_ul_header {
588
+ display: block;
589
+ }
590
+ .wplc_p_cul {
591
+ border-bottom: none;
592
+ }
593
+ #wplc_admin_chat_area_new li {
594
+ float: left;
595
+ }
596
+ .wplc_headerspan_a, .wplc_headerspan_d, .wplc_headerspan_v, .wplc_headerspan_s {
597
+ margin: 0;
598
+ text-align: left;
599
+ }
600
+
601
+ }
602
+
603
+ @media (min-width:961px) {
604
+
605
+ #wplc_admin_chat_area_new {
606
+ float: none;
607
+ display: block;
608
+ margin: 0 auto;
609
+ }
610
+
611
+ .wplc_headerspan_t {
612
+ display: none;
613
+ }
614
+ .wplc_headerspan_nr {
615
+ display: block;
616
+ }
617
+ .wplc_chat_ul_header {
618
+ display: block;
619
+ }
620
+ .wplc_p_cul {
621
+ border-bottom: none;
622
+ }
623
+ #wplc_admin_chat_area_new li {
624
+ float: left;
625
+ }
626
+ .wplc_headerspan_a, .wplc_headerspan_d, .wplc_headerspan_v, .wplc_headerspan_s {
627
+ margin: 0;
628
+ text-align: left;
629
+ }
630
+
631
+ }
632
+
633
+ @media (min-width:1025px) {
634
+
635
+
636
+ #wplc_admin_chat_area_new {
637
+ display: block;
638
+ margin: 0;
639
+ }
640
+
641
+ .wplc_headerspan_t {
642
+ display: none;
643
+ }
644
+ .wplc_headerspan_nr {
645
+ display: block;
646
+ }
647
+ .wplc_chat_ul_header {
648
+ display: block;
649
+ }
650
+ .wplc_p_cul {
651
+ border-bottom: none;
652
+ }
653
+ #wplc_admin_chat_area_new li {
654
+ float: left;
655
+ }
656
+ .wplc_headerspan_a, .wplc_headerspan_d, .wplc_headerspan_v, .wplc_headerspan_s {
657
+ margin: 0;
658
+ text-align: left;
659
+ }
660
+
661
+ }
662
+
663
+ @media (min-width:1281px) {
664
+ #wplc_admin_chat_holder {
665
+ width: 990px;
666
+ }
667
+ #wplc_admin_chat_area_new {
668
+ display: block;
669
+ margin: 0;
670
+ }
671
+
672
+ .wplc_headerspan_t {
673
+ display: block;
674
+ }
675
+ .wplc_headerspan_nr {
676
+ display: block;
677
+ }
678
+ .wplc_chat_ul_header {
679
+ display: block;
680
+ }
681
+ .wplc_p_cul {
682
+ border-bottom: none;
683
+ }
684
+ #wplc_admin_chat_area_new li {
685
+ float: left;
686
+ }
687
+ .wplc_headerspan_a, .wplc_headerspan_d, .wplc_headerspan_v, .wplc_headerspan_s {
688
+ margin: 0;
689
+ text-align: left;
690
+ }
691
+
692
+ }
693
+ .wplc_add_on_button_chat {
694
+ float: left;
695
+ margin-right: 10px;
696
+ }
697
+ .wplc_no_visitors {
698
+ display: block;
699
+ width: 100%;
700
+ text-align: center;
701
+ font-style: italic;
702
+ }
703
+ #wplc_star_rating {
704
+ text-align: center;
705
+ padding: 10px;
706
+ }
707
+ #nifty_file_holder {
708
+ float: right;
709
+ margin-right: 13px;
710
+ margin-top: 4px;
711
+ }
712
+ .nifty_tedit_icon {
713
+ font-size: 12px;
714
+ padding-left: 6px;
715
+ }
716
+ #nifty_text_editor_holder {
717
+ margin-top: 3px;
718
+ margin-left: 4px;
719
+ }
720
+ .wplc_faded_upsell {
721
+ color: lightgrey;
722
+ }
723
+ .wplc_chat_area_temp {
724
+ padding: 20px;
725
+ }
726
+ .offline-quote {
727
+ font-size: 26px;
728
+ font-style: italic;
729
+ text-align: center;
730
+ width: 100%;
731
+ display: block;
732
+ color: #343434;
733
+ }
734
+ .offline-status {
735
+ display: block;
736
+ width: 100%;
737
+ clear: both;
738
+ text-align: center;
739
+ line-height: 45px;
740
+ }
741
+ .wplc-logo {
742
+ padding-top: 50px;
743
+ max-width: 100vw;
744
+ padding-bottom: 50px;
745
+ }
746
+ .wplc_network_issue {
747
+ position: absolute;
748
+ background: white;
749
+ width: 400px;
750
+ height: 55px;
751
+ border-left: 4px solid #0596d4;
752
+ left: 0;
753
+ right: 0;
754
+ top: 0;
755
+ bottom: 0;
756
+ margin: auto;
757
+ box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16), 0 2px 10px 0 rgba(0,0,0,0.12);
758
+ -webkit-box-shadow: 0 0px 0px 0 rgba(0,0,0,0.16), 0 2px 7px 0 rgba(0,0,0,0.12);
759
+ -moz-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16), 0 2px 10px 0 rgba(0,0,0,0.12);
760
+ -o-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16), 0 2px 10px 0 rgba(0,0,0,0.12);
761
+ }
762
+ .wplc_network_issue span {
763
+ width: 80%;
764
+ display: block;
765
+ padding-top: 5%;
766
+ padding-bottom: 5%;
767
+ padding-left: 10%;
768
+ padding-right: 10%;
769
+ margin: auto;
770
+ position: absolute;
771
+ top: 0;
772
+ bottom: 0;
773
+ }
774
+ .wplc_dashboard_additional_label {
775
+ width: 100%;
776
+ text-align: center;
777
+ display: block;
778
+ margin-top: 10px;
779
+ cursor: help;
780
+ }
781
+ .wplc_modal {
782
+ display: block;
783
+ position: fixed;
784
+ top: 0;
785
+ bottom: 0;
786
+ left: 0;
787
+ right: 0;
788
+ background: rgba(0, 0, 0, 0.3);
789
+ }
790
+ .wplc_modal_inner {
791
+ width: 60%;
792
+ height: 300px;
793
+ margin: auto;
794
+ background: #ffffff;
795
+ position: fixed;
796
+ z-index: 9999;
797
+ display: block;
798
+ top: 0;
799
+ bottom: 0;
800
+ left: 0;
801
+ right: 0;
802
+ border: 1px solid #9f9f9f;
803
+ border-radius: 3px;
804
+ }
805
+ .wplc_modal_inner_title {
806
+ font-size: 18px;
807
+ padding: 17px;
808
+ border-bottom: 1px solid #d5d5d5;
809
+ }
810
+ .wplc_modal_inner_content {
811
+ position: absolute;
812
+ display: block;
813
+ left: 10px;
814
+ right: 10px;
815
+ bottom: 55px;
816
+ top: 55px;
817
+ overflow-y: auto;
818
+ }
819
+ .wplc_modal_inner_actions {
820
+ height: 28px;
821
+ position: absolute;
822
+ bottom: 5px;
823
+ left: 0;
824
+ right: 0;
825
+ text-align: center;
826
+ }
827
+ span.wplc-system-notification {
828
+ display: block;
829
+ clear: both;
830
+ padding: 8px;
831
+ font-style: italic;
832
+ text-align: right;
833
+ }
834
+ .widefat th.sortable, .widefat th.sorted {
835
+ padding: 5px 10px !important;
836
+ }
837
+
838
+ @media (max-width: 1145px) {
839
+ .wplc-badge {
840
+ max-width: 35% !important;
841
+ float: none !important;
842
+ margin: 0 auto !important;
843
+ }
844
+ }
845
+ .wplc-chat-in-progress {
846
+ display: inline-block;
847
+ width: 100px;
848
+ margin-top: 5px;
849
+ }
850
+ .wplc-history__date {
851
+ display: block;
852
+ margin-bottom: 5px;
853
+ }
854
+ .wplc-history__date-end {
855
+ margin-bottom: 10px;
856
+ }
857
+ .wplc-history__date strong {
858
+ margin-right: 5px;
859
+ }
860
+ .wplc-exclude-post-types__item, .wplc-require-user-info__item {
861
+ margin-bottom: 5px;
862
+ }
863
+ .wplc-chat-box-notification--disabled {
864
+ padding: 5px;
865
+ display: block;
866
+ width: 40%;
867
+ margin-left: auto;
868
+ margin-right: auto;
869
+ border: 1px solid #d26d6d;
870
+ background-color: #f3bfbf;
871
+ font-weight: bold;
872
+ }
873
+ .admin_chat_box_inner span.timedate {
874
+ clear: both;
875
+ position: relative;
876
+ font-size: 0.8em;
877
+ font-style: italic
878
+ }
879
+ .wplc-msg-float-left {
880
+ left: 32px;
881
+ float: left;
882
+ }
883
+ .wplc-msg-float-right {
884
+ right: 32px;
885
+ float: right;
886
+ }
887
+ #wplc-chat-box {
888
+ width: fit-content;
889
+ position: relative;
890
+ cursor: pointer;
891
+ }
892
+ .wplc_block {
893
+ position: relative;
894
+ display: inline-block;
895
+ background: #32373c;
896
+ color: #eee;
897
+ border-radius: 3px;
898
+ height: 35px;
899
+ padding-left: 45px;
900
+ margin: 5px 0 5px 0;
901
+ transition: all .2s ease-in-out;
902
+ cursor: pointer;
903
+ border-bottom: 0px solid #111;
904
+ font-size: 17px;
905
+ line-height: 35px;
906
+ }
907
+ .wplc_block:hover {
908
+ transform: translateY(-2px);
909
+ }
910
+ .wplc_block:after {
911
+ content: "";
912
+ position: absolute;
913
+ display: block;
914
+ height: 0px;
915
+ bottom: 0;
916
+ left: 0;
917
+ width: 100%;
918
+ background-color: #000;
919
+ opacity: 0;
920
+ transition: all .2s ease-in-out;
921
+ }
922
+ .wplc_block:hover:after {
923
+ height: 3px;
924
+ opacity: .2;
925
+ }
926
+ #wplc-chat-box.disabled:first-child:after {
927
+ content: "Disabled";
928
+ color: #fff;
929
+ font-size: 17px;
930
+ text-transform: uppercase;
931
+ text-align: center;
932
+ display: block;
933
+ position: absolute;
934
+ height: 100%;
935
+ width: 100%;
936
+ bottom: 0;
937
+ left: 0;
938
+ background: #0596d4;
939
+ opacity: .9;
940
+ }
941
+ .wplc_block_logo {
942
+ width: 35px;
943
+ height: 35px;
944
+ position: absolute;
945
+ left: 0;
946
+ background: #e7e7e7;
947
+ display: inline-block;
948
+ margin: 0;
949
+ background-size: cover;
950
+ background-position: center;
951
+ background-color: #0596d4 !important;
952
+ transition: all .2s ease-in-out;
953
+ box-sizing: border-box;
954
+ box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
955
+ -webkit-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
956
+ -moz-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
957
+ }
958
+ .wplc_block_text {
959
+ display: inline-block;
960
+ height: 100%;
961
+ margin-right: 7px;
962
+ }
963
+ .wplc_block_icon {
964
+ height: 100%;
965
+ width: 35px;
966
+ background: transparent;
967
+ display: inline-block;
968
+ }
969
+ .wplc_block_icon.disabled {
970
+ display: none;
971
+ }
972
+ /* Block size styles: small */
973
+ .wplc_block.sm {
974
+ height: 25px;
975
+ line-height: 25px;
976
+ padding-left: 30px;
977
+ font-size: 12px;
978
+ }
979
+ .wplc_block.sm:hover:after {
980
+ height: 2px;
981
+ opacity: .2;
982
+ }
983
+ .wplc_block.sm .wplc_block_logo {
984
+ height: 25px;
985
+ width: 25px;
986
+ }
987
+ .wplc_block.sm .wplc_block_text {
988
+ margin-right: 7px;
989
+ }
990
+ .wplc_block.sm .wplc_block_icon {
991
+ margin-right: 7px;
992
+ width: 13px;
993
+ }
994
+ /* Block size styles: large */
995
+ .wplc_block.lg {
996
+ height: 80px;
997
+ line-height: 80px;
998
+ padding-left: 100px;
999
+ font-size: 25px;
1000
+ }
1001
+ .wplc_block.lg:hover:after {
1002
+ height: 6px;
1003
+ opacity: .2;
1004
+ }
1005
+ .wplc_block.lg .wplc_block_logo {
1006
+ height: 80px;
1007
+ width: 80px;
1008
+ }
1009
+ .wplc_block.lg .wplc_block_text {
1010
+ margin-right: 13px;
1011
+ }
1012
+ .wplc_block.lg .wplc_block_icon {
1013
+ margin-right: 13px;
1014
+ }
1015
+
1016
+
1017
+ .wplc_admin_chat_on_premise_header{
1018
+ margin-bottom:12px;
1019
+ }
1020
+
1021
+ .wplc_admin_chat_on_premise_header_left{
1022
+ flex-basis:50%;
1023
+ transition: all .2s ease-in-out;
1024
+ }
1025
+ .wplc_admin_chat_on_premise_header_right{
1026
+ padding:5px 0px 5px 8px;
1027
+ border-radius: 5px;
1028
+ margin-left: auto!important;
1029
+ justify-content: center;
1030
+ align-self: flex-end;
1031
+ }
1032
+ .wplc_vis_online_label{
1033
+ width: 55px;
1034
+ display: inline-block;
1035
+ position:relative;
1036
+ padding:5px;
1037
+ line-height: 13px;
1038
+ }
1039
+ .wplc_vis_online_label_l{
1040
+ padding-right:10px;
1041
+ margin-right:10px;
1042
+ }
1043
+ .wplc_vis_online_label_l::after{
1044
+ content: "";
1045
+ position: absolute;
1046
+ right: 0;
1047
+ top: -1px;
1048
+ width: 1px;
1049
+ background-color: #a5a5a5;
1050
+ height: 37px;
1051
+ }
1052
+
1053
+ #wplc_dashboard_department_selector{
1054
+ cursor: pointer;
1055
+ padding:5px 30px 5px 10px;
1056
+ height:auto!important;
1057
+ position:relative;
1058
+ -webkit-appearance: none;
1059
+ -moz-appearance: none;
1060
+ -ms-appearance: none;
1061
+ -o-appearance: none;
1062
+ appearance: none;
1063
+ border:1px solid #0596d4;
1064
+ }
1065
+
1066
+ #wplc_dashboard_department_selector option{
1067
+ background-color:#FFF;
1068
+ color:#333;
1069
+ cursor:pointer;
1070
+ }
1071
+
1072
+ .wplc_dashboard_department_selector_outer{
1073
+ position: relative;
1074
+ }
1075
+
1076
+ .wplc_dashboard_department_selector_outer:after {
1077
+ content: '';
1078
+ right: 15px;
1079
+ top: 16px;
1080
+ padding: 0 0 2px;
1081
+ background-image: url(../images/wplc_dashboard_department_selector.png);
1082
+ background-repeat: no-repeat;
1083
+ width: 13px;
1084
+ height: 25px;
1085
+ position: absolute;
1086
+ pointer-events: none;
1087
+ }
1088
+
1089
+ .wplc_admin_chat_on_premise_switchery_label{
1090
+ font-size:12px;
1091
+ display:block;
1092
+ text-align:right;
1093
+ margin-bottom:10px;
1094
+ }
1095
+
1096
+ .wplc_open_chat{
1097
+ background-color: #0596d4!important;
1098
+ color: #FFF!important;
1099
+ border: none!important;
1100
+ box-shadow: none!important;
1101
+ text-shadow: none!important;
1102
+ }
1103
+ .wplc_chat_dashboard_on_premise_stats{
1104
+ margin-right:25px;
1105
+ font-size:15px;
1106
+ }
1107
+ .wplc_admin_chat_on_premise_header_left h2{
1108
+ display:inline-block;
1109
+ margin-right:15px;
1110
+ }
1111
+ .wplc_admin_chat_switchery_a{
1112
+ margin: 0 auto;
1113
+ display:inline-block;
1114
+ }
1115
+ #wplc_agent_status_text{
1116
+ display: inline-block;
1117
+ padding-left: 10px;
1118
+ }
1119
+
1120
+ .wplc_on_premise_chat_window_header{
1121
+ display:flex;
1122
+ margin-bottom: 5px;
1123
+ }
1124
+
1125
+ .wplc_on_premise_chat_window h2{
1126
+ background: #0596d4;
1127
+ margin-top: 0;
1128
+ padding: 7px;
1129
+ color: #FFF;
1130
+ margin-bottom: 3px;
1131
+ border-radius: 2px;
1132
+ font-weight: normal;
1133
+ font-size: 16px;
1134
+ display:inline-block;
1135
+ }
1136
+
1137
+ .wplc_on_premise_chat_box_user_info {
1138
+ position: relative;
1139
+ display: flex;
1140
+ margin-bottom: 10px;
1141
+ }
1142
+ .wplc_on_premise_chat_box_user_info_avatar{
1143
+ width:50px;
1144
+ padding-right:10px;
1145
+ }
1146
+ .wplc_on_premise_chat_box_user_info_details{
1147
+ flex-basis:100%;
1148
+ }
1149
+ .wplc_on_premise_chat_box_user_info_rating{
1150
+ flex-basis:15%;
1151
+ margin-left:auto!important;
1152
+ align-self: flex-end;
1153
+ }
1154
+
1155
+ .wplc_on_premise_chat_quick_response{
1156
+ margin-left: auto!important;
1157
+ padding-top:5px;
1158
+ }
1159
+
1160
+ #wplc_admin_email_transcript{
1161
+ margin-left:3px;
1162
+ }
1163
+
1164
+ .admin_visitor_advanced_info{
1165
+ align-self: flex-end;
1166
+ }
1167
+
1168
+
1169
+ @media(min-width:800px){
1170
+ .wplc_admin_chat_on_premise_header{
1171
+ display:flex;
1172
+ }
1173
+ .wplc_chat_dashboard_on_premise_stats{
1174
+ margin-right:15px;
1175
+ }
1176
+ }
1177
+
1178
+ @media(max-width:800px){
1179
+ .wplc_admin_chat_on_premise_header_right{
1180
+ padding:15px;
1181
+ }
1182
+ .wplc_admin_chat_on_premise_header_left{
1183
+ text-align:center;
1184
+ }
1185
+ .wplc_admin_chat_on_premise_switchery_label{
1186
+ text-align:center;
1187
+ padding:5px;
1188
+ }
1189
+ }
1190
+
1191
+ @media(max-width:420px){
1192
+ .wplc_dashboard_department_selector_outer{
1193
+ display:block;
1194
+ }
1195
+ }
css/chat-style.min.css DELETED
@@ -1 +0,0 @@
1
- #admin_chat_box{display:block;overflow:auto;clear:both;padding:20px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;border:1px solid #ccc;background-color:#fff;width:85%;min-width:675px}.wplc-sub-item-email-string{white-space:nowrap;display:inline-block;width:120px;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis}.admin_chat_box{-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;border:1px solid #ccc;float:left;display:block;background-color:#fff;width:50%;min-width:300px;background-color:#fff;background-image:-webkit-gradient(linear,left top,left bottom,from(#ccc),to(#fff));background-image:-webkit-linear-gradient(top,#ccc,#fff);background-image:-moz-linear-gradient(top,#ccc,#fff);background-image:-o-linear-gradient(top,#ccc,#fff);background-image:linear-gradient(to bottom,#ccc,#fff)}.admin_chat_box_inner{height:210px;padding:10px;overflow:scroll;overflow-x:hidden;background-color:#fff}.admin_chat_box_inner_bottom{width:100%;border-top:1px solid #ccc;display:block;overflow:auto}.admin_chat_quick_controls{clear:left;padding-left:10px}.admin_visitor_info{float:left;width:47%;padding-left:15px;min-width:250px}#wplc_admin_chatmsg{width:95%;margin:0 auto;margin-top:10px;display:block;height:50px;padding:10px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;border:1px solid #ccc}.admin_chat_img{-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.admin_chat_box .admin_chat_box_inner{background:url(../images/bg/cloudy.jpg) repeat;background-size:cover}.wplc-admin-message{padding:10px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;border:1px solid #ccc;margin-top:2px;background-color:#eee;display:inline-block;float:left;clear:both;margin-bottom:3px;word-wrap:break-word;max-width:96%}.wplc-user-message{padding:10px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;border:1px solid #ffdb99;margin-top:2px;background-color:#fff6ef;color:#000;display:inline-block;float:right;clear:both;margin-bottom:3px;word-wrap:break-word;max-width:96%;position:relative;right:35px;max-width:71%}.wplc-admin-message{padding:10px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;border:1px solid #666;margin-top:2px;background-color:#666;display:inline-block;float:left;clear:both;margin-bottom:3px;position:relative;left:32px;color:#fff;max-width:82%;word-wrap:break-word;max-width:71%}.wplc-admin-message img{border-radius:25px;position:absolute;left:-37px;top:3px}.wplc-user-message:before{display:block;width:0;top:15px;bottom:auto;left:auto;right:-7px;border-width:6px 0 6px 7px;border-color:transparent #ffdb99;content:"";position:absolute;border-style:solid}.wplc-admin-message:before{display:block;width:0;top:15px;bottom:auto;left:auto;left:-7px;border-width:6px 7px 6px 0;border-color:transparent #666;content:"";position:absolute;border-style:solid}.wplc-user-message img.wplc-user-message-avatar{border-radius:25px;position:absolute;right:-37px;top:3px}.wplc-admin-message hr,.wplc-user-message hr{margin-bottom:0!important}.chat_time{display:block;width:100%;text-align:center;font-size:.8em;color:#ccc;clear:both}.admin_visitor_advanced_info{clear:left}.admin_visitor_advanced_info .part1{color:#3b3b3b}.admin_visitor_advanced_info .part2{color:#949494}.admin_chat_name{font-size:1.3em;display:block;clear:right;font-weight:700;margin-bottom:5px}.admin_chat_email{font-size:1em;display:block;clear:right}.end_chat_div{display:block;clear:both;text-align:right;font-size:10px;width:85%;margin-left:40px;margin-bottom:20px}.wplc_admin_dashboard_container{width:80%;margin:0 auto}#wplc_admin_chat_area{width:65%;display:inline-block;background-color:#fff;float:left;box-shadow:1px 1px 3px #ccc}#wplc_admin_visitor_area{width:30%;display:inline-block;background-color:#fff;float:right;box-shadow:1px 1px 3px #ccc}.wplc_visitor_container{padding:10px}.wplc_visitor_container h1{text-align:center;line-height:22px}.wplc_chats_container h2{padding:10px}.wplc_chat_section{width:33.33%;display:table-cell;vertical-align:middle}.wplc_agent_actions{text-align:center}.wplc_single_chat{width:100%;display:inline-block;border:1px solid #eee;border-radius:5px;box-shadow:1px 1px 21px #eee;margin:8px auto;padding:10px}.wplc_single_chat .wplc_user_image{width:30%;display:inline-block;float:left}.wplc_user_meta_data{width:70%;display:inline-block}.wplc_single_chat .wplc_user_image img{border-radius:100px}.wplc_single_visitor{border-bottom:1px solid #ccc;padding:20px}.wplc_single_visitor .wplc_user_image{width:120px;display:inline-block;margin-right:10px}.wplc_single_visitor .wplc_user_image img{border-radius:100px}.wplc_single_visitor .wplc_user_meta_data{display:inline-block;vertical-align:top}.wplc_single_visitor .wplc_user_name h3{margin:0;padding:0}.wplc_single_visitor h3.ui-accordion .ui-accordion-icons{margin:0;padding-left:0}.wplc_single_visitor .wplc_user_name h3 i{padding:0 10px}.wplc_active{color:green}.wplc_pending{color:orange}.wplc_closed{color:red}.wplc_single_visitor .wplc_current_page a{width:100%}.wplc_icon_message{font-size:10px;font-weight:400}.wplc_page_title{text-align:center}.wplc_page_title h1{font-size:3em}.wplc_visitor_icon{padding-right:10px}@media all and (max-width:550px){#wplc_admin_chat_area{width:100%;padding:0;margin:0 0 10px 0}#wplc_admin_visitor_area{width:100%}#wplc_admin_chat_area p{padding:10px}}@media all and (max-width:1440px){.wplc_single_chat .wplc_user_image{width:100%;display:block;text-align:center}.wplc_user_meta_data{width:100%;display:block;text-align:center}}@media all and (max-width:1200px){.wplc_chat_section.section_1{display:inline-block;width:100%;padding:10px}}@media all and (max-width:850px){.wplc_chat_section.section_2{display:inline-block;width:100%;padding:10px}.admin_visitor_advanced_info{width:93%;clear:both}}.wplc_admin_dashboard_container p{padding:0 5px}.toplevel_page_wplivechat-menu .wp-pointer-content h3{background-color:#ec822c;border:1px solid #ec822c}.toplevel_page_wplivechat-menu .wp-pointer-content h3:before{color:#ec822c}#wplc_admin_chat_holder{width:990px;margin:0 auto;display:block;overflow:auto;clear:both}#wplc_admin_chat_area_new{width:750px;font-size:13px;float:left;display:block;background-color:#fff;border-radius:25px}#wplc_admin_chat_info_new{float:left;width:240px;display:block;margin-bottom:20px}.wplc_chat_vis_count_box{width:57%;min-width:198px;background-color:#fff;min-height:150px;border-radius:25px;margin-left:auto;margin-right:auto;display:block;text-align:center;padding:10px}.wplc_vis_online{font-size:60px;line-height:70px;color:#ec822c;text-align:center;padding-top:36px;font-family:Arial;display:block;font-weight:700}#wplc_admin_chat_area_new li{float:left;background:0 0;padding:0 2px 0 0;list-style:none;margin:0}#wplc_chat_ul{clear:both;overflow:auto;display:block}.wplc_p_cul{padding:10px;clear:both;display:block;overflow:auto}.wplc_p_cul:hover{background-color:#eee;border-radius:5px}.wplc_status_box{padding:3px;border-radius:5px;color:#fff;font-size:11px}.wplc-agent-info{font:bold 12px/24px Arial;color:#c2bbbe;text-transform:uppercase;display:block}.wplc_agents_online{color:#ec822c}.wplc_type_new{background-color:#e1734a}.wplc_type_returning{background-color:#ec822c}.wplc_status_1{background-color:#ccc}.wplc_status_4{background-color:#ccc}.wplc_status_8{background-color:#ccc}.wplc_status_5{background-color:#b3d24b}.wplc_status_2{background-color:#3278cd}.wplc_status_3{background-color:#3278cd}.wplc_status_6{background-color:red}.wplc_status_7{background-color:#bfbcbb}.wplc_status_9{background-color:#bfbcbb}.browser-tag{font-size:10px}.browser-tag img{top:3px;position:relative}.wplc-sub-item-header{color:#c7c3c3;font-style:italic}@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_s,.wplc_headerspan_v{margin:5px auto;text-align:center}.wplc_chat_vis_count_box{min-width:180px}}@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_s,.wplc_headerspan_v{margin:5px auto;text-align:center}.wplc_chat_vis_count_box{min-width:180px}.wplc-sub-item-email-string{white-space:nowrap;width:100%;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis}}@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_s,.wplc_headerspan_v{margin:0;text-align:left}.wplc_chat_vis_count_box{min-width:180px}}@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_s,.wplc_headerspan_v{margin:0;text-align:left}.wplc_chat_vis_count_box{min-width:110px}}@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_s,.wplc_headerspan_v{margin:0;text-align:left}.wplc_chat_vis_count_box{min-width:110px}}@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_s,.wplc_headerspan_v{margin:0;text-align:left}.wplc_chat_vis_count_box{min-width:198px}}.wplc_add_on_button_chat{float:left;margin-right:10px}.wplc_no_visitors{display:block;width:100%;text-align:center;font-style:italic}#wplc_star_rating{text-align:center;padding:10px}#nifty_file_holder{float:right;margin-right:13px;margin-top:4px}.nifty_tedit_icon{font-size:12px;padding-left:6px}#nifty_text_editor_holder{margin-top:3px;margin-left:4px}.wplc_faded_upsell{color:#d3d3d3}.wplc_chat_area_temp{padding:20px}.offline-quote{font-size:26px;font-style:italic;text-align:center;width:100%;display:block;color:#343434}.offline-status{display:block;width:100%;clear:both;text-align:center;line-height:45px}.wplc-logo{padding-top:50px;max-width:100vw;padding-bottom:50px}.wplc_network_issue{position:absolute;background:#fff;width:400px;height:55px;border-left:4px solid #ec822c;left:0;right:0;top:0;bottom:0;margin:auto;box-shadow:0 2px 5px 0 rgba(0,0,0,.16),0 2px 10px 0 rgba(0,0,0,.12);-webkit-box-shadow:0 0 0 0 rgba(0,0,0,.16),0 2px 7px 0 rgba(0,0,0,.12);-moz-box-shadow:0 2px 5px 0 rgba(0,0,0,.16),0 2px 10px 0 rgba(0,0,0,.12);-o-box-shadow:0 2px 5px 0 rgba(0,0,0,.16),0 2px 10px 0 rgba(0,0,0,.12)}.wplc_network_issue span{width:80%;display:block;padding-top:5%;padding-bottom:5%;padding-left:10%;padding-right:10%;margin:auto;position:absolute;top:0;bottom:0}.wplc_dashboard_additional_label{width:100%;text-align:center;display:block;margin-top:10px;cursor:help}.wplc_modal{display:block;position:fixed;top:0;bottom:0;left:0;right:0;background:rgba(0,0,0,.3)}.wplc_modal_inner{width:60%;height:300px;margin:auto;background:#fff;position:fixed;z-index:9999;display:block;top:0;bottom:0;left:0;right:0;border:1px solid #9f9f9f;border-radius:3px}.wplc_modal_inner_title{font-size:18px;padding:17px;border-bottom:1px solid #d5d5d5}.wplc_modal_inner_content{position:absolute;display:block;left:10px;right:10px;bottom:55px;top:55px;overflow-y:auto}.wplc_modal_inner_actions{height:28px;position:absolute;bottom:5px;left:0;right:0;text-align:center}span.wplc_system_notification{display:block;clear:both;padding:8px;font-style:italic;text-align:right}.widefat th.sortable,.widefat th.sorted{padding:5px 10px!important}@media (max-width:1145px){.wplc-badge{max-width:35%!important;float:none!important;margin:0 auto!important}}.wplc-chat-in-progress{display:inline-block;width:100px;margin-top:5px}.wplc-history__date{display:block;margin-bottom:5px}.wplc-history__date-end{margin-bottom:10px}.wplc-history__date strong{margin-right:5px}.wplc-exclude-post-types__item,.wplc-require-user-info__item{margin-bottom:5px}.wplc-chat-box-notification--disabled{padding:5px;display:block;width:40%;margin-left:auto;margin-right:auto;border:1px solid #d26d6d;background-color:#f3bfbf;font-weight:700}.admin_chat_box_inner span.timedate{clear:both;position:relative;font-size:.8em;font-style:italic}.wplc-msg-float-left{left:32px;float:left}.wplc-msg-float-right{right:32px;float:right}#wplc-chat-box{width:fit-content;position:relative;cursor:pointer}.wplc_block{position:relative;display:inline-block;background:#32373c;color:#eee;border-radius:3px;height:35px;padding-left:45px;margin:5px 0 5px 0;transition:all .2s ease-in-out;cursor:pointer;border-bottom:0 solid #111;font-size:17px;line-height:35px}.wplc_block:hover{transform:translateY(-2px)}.wplc_block:after{content:"";position:absolute;display:block;height:0;bottom:0;left:0;width:100%;background-color:#000;opacity:0;transition:all .2s ease-in-out}.wplc_block:hover:after{height:3px;opacity:.2}#wplc-chat-box.disabled:first-child:after{content:"Disabled";color:#fff;font-size:17px;text-transform:uppercase;text-align:center;display:block;position:absolute;height:100%;width:100%;bottom:0;left:0;background:#ed832f;opacity:.9}.wplc_block_logo{width:35px;height:35px;position:absolute;left:0;background:#e7e7e7;display:inline-block;margin:0;background-size:cover;background-position:center;background-color:#ed832f!important;transition:all .2s ease-in-out;box-sizing:border-box;box-shadow:inset -2px 0 0 0 rgba(0,0,0,.28);-webkit-box-shadow:inset -2px 0 0 0 rgba(0,0,0,.28);-moz-box-shadow:inset -2px 0 0 0 rgba(0,0,0,.28)}.wplc_block_text{display:inline-block;height:100%;margin-right:7px}.wplc_block_icon{height:100%;width:35px;background:0 0;display:inline-block}.wplc_block_icon.disabled{display:none}.wplc_block.sm{height:25px;line-height:25px;padding-left:30px;font-size:12px}.wplc_block.sm:hover:after{height:2px;opacity:.2}.wplc_block.sm .wplc_block_logo{height:25px;width:25px}.wplc_block.sm .wplc_block_text{margin-right:7px}.wplc_block.sm .wplc_block_icon{margin-right:7px;width:13px}.wplc_block.lg{height:80px;line-height:80px;padding-left:100px;font-size:25px}.wplc_block.lg:hover:after{height:6px;opacity:.2}.wplc_block.lg .wplc_block_logo{height:80px;width:80px}.wplc_block.lg .wplc_block_text{margin-right:13px}.wplc_block.lg .wplc_block_icon{margin-right:13px}
 
css/chat_dashboard/admin_style.css CHANGED
@@ -240,11 +240,8 @@
240
  background-color:#efefef;
241
  }
242
 
243
-
244
-
245
-
246
  #nifty_wrapper span.chatClose {
247
- display:block;
248
  width: 46px;
249
  height: 20px;
250
  position: absolute;
@@ -254,7 +251,6 @@
254
  border: 1px solid #777;
255
  border-radius: 10px;
256
  font-size: 0.8em;
257
- vertical-align: middle;
258
  padding-top: 0px;
259
  color: #777;
260
  cursor: pointer;
@@ -336,6 +332,7 @@
336
  background-color:#fff;
337
  border-right:1px solid #ccc;
338
  }
 
339
  #nifty_wrapper .infoAreaHeader {
340
  padding:20px;
341
  color:#FFF;
@@ -344,9 +341,7 @@
344
  height:60px;
345
  background-color:#333;
346
  }
347
- #nifty_wrapper .infoArea {
348
-
349
- }
350
  #nifty_wrapper .infoArea h2 {
351
  font-size: 24px;
352
  font-weight: 100;
@@ -361,7 +356,6 @@
361
  font-size: 2em;
362
  }
363
 
364
-
365
  /* Pages */
366
 
367
  #nifty_wrapper .pages {
@@ -1069,7 +1063,7 @@
1069
  margin-bottom: 5px;
1070
  }
1071
 
1072
- #nifty_wrapper .bleeper_in_chat_card {
1073
  background: #fff;
1074
  box-shadow: 0 0 10px 1px rgba(0,0,0,0.05);
1075
  display: inline-block;
@@ -1079,7 +1073,7 @@
1079
  padding-bottom: 5px;
1080
  }
1081
 
1082
- #nifty_wrapper .bleeper_in_chat_card i {
1083
  color: #9e9e9e;
1084
  padding: 13px;
1085
  font-size: 12px;
@@ -1088,7 +1082,7 @@
1088
  margin-right: 10px;
1089
  }
1090
 
1091
- #nifty_wrapper .bleeper_dynamic_link small strong {
1092
  text-transform: capitalize;
1093
  }
1094
 
@@ -1102,7 +1096,7 @@
1102
  padding-right:5px;
1103
  border-radius:10px;
1104
  }
1105
- #nifty_wrapper span.bleeper_close_item {
1106
  position: absolute;
1107
  right: 3px;
1108
  top: 3px;
@@ -1115,12 +1109,12 @@
1115
  line-height: 11px;
1116
  font-size: 10px;
1117
  }
1118
- #nifty_wrapper span.bleeper_close_item:hover {
1119
  background-color: #ccc;
1120
  color: #fff;
1121
  border: 1px solid #bdbdbc;
1122
  }
1123
- #nifty_wrapper .bleeper_close_item {
1124
  display:none;
1125
  }
1126
 
@@ -1137,7 +1131,7 @@
1137
  border-radius: 10px;
1138
  }
1139
 
1140
- #nifty_wrapper .bleeper_userlist_gravatar {
1141
  border-radius: 24px;
1142
  position: absolute;
1143
  top:13px;
@@ -1179,7 +1173,7 @@
1179
  }
1180
 
1181
  @media screen and (max-width: 700px){
1182
- #bleeper_offline_image{
1183
  display:none !important;
1184
  }
1185
 
@@ -1203,7 +1197,7 @@
1203
  font-size: 24px;
1204
  }
1205
 
1206
- .bleeper_tips_hints {
1207
  top: 2% !important;
1208
  margin-top: 22px !important;
1209
  }
@@ -1258,7 +1252,7 @@
1258
  font-size: 18px;
1259
  }
1260
 
1261
- #nifty_wrapper .bleeper_tips_hints {
1262
  padding-left: 10px;
1263
  padding-right: 10px;
1264
  }
@@ -1267,7 +1261,7 @@
1267
  max-height: 60px !important;
1268
  }
1269
 
1270
- #nifty_wrapper .bleeper_tips_hints {
1271
  padding-left: 10px;
1272
  padding-right: 10px;
1273
  }
@@ -1310,7 +1304,7 @@
1310
  max-height: 60px !important;
1311
  }
1312
 
1313
- #nifty_wrapper .bleeper_tips_hints {
1314
  padding-left: 10px;
1315
  padding-right: 10px;
1316
  }
@@ -1329,7 +1323,7 @@
1329
  font-size: 17px;
1330
  }
1331
 
1332
- #nifty_wrapper .bleeper_tips_hints {
1333
  display: none !important;
1334
  }
1335
 
@@ -1385,7 +1379,7 @@
1385
  }
1386
  #nifty_wrapper .userList .userItemLastMessage { display:none !important; }
1387
 
1388
- #nifty_wrapper .bleeper_join_chat_div {
1389
  display:none;
1390
  bottom: 0;
1391
  height: 60px;
@@ -1401,7 +1395,7 @@
1401
  background-color: #efefef;
1402
  background: #efefef !important;
1403
  }
1404
- #nifty_wrapper .bleeper_join_chat_div button {
1405
  position:absolute;
1406
  left:50%;
1407
  top:15px;
@@ -1439,7 +1433,7 @@
1439
  }
1440
 
1441
  @media screen and (max-height:550px){
1442
- #bleeper_offline_image {
1443
  max-height: 130px;
1444
  display:block;
1445
  margin-left:auto;
@@ -1448,7 +1442,7 @@
1448
  .nifty_bg_holder_text{
1449
  font-size:1.4em;
1450
  }
1451
- .bleeper_tips_hints{
1452
  top:8% !important;
1453
  }
1454
  }
@@ -1469,7 +1463,7 @@
1469
  padding:0 !important;
1470
  }
1471
 
1472
- span.bleeper-edit-message {
1473
  font-size: 12px;
1474
  float: right;
1475
  }
240
  background-color:#efefef;
241
  }
242
 
 
 
 
243
  #nifty_wrapper span.chatClose {
244
+ display: block;
245
  width: 46px;
246
  height: 20px;
247
  position: absolute;
251
  border: 1px solid #777;
252
  border-radius: 10px;
253
  font-size: 0.8em;
 
254
  padding-top: 0px;
255
  color: #777;
256
  cursor: pointer;
332
  background-color:#fff;
333
  border-right:1px solid #ccc;
334
  }
335
+
336
  #nifty_wrapper .infoAreaHeader {
337
  padding:20px;
338
  color:#FFF;
341
  height:60px;
342
  background-color:#333;
343
  }
344
+
 
 
345
  #nifty_wrapper .infoArea h2 {
346
  font-size: 24px;
347
  font-weight: 100;
356
  font-size: 2em;
357
  }
358
 
 
359
  /* Pages */
360
 
361
  #nifty_wrapper .pages {
1063
  margin-bottom: 5px;
1064
  }
1065
 
1066
+ #nifty_wrapper .tcx_in_chat_card {
1067
  background: #fff;
1068
  box-shadow: 0 0 10px 1px rgba(0,0,0,0.05);
1069
  display: inline-block;
1073
  padding-bottom: 5px;
1074
  }
1075
 
1076
+ #nifty_wrapper .tcx_in_chat_card i {
1077
  color: #9e9e9e;
1078
  padding: 13px;
1079
  font-size: 12px;
1082
  margin-right: 10px;
1083
  }
1084
 
1085
+ #nifty_wrapper .tcx_dynamic_link small strong {
1086
  text-transform: capitalize;
1087
  }
1088
 
1096
  padding-right:5px;
1097
  border-radius:10px;
1098
  }
1099
+ #nifty_wrapper span.tcx_close_item {
1100
  position: absolute;
1101
  right: 3px;
1102
  top: 3px;
1109
  line-height: 11px;
1110
  font-size: 10px;
1111
  }
1112
+ #nifty_wrapper span.tcx_close_item:hover {
1113
  background-color: #ccc;
1114
  color: #fff;
1115
  border: 1px solid #bdbdbc;
1116
  }
1117
+ #nifty_wrapper .tcx_close_item {
1118
  display:none;
1119
  }
1120
 
1131
  border-radius: 10px;
1132
  }
1133
 
1134
+ #nifty_wrapper .tcx_userlist_gravatar {
1135
  border-radius: 24px;
1136
  position: absolute;
1137
  top:13px;
1173
  }
1174
 
1175
  @media screen and (max-width: 700px){
1176
+ #tcx_offline_image{
1177
  display:none !important;
1178
  }
1179
 
1197
  font-size: 24px;
1198
  }
1199
 
1200
+ .tcx_tips_hints {
1201
  top: 2% !important;
1202
  margin-top: 22px !important;
1203
  }
1252
  font-size: 18px;
1253
  }
1254
 
1255
+ #nifty_wrapper .tcx_tips_hints {
1256
  padding-left: 10px;
1257
  padding-right: 10px;
1258
  }
1261
  max-height: 60px !important;
1262
  }
1263
 
1264
+ #nifty_wrapper .tcx_tips_hints {
1265
  padding-left: 10px;
1266
  padding-right: 10px;
1267
  }
1304
  max-height: 60px !important;
1305
  }
1306
 
1307
+ #nifty_wrapper .tcx_tips_hints {
1308
  padding-left: 10px;
1309
  padding-right: 10px;
1310
  }
1323
  font-size: 17px;
1324
  }
1325
 
1326
+ #nifty_wrapper .tcx_tips_hints {
1327
  display: none !important;
1328
  }
1329
 
1379
  }
1380
  #nifty_wrapper .userList .userItemLastMessage { display:none !important; }
1381
 
1382
+ #nifty_wrapper .tcx_join_chat_div {
1383
  display:none;
1384
  bottom: 0;
1385
  height: 60px;
1395
  background-color: #efefef;
1396
  background: #efefef !important;
1397
  }
1398
+ #nifty_wrapper .tcx_join_chat_div button {
1399
  position:absolute;
1400
  left:50%;
1401
  top:15px;
1433
  }
1434
 
1435
  @media screen and (max-height:550px){
1436
+ #tcx_offline_image {
1437
  max-height: 130px;
1438
  display:block;
1439
  margin-left:auto;
1442
  .nifty_bg_holder_text{
1443
  font-size:1.4em;
1444
  }
1445
+ .tcx_tips_hints{
1446
  top:8% !important;
1447
  }
1448
  }
1463
  padding:0 !important;
1464
  }
1465
 
1466
+ span.tcx-edit-message {
1467
  font-size: 12px;
1468
  float: right;
1469
  }
css/chat_dashboard/admin_style_modern.css CHANGED
@@ -1,12 +1,4 @@
1
- @font-face {
2
- font-family: "Sansation Regular";
3
- src: url("https://bleeper.io/app/assets/fonts/Sansation_Regular.ttf") format("truetype");
4
- }
5
 
6
- @font-face {
7
- font-family: "Sansation Bold";
8
- src: url("https://bleeper.io/app/assets/fonts/Sansation_Bold.ttf") format("truetype");
9
- }
10
 
11
  #nifty_wrapper {
12
  padding: 0 !important;
@@ -1067,7 +1059,7 @@
1067
  margin-bottom: 5px;
1068
  }
1069
 
1070
- #nifty_wrapper .bleeper_in_chat_card {
1071
  background: #fff;
1072
  box-shadow: 0 0 10px 1px rgba(0,0,0,0.05);
1073
  display: inline-block;
@@ -1077,7 +1069,7 @@
1077
  padding-bottom: 5px;
1078
  }
1079
 
1080
- #nifty_wrapper .bleeper_in_chat_card i {
1081
  color: #9e9e9e;
1082
  padding: 13px;
1083
  font-size: 12px;
@@ -1086,7 +1078,7 @@
1086
  margin-right: 10px;
1087
  }
1088
 
1089
- #nifty_wrapper .bleeper_dynamic_link small strong {
1090
  text-transform: capitalize;
1091
  }
1092
 
@@ -1106,7 +1098,7 @@
1106
  }
1107
 
1108
 
1109
- #nifty_wrapper span.bleeper_close_item {
1110
  position: absolute;
1111
  right: 3px;
1112
  top: 3px;
@@ -1120,12 +1112,12 @@
1120
  font-size: 10px;
1121
  text-indent: 3px;
1122
  }
1123
- #nifty_wrapper span.bleeper_close_item:hover {
1124
  background-color: #ccc;
1125
  color: #fff;
1126
  border: 1px solid #bdbdbc;
1127
  }
1128
- #nifty_wrapper .bleeper_close_item {
1129
  display:none;
1130
  }
1131
 
@@ -1144,7 +1136,7 @@
1144
  border: 2px solid #8e8e8e;
1145
  }
1146
 
1147
- #nifty_wrapper .bleeper_userlist_gravatar {
1148
  border-radius: 24px;
1149
  position: absolute;
1150
  top: 15px;
@@ -1190,7 +1182,7 @@
1190
  }
1191
 
1192
  @media screen and (max-width: 700px){
1193
- #bleeper_offline_image{
1194
  display:none !important;
1195
  }
1196
 
@@ -1214,7 +1206,7 @@
1214
  font-size: 24px;
1215
  }
1216
 
1217
- .bleeper_tips_hints {
1218
  top: 2% !important;
1219
  margin-top: 22px !important;
1220
  }
@@ -1269,7 +1261,7 @@
1269
  font-size: 18px;
1270
  }
1271
 
1272
- #nifty_wrapper .bleeper_tips_hints {
1273
  padding-left: 10px;
1274
  padding-right: 10px;
1275
  }
@@ -1278,7 +1270,7 @@
1278
  max-height: 60px !important;
1279
  }
1280
 
1281
- #nifty_wrapper .bleeper_tips_hints {
1282
  padding-left: 10px;
1283
  padding-right: 10px;
1284
  }
@@ -1321,7 +1313,7 @@
1321
  max-height: 60px !important;
1322
  }
1323
 
1324
- #nifty_wrapper .bleeper_tips_hints {
1325
  padding-left: 10px;
1326
  padding-right: 10px;
1327
  }
@@ -1340,7 +1332,7 @@
1340
  font-size: 17px;
1341
  }
1342
 
1343
- #nifty_wrapper .bleeper_tips_hints {
1344
  display: none !important;
1345
  }
1346
 
@@ -1396,7 +1388,7 @@
1396
  }
1397
  #nifty_wrapper .userList .userItemLastMessage { display:none !important; }
1398
 
1399
- #nifty_wrapper .bleeper_join_chat_div {
1400
  display:none;
1401
  bottom: 0;
1402
  height: 60px;
@@ -1412,7 +1404,7 @@
1412
  background-color: #efefef;
1413
  background: #efefef !important;
1414
  }
1415
- #nifty_wrapper .bleeper_join_chat_div button {
1416
  position:absolute;
1417
  left:50%;
1418
  top:15px;
@@ -1453,7 +1445,7 @@
1453
  }
1454
 
1455
  @media screen and (max-height:550px){
1456
- #bleeper_offline_image {
1457
  max-height: 130px;
1458
  display:block;
1459
  margin-left:auto;
@@ -1462,7 +1454,7 @@
1462
  .nifty_bg_holder_text{
1463
  font-size:1.4em;
1464
  }
1465
- .bleeper_tips_hints{
1466
  top:8% !important;
1467
  }
1468
  }
@@ -1483,7 +1475,7 @@
1483
  padding:0 !important;
1484
  }
1485
 
1486
- span.bleeper-edit-message {
1487
  font-size: 12px;
1488
  float: right;
1489
  margin-left: 10px;
@@ -1843,18 +1835,18 @@ span.bleeper-edit-message {
1843
  min-height: 73%;
1844
  }
1845
 
1846
- .bleeper_chat_dash_header {
1847
  height: 80px;
1848
  background: #4169e1;
1849
  border-top-left-radius: 8px;
1850
  border-top-right-radius: 80px;
1851
  }
1852
 
1853
- .bleeper_chat_dash_header > div {
1854
  height: 100%;
1855
  }
1856
 
1857
- .bleeper_chat_dash_header > div img.logo{
1858
  margin-top: 10px;
1859
  }
1860
 
@@ -2076,7 +2068,7 @@ label[for=nifty_file_input] {
2076
  font-size: 12px;
2077
  }
2078
 
2079
- .bleeper_loader {
2080
  display: inline-block;
2081
  border-bottom-left-radius: 15px;
2082
  border-bottom-right-radius: 5px;
@@ -2126,19 +2118,19 @@ label[for=nifty_file_input] {
2126
 
2127
  /** Tablet */
2128
  @media screen and (max-width: 1100px) and (min-width: 701px) {
2129
- .bleeper_chat_dash_header .col-md-3 {
2130
  width: 23% !important;
2131
  display:inline-block;
2132
  vertical-align:top;
2133
  }
2134
 
2135
- .bleeper_chat_dash_header .col-md-6 {
2136
  width: 59% !important;
2137
  display:inline-block;
2138
  vertical-align:top;
2139
  }
2140
 
2141
- .bleeper_chat_dash_header .logo{
2142
  max-width: 100%;
2143
  position:relative;
2144
  top: 50%;
@@ -2146,28 +2138,28 @@ label[for=nifty_file_input] {
2146
  margin-top: 0 !important;
2147
  }
2148
 
2149
- .bleeper_chat_dash_header .col-md-3 .col-md-4{
2150
  width: 50% !important;
2151
  padding: 0;
2152
 
2153
  }
2154
 
2155
- .bleeper_chat_dash_header .col-md-3 .col-md-8{
2156
  position: absolute;
2157
  top: 0;
2158
  left: 45px;
2159
  }
2160
 
2161
- .bleeper_chat_dash_header .col-md-3.text-right{
2162
  display: none;
2163
  }
2164
 
2165
- .bleeper_chat_dash_header .user_top{
2166
  line-height: 76px;
2167
  }
2168
 
2169
 
2170
- .bleeper_chat_dash_header .avatar_top{
2171
  height: 30px;
2172
  width: 30px;
2173
  margin-top: 22px;
@@ -2176,20 +2168,20 @@ label[for=nifty_file_input] {
2176
  overflow: hidden;
2177
  }
2178
 
2179
- .bleeper_chat_dash_header #toolbar-item-fullscreen{
2180
  font-size: 16px !important;
2181
  }
2182
 
2183
- .bleeper_chat_dash_header .bleeper_online_dropdown{
2184
  position: absolute;
2185
  top: 25px;
2186
  }
2187
 
2188
- .bleeper_chat_dash_header .bleeper_online_dropdown .dropdown-menu.dropdown-menu-right {
2189
  transform: translateX(60%);
2190
  }
2191
 
2192
- #bleeper_search{
2193
  display:none;
2194
  }
2195
 
@@ -2262,7 +2254,7 @@ label[for=nifty_file_input] {
2262
  display: none !important;
2263
  }
2264
 
2265
- .bleeper_chat_dash_header {
2266
  border-radius: 0 !important;
2267
  }
2268
 
@@ -2437,19 +2429,19 @@ label[for=nifty_file_input] {
2437
  max-height: 70%;
2438
  }
2439
 
2440
- .bleeper_chat_dash_header .col-md-3 {
2441
  width: 23% !important;
2442
  display:inline-block;
2443
  vertical-align:top;
2444
  }
2445
 
2446
- .bleeper_chat_dash_header .col-md-6 {
2447
  width: 59% !important;
2448
  display:inline-block;
2449
  vertical-align:top;
2450
  }
2451
 
2452
- .bleeper_chat_dash_header .logo{
2453
  max-width: 100%;
2454
  position:relative;
2455
  top: 50%;
@@ -2457,28 +2449,28 @@ label[for=nifty_file_input] {
2457
  margin-top: 0 !important;
2458
  }
2459
 
2460
- .bleeper_chat_dash_header .col-md-3 .col-md-4{
2461
  width: 50% !important;
2462
  padding: 0;
2463
 
2464
  }
2465
 
2466
- .bleeper_chat_dash_header .col-md-3 .col-md-8{
2467
  position: absolute;
2468
  top: 0;
2469
  left: 45px;
2470
  }
2471
 
2472
- .bleeper_chat_dash_header .col-md-3.text-right{
2473
  display: none;
2474
  }
2475
 
2476
- .bleeper_chat_dash_header .user_top{
2477
  display:none;
2478
  }
2479
 
2480
 
2481
- .bleeper_chat_dash_header .avatar_top{
2482
  height: 30px;
2483
  width: 30px;
2484
  margin-top: 22px;
@@ -2487,16 +2479,16 @@ label[for=nifty_file_input] {
2487
  overflow: hidden;
2488
  }
2489
 
2490
- .bleeper_chat_dash_header #toolbar-item-fullscreen{
2491
  font-size: 16px !important;
2492
  }
2493
 
2494
- .bleeper_chat_dash_header .bleeper_online_dropdown{
2495
  position: absolute;
2496
  top: 3px;
2497
  }
2498
 
2499
- .bleeper_chat_dash_header .bleeper_online_dropdown .dropdown-menu.dropdown-menu-right {
2500
  transform: translateX(60%);
2501
  }
2502
 
@@ -2518,7 +2510,7 @@ label[for=nifty_file_input] {
2518
  display: none;
2519
  }
2520
 
2521
- #bleeper_search{
2522
  display:none;
2523
  }
2524
 
@@ -2531,7 +2523,7 @@ label[for=nifty_file_input] {
2531
  transform: translateY(8px);
2532
  }
2533
 
2534
- .bleeper_chat_dash_header {
2535
  border-radius: 0 !important;
2536
  }
2537
 
 
 
 
 
1
 
 
 
 
 
2
 
3
  #nifty_wrapper {
4
  padding: 0 !important;
1059
  margin-bottom: 5px;
1060
  }
1061
 
1062
+ #nifty_wrapper .tcx_in_chat_card {
1063
  background: #fff;
1064
  box-shadow: 0 0 10px 1px rgba(0,0,0,0.05);
1065
  display: inline-block;
1069
  padding-bottom: 5px;
1070
  }
1071
 
1072
+ #nifty_wrapper .tcx_in_chat_card i {
1073
  color: #9e9e9e;
1074
  padding: 13px;
1075
  font-size: 12px;
1078
  margin-right: 10px;
1079
  }
1080
 
1081
+ #nifty_wrapper .tcx_dynamic_link small strong {
1082
  text-transform: capitalize;
1083
  }
1084
 
1098
  }
1099
 
1100
 
1101
+ #nifty_wrapper span.tcx_close_item {
1102
  position: absolute;
1103
  right: 3px;
1104
  top: 3px;
1112
  font-size: 10px;
1113
  text-indent: 3px;
1114
  }
1115
+ #nifty_wrapper span.tcx_close_item:hover {
1116
  background-color: #ccc;
1117
  color: #fff;
1118
  border: 1px solid #bdbdbc;
1119
  }
1120
+ #nifty_wrapper .tcx_close_item {
1121
  display:none;
1122
  }
1123
 
1136
  border: 2px solid #8e8e8e;
1137
  }
1138
 
1139
+ #nifty_wrapper .tcx_userlist_gravatar {
1140
  border-radius: 24px;
1141
  position: absolute;
1142
  top: 15px;
1182
  }
1183
 
1184
  @media screen and (max-width: 700px){
1185
+ #tcx_offline_image{
1186
  display:none !important;
1187
  }
1188
 
1206
  font-size: 24px;
1207
  }
1208
 
1209
+ .tcx_tips_hints {
1210
  top: 2% !important;
1211
  margin-top: 22px !important;
1212
  }
1261
  font-size: 18px;
1262
  }
1263
 
1264
+ #nifty_wrapper .tcx_tips_hints {
1265
  padding-left: 10px;
1266
  padding-right: 10px;
1267
  }
1270
  max-height: 60px !important;
1271
  }
1272
 
1273
+ #nifty_wrapper .tcx_tips_hints {
1274
  padding-left: 10px;
1275
  padding-right: 10px;
1276
  }
1313
  max-height: 60px !important;
1314
  }
1315
 
1316
+ #nifty_wrapper .tcx_tips_hints {
1317
  padding-left: 10px;
1318
  padding-right: 10px;
1319
  }
1332
  font-size: 17px;
1333
  }
1334
 
1335
+ #nifty_wrapper .tcx_tips_hints {
1336
  display: none !important;
1337
  }
1338
 
1388
  }
1389
  #nifty_wrapper .userList .userItemLastMessage { display:none !important; }
1390
 
1391
+ #nifty_wrapper .tcx_join_chat_div {
1392
  display:none;
1393
  bottom: 0;
1394
  height: 60px;
1404
  background-color: #efefef;
1405
  background: #efefef !important;
1406
  }
1407
+ #nifty_wrapper .tcx_join_chat_div button {
1408
  position:absolute;
1409
  left:50%;
1410
  top:15px;
1445
  }
1446
 
1447
  @media screen and (max-height:550px){
1448
+ #tcx_offline_image {
1449
  max-height: 130px;
1450
  display:block;
1451
  margin-left:auto;
1454
  .nifty_bg_holder_text{
1455
  font-size:1.4em;
1456
  }
1457
+ .tcx_tips_hints{
1458
  top:8% !important;
1459
  }
1460
  }
1475
  padding:0 !important;
1476
  }
1477
 
1478
+ span.tcx-edit-message {
1479
  font-size: 12px;
1480
  float: right;
1481
  margin-left: 10px;
1835
  min-height: 73%;
1836
  }
1837
 
1838
+ .tcx_chat_dash_header {
1839
  height: 80px;
1840
  background: #4169e1;
1841
  border-top-left-radius: 8px;
1842
  border-top-right-radius: 80px;
1843
  }
1844
 
1845
+ .tcx_chat_dash_header > div {
1846
  height: 100%;
1847
  }
1848
 
1849
+ .tcx_chat_dash_header > div img.logo{
1850
  margin-top: 10px;
1851
  }
1852
 
2068
  font-size: 12px;
2069
  }
2070
 
2071
+ .tcx_loader {
2072
  display: inline-block;
2073
  border-bottom-left-radius: 15px;
2074
  border-bottom-right-radius: 5px;
2118
 
2119
  /** Tablet */
2120
  @media screen and (max-width: 1100px) and (min-width: 701px) {
2121
+ .tcx_chat_dash_header .col-md-3 {
2122
  width: 23% !important;
2123
  display:inline-block;
2124
  vertical-align:top;
2125
  }
2126
 
2127
+ .tcx_chat_dash_header .col-md-6 {
2128
  width: 59% !important;
2129
  display:inline-block;
2130
  vertical-align:top;
2131
  }
2132
 
2133
+ .tcx_chat_dash_header .logo{
2134
  max-width: 100%;
2135
  position:relative;
2136
  top: 50%;
2138
  margin-top: 0 !important;
2139
  }
2140
 
2141
+ .tcx_chat_dash_header .col-md-3 .col-md-4{
2142
  width: 50% !important;
2143
  padding: 0;
2144
 
2145
  }
2146
 
2147
+ .tcx_chat_dash_header .col-md-3 .col-md-8{
2148
  position: absolute;
2149
  top: 0;
2150
  left: 45px;
2151
  }
2152
 
2153
+ .tcx_chat_dash_header .col-md-3.text-right{
2154
  display: none;
2155
  }
2156
 
2157
+ .tcx_chat_dash_header .user_top{
2158
  line-height: 76px;
2159
  }
2160
 
2161
 
2162
+ .tcx_chat_dash_header .avatar_top{
2163
  height: 30px;
2164
  width: 30px;
2165
  margin-top: 22px;
2168
  overflow: hidden;
2169
  }
2170
 
2171
+ .tcx_chat_dash_header #toolbar-item-fullscreen{
2172
  font-size: 16px !important;
2173
  }
2174
 
2175
+ .tcx_chat_dash_header .tcx_online_dropdown{
2176
  position: absolute;
2177
  top: 25px;
2178
  }
2179
 
2180
+ .tcx_chat_dash_header .tcx_online_dropdown .dropdown-menu.dropdown-menu-right {
2181
  transform: translateX(60%);
2182
  }
2183
 
2184
+ #tcx_search{
2185
  display:none;
2186
  }
2187
 
2254
  display: none !important;
2255
  }
2256
 
2257
+ .tcx_chat_dash_header {
2258
  border-radius: 0 !important;
2259
  }
2260
 
2429
  max-height: 70%;
2430
  }
2431
 
2432
+ .tcx_chat_dash_header .col-md-3 {
2433
  width: 23% !important;
2434
  display:inline-block;
2435
  vertical-align:top;
2436
  }
2437
 
2438
+ .tcx_chat_dash_header .col-md-6 {
2439
  width: 59% !important;
2440
  display:inline-block;
2441
  vertical-align:top;
2442
  }
2443
 
2444
+ .tcx_chat_dash_header .logo{
2445
  max-width: 100%;
2446
  position:relative;
2447
  top: 50%;
2449
  margin-top: 0 !important;
2450
  }
2451
 
2452
+ .tcx_chat_dash_header .col-md-3 .col-md-4{
2453
  width: 50% !important;
2454
  padding: 0;
2455
 
2456
  }
2457
 
2458
+ .tcx_chat_dash_header .col-md-3 .col-md-8{
2459
  position: absolute;
2460
  top: 0;
2461
  left: 45px;
2462
  }
2463
 
2464
+ .tcx_chat_dash_header .col-md-3.text-right{
2465
  display: none;
2466
  }
2467
 
2468
+ .tcx_chat_dash_header .user_top{
2469
  display:none;
2470
  }
2471
 
2472
 
2473
+ .tcx_chat_dash_header .avatar_top{
2474
  height: 30px;
2475
  width: 30px;
2476
  margin-top: 22px;
2479
  overflow: hidden;
2480
  }
2481
 
2482
+ .tcx_chat_dash_header #toolbar-item-fullscreen{
2483
  font-size: 16px !important;
2484
  }
2485
 
2486
+ .tcx_chat_dash_header .tcx_online_dropdown{
2487
  position: absolute;
2488
  top: 3px;
2489
  }
2490
 
2491
+ .tcx_chat_dash_header .tcx_online_dropdown .dropdown-menu.dropdown-menu-right {
2492
  transform: translateX(60%);
2493
  }
2494
 
2510
  display: none;
2511
  }
2512
 
2513
+ #tcx_search{
2514
  display:none;
2515
  }
2516
 
2523
  transform: translateY(8px);
2524
  }
2525
 
2526
+ .tcx_chat_dash_header {
2527
  border-radius: 0 !important;
2528
  }
2529
 
css/chat_styles_pro.css CHANGED
@@ -42,7 +42,7 @@
42
  }
43
 
44
  #wplc_user_typing {
45
- color:#666;
46
  font-style:italic;
47
  }
48
 
@@ -233,11 +233,11 @@
233
  }
234
 
235
  .toplevel_page_wplivechat-menu .wp-pointer-content h3 {
236
- background-color: #ec822c;
237
- border: 1px solid #ec822c;
238
  }
239
  .toplevel_page_wplivechat-menu .wp-pointer-content h3:before {
240
- color: #ec822c;
241
 
242
  }
243
 
@@ -281,7 +281,7 @@
281
  .wplc_vis_online {
282
  font-size: 60px;
283
  line-height:70px;
284
- color: #ec822c;
285
  text-align: center;
286
  padding-top: 36px;
287
  font-family: Arial;
@@ -343,9 +343,9 @@
343
  text-transform: uppercase;
344
  display: block;
345
  }
346
- .wplc_agents_online { color: #ec822c; }
347
  .wplc_type_new { background-color: #E1734A; }
348
- .wplc_type_returning { background-color: #ec822c; }
349
 
350
  .wplc_status_1 { background-color: #CCCCCC; }
351
  .wplc_status_4 { background-color: #CCCCCC; }
42
  }
43
 
44
  #wplc_user_typing {
45
+ color:#373737;
46
  font-style:italic;
47
  }
48
 
233
  }
234
 
235
  .toplevel_page_wplivechat-menu .wp-pointer-content h3 {
236
+ background-color: #0596d4;
237
+ border: 1px solid #0596d4;
238
  }
239
  .toplevel_page_wplivechat-menu .wp-pointer-content h3:before {
240
+ color: #0596d4;
241
 
242
  }
243
 
281
  .wplc_vis_online {
282
  font-size: 60px;
283
  line-height:70px;
284
+ color: #0596d4;
285
  text-align: center;
286
  padding-top: 36px;
287
  font-family: Arial;
343
  text-transform: uppercase;
344
  display: block;
345
  }
346
+ .wplc_agents_online { color: #0596d4; }
347
  .wplc_type_new { background-color: #E1734A; }
348
+ .wplc_type_returning { background-color: #0596d4; }
349
 
350
  .wplc_status_1 { background-color: #CCCCCC; }
351
  .wplc_status_4 { background-color: #CCCCCC; }
css/chat_styles_pro.min.css DELETED
@@ -1 +0,0 @@
1
- .wplc_admin_dashboard_container{width:80%;margin:0 auto}#wplc_admin_chat_area{width:65%;display:inline-block;background-color:#fff;float:left;box-shadow:1px 1px 3px #ccc}#wplc_admin_visitor_area{width:30%;display:inline-block;background-color:#fff;float:right;box-shadow:1px 1px 3px #ccc}.wplc_visitor_container{padding:10px}.wplc_visitor_container h1{text-align:center;line-height:22px}.wplc_chats_container h2{padding:10px}.wplc_chat_section{width:33.33%;display:table-cell;vertical-align:middle}.wplc_agent_actions{text-align:center}#wplc_user_typing{color:#666;font-style:italic}.wplc_single_chat{width:100%;display:inline-block;border:1px solid #eee;border-radius:5px;box-shadow:1px 1px 21px #eee;margin:8px auto;padding:10px}.wplc_single_chat .wplc_user_image{width:30%;display:inline-block;float:left}.wplc_user_meta_data{width:70%;display:inline-block}.wplc_single_chat .wplc_user_image img{border-radius:100px}.wplc_single_visitor{border-bottom:1px solid #ccc;padding:20px;overflow:hidden}.wplc_single_visitor .wplc_user_image{width:120px;display:inline-block;margin-right:10px}.wplc_single_visitor .wplc_user_image img{border-radius:100px}.wplc_single_visitor .wplc_user_meta_data{display:inline-block;vertical-align:top}.wplc_single_visitor .wplc_user_name h3{margin:0;padding:0}.wplc_single_visitor h3.ui-accordion .ui-accordion-icons{margin:0;padding-left:0}.wplc_single_visitor .wplc_user_name h3 i{padding:0 10px}.wplc_active{color:green}.wplc_pending{color:orange}.wplc_closed{color:red}.wplc_single_visitor .wplc_current_page a{width:100%}.wplc_icon_message{font-size:10px;font-weight:400}.wplc_page_title{text-align:center}.wplc_page_title h1{font-size:3em}.wplc_visitor_icon{padding-right:10px}#wplc_admin_visitor_area #wplc_visitor_accordion,#wplc_admin_visitor_area h2{padding:10px}#wplc_visitor_accordion .wplc_single_visitor{padding:10px;overflow:hidden}#wplc_visitor_accordion .wplc_user_name h3{font-size:14px}#wplc_visitor_accordion>.wplc_single_visitor{text-align:center}.wplc_single_visitor .section_1 .wplc_user_meta_data{width:100%}@media all and (max-width:700px){#wplc_admin_chat_area{width:100%;padding:0;margin:0 0 10px 0}#wplc_admin_visitor_area{width:100%}#wplc_admin_chat_area p{padding:10px}}@media all and (max-width:1440px){.wplc_single_chat .wplc_user_image{width:100%;display:block;text-align:center}.wplc_user_meta_data{width:100%;display:block;text-align:center}}@media all and (max-width:1700px){.wplc_single_visitor .wplc_chat_section{width:100%;display:block}}@media all and (max-width:1200px){.wplc_chat_section.section_1{display:inline-block;width:100%;padding:10px}}@media all and (max-width:850px){.wplc_chat_section.section_2{display:inline-block;width:100%;padding:10px}.admin_visitor_advanced_info{width:93%}}.wplc_admin_dashboard_container p{padding:0 5px}.toplevel_page_wplivechat-menu .wp-pointer-content h3{background-color:#ec822c;border:1px solid #ec822c}.toplevel_page_wplivechat-menu .wp-pointer-content h3:before{color:#ec822c}#wplc_admin_chat_holder{width:990px;margin:0 auto;display:block;overflow:auto;clear:both}#wplc_admin_chat_area_new{width:750px;font-size:13px;float:left;display:block;background-color:#fff;border-radius:25px}#wplc_admin_chat_info_new{float:left;width:240px;display:block;margin-bottom:20px}.wplc_chat_vis_count_box{width:57%;min-width:198px;background-color:#fff;min-height:150px;border-radius:25px;margin-left:auto;margin-right:auto;display:block;text-align:center;padding:10px}.wplc_vis_online{font-size:60px;line-height:70px;color:#ec822c;text-align:center;padding-top:36px;font-family:Arial;display:block;font-weight:700}#wplc_admin_chat_area_new li{float:left;background:0 0;padding:0 2px 0 0;list-style:none;margin:0}.wplc_header_vh{font:bold 14px/26px Arial;padding:0;color:#c2bbbe;display:block;text-transform:uppercase;display:block}.wplc_headerspan_v{min-width:140px;width:20%;display:block}.wplc_headerspan_nr{min-width:100px;width:14%;display:block}.wplc_headerspan_d{min-width:200px;width:30%;display:block}.wplc_headerspan_d a{font-style:italic}.wplc_headerspan_t{min-width:60px;width:9%;display:block}.wplc_headerspan_s{min-width:80px;width:12%;display:block}.wplc_headerspan_a{min-width:100px;width:15%;display:block}.wplc_chat_ul_header{clear:both;overflow:auto;display:block;padding:10px}#wplc_chat_ul{clear:both;overflow:auto;display:block}.wplc_p_cul{padding:10px;clear:both;display:block;overflow:auto}.wplc_p_cul:hover{background-color:#eee;border-radius:5px}.wplc_status_box{padding:3px;border-radius:5px;color:#fff;font-size:11px}.wplc-agent-info{font:bold 12px/24px Arial;color:#c2bbbe;text-transform:uppercase;display:block}.wplc_agents_online{color:#ec822c}.wplc_type_new{background-color:#e1734a}.wplc_type_returning{background-color:#ec822c}.wplc_status_1{background-color:#ccc}.wplc_status_4{background-color:#ccc}.wplc_status_8{background-color:#ccc}.wplc_status_5{background-color:#b3d24b}.wplc_status_2{background-color:#3278cd}.wplc_status_3{background-color:#3278cd}.wplc_status_6{background-color:red}.wplc_status_7{background-color:#bfbcbb}.wplc_status_9{background-color:#bfbcbb}.browser-tag{font-size:10px}.wplc-sub-item-header{color:#c7c3c3;font-style:italic}@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_s,.wplc_headerspan_v{margin:5px auto;text-align:center}.wplc_chat_vis_count_box{min-width:180px}}@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_s,.wplc_headerspan_v{margin:5px auto;text-align:center}.wplc_chat_vis_count_box{min-width:180px}}@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_s,.wplc_headerspan_v{margin:0;text-align:left}.wplc_chat_vis_count_box{min-width:180px}}@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_s,.wplc_headerspan_v{margin:0;text-align:left}.wplc_chat_vis_count_box{min-width:110px}}@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_s,.wplc_headerspan_v{margin:0;text-align:left}.wplc_chat_vis_count_box{min-width:110px}}@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_s,.wplc_headerspan_v{margin:0;text-align:left}.wplc_chat_vis_count_box{min-width:198px}}
 
css/cta_animations/bounce.min.css DELETED
@@ -1 +0,0 @@
1
- #wp-live-chat-header:not(.active){-webkit-animation:wplc-bounce 1.5s 5!important;-moz-animation:wplc-bounce 1.5s 5!important;-o-animation:wplc-bounce 1.5s 5!important;animation:wplc-bounce 1.5s 5!important;animation-name:wplc-bounce!important;animation-duration:1.5s!important;animation-timing-function:cubic-bezier(.25,.1,.31,1)!important;animation-delay:0s!important;animation-iteration-count:5!important;animation-direction:normal!important;animation-fill-mode:none!important;animation-play-state:running!important}@keyframes wplc-bounce{0%{transform:translateY(0)}50%{transform:translateY(-30%)}100%{transform:translateY(0)}}
 
css/cta_animations/pop.min.css DELETED
@@ -1 +0,0 @@
1
- #wp-live-chat-header:not(.active){-webkit-animation:wplc-pop .3s pop!important;-moz-animation:wplc-pop .3s pop!important;-o-animation:wplc-pop .3s pop!important;animation:wplc-pop .3s pop!important;animation-name:wplc-pop!important;animation-duration:.3s!important;animation-timing-function:cubic-bezier(.25,.1,.66,.97)!important;animation-delay:0s!important;animation-iteration-count:pop!important;animation-direction:normal!important;animation-fill-mode:none!important;animation-play-state:running!important}@keyframes wplc-pop{0%{transform:scale(0,0)}50%{transform:scale(1.2,1.2)}100%{transform:scale(1,1)}}
 
css/cta_animations/ripple.min.css DELETED
@@ -1 +0,0 @@
1
- #wp-live-chat-header:not(.active){-webkit-animation:wplc-pulse 1s infinite!important;-moz-animation:wplc-pulse 1s infinite!important;-o-animation:wplc-pulse 1s infinite!important;animation:wplc-pulse 1s infinite!important;animation-name:wplc-pulse!important;animation-duration:1s!important;animation-timing-function:ease!important;animation-delay:0s!important;animation-iteration-count:infinite!important;animation-direction:normal!important;animation-fill-mode:none!important;animation-play-state:running!important}@keyframes wplc-pulse{0%{-webkit-box-shadow:0 0 0 0 #75757575;-moz-box-shadow:0 0 0 0 #75757575;-o-box-shadow:0 0 0 0 #75757575;box-shadow:0 0 0 0 #75757575}70%{-webkit-box-shadow:0 0 0 15px rgba(218,218,218,0);-moz-box-shadow:0 0 0 15px rgba(218,218,218,0);-o-box-shadow:0 0 0 15px rgba(218,218,218,0);box-shadow:0 0 0 15px rgba(218,218,218,0)}100%{-webkit-box-shadow:0 0 0 0 rgba(228,228,228,0);-moz-box-shadow:0 0 0 0 rgba(228,228,228,0);-o-box-shadow:0 0 0 0 rgba(228,228,228,0);box-shadow:0 0 0 0 rgba(228,228,228,0)}}
 
css/fontawesome-iconpicker.css CHANGED
@@ -332,4 +332,4 @@
332
  }
333
  a.iconpicker-selected {
334
  background: #ED832F !important;
335
- }
332
  }
333
  a.iconpicker-selected {
334
  background: #ED832F !important;
335
+ }
css/node_history_styles.css CHANGED
@@ -1,11 +1,17 @@
1
- .admin_chat_box_inner_bottom, .end_chat_div, .bleeper-edit-message{
2
  display:none !important; /*User cannot type or input any data*/
3
  }
4
 
5
  #admin_chat_box {
6
- border:none !important;
7
- padding:0px !important;
8
- background:none !important;
 
 
 
 
 
 
9
  }
10
 
11
  .admin_chat_img {
@@ -13,19 +19,15 @@
13
  }
14
 
15
  .admin_chat_box {
16
- border:none !important;
17
- position:absolute !important;
18
- background:#fff !important;
19
- margin-left:40% !important;
20
- padding: 3% !important;
21
- width:50% !important;
22
- height: 320px !important;
23
- border-radius: 5px;
24
-
25
- box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
26
- -webkit-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
27
- -moz-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
28
- -o-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
29
  }
30
 
31
  .admin_visitor_info {
@@ -36,7 +38,6 @@
36
  border-radius:5px;
37
  color:#fff !important;
38
  height:320px !important;
39
-
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);
@@ -48,9 +49,6 @@
48
  overflow-y: auto;
49
  }
50
 
51
- .admin_visitor_advanced_info .part1 {
52
- color: #fff !important;
53
- }
54
 
55
  .wplc_bottom_chat_info_container {
56
  position: absolute;
1
+ .admin_chat_box_inner_bottom, .end_chat_div, .tcx-edit-message{
2
  display:none !important; /*User cannot type or input any data*/
3
  }
4
 
5
  #admin_chat_box {
6
+ display: block;
7
+ overflow: auto;
8
+ clear: both;
9
+ padding: 20px;
10
+ -webkit-border-radius: 5px;
11
+ -moz-border-radius: 5px;
12
+ border-radius: 5px;
13
+ border: 1px solid #ccc;
14
+ background-color: #fff;
15
  }
16
 
17
  .admin_chat_img {
19
  }
20
 
21
  .admin_chat_box {
22
+ display: block;
23
+ overflow: auto;
24
+ clear: both;
25
+ padding: 20px;
26
+ -webkit-border-radius: 5px;
27
+ -moz-border-radius: 5px;
28
+ border-radius: 5px;
29
+ border: 1px solid #ccc;
30
+ background-color: #fff;
 
 
 
 
31
  }
32
 
33
  .admin_visitor_info {
38
  border-radius:5px;
39
  color:#fff !important;
40
  height:320px !important;
 
41
  box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
42
  -webkit-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
43
  -moz-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
49
  overflow-y: auto;
50
  }
51
 
 
 
 
52
 
53
  .wplc_bottom_chat_info_container {
54
  position: absolute;
css/node_history_styles.min.css DELETED
@@ -1 +0,0 @@
1
- .admin_chat_box_inner_bottom,.bleeper-edit-message,.end_chat_div{display:none!important}#admin_chat_box{border:none!important;padding:0!important;background:0 0!important}.admin_chat_img{border-radius:100px!important}.admin_chat_box{border:none!important;position:absolute!important;background:#fff!important;margin-left:40%!important;padding:3%!important;width:50%!important;height:320px!important;border-radius:5px;box-shadow:0 0 40px 1px rgba(0,0,0,.07);-webkit-box-shadow:0 0 40px 1px rgba(0,0,0,.07);-moz-box-shadow:0 0 40px 1px rgba(0,0,0,.07);-o-box-shadow:0 0 40px 1px rgba(0,0,0,.07)}.admin_visitor_info{position:absolute!important;background:#333;padding:3%!important;width:30%!important;border-radius:5px;color:#fff!important;height:320px!important;box-shadow:0 0 40px 1px rgba(0,0,0,.07);-webkit-box-shadow:0 0 40px 1px rgba(0,0,0,.07);-moz-box-shadow:0 0 40px 1px rgba(0,0,0,.07);-o-box-shadow:0 0 40px 1px rgba(0,0,0,.07)}.admin_chat_box_inner{height:100%!important;overflow-y:auto}.admin_visitor_advanced_info .part1{color:#fff!important}.wplc_bottom_chat_info_container{position:absolute;top:510px;background:#fff;border-radius:5px;padding-left:3%;padding-right:3%;padding-top:20px;padding-bottom:20px;width:30%;min-width:224px;box-shadow:0 0 40px 1px rgba(0,0,0,.07);-webkit-box-shadow:0 0 40px 1px rgba(0,0,0,.07);-moz-box-shadow:0 0 40px 1px rgba(0,0,0,.07);-o-box-shadow:0 0 40px 1px rgba(0,0,0,.07)}.wplc_bottom_chat_info_container h3{margin-top:0!important}.wplc-admin-message,.wplc-user-message{display:block;max-width:80%;margin:5px;padding:5px;border-radius:3px;margin-bottom:10px;box-shadow:0 0 2px 1px rgba(0,0,0,.07);-webkit-box-shadow:0 0 2px 1px rgba(0,0,0,.07);-moz-box-shadow:0 0 2px 1px rgba(0,0,0,.07);-o-box-shadow:0 0 2px 1px rgba(0,0,0,.07)}.wplc-user-message{background-color:#e0e0e0}.wplc-admin-message{background-color:#333;color:#fff;margin-left:20%}.wplc-admin-message-avatar,.wplc-user-message-avatar{display:inline-block;border-radius:20px}.wplc-msg-content{display:inline-block;padding-left:10px}.wplc-chat-person-name{font-size:11px}.messageBody{display:block}.wplc-history__date{display:block;margin-bottom:5px}
 
css/remote_dash_styles.css CHANGED
@@ -1,15 +1,15 @@
1
  .toplevel_page_wplivechat-menu a {
2
- color:#EB832C;
3
  }
4
  .toplevel_page_wplivechat-menu a:hover {
5
- color:#EB832C;
6
  text-decoration: underline;
7
  }
8
  .toplevel_page_wplivechat-menu a:active {
9
- color:#EB832C;
10
  }
11
  .toplevel_page_wplivechat-menu a:focus {
12
- color:#EB832C;
13
  }
14
  .wplc_a2a_dismiss {
15
  position: absolute;
@@ -154,7 +154,7 @@
154
  float:left;
155
  }
156
 
157
- .bleeper_tips_hints {
158
  margin-top: 30px;
159
  width: 300px;
160
  position: relative;
@@ -222,7 +222,7 @@ span.online_offline.offline {
222
  font-size: 24px;
223
  }
224
 
225
- span.bleeper-edit-message {
226
  margin-right: 10px;
227
  margin-top: -26px;
228
  right: 11px;
@@ -253,7 +253,7 @@ span.bleeper-edit-message {
253
  /**
254
  * POP OUT DASHBOARD STYLES
255
  */
256
- .bleeper-out-dash #nifty_wrapper {
257
  border-radius:15px;
258
  }
259
  #nifty_wrapper .nifty_add_media_button {
@@ -266,7 +266,7 @@ span.bleeper-edit-message {
266
  padding-right: 10px;
267
  padding-top: 5px;
268
  }
269
- .bleeper-out-dash .wrap {
270
  position: fixed;
271
  right: 35px;
272
  top: 30px;
@@ -279,88 +279,88 @@ span.bleeper-edit-message {
279
  margin: 5px;
280
  background-color: transparent !important;
281
  }
282
- .bleeper-out-dash .floating-right-toolbar i {
283
  position:fixed !important;
284
  top:56%;
285
  right:7px;
286
  }
287
- .bleeper-out-dash .info_chat img {
288
  clear: both;
289
  display: block;
290
  }
291
 
292
- .bleeper-out-dash #user_count {
293
  padding: 6px !important;
294
  padding-bottom: 30px !important;
295
  text-align: center;
296
  }
297
- .bleeper-out-dash #active_count {
298
  font-size: 1em !important;
299
  top: 0px;
300
  }
301
- .bleeper-out-dash #active_count_string {
302
  font-size: 0.8em !important;
303
  }
304
- .bleeper-out-dash #choose_online {
305
  top: 28px !important;
306
  width: 100%;
307
  padding-right: 0;
308
  text-align: center;
309
  }
310
- .bleeper-out-dash .switchery-small {
311
  height: 15px;
312
  width: 24px;
313
  }
314
- .bleeper-out-dash .visActionCol {
315
  float:right !important;
316
  }
317
- .bleeper-out-dash .visChatStatusCol {
318
  width:20% !important;
319
  }
320
- .bleeper-out-dash .visChatDepCol {
321
  display: none !important;
322
  }
323
- .bleeper-out-dash .agents_involved {
324
  display: none !important;
325
  }
326
- .bleeper-out-dash .switchery-small>small {
327
  width: 14px !important;
328
  height: 14px !important;
329
  }
330
- .bleeper-out-dash #user_list {
331
 
332
  width: 25%;
333
  }
334
- .bleeper-out-dash .agent_count {
335
  display: none;
336
  }
337
- .bleeper-out-dash .history_link {
338
  width: 100%;
339
  }
340
- .bleeper-out-dash #nifty_wrapper {
341
  background-color:transparent !important;
342
  }
343
- .bleeper-out-dash .userListBox_Wrapper {
344
  background-color: #fff;
345
  top: 86px !important;
346
  }
347
- .bleeper-out-dash .nifty_bg_holder {
348
  position:absolute;
349
  left:180px;
350
  border-top-right-radius: 15px;
351
  border-bottom-right-radius: 15px;
352
  }
353
- #toolbar-item-open-bleeper {
354
  position:fixed;
355
  right:7px;
356
  top:50%;
357
  }
358
 
359
- .bleeper-out-dash .user_header_wrapper_info {
360
  width:60% !important;
361
  }
362
 
363
- .nifty_top_wrapper.bleeper-out-dash .wrap {
364
  z-index: 9999 !important;
365
  }
366
 
@@ -631,7 +631,7 @@ span.bleeper-edit-message {
631
  font-size:0.8em;
632
  background-color:#bbb;
633
  color:#FFF;
634
- webkit-border-radius: 5px;
635
  -moz-border-radius: 5px;
636
  border-radius: 5px;
637
  }
@@ -685,10 +685,9 @@ span.bleeper-edit-message {
685
  padding: 0 0 0 0px;
686
  color: #C2BBBE;
687
  display: block;
688
- height:40px;
689
  text-transform: uppercase;
690
  }
691
- .wplc_agent_container small { word-wrap: break-word; display:block; height:50px; }
692
  .wplc_agent_container select { width: 120px; }
693
 
694
  /* Settings: Relevant extensions (bottom of the page) */
@@ -988,7 +987,7 @@ span.wplc-system-notification {
988
  background: white;
989
  width: 400px;
990
  height: 55px;
991
- border-left: 4px solid #ec822c;
992
  left: 0;
993
  right: 0;
994
  top: 0;
@@ -1107,7 +1106,7 @@ span.wplc-system-notification {
1107
  width: 100%;
1108
  bottom: 0;
1109
  left: 0;
1110
- background: #ED832F;
1111
  opacity: .9;
1112
  }
1113
 
@@ -1121,7 +1120,7 @@ span.wplc-system-notification {
1121
  margin:0;
1122
  background-size: cover;
1123
  background-position: center;
1124
- background-color:#ED832F !important;
1125
  transition: all .2s ease-in-out;
1126
  box-sizing: border-box;
1127
  box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
@@ -1289,7 +1288,6 @@ li.wplc-ds-li a:empty {
1289
  .exp_cols {
1290
  background: #fcfcfc;
1291
  height: 24px;
1292
- margin-top: 29px;
1293
  border-bottom: 1px solid #eee;
1294
  font-size: 11px;
1295
  }
@@ -1318,11 +1316,8 @@ li.wplc-ds-li a:empty {
1318
  color: #007bff !important;
1319
  }
1320
 
1321
-
1322
-
1323
-
1324
  #nifty_wrapper .messages .wplc-admin-message.agent_to_agent .wplc-msg-content {
1325
- display: inline-block;
1326
  position: relative;
1327
  top: 0px;
1328
  left: 0px;
@@ -1333,6 +1328,7 @@ li.wplc-ds-li a:empty {
1333
  border-radius: 3px;
1334
  float: left !important;
1335
  }
 
1336
  #nifty_wrapper .messages .wplc-admin-message.agent_to_agent .wplc-msg-content:after {
1337
  top: 15px;
1338
  left: -7px;
@@ -1349,4 +1345,16 @@ label.nifty_add_media_button i {
1349
  position:absolute;
1350
  top: 22px;
1351
  right: 20px;
 
 
 
 
 
 
 
 
 
 
 
 
1352
  }
1
  .toplevel_page_wplivechat-menu a {
2
+ color:#0596d4;
3
  }
4
  .toplevel_page_wplivechat-menu a:hover {
5
+ color:#0596d4;
6
  text-decoration: underline;
7
  }
8
  .toplevel_page_wplivechat-menu a:active {
9
+ color:#0596d4;
10
  }
11
  .toplevel_page_wplivechat-menu a:focus {
12
+ color:#0596d4;
13
  }
14
  .wplc_a2a_dismiss {
15
  position: absolute;
154
  float:left;
155
  }
156
 
157
+ .tcx_tips_hints {
158
  margin-top: 30px;
159
  width: 300px;
160
  position: relative;
222
  font-size: 24px;
223
  }
224
 
225
+ span.tcx-edit-message {
226
  margin-right: 10px;
227
  margin-top: -26px;
228
  right: 11px;
253
  /**
254
  * POP OUT DASHBOARD STYLES
255
  */
256
+ .tcx-out-dash #nifty_wrapper {
257
  border-radius:15px;
258
  }
259
  #nifty_wrapper .nifty_add_media_button {
266
  padding-right: 10px;
267
  padding-top: 5px;
268
  }
269
+ .tcx-out-dash .wrap {
270
  position: fixed;
271
  right: 35px;
272
  top: 30px;
279
  margin: 5px;
280
  background-color: transparent !important;
281
  }
282
+ .tcx-out-dash .floating-right-toolbar i {
283
  position:fixed !important;
284
  top:56%;
285
  right:7px;
286
  }
287
+ .tcx-out-dash .info_chat img {
288
  clear: both;
289
  display: block;
290
  }
291
 
292
+ .tcx-out-dash #user_count {
293
  padding: 6px !important;
294
  padding-bottom: 30px !important;
295
  text-align: center;
296
  }
297
+ .tcx-out-dash #active_count {
298
  font-size: 1em !important;
299
  top: 0px;
300
  }
301
+ .tcx-out-dash #active_count_string {
302
  font-size: 0.8em !important;
303
  }
304
+ .tcx-out-dash #choose_online {
305
  top: 28px !important;
306
  width: 100%;
307
  padding-right: 0;
308
  text-align: center;
309
  }
310
+ .tcx-out-dash .switchery-small {
311
  height: 15px;
312
  width: 24px;
313
  }
314
+ .tcx-out-dash .visActionCol {
315
  float:right !important;
316
  }
317
+ .tcx-out-dash .visChatStatusCol {
318
  width:20% !important;
319
  }
320
+ .tcx-out-dash .visChatDepCol {
321
  display: none !important;
322
  }
323
+ .tcx-out-dash .agents_involved {
324
  display: none !important;
325
  }
326
+ .tcx-out-dash .switchery-small>small {
327
  width: 14px !important;
328
  height: 14px !important;
329
  }
330
+ .tcx-out-dash #user_list {
331
 
332
  width: 25%;
333
  }
334
+ .tcx-out-dash .agent_count {
335
  display: none;
336
  }
337
+ .tcx-out-dash .history_link {
338
  width: 100%;
339
  }
340
+ .tcx-out-dash #nifty_wrapper {
341
  background-color:transparent !important;
342
  }
343
+ .tcx-out-dash .userListBox_Wrapper {
344
  background-color: #fff;
345
  top: 86px !important;
346
  }
347
+ .tcx-out-dash .nifty_bg_holder {
348
  position:absolute;
349
  left:180px;
350
  border-top-right-radius: 15px;
351
  border-bottom-right-radius: 15px;
352
  }
353
+ #toolbar-item-open-tcx {
354
  position:fixed;
355
  right:7px;
356
  top:50%;
357
  }
358
 
359
+ .tcx-out-dash .user_header_wrapper_info {
360
  width:60% !important;
361
  }
362
 
363
+ .nifty_top_wrapper.tcx-out-dash .wrap {
364
  z-index: 9999 !important;
365
  }
366
 
631
  font-size:0.8em;
632
  background-color:#bbb;
633
  color:#FFF;
634
+ -webkit-border-radius: 5px;
635
  -moz-border-radius: 5px;
636
  border-radius: 5px;
637
  }
685
  padding: 0 0 0 0px;
686
  color: #C2BBBE;
687
  display: block;
 
688
  text-transform: uppercase;
689
  }
690
+ .wplc_agent_container small { word-wrap: break-word; display:block; }
691
  .wplc_agent_container select { width: 120px; }
692
 
693
  /* Settings: Relevant extensions (bottom of the page) */
987
  background: white;
988
  width: 400px;
989
  height: 55px;
990
+ border-left: 4px solid #0596d4;
991
  left: 0;
992
  right: 0;
993
  top: 0;
1106
  width: 100%;
1107
  bottom: 0;
1108
  left: 0;
1109
+ background: #0596d4;
1110
  opacity: .9;
1111
  }
1112
 
1120
  margin:0;
1121
  background-size: cover;
1122
  background-position: center;
1123
+ background-color:#0596d4 !important;
1124
  transition: all .2s ease-in-out;
1125
  box-sizing: border-box;
1126
  box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
1288
  .exp_cols {
1289
  background: #fcfcfc;
1290
  height: 24px;
 
1291
  border-bottom: 1px solid #eee;
1292
  font-size: 11px;
1293
  }
1316
  color: #007bff !important;
1317
  }
1318
 
 
 
 
1319
  #nifty_wrapper .messages .wplc-admin-message.agent_to_agent .wplc-msg-content {
1320
+ /*display: inline-block;*/
1321
  position: relative;
1322
  top: 0px;
1323
  left: 0px;
1328
  border-radius: 3px;
1329
  float: left !important;
1330
  }
1331
+
1332
  #nifty_wrapper .messages .wplc-admin-message.agent_to_agent .wplc-msg-content:after {
1333
  top: 15px;
1334
  left: -7px;
1345
  position:absolute;
1346
  top: 22px;
1347
  right: 20px;
1348
+ }
1349
+ .wplc_wrap h2{
1350
+ margin-bottom:12px!important;
1351
+ }
1352
+ .wplc_gdpr_sub_notice{
1353
+ margin-bottom:10px;
1354
+ }
1355
+ .wplc_dgpr_table{
1356
+ table-layout: auto!important;
1357
+ }
1358
+ .wplc_dgpr_table input[type="text"] {
1359
+ width:300px!important;
1360
  }
css/remote_dash_styles.min.css DELETED
@@ -1 +0,0 @@
1
- .toplevel_page_wplivechat-menu a{color:#eb832c}.toplevel_page_wplivechat-menu a:hover{color:#eb832c;text-decoration:underline}.toplevel_page_wplivechat-menu a:active{color:#eb832c}.toplevel_page_wplivechat-menu a:focus{color:#eb832c}.wplc_a2a_dismiss{position:absolute;right:10px;top:5px;font-style:italic;font-size:.9em;text-decoration:underline;cursor:pointer}.floating-right-toolbar{position:absolute;right:10px;top:10px;z-index:9999}.floating-right-toolbar i{text-align:center;display:inline-block;color:#fff;background:#333;width:25px;height:25px;line-height:26px;font-size:9px;border-radius:30px;cursor:pointer;transition:background .5s ease;-webkit-transition:background .5s ease;-moz-transition:background .5s ease;-o-transition:background .5s ease}.floating-right-toolbar i:hover{background:#075077}.online_agent{position:relative}.online_agent .unread_count{top:5px;right:0}.wplc-admin-message,.wplc-user-message{display:block;padding-left:40px;font-size:14px;font-weight:700;margin-top:6px}.wplc-admin-message-avatar,.wplc-user-message-avatar{border-radius:5px;height:40px;width:40px;left:12px}.chatArea .messages a{color:#fff!important;text-decoration:underline!important}.chatArea span.messageBody{display:block;clear:both;font-size:14px;font-weight:100}#agent_list h4{padding-left:5px}.userListBox_Wrapper{top:110px;bottom:118px;position:absolute;width:100%;overflow-y:auto}.agent_involved{width:22px}div#choose_online{position:absolute;top:38px;right:0;color:#fff;padding-right:10px}.timedate{font-size:10px;float:right;position:relative;top:-15px}.wplc_remote_dash_below_contianer{border-radius:4px;overflow:hidden;margin-top:10px;margin-right:20px;padding:10px;text-align:center}.wplc_remote_dash_below_contianer p{margin:0}.agent_count{text-align:center;display:block;background:#fcfcfc;padding:5px;border-bottom:1px solid #eee;font-size:10px;width:50%;float:left}.history_link{text-align:center;display:block;background:#fcfcfc;padding:5px;border-bottom:1px solid #eee;font-size:10px;width:50%;float:left}.bleeper_tips_hints{margin-top:30px;width:300px;position:relative;display:block;left:0;top:15%;color:#000;text-align:center;margin-left:auto;margin-right:auto;font-size:1.3em;color:#777}#nifty_wrapper #agent_list{display:block;position:absolute;bottom:0;width:100%;max-height:155px;padding-right:20px;padding-left:20px;padding-top:5px;padding-bottom:5px;overflow-y:auto;border-top:1px solid #eee;background:#333;color:#b8b8b8}span.online_offline.online{background-color:#6da164;border-radius:15px}span.online_offline.offline{background-color:#939393;border-radius:15px}#agent_list ul li{padding-left:10px;padding:5px;border-radius:5px}.online_agent.active{background:#075077;color:#fff}.typing_preview_wplc{position:absolute;bottom:60px;height:auto;width:100%;background:#fff;padding-top:10px;padding-left:22px;padding-bottom:10px;color:#777;background-color:rgba(250,250,250,.25);box-shadow:0 0 7px 1px rgba(0,0,0,.07)}#wplc_footer_loading_icon{font-size:24px}span.bleeper-edit-message{margin-right:10px;margin-top:-26px;right:11px;font-weight:100;color:#1985be;font-size:11px;position:absolute;cursor:pointer}#quick_response_drawer_container{top:174px;left:30%;z-index:999}@media screen and (max-width:1300px){#quick_response_drawer_container{left:40%}}@media screen and (max-width:700px){#quick_response_drawer_container{left:10%}}.bleeper-out-dash #nifty_wrapper{border-radius:15px}#nifty_wrapper .nifty_add_media_button{position:absolute;right:0;bottom:0;width:60px;height:60px;padding-left:10px;padding-right:10px;padding-top:5px}.bleeper-out-dash .wrap{position:fixed;right:35px;top:30px;width:70%;min-width:400px;box-shadow:20px 20px 20px 20px rgba(0,0,0,.07);box-shadow:0 5px 40px rgba(0,0,0,.66)!important;border-radius:20px;padding:0;margin:5px;background-color:transparent!important}.bleeper-out-dash .floating-right-toolbar i{position:fixed!important;top:56%;right:7px}.bleeper-out-dash .info_chat img{clear:both;display:block}.bleeper-out-dash #user_count{padding:6px!important;padding-bottom:30px!important;text-align:center}.bleeper-out-dash #active_count{font-size:1em!important;top:0}.bleeper-out-dash #active_count_string{font-size:.8em!important}.bleeper-out-dash #choose_online{top:28px!important;width:100%;padding-right:0;text-align:center}.bleeper-out-dash .switchery-small{height:15px;width:24px}.bleeper-out-dash .visActionCol{float:right!important}.bleeper-out-dash .visChatStatusCol{width:20%!important}.bleeper-out-dash .visChatDepCol{display:none!important}.bleeper-out-dash .agents_involved{display:none!important}.bleeper-out-dash .switchery-small>small{width:14px!important;height:14px!important}.bleeper-out-dash #user_list{width:25%}.bleeper-out-dash .agent_count{display:none}.bleeper-out-dash .history_link{width:100%}.bleeper-out-dash #nifty_wrapper{background-color:transparent!important}.bleeper-out-dash .userListBox_Wrapper{background-color:#fff;top:86px!important}.bleeper-out-dash .nifty_bg_holder{position:absolute;left:180px;border-top-right-radius:15px;border-bottom-right-radius:15px}#toolbar-item-open-bleeper{position:fixed;right:7px;top:50%}.bleeper-out-dash .user_header_wrapper_info{width:60%!important}.nifty_top_wrapper.bleeper-out-dash .wrap{z-index:9999!important}.admin_visitor_advanced_info{border:1px solid #ccc;border-radius:3px;padding:15px;background:#fdfdfd;font-size:12px}.admin_visitor_advanced_info hr{margin-top:5px!important;margin-bottom:5px!important}.wplc-chat-box-notification--disabled{padding:5px;padding-left:15px;padding-right:15px;display:block;width:fit-content;margin-top:5px;margin-left:2px;border-left:4px solid #d26d6d;background-color:#fff;font-weight:700;box-shadow:0 1px 1px 0 rgba(0,0,0,.1);-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);-moz-box-shadow:0 1px 1px 0 rgba(0,0,0,.1)}#nifty_wrapper .dropdown-toggle,#nifty_wrapper .infoArea .filter-menu.pull-right{margin-top:7px;margin-right:-10px}#nifty_wrapper .dropdown-toggle{background-color:#000;color:#fff}#nifty_wrapper .visitorListBox .visitorList .vcol.visCol,#nifty_wrapper .visitorListBoxHeader .vcol.visCol{width:25%}#nifty_wrapper .visitorListBox .visitorList .vcol.visStatusCol,#nifty_wrapper .visitorListBoxHeader .vcol.visStatusCol{width:10%}#nifty_wrapper .visitorListBox .visitorList .vcol.visPageCol,#nifty_wrapper .visitorListBoxHeader .vcol.visPageCol{width:30%}#nifty_wrapper .visitorListBox .visitorList .vcol.visChatStatusCol,#nifty_wrapper .visitorListBoxHeader .vcol.visChatStatusCol{width:15%}#nifty_wrapper .visitorListBox .visitorList .vcol.visActionCol,#nifty_wrapper .visitorListBoxHeader .vcol.visActionCol{width:10%}#nifty_wrapper .visitorListBoxHeader .vcol.visCol{padding-left:15px}#nifty_wrapper .visitorListBoxHeader .vcol.visChatStatusCol{padding-left:0}#nifty_wrapper .visitorListBoxHeader .vcol.visActionCol{display:none}#nifty_wrapper .visitorListBox .visitorList{position:relative;left:0;top:0;width:100%;height:auto;padding:10px;margin:0;background-color:#fafafa;border-bottom:1px solid #e6e6e6}#nifty_wrapper .visitorListBox .visitorList .vcol{display:inline-block;position:relative;left:0;top:0;height:auto;padding-left:0;padding-top:7px;padding-right:0;padding-bottom:5px;margin:0}#nifty_wrapper .visitorListBox .visitorList .vcol.visCol{display:inline-block;position:relative;left:0;top:0}#nifty_wrapper .visitorListBox .visitorList .vcol.visCol .userName{padding-left:5px;text-overflow:ellipsis}#nifty_wrapper .visitorListBox .visitorList .vcol.visStatusCol{padding-top:0}#nifty_wrapper .visitorListBox .visitorList .vcol.visStatusCol .info_chat{display:inline-block;position:relative;left:0;top:0;font-size:1.5em;padding:1px;margin-top:5px}#nifty_wrapper .visitorListBox .visitorList .vcol.visStatusCol .info_chat i{margin-left:2px}#nifty_wrapper .visitorListBox .visitorList .vcol.visPageCol .referer-link{margin-bottom:5px}#nifty_wrapper .visitorListBox .visitorList .vcol.visPageCol .label-default.time-state-label{margin-bottom:3px;text-overflow:ellipsis}#nifty_wrapper .visitorListBox .visitorList .vcol.visChatStatusCol{padding-left:5px}#nifty_wrapper .visitorListBox .visitorList .vcol.visChatStatusCol label{text-overflow:ellipsis}#nifty_wrapper .visitorListBox .visitorList .vcol.visActionCol{padding-right:5px}#nifty_wrapper .visitorListBox .visitorList .vcol.visActionCol .btn{margin:0;padding:5px;font-size:1.3em;text-decoration:none}#nifty_wrapper .visitorListBox .visitorList .vcol.visActionCol .wplc_initiate_chat{background-color:#5bc0de}#nifty_wrapper .visitorListBox .visitorList .label-default{background-color:#fff;border:1px solid #e6e6e6;padding:5px;cursor:default}@media(max-width:767px){#nifty_wrapper .dropdown-toggle,#nifty_wrapper .infoArea .filter-menu.pull-right{margin-top:4px}#nifty_wrapper .visitorListBoxHeader .vcol.visCol{padding-left:15px}#nifty_wrapper .visitorListBoxHeader .vcol.visActionCol,#nifty_wrapper .visitorListBoxHeader .vcol.visChatStatusCol,#nifty_wrapper .visitorListBoxHeader .vcol.visPageCol,#nifty_wrapper .visitorListBoxHeader .vcol.visStatusCol{display:none}#nifty_wrapper .visitorListBox .visitorList .vcol.visChatStatusCol,#nifty_wrapper .visitorListBox .visitorList .vcol.visCol,#nifty_wrapper .visitorListBox .visitorList .vcol.visPageCol{padding:5px}#nifty_wrapper .visitorListBox .visitorList .vcol.visCol{width:75%}#nifty_wrapper .visitorListBox .visitorList .vcol.visCol .userName{padding-left:0}#nifty_wrapper .visitorListBox .visitorList .vcol.visStatusCol{width:25%}#nifty_wrapper .visitorListBox .visitorList .vcol.visPageCol{width:75%}#nifty_wrapper .visitorListBox .visitorList .vcol.visPageCol .label-default.time-state-label{margin-top:5px}#nifty_wrapper .visitorListBox .visitorList .vcol.visChatStatusCol{width:25%}#nifty_wrapper .visitorListBox .visitorList .vcol.visActionCol{width:100%}#nifty_wrapper .visitorListBox .visitorList .vcol.visActionCol .btn{width:100%;font-size:1em}}.wplc-chat-box-notification--disabled{padding:5px;padding-left:15px;padding-right:15px;display:block;width:fit-content;margin-top:5px;margin-left:2px;border-left:4px solid #d26d6d;background-color:#fff;font-weight:700;box-shadow:0 1px 1px 0 rgba(0,0,0,.1);-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);-moz-box-shadow:0 1px 1px 0 rgba(0,0,0,.1)}#wplc_settings .tooltip{display:block;position:absolute;width:auto;max-width:400px;height:auto;padding:15px;opacity:.85;background-color:#333;color:#eee;border-radius:15px}.wplc-extension-label-box{display:block;overflow:auto;clear:both}.wplc-extension-label{display:block;float:left;padding:5px;margin-right:5px;font-size:.8em;background-color:#bbb;color:#fff;webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.wplc-extension{float:left;margin:0 1% 1% 0;background:#fff;border:1px solid #ccc;width:320px;padding:14px;height:370px;position:relative}.wplc-extension h3{margin:0 0 8px;font-size:13px}.wplc-extension .button-secondary{position:absolute;bottom:14px;left:14px}.wplc-plugin{height:250px}.wplc_agent_container ul{display:block;overflow:auto}.wplc_agent_container li{display:block;float:left;text-align:center;border:1px solid #ccc;width:150px;height:310px;padding:10px;border-radius:5px;margin:10px;box-shadow:2px 2px 2px #ccc;overflow:auto}.wplc_agent_container img{border-radius:100px}.wplc_agent_container h3{font:bold 12px/16px Arial;padding:0;color:#c2bbbe;display:block;height:40px;text-transform:uppercase}.wplc_agent_container small{word-wrap:break-word;display:block;height:50px}.wplc_agent_container select{width:120px}#wplc_star_rating{text-align:center;padding:10px}.relevant_extension p{margin-top:2px}.relevant_extension h3{margin-bottom:2px}.relevant_extension{width:49%!important;height:125px!important;opacity:.5}.relevant_extension:hover{opacity:1}.relevant_extension .button-secondary{right:10px!important;text-align:center}.relevant_extension img{margin-right:10px}@media (min-width:320px){.relevant_extension{width:85%!important;height:145px!important;opacity:.5}.relevant_extension img{width:105px}.wplc-extension .wp-post-image{height:auto}}@media (min-width:480px){.relevant_extension{width:94%!important;height:125px!important;opacity:.5}.relevant_extension img{width:105px}.wplc-extension .wp-post-image{height:auto}}@media (min-width:600px){.relevant_extension{width:94%!important;height:125px!important;opacity:.5}.relevant_extension img{width:105px}.wplc-extension .wp-post-image{height:auto}}@media (min-width:801px){.relevant_extension{width:43%!important;height:145px!important;opacity:.5}.relevant_extension img{width:95px}.wplc-extension .wp-post-image{height:auto}}@media (min-width:1025px){.relevant_extension{width:44%!important;height:125px!important;opacity:.5}.relevant_extension img{width:125px}.wplc-extension .wp-post-image{height:auto}}@media (min-width:1281px){.relevant_extension{width:32%!important;height:125px!important;opacity:.5}.relevant_extension img{width:110px}.wplc-extension .wp-post-image{height:auto}}.wplc-palette-selection{border:1px solid #ccc;border-radius:5px;padding:5px;margin:5px;height:100%}.wplc_palette_single{margin:5px;margin-top:15px;width:162px;height:122px;text-align:center;display:inline-block;vertical-align:top;cursor:pointer}.wplc-palette-top{display:block;width:100%;height:25%}.wplc_modal{display:block;position:fixed;top:0;bottom:0;left:0;right:0;background:rgba(0,0,0,.3)}.wplc_modal_inner{width:60%;height:300px;margin:auto;background:#fff;position:fixed;z-index:9999;display:block;top:0;bottom:0;left:0;right:0;border:1px solid #9f9f9f;border-radius:3px}.wplc_modal_inner_title{font-size:18px;padding:17px;border-bottom:1px solid #d5d5d5}.wplc_modal_inner_content{position:absolute;display:block;left:10px;right:10px;bottom:55px;top:55px;overflow-y:auto}.wplc_modal_inner_actions{height:28px;position:absolute;bottom:5px;left:0;right:0;text-align:center}span.wplc_system_notification{display:block;clear:both;padding:8px;font-style:italic;text-align:right}.widefat th.sortable,.widefat th.sorted{padding:5px 10px!important}@media (max-width:1145px){.wplc-badge{max-width:35%!important;float:none!important;margin:0 auto!important}}#wplc_tabs .ui-tabs-anchor{width:100%}.wplc-chat-in-progress{display:inline-block;width:100px;margin-top:5px}.wplc-history__date{display:block;margin-bottom:5px}.wplc-history__date-end{margin-bottom:10px}.wplc-history__date strong{margin-right:5px}.wplc-exclude-post-types__item,.wplc-require-user-info__item{margin-bottom:5px}.wplc-chat-box-notification--disabled{padding:5px;display:block;width:40%;margin-left:auto;margin-right:auto;border:1px solid #d26d6d;background-color:#f3bfbf;font-weight:700}.admin_chat_box_inner span.timedate{clear:both;position:relative;font-size:.8em;font-style:italic}#nifty_file_holder{float:right;margin-right:13px;margin-top:4px}.nifty_tedit_icon{font-size:12px;padding-left:6px}#nifty_text_editor_holder{margin-top:3px;margin-left:4px}.wplc_faded_upsell{color:#d3d3d3}.wplc_chat_area_temp{padding:20px}.offline-quote{font-size:26px;font-style:italic;text-align:center;width:100%;display:block;color:#343434}.offline-status{display:block;width:100%;clear:both;text-align:center;line-height:45px}.wplc-logo{padding-top:50px;max-width:100vw;padding-bottom:50px}.wplc_network_issue{position:absolute;background:#fff;width:400px;height:55px;border-left:4px solid #ec822c;left:0;right:0;top:0;bottom:0;margin:auto;box-shadow:0 2px 5px 0 rgba(0,0,0,.16),0 2px 10px 0 rgba(0,0,0,.12);-webkit-box-shadow:0 0 0 0 rgba(0,0,0,.16),0 2px 7px 0 rgba(0,0,0,.12);-moz-box-shadow:0 2px 5px 0 rgba(0,0,0,.16),0 2px 10px 0 rgba(0,0,0,.12);-o-box-shadow:0 2px 5px 0 rgba(0,0,0,.16),0 2px 10px 0 rgba(0,0,0,.12)}.wplc_network_issue span{width:80%;display:block;padding-top:5%;padding-bottom:5%;padding-left:10%;padding-right:10%;margin:auto;position:absolute;top:0;bottom:0}.wplc_dashboard_additional_label{width:100%;text-align:center;display:block;margin-top:10px;cursor:help}#tabs-gutenberg input[type=button]{cursor:pointer}#wplc_custom_css_editor,#wplc_custom_html_editor,#wplc_custom_js_editor{width:100%;height:285px;margin:10px 0 10px 0;z-index:0}#wplc_gutenberg_icon{cursor:pointer}.wplc_code{cursor:pointer;transition:all .2s ease-in-out;border-radius:3px;color:#696969}.wplc_code:hover{background:#d7d7d7}.wplc_code:active,.wplc_code:focus{background:#018add;color:#fff}#wplc-chat-box{width:fit-content;position:relative;cursor:pointer}.wplc_block{position:relative;display:inline-block;background:#32373c;color:#eee;border-radius:3px;height:35px;padding-left:45px;margin:5px 0 5px 0;transition:all .2s ease-in-out;cursor:pointer;border-bottom:0 solid #111;font-size:17px;line-height:35px}.wplc_block:hover{transform:translateY(-2px)}.wplc_block:after{content:"";position:absolute;display:block;height:0;bottom:0;left:0;width:100%;background-color:#000;opacity:0;transition:all .2s ease-in-out}.wplc_block:hover:after{height:3px;opacity:.2}#wplc-chat-box.disabled:first-child:after{content:"Disabled";color:#fff;font-size:17px;text-transform:uppercase;text-align:center;display:block;position:absolute;height:100%;width:100%;bottom:0;left:0;background:#ed832f;opacity:.9}.wplc_block_logo{width:35px;height:35px;position:absolute;left:0;background:#e7e7e7;display:inline-block;margin:0;background-size:cover;background-position:center;background-color:#ed832f!important;transition:all .2s ease-in-out;box-sizing:border-box;box-shadow:inset -2px 0 0 0 rgba(0,0,0,.28);-webkit-box-shadow:inset -2px 0 0 0 rgba(0,0,0,.28);-moz-box-shadow:inset -2px 0 0 0 rgba(0,0,0,.28)}.wplc_block_text{display:inline-block;height:100%;margin-right:7px}.wplc_block_icon{height:100%;width:35px;background:0 0;display:inline-block}.wplc_block_icon.disabled{display:none}.wplc_block.sm{height:25px;line-height:25px;padding-left:30px;font-size:12px}.wplc_block.sm:hover:after{height:2px;opacity:.2}.wplc_block.sm .wplc_block_logo{height:25px;width:25px}.wplc_block.sm .wplc_block_text{margin-right:7px}.wplc_block.sm .wplc_block_icon{margin-right:7px;width:13px}.wplc_block.lg{height:80px;line-height:80px;padding-left:100px;font-size:25px}.wplc_block.lg:hover:after{height:6px;opacity:.2}.wplc_block.lg .wplc_block_logo{height:80px;width:80px}.wplc_block.lg .wplc_block_text{margin-right:13px}.wplc_block.lg .wplc_block_icon{margin-right:13px}#wpfooter+#quick_response_drawer_container+.update-nag{display:none!important;position:relative;float:left;left:15%;top:-60px;width:80%;margin-top:0;margin-bottom:10px;line-height:19px;padding:11px 15px;font-size:14px;text-align:left;background-color:#fff;border-left:4px solid #ffba00;box-shadow:0 1px 1px 0 rgba(0,0,0,.1)}#wpbody-content #screen-meta+.wplc_list_table,#wpbody-content #screen-meta+.wplc_wrap div{position:relative;left:0;top:0;margin-top:5px;height:auto}#wpbody-content #screen-meta>.wplc_wrap div{width:98%!important}#wpbody-content #screen-meta+.wplc_wrap .widefat{width:100%!important}#reporting_tabs{width:auto;max-width:98%}#wpbody-content #screen-meta+.wplc_wrap form[name=wplc_feedback]{width:70%;max-width:70%}#wpbody-content #screen-meta+.wplc_wrap form[name=wplc_feedback] .wplc_list_table{width:100%!important}#wpbody-content #screen-meta+.wplc_wrap form[name=wplc_feedback] .wplc_list_table tbody td input{width:100%}#nifty_wrapper .messages .messageBody a{color:#fff!important;text-decoration:underline!important}#nifty_wrapper .messages .wplc_system_notification .admin_visitor_advanced_info{background:0 0!important;border:none!important;padding:0!important}
 
css/support-css.css CHANGED
@@ -39,4 +39,46 @@
39
  -webkit-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
40
  -moz-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
41
  -o-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
42
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  -webkit-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
40
  -moz-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
41
  -o-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
42
+ }
43
+ @media (min-width:600px) {
44
+ .wplc_row_support{
45
+ display:flex;
46
+ justify-content: flex-start;
47
+ }
48
+ .wplc_row_col_support{
49
+ margin-right:25px;
50
+ }
51
+ }
52
+ .wplc_row_col_support{
53
+ margin-bottom:25px;
54
+ }
55
+ .wplc_row_col_support_inner{
56
+ padding:15px;
57
+ }
58
+ .wplc_row_col_support ul {
59
+ list-style:none;
60
+ }
61
+ .wplc_row_col_support ul li {
62
+ list-style:none;
63
+ }
64
+ .wplc_panel_heading{
65
+ background-color: #333;
66
+ color: #FFF;
67
+ font-size: 16px;
68
+ padding: 7px;
69
+ font-weight: bold;
70
+ }
71
+
72
+ .wplc_row_col_support ul li::before {
73
+ content: "•";
74
+ color: #0596d4;
75
+ display: inline-block;
76
+ width: 15px;
77
+ font-size: 25px;
78
+ top: 3px;
79
+ position: relative;
80
+ margin-left: 0px;
81
+ }
82
+ .wplc_wrap h2 {
83
+ margin-bottom: 12px!important;
84
+ }
css/support-css.min.css DELETED
@@ -1 +0,0 @@
1
- .wplc_row{width:100%;display:block;overflow:auto}.wplc_row_col{width:90%;float:left;display:block;overflow:auto;margin:.25%;padding:.2%;min-height:420px}.wplc_row_col h2{font-weight:900}.wplc_row_col ul li{margin:.3em 2.5em}.wplc_row_col ul{list-style-type:disc}@media only screen and (min-width:480px){.wplc_row_col{width:28%;float:left;display:block;overflow:auto;margin:1%;padding:1%;min-height:420px}}.wplc_row_col{border-radius:5px;box-shadow:0 0 40px 1px rgba(0,0,0,.07);-webkit-box-shadow:0 0 40px 1px rgba(0,0,0,.07);-moz-box-shadow:0 0 40px 1px rgba(0,0,0,.07);-o-box-shadow:0 0 40px 1px rgba(0,0,0,.07)}
 
css/themes/classic.css CHANGED
@@ -438,7 +438,7 @@ span.wplc-system-notification {
438
  left: auto;
439
  left: -7px;
440
  border-width: 6px 7px 6px 0;
441
- border-color: transparent #666;
442
  content: "";
443
  position: absolute;
444
  border-style: solid;
@@ -622,20 +622,20 @@ input#nifty_ratings_comment {
622
  }
623
 
624
  .wplc_button_standard {
625
- border: 1px solid #ED832F;
626
- background-color: #ED832F;
627
  opacity:0.9;
628
 
629
  }
630
  .wplc_button_standard:hover {
631
- border: 1px solid #ED832F;
632
- background-color: #ED832F;
633
  opacity:0.7;
634
  }
635
 
636
  .wplc_button_standard:focus {
637
- border: 1px solid #ED832F;
638
- background-color: #ED832F;
639
  opacity:0.7;
640
  }
641
 
@@ -832,13 +832,13 @@ input#nifty_ratings_comment {
832
  background: none !important;
833
  color: #333 !important;
834
  }
835
- a.bleeper_restart_chat {
836
  text-align: center;
837
  margin-top: 15px;
838
  display: block;
839
  }
840
 
841
- div#bleeper_chat_ended {
842
  min-height: 50px;
843
  max-height: 50px;
844
  height: 50px;
@@ -854,7 +854,7 @@ div#bleeper_chat_ended {
854
  }
855
 
856
  /* System notification message style */
857
- #bleeper_notification_message {
858
  position: absolute;
859
  border-radius: 3px;
860
  padding: 3px 6px;
438
  left: auto;
439
  left: -7px;
440
  border-width: 6px 7px 6px 0;
441
+ border-color: transparent #373737;
442
  content: "";
443
  position: absolute;
444
  border-style: solid;
622
  }
623
 
624
  .wplc_button_standard {
625
+ border: 1px solid #0596d4;
626
+ background-color: #0596d4;
627
  opacity:0.9;
628
 
629
  }
630
  .wplc_button_standard:hover {
631
+ border: 1px solid #0596d4;
632
+ background-color: #0596d4;
633
  opacity:0.7;
634
  }
635
 
636
  .wplc_button_standard:focus {
637
+ border: 1px solid #0596d4;
638
+ background-color: #0596d4;
639
  opacity:0.7;
640
  }
641
 
832
  background: none !important;
833
  color: #333 !important;
834
  }
835
+ a.tcx_restart_chat {
836
  text-align: center;
837
  margin-top: 15px;
838
  display: block;
839
  }
840
 
841
+ div#tcx_chat_ended {
842
  min-height: 50px;
843
  max-height: 50px;
844
  height: 50px;
854
  }
855
 
856
  /* System notification message style */
857
+ #tcx_notification_message {
858
  position: absolute;
859
  border-radius: 3px;
860
  padding: 3px 6px;
css/themes/classic.min.css DELETED
@@ -1 +0,0 @@
1
- #wplc_chatmsg{background-color:#fff!important;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:15px;line-height:32px;color:#60686e;width:275px!important;height:40px;border:0;border-radius:5px;background:#fff;resize:none;border:none;white-space:pre-wrap;word-wrap:break-word;padding-left:30px;padding-right:100px;box-sizing:border-box;min-height:35px;overflow-y:hidden;padding:5px!important;margin-top:10px;background-color:#fff!important;padding-left:30px!important}#wp-live-chat textarea{width:100%}.nifty_rating_icon{margin-right:10px}#wp-live-chat-2-inner input,#wp-live-chat-2-inner select,#wp-live-chat-2-inner textarea{border:1px solid rgba(0,0,0,.1);border-radius:2px;color:#2b2b2b;padding:8px 10px 7px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;height:inherit;width:100%}#wplc_chatbox{padding:5px;height:190px;overflow-y:auto;overflow-x:hidden;-webkit-box-shadow:inset 0 5px 5px -4px rgba(50,50,50,.5);-moz-box-shadow:inset 0 5px 5px -4px rgba(50,50,50,.5);box-shadow:inset 0 5px 5px -4px rgba(50,50,50,.5)}#wp-live-chat td{padding:5px;padding-left:10px}#wp-live-chat table{border:0!important}#wp-live-chat table td{border:0!important}#wp-live-chat h4{font-size:20px;margin:3px}#wp-live-chat p{font-size:14px;margin:3px}#wp-live-chat #wplc-sb{font-size:14px;font-weight:700}#wp-live-chat-3{padding:10px;text-align:center}#wp-live-chat{position:fixed;z-index:105;display:block;background:#fff;-webkit-box-shadow:0 0 5px 0 rgba(50,50,50,.5);-moz-box-shadow:0 0 5px 0 rgba(50,50,50,.5);box-shadow:0 0 5px 0 rgba(50,50,50,.5);border-radius:5px 5px 0 0;color:#999;max-width:280px;z-index:9999}#wp-live-chat-1{cursor:pointer;padding:5px;padding-left:20px;padding-right:20px;font-size:14px;color:#fff}#wp-live-chat-minimize{position:absolute;right:6px;top:4px;cursor:pointer;height:14px;padding:0 3px;border-radius:2px;background-color:rgba(0,0,0,.4);font-size:10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:14px;padding-top:6px}#wp-live-chat-close{position:absolute;right:5px;top:4px;cursor:pointer;border-radius:2px;background-color:rgba(0,0,0,.4);font-size:12px;vertical-align:middle;height:14px;width:14px;text-align:center;vertical-align:bottom;padding-top:1px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#wp-live-chat-2-info{font-size:13px;display:block;width:212px;overflow:hidden;text-align:center;margin:0 auto}#wp-live-chat-2-img{padding-bottom:5px}.wplc_offline{font-size:12px;font-weight:700}.wplc_logo_class{max-width:250px;padding-top:5px}#wp-live-chat-header{padding:10px 0 0;border-radius:5px 5px 0 0;position:relative}#wp-live-chat-image{position:absolute;width:40px;padding:4px;max-height:40px;background:#fff;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;top:-35px;left:20px;-webkit-box-shadow:0 0 5px 0 rgba(100,100,100,.7);-moz-box-shadow:0 0 5px 0 rgba(100,100,100,.7);box-shadow:0 0 5px 0 rgba(100,100,100,.7)}#wp-live-chat-image img{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}#wp-live-chat-2{padding:5px}#wp-live-chat-2 input{display:block;margin:5px 0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;height:inherit;background-image:none;filter:none;text-shadow:none}.wplc-clear-float-message{clear:both}#wplc_message_div{text-align:center}#wp-live-chat-inner-image-div{overflow:hidden;height:32px}.wplc_close.wplc_left #wp-live-chat-1{-ms-transform:rotate(90deg);-moz-transform:rotate(90deg);-webkit-transform:rotate(90deg);transform:rotate(90deg);-ms-transform-origin:left top 0;-moz-transform-origin:left top 0;-webkit-transform-origin:left top 0;transform-origin:left top 0;float:left;width:195px;position:absolute;top:27px;padding-left:0;left:39px}.wplc_left #wp-live-chat-header{border-radius:0 5px 5px 0}.wplc_close.wplc_left #wp-live-chat-header{position:absolute;top:0;width:45px;bottom:0;right:0}.wplc_open.wplc_left #wp-live-chat-header{border-radius:0 5px 0 0}.wplc_close.wplc_left .wp-live-chat-wrapper,.wplc_close.wplc_right .wp-live-chat-wrapper{position:relative;height:250px}.wplc_left{border-radius:0 5px 5px 0!important}.wplc_close.wplc_left{padding-right:45px;min-height:220px}#wplc_user_message_div{border-top:1px solid #eee;background-color:#fff}.wplc_close.wplc_right #wp-live-chat-1{-ms-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-webkit-transform:rotate(-90deg);transform:rotate(-90deg);-ms-transform-origin:0 0 0;-moz-transform-origin:0 0 0;-webkit-transform-origin:0 0 0;transform-origin:0 0 0;float:left;width:180px;padding:0!important;bottom:0;position:absolute;left:8px}span.wplc_system_notification{display:block;padding:8px;clear:both;font-style:italic;text-align:left}.wplc_close.wplc_right #wp-live-chat-header{position:absolute;top:0;width:45px;bottom:0;left:0;border-radius:5px 0 0 5px}.wplc_close.wplc_right{padding-left:45px;min-height:220px;border-radius:5px 0 0 5px!important}.wplc_open.wplc_right #wp-live-chat-header{border-radius:5px 0 0 0}.wplc_right{border-radius:5px 0 0 5px!important}.wplc_close.wplc_left #wp-live-chat-image{top:25px;left:35px}.wplc_close.wplc_right #wp-live-chat-image{bottom:18px;left:initial;right:38px;top:initial}.wplc-user-message .wplc-user-message-avatar{border-radius:25px;position:absolute;top:3px;right:-38px;max-width:30px;max-height:30px}.wplc-admin-message-avatar{max-width:30px;max-height:30px}.wplc-admin-message img{border-radius:25px;position:absolute;top:3px;left:-38px}.wplc-admin-message{padding:10px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;border:1px solid #ccc;margin-top:2px;background-color:#eee;display:inline-block;float:right;clear:both;margin-bottom:3px;word-wrap:break-word;width:85%;position:relative}.wplc-user-message{padding:10px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;border:1px solid #ffdb99;margin-top:2px;background-color:#fff6ef;color:#000;display:inline-block;clear:both;margin-bottom:3px;word-wrap:break-word;width:85%;position:relative}.wplc-user-message:before{display:block;width:0;top:15px;bottom:auto;left:auto;right:-7px;border-width:6px 0 6px 7px;border-color:transparent #ffdb99;content:"";position:absolute;border-style:solid}.wplc-admin-message:before{display:block;width:0;top:15px;bottom:auto;left:auto;left:-7px;border-width:6px 7px 6px 0;border-color:transparent #666;content:"";position:absolute;border-style:solid}.chat_time{display:block;width:100%;text-align:center;font-size:.8em;color:#ccc;clear:both}.wplc-admin-message hr,.wplc-user-message hr{margin-bottom:0!important}#wplc_first_message{display:block}#wp-live-chat-2-inner #wplc_start_chat_btn{width:100%;border:none}#wplc_social_holder{position:absolute;top:2px;width:20px}.nifty_tedit_icon{font-size:12px!important;padding-left:6px}#nifty_text_editor_holder{margin-top:0;margin-left:4px}.nifty_attach_icon{position:absolute;bottom:10px;right:10px}#nifty_ratings_holder{position:absolute;top:-35px;left:70px}#nifty_ratings_form{position:absolute;left:-40px;top:-38px;width:250px;padding:2px;border-radius:4px}input#nifty_ratings_comment{width:60%;margin-bottom:0;line-height:inherit;font-size:12px;top:0;position:relative;float:left}#nifty_ratings_comment{height:25px!important;margin-left:2px}#nifty_rating_button{float:left;border-style:none;width:27%;border-radius:2px;text-align:center;font-size:12px;padding:2px;position:relative;margin-left:10px;margin-top:1px}#nifty_rating_thanks{position:absolute;top:0;left:58px;width:200px}#nifty_recording{margin-left:5px}#wplc_hovercard{position:fixed;bottom:96px;right:98px;width:209px;height:125px;border:1px solid #ccc;background-color:#fff;border-radius:5px;z-index:9999999}#wplc_hovercard:before{content:"";position:absolute;bottom:-9px;left:32px;border-width:9px 9px 0;border-style:solid;border-color:#ccc transparent;display:block;width:0}#wplc_hovercard:after{content:"";position:absolute;bottom:-8px;left:33px;border-width:8px 8px 0;border-style:solid;border-color:#fafafb transparent;display:block;width:0}.wplc_button_standard{border:1px solid #ed832f;background-color:#ed832f;opacity:.9}.wplc_button_standard:hover{border:1px solid #ed832f;background-color:#ed832f;opacity:.7}.wplc_button_standard:focus{border:1px solid #ed832f;background-color:#ed832f;opacity:.7}#wplc_hovercard_min{position:absolute;width:61px;height:18px;right:0;top:-25px;font-size:9px;text-align:center;border-radius:9px;color:#fff;cursor:pointer}#wplc_hovercard_bottom{border-top:1px solid #ccc;padding-top:10px;height:43px;border-bottom-right-radius:5px;background-color:#fafafb;border-bottom-left-radius:5px}#wplc_hovercard_content{padding:15px;height:80px;box-shadow:0 1px 1px #f0f0f1}#speeching_button{padding:5px;font-size:12px;text-transform:none;float:right;margin-right:15px}.wplc_hovercard_content_right #wplc_first_message{display:block}.wplc_hovercard_content_right #wplc_first_message strong{display:block;clear:right}.wplc_hovercard_content_left{float:left;display:block;height:60px;padding-left:10px;padding-right:10px;width:80px}.wplc_hovercard_content_right{float:left;display:block;font-size:.8em;word-wrap:break-word;height:70px;width:188px}.wplc_left_logo{width:60px;height:60px;border-radius:30px}.wplc_hovercard_content_right .wplc_offline{font-size:.9em;font-weight:700}.typing_indicator{width:100%;position:relative;height:0;opacity:.3;font-size:.8em;transition-property:all;-webkit-transition-property:all;-moz-transition-property:all;-o-transition-property:all;transition-duration:.5s;-webkit-transition-duration:.5s;-moz-transition-duration:.5s;-o-transition-propdurationerty:.5s}.typing_indicator_active{position:relative;height:20px;opacity:.9;transition-property:all;-webkit-transition-property:all;-moz-transition-property:all;-o-transition-property:all;transition-duration:.5s;-webkit-transition-duration:.5s;-moz-transition-duration:.5s;-o-transition-propdurationerty:.5s}.wplc_msg_notice{font-size:.8em}.wplc_powered_by_link{font-size:10px;max-width:120px;position:absolute;bottom:3px;padding:3px}#wplc_chatbox span.timedate{font-size:.8em;display:block;font-style:italic}.wplc-msg-float-left{margin-left:15%;text-align:left}.wplc-msg-float-right{margin-right:15%;text-align:right}.wdt-emoji-popup.open{z-index:99999}.wdt-emoji-picker{right:84px!important;bottom:27px!important;font-size:17px;text-align:center;line-height:50px}.wdt-emoji-picker i{position:absolute;left:61px;top:27px}.wdt-emoji-popup.ready.open{width:281px;margin-left:20px}.wdt-emoji-popup h3.sticky{width:214px}.wdt-emoji-tab{width:25px}.wdt-credit{z-index:999999;position:absolute;right:5px;bottom:5px;font-size:9px;color:#cecece}#chat_drag_zone{background:rgba(51,51,51,.35);position:absolute;top:0;left:0;right:0;bottom:0;z-index:9999999;border-top-left-radius:11px;border-top-right-radius:11px}#chat_drag_zone_inner{position:absolute;top:10%;left:5%;right:5%;bottom:10%;border:3px dashed #fff}#chat_drag_zone_inner span{color:#fff;position:absolute;width:100%;height:50px;text-align:center;font-size:30px;margin-top:auto;margin-bottom:auto;top:50%;transform:translate(0,-50%)}#nifty_text_editor_holder{display:none}.typing_indicator{padding-left:5px}#wp-live-chat-2-info{background:0 0!important;color:#333!important}a.bleeper_restart_chat{text-align:center;margin-top:27px;display:block}div#bleeper_chat_ended{min-height:60px;max-height:82px;height:82px;position:absolute;bottom:0;width:100%;z-index:99999999999999999;background-color:#fff;border-bottom-right-radius:10px;border-bottom-left-radius:10px;box-shadow:0 0 40px 1px rgba(0,0,0,.07)}#bleeper_notification_message{position:absolute;border-radius:3px;padding:3px 6px;top:-5px;animation:wplc_notification_slide_in .2s forwards}@keyframes wplc_notification_slide_in{from{top:-5px;opacity:0}to{top:-35px;opacity:.8}}input#wplc_chat_gdpr_opt_in{display:inline-block;width:inherit;vertical-align:top;margin-left:2px;margin-right:2px}label[for=wplc_chat_gdpr_opt_in]{display:inline-block;font-size:.7em;max-width:90%;vertical-align:top}.wplc_gdpr_privacy_notice{margin-top:10px;margin-bottom:10px;font-size:.6em;margin-left:2em;margin-right:2em;color:#bdbdbd}.wplc_gdpr_privacy_notice a{color:#8e8e8e}.wplc_gdpr_privacy_notice a:hover{color:#8e8e8e;text-decoration:underline}#wplc_end_chat_button{position:absolute;top:-32px;right:0;padding:5px;font-size:9px;font-weight:200;border-radius:4px;background:#fff!important;color:#333!important;line-height:12px;box-shadow:0 0 15px 0 rgba(86,86,86,.11);border:none}.wplc_in_chat_notice{position:absolute;background:#fff;bottom:35%;padding:30px;width:80%;margin-left:8%;box-shadow:0 0 20px 0 #33333324;border-radius:5px;z-index:999999}.wplc_in_chat_notice_heading{font-size:16px;padding-bottom:10px;border-bottom:#eee 1px solid;margin-bottom:10px}.wplc_in_chat_notice_content button{padding:5px;font-size:12px;display:inline-block;font-weight:100;margin-bottom:5px;border:none}.wplc_in_chat_notice_content button:hover{box-shadow:none;padding:5px;cursor:pointer}.wplc_in_chat_notice_content{padding-top:15px}
 
css/themes/modern.css CHANGED
@@ -2,10 +2,10 @@
2
  background-color: #fff !important;
3
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
4
  font-size: 15px;
5
- line-height: 28px;
6
  color: #60686e;
7
  /* width: 100%; */
8
- width: 268px !important;
9
  height: 40px;
10
  /* margin-bottom: 10px; */
11
  border: 0;
@@ -24,11 +24,12 @@
24
  margin-top: 10px;
25
  background-color: #fff !important;
26
  padding-left: 30px !important;
 
27
  }
 
28
  #wplc_chatmsg:focus {
29
  outline: none !important;
30
  background-color: #fff;
31
- box-shadow: none !important;
32
  }
33
 
34
  #wp-live-chat-inner-container textarea {
@@ -73,16 +74,12 @@
73
  /* height: 100%; */
74
  z-index: 99998;
75
  position: absolute;
76
- overflow-y: auto;
77
  padding: 5%;
78
  width:100%;
79
  overflow-y: scroll;
 
80
  font-size: 12pt;
81
  }
82
- #wp-live-chat-inner-container {
83
- /* padding:16px; */
84
-
85
- }
86
 
87
  #wp-live-chat td {
88
  padding: 5px;
@@ -219,10 +216,6 @@
219
  padding-bottom: 5px;
220
  }
221
 
222
- .wplc_offline {
223
-
224
-
225
- }
226
  .wplc_agent_involved {
227
  margin-top:5px;
228
  }
@@ -230,20 +223,21 @@
230
  display:block;
231
  overflow:auto;
232
  font-size: 12pt;
233
-
234
  }
235
 
236
  .wplc_agent_name {
237
  font-weight: bold;
238
- margin-top: 12px;
239
  display: block;
240
  float: left;
241
- margin-left: 10px;
242
  font-size: 12pt;
243
- max-width: 50%;
244
  overflow: hidden;
245
  text-overflow: ellipsis;
246
  white-space: pre;
 
 
 
247
  }
248
 
249
  .wplc_logo_class {
@@ -352,10 +346,9 @@ z-index: 2147483000;
352
  -webkit-border-radius: 2px;
353
  -moz-border-radius: 2px;
354
  border-radius: 6px;
355
- border: 1px solid #666;
356
  margin-top:2px;
357
- background-color:#666;
358
- display: inline-block;
359
  float: left;
360
  clear:both;
361
  margin-bottom: 3px;
@@ -373,30 +366,19 @@ z-index: 2147483000;
373
  max-height: 30px;
374
  }
375
 
376
-
377
- .wplc-shrink .wplc_agent_involved {
378
  float: left;
379
  margin-left: 30px;
380
  margin-top: 3px;
381
- width:40px;
382
- height:40px;
383
-
384
- }
385
- .wplc-shrink {
386
- /*height: 50px !important;*/
387
  }
388
 
389
- span.bleeper_pullup.up {
390
  top: 3px !important;
391
  }
392
 
393
- .wplc-shrink .wplc_agent_name {
394
- float: left;
395
- margin-left: 10px;
396
- margin-top: -15px;
397
- }
398
-
399
- .wplc-shrink .wplc_agent_infosection {
400
  display: none;
401
  }
402
 
@@ -410,14 +392,17 @@ span.bleeper_pullup.up {
410
  text-align:left;
411
  }
412
 
413
-
414
  .wplc_agent_tagline {
415
- display: block;
416
- clear: both;
417
- float: left;
418
- margin-left: 45px;
419
- font-weight: 100;
420
-
 
 
 
 
421
  }
422
 
423
  #wplc_chatbox {
@@ -434,8 +419,10 @@ span.bleeper_pullup.up {
434
  opacity:0.90;
435
  transition: top 0.7s ease;
436
  padding-bottom:18px;
437
-
 
438
  }
 
439
  #wplc_chatbox_header_bg {
440
  border-top-left-radius: 10px;
441
  border-top-right-radius: 10px;
@@ -451,7 +438,7 @@ span.bleeper_pullup.up {
451
  left: auto;
452
  left: -7px;
453
  border-width: 6px 7px 6px 0;
454
- border-color: transparent #666;
455
  content: "";
456
  position: absolute;
457
  border-style: solid;
@@ -467,7 +454,6 @@ span.bleeper_pullup.up {
467
  margin-top:2px;
468
  background-color:#ffdb99;
469
  color:#000;
470
- display: inline-block;
471
  float: right;
472
  clear:both;
473
  margin-bottom: 3px;
@@ -532,20 +518,20 @@ span.bleeper_pullup.up {
532
  }
533
 
534
  .wplc_button_standard {
535
- border: 1px solid #ED832F;
536
- background-color: #ED832F;
537
  opacity:0.9;
538
 
539
  }
540
  .wplc_button_standard:hover {
541
- border: 1px solid #ED832F;
542
- background-color: #ED832F;
543
  opacity:0.7;
544
  }
545
 
546
  .wplc_button_standard:focus {
547
- border: 1px solid #ED832F;
548
- background-color: #ED832F;
549
  opacity:0.7;
550
  }
551
 
@@ -629,11 +615,6 @@ span.bleeper_pullup.up {
629
  border-radius: 30px;
630
  }
631
 
632
- .wplc_hovercard_content_right .wplc_offline {
633
-
634
-
635
- }
636
-
637
  #wplc_message_div {
638
  margin-top: 20px;
639
  }
@@ -654,11 +635,16 @@ span.bleeper_pullup.up {
654
  position: absolute;
655
  width: 80px;
656
  z-index: 9999999999 !important;
657
- bottom: 12px;
658
- right: 45px;
659
  font-size: 15px;
660
  }
661
 
 
 
 
 
 
662
  .wplc_social_icon {
663
  margin-left: 3px;
664
  font-size: 24px;
@@ -677,8 +663,7 @@ span.bleeper_pullup.up {
677
  #nifty_file_holder {
678
  float: right;
679
  position: relative;
680
- top: -47px;
681
- display: inline-block;
682
  margin-right: 10px;
683
  font-size: 18px;
684
  }
@@ -688,14 +673,14 @@ span.bleeper_pullup.up {
688
  .nifty_rating_icon {
689
  margin-right: 10px;
690
  color:#999;
691
- font-size: 17px;
692
  }
693
  #nifty_ratings_holder {
694
- float:right;
695
- display: inline-block;
696
  position: relative;
697
- top: -52px;
698
  cursor: pointer;
 
699
  }
700
  #nifty_ratings_form {
701
  position: absolute;
@@ -742,7 +727,6 @@ input#nifty_ratings_comment {
742
  line-height: 12px;
743
  right: 3px;
744
  height: 24px;
745
- display: inline-block;
746
  position: relative;
747
  box-sizing: border-box;
748
  }
@@ -759,7 +743,6 @@ input#nifty_ratings_comment {
759
  line-height: 12px;
760
  right: 1px;
761
  height: 24px;
762
- display: inline-block;
763
  position: relative;
764
  box-sizing: border-box;
765
  }
@@ -827,10 +810,6 @@ span.wplc-system-notification {
827
  text-align: left;
828
  }
829
 
830
- .wplc_doc_suggestion {
831
-
832
-
833
- }
834
  button.wplc_retry_chat {
835
  margin: 10px;
836
  }
@@ -878,7 +857,7 @@ button.wplc_retry_chat {
878
  margin-left:35px;
879
  }
880
 
881
- .wplc-shrink .wplc_thumb16_stacked {
882
  border-radius: 16px;
883
  height: 32px !important;
884
  width: 32px !important;
@@ -890,9 +869,8 @@ button.wplc_retry_chat {
890
  .wplc_thumb32 {
891
  border-radius:32px;
892
  float: left;
893
- height: 60px;
894
- margin-left: 45px;
895
- margin-top: 20px;
896
  }
897
 
898
 
@@ -960,12 +938,18 @@ button.wplc_retry_chat {
960
  z-index: 99999;
961
  }
962
 
 
 
 
 
963
  .wdt-emoji-picker {
964
- right: 10px;
965
- bottom: 25px !important;
966
  font-size: 17px;
967
  text-align: center;
968
- line-height: 50px;
 
 
969
  }
970
 
971
  .wdt-credit{
@@ -1011,38 +995,29 @@ button.wplc_retry_chat {
1011
  transform: translate(0, -50%);
1012
  }
1013
 
1014
-
1015
  .wplc_agent_involved {
1016
  transition: all 0.4s ease;
1017
  }
1018
 
1019
- .wplc-shrink .wplc_agent_involved {
1020
- transition: none !important;
1021
- }
1022
-
1023
  .wplc_agent_info .wplc_agent_name{
1024
  transition: all 0.4s ease;
1025
  }
1026
 
1027
- .wplc-shrink .wplc_agent_name{
1028
- transition: none !important;
1029
- }
1030
-
1031
 
1032
- span.bleeper_pullup {
1033
  position: absolute;
1034
- top: 31px;
1035
  color: rgba(255, 255, 255, 0.68);
1036
- right: 50px;
1037
  font-size: 20pt;
1038
  cursor: pointer;
1039
  }
1040
- a.bleeper_restart_chat {
1041
  text-align: center;
1042
  margin-top: 15px;
1043
  display: block;
1044
  }
1045
- div#bleeper_chat_ended {
1046
  min-height: 60px;
1047
  max-height: 60px;
1048
  position: absolute;
@@ -1056,7 +1031,7 @@ div#bleeper_chat_ended {
1056
  }
1057
 
1058
  /* System notification message style */
1059
- #bleeper_notification_message {
1060
  position: absolute;
1061
  border-radius: 3px;
1062
  padding: 3px 6px;
@@ -1083,7 +1058,7 @@ div#bleeper_chat_ended {
1083
 
1084
  }
1085
 
1086
- div#bleeper_bell {
1087
  animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
1088
  transform: translate3d(0, 0, 0);
1089
  backface-visibility: hidden;
@@ -1157,9 +1132,9 @@ label[for=wplc_chat_gdpr_opt_in] {
1157
 
1158
  #wplc_end_chat_button {
1159
  position: absolute;
1160
- top: 35px;
1161
  z-index:9999999;
1162
- right: 25px;
1163
  padding: 5px;
1164
  font-size: 15pt;
1165
  font-weight: 100 !important;
@@ -1170,6 +1145,7 @@ label[for=wplc_chat_gdpr_opt_in] {
1170
  transition: top 0.15s cubic-bezier(0.65, 0.05, 0.36, 1);
1171
  height: 25px;
1172
  width: 25px;
 
1173
  }
1174
 
1175
  #wplc_end_chat_button i:first-child{
@@ -1185,7 +1161,7 @@ label[for=wplc_chat_gdpr_opt_in] {
1185
  top: 6px !important;
1186
  }
1187
 
1188
- .bleeper_restart_chat {
1189
  font-size: 12pt;
1190
  }
1191
 
@@ -1274,20 +1250,3 @@ span.wplc_char_counter {
1274
  font-size: 12pt;
1275
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
1276
  }
1277
-
1278
- .wplc_agent_bio {
1279
- display: none !important;
1280
- }
1281
-
1282
- .wplc_agent_tagline {
1283
- position: absolute;
1284
- margin-left: 115px;
1285
- margin-top: 30px !important;
1286
- font-size: 12pt;
1287
- height: 22px;
1288
- width: 150px;
1289
- overflow: hidden;
1290
- text-overflow: ellipsis;
1291
- white-space: pre;
1292
- font-style: italic;
1293
- }
2
  background-color: #fff !important;
3
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
4
  font-size: 15px;
5
+ line-height: 1em;
6
  color: #60686e;
7
  /* width: 100%; */
8
+ width: 260px !important;
9
  height: 40px;
10
  /* margin-bottom: 10px; */
11
  border: 0;
24
  margin-top: 10px;
25
  background-color: #fff !important;
26
  padding-left: 30px !important;
27
+ box-shadow: none !important;
28
  }
29
+
30
  #wplc_chatmsg:focus {
31
  outline: none !important;
32
  background-color: #fff;
 
33
  }
34
 
35
  #wp-live-chat-inner-container textarea {
74
  /* height: 100%; */
75
  z-index: 99998;
76
  position: absolute;
 
77
  padding: 5%;
78
  width:100%;
79
  overflow-y: scroll;
80
+ overflow-x: hidden;
81
  font-size: 12pt;
82
  }
 
 
 
 
83
 
84
  #wp-live-chat td {
85
  padding: 5px;
216
  padding-bottom: 5px;
217
  }
218
 
 
 
 
 
219
  .wplc_agent_involved {
220
  margin-top:5px;
221
  }
223
  display:block;
224
  overflow:auto;
225
  font-size: 12pt;
226
+ box-sizing: unset;
227
  }
228
 
229
  .wplc_agent_name {
230
  font-weight: bold;
 
231
  display: block;
232
  float: left;
 
233
  font-size: 12pt;
234
+ max-width: 60%;
235
  overflow: hidden;
236
  text-overflow: ellipsis;
237
  white-space: pre;
238
+ margin-left: 10px;
239
+ margin-top: -8px;
240
+ transition: none !important;
241
  }
242
 
243
  .wplc_logo_class {
346
  -webkit-border-radius: 2px;
347
  -moz-border-radius: 2px;
348
  border-radius: 6px;
349
+ border: 1px solid #373737;
350
  margin-top:2px;
351
+ background-color:#373737;
 
352
  float: left;
353
  clear:both;
354
  margin-bottom: 3px;
366
  max-height: 30px;
367
  }
368
 
369
+ .wplc_agent_involved {
 
370
  float: left;
371
  margin-left: 30px;
372
  margin-top: 3px;
373
+ width: 40px;
374
+ height: 40px;
 
 
 
 
375
  }
376
 
377
+ span.tcx_pullup.up {
378
  top: 3px !important;
379
  }
380
 
381
+ .wplc_agent_infosection {
 
 
 
 
 
 
382
  display: none;
383
  }
384
 
392
  text-align:left;
393
  }
394
 
 
395
  .wplc_agent_tagline {
396
+ position: absolute;
397
+ margin-left: 62px;
398
+ margin-top: 15px;
399
+ font-size: 8pt;
400
+ height: 22px;
401
+ width: 220px;
402
+ overflow: hidden;
403
+ text-overflow: ellipsis;
404
+ white-space: pre;
405
+ font-style: italic;
406
  }
407
 
408
  #wplc_chatbox {
419
  opacity:0.90;
420
  transition: top 0.7s ease;
421
  padding-bottom:18px;
422
+ height: 50px;
423
+ box-sizing: unset;
424
  }
425
+
426
  #wplc_chatbox_header_bg {
427
  border-top-left-radius: 10px;
428
  border-top-right-radius: 10px;
438
  left: auto;
439
  left: -7px;
440
  border-width: 6px 7px 6px 0;
441
+ border-color: transparent #373737;
442
  content: "";
443
  position: absolute;
444
  border-style: solid;
454
  margin-top:2px;
455
  background-color:#ffdb99;
456
  color:#000;
 
457
  float: right;
458
  clear:both;
459
  margin-bottom: 3px;
518
  }
519
 
520
  .wplc_button_standard {
521
+ border: 1px solid #0596d4;
522
+ background-color: #0596d4;
523
  opacity:0.9;
524
 
525
  }
526
  .wplc_button_standard:hover {
527
+ border: 1px solid #0596d4;
528
+ background-color: #0596d4;
529
  opacity:0.7;
530
  }
531
 
532
  .wplc_button_standard:focus {
533
+ border: 1px solid #0596d4;
534
+ background-color: #0596d4;
535
  opacity:0.7;
536
  }
537
 
615
  border-radius: 30px;
616
  }
617
 
 
 
 
 
 
618
  #wplc_message_div {
619
  margin-top: 20px;
620
  }
635
  position: absolute;
636
  width: 80px;
637
  z-index: 9999999999 !important;
638
+ bottom: 27px;
639
+ right: 40px;
640
  font-size: 15px;
641
  }
642
 
643
+ #wplc-inline-chat-box #wplc_social_holder{
644
+ display:none;
645
+ }
646
+
647
+
648
  .wplc_social_icon {
649
  margin-left: 3px;
650
  font-size: 24px;
663
  #nifty_file_holder {
664
  float: right;
665
  position: relative;
666
+ top: -45px;
 
667
  margin-right: 10px;
668
  font-size: 18px;
669
  }
673
  .nifty_rating_icon {
674
  margin-right: 10px;
675
  color:#999;
676
+ font-size: 18px!important;
677
  }
678
  #nifty_ratings_holder {
679
+ float: right;
 
680
  position: relative;
681
+ bottom: 45px;
682
  cursor: pointer;
683
+ font-size: 18px;
684
  }
685
  #nifty_ratings_form {
686
  position: absolute;
727
  line-height: 12px;
728
  right: 3px;
729
  height: 24px;
 
730
  position: relative;
731
  box-sizing: border-box;
732
  }
743
  line-height: 12px;
744
  right: 1px;
745
  height: 24px;
 
746
  position: relative;
747
  box-sizing: border-box;
748
  }
810
  text-align: left;
811
  }
812
 
 
 
 
 
813
  button.wplc_retry_chat {
814
  margin: 10px;
815
  }
857
  margin-left:35px;
858
  }
859
 
860
+ .wplc_thumb16_stacked {
861
  border-radius: 16px;
862
  height: 32px !important;
863
  width: 32px !important;
869
  .wplc_thumb32 {
870
  border-radius:32px;
871
  float: left;
872
+ margin-left: 12px;
873
+ margin-top: 13px;
 
874
  }
875
 
876
 
938
  z-index: 99999;
939
  }
940
 
941
+ .wdt-emoji-picker-parent {
942
+ height: 60px!important;
943
+ }
944
+
945
  .wdt-emoji-picker {
946
+ right: 10px!important;
947
+ bottom: 45px !important;
948
  font-size: 17px;
949
  text-align: center;
950
+ height: 35px;
951
+ position: relative!important;
952
+ float: right!important;
953
  }
954
 
955
  .wdt-credit{
995
  transform: translate(0, -50%);
996
  }
997
 
 
998
  .wplc_agent_involved {
999
  transition: all 0.4s ease;
1000
  }
1001
 
 
 
 
 
1002
  .wplc_agent_info .wplc_agent_name{
1003
  transition: all 0.4s ease;
1004
  }
1005
 
 
 
 
 
1006
 
1007
+ span.tcx_pullup {
1008
  position: absolute;
1009
+ top: -2px;
1010
  color: rgba(255, 255, 255, 0.68);
1011
+ right: 36px;
1012
  font-size: 20pt;
1013
  cursor: pointer;
1014
  }
1015
+ a.tcx_restart_chat {
1016
  text-align: center;
1017
  margin-top: 15px;
1018
  display: block;
1019
  }
1020
+ div#tcx_chat_ended {
1021
  min-height: 60px;
1022
  max-height: 60px;
1023
  position: absolute;
1031
  }
1032
 
1033
  /* System notification message style */
1034
+ #tcx_notification_message {
1035
  position: absolute;
1036
  border-radius: 3px;
1037
  padding: 3px 6px;
1058
 
1059
  }
1060
 
1061
+ div#tcx_bell {
1062
  animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
1063
  transform: translate3d(0, 0, 0);
1064
  backface-visibility: hidden;
1132
 
1133
  #wplc_end_chat_button {
1134
  position: absolute;
1135
+ top: 0;
1136
  z-index:9999999;
1137
+ right: 12px;
1138
  padding: 5px;
1139
  font-size: 15pt;
1140
  font-weight: 100 !important;
1145
  transition: top 0.15s cubic-bezier(0.65, 0.05, 0.36, 1);
1146
  height: 25px;
1147
  width: 25px;
1148
+ cursor: pointer;
1149
  }
1150
 
1151
  #wplc_end_chat_button i:first-child{
1161
  top: 6px !important;
1162
  }
1163
 
1164
+ .tcx_restart_chat {
1165
  font-size: 12pt;
1166
  }
1167
 
1250
  font-size: 12pt;
1251
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
1252
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/themes/modern.min.css DELETED
@@ -1 +0,0 @@
1
- #wplc_chatmsg{background-color:#fff!important;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:15px;line-height:32px;color:#60686e;width:268px!important;height:40px;border:0;border-radius:5px;background:#fff;resize:none;border:none;white-space:pre-wrap;word-wrap:break-word;padding-left:30px;padding-right:100px;box-sizing:border-box;min-height:35px;overflow-y:hidden;padding:5px!important;margin-top:10px;background-color:#fff!important;padding-left:30px!important}#wplc_chatmsg:focus{outline:0!important;background-color:#fff;box-shadow:none!important}#wp-live-chat-inner-container textarea{width:100%;height:100px}#wp-live-chat input,#wp-live-chat textarea{color:#2b2b2b;padding:8px 10px 7px;margin-bottom:10px;border:0;border-radius:5px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:400;font-size:12px;background-color:#fafafa;resize:none;border:none;transition:background-color .2s ease,box-shadow .2s ease}#wp-live-chat input:focus{outline:0;background-color:#fff;box-shadow:0 0 40px 0 rgba(150,165,190,.14)}#wp-live-chat textarea:focus{outline:0;background-color:#fff;box-shadow:0 0 40px 0 rgba(150,165,190,.14)}#wp-live-chat select:focus{outline:0;background-color:#fff;box-shadow:0 0 40px 0 rgba(150,165,190,.14)}#wplc_chatbox{top:35px;bottom:113px;z-index:99998;position:absolute;overflow-y:auto;padding:5%;width:100%;overflow-y:scroll}#wp-live-chat td{padding:5px;padding-left:10px}#wp-live-chat table{border:0!important}#wp-live-chat table td{border:0!important}#wplc_user_message_div{min-height:60px;max-height:60px;position:absolute;bottom:-60px;width:100%;background-color:#fff;border-bottom-right-radius:10px;border-bottom-left-radius:10px;box-shadow:0 0 40px 1px rgba(0,0,0,.07)}#wp-live-chat h4{font-size:20px;margin:3px}#wp-live-chat p{font-size:14px;margin:3px}#wp-live-chat #wplc-sb{font-size:14px;font-weight:700}#wp-live-chat-4{position:fixed;bottom:150px;right:20px;width:368px;max-width:100%;top:10%;border-top-left-radius:15px;border-top-right-radius:15px;box-shadow:0 0 40px 0 rgba(150,165,190,.14);z-index:28000000}#wp-live-chat-3{padding:10px;text-align:center}#wp-live-chat{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;position:fixed;z-index:28000000;display:block;border-radius:5px 5px 0 0;color:#999}#wp-live-chat-1{padding:5px;padding-left:20px;padding-right:20px;color:#000;text-align:center;padding-top:18px}#wp-live-chat-minimize{position:absolute;right:3px;top:7px;cursor:pointer;height:20px;padding:2px 3px;border-radius:2px;background-color:rgba(0,0,0,.4);font-size:17px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:20px;padding-top:6px;color:#fff;font-weight:400;z-index:92354389047593475893475}#wp-live-chat-close{position:absolute;right:5px;top:4px;cursor:pointer;border-radius:2px;background-color:rgba(0,0,0,.4);font-size:12px;vertical-align:middle;height:14px;width:14px;text-align:center;vertical-align:bottom;padding-top:1px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#wp-live-chat-2-info{font-size:1em;display:block;width:100%;overflow:hidden;text-align:center;margin:0 auto;padding-bottom:10px;padding:16px;color:#fff;padding-top:10px}#wp-live-chat-2-inner{padding:20px 12px 26px;background-color:#fff;overflow:hidden}#wp-live-chat-2-img{padding-bottom:5px}.wplc_agent_involved{margin-top:5px}.wplc_agent_info{display:block;overflow:auto}.wplc_agent_name{font-weight:700;margin-top:18px;display:block;float:left;margin-left:10px;font-size:1.2em}.wplc_logo_class{max-width:250px;max-height:180px}#wplc_logo{width:100%;padding-top:13px}#wp-live-chat-header{margin-bottom:14px;border-radius:62px 62px;position:relative;width:62px;height:62px;-webkit-box-shadow:0 5px 40px rgba(0,0,0,.16)!important;-moz-box-shadow:0 5px 40px rgba(0,0,0,.16)!important;box-shadow:0 5px 40px rgba(0,0,0,.16)!important;cursor:pointer;transform:rotate(0);-o-transform:rotate(0);-ms-transform:rotate(0);-moz-transform:rotate(0);-webkit-transform:rotate(0);transition:all .3s ease;-webkit-transition:all .3s ease;-moz-transition:all .3s ease;-ms-transition:all .3s ease;-o-transition:all .3s ease}#wp-live-chat-header.active{transform:rotate(-90deg);-o-transform:rotate(-90deg);-ms-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-webkit-transform:rotate(-90deg);transition:all .3s ease;-webkit-transition:all .3s ease;-moz-transition:all .3s ease;-ms-transition:all .3s ease;-o-transition:all .3s ease}#wp-live-chat-2{z-index:2147483000;position:fixed;width:368px;max-width:100%;bottom:90px;right:20px;background:#fff;box-shadow:0 0 40px 1px rgba(0,0,0,.07);overflow:auto;display:block;border-radius:10px;border-radius:10px}#wp-live-chat-2 input{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:15px;line-height:32px;color:#60686e;width:100%;margin-bottom:10px;border:0;border-radius:5px}.wplc-clear-float-message{clear:both}#wplc_message{background:#fff;font-weight:400;color:#455a64;resize:none;border:none;margin-bottom:10px}#wplc_message_div{text-align:center;padding:16px}#wp-live-chat-inner-image-div{overflow:hidden;height:32px}.wplc-admin-message{padding:10px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;border:1px solid #666;margin-top:2px;background-color:#666;display:inline-block;float:left;clear:both;margin-bottom:3px;position:relative;left:32px;color:#fff;max-width:82%;word-wrap:break-word}.wplc-admin-message-avatar{position:absolute;left:-38px;border-radius:15px;max-width:30px;max-height:30px}.wplc-shrink .wplc_agent_involved{float:left;margin-left:30px;margin-top:3px;width:40px;height:40px}.wplc-shrink .wplc_agent_name{float:left;margin-left:10px;margin-top:-10px}.wplc-shrink .wplc_agent_infosection{display:none}.wplc_agent_infosection{display:block;clear:both;float:left;margin-left:45px;margin-top:20px;font-weight:100;text-align:left}.wplc_agent_tagline{display:block;clear:both;float:left;margin-left:45px;font-weight:100}#wplc_chatbox{transition:all .2s ease}#wplc_chatbox_header{top:0;right:0;border-top-left-radius:10px;border-top-right-radius:10px;box-shadow:0 5px 20px -2px rgba(0,0,0,.16)!important;margin-top:0;opacity:.9;transition:top .7s ease;padding-bottom:18px}#wplc_chatbox_header_bg{border-top-left-radius:10px;border-top-right-radius:10px;z-index:99999!important;position:relative}.wplc-admin-message:before{display:block;width:0;top:20px;bottom:auto;left:auto;left:-7px;border-width:6px 7px 6px 0;border-color:transparent #666;content:"";position:absolute;border-style:solid}.wplc-user-message{padding:10px;-webkit-border-radius:26x;-moz-border-radius:26x;border-radius:6px;border:1px solid #ffdb99;margin-top:2px;background-color:#ffdb99;color:#000;display:inline-block;float:right;clear:both;margin-bottom:3px;position:relative;right:30px;max-width:82%;word-wrap:break-word}.chat_time{display:block;font-size:.8em;color:#ccc;clear:both;position:relative;right:30px;text-align:right}.wplc-admin-message hr,.wplc-user-message hr{margin-bottom:0!important}.wplc-user-message-avatar{position:absolute;right:-38px;border-radius:15px;max-width:30px;max-height:30px}.wplc-user-message:before{display:block;width:0;top:20px;bottom:auto;left:auto;right:-7px;border-width:6px 0 6px 7px;border-color:transparent #ffdb99;content:"";position:absolute;border-style:solid}#wplc_hovercard{-webkit-box-shadow:0 5px 40px rgba(0,0,0,.16)!important;-moz-box-shadow:0 5px 40px rgba(0,0,0,.16)!important;box-shadow:0 5px 40px rgba(0,0,0,.16)!important;position:fixed;bottom:110px;right:20px;width:300px;height:145px;background-color:#fff;border-radius:5px;z-index:9999999;height:auto}.wplc_button_standard{border:1px solid #ed832f;background-color:#ed832f;opacity:.9}.wplc_button_standard:hover{border:1px solid #ed832f;background-color:#ed832f;opacity:.7}.wplc_button_standard:focus{border:1px solid #ed832f;background-color:#ed832f;opacity:.7}#wplc_hovercard_min{position:absolute;width:61px;height:18px;right:0;top:-25px;font-size:9px;text-align:center;border-radius:9px;color:#fff;cursor:pointer;line-height:16px}#wplc_hovercard_bottom{padding-top:10px;height:43px;border-bottom-right-radius:5px;background-color:#fafafb;border-bottom-left-radius:5px}#wplc_hovercard_content{padding:15px;height:100px;box-shadow:0 1px 1px #f0f0f1;display:flex;height:auto}#speeching_button{padding:5px;font-size:12px;text-transform:none;float:right;margin-right:15px;border-style:none;line-height:12px;font-weight:400}#wplc_first_message{display:block}#wplc_first_message strong{display:block;clear:right}.wplc_hovercard_content_left{float:left;display:block;padding-left:10px;padding-right:10px;width:80px;font-weight:400}.wplc_hovercard_content_right{float:left;display:block;font-size:.8em;word-wrap:break-word;width:188px}.wplc_left_logo{width:60px;height:60px;border-radius:30px}#wplc_message_div{margin-top:20px}#wp-live-chat-2-inner #wplc_start_chat_btn{margin-left:auto;margin-right:auto;display:block;padding-left:30px;padding-right:30px}#wp-live-chat-2-inner #wplc_na_msg_btn{margin-left:auto;margin-right:auto;display:block;padding-left:30px;padding-right:30px}#wplc_social_holder{position:absolute;width:40px;z-index:9999999999!important;bottom:0;right:2px!important;left:330px!important;font-size:15px}.wplc_social_icon{margin-left:3px}.nifty_tedit_icon{font-size:12px!important;padding-left:6px}#nifty_text_editor_holder{display:none}.nifty_attach_icon{position:absolute;top:19px;right:65px;color:#999;font-size:20px}.nifty_rating_icon{margin-right:10px;color:#999;font-size:17px}#nifty_ratings_holder{position:absolute;z-index:9999999;right:6px;top:16px}#nifty_ratings_form{position:absolute;left:-165px;top:-52px;width:220px;padding:2px;border-radius:2px}#nifty_rating_thanks{position:absolute;width:200px;margin-left:5px;position:absolute;top:-22px;right:0;text-align:right}input#nifty_ratings_comment{width:70%;margin-bottom:0;line-height:inherit;font-size:12px;top:0;position:relative;float:left}#nifty_ratings_comment{height:25px!important;margin-left:2px}#nifty_rating_button{float:right;border-style:none;width:27%;border-radius:2px;text-align:center;font-size:12px;padding:1px;top:2px;right:2px;position:relative}#nifty_recording{margin-left:5px;position:absolute;top:-21px;right:22px}.wplc_powered_by_link{font-size:10px;padding:5px}#wplc_msg_notice{margin-left:4px!important;display:none}.typing_indicator{display:none;position:absolute;padding:3px;padding-left:6px;padding-right:6px;border-radius:6px;top:65px;z-index:99;opacity:0;font-size:.8em;font-style:italic;margin-left:4px;transition:all .1s ease;-webkit-transition:all .1s ease;-moz-transition:all .1s ease;-o-transition:all .1s ease;left:6px}.typing_indicator_active{display:block;opacity:.7;transition:all .1s ease;-webkit-transition:all .1s ease;-moz-transition:all .1s ease;-o-transition:all .1s ease}#wp-live-chat-2 select{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:15px;line-height:32px;width:100%;height:49px;color:#60686e;border:1px solid #e4e5e7;border-radius:2px;margin-bottom:5px}span.wplc_system_notification{display:block;padding:8px;clear:both;font-style:italic;text-align:left}button.wplc_retry_chat{margin:10px}#wplc_na_msg_btn,#wplc_start_chat_btn{min-height:40px;border:none}#speeching_button,#wplc_na_msg_btn,#wplc_start_chat_btn{font-weight:400!important;border-radius:40px!important;padding-top:7px!important;padding-bottom:7px!important;padding-left:10px!important;padding-right:10px!important;-webkit-box-shadow:0 3px 15px rgba(0,0,0,.16)!important;-moz-box-shadow:0 3px 15px rgba(0,0,0,.16)!important;-o-box-shadow:0 3px 15px rgba(0,0,0,.16)!important;box-shadow:0 3px 15px rgba(0,0,0,.16)!important;-webkit-transition:all .3s ease;-moz-transition:all .3s ease;-o-transition:all .3s ease;transition:all .3s ease}#speeching_button:hover,#wplc_na_msg_btn:hover,#wplc_start_chat_btn:hover{-webkit-box-shadow:0 5px 10px rgba(0,0,0,.19)!important;-moz-box-shadow:0 5px 10px rgba(0,0,0,.19)!important;-o-box-shadow:0 4px 10px rgba(0,0,0,.19)!important;box-shadow:0 5px 10px rgba(0,0,0,.19)!important}.wplc_thumb16_stacked{border-radius:16px;height:32px;float:left;margin-top:35px;margin-left:-15px}.wplc_thumb16_stacked:first-child{margin-left:35px}.wplc_thumb32{border-radius:32px;float:left;height:60px;margin-left:45px;margin-top:20px}#wplc_chatbox span.timedate{clear:both;position:relative;font-size:.8em;font-style:italic}.wplc-msg-float-left{left:32px;float:left}.wplc-msg-float-right{right:32px;float:right}@media only screen and (device-width :375px) and (device-height :812px) and (-webkit-device-pixel-ratio :3){#wplc_chatmsg{font-size:16px!important}}@media screen and (max-width:510px){#wplc_chatmsg{font-size:16px!important}#wp-live-chat-4{bottom:150px;right:2%;left:2%;top:2%;width:auto}#wp-live-chat-2{bottom:150px;right:2%;left:2%;width:auto}#wplc_chatbox{top:65px!important}.wplc_agent_involved{float:left;margin-left:30px;margin-top:3px;width:40px;height:40px}.wplc_agent_name{float:left;margin-left:10px;margin-top:-10px}.wplc_agent_infosection{display:none}.wplc_agent_infosection{display:none}}.wdt-emoji-popup.open{z-index:99999}.wdt-emoji-picker{right:10px;bottom:25px!important;font-size:17px;text-align:center;line-height:50px}.wdt-credit{z-index:999999;position:absolute;right:5px;bottom:5px;font-size:9px;color:#cecece}#chat_drag_zone{background:rgba(51,51,51,.35);position:absolute;top:0;left:0;right:0;bottom:0;z-index:9999999;border-top-left-radius:11px;border-top-right-radius:11px}#chat_drag_zone_inner{position:absolute;top:10%;left:5%;right:5%;bottom:10%;border:3px dashed #fff}#chat_drag_zone_inner span{color:#fff;position:absolute;width:100%;height:50px;text-align:center;font-size:30px;margin-top:auto;margin-bottom:auto;top:50%;transform:translate(0,-50%)}.wplc_agent_involved{transition:all .4s ease}.wplc-shrink .wplc_agent_involved{transition:none!important}.wplc_agent_info .wplc_agent_name{transition:all .4s ease}.wplc-shrink .wplc_agent_name{transition:none!important}span.bleeper_pullup{position:absolute;bottom:5px;color:rgba(255,255,255,.68);right:15px;font-size:2em;cursor:pointer}a.bleeper_restart_chat{text-align:center;margin-top:15px;display:block}div#bleeper_chat_ended{min-height:60px;max-height:60px;position:absolute;bottom:-60px;width:100%;z-index:99999999999999999;background-color:#fff;border-bottom-right-radius:10px;border-bottom-left-radius:10px;box-shadow:0 0 40px 1px rgba(0,0,0,.07)}#bleeper_notification_message{position:absolute;border-radius:3px;padding:3px 6px;top:-5px;animation:wplc_notification_slide_in .2s forwards}@keyframes wplc_notification_slide_in{from{top:-5px;opacity:0}to{top:-35px;opacity:.8}}@media screen and (max-height:675px){#wp-live-chat-2{bottom:70px}}div#bleeper_bell{animation:shake .82s cubic-bezier(.36,.07,.19,.97) both;transform:translate3d(0,0,0);backface-visibility:hidden;perspective:1000px;z-index:99;position:absolute;color:#fff;right:0;width:22px;background-color:#d6abab;height:22px;text-align:center;font-size:11px;border-radius:20px;border:2px solid #fff}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(2px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}input#wplc_chat_gdpr_opt_in{display:inline-block;width:inherit;vertical-align:top;margin-left:2px;margin-right:2px}label[for=wplc_chat_gdpr_opt_in]{display:inline-block;font-size:.7em;max-width:90%;vertical-align:top}.wplc_gdpr_privacy_notice{margin-top:10px;margin-bottom:10px;font-size:.6em;margin-left:2em;margin-right:2em;color:#bdbdbd}.wplc_gdpr_privacy_notice a{color:#8e8e8e}.wplc_gdpr_privacy_notice a:hover{color:#8e8e8e;text-decoration:underline}#wplc_end_chat_button{position:absolute;top:-32px;right:0;padding:5px;font-size:9px;font-weight:200;border-radius:4px;background:#fff!important;color:#333!important;line-height:12px;box-shadow:0 0 15px 0 rgba(86,86,86,.11);border:none}.wplc_in_chat_notice{position:absolute;background:#fff;bottom:35%;padding:30px;width:80%;margin-left:8%;box-shadow:0 0 20px 0 #33333324;border-radius:5px;z-index:999999}.wplc_in_chat_notice_heading{font-size:16px;padding-bottom:10px;border-bottom:#eee 1px solid;margin-bottom:10px}.wplc_in_chat_notice_content button{padding:5px;font-size:12px;display:inline-block;font-weight:100;border:none}.wplc_in_chat_notice_content button:hover{box-shadow:none;padding:5px;cursor:pointer}.wplc_in_chat_notice_content{padding-top:15px}.wp-live-chat-wraper .wpcf_wrapper{position:relative!important;padding:20px}
 
css/themes/position-bottom-left.min.css DELETED
@@ -1 +0,0 @@
1
- #wplc_hovercard.modern{position:fixed;bottom:96px;left:20px;width:300px;height:145px;border:1px solid #ccc;background-color:#fff;border-radius:5px}#wplc_hovercard:before{left:40px}#wplc_hovercard:after{left:41px}.modern #wp-live-chat-2{left:20px!important;right:auto}.modern #wp-live-chat-4{left:0!important;right:auto}#wplc_social_holder{right:-24px}#wplc_hovercard.classic{position:fixed;bottom:96px;left:97px;width:209px;height:125px;border:1px solid #ccc;background-color:#fff;border-radius:5px}#wplc_hovercard.classic:before{left:32px}#wplc_hovercard.classic:after{left:33px}
 
css/themes/position-bottom-right.min.css DELETED
@@ -1 +0,0 @@
1
- #wplc_social_holder{left:-18px}
 
css/themes/position-left.min.css DELETED
@@ -1 +0,0 @@
1
- #wplc_hovercard.modern{bottom:135px;left:93px}.modern #wp-live-chat-2{left:93px!important;right:auto}.modern #wp-live-chat-4{left:93px!important;right:auto}#wplc_social_holder{right:-24px}#wplc_hovercard.classic:before{content:"";position:absolute;left:-9px;top:auto;border-width:9px 9px 9px 0;border-style:solid;border-color:transparent #ccc;display:block;width:0;right:auto;bottom:49px}#wplc_hovercard.classic:after{content:"";position:absolute;left:-8px;top:auto;border-width:8px 8px 8px 0;border-style:solid;border-color:transparent #fff;display:block;width:0;right:auto;bottom:50px}#wplc_hovercard.classic{bottom:80px;left:93px}.wplc_close.wplc_left #wp-live-chat-image{top:160px;left:35px}.modern div#wp-live-chat-header{position:absolute;bottom:0;left:20px}div#wp-live-chat-2{left:93px}
 
css/themes/position-right.min.css DELETED
@@ -1 +0,0 @@
1
- #wplc_hovercard.modern{bottom:120px;right:93px}#wplc_social_holder{left:-18px}#wplc_hovercard.classic:before{content:"";position:absolute;right:-9px;top:auto;border-width:9px 0 9px 9px;border-style:solid;border-color:transparent #ccc;display:block;width:0;left:auto;bottom:48px}#wplc_hovercard.classic:after{content:"";position:absolute;right:-8px;top:auto;border-width:8px 0 8px 8px;border-style:solid;border-color:transparent #fff;display:block;width:0;left:auto;bottom:49px}#wplc_hovercard.classic{bottom:80px;right:93px}.modern div#wp-live-chat-header{position:absolute;bottom:0;right:20px}div#wp-live-chat-2{right:93px}.wplc_right #wp-live-chat-4{right:93px}
 
css/themes/theme-1.css CHANGED
@@ -1,16 +1,16 @@
1
  .wplc-color-1 { color: #DB0000 !important; }
2
  .wplc-color-2 { color: #FFF !important; }
3
  .wplc-color-3 { color: #000 !important; }
4
- .wplc-color-4 { color: #666 !important; }
5
  .wplc-color-bg-1 { background-color: #DB0000 !important; }
6
  .wplc-color-bg-2 { background-color: #FFF !important; }
7
  .wplc-color-bg-3 { background-color: #000 !important; }
8
- .wplc-color-bg-4 { background-color: #666 !important; }
9
  .wplc-color-border-1 { border-color: #DB0000 !important; }
10
  .wplc-color-border-2 { border-color: #FFF !important; }
11
  .wplc-color-border-3 { border-color: #000 !important; }
12
- .wplc-color-border-4 { border-color: #666 !important; }
13
  .wplc-color-border-1:before { border-color: transparent #DB0000 !important; }
14
  .wplc-color-border-2:before { border-color: transparent #FFF !important; }
15
  .wplc-color-border-3:before { border-color: transparent #000 !important; }
16
- .wplc-color-border-4:before { border-color: transparent #666 !important; }
1
  .wplc-color-1 { color: #DB0000 !important; }
2
  .wplc-color-2 { color: #FFF !important; }
3
  .wplc-color-3 { color: #000 !important; }
4
+ .wplc-color-4 { color: #373737 !important; }
5
  .wplc-color-bg-1 { background-color: #DB0000 !important; }
6
  .wplc-color-bg-2 { background-color: #FFF !important; }
7
  .wplc-color-bg-3 { background-color: #000 !important; }
8
+ .wplc-color-bg-4 { background-color: #373737 !important; }
9
  .wplc-color-border-1 { border-color: #DB0000 !important; }
10
  .wplc-color-border-2 { border-color: #FFF !important; }
11
  .wplc-color-border-3 { border-color: #000 !important; }
12
+ .wplc-color-border-4 { border-color: #373737 !important; }
13
  .wplc-color-border-1:before { border-color: transparent #DB0000 !important; }
14
  .wplc-color-border-2:before { border-color: transparent #FFF !important; }
15
  .wplc-color-border-3:before { border-color: transparent #000 !important; }
16
+ .wplc-color-border-4:before { border-color: transparent #373737 !important; }
css/themes/theme-1.min.css DELETED
@@ -1 +0,0 @@
1
- .wplc-color-1{color:#db0000!important}.wplc-color-2{color:#fff!important}.wplc-color-3{color:#000!important}.wplc-color-4{color:#666!important}.wplc-color-bg-1{background-color:#db0000!important}.wplc-color-bg-2{background-color:#fff!important}.wplc-color-bg-3{background-color:#000!important}.wplc-color-bg-4{background-color:#666!important}.wplc-color-border-1{border-color:#db0000!important}.wplc-color-border-2{border-color:#fff!important}.wplc-color-border-3{border-color:#000!important}.wplc-color-border-4{border-color:#666!important}.wplc-color-border-1:before{border-color:transparent #db0000!important}.wplc-color-border-2:before{border-color:transparent #fff!important}.wplc-color-border-3:before{border-color:transparent #000!important}.wplc-color-border-4:before{border-color:transparent #666!important}
 
css/themes/theme-2.css CHANGED
@@ -1,7 +1,7 @@
1
  .wplc-color-1 { color: #000 !important; }
2
  .wplc-color-2 { color: #FFF !important; }
3
  .wplc-color-3 { color: #888 !important; }
4
- .wplc-color-4 { color: #666 !important; }
5
 
6
 
7
 
@@ -9,7 +9,7 @@
9
  .wplc-color-bg-1 { background-color: #000 !important; }
10
  .wplc-color-bg-2 { background-color: #FFF !important; }
11
  .wplc-color-bg-3 { background-color: #888 !important; }
12
- .wplc-color-bg-4 { background-color: #666 !important; }
13
 
14
 
15
 
@@ -17,11 +17,11 @@
17
  .wplc-color-border-1 { border-color: #000 !important; }
18
  .wplc-color-border-2 { border-color: #FFF !important; }
19
  .wplc-color-border-3 { border-color: #888 !important; }
20
- .wplc-color-border-4 { border-color: #666 !important; }
21
 
22
 
23
 
24
  .wplc-color-border-1:before { border-color: transparent #000 !important; }
25
  .wplc-color-border-2:before { border-color: transparent #FFF !important; }
26
  .wplc-color-border-3:before { border-color: transparent #888 !important; }
27
- .wplc-color-border-4:before { border-color: transparent #666 !important; }
1
  .wplc-color-1 { color: #000 !important; }
2
  .wplc-color-2 { color: #FFF !important; }
3
  .wplc-color-3 { color: #888 !important; }
4
+ .wplc-color-4 { color: #373737 !important; }
5
 
6
 
7
 
9
  .wplc-color-bg-1 { background-color: #000 !important; }
10
  .wplc-color-bg-2 { background-color: #FFF !important; }
11
  .wplc-color-bg-3 { background-color: #888 !important; }
12
+ .wplc-color-bg-4 { background-color: #373737 !important; }
13
 
14
 
15
 
17
  .wplc-color-border-1 { border-color: #000 !important; }
18
  .wplc-color-border-2 { border-color: #FFF !important; }
19
  .wplc-color-border-3 { border-color: #888 !important; }
20
+ .wplc-color-border-4 { border-color: #373737 !important; }
21
 
22
 
23
 
24
  .wplc-color-border-1:before { border-color: transparent #000 !important; }
25
  .wplc-color-border-2:before { border-color: transparent #FFF !important; }
26
  .wplc-color-border-3:before { border-color: transparent #888 !important; }
27
+ .wplc-color-border-4:before { border-color: transparent #373737 !important; }
css/themes/theme-2.min.css DELETED
@@ -1 +0,0 @@
1
- .wplc-color-1{color:#000!important}.wplc-color-2{color:#fff!important}.wplc-color-3{color:#888!important}.wplc-color-4{color:#666!important}.wplc-color-bg-1{background-color:#000!important}.wplc-color-bg-2{background-color:#fff!important}.wplc-color-bg-3{background-color:#888!important}.wplc-color-bg-4{background-color:#666!important}.wplc-color-border-1{border-color:#000!important}.wplc-color-border-2{border-color:#fff!important}.wplc-color-border-3{border-color:#888!important}.wplc-color-border-4{border-color:#666!important}.wplc-color-border-1:before{border-color:transparent #000!important}.wplc-color-border-2:before{border-color:transparent #fff!important}.wplc-color-border-3:before{border-color:transparent #888!important}.wplc-color-border-4:before{border-color:transparent #666!important}
 
css/themes/theme-3.min.css DELETED
@@ -1 +0,0 @@
1
- .wplc-color-1{color:#b97b9d!important}.wplc-color-2{color:#fff!important}.wplc-color-3{color:#eee!important}.wplc-color-4{color:#5a0031!important}.wplc-color-bg-1{background-color:#b97b9d!important}.wplc-color-bg-2{background-color:#fff!important}.wplc-color-bg-3{background-color:#eee!important}.wplc-color-bg-4{background-color:#5a0031!important}.wplc-color-border-1{border-color:#b97b9d!important}.wplc-color-border-2{border-color:#fff!important}.wplc-color-border-3{border-color:#eee!important}.wplc-color-border-4{border-color:#5a0031!important}.wplc-color-border-1:before{border-color:transparent #b97b9d!important}.wplc-color-border-2:before{border-color:transparent #fff!important}.wplc-color-border-3:before{border-color:transparent #eee!important}.wplc-color-border-4:before{border-color:transparent #5a0031!important}
 
css/themes/theme-4.css CHANGED
@@ -2,7 +2,7 @@
2
  .wplc-color-1 { color: #1A14DB !important; }
3
  .wplc-color-2 { color: #FDFDFF !important; }
4
  .wplc-color-3 { color: #7F7FB3 !important; }
5
- .wplc-color-4 { color: #666 !important; }
6
 
7
 
8
 
@@ -10,7 +10,7 @@
10
  .wplc-color-bg-1 { background-color: #1A14DB !important; }
11
  .wplc-color-bg-2 { background-color: #FDFDFF !important; }
12
  .wplc-color-bg-3 { background-color: #7F7FB3 !important; }
13
- .wplc-color-bg-4 { background-color: #666 !important; }
14
 
15
 
16
 
@@ -18,11 +18,11 @@
18
  .wplc-color-border-1 { border-color: #1A14DB !important; }
19
  .wplc-color-border-2 { border-color: #FDFDFF !important; }
20
  .wplc-color-border-3 { border-color: #7F7FB3 !important; }
21
- .wplc-color-border-4 { border-color: #666 !important; }
22
 
23
 
24
 
25
  .wplc-color-border-1:before { border-color: transparent #1A14DB !important; }
26
  .wplc-color-border-2:before { border-color: transparent #FDFDFF !important; }
27
  .wplc-color-border-3:before { border-color: transparent #7F7FB3 !important; }
28
- .wplc-color-border-4:before { border-color: transparent #666 !important; }
2
  .wplc-color-1 { color: #1A14DB !important; }
3
  .wplc-color-2 { color: #FDFDFF !important; }
4
  .wplc-color-3 { color: #7F7FB3 !important; }
5
+ .wplc-color-4 { color: #373737 !important; }
6
 
7
 
8
 
10
  .wplc-color-bg-1 { background-color: #1A14DB !important; }
11
  .wplc-color-bg-2 { background-color: #FDFDFF !important; }
12
  .wplc-color-bg-3 { background-color: #7F7FB3 !important; }
13
+ .wplc-color-bg-4 { background-color: #373737 !important; }
14
 
15
 
16
 
18
  .wplc-color-border-1 { border-color: #1A14DB !important; }
19
  .wplc-color-border-2 { border-color: #FDFDFF !important; }
20
  .wplc-color-border-3 { border-color: #7F7FB3 !important; }
21
+ .wplc-color-border-4 { border-color: #373737 !important; }
22
 
23
 
24
 
25
  .wplc-color-border-1:before { border-color: transparent #1A14DB !important; }
26
  .wplc-color-border-2:before { border-color: transparent #FDFDFF !important; }
27
  .wplc-color-border-3:before { border-color: transparent #7F7FB3 !important; }
28
+ .wplc-color-border-4:before { border-color: transparent #373737 !important; }
css/themes/theme-4.min.css DELETED
@@ -1 +0,0 @@
1
- .wplc-color-1{color:#1a14db!important}.wplc-color-2{color:#fdfdff!important}.wplc-color-3{color:#7f7fb3!important}.wplc-color-4{color:#666!important}.wplc-color-bg-1{background-color:#1a14db!important}.wplc-color-bg-2{background-color:#fdfdff!important}.wplc-color-bg-3{background-color:#7f7fb3!important}.wplc-color-bg-4{background-color:#666!important}.wplc-color-border-1{border-color:#1a14db!important}.wplc-color-border-2{border-color:#fdfdff!important}.wplc-color-border-3{border-color:#7f7fb3!important}.wplc-color-border-4{border-color:#666!important}.wplc-color-border-1:before{border-color:transparent #1a14db!important}.wplc-color-border-2:before{border-color:transparent #fdfdff!important}.wplc-color-border-3:before{border-color:transparent #7f7fb3!important}.wplc-color-border-4:before{border-color:transparent #666!important}
 
css/themes/theme-5.css CHANGED
@@ -2,7 +2,7 @@
2
  .wplc-color-1 { color: #3DCC13 !important; }
3
  .wplc-color-2 { color: #FDFDFF !important; }
4
  .wplc-color-3 { color: #EEE !important; }
5
- .wplc-color-4 { color: #666 !important; }
6
 
7
 
8
 
@@ -10,7 +10,7 @@
10
  .wplc-color-bg-1 { background-color: #3DCC13 !important; }
11
  .wplc-color-bg-2 { background-color: #FDFDFF !important; }
12
  .wplc-color-bg-3 { background-color: #EEE !important; }
13
- .wplc-color-bg-4 { background-color: #666 !important; }
14
 
15
 
16
 
@@ -18,11 +18,11 @@
18
  .wplc-color-border-1 { border-color: #3DCC13 !important; }
19
  .wplc-color-border-2 { border-color: #FDFDFF !important; }
20
  .wplc-color-border-3 { border-color: #EEE !important; }
21
- .wplc-color-border-4 { border-color: #666 !important; }
22
 
23
 
24
 
25
  .wplc-color-border-1:before { border-color: transparent #3DCC13 !important; }
26
  .wplc-color-border-2:before { border-color: transparent #FDFDFF !important; }
27
  .wplc-color-border-3:before { border-color: transparent #EEE !important; }
28
- .wplc-color-border-4:before { border-color: transparent #666 !important; }
2
  .wplc-color-1 { color: #3DCC13 !important; }
3
  .wplc-color-2 { color: #FDFDFF !important; }
4
  .wplc-color-3 { color: #EEE !important; }
5
+ .wplc-color-4 { color: #373737 !important; }
6
 
7
 
8
 
10
  .wplc-color-bg-1 { background-color: #3DCC13 !important; }
11
  .wplc-color-bg-2 { background-color: #FDFDFF !important; }
12
  .wplc-color-bg-3 { background-color: #EEE !important; }
13
+ .wplc-color-bg-4 { background-color: #373737 !important; }
14
 
15
 
16
 
18
  .wplc-color-border-1 { border-color: #3DCC13 !important; }
19
  .wplc-color-border-2 { border-color: #FDFDFF !important; }
20
  .wplc-color-border-3 { border-color: #EEE !important; }
21
+ .wplc-color-border-4 { border-color: #373737 !important; }
22
 
23
 
24
 
25
  .wplc-color-border-1:before { border-color: transparent #3DCC13 !important; }
26
  .wplc-color-border-2:before { border-color: transparent #FDFDFF !important; }
27
  .wplc-color-border-3:before { border-color: transparent #EEE !important; }
28
+ .wplc-color-border-4:before { border-color: transparent #373737 !important; }
css/themes/theme-5.min.css DELETED
@@ -1 +0,0 @@
1
- .wplc-color-1{color:#3dcc13!important}.wplc-color-2{color:#fdfdff!important}.wplc-color-3{color:#eee!important}.wplc-color-4{color:#666!important}.wplc-color-bg-1{background-color:#3dcc13!important}.wplc-color-bg-2{background-color:#fdfdff!important}.wplc-color-bg-3{background-color:#eee!important}.wplc-color-bg-4{background-color:#666!important}.wplc-color-border-1{border-color:#3dcc13!important}.wplc-color-border-2{border-color:#fdfdff!important}.wplc-color-border-3{border-color:#eee!important}.wplc-color-border-4{border-color:#666!important}.wplc-color-border-1:before{border-color:transparent #3dcc13!important}.wplc-color-border-2:before{border-color:transparent #fdfdff!important}.wplc-color-border-3:before{border-color:transparent #eee!important}.wplc-color-border-4:before{border-color:transparent #666!important}
 
css/themes/theme-default.css CHANGED
@@ -1,30 +1,30 @@
1
- .wplc-color-1 { color: #ED832F !important; }
2
  .wplc-color-2 { color: #FFF !important; }
3
- .wplc-color-3 { color: #EEE !important; }
4
- .wplc-color-4 { color: #666 !important; }
5
 
6
 
7
 
8
 
9
- .wplc-color-bg-1 { background-color: #ED832F !important; }
10
  .wplc-color-bg-2 { background-color: #FFF !important; }
11
- .wplc-color-bg-3 { background-color: #EEE !important; }
12
- .wplc-color-bg-4 { background-color: #666 !important; }
13
 
14
 
15
 
16
 
17
- .wplc-color-border-1 { border-color: #ED832F !important; }
18
  .wplc-color-border-2 { border-color: #FFF !important; }
19
- .wplc-color-border-3 { border-color: #EEE !important; }
20
- .wplc-color-border-4 { border-color: #666 !important; }
21
 
22
 
23
 
24
- .wplc-color-border-1:before { border-color: transparent #ED832F !important; }
25
  .wplc-color-border-2:before { border-color: transparent #FFF !important; }
26
- .wplc-color-border-3:before { border-color: transparent #EEE !important; }
27
- .wplc-color-border-4:before { border-color: transparent #666 !important; }
28
 
29
  span.wplc-system-notification {
30
  display: block;
1
+ .wplc-color-1 { color: #0596d4 !important; }
2
  .wplc-color-2 { color: #FFF !important; }
3
+ .wplc-color-3 { color: #06B4FF !important; }
4
+ .wplc-color-4 { color: #373737 !important; }
5
 
6
 
7
 
8
 
9
+ .wplc-color-bg-1 { background-color: #0596d4 !important; }
10
  .wplc-color-bg-2 { background-color: #FFF !important; }
11
+ .wplc-color-bg-3 { background-color: #06B4FF !important; }
12
+ .wplc-color-bg-4 { background-color: #373737 !important; }
13
 
14
 
15
 
16
 
17
+ .wplc-color-border-1 { border-color: #0596d4 !important; }
18
  .wplc-color-border-2 { border-color: #FFF !important; }
19
+ .wplc-color-border-3 { border-color: #06B4FF !important; }
20
+ .wplc-color-border-4 { border-color: #373737 !important; }
21
 
22
 
23
 
24
+ .wplc-color-border-1:before { border-color: transparent #0596d4 !important; }
25
  .wplc-color-border-2:before { border-color: transparent #FFF !important; }
26
+ .wplc-color-border-3:before { border-color: transparent #06B4FF !important; }
27
+ .wplc-color-border-4:before { border-color: transparent #373737 !important; }
28
 
29
  span.wplc-system-notification {
30
  display: block;
css/themes/theme-default.min.css DELETED
@@ -1 +0,0 @@
1
- .wplc-color-1{color:#ed832f!important}.wplc-color-2{color:#fff!important}.wplc-color-3{color:#eee!important}.wplc-color-4{color:#666!important}.wplc-color-bg-1{background-color:#ed832f!important}.wplc-color-bg-2{background-color:#fff!important}.wplc-color-bg-3{background-color:#eee!important}.wplc-color-bg-4{background-color:#666!important}.wplc-color-border-1{border-color:#ed832f!important}.wplc-color-border-2{border-color:#fff!important}.wplc-color-border-3{border-color:#eee!important}.wplc-color-border-4{border-color:#666!important}.wplc-color-border-1:before{border-color:transparent #ed832f!important}.wplc-color-border-2:before{border-color:transparent #fff!important}.wplc-color-border-3:before{border-color:transparent #eee!important}.wplc-color-border-4:before{border-color:transparent #666!important}span.wplc_system_notification{display:block;padding:8px;clear:both;font-style:italic;text-align:left;color:grey!important}button.wplc_retry_chat{margin:10px}
 
css/toastr.min.css DELETED
@@ -1 +0,0 @@
1
- .toast-title{font-weight:700}.toast-message{-ms-word-wrap:break-word;word-wrap:break-word}.toast-message a,.toast-message label{color:#fff}.toast-message a:hover{color:#ccc;text-decoration:none}.toast-close-button{position:relative;right:-.3em;top:-.3em;float:right;font-size:20px;font-weight:700;color:#fff;-webkit-text-shadow:0 1px 0 #fff;text-shadow:0 1px 0 #fff;opacity:.8}.toast-close-button:focus,.toast-close-button:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4}button.toast-close-button{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none}.toast-top-center{top:0;right:0;width:100%}.toast-bottom-center{bottom:0;right:0;width:100%}.toast-top-full-width{top:0;right:0;width:100%}.toast-bottom-full-width{bottom:0;right:0;width:100%}.toast-top-left{top:12px;left:12px}.toast-top-right{top:12px;right:12px}.toast-bottom-right{right:12px;bottom:12px}.toast-bottom-left{bottom:12px;left:12px}#toast-container{position:fixed;z-index:999999}#toast-container *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#toast-container>div{position:relative;overflow:hidden;margin:0 0 6px;padding:15px 15px 15px 50px;width:300px;-moz-border-radius:3px 3px 3px 3px;-webkit-border-radius:3px 3px 3px 3px;border-radius:3px 3px 3px 3px;background-position:15px center;background-repeat:no-repeat;-moz-box-shadow:0 0 12px #999;-webkit-box-shadow:0 0 12px #999;box-shadow:0 0 12px #999;color:#fff;opacity:.8}#toast-container>:hover{-moz-box-shadow:0 0 12px #000;-webkit-box-shadow:0 0 12px #000;box-shadow:0 0 12px #000;opacity:1;cursor:pointer}#toast-container>.toast-info{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=)!important}#toast-container>.toast-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=)!important}#toast-container>.toast-success{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==)!important}#toast-container>.toast-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=)!important}#toast-container.toast-bottom-center>div,#toast-container.toast-top-center>div{width:300px;margin:auto}#toast-container.toast-bottom-full-width>div,#toast-container.toast-top-full-width>div{width:96%;margin:auto}.toast{background-color:#030303}.toast-success{background-color:#51a351}.toast-error{background-color:#bd362f}.toast-info{background-color:#2f96b4}.toast-warning{background-color:#f89406}.toast-progress{position:absolute;left:0;bottom:0;height:4px;background-color:#000;opacity:.4}@media all and (max-width:240px){#toast-container>div{padding:8px 8px 8px 50px;width:11em}#toast-container .toast-close-button{right:-.2em;top:-.2em}}@media all and (min-width:241px) and (max-width:480px){#toast-container>div{padding:8px 8px 8px 50px;width:18em}#toast-container .toast-close-button{right:-.2em;top:-.2em}}@media all and (min-width:481px) and (max-width:768px){#toast-container>div{padding:15px 15px 15px 50px;width:25em}}
 
css/voice_note_admin.min.css DELETED
@@ -1 +0,0 @@
1
- .wplc-voice-notes{display:none;width:100%;position:fixed;right:0;bottom:-100px;left:0;z-index:10000;transition:bottom .3s;padding:20px;background:rgba(0,0,0,.8);color:#ccc}.wplc-voice-notes.is-active{display:block;bottom:0}.wplc-voice-notes__close{float:right;position:relative;right:70px;bottom:0;font-size:19px!important;cursor:pointer}.wplc-voice-notes{display:none}#nifty_wrapper .messages .wplc-admin-message .wplc-msg-content-audio,#nifty_wrapper .messages .wplc-user-message .wplc-msg-content-audio{height:30px;top:4px;padding:0 10px 0 0;background-color:#e0e0e0;border-radius:30px}#nifty_wrapper .messages .wplc-admin-message .wplc-msg-content-audio:hover,#nifty_wrapper .messages .wplc-user-message .wplc-msg-content-audio:hover{cursor:pointer}#nifty_wrapper .messages .wplc-user-message .wplc-msg-content-audio{top:12px}#nifty_wrapper .messages .wplc-admin-message .wplc-msg-content-audio:after,#nifty_wrapper .messages .wplc-user-message .wplc-msg-content-audio:before{content:none}.wplc-msg-content-audio-icon{display:inline-block;width:30px;height:30px;position:relative;margin-right:5px;background-color:#0776b8;border-radius:30px;font-family:FontAwesome}.wplc-msg-content-audio-icon:after{position:absolute;top:7px;left:11px;content:'\f04b';font-size:13px}.wplc-msg-content-audio .messageBody{float:right;vertical-align:middle}#nifty_wrapper .wplc-msg-content-audio .messageBody a{outline:0;color:#333!important;font-size:15px;line-height:30px;text-decoration:none!important}#nifty_wrapper .wplc-msg-content-audio .messageBody a:active,#nifty_wrapper .wplc-msg-content-audio .messageBody a:focus{outline:0;box-shadow:none}.nifty_voice_notes_icon_dashboard{width:25px;height:25px;position:absolute;top:10px;right:60px;background-color:#333;border-radius:20px;color:#fff;cursor:pointer}.nifty_voice_notes_icon_dashboard i{position:relative;left:8px;line-height:25px}.nifty_voice_notes_icon_dashboard_off{left:7px}.nifty_voice_notes_icon_dashboard_on{display:none}.is-audio-active .nifty_voice_notes_icon_dashboard_on{display:block}.is-audio-active .nifty_voice_notes_icon_dashboard_off{display:none}.nifty_voice_notes_icon_dashboard.is-audio-active,.nifty_voice_notes_icon_dashboard:hover{background-color:#075077}.nifty_voice_notes_icon_dashboard.is-audio-active:hover{cursor:default}.wplc-voice-note-toggle.recording{color:#333;animation-name:recording_fade;animation-direction:alternate;animation-duration:1s;animation-iteration-count:infinite}.wplc-msg-content.wplc-msg-content-audio .messageBody{width:150px!important}@keyframes recording_fade{to{color:#333}from{color:#cc0e0e}}
 
css/voice_notes_user.min.css DELETED
@@ -1 +0,0 @@
1
- #wplc_chatbox .wplc-user-message-audio{height:30px;top:4px;padding:0 10px 0 0!important;border-radius:13px!important;background-color:#e0e0e0!important;border:none!important}#wplc_chatbox .wplc-admin-message.wplc-user-message-audio{padding-right:35px!important;padding-left:10px!important}.wplc-user-message-audio:before{content:none!important}#wplc_chatbox .wplc-user-message-audio .messageBody a{outline:0;color:#333!important;font-size:15px;line-height:30px;text-decoration:none!important}#wplc_chatbox .wplc-user-message-audio .messageBody a:active,#wplc_chatbox .wplc-user-message-audio .messageBody a:focus,#wplc_chatbox .wplc-user-message-audio .messageBody a:hover{outline:0}.wplc-msg-content-audio-icon{display:inline-block;width:30px;height:30px;position:relative;margin-right:5px;background-color:#0776b8;border-radius:30px;font-family:FontAwesome;cursor:pointer}.wplc-msg-content-audio-icon:after{position:absolute;top:6px;left:11px;content:'\f04b';font-size:13px}.wplc-admin-message .wplc-msg-content-audio-icon{position:absolute;right:0;margin-right:0;margin-left:5px}.wplc-msg-content-audio .messageBody{float:right;vertical-align:middle}.wplc-voice-note-toggle{position:absolute;z-index:99;width:22px;height:22px;border-radius:30px;font-size:13px!important;line-height:23px!important;text-align:center;cursor:pointer;margin-top:20px;margin-left:5px}#wp-live-chat.classic .wplc-voice-note-toggle{margin-top:45px}.wplc-voice-note-toggle.recording{animation-name:recording_fade;animation-direction:alternate;animation-duration:1s;animation-iteration-count:infinite}.wplc-msg-content.wplc-msg-content-audio .messageBody{width:150px!important}@keyframes recording_fade{to{background:inherit}from{background:#cc0e0e}}
 
css/wplc-survey-style-before.css DELETED
@@ -1,18 +0,0 @@
1
- #wplc_hovercard { height: auto !important; }
2
- #wplc_hovercard_content { height: auto !important; padding: 5px !important;}
3
- .wplc_hovercard_content_left { display:none !important; }
4
- .wplc_hovercard_content_right { display:none !important; }
5
-
6
- #speeching_button {
7
- padding: 5px;
8
- font-size: 12px;
9
- text-transform: none;
10
- float:none !important;
11
-
12
- margin-left: auto;
13
- margin-right: auto;
14
- margin-top: -3px;
15
- display: block;
16
- padding-right: 10px;
17
- padding-left: 10px;
18
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/wplc-survey-style-before.min.css DELETED
@@ -1 +0,0 @@
1
- #wplc_hovercard{height:auto!important}#wplc_hovercard_content{height:auto!important;padding:5px!important}.wplc_hovercard_content_left{display:none!important}.wplc_hovercard_content_right{display:none!important}#speeching_button{padding:5px;font-size:12px;text-transform:none;float:none!important;margin-left:auto;margin-right:auto;margin-top:-3px;display:block;padding-right:10px;padding-left:10px}
 
css/wplc-survey-style.css DELETED
@@ -1,26 +0,0 @@
1
-
2
-
3
-
4
- #nimblesquirrel_div { width: auto !important; }
5
- html #nimblesquirrel_main { border-bottom: initial;}
6
-
7
- #nimblesquirrel_main {
8
- background: inherit !important;
9
- border: 0 !important;
10
- }
11
-
12
-
13
-
14
- #nimblesquirrel_div {
15
- width: 100% !important;
16
- }
17
-
18
- .nps_score { width: 18px !important; }
19
-
20
- .nps_score_box {
21
- width: 230px !important;
22
- display: block;
23
- margin-left: auto ;
24
- margin-right: auto;
25
- overflow: auto;
26
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/wplc-survey-style.min.css DELETED
@@ -1 +0,0 @@
1
- #nimblesquirrel_div{width:auto!important}html #nimblesquirrel_main{border-bottom:initial}#nimblesquirrel_main{background:inherit!important;border:0!important}#nimblesquirrel_div{width:100%!important}.nps_score{width:18px!important}.nps_score_box{width:230px!important;display:block;margin-left:auto;margin-right:auto;overflow:auto}
 
css/wplc_gif_integration.min.css DELETED
@@ -1 +0,0 @@
1
- .messageBody .gif-img{max-width:100%;margin-bottom:-5px}.wplc-gif-integration-search-box .gif-sb-loader{display:block;position:absolute;left:0;top:0;width:100%;height:100%;z-index:1;background-color:#fff}.wplc-gif-integration-search-box .gif-sb-loader.hidden{display:none;z-index:0}.wplc-gif-integration-search-box .gif-sb-loader img{display:block;position:relative;top:calc(50% - 25px);width:50px;height:auto;margin:auto}.wplc-gif-integration-search-box,.wplc-gif-integration-search-box.show{display:block;position:absolute;bottom:66px;width:70%;margin-left:15%;height:300px;background:#fafafa;z-index:100000000;box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24);transition:all .3s cubic-bezier(.25,.8,.25,1)}.wplc-gif-integration-search-box.show{animation-name:present-gif-search-box;animation-duration:.5s;animation-timing-function:ease-in-out;animation-fill-mode:forwards;-webkit-animation-name:present-gif-search-box;-webkit-animation-duration:.5s;-webkit-animation-timing-function:ease-in-out;-webkit-animation-fill-mode:forwards;-moz-animation-name:present-gif-search-box;-moz-animation-duration:.5s;-moz-animation-timing-function:ease-in-out;-moz-animation-fill-mode:forwards;-ms-animation-name:present-gif-search-box;-ms-animation-duration:.5s;-ms-animation-timing-function:ease-in-out;-ms-animation-fill-mode:forwards}.wplc-gif-integration-search-box{animation-name:dismiss-gif-search-box;animation-duration:.5s;animation-timing-function:ease-in-out;animation-fill-mode:forwards;-webkit-animation-name:dismiss-gif-search-box;-webkit-animation-duration:.5s;-webkit-animation-timing-function:ease-in-out;-webkit-animation-fill-mode:forwards;-moz-animation-name:dismiss-gif-search-box;-moz-animation-duration:.5s;-moz-animation-timing-function:ease-in-out;-moz-animation-fill-mode:forwards;-ms-animation-name:dismiss-gif-search-box;-ms-animation-duration:.5s;-ms-animation-timing-function:ease-in-out;-ms-animation-fill-mode:forwards}.wplc-gif-integration-search-box.hidden{display:none}@keyframes present-gif-search-box{0%{left:5000px}100%{left:0}}@-moz-keyframes present-gif-search-box{0%{left:5000px}100%{left:0}}@-webkit-keyframes present-gif-search-box{0%{left:5000px}100%{left:0}}@keyframes dismiss-gif-search-box{0%{left:0}100%{left:5000px}}@-moz-keyframes dismiss-gif-search-box{0%{left:0}100%{left:5000px}}@-webkit-keyframes dismiss-gif-search-box{0%{left:0}100%{left:5000px}}@media(max-width:767px){.wplc-gif-integration-search-box,.wplc-gif-integration-search-box.show{bottom:75px}}.wplc-gif-integration-search-box .gif-sb-body,.wplc-gif-integration-search-box .gif-sb-footer,.wplc-gif-integration-search-box .gif-sb-header{display:block;position:relative;left:0;top:0;width:100%;height:auto;padding:10px;padding-top:5px;padding-bottom:5px}.wplc-gif-integration-search-box .gif-sb-header{min-height:10%;background-color:#fff;border:1px solid #e6e6e6},.wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search,.wplc-gif-integration-search-box .gif-sb-header .gif-sb-search-term{display:inline-block;position:relative;left:0;margin:0;border-bottom:1px solid #f0f0f0!important;background-color:transparent!important;border-right:none}.wplc-gif-integration-search-box .gif-sb-header .gif-sb-close i,.wplc-gif-integration-search-box .gif-sb-header .gif-sb-close:hover i,.wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search i,.wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search:hover i{display:block;position:relative;left:0;font-style:initial;color:#ccc}.wplc-gif-integration-search-box .gif-sb-header .gif-sb-close{position:absolute;top:3px;right:4px;border:none!important}.wplc-gif-integration-search-box .gif-sb-header .gif-sb-close,.wplc-gif-integration-search-box .gif-sb-header .gif-sb-close:hover,.wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search,.wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search:hover{text-decoration:none!important}.wplc-gif-integration-search-box .gif-sb-header .gif-sb-search-term{top:-1px;width:95%;height:38px;margin-bottom:0!important;padding-left:10px!important;padding-right:10px!important;background-color:transparent!important;border-bottom:1px solid #eee!important;border-top:none;border-left:none;border-right:none}.wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search,.wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search:hover{top:0;left:1px;width:10%;height:40px;text-align:center;padding-top:10px;border-radius:3px}.wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search i,.wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search:hover i{top:0;left:-1px;font-weight:600}.wplc-gif-integration-search-box .gif-sb-header .gif-sb-close{color:#999!important;cursor:pointer}.wplc-gif-integration-search-box .gif-sb-header .gif-sb-close:hover{background-color:#fff;color:#333!important}.wplc-gif-integration-search-box .gif-sb-header .gif-sb-close i,.wplc-gif-integration-search-box .gif-sb-header .gif-sb-close:hover i{top:-3px;font-weight:500}.wplc-gif-integration-search-box .gif-sb-body{min-height:65%;max-height:195px;background-color:#f0f0f0;border:1px solid #eaeaea;overflow:auto}.wplc-gif-integration-search-box .gif-sb-body .gif-img,.wplc-gif-integration-search-box .gif-sb-body .gif-img.selected-gif,.wplc-gif-integration-search-box .gif-sb-body .gif-img:hover{display:inline-block;position:relative;left:0;top:0;min-height:70px;min-height:70px;width:auto;max-width:100px;margin-left:2px;margin-right:2px;margin-bottom:1px}.wplc-gif-integration-search-box .gif-sb-body .gif-img{opacity:.7}.wplc-gif-integration-search-box .gif-sb-body .gif-img:hover{opacity:1}.wplc-gif-integration-search-box .gif-sb-body .gif-img.selected-gif{min-height:100px;opacity:1}@media(max-width:767px){.wplc-gif-integration-search-box .gif-sb-body .gif-img{width:50%}}@media(max-width:900px){.wplc-gif-integration-search-box .gif-sb-body .gif-img{width:33%}}@media(max-width:1200px){.wplc-gif-integration-search-box .gif-sb-body .gif-img{width:20%}}.wplc-gif-integration-search-box .gif-sb-footer{min-height:10%;background-color:#fafafa;border:1px solid #eaeaea;font-size:.9em;color:#777}#chat_area .messageBody .gif-img{max-width:100%;margin-bottom:0}#chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-search-term{top:1px}#chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search,#chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search:hover{padding-top:9px}#chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close,#chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close:hover{top:2px;height:38px}#chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close i,#chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-close:hover i{top:0}#chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search i,#chat_area .wplc-gif-integration-search-box .gif-sb-header .gif-sb-confirm-search:hover i{top:1px}#chat_area .wplc-gif-integration-search-box .gif-sb-body{min-height:73%}
 
css/wplc_gutenberg_template_styles.min.css DELETED
@@ -1 +0,0 @@
1
- .wplc_block.light{background:#eceff1;color:#555;border:1px solid #ccc}.wplc_block.circle{background:0 0;width:50px;height:50px;padding:0;position:relative}.wplc_block.circle:after{display:none}.wplc_block.circle .wplc_block_logo{position:relative;width:50px;height:50px;padding:0;border-radius:50%}.wplc_block.sm.circle{background:0 0;width:35px;height:35px;padding:0}.wplc_block.sm.circle:after{display:none}.wplc_block.sm.circle .wplc_block_logo{position:relative;width:35px;height:35px;padding:0;border-radius:50%}.wplc_block.lg.circle{background:0 0;width:65px;height:65px;padding:0}.wplc_block.lg.circle:after{display:none}.wplc_block.lg.circle .wplc_block_logo{position:relative;width:65px;height:65px;padding:0;border-radius:50%}.wplc_block:hover .wplc_block_tooltip{top:-62px;background:#333;color:#fff;opacity:.85;display:inline-block}.wplc_block_tooltip{min-width:100px;border-radius:3px;color:transparent;position:absolute;line-height:25px;padding:10px;top:-50px;left:0;opacity:0;transition:opacity .2s ease-in-out,top .2s ease-in-out}.wplc_block.circle:hover .wplc_block_tooltip{top:-75px;display:block}.wplc_block.circle.sm:hover .wplc_block_tooltip{top:-50px}.wplc_block.circle.lg:hover .wplc_block_tooltip{top:-100px}.wplc_block.chat_bubble:before{content:'';position:absolute;width:0;height:0;left:0;bottom:-10px;border:8px solid;border-color:#32373c transparent transparent #32373c}.wplc_block.chat_bubble:hover:after{content:'';position:absolute;width:0;height:0}.wplc_block.chat_bubble{padding-left:10px;padding-right:40px;border-radius:7px 7px 7px 0}.wplc_block.chat_bubble .wplc_block_logo{border:none;right:0;left:initial;border-radius:0 7px 7px 0}.wplc_block.chat_bubble.sm{padding-left:10px;padding-right:25px}.wplc_block.chat_bubble.lg{padding-left:20px;padding-right:80px}.wplc_block.rotate{transform:rotate(0)}.wplc_block.rotate:hover{transition:all .3s ease-in-out;transform:rotate(-90deg)}.wplc_block.rotate .wplc_block_icon{position:relative;height:100%;width:100%;text-align:center;font-size:30px;transform:rotate(90deg);line-height:150%}.wplc_block.rotate .wplc_block_logo{z-index:10;position:absolute}.wplc_block.rotate{border-radius:50%;background:#32373c}.wplc_block.rotate .wplc_block_logo:hover{opacity:0}.wplc_block.circle.rotate.lg .wplc_block_logo{padding:0;margin:0;position:absolute}.wplc_block.circle.rotate.lg{background:#32373c}.wplc_block.rotate.lg .wplc_block_icon{position:relative;height:100%;width:100%;text-align:center;font-size:30px;transform:rotate(90deg);line-height:225%;padding-right:10px}.wplc_block.circle.rotate.sm .wplc_block_logo{padding:0;margin:0;position:absolute}.wplc_block.circle.rotate.sm{background:#32373c}.wplc_block.rotate.sm .wplc_block_icon{position:relative;height:100%;width:100%;text-align:center;font-size:20px;transform:rotate(90deg);line-height:100%;right:5px}
 
css/wplc_styles_admin_pro.css CHANGED
@@ -90,4 +90,14 @@
90
 
91
  .wplc_agent_card_details small {
92
  height: unset;
 
 
 
 
 
 
 
 
 
 
93
  }
90
 
91
  .wplc_agent_card_details small {
92
  height: unset;
93
+ }
94
+
95
+ .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active, a.ui-button:active, .ui-button:active, .ui-button.ui-state-active:hover {
96
+ border: 1px solid #0596d4;
97
+ background: #0596d4;
98
+ margin-bottom:2px!important;
99
+ }
100
+
101
+ .wplc_wrap h2 {
102
+ margin-bottom: 12px!important;
103
  }
css/wplc_styles_admin_pro.min.css DELETED
@@ -1 +0,0 @@
1
- .wplc_add_new_btn{margin-left:4px;padding:4px 8px;position:relative;top:-1px;text-decoration:none;border:none;-webkit-border-radius:2px;border-radius:2px;background:#e0e0e0;text-shadow:none;font-weight:600;font-size:13px}.wplc_add_new_btn:hover{color:#fff;background:#0073aa}.wplc_trigger_status{width:70px;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-o-border-radius:2px;text-align:center}.wplc_trigger_enabled{background-color:#158500;color:#fff}.wplc_trigger_disabled{background-color:#d3d3d3}.wplc_trigger_status a{color:inherit}#reporting_tabs{border:none!important;box-shadow:0 0 40px 1px rgba(0,0,0,.07);-webkit-box-shadow:0 0 40px 1px rgba(0,0,0,.07);-moz-box-shadow:0 0 40px 1px rgba(0,0,0,.07);-o-box-shadow:0 0 40px 1px rgba(0,0,0,.07)}.wplc_roi_report_list{display:inline-block;width:30%;border-right:1px solid #818181;min-height:745px;max-height:745px;overflow-y:auto}.wplc_roi_report_list_item{height:40px;padding:10px;line-height:40px;transition:background .5s;-webkit-transition:background .5s;-moz-transition:background .5s;-o-transition:background .5s}.wplc_roi_report_list_item:hover{height:40px;padding:10px;background:#f3f3f3;line-height:40px;cursor:pointer}.wplc_roi_report_content{display:inline-block;width:65%;vertical-align:top}.wplc_roi_report_content{padding:10px}
 
css/wplc_styles_pro.css CHANGED
@@ -2,39 +2,39 @@
2
  width: 90% !important;
3
  }
4
 
5
- .modern.file_sharing_ratings_enabled .wdt-emoji-picker {
6
- right: 75px !important;
7
- }
8
 
9
  .modern.rating_enabled .wdt-emoji-picker {
10
- right: 54px !important;
11
  }
12
 
13
- .modern.file_sharing_enabled .wdt-emoji-picker {
14
- right: 24px !important;
15
- }
16
 
17
- .classic.file_sharing_ratings_enabled .wdt-emoji-picker {
18
- right: 72px !important;
19
  }
20
 
21
- .classic.rating_enabled .wdt-emoji-picker {
22
- right: 54px !important;
23
  }
24
 
25
- .classic.file_sharing_enabled .wdt-emoji-picker {
26
- right: 24px !important;
27
  }
28
 
29
- .modern.emoji_only .wdt-emoji-popup.open {
30
- transform: translateX(-75px);
31
  }
32
 
33
- .modern.file_sharing_enabled .wdt-emoji-popup.open {
34
- transform: translateX(-60px);
35
  }
36
 
 
 
 
37
 
38
-
 
 
39
 
40
 
2
  width: 90% !important;
3
  }
4
 
5
+
 
 
6
 
7
  .modern.rating_enabled .wdt-emoji-picker {
8
+ right: 5px !important;
9
  }
10
 
 
 
 
11
 
12
+ .modern.file_sharing_enabled #nifty_file_holder {
13
+ margin-right: 12px;
14
  }
15
 
16
+ .modern.emoji_only .wdt-emoji-popup.open {
17
+ transform: translateX(-75px);
18
  }
19
 
20
+ .modern.file_sharing_enabled .wdt-emoji-popup.open {
21
+ transform: translateX(-60px);
22
  }
23
 
24
+ .classic.file_sharing_ratings_enabled .wdt-emoji-picker {
25
+ right: 30px !important;
26
  }
27
 
28
+ .classic.rating_enabled .wdt-emoji-picker {
29
+ right: 5px !important;
30
  }
31
 
32
+ .classic.file_sharing_enabled .wdt-emoji-picker {
33
+ right: 30px !important;
34
+ }
35
 
36
+ .classic.file_sharing_enabled #nifty_file_holder {
37
+ margin-right: 12px;
38
+ }
39
 
40
 
css/wplc_styles_pro.min.css DELETED
@@ -1 +0,0 @@
1
- #wplc_chatmsg{width:90%!important}.modern .wdt-emoji-picker{right:84px!important}
 
css/wplcstyle.css CHANGED
@@ -1,250 +1,254 @@
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: auto;
77
- }
78
-
79
- #wp-live-chat-4 {
80
- top: 40px !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
  }
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: #373737;
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
+ .tcx-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: auto;
77
+ }
78
+
79
+ #wp-live-chat-4 {
80
+ top: 40px !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
+ }
251
+
252
+ .wplc_uploaded_file span {
253
+ padding-left: 8px;
254
  }
css/wplcstyle.min.css DELETED
@@ -1 +0,0 @@
1
- .wplc-chat-alert{display:none;width:30px;height:30px;position:absolute;top:-10px;right:-10px;background-color:#666;border-radius:15px}.wplc-chat-alert--theme-3{background-color:#5a0031}.wplc-chat-alert.is-active{display:inline-block}.wplc-chat-alert:after{content:'\f0a2';position:absolute;left:7px;font-family:FontAwesome;color:#fff;line-height:30px}.bleeper-edit-message{display:none;cursor:pointer;margin-left:10px;font-style:italic;text-decoration:underline}@media (max-width:767px){#wp-live-chat-2{min-height:420px;top:2px}#wp-live-chat.classic{right:30px!important}#wp-live-chat.classic.wplc_right{right:0!important}#wp-live-chat.classic.wplc_left{right:auto!important}#wp-live-chat.classic.is-active{top:2px}#wp-live-chat.mobile-active #wp-live-chat-2{min-height:auto;top:auto}#wp-live-chat-inner{overflow-y:scroll}#wp-live-chat-4{top:2px!important;bottom:150px!important}.wplc_left #wp-live-chat-4{bottom:80px!important}#wp-live-chat-4.is-full-height{bottom:70px!important}#wp-live-chat.is-full-height.classic{top:-40px}.wplc_left #wp-live-chat-4{width:225px}.modern[original_pos=bottom_left] #wp-live-chat-4{width:310px}}#wplc-chat-box.disabled{display:none}.wplc_live_chat_support_shortcode .wp-live-chat-wraper{position:relative;z-index:0;display:block}.wplc_live_chat_support_shortcode #wp-live-chat-4{position:relative;height:500px;z-index:0;bottom:unset;right:unset;left:70px;top:-80px}.wplc_live_chat_support_shortcode #wplc_hovercard{position:absolute;top:0;left:70px;bottom:unset;z-index:0}.wplc_live_chat_support_shortcode #wp-live-chat{position:relative;z-index:0}.wplc_live_chat_support_shortcode{position:relative;transition:all .3s ease-in-out;z-index:10}.wplc_live_chat_support_shortcode #wp-live-chat-2{position:relative;left:70px;z-index:5}@media screen and (max-width:500px){.wplc_live_chat_support_shortcode #wp-live-chat-4{max-width:280px}.wplc_live_chat_support_shortcode #wp-live-chat-2{left:0!important}.wplc_live_chat_support_shortcode #wplc_hovercard{top:80px!important;left:-20px!important}}@media screen and (max-width:400px){.wplc_live_chat_support_shortcode #wp-live-chat-4{max-width:240px}}.wplc_live_chat_support_shortcode #wp-live-chat-4{margin-bottom:65px!important}.wplc_live_chat_support_shortcode.wplc_wide #wp-live-chat-4{width:100%;left:0;top:0}.wplc_live_chat_support_shortcode.wplc_wide #wplc_hovercard{top:0;left:0;margin:0 auto;width:70%}.wplc_live_chat_support_shortcode.wplc_wide #wp-live-chat-2{top:0;width:100%;left:0}.wplc_live_chat_support_shortcode.wplc_center #wp-live-chat-header{margin:0 auto;left:0;top:0;margin-bottom:10px}.wplc_live_chat_support_shortcode.wplc_center #wp-live-chat-4{margin:0 auto;left:0;top:0}.wplc_live_chat_support_shortcode.wplc_center #wplc_hovercard{left:0;margin:0 auto;top:75px}.wplc_live_chat_support_shortcode.wplc_center #wp-live-chat-2{left:0;margin:0 auto;top:0}#wplc_chatbox .wplc-admin-message a,#wplc_chatbox .wplc-user-message a{color:#fff!important;text-decoration:underline!important}#wp-live-chat-inner .wpcf_wrapper{position:inherit;padding:25px;max-height:400px;margin-bottom:20px}input#wplc_chat_gdpr_opt_in.incomplete+label{border-left:1px solid #bd0000!important;background:0 0!important;padding:4px}@media screen and (max-width:510px){#wp-live-chat.modern #wp-live-chat-2,#wp-live-chat.modern #wp-live-chat-4{bottom:100px}}
 
functions.php CHANGED
@@ -4,19 +4,21 @@ if ( ! defined( 'ABSPATH' ) ) {
4
  exit;
5
  }
6
 
 
 
 
 
 
 
7
  function wplc_log_user_on_page($name,$email,$session, $is_mobile = false) {
8
  global $wpdb;
9
  global $wplc_tblname_chats;
10
 
11
- $wplc_settings = get_option('WPLC_SETTINGS');
12
-
13
-
14
  $user_data = array(
15
- 'ip' => "",
16
- 'user_agent' => $_SERVER['HTTP_USER_AGENT']
17
  );
18
 
19
-
20
  /* user types
21
  * 1 = new
22
  * 2 = returning
@@ -78,11 +80,9 @@ function wplc_log_user_on_page($name,$email,$session, $is_mobile = false) {
78
  function wplc_update_user_on_page($cid, $status = 5,$session) {
79
  global $wpdb;
80
  global $wplc_tblname_chats;
81
- $wplc_settings = get_option('WPLC_SETTINGS');
82
-
83
 
84
  $user_data = array(
85
- 'ip' => "",
86
  'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
87
  );
88
 
@@ -118,7 +118,7 @@ function wplc_update_user_on_page($cid, $status = 5,$session) {
118
  function wplc_record_chat_msg($from, $cid, $msg, $rest_check = false, $aid = false, $other = false) {
119
  global $wpdb;
120
  global $wplc_tblname_msgs;
121
-
122
 
123
  if( ! filter_var($cid, FILTER_VALIDATE_INT) ) {
124
 
@@ -135,7 +135,9 @@ function wplc_record_chat_msg($from, $cid, $msg, $rest_check = false, $aid = fal
135
  */
136
 
137
  global $wplc_tblname_chats;
138
- $results = $wpdb->get_results("SELECT * FROM $wplc_tblname_chats WHERE `rel` = '".$cid."' OR `id` = '".$cid."' LIMIT 1");
 
 
139
  if (!$results) {
140
  /* it doesnt exist, lets put it in the table */
141
 
@@ -147,7 +149,7 @@ function wplc_record_chat_msg($from, $cid, $msg, $rest_check = false, $aid = fal
147
  'name' => 'agent-to-agent chat',
148
  'email' => 'none',
149
  'session' => '1',
150
- 'ip' => '0',
151
  'url' => '',
152
  'last_active_timestamp' => current_time('mysql'),
153
  'other' => '',
@@ -181,7 +183,7 @@ function wplc_record_chat_msg($from, $cid, $msg, $rest_check = false, $aid = fal
181
 
182
  if ($from == "1") {
183
  $fromname = wplc_return_chat_name(sanitize_text_field($cid));
184
- if (empty($fromname)) { $fromname = 'Guest'; }
185
  $orig = '2';
186
  }
187
  else {
@@ -220,10 +222,6 @@ function wplc_record_chat_msg($from, $cid, $msg, $rest_check = false, $aid = fal
220
  }
221
  }
222
 
223
-
224
-
225
-
226
-
227
  $wpdb->insert(
228
  $wplc_tblname_msgs,
229
  array(
@@ -254,7 +252,7 @@ function wplc_record_chat_msg($from, $cid, $msg, $rest_check = false, $aid = fal
254
  'msg' => $orig_msg,
255
  'orig' => $orig
256
  );
257
- do_action("wplc_hook_message_sent",$data);
258
 
259
  wplc_update_active_timestamp(sanitize_text_field($cid));
260
 
@@ -285,11 +283,7 @@ function wplc_return_chat_name($cid) {
285
  global $wplc_tblname_chats;
286
 
287
  $results = $wpdb->get_results(
288
- "
289
- SELECT *
290
- FROM $wplc_tblname_chats
291
- WHERE `id` = '$cid'
292
- "
293
  );
294
  foreach ($results as $result) {
295
  return $result->name;
@@ -311,7 +305,7 @@ function wplc_return_chat_id_by_rel($rel) {
311
  global $wplc_tblname_chats;
312
  $rel = sanitize_text_field($rel);
313
 
314
- $results = $wpdb->get_results("SELECT * FROM $wplc_tblname_chats WHERE `rel` = '$rel' LIMIT 1");
315
  if ($results) {
316
  foreach ($results as $result) {
317
  if (isset($result->id)) {
@@ -329,13 +323,7 @@ function wplc_return_chat_email($cid) {
329
  global $wpdb;
330
  global $wplc_tblname_chats;
331
  $cid = intval($cid);
332
- $results = $wpdb->get_results(
333
- "
334
- SELECT *
335
- FROM $wplc_tblname_chats
336
- WHERE `id` = '$cid'
337
- "
338
- );
339
  foreach ($results as $result) {
340
  return $result->email;
341
  }
@@ -415,7 +403,6 @@ add_filter("wplc_filter_list_chats_actions","wplc_filter_control_list_chats_acti
415
  * @return void
416
  * @since 6.0.00
417
  * @version 6.0.04 Updated to ensure those with the correct access can access this function
418
- * @author Nick Duncan <nick@wp-livechat.com>
419
  */
420
  function wplc_filter_control_list_chats_actions($actions,$result,$post_data) {
421
  $aid = apply_filters("wplc_filter_aid_in_action","");
@@ -476,7 +463,7 @@ function wplc_list_chats($post_data) {
476
 
477
  // Retrieve data
478
  $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)";
479
- $wplc_chat_sql .= apply_filters("wplc_alter_chat_list_sql_before_sorting", "");
480
 
481
  $wplc_chat_sql .= " ORDER BY `timestamp` ASC";
482
 
@@ -491,17 +478,9 @@ function wplc_list_chats($post_data) {
491
  unset($actions);
492
 
493
  $user_data = maybe_unserialize($result->ip);
494
- $user_ip = $user_data['ip'];
495
  $browser = @wplc_return_browser_string($user_data['user_agent']);
496
  $browser_image = wplc_return_browser_image($browser,"16");
497
 
498
- if($user_ip == ""){
499
- $user_ip = __('IP Address not recorded', 'wplivechat');
500
- } else {
501
- $user_ip = "<a href='http://www.ip-adress.com/ip_tracer/" . $user_ip . "' title='".__('Whois for' ,'wplivechat')." ".$user_ip."' target='_BLANK'>".$user_ip."</a>";
502
- }
503
-
504
-
505
  $actions = apply_filters("wplc_filter_list_chats_actions","",$result,$post_data);
506
 
507
 
@@ -537,7 +516,7 @@ function wplc_list_chats($post_data) {
537
  }
538
 
539
  $data_array[$result->id]['data']['browser'] = "<img src='" . WPLC_PLUGIN_URL . "/images/$browser_image' alt='$browser' title='$browser' /> ";
540
- $data_array[$result->id]['data']['ip'] = $user_ip;
541
  $data_array[$result->id]['other'] = $other_data;
542
  }
543
 
@@ -549,99 +528,68 @@ function wplc_list_chats($post_data) {
549
 
550
 
551
 
552
- function wplc_return_user_chat_messages($cid,$wplc_settings = false,$cdata = false) {
553
- global $wpdb;
554
- global $wplc_tblname_msgs;
555
 
556
- if (!$wplc_settings) {
557
- $wplc_settings = get_option("WPLC_SETTINGS");
558
- }
559
 
560
- if(isset($wplc_settings['wplc_display_name']) && $wplc_settings['wplc_display_name'] == 1){ $display_name = 1; } else { $display_name = 0; }
 
 
 
561
 
562
- $sql = "SELECT * FROM $wplc_tblname_msgs WHERE `chat_sess_id` = '%d' AND `status` = '0' AND (`originates` = '1' OR `originates` = '0') ORDER BY `timestamp` ASC";
563
- $sql = $wpdb->prepare($sql, $cid);
564
- $results = $wpdb->get_results($sql);
565
- if (!$cdata) {
566
- $cdata = wplc_get_chat_data($cid,__LINE__);
 
 
 
 
 
 
 
 
 
567
  }
568
 
 
 
 
 
 
569
 
570
- $msg_hist = array();
571
- foreach ($results as $result) {
572
- $system_notification = false;
573
-
574
- $id = $result->id;
575
- $from = $result->msgfrom;
576
-
577
-
578
- $msg = $result->msg;
579
-
580
- if ( isset( $result->other ) ) { $other_data = maybe_unserialize( $result->other ); } else { $other_data = array(); }
581
- if ($other_data == '') { $other_data = array(); }
582
-
583
- $timestamp = strtotime( $result->timestamp );
584
- $other_data['datetime'] = $timestamp;
585
- $other_data['datetimeUTC'] = strtotime( get_gmt_from_date( $result->timestamp ) );
586
-
587
- //
588
- if (intval($result->originates) == 0) {
589
- /*
590
- system notifications
591
- from version 7
592
- */
593
- $system_notification = true;
594
-
595
- }
596
-
597
- if (!$system_notification) {
598
- /* this is a normal message */
599
- if(function_exists('wplc_encrypt_decrypt_msg')){
600
- $msg = wplc_encrypt_decrypt_msg($msg);
601
- }
602
-
603
- $msg_array = maybe_unserialize( $msg );
604
-
605
- if( is_array( $msg_array ) ){
606
- $msg = $msg_array['m'];
607
- }
608
-
609
- $msg = stripslashes($msg);
610
-
611
- $msg = apply_filters("wplc_filter_message_control_out",$msg);
612
-
613
- $msg = sanitize_text_field(stripslashes($msg));
614
-
615
- $msg_hist[$id]['msg'] = $msg;
616
- $msg_hist[$id]['originates'] = intval($result->originates);
617
- $msg_hist[$id]['other'] = $other_data;
618
-
619
- } else {
620
- /* add the system notification to the list */
621
- if ( isset( $msg_hist[$id] ) ) { $msg_hist[$id] = array(); }
622
-
623
- $msg_hist[$id]['msg'] = $msg;
624
- $msg_hist[$id]['other'] = $other_data;
625
- $msg_hist[$id]['originates'] = intval($result->originates);
626
- }
627
-
628
 
 
 
 
629
 
 
 
 
630
 
 
 
 
 
 
 
 
 
 
631
  }
632
-
633
- return $msg_hist;
634
-
635
-
636
  }
637
 
638
-
639
-
640
-
641
-
642
  function wplc_return_no_answer_string($cid) {
643
 
644
- $wplc_settings = get_option("WPLC_SETTINGS");
645
  if (isset($wplc_settings['wplc_user_no_answer'])) {
646
  $string = stripslashes($wplc_settings['wplc_user_no_answer']);
647
  } else {
@@ -659,7 +607,7 @@ add_filter("wplc_filter_no_answer_string","wplc_filter_control_no_answer_string"
659
  * @return string
660
  */
661
  function wplc_filter_control_no_answer_string($string,$cid) {
662
- $string = $string. " <br /><button class='wplc_retry_chat wplc-color-bg-1 wplc-color-2' cid='".$cid."'>".__("Request new chat","wplivechat")."</button>";
663
  return $string;
664
  }
665
 
@@ -670,7 +618,7 @@ function wplc_change_chat_status($id,$status,$aid = 0) {
670
 
671
  if ($aid > 0) {
672
  /* only run when accepting a chat */
673
- $results = $wpdb->get_results("SELECT * FROM ".$wplc_tblname_chats." WHERE `id` = '".$id."' LIMIT 1");
674
  foreach ($results as $result) {
675
  $other = maybe_unserialize($result->other);
676
  if (isset($other['aid']) && $other['aid'] > 0) {
@@ -683,9 +631,6 @@ function wplc_change_chat_status($id,$status,$aid = 0) {
683
  }
684
  }
685
 
686
-
687
-
688
-
689
  if ($aid > 0) {
690
  $wpdb->update(
691
  $wplc_tblname_chats,
@@ -722,187 +667,168 @@ function wplc_change_chat_status($id,$status,$aid = 0) {
722
 
723
  //come back here
724
  function wplc_return_chat_messages($cid, $transcript = false, $html = true, $wplc_settings = false, $cdata = false, $display = 'string', $only_read_message = false) {
725
- global $wpdb;
726
- global $wplc_tblname_msgs;
727
-
728
-
729
- if (!$wplc_settings) {
730
- $wplc_settings = get_option("WPLC_SETTINGS");
731
- }
732
 
733
- if(isset($wplc_settings['wplc_display_name']) && $wplc_settings['wplc_display_name'] == 1){ $display_name = 1; } else { $display_name = 0; }
 
734
 
735
- $results = wplc_get_chat_messages($cid, $only_read_message, $wplc_settings);
736
- if (!$results) { return; }
 
737
 
738
- if (!$cdata) {
739
- $cdata = wplc_get_chat_data($cid,__LINE__);
 
 
 
 
 
 
 
 
 
740
  }
741
- $msg_array = array();
742
- $msg_hist = "";
743
- $previous_time = "";
744
- $previous_timestamp = 0;
745
- foreach ($results as $result) {
746
- $display_notification = false;
747
- $system_notification = false;
748
-
749
- $from = $result->msgfrom;
750
 
 
 
 
 
 
 
 
 
 
751
 
752
- /* added a control here to see if we should use the NODE ID instead of the SQL ID */
753
- if (empty($result->rel)) {
754
- $id = $result->id;
755
- } else {
756
- $id = $result->rel;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
757
  }
758
- $msg = $result->msg;
759
-
760
-
761
- if ( isset( $result->other ) ) { $other_data = maybe_unserialize( $result->other ); } else { $other_data = array(); }
762
- if ($other_data == '') { $other_data = array(); }
763
-
764
- $timestamp = strtotime( $result->timestamp );
765
- $other_data['datetime'] = $timestamp;
766
- $other_data['datetimeUTC'] = strtotime( get_gmt_from_date( $result->timestamp ) );
767
- $nice_time = date("d M Y H:i:s",$timestamp);
768
-
769
-
770
- $agent_from = false;
771
-
772
- $image = "";
773
- if($result->originates == 1){
774
-
775
- $agent_from = 'Agent';
776
-
777
- } else if ($result->originates == 2){
778
-
779
-
780
- } else if ($result->originates == 0 || $result->originates == 3) {
781
-
782
 
 
 
 
 
783
 
784
- $system_notification = true;
785
- $cuid = get_current_user_id();
786
- $is_agent = get_user_meta(intval( $cuid ), 'wplc_ma_agent', true);
787
- if ($is_agent && $result->originates == 3 ) {
788
- /* this user is an agent and the notification is meant for an agent, therefore display it */
789
- $display_notification = true;
790
 
791
- /* 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) */
792
- if (isset($_POST) && isset($_POST['action']) && sanitize_text_field( $_POST['action'] ) == "wplc_call_to_server_visitor") {
793
- $display_notification = false;
794
- }
795
- }
796
- else if (!$is_agent && $result->originates == 0) {
797
- /* this user is a not an agent and the notification is meant for a users, therefore display it */
798
- $display_notification = true;
799
- } else {
800
- /* this notification is not intended for this user */
801
- $display_notification = false;
802
- }
803
  }
 
 
804
 
805
- if (!$system_notification) {
806
-
807
- if(function_exists('wplc_encrypt_decrypt_msg')){
808
- $msg = wplc_encrypt_decrypt_msg($msg);
809
- }
810
-
811
- $msg = apply_filters("wplc_filter_message_control_out",$msg);
812
-
813
- if( is_serialized( $msg ) ){
814
- $msg_array = maybe_unserialize( $msg );
815
-
816
- if( is_array( $msg_array ) ){
817
- $msg = $msg_array['m'];
818
- } else {
819
- $msg = $msg;
820
- }
821
-
822
- $msg = sanitize_text_field(stripslashes($msg));
823
- }
824
-
825
- if($transcript){
826
- $msg = str_replace('img:', '', $msg);
827
- $msg = str_replace(':img', '', $msg);
828
- $msg = str_replace('video:', '', $msg);
829
- $msg = str_replace(':video', '', $msg);
830
- $msg = str_replace('vid:', '', $msg);
831
- $msg = str_replace(':vid', '', $msg);
832
- $msg = str_replace('link:', '', $msg);
833
- $msg = str_replace(':link', '', $msg);
834
- }
835
-
836
- if ( isset( $result->afrom ) && intval( $result->afrom ) > 0 ) {
837
- $msg_array[$id]['afrom'] = intval( $result->afrom ); $other_data['aid'] = intval( $result->afrom );
838
-
839
- }
840
- if ( isset( $result->ato ) && intval( $result->ato ) > 0 ) { $msg_array[$id]['ato'] = intval( $result->ato ); }
841
-
842
-
843
- /* use the new "other" array to get the AID and agent name */
844
- if ( $result->originates == '1' && isset( $result->other ) ){
845
- $other_data = maybe_unserialize( $result->other );
846
- if ( isset( $other_data['aid'] ) ) {
847
- $user_info = get_userdata( intval( $other_data['aid'] ) );
848
- $agent_from = $user_info->display_name;
849
- }
850
-
851
- }
852
-
853
- /* get the name of the USER if there is one */
854
- if ( $result->originates == '2' && isset( $result->msgfrom ) ) {
855
- $user_from = $result->msgfrom;
856
- } else {
857
- $user_from = 'User';
858
- }
859
-
860
-
861
- $msg_array[$id]['msg'] = $msg;
862
-
863
- if ($agent_from !== false) {
864
- $msg_hist .= $agent_from . ": " . $msg . "<br />";
865
- } else {
866
- $msg_hist .= $user_from . ": " . $msg . "<br />";
867
- }
868
-
869
 
870
- $msg_array[$id]['originates'] = $result->originates;
871
- $msg_array[$id]['other'] = $other_data;
 
 
872
 
 
 
 
873
 
874
- } else {
875
- /* this is a system notification */
876
- if ($display_notification) {
877
-
878
- if( is_serialized( $msg ) ){
879
- $tmp_array = maybe_unserialize( $msg );
880
- if( is_array( $tmp_array ) ){
881
- $msg = $tmp_array['m'];
882
- } else {
883
- $msg = $msg;
884
- }
885
- }
886
- $str = "<span class='chat_time wplc-color-4'>".$nice_time."</span> <span class='wplc-system-notification wplc-color-4'>".$msg."</span>";
887
 
888
- if($transcript){
889
- $str = "<span class='wplc-system-notification wplc-color-4'>".$msg."</span><br />";
890
- }
 
 
 
 
 
 
 
 
 
 
 
891
 
892
- if ( !isset( $msg_array[$id] ) ) { $msg_array[$id] = array(); }
893
- $msg_array[$id]['msg'] = $str;
894
- $msg_array[$id]['other'] = $other_data;
895
- $msg_array[$id]['originates'] = $result->originates;
 
 
 
 
 
 
 
 
896
 
897
- $msg_hist .= $str;
898
- }
899
  }
900
 
901
- }
 
 
902
 
903
- if ($display == 'string') { return $msg_hist; } else { return $msg_array; }
 
 
 
904
 
 
 
 
 
905
 
 
 
 
 
 
906
  }
907
 
908
 
@@ -916,11 +842,10 @@ function wplc_mark_as_read_user_chat_messages($cid) {
916
  global $wpdb;
917
  global $wplc_tblname_msgs;
918
 
919
- $results = $wpdb->get_results("SELECT *
920
  FROM $wplc_tblname_msgs
921
- WHERE `chat_sess_id` = '$cid' AND `status` = '0' AND (`originates` = 1 OR `originates` = 0)
922
- ORDER BY `timestamp` DESC");
923
-
924
 
925
  foreach ($results as $result) {
926
  $id = $result->id;
@@ -935,7 +860,6 @@ function wplc_mark_as_read_user_chat_messages($cid) {
935
  array('%d')
936
  );
937
 
938
-
939
  }
940
  return "ok";
941
 
@@ -951,11 +875,10 @@ function wplc_mark_as_read_agent_chat_messages($cid, $aid) {
951
  global $wpdb;
952
  global $wplc_tblname_msgs;
953
 
954
- $results = $wpdb->get_results("SELECT *
955
  FROM $wplc_tblname_msgs
956
- WHERE `chat_sess_id` = '$cid' AND `ato` = '".intval( $aid )."'
957
- ORDER BY `timestamp` DESC");
958
-
959
 
960
  foreach ($results as $result) {
961
  $id = $result->id;
@@ -970,118 +893,73 @@ function wplc_mark_as_read_agent_chat_messages($cid, $aid) {
970
  array('%d')
971
  );
972
 
973
-
974
  }
975
  return "ok";
976
 
977
-
978
  }
979
 
980
-
981
- //here
982
  function wplc_return_admin_chat_messages($cid) {
983
- $wplc_current_user = get_current_user_id();
984
- if( get_user_meta( $wplc_current_user, 'wplc_ma_agent', true ) ){
985
- /*
986
- -- modified in in 6.0.04 --
987
-
988
- if(current_user_can('wplc_ma_agent') || current_user_can('manage_options')){
989
- */
990
- $wplc_settings = get_option("WPLC_SETTINGS");
991
-
992
- if(isset($wplc_settings['wplc_display_name']) && $wplc_settings['wplc_display_name'] == 1){ $display_name = 1; } else { $display_name = 0; }
993
-
994
- global $wpdb;
995
- global $wplc_tblname_msgs;
996
-
997
- /**
998
- * `Originates` - codes:
999
- * 0 - System notification to be delivered to users
1000
- * 1 - Message from an agent
1001
- * 2 - Message from a user
1002
- * 3 - System notification to be delivered to agents
1003
- *
1004
- */
1005
- $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");
1006
-
1007
-
1008
- $msg_hist = array();
1009
- foreach ($results as $result) {
1010
- $system_notification = false;
1011
-
1012
- $id = $result->id;
1013
- wplc_mark_as_read_admin_chat_messages($id);
1014
- $from = $result->msgfrom;
1015
-
1016
-
1017
- $msg = $result->msg;
1018
-
1019
- if ( isset( $result->other ) ) { $other_data = maybe_unserialize( $result->other ); } else { $other_data = array(); }
1020
- if ($other_data == '') { $other_data = array(); }
1021
-
1022
- $timestamp = strtotime( $result->timestamp );
1023
- $other_data['datetime'] = $timestamp;
1024
- $other_data['datetimeUTC'] = strtotime( get_gmt_from_date( $result->timestamp ) );
1025
-
1026
- if (intval($result->originates) == 3) {
1027
- /*
1028
- system notifications
1029
- from version 7
1030
- */
1031
- $system_notification = true;
1032
-
1033
- }
1034
- else {
1035
-
1036
-
1037
- }
1038
-
1039
- if (!$system_notification) {
1040
- /* this is a normal message */
1041
- if(function_exists('wplc_encrypt_decrypt_msg')){
1042
- $msg = wplc_encrypt_decrypt_msg($msg);
1043
- }
1044
-
1045
- $msg_array = maybe_unserialize( $msg );
1046
-
1047
- if( is_array( $msg_array ) ){
1048
- $msg = $msg_array['m'];
1049
- }
1050
-
1051
- $msg = stripslashes($msg);
1052
-
1053
- $msg = apply_filters("wplc_filter_message_control_out",$msg);
1054
-
1055
- $msg = sanitize_text_field(stripslashes($msg));
1056
-
1057
- $msg_hist[$id]['msg'] = $msg;
1058
- $msg_hist[$id]['originates'] = intval($result->originates);
1059
- $msg_hist[$id]['other'] = $other_data;
1060
-
1061
- } else {
1062
- /* add the system notification to the list */
1063
- if ( isset( $msg_hist[$id] ) ) { $msg_hist[$id] = array(); }
1064
-
1065
- $msg_hist[$id]['msg'] = $msg;
1066
- $msg_hist[$id]['other'] = $other_data;
1067
- $msg_hist[$id]['originates'] = intval($result->originates);
1068
- }
1069
-
1070
-
1071
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1072
 
 
 
 
 
1073
  }
1074
 
1075
- return $msg_hist;
1076
- }
1077
 
 
 
 
 
 
 
1078
 
 
 
 
1079
 
1080
- else {
1081
- return "security issue";
 
 
 
 
 
1082
  }
1083
-
1084
-
 
 
1085
  }
1086
 
1087
  /**
@@ -1119,13 +997,7 @@ function wplc_mark_as_read_admin_chat_messages( $mid ) {
1119
  function wplc_return_chat_session_variable($cid) {
1120
  global $wpdb;
1121
  global $wplc_tblname_chats;
1122
- $results = $wpdb->get_results(
1123
- "
1124
- SELECT *
1125
- FROM $wplc_tblname_chats
1126
- WHERE `id` = '$cid'
1127
- "
1128
- );
1129
  foreach ($results as $result) {
1130
  return $result->session;
1131
  }
@@ -1140,19 +1012,12 @@ function wplc_return_chat_session_variable($cid) {
1140
  function wplc_return_chat_status($cid) {
1141
  global $wpdb;
1142
  global $wplc_tblname_chats;
1143
- $results = $wpdb->get_results(
1144
- "
1145
- SELECT *
1146
- FROM $wplc_tblname_chats
1147
- WHERE `id` = '$cid'
1148
- "
1149
- );
1150
  foreach ($results as $result) {
1151
  return intval($result->status);
1152
  }
1153
  }
1154
 
1155
-
1156
  function wplc_return_status($status) {
1157
  if ($status == 1) {
1158
  return __("complete","wplivechat");
@@ -1183,7 +1048,7 @@ function wplc_return_status($status) {
1183
 
1184
  add_filter("wplc_filter_mail_body","wplc_filter_control_mail_body",10,2);
1185
  function wplc_filter_control_mail_body($header,$msg) {
1186
- $primary_bg_color = apply_filters("wplc_mailer_bg_color", "#ec822c"); //Default orange
1187
  $body = '
1188
  <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">
1189
  <html>
@@ -1252,31 +1117,25 @@ function wplc_filter_control_mail_body($header,$msg) {
1252
 
1253
  add_filter("wplc_mailer_bg_color","wplc_fitler_mailer_bg_color",10,1);
1254
  function wplc_fitler_mailer_bg_color($default_color) {
1255
- $wplc_settings = get_option('WPLC_SETTINGS');
1256
-
1257
- if (isset($wplc_settings['wplc_theme'])) {
1258
- $wplc_theme = $wplc_settings['wplc_theme'];
1259
- }
1260
-
1261
- if (isset($wplc_theme)) {
1262
- if($wplc_theme == 'theme-1') {
1263
- $default_color = "#DB0000";
1264
- } else if ($wplc_theme == 'theme-2'){
1265
- $default_color = "#000000";
1266
- } else if ($wplc_theme == 'theme-3'){
1267
- $default_color = "#B97B9D";
1268
- } else if ($wplc_theme == 'theme-4'){
1269
- $default_color = "#1A14DB";
1270
- } else if ($wplc_theme == 'theme-5'){
1271
- $default_color = "#3DCC13";
1272
- } else if ($wplc_theme == 'theme-6'){
1273
- //Check what color is selected in palette
1274
- if (isset($wplc_settings["wplc_settings_color1"])) {
1275
- $default_color = "#" . $wplc_settings["wplc_settings_color1"];
1276
- }
1277
  }
1278
  }
1279
-
1280
  return $default_color;
1281
  }
1282
 
@@ -1290,34 +1149,28 @@ function wplc_fitler_mailer_bg_color($default_color) {
1290
  * @since 5.1.00
1291
  */
1292
  function wplcmail($reply_to,$reply_to_name,$subject,$msg) {
1293
-
1294
- $upload_dir = wp_upload_dir();
1295
-
1296
- $wplc_settings = get_option("WPLC_SETTINGS");
1297
- if(isset($wplc_settings['wplc_pro_chat_email_address'])){
1298
- $email_address = $wplc_settings['wplc_pro_chat_email_address'];
1299
- }else{
1300
- $email_address = get_option('admin_email');
1301
- }
1302
-
1303
- $email_address = explode(',', $email_address);
1304
-
1305
- $headers[] = 'Content-type: text/html';
1306
- $headers[] = 'Reply-To: '.$reply_to_name.'<'.$reply_to.'>';
1307
- if($email_address){
1308
- foreach($email_address as $email){
1309
- /* Send offline message to each email address */
1310
- $overbody = apply_filters("wplc_filter_mail_body",$subject,$msg);
1311
- if (!wp_mail($email, $subject, $overbody, $headers)) {
1312
- $error = date("Y-m-d H:i:s") . " WP-Mail Failed to send \n";
1313
- error_log($error);
1314
- }
1315
- }
1316
  }
1317
-
1318
- return;
1319
-
1320
  }
 
1321
  /**
1322
  * Sends offline messages to the admin (normally via ajax)
1323
  * @param string $name Name of the user
@@ -1327,11 +1180,11 @@ function wplcmail($reply_to,$reply_to_name,$subject,$msg) {
1327
  * @return void
1328
  */
1329
  function wplc_send_offline_msg($name,$email,$msg,$cid) {
1330
- $subject = apply_filters("wplc_offline_message_subject_filter", __("WP Live Chat Support - Offline Message from ", "wplivechat") );
1331
  $msg = __("Name", "wplivechat").": $name \n".
1332
  __("Email", "wplivechat").": $email\n".
1333
  __("Message", "wplivechat").": $msg\n\n".
1334
- __("Via WP Live Chat Support", "wplivechat");
1335
  wplcmail($email,$name, $subject, $msg);
1336
  return;
1337
  }
@@ -1349,17 +1202,12 @@ function wplc_store_offline_message($name, $email, $message){
1349
  global $wpdb;
1350
  global $wplc_tblname_offline_msgs;
1351
 
1352
- $wplc_settings = get_option('WPLC_SETTINGS');
1353
-
1354
- $offline_ip_address = "";
1355
-
1356
-
1357
  $ins_array = array(
1358
  'timestamp' => current_time('mysql'),
1359
  'name' => sanitize_text_field($name),
1360
  'email' => sanitize_email($email),
1361
  'message' => implode( "\n", array_map( 'sanitize_text_field', explode( "\n", $message ) ) ),
1362
- 'ip' => sanitize_text_field($offline_ip_address),
1363
  'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
1364
  );
1365
 
@@ -1374,11 +1222,8 @@ function wplc_user_initiate_chat($name,$email,$cid = null,$session) {
1374
  global $wpdb;
1375
  global $wplc_tblname_chats;
1376
 
1377
-
1378
- $wplc_settings = get_option('WPLC_SETTINGS');
1379
-
1380
  $user_data = array(
1381
- 'ip' => "",
1382
  'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
1383
  );
1384
  $wplc_ce_ip = null;
@@ -1613,28 +1458,44 @@ function wplc_admin_display_missed_chats() {
1613
 
1614
  global $wpdb;
1615
  global $wplc_tblname_chats;
 
 
1616
 
1617
  if (isset($_GET['wplc_action']) && $_GET['wplc_action'] == 'remove_missed_cid') {
1618
  if (isset($_GET['cid'])) {
1619
- if (isset($_GET['wplc_confirm'])) {
1620
- //Confirmed - delete
1621
- $delete_sql = "";
1622
- if (empty($_GET['cid'])) {
1623
- exit('No CID?');
1624
- }
1625
  $cid = intval($_GET['cid']);
1626
- $delete_sql = "DELETE FROM $wplc_tblname_chats WHERE `id` = '%d' LIMIT 1";
1627
- $delete_sql = $wpdb->prepare($delete_sql, $cid);
1628
- $wpdb->query($delete_sql);
1629
- if ($wpdb->last_error) {
1630
- echo "<div class='update-nag' style='margin-top: 0px;margin-bottom: 5px;'>".__("Error: Could not delete chat", "wplivechat")."<br></div>";
1631
- } else {
1632
- echo "<div class='update-nag' style='margin-top: 0px;margin-bottom: 5px;border-color:#67d552;'>".__("Chat Deleted", "wplivechat")."<br></div>";
1633
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1634
  } else {
1635
  //Prompt
1636
  echo "<div class='update-nag' style='margin-top: 0px;margin-bottom: 5px;'>".__("Are you sure you would like to delete this chat?", "wplivechat")."<br>
1637
- <a class='button' href='?page=wplivechat-menu-missed-chats&wplc_action=remove_missed_cid&cid=".$cid."&wplc_confirm=1''>".__("Yes", "wplivechat")."</a> <a class='button' href='?page=wplivechat-menu-missed-chats'>".__("No", "wplivechat")."</a>
1638
  </div>";
1639
  }
1640
  }
@@ -1658,9 +1519,7 @@ function wplc_admin_display_missed_chats() {
1658
  $total = $wpdb->get_var( "SELECT COUNT(`id`) FROM $wplc_tblname_chats WHERE `status` = 0" );
1659
  $num_of_pages = ceil( $total / $limit );
1660
 
1661
- $sql = "SELECT * FROM $wplc_tblname_chats WHERE `status` = 0 ORDER BY `timestamp` DESC LIMIT %d OFFSET %d";
1662
- $sql = $wpdb->prepare($sql, $limit, $offset);
1663
- $results = $wpdb->get_results($sql);
1664
 
1665
  if (!$results) {
1666
  echo "<tr><td></td><td>" . __("You have not missed any chat requests.", "wplivechat") . "</td></tr>";
@@ -1674,7 +1533,7 @@ function wplc_admin_display_missed_chats() {
1674
 
1675
  echo "<tr id=\"record_" . intval($result->id) . "\">";
1676
  echo "<td class='chat_id column-chat_d'>" . sanitize_text_field($result->timestamp) . "</td>";
1677
- echo "<td class='chat_name column_chat_name' id='chat_name_" . intval($result->id) . "'><img src=\"//www.gravatar.com/avatar/" . md5($result->email) . "?s=30&d=mm\" class='wplc-user-message-avatar' /> " . sanitize_text_field($result->name) . "</td>";
1678
  echo "<td class='chat_email column_chat_email' id='chat_email_" . intval($result->id) . "'><a href='mailto:" . sanitize_text_field($result->email) . "' title='Email " . ".$result->email." . "'>" . sanitize_text_field($result->email) . "</a></td>";
1679
  echo "<td class='chat_name column_chat_url' id='chat_url_" . intval($result->id) . "'>" . esc_url($result->url) . "</td>";
1680
  echo "<td class='chat_name column_chat_url'>".$actions."</td>";
@@ -1687,8 +1546,8 @@ function wplc_admin_display_missed_chats() {
1687
  $page_links = paginate_links(array(
1688
  'base' => add_query_arg( 'pagenum', '%#%' ),
1689
  'format' => '',
1690
- 'prev_text' => __( '&laquo;', 'wplivechat' ),
1691
- 'next_text' => __( '&raquo;', 'wplivechat' ),
1692
  'total' => $num_of_pages,
1693
  'current' => $pagenum
1694
  ));
@@ -1738,7 +1597,7 @@ function wplc_is_user_banned(){
1738
 
1739
  function wplc_return_animations(){
1740
 
1741
- $wplc_settings = get_option("WPLC_SETTINGS");
1742
 
1743
  if ($wplc_settings["wplc_settings_align"] == 1) {
1744
  $original_pos = "bottom_left";
@@ -1861,29 +1720,24 @@ function wplc_return_animations(){
1861
 
1862
 
1863
  add_action("wplc_advanced_settings_above_performance", "wplc_advanced_settings_above_performance_control", 10, 1);
1864
- function wplc_advanced_settings_above_performance_control($wplc_settings){
1865
- $elem_trig_action = isset($wplc_settings['wplc_elem_trigger_action']) ? $wplc_settings['wplc_elem_trigger_action'] : "0";
1866
- $elem_trig_type = isset($wplc_settings['wplc_elem_trigger_type']) ? $wplc_settings['wplc_elem_trigger_type'] : "0";
1867
- $elem_trig_id = isset($wplc_settings['wplc_elem_trigger_id']) ? $wplc_settings['wplc_elem_trigger_id'] : "";
1868
-
1869
- echo "<tr>
1870
- <td width='350'>
1871
- ".__("Open chat window via", "wplivechat").":
1872
- </td>
1873
- <td>
1874
- <select name='wplc_elem_trigger_action'>
1875
- <option value='0' ".($elem_trig_action == "0" ? "selected" : "").">".__("Click", "wplivechat")."</option>
1876
- <option value='1' ".($elem_trig_action == "1" ? "selected" : "").">".__("Hover", "wplivechat")."</option>
1877
- </select>
1878
- ".__("element with", "wplivechat").":
1879
- <select name='wplc_elem_trigger_type'>
1880
- <option value='0' ".($elem_trig_type == "0" ? "selected" : "").">".__("Class", "wplivechat")."</option>
1881
- <option value='1' ".($elem_trig_type == "1" ? "selected" : "").">".__("ID", "wplivechat")."</option>
1882
- </select>
1883
- <input type='text' name='wplc_elem_trigger_id' value='".$elem_trig_id."'>
1884
- </td>
1885
- </tr>
1886
- ";
1887
  }
1888
 
1889
  /**
@@ -1893,7 +1747,7 @@ function wplc_return_chat_rel_by_id($cid) {
1893
  global $wpdb;
1894
  global $wplc_tblname_chats;
1895
 
1896
- $results = $wpdb->get_results("SELECT * FROM $wplc_tblname_chats WHERE `id` = '$cid' LIMIT 1");
1897
  if ($results) {
1898
  foreach ($results as $result) {
1899
  if (isset($result->rel)) {
@@ -1920,12 +1774,11 @@ function wplc_all_avatars() {
1920
  }
1921
 
1922
  function wplc_get_avatar($id) {
1923
- $wplc_settings = get_option("WPLC_SETTINGS");
1924
  $user = get_user_by( 'id', $id );
1925
-
1926
- if (isset($wplc_settings['wplc_avatar_source']) && $wplc_settings['wplc_avatar_source'] == 'gravatar') {
1927
  return '//www.gravatar.com/avatar/' . md5( strtolower( trim( $user->data->user_email ) ) );
1928
- } elseif (isset($wplc_settings['wplc_avatar_source']) && $wplc_settings['wplc_avatar_source'] == 'wp_avatar') {
1929
  if (function_exists('get_wp_user_avatar')) {
1930
  return get_wp_user_avatar_src($id);
1931
  } else {
@@ -1936,99 +1789,72 @@ function wplc_get_avatar($id) {
1936
  }
1937
  }
1938
 
1939
- function wplc_get_admin_picture(){
1940
- $pro_settings = get_option("WPLC_ACBC_SETTINGS");
1941
- if($pro_settings['wplc_chat_pic']){
1942
- return urldecode($pro_settings['wplc_chat_pic']);
1943
- }
1944
  }
1945
 
1946
-
1947
  /**
1948
- * Decides whether or not to show the chat box based on the include/exlcude pages in the settings page
1949
  * @return [type] [description]
1950
  */
1951
- function wplc_display_chat_contents(){
1952
-
1953
- if (in_array($GLOBALS['pagenow'], array('wp-login.php', 'wp-register.php'))) {
1954
- return false;
1955
- }
1956
- $post_id = get_the_ID();
1957
- if (!$post_id || $post_id === NULL) {
1958
- $url = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
1959
- $post_id = url_to_postid($url);
1960
- }
1961
- $show_chat_contents = 0;
1962
- if (!$post_id) {
1963
- return true;
1964
- $show_chat_contents = 1;
1965
- /* we cant get the page ID so just allow it - the JS should handle it from now */
1966
- }
1967
-
1968
- $wplc_settings = get_option("WPLC_SETTINGS");
1969
-
1970
- if (isset($wplc_settings['wplc_include_on_pages'])) {
1971
- $include_on_pages = $wplc_settings['wplc_include_on_pages'];
1972
 
1973
- } else {
1974
- $include_on_pages = "";
1975
- }
1976
- if (isset($wplc_settings['wplc_exclude_from_pages'])) {
1977
- $exclude_from_pages = $wplc_settings['wplc_exclude_from_pages'];
1978
- } else {
1979
- $exclude_from_pages = "";
1980
- }
1981
 
1982
- if($include_on_pages == "" && $exclude_from_pages == ""){
 
1983
 
1984
- $show_chat_contents = 1;
 
 
 
 
1985
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1986
  } else {
1987
-
1988
- if($include_on_pages != ''){
1989
-
1990
- $include_on_pages = explode(',', $include_on_pages);
1991
- foreach($include_on_pages as $key => $val) {
1992
- $include_on_pages[$key] = intval($val);
1993
- }
1994
- $include_array = array();
1995
- foreach($include_on_pages as $page){
1996
- $include_array [intval($page)] = intval($page);
1997
- }
1998
-
1999
- if (isset($include_array[$post_id]) && $include_array[$post_id] > 0) {
2000
- $show_chat_contents = true;
2001
- } else {
2002
- /* Do not show here */
2003
- }
2004
-
2005
-
2006
- } else {
2007
-
2008
- /* Exclude from the following pages */
2009
- $exclude_from_pages = explode(',', $exclude_from_pages);
2010
-
2011
- $exclude_array = array();
2012
- foreach($exclude_from_pages as $page){
2013
- $exclude_array [$page] = intval($page);
2014
- }
2015
-
2016
- $exclude_from_page = array_search($post_id, $exclude_array);
2017
 
2018
- if($exclude_from_page === FALSE){
2019
- /* Show here */
2020
- $show_chat_contents = true;
2021
- } else {
2022
-
2023
- }
2024
-
2025
- }
2026
 
 
 
 
2027
 
2028
-
2029
- }
 
2030
 
2031
- return $show_chat_contents;
2032
  }
2033
 
2034
  add_action("admin_init","wplc_control_logged_in_mrg");
@@ -2108,14 +1934,6 @@ function wplc_mrg_update_db( $networkwide = false ) {
2108
  $sql = " SHOW COLUMNS FROM {$wpdb->prefix}wplc_chat_sessions WHERE `Field` = 'agent_id'";
2109
  $results = $wpdb->get_results($sql);
2110
  if (!$results) {
2111
- /**
2112
- * It was recommended that we prepare this statement, however:
2113
- * - The prepare function does not support preparing table names as it automatically wraps this in "'"
2114
- * - This causes the query to fail entirely as it must either be "`" or without quotes entirely
2115
- * - Running prepare without a replacement value will also fail as it expects at least one replacement
2116
- *
2117
- * For now, we are leaving this as is, as the '$wpdb->prefix' cannot be overriden without a custom PHP file
2118
- */
2119
  $sql = "ALTER TABLE {$wpdb->prefix}wplc_chat_sessions ADD `agent_id` INT(11) NOT NULL ;";
2120
  $wpdb->query($sql);
2121
  }
@@ -2201,7 +2019,7 @@ function wplc_mrg_create_macro_post_type() {
2201
  );
2202
  $args = array(
2203
  'labels' => $labels,
2204
- 'description' => __('Quick Responses for WP Live Chat Support', 'wplivechat'),
2205
  'public' => false,
2206
  'menu_position' => 80,
2207
  'show_in_nav_menus' => true,
@@ -2226,8 +2044,11 @@ function wplc_mrg_create_macro_post_type() {
2226
  ),
2227
  'register_meta_box_cb' => 'wplc_add_quick_response_metaboxes_mrg'
2228
  );
2229
-
2230
- register_post_type('wplc_quick_response', $args);
 
 
 
2231
  }
2232
 
2233
  add_action( 'add_meta_boxes', 'wplc_add_quick_response_metaboxes_mrg' );
@@ -2309,13 +2130,15 @@ add_action( 'admin_init', 'wplc_quick_response_add_agent_caps_mrg' );
2309
  add_action("wplc_hook_admin_below_chat_box","wplc_hook_control_admin_below_chat_box",1,1);
2310
  function wplc_hook_control_admin_below_chat_box($result) {
2311
  if ($result->status == 3) {
2312
- $wplc_settings = get_option( 'WPLC_SETTINGS' );
2313
  $wplc_quick_response_order_by = isset( $wplc_settings['wplc_quick_response_orderby'] ) ? sanitize_text_field( $wplc_settings['wplc_quick_response_orderby'] ) : 'title';
2314
  $wplc_quick_response_order = isset( $wplc_settings['wplc_quick_response_order'] ) ? sanitize_text_field( $wplc_settings['wplc_quick_response_order'] ) : 'DESC';
2315
  echo "<div class='admin_chat_quick_controls'>";
2316
- echo " <p style=\"text-align:left; font-size:11px;\">Press ENTER to send your message</p>";
 
2317
  echo wplc_return_macros_mrg( 0, $wplc_quick_response_order_by, $wplc_quick_response_order );
2318
  echo " </div>";
 
2319
  echo "</div>";
2320
  }
2321
 
@@ -2361,74 +2184,69 @@ function wplc_return_macros_mrg( $firsttd = 0, $orderby = 'post_title', $order =
2361
 
2362
  foreach ($posts_array as $post) {
2363
 
2364
- $msg .= " <option value='" . $post->ID . "'>" . $post->post_title . "</option>";
2365
  }
2366
- $msg .= " </select> <small><a href='http://wp-livechat.com/documentation/what-are-quick-responses/?utm_source=plugin&utm_medium=link&utm_campaign=what_are_quick_resposnes' title='What are quick responses?' target='_BLANK'>" . __("What is this?", "wplivechat") . "</a></small>";
2367
  $msg .= " </td>";
2368
  $msg .= "</tr></table>";
2369
  return $msg;
2370
  }
2371
 
2372
-
2373
-
2374
-
2375
-
2376
-
2377
- if (!function_exists("wplc_acbc_filter_control_microicon")) {
2378
- add_filter("wplc_filter_microicon","wplc_acbc_filter_control_microicon",10,1);
2379
- function wplc_acbc_filter_control_microicon($ret_msg) {
2380
- $wplc_acbc_data = get_option("WPLC_ACBC_SETTINGS");
2381
-
2382
- if ($wplc_acbc_data['wplc_chat_pic']) {
2383
- /* overwrite the $ret_msg variable */
2384
- $ret_msg = "<div class='wplc_left_logo' style='background:url(".urldecode($wplc_acbc_data['wplc_chat_pic']).") no-repeat; background-size: cover;'></div>";
2385
- }
2386
- return $ret_msg;
2387
-
2388
- }
2389
  }
2390
 
2391
  if (!function_exists("wplc_acbc_filter_control_chaticon")) {
2392
  add_filter("wplc_filter_chaticon","wplc_acbc_filter_control_chaticon",10,1);
2393
  function wplc_acbc_filter_control_chaticon($icon) {
2394
- $wplc_acbc_data = get_option("WPLC_ACBC_SETTINGS");
2395
-
2396
- if (isset($wplc_acbc_data['wplc_chat_icon'])) {
2397
- $icon = urldecode($wplc_acbc_data['wplc_chat_icon']);
2398
  }
2399
  return $icon;
2400
-
2401
  }
2402
  }
 
 
 
 
 
 
 
 
2403
  /**
2404
  * Notify the admin that someone wants to chat
2405
  * @param array $array CID, Name, Email
2406
  * @return bool
2407
  */
2408
  function wplc_mrg_notify_via_email($data) {
2409
-
2410
- $wplc_acbc_data = get_option("WPLC_ACBC_SETTINGS");
2411
- if (isset($wplc_acbc_data['wplc_pro_chat_email_address'])) { $email_address = $wplc_acbc_data['wplc_pro_chat_email_address']; } else { $email_address = ""; }
2412
- if (!$email_address || $email_address == "") { $email_address = get_option('admin_email'); }
2413
- if (isset($wplc_acbc_data['wplc_pro_chat_notification']) && $wplc_acbc_data['wplc_pro_chat_notification'] == "yes") {
2414
  $subject = sprintf( __( 'Incoming chat from %s (%s) on %s', 'wplivechat' ),
2415
  $data['name'],
2416
  $data['email'],
2417
  get_option('blogname')
2418
- );
2419
-
2420
- $msg = sprintf( __( '%s (%s) wants to chat with you. <br /><br />Log in: %s', 'wplivechat' ),
2421
  $data['name'],
2422
- $data['email'],
 
 
 
2423
  wp_login_url()
2424
  );
2425
-
2426
- wplcmail($email_address,"WP Live Chat Support", $subject, $msg);
2427
  }
2428
  return true;
2429
  }
2430
 
2431
-
2432
  if (!function_exists("wplc_acbc_admin_scripts")) {
2433
  add_action('admin_print_scripts', 'wplc_acbc_admin_scripts');
2434
  function wplc_acbc_admin_scripts() {
@@ -2442,71 +2260,49 @@ if (!function_exists("wplc_acbc_admin_scripts")) {
2442
  }
2443
  }
2444
 
 
 
 
2445
 
2446
- if (!function_exists("wplc_acbc_hook_control_push_js_to_front")) {
2447
- add_action("wplc_hook_push_js_to_front","wplc_acbc_hook_control_push_js_to_front");
2448
- function wplc_acbc_hook_control_push_js_to_front() {
2449
- $wplc_delay = get_option("WPLC_ACBC_SETTINGS");
2450
- $wplc_settings = get_option("WPLC_SETTINGS");
2451
- $del1 = isset( $wplc_delay['wplc_chat_delay'] ) ? $wplc_delay['wplc_chat_delay'] : 0;
2452
- if (!isset($del1) || !$del1) { $del1 = 0; }
2453
- $del2 = intval($del1 * 1000);
2454
-
2455
- if (isset($wplc_settings['wplc_typing_enabled']) && $wplc_settings['wplc_typing_enabled'] == 1) { $typing_enabled = "1"; } else { $typing_enabled = "0"; }
2456
-
2457
- if ($typing_enabled) {
2458
- $wpc_misc_js_strings = array(
2459
- 'typing_enabled' => $typing_enabled,
2460
- 'typingimg' => plugins_url('/images/comment.svg', __FILE__)
2461
- );
2462
- } else {
2463
- $wpc_misc_js_strings = array(
2464
- 'typing_enabled' => $typing_enabled
2465
- );
2466
- }
2467
- wp_localize_script('wplc-user-script', 'wplc_misc_strings', $wpc_misc_js_strings);
2468
-
2469
-
2470
- if(isset($wplc_settings['wplc_use_node_server']) && $wplc_settings['wplc_use_node_server'] == 1){
2471
-
2472
- wp_localize_script( 'wplc-user-script', 'wplc_integration_pro_active', "true");
2473
- wp_register_script('wplc-user-pro-events-script', plugins_url('/js/wplc_u_node_pro_events.js', __FILE__),array('jquery', 'wplc-server-script'),WPLC_PLUGIN_VERSION);
2474
- wp_register_script('bleeper-action-script', plugins_url('/js/bleeper_action_events.js', __FILE__),false,WPLC_PLUGIN_VERSION);
2475
- wp_enqueue_script('bleeper-action-script');
2476
- } else {
2477
- /* not using the node server, load traditional event handler JS */
2478
- wp_register_script('wplc-user-pro-events-script', plugins_url('/js/wplc_u_pro_events.js', __FILE__),array('jquery', 'wplc-server-script'),WPLC_PLUGIN_VERSION);
2479
- }
2480
-
2481
-
2482
- wp_localize_script('wplc-user-script', 'wplc_delay', "".apply_filters( 'wplc_filter_control_chat_delay', $del2 )."");
2483
-
2484
- wp_register_script('wplc-user-pro-features', plugins_url('/js/wplc_pro_features.js', __FILE__), array('wplc-user-script'),false, false);
2485
-
2486
- wp_enqueue_script( 'wplc-user-pro-features' );
2487
- wp_enqueue_script( 'wplc-user-pro-events-script' );
2488
 
 
 
 
 
 
 
 
 
2489
 
2490
- wp_register_script('wplc-user-pro-editor', plugins_url('/js/wplc_u_editor.js', __FILE__), array('wplc-user-script', 'jquery'),false, false);
2491
- wp_enqueue_script('wplc-user-pro-editor');
 
2492
 
2493
- if(!empty($wplc_settings["wplc_pro_auto_first_response_chat_msg"])){
2494
- wp_localize_script('wplc-user-pro-features', 'wplc_pro_auto_resp_chat_msg', "" . apply_filters('wplc_pro_auto_first_response_chat_msg_filter', $wplc_settings["wplc_pro_auto_first_response_chat_msg"])."");
2495
- }
2496
 
2497
- wp_enqueue_style('wplc-user-pro-styles', plugins_url('/css/wplc_styles_pro.css', __FILE__));
2498
-
 
2499
 
2500
- $post_id = get_the_ID();
2501
- if (!$post_id || $post_id === NULL) {
2502
- $url = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
2503
- $post_id = url_to_postid($url);
2504
- }
2505
- if(wplc_check_trigger_filters_mrg($post_id)){
2506
- wplc_tirggers_enqueue_user_styles_scripts(wplc_check_trigger_filters_mrg($post_id));
2507
- }
2508
 
2509
- }
 
 
 
 
 
 
 
2510
  }
2511
 
2512
  /**
@@ -2523,170 +2319,112 @@ if (!function_exists("wplc_acbc_filter_control_menu_api")) {
2523
  }
2524
 
2525
 
2526
- if (!function_exists("wplc_acbc_filter_control_live_chat_box_above_main_div")) {
2527
- add_filter("wplc_filter_live_chat_box_above_main_div","wplc_acbc_filter_control_live_chat_box_above_main_div");
2528
- function wplc_acbc_filter_control_live_chat_box_above_main_div($ret_msg) {
2529
- $wplc_acbc_data = get_option("WPLC_ACBC_SETTINGS");
2530
-
2531
- if (!empty($wplc_acbc_data['wplc_chat_logo'])) {
2532
- $ret_msg .= "<div id=\"wplc_logo\">";
2533
- $ret_msg .= " <img class=\"wplc_logo_class\" src=\"".urldecode(sanitize_text_field(stripslashes($wplc_acbc_data['wplc_chat_logo'])))."\" style=\"display:block; margin-bottom:5px; margin-left:auto; margin-right:auto;\" alt=\"".get_bloginfo('name')."\" title=\"".get_bloginfo('name')."\" />";
2534
- $ret_msg .= "</div>";
2535
- }
2536
- return $ret_msg;
2537
- }
2538
- }
2539
-
2540
- if (!function_exists("wplc_acbc_filter_control_chat_header_under")) {
2541
- add_filter("wplc_filter_chat_header_under","wplc_acbc_filter_control_chat_header_under");
2542
- function wplc_acbc_filter_control_chat_header_under($ret_msg) {
2543
- $wplc_acbc_data = get_option("WPLC_ACBC_SETTINGS");
2544
-
2545
- if ($wplc_acbc_data['wplc_chat_pic']) {
2546
- $ret_msg .= "<div id=\"wp-live-chat-image\">";
2547
- $ret_msg .= "<div id=\"wp-live-chat-inner-image-div\">";
2548
- $ret_msg .= "<img src=\"".urldecode(esc_url($wplc_acbc_data['wplc_chat_pic']))."\" width=\"40px\"/>";
2549
- $ret_msg .= "</div>";
2550
- $ret_msg .= "</div>";
2551
-
2552
- }
2553
- return $ret_msg;
2554
- }
2555
  }
2556
 
2557
-
2558
-
2559
  /**
2560
  * Check if this is the first time the user has run the plugin. If yes, set the default settings
2561
  * @since 1.0.2
2562
  * @return string
2563
- * @author Nick Duncan <nick@wp-livechat.com>
2564
  */
2565
- if (!function_exists("wplc_acbc_filter_admin_name")) {
2566
- add_filter("wplc_filter_admin_name","wplc_acbc_filter_admin_name");
2567
- function wplc_acbc_filter_admin_name($fromname) {
2568
- $wplc_acbc_data = get_option("WPLC_ACBC_SETTINGS");
2569
-
2570
- if (!empty($wplc_acbc_data['wplc_chat_name'])) {
2571
- $fromname = $wplc_acbc_data['wplc_chat_name'];
2572
- }
2573
-
2574
-
2575
- return $fromname;
2576
- }
2577
  }
2578
 
2579
-
2580
-
2581
  add_filter( "wplc_admin_dashboard_layout_node_request_variable_filter", "wplc_admin_mrg_filter_control_dashboard_layout_node_request_variable_filter", 10, 1);
2582
  function wplc_admin_mrg_filter_control_dashboard_layout_node_request_variable_filter( $form_data ) {
2583
- $choose_array = get_option("WPLC_CHOOSE_ACCEPTING");
2584
- $form_data['choose'] = $choose_array;
2585
  return $form_data;
2586
  }
2587
 
2588
-
2589
-
2590
  /**
2591
  * Display the switchery button at the top of the chat dashboard
2592
  * @return void
2593
  * @since 1.0.00
2594
- * @author Nick Duncan <nick@wp-livechat.com>
2595
  */
2596
- if (!function_exists("wplc_choose_hook_control_chat_dashboard_above")) {
2597
- add_action("wplc_hook_chat_dashboard_above","wplc_choose_hook_control_chat_dashboard_above");
2598
- function wplc_choose_hook_control_chat_dashboard_above() {
2599
- $wplc_current_user_id = get_current_user_id();
2600
- $wplc_choose_data = get_option("WPLC_CHOOSE_SETTINGS");
2601
-
2602
- $choose_array = get_option("WPLC_CHOOSE_ACCEPTING");
2603
- $user_id = get_current_user_id();
2604
- $user_id = get_current_user_id();//
2605
- ?>
2606
- <div style="padding: 10px 0; display: block; margin: 0 auto; text-align: center;">
2607
- <input type="checkbox" class="wplc_switchery" name="wplc_agent_status" id="wplc_agent_status" <?php if (isset($choose_array[$user_id]) && $choose_array[$user_id]) { echo 'checked'; } ?> />
2608
- <div id="wplc_agent_status_text" style="display: inline-block; padding-left: 10px;"></div>
2609
- </div>
2610
- <?php /* } */
2611
- }
2612
  }
2613
 
2614
-
2615
-
2616
  /**
2617
  * Latch onto the set transient filter and decide to show the agent online or not.
2618
  * @param bool $set_transient Should we set the transient or not?
2619
  * @return bool
2620
  * @since 1.0.00
2621
- * @author Nick Duncan <nick@wp-livechat.com>
2622
  */
2623
- if (!function_exists("wplc_choose_filter_control_set_set_transient")) {
2624
- add_filter("wplc_filter_control_set_transient","wplc_choose_filter_control_set_set_transient",10,1);
2625
- function wplc_choose_filter_control_set_set_transient($set_transient) {
2626
-
2627
- $choose_array = get_option("WPLC_CHOOSE_ACCEPTING");
2628
- $user_id = get_current_user_id();
2629
-
2630
- if (isset($choose_array[$user_id]) && $choose_array[$user_id]) {
2631
- return true;
2632
- } else {
2633
- return false;
2634
- }
2635
- }
2636
  }
2637
 
2638
-
2639
-
2640
  /**
2641
  * Latch onto the loggedin filter and set to true if any agent has selected that they can take chats.
2642
  * @param bool $logged_in Is the agent logged in and available?
2643
  * @return bool
2644
  * @since 1.0.01
2645
- * @author Nick Duncan <nick@wp-livechat.com>
2646
  */
2647
- if (!function_exists("wplc_choose_final_loggedin_control")) {
2648
- add_filter("wplc_final_loggedin_control","wplc_choose_final_loggedin_control",10,2);
2649
- function wplc_choose_final_loggedin_control($logged_in,$logged_in_via_app) {
2650
- $choose_array = get_option("WPLC_CHOOSE_ACCEPTING");
2651
- /* get a list of online users */
2652
-
2653
- /* get actuall logged in users and create an array to check with below */
2654
- add_action('pre_get_users', 'wplc_advanced_access_manager_compatibility_mrg', 1000);
2655
- $users = get_users(array(
2656
- 'meta_key'=> 'wplc_chat_agent_online',
2657
- ));
2658
-
2659
- foreach ($users as $wplc_user) {
2660
- $check = get_user_meta($wplc_user->ID,"wplc_chat_agent_online");
2661
- $last_logged_in_time = $check[0];
2662
- if ($last_logged_in_time > 0) {
2663
- if ((time() - $last_logged_in_time) < 70) {
2664
- $tmp_logged_in[$wplc_user->ID] = 1;
2665
- }
2666
- }
2667
- }
2668
- $counter = 0;
2669
- $change_choose = false;
2670
- foreach ($choose_array as $key => $val) {
2671
- /* if there is an agent logged in, return true, if none, return false */
2672
- if ($val == true) {
2673
- /* make sure that they are still logged in - they could have just quit. Update option accordingly and continue with checks */
2674
- if (!isset($tmp_logged_in[$key])) {
2675
- /* user has said they want to accept chats but they are offline */
2676
- $choose_array[$key] = false;
2677
- $change_choose = true;
2678
- } else {
2679
- $counter++;
2680
- }
2681
- }
2682
- }
2683
- if ($change_choose) update_option("WPLC_CHOOSE_ACCEPTING",$choose_array);
2684
- if ($logged_in_via_app) { return true; }
2685
- if ($counter == 0) { return false; }
2686
- if ($logged_in) { return true; }
2687
- else { return false; }
2688
-
2689
- }
2690
  }
2691
 
2692
  /**
@@ -2697,29 +2435,25 @@ if (!function_exists("wplc_choose_hook_control_action_callback")) {
2697
  function wplc_choose_hook_control_action_callback() {
2698
 
2699
  if ($_POST['action'] == 'wplc_choose_accepting') {
2700
- $choose_array = get_option("WPLC_CHOOSE_ACCEPTING");
2701
- $user_id = get_current_user_id();
2702
- $choose_array[$user_id] = true;
2703
- update_option("WPLC_CHOOSE_ACCEPTING",$choose_array);
2704
- /* mark agent as online */
2705
  $user_id = get_current_user_id();
 
2706
  do_action("wplc_hook_set_transient");
2707
  echo "done";
2708
  }
2709
 
2710
  if ($_POST['action'] == 'wplc_choose_not_accepting') {
2711
- $choose_array = get_option("WPLC_CHOOSE_ACCEPTING");
2712
  $user_id = get_current_user_id();
2713
- $choose_array[$user_id] = false;
2714
- update_option("WPLC_CHOOSE_ACCEPTING",$choose_array);
2715
- $deleted = delete_user_meta($user_id, "wplc_chat_agent_online");
2716
  delete_transient('wplc_is_admin_logged_in');
2717
  echo "done";
2718
  }
2719
 
2720
  if ($_POST['action'] == "wplc_typing") {
2721
  if (isset($_POST['cid']) && isset($_POST['user']) && isset($_POST['type'])) {
2722
- echo wplc_typing_mrg(sanitize_text_field($_POST['user']), intval($_POST['cid']), sanitize_text_field($_POST['type']));
 
 
2723
  }
2724
  }
2725
 
@@ -2727,56 +2461,60 @@ if (!function_exists("wplc_choose_hook_control_action_callback")) {
2727
  $upload_dir = wp_upload_dir();
2728
  $user_dirname = $upload_dir['basedir'];
2729
  $cid=0;
 
2730
  if (isset($_POST['cid'])) {
2731
- $cid = sanitize_text_field($_POST['cid']);
2732
- if( ! filter_var($cid, FILTER_VALIDATE_INT) ) {
2733
- /* We need to identify if this CID is a node CID, and if so, return the WP CID */
2734
- $cid = wplc_return_chat_id_by_rel($cid);
2735
- }
2736
-
2737
- $cid = intval($cid);
2738
- }
2739
-
2740
- if( !file_exists( $user_dirname."/wp_live_chat/" ) ){
2741
- @mkdir($user_dirname.'/wp_live_chat/');
2742
- }
2743
-
2744
- if( !realpath( $user_dirname."/wp_live_chat/" . $cid ) ){
2745
- @mkdir( $user_dirname.'/wp_live_chat/'. $cid );
2746
- }
2747
 
2748
- if (isset($_FILES['file']) && isset($_POST['timestamp'])) {
2749
- $file_name = strtolower( sanitize_file_name($_FILES['file']['name']) );
2750
- $file_name = basename($file_name); //This prevents traversal
2751
-
2752
- if(!wplc_check_file_name_for_unsafe_extension($file_name)) {
2753
- if(wplc_check_file_name_for_safe_extension($file_name)) {
2754
- if( realpath($user_dirname . "/wp_live_chat/" . $cid . "/" . sanitize_file_name($_FILES['file']['name']) ) == false ) {
2755
- $file_name = rand(0, 10) . "-" . $file_name;
2756
- }
2757
-
2758
- if(move_uploaded_file($_FILES['file']['tmp_name'], $user_dirname."/wp_live_chat/" . $cid . "/" . $file_name)) {
2759
- //File has been uploaded, let's now go ahead and check the mime type
2760
- if(wplc_check_file_mime_type( $user_dirname. "/wp_live_chat/" . $cid . "/" . $file_name) ) {
2761
- $response = $upload_dir['baseurl']."/wp_live_chat/" . $cid . "/" . $file_name;
2762
- echo $response;
2763
- } else {
2764
- //Failed, lets delete this file to be safe
2765
- @unlink(realpath($user_dirname. "/wp_live_chat/" . $cid . "/" . $file_name));
2766
- echo "Security Violation";
2767
- }
2768
- } else {
2769
- echo "Security Violation";
2770
 
2771
- }
2772
- } else {
2773
- echo "Security Violation";
 
 
 
2774
 
2775
- }
2776
- } else {
2777
- echo "Security Violation";
2778
- }
2779
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2780
  wp_die();
2781
  }
2782
  }
@@ -2813,79 +2551,61 @@ function wplc_typing_mrg($user,$cid,$type) {
2813
  }
2814
  }
2815
 
2816
-
2817
  /**
2818
  * Add switchery JS & CSS button to the chat dashboard
2819
  * @since 1.0.00
2820
- * @author Nick Duncan <nick@wp-livechat.com>
2821
  * @return void
2822
  */
2823
- if (!function_exists("wplc_choose_admin_scripts")) {
2824
- add_action('admin_print_scripts', 'wplc_choose_admin_scripts');
2825
- function wplc_choose_admin_scripts() {
2826
- wp_register_script('wplc_switchery', plugins_url('js/switchery.min.js', __FILE__), array('jquery'),WPLC_PLUGIN_VERSION);
2827
- wp_enqueue_script('wplc_switchery');
2828
- wp_register_style('wplc_switchery_css', plugins_url('css/switchery.min.css', __FILE__),false,WPLC_PLUGIN_VERSION);
2829
- wp_enqueue_style('wplc_switchery_css');
2830
- wp_register_script('wplc-choose-script', plugins_url('/js/wplc_choose.js', __FILE__),array('jquery'),WPLC_PLUGIN_VERSION);
2831
- wp_enqueue_script('wplc-choose-script');
2832
-
2833
- $wpc_admin_js_strings = array(
2834
- 'accepting_status' => __('Status (Online)', 'wplivechat'),
2835
- 'accepting_chats' => __('Online', 'wplivechat'),
2836
- 'not_accepting_chats' => __('Offline', 'wplivechat'),
2837
- 'not_accepting_status' => __('Status (Offline)', 'wplivechat')
2838
- );
2839
- wp_localize_script('wplc-choose-script', 'wplc_choose_admin_strings', $wpc_admin_js_strings);
2840
-
2841
- $wplc_current_user_id = get_current_user_id();
2842
- $choose_array = get_option("WPLC_CHOOSE_ACCEPTING");
2843
- if (isset($choose_array[$wplc_current_user_id]) && $choose_array[$wplc_current_user_id]) {
2844
- /* user is online */
2845
- wp_localize_script('wplc-choose-script', 'wplc_choose_accept_chats', '1');
2846
- //wp_localize_script('wplc-choose-script', 'wplc_localized_offline_string', ' ');
2847
- //wp_localize_script('wplc-choose-script', 'wplc_localized_quote_string', ' ');
2848
-
2849
- } else {
2850
- wp_localize_script('wplc-choose-script', 'wplc_choose_accept_chats', '0');
2851
- $offline_string = "<p><span class='offline-status'>".__("You have set your status to offline. To view visitors and accept chats please set your status to online using the switch above.","wplivechat")."</span></p>";
2852
- $quote_string = "<p><span class='offline-quote'>".wplc_random_quote_mrg()."</span></p>";
2853
- wp_localize_script('wplc-choose-script', 'wplc_localized_offline_string', $offline_string);
2854
- wp_localize_script('wplc-choose-script', 'wplc_localized_quote_string', $quote_string);
2855
-
2856
- }
2857
-
2858
-
2859
- wp_register_script('wplc-qr-script', plugins_url('/js/quick_responses.js', __FILE__),array('jquery'),WPLC_PLUGIN_VERSION);
2860
- wp_enqueue_script('wplc-qr-script');
2861
- wp_register_script('wplc-triggers', plugins_url('/js/triggers.js', __FILE__),array('jquery'),WPLC_PLUGIN_VERSION);
2862
- wp_enqueue_script('wplc-triggers');
2863
-
2864
- $wplc_settings = get_option("WPLC_SETTINGS");
2865
-
2866
- wp_register_script('wplc-admin-editor', plugins_url('/js/wplc_admin_editor.js', __FILE__),array('jquery'),WPLC_PLUGIN_VERSION);
2867
- wp_enqueue_script('wplc-admin-editor');
2868
 
 
2869
 
 
 
 
 
 
 
 
 
 
 
2870
 
2871
- }
 
 
 
 
 
2872
  }
2873
 
2874
-
2875
  /**
2876
  * Remove default transient renewer if option is enabled
2877
  * @since 1.0.00
2878
- * @author Nick Duncan <nick@wp-livechat.com>
2879
  * @return void
2880
  */
2881
  if (!function_exists("wplc_choose_hook_control_head")) {
2882
  add_action("wplc_maa_hook_head","wplc_choose_hook_control_head",1);
2883
  function wplc_choose_hook_control_head() {
2884
- $wplc_choose_data = get_option("WPLC_CHOOSE_SETTINGS");
2885
- if(isset($wplc_choose_data['wplc_auto_online'])) { } else {
2886
- remove_action("wplc_maa_hook_head","wplc_maa_hook_control_head");
2887
- }
2888
-
2889
  }
2890
  }
2891
 
@@ -2894,7 +2614,6 @@ if (!function_exists("wplc_choose_hook_control_head")) {
2894
  * @param string $msg The message
2895
  * @return string
2896
  * @since 1.0.00
2897
- * @author Nick Duncan <nick@wp-livechat.com>
2898
  */
2899
  if (!function_exists("wplc_encrypt_filter_control_message_control")) {
2900
  add_filter("wplc_filter_message_control","wplc_encrypt_filter_control_message_control",10,1);
@@ -2909,7 +2628,6 @@ if (!function_exists("wplc_encrypt_filter_control_message_control")) {
2909
  * @param string $msg The message
2910
  * @return string
2911
  * @since 1.0.00
2912
- * @author Nick Duncan <nick@wp-livechat.com>
2913
  */
2914
  if (!function_exists("wplc_encrypt_filter_control_out_message_control")) {
2915
  add_filter("wplc_filter_message_control_out","wplc_encrypt_filter_control_out_message_control",10,1);
@@ -2924,7 +2642,6 @@ if (!function_exists("wplc_encrypt_filter_control_out_message_control")) {
2924
  * Add to the tabs filter
2925
  * @return void
2926
  * @since 1.0.00
2927
- * @author Nick Duncan <nick@wp-livechat.com>
2928
  */
2929
 
2930
  if (!function_exists("wplc_business_hours_filter_control_setting_tabs")) {
@@ -2950,13 +2667,11 @@ if (!function_exists("wplc_business_hours_filter_control_setting_tabs")) {
2950
  * Encrypt the message
2951
  * @since 1.0.0
2952
  * @return void
2953
- * @author Jarryd Long <jarryd@wp-livechat.com>
2954
  */
2955
  if (!function_exists("wplc_encrypt_encrypt_msg")) {
2956
- function wplc_encrypt_encrypt_msg($plaintext){
2957
-
2958
- $wplc_encrypt_data = get_option("WPLC_ENCRYPT_SETTINGS");
2959
- if(isset($wplc_encrypt_data['wplc_enable_encryption']) && intval($wplc_encrypt_data['wplc_enable_encryption']) == 1){
2960
 
2961
  $encrypted_salt = get_option( "wp-live-chat-support-pro_key" );
2962
  $api_key = get_option('wplc_api_key');
@@ -2982,8 +2697,6 @@ if (!function_exists("wplc_encrypt_encrypt_msg")) {
2982
  }
2983
  if($api_key != ''){
2984
  $api_key = substr($api_key, 0, 10);
2985
-
2986
- $plaintext_utf8 = utf8_encode($plaintext);
2987
  $inputData = cryptoHelpers::convertStringToByteArray($plaintext);
2988
  $keyAsNumbers = cryptoHelpers::toNumbers(bin2hex($api_key));
2989
  $keyLength = count($keyAsNumbers);
@@ -3028,182 +2741,65 @@ if (!function_exists("wplc_encrypt_encrypt_msg")) {
3028
  * Updated in 8.0.32 for backwards compatibility
3029
  * @since 1.0.0
3030
  * @return void
3031
- * @author Jarryd Long <jarryd@wp-livechat.com>
3032
  */
3033
- if (!function_exists("wplc_encrypt_decrypt_msg")) {
3034
- function wplc_encrypt_decrypt_msg($input){
3035
-
3036
- $messages = maybe_unserialize($input);
3037
-
3038
-
3039
- if(is_array($messages)){
3040
- /** Check already in place to determine if a message was previously encrypted */
3041
- if($messages['e'] == 1){
3042
- /* This message was encrypted */
3043
- $encrypted_salt = get_option( "wp-live-chat-support-pro_key" );
3044
- $api_key = get_option('wplc_api_key');
3045
-
3046
- if( $api_key != '' ){
3047
- /**
3048
- * Use the current API key and don't change anything
3049
- */
3050
- $api_key = $api_key;
3051
- } else {
3052
- /**
3053
- * It's empty so lets fix this
3054
- */
3055
- if( $encrypted_salt != '' ){
3056
-
3057
- $api_key = $encrypted_salt;
3058
-
3059
- } else {
3060
-
3061
- $api_key = '';
3062
-
3063
- }
3064
- }
3065
-
3066
- $api_key = substr($api_key, 0, 10);
3067
- $cipherSplit = explode( " ", $messages['m']);
3068
- $originalSize = intval($cipherSplit[0]);
3069
- $iv = cryptoHelpers::toNumbers($cipherSplit[1]);
3070
- $cipherText = $cipherSplit[2];
3071
-
3072
- $cipherIn = cryptoHelpers::toNumbers($cipherText);
3073
- $keyAsNumbers = cryptoHelpers::toNumbers(bin2hex($api_key));
3074
- $keyLength = count($keyAsNumbers);
3075
-
3076
- $decrypted = AES::decrypt(
3077
- $cipherIn,
3078
- $originalSize,
3079
- AES::modeOfOperation_CBC,
3080
- $keyAsNumbers,
3081
- $keyLength,
3082
- $iv
3083
- );
3084
-
3085
- $hexDecrypted = cryptoHelpers::toHex($decrypted);
3086
- $retVal = pack("H*" , $hexDecrypted);
3087
-
3088
- return stripslashes($retVal);
3089
- } else {
3090
- return stripslashes($messages['m']);
3091
- }
3092
- } else{
3093
- return stripslashes($input);
3094
- }
3095
- }
3096
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3097
  }
3098
 
 
 
 
 
 
 
3099
 
3100
-
3101
- if (!function_exists("wplc_inex_filter_control_display_contents")) {
3102
- add_filter("wplc_filter_display_contents","wplc_inex_filter_control_display_contents",1);
3103
- function wplc_inex_filter_control_display_contents($display_contents) {
3104
-
3105
- $wplc_inex_data = get_option("WPLC_INEX_SETTINGS");
3106
-
3107
- $post_id = get_the_ID();
3108
- if (!$post_id || $post_id === NULL) {
3109
- $url = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
3110
- $post_id = url_to_postid($url);
3111
- }
3112
-
3113
-
3114
- if (isset($wplc_inex_data['wplc_include_on_pages'])) { $include_on_pages = $wplc_inex_data['wplc_include_on_pages']; } else { $include_on_pages = ""; }
3115
- if (isset($wplc_inex_data['wplc_exclude_from_pages'])) { $exclude_from_pages = $wplc_inex_data['wplc_exclude_from_pages']; } else { $exclude_from_pages = ""; }
3116
-
3117
-
3118
- if($include_on_pages == "" && $exclude_from_pages == ""){
3119
- $display_contents = 1;
3120
-
3121
- } else {
3122
-
3123
- if($include_on_pages != ''){
3124
-
3125
- $include_on_pages = explode(',', $include_on_pages);
3126
- foreach($include_on_pages as $key => $val) {
3127
- $include_on_pages[$key] = intval($val);
3128
- }
3129
- $include_array = array();
3130
- foreach($include_on_pages as $page){
3131
- $include_array [intval($page)] = intval($page);
3132
- }
3133
-
3134
- if (isset($include_array[$post_id]) && $include_array[$post_id] > 0) {
3135
- $display_contents = true;
3136
- } else {
3137
- /* Do not show here */
3138
- $display_contents = false;
3139
- }
3140
-
3141
-
3142
- } else {
3143
-
3144
- /* Exclude from the following pages */
3145
- $exclude_from_pages = explode(',', $exclude_from_pages);
3146
- $exclude_array = array();
3147
- foreach($exclude_from_pages as $page){
3148
- $exclude_array [$page] = intval($page);
3149
- }
3150
-
3151
- $exclude_from_page = array_search($post_id, $exclude_array);
3152
- if($exclude_from_page === FALSE){
3153
- /* Show here */
3154
- $display_contents = true;
3155
- } else {
3156
- $display_contents = false;
3157
- }
3158
-
3159
- }
3160
-
3161
- }
3162
- if( isset( $wplc_inex_data['wplc_exclude_home'] ) && $wplc_inex_data['wplc_exclude_home'] == '1' ){
3163
- if( is_home() || is_front_page() || $_SERVER['REQUEST_URI'] == '/' ){
3164
-
3165
- $display_contents = false;
3166
-
3167
- }
3168
-
3169
- }
3170
-
3171
- if( isset( $wplc_inex_data['wplc_exclude_archive'] ) && $wplc_inex_data['wplc_exclude_archive'] == '1' ){
3172
-
3173
- if( is_archive() ){
3174
-
3175
- $display_contents = false;
3176
-
3177
- }
3178
-
3179
- }
3180
-
3181
- if ( isset( $wplc_inex_data['wplc_exclude_post_types'] ) && ! empty( $wplc_inex_data['wplc_exclude_post_types'] ) && in_array( get_post_type($post_id), $wplc_inex_data['wplc_exclude_post_types'] ) ) {
3182
- $display_contents = false;
3183
- }
3184
-
3185
- return $display_contents;
3186
-
3187
- }
3188
- }
3189
-
3190
-
3191
-
3192
-
3193
- add_action('wplc_hook_admin_chatbox_javascript','wplc_ic_admin_javascript');
3194
- add_action('wplc_hook_admin_menu_layout_display' , 'wplc_hook_control_admin_menu_layout_display', 1, 3);
3195
- add_action('wplc_hook_wplc_draw_chat_area', 'wplc_hook_control_wplc_draw_chat_area',1, 1);
3196
- add_filter('wplc_filter_list_chats_actions', 'wplc_ic_initiate_chat_button', 14, 3);
3197
- add_filter('wplc_filter_wplc_call_to_server_visitor_new_status_check', 'wplc_filter_control_wplc_call_to_server_visitor_new_status_check', 1, 1);
3198
- add_filter("wplc_filter_run_override","wplc_ic_filter_control_run_override");
3199
-
3200
- if (!function_exists("wplc_ic_filter_control_run_override")) {
3201
- function wplc_ic_filter_control_run_override($ret) {
3202
- $wplc_settings = get_option("WPLC_SETTINGS");
3203
- if (isset($wplc_settings['wplc_disable_initiate_chat']) && $wplc_settings['wplc_disable_initiate_chat'] == 1 ) { return "0"; } else { return "1"; /* allow long poll */ }
3204
- }
3205
- }
3206
-
3207
 
3208
  /**
3209
  * Add an item to the data_array ajax variable
@@ -3211,7 +2807,6 @@ if (!function_exists("wplc_ic_filter_control_run_override")) {
3211
  * @since 1.0.0
3212
  * @param
3213
  * @return void
3214
- * @author Nick Duncan <nick@wp-livechat.com>
3215
  *
3216
  */
3217
  if (!function_exists("wplc_ic_filter_control_admin_javascript")) {
@@ -3232,13 +2827,12 @@ if (!function_exists("wplc_ic_filter_control_admin_javascript")) {
3232
  * @since 1.0.0
3233
  * @param
3234
  * @return string
3235
- * @author Nick Duncan <nick@wp-livechat.com>
3236
  *
3237
  */
3238
  if (!function_exists("wplc_ic_check_if_user_is_agent")) {
3239
  function wplc_ic_check_if_user_is_agent(){
3240
  $user_id = get_current_user_id();
3241
- if (sanitize_text_field(get_the_author_meta('wplc_ma_agent', $user_id ) ) == "1"){
3242
  return $user_id;
3243
  } else {
3244
  return "not_user_agent";
@@ -3246,85 +2840,55 @@ if (!function_exists("wplc_ic_check_if_user_is_agent")) {
3246
  }
3247
  }
3248
 
3249
-
3250
-
3251
-
3252
  /**
3253
  * Initiate chat button
3254
  * @param string $default The default text that gets passed through
3255
  * @param int $id2 ID of the chat
3256
  * @return string
3257
  * @since 1.0.00
3258
- * @author Nick Duncan <nick@wp-livechat.com>
3259
  */
3260
- if (!function_exists("wplc_ic_initiate_chat_button")) {
3261
- function wplc_ic_initiate_chat_button($actions,$result,$post_data) {
3262
-
3263
- if(intval($result->status) == 5 ){
3264
- $aid = "";
3265
- if ($post_data['wplc_extra_data']['agent_id']) {
3266
- if(is_numeric($post_data['wplc_extra_data']['agent_id'])){
3267
- $aid = "&aid=".$post_data['wplc_extra_data']['agent_id'];
3268
- }
3269
- }
3270
-
3271
- $url = admin_url( 'admin.php?page=wplivechat-menu&action=rc&cid='.$result->id.$aid);
3272
- $url_params = apply_filters("wplc_filter_list_chats_url_params","",$result,$post_data);
3273
-
3274
- /* have we disabled this? */
3275
- $wplc_settings = get_option("WPLC_SETTINGS");
3276
- if (isset($wplc_settings['wplc_disable_initiate_chat']) && $wplc_settings['wplc_disable_initiate_chat'] === '1' ) {
3277
- $actions = "";
3278
- } else {
3279
-
3280
- $actions = "<a href=\"".$url."\" class=\"wplc_open_chat button wplc_initiate_chat button-secondary\" window-title=\"WP_Live_Chat_".$result->id.$url_params."\">".__("Initiate Chat","wplivechat")."</a>";
3281
- }
3282
-
3283
- }
3284
-
3285
-
3286
- return $actions;
3287
-
3288
- }
3289
  }
3290
 
3291
  /**
3292
  * Localize the action2 variable that is required
3293
  * @return void
3294
  * @since 1.0.00
3295
- * @author Nick Duncan <nick@wp-livechat.com>
3296
  */
3297
- if (!function_exists("wplc_ic_admin_javascript")) {
3298
- function wplc_ic_admin_javascript() {
3299
-
3300
- $wplc_settings = get_option("WPLC_SETTINGS");
3301
- if (isset($wplc_settings['wplc_typing_enabled']) && $wplc_settings['wplc_typing_enabled'] == 1) { $typing_enabled = "1"; } else { $typing_enabled = "0"; }
3302
-
3303
-
3304
-
3305
- if ($typing_enabled) {
3306
- $wpc_misc_js_strings = array(
3307
- 'typing_enabled' => $typing_enabled,
3308
- 'typingimg' => plugins_url('/images/comment.svg', __FILE__)
3309
- );
3310
- } else {
3311
- $wpc_misc_js_strings = array(
3312
- 'typing_enabled' => $typing_enabled
3313
- );
3314
- }
3315
-
3316
-
3317
- wp_localize_script('wplc-admin-chat-js', 'wplc_misc_strings', $wpc_misc_js_strings);
3318
-
3319
 
 
3320
 
3321
- if (isset($_GET['action']) && $_GET['action'] == 'rc') {
3322
- wp_localize_script( 'wplc-admin-chat-js', 'wplc_action2', 'wplc_long_poll_check_user_opened_chat' );
3323
- wp_localize_script( 'wplc-admin-chat-js', 'wplc_use_node_server', 'false' );
3324
- } else {
3325
- return;
3326
- }
3327
- }
3328
  }
3329
 
3330
  if (!function_exists("wplc_hook_control_intiate_check")) {
@@ -3344,7 +2908,6 @@ if (!function_exists("wplc_hook_control_intiate_check")) {
3344
  * @param string $action The action GET param
3345
  * @return void
3346
  * @since 1.0.00
3347
- * @author Nick Duncan <nick@wp-livechat.com>
3348
  */
3349
  if (!function_exists("wplc_hook_control_admin_menu_layout_display")) {
3350
  function wplc_hook_control_admin_menu_layout_display($action, $cid,$aid) {
@@ -3359,7 +2922,6 @@ if (!function_exists("wplc_hook_control_admin_menu_layout_display")) {
3359
  * @param array $array
3360
  * @return array
3361
  * @since 1.0.00
3362
- * @author Nick Duncan <nick@wp-livechat.com>
3363
  */
3364
  if (!function_exists("wplc_filter_control_wplc_call_to_server_visitor_new_status_check")) {
3365
  function wplc_filter_control_wplc_call_to_server_visitor_new_status_check($array) {
@@ -3379,38 +2941,26 @@ if (!function_exists("wplc_filter_control_wplc_call_to_server_visitor_new_status
3379
  * @param array $array
3380
  * @return array
3381
  * @since 1.0.00
3382
- * @author Nick Duncan <nick@wp-livechat.com>
3383
  */
3384
- if (!function_exists("wplc_hook_control_wplc_draw_chat_area")) {
3385
- function wplc_hook_control_wplc_draw_chat_area($result) {
3386
-
3387
- if(!empty($result->name)){
3388
- wp_localize_script('wplc-admin-chat-js', 'wplc_chat_name', $result->name);
3389
- } else {
3390
- wp_localize_script('wplc-admin-chat-js', 'wplc_chat_name', __('Guest', 'wplivechat'));
3391
- }
3392
-
3393
-
3394
- if (intval($result->status) == 6) {
3395
- echo "<strong>" . __("Attempting to open the chat window... Please be patient.", "wp-live-chat-support-initiate-chats") . "</strong>";
3396
- $result->continue = false;
3397
- return $result;
3398
- }
3399
- return $result;
3400
-
3401
- }
3402
  }
3403
 
3404
-
3405
-
3406
-
3407
-
3408
-
3409
  /**
3410
  * Checks if user is an agent while on the chat dashboard page
3411
  * @return void
3412
  * @since 1.0.00
3413
- * @author Nick Duncan <nick@wp-livechat.com>
3414
  */
3415
  if (!function_exists("wplc_ma_hook_control_admin_meny_layout_display_top")) {
3416
  function wplc_ma_hook_control_admin_meny_layout_display_top() {
@@ -3434,7 +2984,6 @@ if (!function_exists("wplc_ma_hook_control_admin_meny_layout_display_top")) {
3434
  * @since 1.0.0
3435
  * @param
3436
  * @return void
3437
- * @author Nick Duncan <nick@wp-livechat.com>
3438
  *
3439
  */
3440
  if (!function_exists("wplc_maa_update_agent_id")) {
@@ -3464,7 +3013,6 @@ if (!function_exists("wplc_maa_update_agent_id")) {
3464
  * @since 1.0.0
3465
  * @param
3466
  * @return string
3467
- * @author Nick Duncan <nick@wp-livechat.com>
3468
  *
3469
  */
3470
  if (!function_exists("wplc_maa_check_if_user_is_agent")) {
@@ -3486,7 +3034,6 @@ if (!function_exists("wplc_maa_check_if_user_is_agent")) {
3486
  * @param int $cid Chat ID
3487
  * @param int $aid Agent ID
3488
  * @return bool
3489
- * @author Nick Duncan <nick@wp-livechat.com>
3490
  */
3491
  if (!function_exists("wplc_maa_check_if_chat_answered_by_other_agent")) {
3492
  function wplc_maa_check_if_chat_answered_by_other_agent($cid, $aid){
@@ -3519,7 +3066,6 @@ if (!function_exists("wplc_hook_control_ma_check_if_answered_by_another_agent"))
3519
  * @param int $cid Chat ID
3520
  * @param int $aid Agent ID
3521
  * @since 1.0.0
3522
- * @author Nick Duncan <nick@wp-livechat.com>
3523
  * @return void
3524
  */
3525
  if (!function_exists("wplc_ma_hook_control_update_agent_id")) {
@@ -3537,7 +3083,6 @@ if (!function_exists("wplc_ma_hook_control_update_agent_id")) {
3537
  * @since 1.0.0
3538
  * @param
3539
  * @return void
3540
- * @author Nick Duncan <nick@wp-livechat.com>
3541
  */
3542
  if (!function_exists("wplc_ma_first_time_install")) {
3543
  function wplc_ma_first_time_install() {
@@ -3570,7 +3115,6 @@ if (!function_exists("wplc_ma_first_time_install")) {
3570
  * @since 1.0.0
3571
  * @param
3572
  * @return void
3573
- * @author Nick Duncan <nick@wp-livechat.com>
3574
  */
3575
  if (!function_exists("wplc_maa_set_user_as_agent")) {
3576
  function wplc_maa_set_user_as_agent( $user_id ) {
@@ -3608,13 +3152,12 @@ if (!function_exists("wplc_maa_set_user_as_agent")) {
3608
  * @since 1.0.0
3609
  * @param
3610
  * @return void
3611
- * @author Nick Duncan <nick@wp-livechat.com>
3612
  *
3613
  */
3614
  if (!function_exists("wplc_maa_custom_user_profile_fields")) {
3615
  function wplc_maa_custom_user_profile_fields($user) {
3616
- $wplc_settings = get_option('WPLC_INEX_SETTINGS');
3617
- if(isset($wplc_settings['wplc_make_agent']) && $wplc_settings['wplc_make_agent'] == 1){
3618
  ?>
3619
  <table class="form-table">
3620
  <tr>
@@ -3710,7 +3253,6 @@ function wplc_is_typing_mrg($user,$cid) {
3710
  * @since 1.0.0
3711
  * @param
3712
  * @return array
3713
- * @author Nick Duncan <nick@wp-livechat.com>
3714
  */
3715
 
3716
  if (!function_exists("wplc_ma_filter_control_wplc_admin_long_poll_chat_iteration")) {
@@ -3801,7 +3343,6 @@ if (!function_exists("wplc_ma_filter_control_wplc_admin_long_poll_chat_iteration
3801
  * @since 1.0.0
3802
  * @param
3803
  * @return array
3804
- * @author Nick Duncan <nick@wp-livechat.com>
3805
  */
3806
 
3807
  if (!function_exists("wplc_ma_filter_control_wplc_user_long_poll_chat_iteration")) {
@@ -3858,7 +3399,6 @@ if (!function_exists("wplc_ma_filter_control_wplc_user_long_poll_chat_iteration"
3858
  * @since 1.0.0
3859
  * @param
3860
  * @return void
3861
- * @author Nick Duncan <nick@wp-livechat.com>
3862
  *
3863
  */
3864
  if (!function_exists("wplc_ma_hook_control_accept_chat_url")) {
@@ -3893,7 +3433,6 @@ if (!function_exists("wplc_filter_control_aid_in_action")) {
3893
  * @since 1.0.0
3894
  * @param
3895
  * @return void
3896
- * @author Nick Duncan <nick@wp-livechat.com>
3897
  *
3898
  */
3899
  if (!function_exists("wplc_ma_filter_control_admin_javascript")) {
@@ -3919,11 +3458,8 @@ if (!function_exists("wplc_ma_filter_control_admin_javascript")) {
3919
  if (!function_exists("wplc_ma_filter_control_chat_dashboard_visitors_online_bottom")) {
3920
  add_action("wplc_filter_chat_dahsboard_visitors_online_bottom","wplc_ma_filter_control_chat_dashboard_visitors_online_bottom",11);
3921
  function wplc_ma_filter_control_chat_dashboard_visitors_online_bottom($text) {
3922
- $text = "<hr />";
3923
- $text .= " <p class='wplc-agent-info2' id='wplc-agent-info'>";
3924
- $text .= " <span class='wplc_agents_online'>".wplc_maa_total_agents_online()."</span>";
3925
- $text .= " <a href='?page=wplivechat-menu-settings#tabs-5' target='_BLANK'>".__("Agent(s) online","wplivechat")."</a>";
3926
- $text .= " </p>";
3927
  return $text;
3928
  }
3929
  }
@@ -3932,102 +3468,86 @@ if (!function_exists("wplc_ma_filter_control_chat_dashboard_visitors_online_bott
3932
  * Count how many agents are online
3933
  * @return int number of agents
3934
  */
3935
- if (!function_exists("wplc_maa_total_agents_online")) {
3936
-
3937
- function wplc_maa_total_agents_online(){
3938
- $choose_array = get_option("WPLC_CHOOSE_ACCEPTING");
3939
- $count_agents = 0;
3940
- if($choose_array){
3941
- foreach($choose_array as $ch){
3942
- if($ch == true){
3943
- $count_agents++;
3944
- }
3945
- }
3946
- }
3947
- return $count_agents;
3948
- }
 
 
 
3949
  }
3950
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3951
 
3952
- if (!function_exists("wplc_maa_online_agents")) {
3953
-
3954
- add_action('admin_bar_menu', 'wplc_maa_online_agents', 100);
3955
- function wplc_maa_online_agents(){
3956
-
3957
- if( !current_user_can( 'wplc_ma_agent', array(null) ) ){
3958
- return; //if user doesn't have permissions for chat agent, do not show admin bar.
3959
- }
3960
- ?>
3961
- <style >
3962
- .wplc_circle{
3963
- width: 10px !important;
3964
- height: 10px !important;
3965
- display: inline-block !important;
3966
- border-radius: 100% !important;
3967
- margin-right: 5px !important;
3968
- }
3969
- .wplc_red_circle{
3970
- background: red;
3971
- }
3972
- .wplc_green_circle{
3973
- background:rgb(103, 213, 82);
3974
- }
3975
- </style>
3976
- <?php
3977
- if(wplc_maa_is_agent_online()){
3978
- $online_now = wplc_maa_total_agents_online();
3979
- $circle_class = "wplc_green_circle";
3980
- if($online_now == 1){
3981
- $chat_agents = __('Chat Agent Online', 'wplivechat');
3982
- } else {
3983
- $chat_agents = __('Chat Agents Online', 'wplivechat');
3984
- }
3985
- } else {
3986
- $online_now = 0;
3987
- $circle_class = "wplc_red_circle";
3988
- $chat_agents = __('Chat Agents Online', 'wplivechat');
3989
- }
3990
 
3991
- global $wp_admin_bar;
3992
- $wp_admin_bar->add_menu( array(
3993
- 'id' => 'wplc_ma_online_agents',
3994
- 'title' => '<span class="wplc_circle '.$circle_class.'" id="wplc_ma_online_agents_circle"></span><span id="wplc_ma_online_agents_count">'.$online_now.'</span> '.$chat_agents,
3995
- 'href' => false
3996
- ) );
3997
- $choose_array = get_option("WPLC_CHOOSE_ACCEPTING");
3998
- if($online_now > 0){
3999
- $user_array = get_users(array(
4000
- 'meta_key'=> 'wplc_chat_agent_online',
4001
- ));
4002
- foreach($user_array as $user){
4003
- $online = get_user_meta($user->ID, 'wplc_chat_agent_online' );
4004
-
4005
- foreach($choose_array as $key => $val ){
4006
- if( $key == $user->ID && $val == true ){
4007
- $wp_admin_bar->add_menu( array(
4008
- 'id' => 'wplc_user_online_'.$user->ID,
4009
- 'parent' => 'wplc_ma_online_agents',
4010
- 'title' => $user->display_name,
4011
- 'href' => false,
4012
- ) );
4013
-
4014
- }
4015
- }
4016
-
4017
- }
4018
- }
4019
- }
4020
  }
4021
 
4022
-
4023
-
4024
-
4025
-
4026
  /**
4027
  * Logs the agent out
4028
  * @return void
4029
  * @since 1.0.00
4030
- * @author Nick Duncan <nick@wp-livechat.com>
4031
  */
4032
 
4033
  if (!function_exists("wplc_maa_remove_agents_online")) {
@@ -4058,7 +3578,6 @@ if (!function_exists("wplc_maa_hook_control_head")) {
4058
  * @param bool $logged_in
4059
  * @return array
4060
  * @since 1.0.00
4061
- * @author Nick Duncan <nick@wp-livechat.com>
4062
  */
4063
  if (!function_exists("wplc_maa_filter_control_check_if_logged_in")) {
4064
  add_filter("wplc_filter_is_admin_logged_in","wplc_maa_filter_control_check_if_logged_in",10,1);
@@ -4073,7 +3592,6 @@ if (!function_exists("wplc_maa_filter_control_check_if_logged_in")) {
4073
  * Logs the agent out
4074
  * @return void
4075
  * @since 1.0.00
4076
- * @author Nick Duncan <nick@wp-livechat.com>
4077
  */
4078
  if (!function_exists("wplc_maa_agent_logout")) {
4079
  add_action('wp_logout', 'wplc_maa_agent_logout');
@@ -4084,42 +3602,19 @@ if (!function_exists("wplc_maa_agent_logout")) {
4084
  }
4085
 
4086
  /**
4087
- * Is the agent online?
4088
  * @return bool
4089
  * @since 1.0.00
4090
- * @author Nick Duncan <nick@wp-livechat.com>
4091
  */
4092
 
4093
- if (!function_exists("wplc_maa_is_agent_online")) {
4094
- function wplc_maa_is_agent_online(){
4095
-
4096
- $wplc_online = 0;
4097
- $choose_array = get_option("WPLC_CHOOSE_ACCEPTING");
4098
-
4099
- if( $choose_array ){
4100
- foreach($choose_array as $choose ){
4101
- if($choose === TRUE){
4102
- $wplc_online++;
4103
- }
4104
- }
4105
- }
4106
-
4107
- if($wplc_online > 0){
4108
- return true;
4109
- } else {
4110
- return false;
4111
- }
4112
-
4113
- }
4114
  }
4115
 
4116
-
4117
-
4118
  /**
4119
  * Add the JS file to the admin screen
4120
  * @return void
4121
  * @since 1.0.00
4122
- * @author Nick Duncan <nick@wp-livechat.com>
4123
  */
4124
  if (!function_exists("wplc_control_admin_javascript")) {
4125
  function wplc_control_admin_javascript() {
@@ -4138,8 +3633,6 @@ if (!function_exists("wplc_control_admin_javascript")) {
4138
  'typing_string' => __('Typing...', 'wplivechat')
4139
  );
4140
  wp_localize_script('wplc-ma-js', 'wplc_admin_strings', $wpc_ma_js_strings);
4141
- wp_localize_script('wplc-ma-js', 'wplc_is_pro', '1');
4142
-
4143
  }
4144
  do_action("wplc_maa_hook_head");
4145
  }
@@ -4170,7 +3663,6 @@ if (!function_exists("wplc_ma_hook_control_remove_transient")) {
4170
  * AJAX callback control
4171
  * @return void
4172
  * @since 1.0.00
4173
- * @author Nick Duncan <nick@wp-livechat.com>
4174
  */
4175
  if (!function_exists("wplc_ma_hook_control_action_callback")) {
4176
  add_action("wplc_hook_action_callback","wplc_ma_hook_control_action_callback");
@@ -4200,45 +3692,60 @@ if (!function_exists("wplc_ma_hook_control_action_callback")) {
4200
  }
4201
 
4202
  if ($_POST['action'] == "wplc_macro") {
4203
- if (isset($_POST['postid'])) {
4204
- $post_id = sanitize_text_field($_POST['postid']);
4205
- } else {
4206
- return false;
4207
- }
 
4208
 
4209
- if ($post_id > 0) {
4210
- $post_details = get_post($post_id);
4211
- if ($post_details) {
4212
- echo json_encode(nl2br($post_details->post_content));
4213
- } else {
4214
- echo json_encode("No post with that ID");
4215
- die();
4216
- }
4217
- } else {
4218
- echo json_encode("No macro with that ID");
 
 
 
 
4219
  die();
4220
- }
4221
  }
4222
 
4223
  if( $_POST['action'] == 'wplc_record_chat_rating' ){
4224
  $rating_id = sanitize_text_field($_POST['cid']);
4225
  $rating_score = sanitize_text_field($_POST['rating']);
 
 
 
 
 
 
 
4226
 
4227
- if( ! filter_var($rating_id, FILTER_VALIDATE_INT) ) {
4228
- /* We need to identify if this CID is a node CID, and if so, return the WP CID */
4229
- $rating_id = wplc_return_chat_id_by_rel($rating_id);
4230
- }
4231
-
4232
-
4233
- $nifty_record_rating = nifty_record_rating_mrg($rating_id, $rating_score);
4234
- if ($nifty_record_rating) {
4235
- echo 'rating added';
4236
- wp_die();
4237
- } else {
4238
- echo "There was an error sending your chat message. Please contact support";
4239
- wp_die();
4240
- }
4241
-
 
 
 
4242
  }
4243
 
4244
  }
@@ -4248,7 +3755,6 @@ if (!function_exists("wplc_ma_hook_control_action_callback")) {
4248
  * Mark the agent as "online"
4249
  * @return void
4250
  * @since 1.0.00
4251
- * @author Nick Duncan <nick@wp-livechat.com>
4252
  */
4253
 
4254
  if (!function_exists("wplc_maa_set_agents_online")) {
@@ -4276,51 +3782,31 @@ if (!function_exists("wplc_maa_set_agents_online")) {
4276
  // add_filter("wplc_filter_chat_header_above","wplc_chat_social_div_mrg",5,2);
4277
  // add_filter("wplc_filter_chat_4th_layer_below_input","wplc_chat_social_div_mrg",5,2);
4278
  add_filter("wplc_filter_chat_social_div_hook","wplc_chat_social_div_mrg",5,2);
4279
- function wplc_chat_social_div_mrg($msg, $wplc_setting){
4280
- $acbc_settings = get_option("WPLC_ACBC_SETTINGS");
4281
- $current_theme = isset($wplc_setting['wplc_newtheme']) ? $wplc_setting['wplc_newtheme'] : "";
4282
-
4283
- $top_offset = "";
4284
-
4285
- $wplc_settings = get_option("WPLC_SETTINGS");
4286
- if($wplc_settings["wplc_ux_exp_rating"] === "0" && $current_theme === "theme-2"){
4287
- //$top_offset = "bottom:-4px !important;";
4288
- }
4289
-
4290
- $msg .= "<div id='wplc_social_holder' ".($current_theme === "theme-2" ? "class='wplc_modern'" : "" )." >";
4291
- if(isset($acbc_settings['wplc_social_fb']) && $acbc_settings['wplc_social_fb'] != ""){
4292
- $msg .= "<a class='wplc-color-1' href=".urldecode($acbc_settings['wplc_social_fb'])." target='_blank'><i class='wplc_social_icon fa fa-facebook-square' id='wplc_social_fb' ></i></a>";
4293
- }
4294
- if(isset($acbc_settings['wplc_social_tw']) && $acbc_settings['wplc_social_tw'] != ""){
4295
- $msg .= "<a class='wplc-color-1' href=".urldecode($acbc_settings['wplc_social_tw'])." target='_blank'><i class='wplc_social_icon fa fa-twitter-square' id='wplc_social_tw' ></i></a>";
4296
- }
4297
- $msg .= "</div>";
4298
- return $msg;
4299
- }
4300
-
4301
- /*Text Editor*/
4302
- add_filter("wplc_filter_chat_text_editor","nifty_text_edit_div_mrg",1,1);
4303
- function nifty_text_edit_div_mrg($msg){
4304
- $msg .= "<div id='nifty_text_editor_holder'>";
4305
- $msg .= "<i class='nifty_tedit_icon fa fa-bold' id='nifty_tedit_b'></i>";
4306
- $msg .= "<i class='nifty_tedit_icon fa fa-italic' id='nifty_tedit_i'></i>";
4307
- $msg .= "<i class='nifty_tedit_icon fa fa-underline' id='nifty_tedit_u'></i>";
4308
- $msg .= "<i class='nifty_tedit_icon fa fa-strikethrough' id='nifty_tedit_strike'></i>";
4309
- $msg .= "<i class='nifty_tedit_icon fa fa-square' id='nifty_tedit_mark'></i>";
4310
- $msg .= "<i class='nifty_tedit_icon fa fa-subscript' id='nifty_tedit_sub'></i>";
4311
- $msg .= "<i class='nifty_tedit_icon fa fa-superscript' id='nifty_tedit_sup'></i>";
4312
- $msg .= "<i class='nifty_tedit_icon fa fa-link' id='nifty_tedit_link'></i>";
4313
- $msg .= "</div>";
4314
- return $msg;
4315
  }
4316
 
4317
  /*Upload Div*/
4318
  add_filter("wplc_filter_chat_upload","nifty_file_upload_div_mrg",1,1);
4319
  function nifty_file_upload_div_mrg($msg){
4320
- $wplc_settings = get_option("WPLC_SETTINGS");
4321
- if($wplc_settings["wplc_ux_file_share"] !== "0"){
4322
- // $editor_enabled = $wplc_settings["wplc_ux_exp_rating"] == "0" ? "bottom: 35px !important;" : "";
4323
- $editor_enabled = "";
4324
  $msg .= "<div id='nifty_file_holder'>";
4325
  $msg .= "<label for='nifty_file_input' id='nifty_select_file'><i class='nifty_attach_icon nifty_attach_open_icon fa fa-paperclip' id='nifty_attach' style='$editor_enabled' ></i></label>";
4326
  $msg .= "<i class='nifty_attach_icon fa fa-circle-o-notch fa-spin' id='nifty_attach_uploading_icon' style='display:none; $editor_enabled' ></i>";
@@ -4335,8 +3821,8 @@ function nifty_file_upload_div_mrg($msg){
4335
  // add_filter("wplc_filter_chat_header_above","nifty_chat_ratings_div_mrg",1,2);
4336
  add_filter("wplc_filter_chat_4th_layer_below_input","nifty_chat_ratings_div_mrg",1,2);
4337
  function nifty_chat_ratings_div_mrg($msg, $wplc_setting){
4338
- $wplc_settings = get_option("WPLC_SETTINGS");
4339
- if($wplc_settings["wplc_ux_exp_rating"] !== "0"){
4340
  $msg .= "<div id='nifty_ratings_holder' style='display:none;'>";
4341
  $msg .= "<i class='nifty_rating_icon fa fa-thumbs-o-up' id='nifty_rating_pos' ></i>";
4342
  $msg .= "";
@@ -4405,25 +3891,18 @@ function nifty_get_rating_data_mrg($cid,$force = false){
4405
  global $wpdb;
4406
  global $wplc_tblname_chat_ratings;
4407
  if ($force) {
4408
- $sql = "SELECT * FROM $wplc_tblname_chat_ratings WHERE `cid` = '%d' LIMIT 1";
4409
- $sql = $wpdb->prepare($sql, $cid);
4410
- $results = $wpdb->get_results($sql);
4411
  } else {
4412
- $sql = "SELECT * FROM $wplc_tblname_chat_ratings WHERE `cid` = '%d' AND `notified` = 0 LIMIT 1";
4413
- $sql = $wpdb->prepare($sql, $cid);
4414
- $results = $wpdb->get_results($sql);
4415
  }
4416
  if ($wpdb->num_rows) {
4417
-
4418
- foreach ($results as $result) {
4419
- $id = $result->id;
4420
- $sql = "UPDATE $wplc_tblname_chat_ratings SET `notified` = 1 WHERE `id` = %d LIMIT 1";
4421
- $sql = $wpdb->prepare($sql, $id);
4422
- $wpdb->Query($sql);
4423
- return array("rating" => $result->rating, "comment" => $result->comment);
4424
- }
4425
- }else{
4426
- return false;
4427
  }
4428
  }
4429
 
@@ -4432,19 +3911,13 @@ function nifty_rating_advanced_info_control_mrg($msg, $cid, $name, $chat_data){
4432
  $rating = apply_filters("wplc_rating_data_filter","",$cid,$name);
4433
  if ($rating) {
4434
 
4435
- $msg .= "<div class='admin_visitor_advanced_info admin_agent_rating'><br>
4436
- <strong>" . __("Experience Rating", "wplivechat") . "</strong>
4437
  <div class='rating " .(isset($rating['rating']) && $rating['rating'] == '1' ? "rating-good" : ($rating['rating'] == '0' ? "rating-bad" : "" ))."'>".(isset($rating['rating']) && $rating['rating'] == '1' ? "Satisfied" : ($rating['rating'] == '0' ? "Unsatisfied" : "No Rating" ))."</div>
4438
- <hr />
4439
- <div class='rating-comment'><div id='rating-comment-holder'>\"".(isset($rating['comment']) && $rating['comment'] != "undefined" ? $rating['comment'] : "No Comment...")."\"</div> - ".$name."</div>
4440
  </div>";
4441
  } else{
4442
  //No Rating Provided
4443
  $msg .= "<div class='admin_visitor_advanced_info admin_agent_rating'>
4444
- <strong>" . __("Experience Rating", "wplivechat") . "</strong>
4445
  <div class='rating'>No Rating</div>
4446
- <hr />
4447
- <div class='rating-comment'><div id='rating-comment-holder'>\"No Comment...\"</div> - ".$name."</div>
4448
  </div>";
4449
  }
4450
  return $msg;
@@ -4469,17 +3942,17 @@ function nifty_get_rating_report_mrg($uid, $filter = 0){
4469
  global $wpdb;
4470
  global $wplc_tblname_chat_ratings;
4471
 
4472
- $sql = "SELECT * FROM $wplc_tblname_chat_ratings WHERE `aid` = '$uid'";
4473
  if($filter == 1){
4474
- $sql = "SELECT * FROM $wplc_tblname_chat_ratings WHERE `aid` = '$uid' AND `timestamp` > DATE_SUB(NOW(), INTERVAL 7 DAY)";
4475
  }else if($filter == 2){
4476
- $sql = "SELECT * FROM $wplc_tblname_chat_ratings WHERE `aid` = '$uid' AND `timestamp` > DATE_SUB(NOW(), INTERVAL 14 DAY)";
4477
  }else if($filter == 3){
4478
- $sql = "SELECT * FROM $wplc_tblname_chat_ratings WHERE `aid` = '$uid' AND `timestamp` > DATE_SUB(NOW(), INTERVAL 30 DAY)";
4479
  }else if($filter == 4){
4480
- $sql = "SELECT * FROM $wplc_tblname_chat_ratings WHERE `aid` = '$uid' AND `timestamp` > DATE_SUB(NOW(), INTERVAL 60 DAY)";
4481
  }else if($filter == 5){
4482
- $sql = "SELECT * FROM $wplc_tblname_chat_ratings WHERE `aid` = '$uid' AND `timestamp` > DATE_SUB(NOW(), INTERVAL 90 DAY)";
4483
  }
4484
 
4485
  $sql .= " ORDER BY `cid` DESC"; //Sort
@@ -4490,7 +3963,7 @@ function nifty_get_rating_report_mrg($uid, $filter = 0){
4490
 
4491
  $data_array = array();
4492
  $current_index = 0;
4493
- $results = $wpdb->get_results($sql);
4494
  if($wpdb->num_rows){
4495
  foreach ($results as $res) {
4496
  $data_array[$uid][$current_index] = array(
@@ -4552,6 +4025,7 @@ function wplc_reporting_tab_content_filter_experience_ratings_control_mrg($tabs_
4552
  display: inline-block;
4553
  margin-right: 13px;
4554
  vertical-align: top;
 
4555
  }";
4556
  $ratings .= ".wplc_agent_data {
4557
  max-height: 200px;
@@ -4687,7 +4161,7 @@ function wplc_reporting_page(){
4687
 
4688
  $tabs .= "<style>" . $styling_reporting . "</style>";
4689
 
4690
- $tabs .= "<div clas='wrap'><h2>".__('WP Live Chat Support Reporting', 'wp-livechat')."</h2><div id='reporting_tabs'>";
4691
  $tabs .= "<ul>";
4692
  $tab = array(
4693
  'overview' => __('Overview', 'wp-livechat'),
@@ -4787,69 +4261,64 @@ function return_statistics_mrg(){
4787
  'other_data' => apply_filters('wplc_additional_statistic_data', '')
4788
  );
4789
  }
4790
- function return_stats_strings_mrg(){
4791
  return array(
4792
  'url' => __('URL', 'wp-livechat'),
4793
  'count' => __('Count', 'wp-livechat')
4794
  );
4795
  }
4796
 
4797
- add_filter( 'wplc_filter_message_sound', 'wplc_mrg_filter_control_message_sound', 10, 1 );
4798
- function wplc_mrg_filter_control_message_sound( $wplc_message_sound ) {
4799
-
4800
- $wplc_settings = get_option( 'WPLC_SETTINGS' );
4801
-
4802
- return ! empty( $wplc_settings['wplc_messagetone'] ) ? $wplc_settings['wplc_messagetone'] : $wplc_message_sound;
4803
-
4804
  }
4805
 
4806
- add_filter("wplc_filter_wav_file","wplc_filter_control_wav_file",10,1);
4807
- function wplc_filter_control_wav_file($wplc_wav_file) {
4808
- $wplc_settings = get_option("WPLC_SETTINGS");
4809
- if (isset($wplc_settings['wplc_ringtone'])) { return $wplc_settings['wplc_ringtone']; }
4810
- else { return $wplc_wav_file; }
4811
-
4812
-
4813
  }
4814
 
4815
  add_action("wplc_advanced_settings_settings","wplc_hook_control_advanced_settings_settings",10);
4816
  function wplc_hook_control_advanced_settings_settings() {
4817
- $wplc_settings = get_option("WPLC_SETTINGS");
4818
  echo "<tr>";
4819
- echo " <td>".__("Disable initiate chat feature:","wplivechat")." <i class=\"fa fa-question-circle wplc_light_grey wplc_settings_tooltip\" title=\"".__("This will substantially improve performance. If you are experiencing performance issues on your site, you should disable the initiate chat feature and only enable it when you need it.","wplivechat")."\"></i></td>";
4820
- if (isset($wplc_settings['wplc_disable_initiate_chat']) && $wplc_settings['wplc_disable_initiate_chat'] == '1' ) { $is_checked = "checked"; } else { $is_checked = ""; }
4821
-
4822
- echo " <td><input type='checkbox' name='wplc_disable_initiate_chat' value='1' ".$is_checked."/></td>";
 
 
4823
  echo "</tr>";
4824
  }
4825
 
4826
-
4827
-
4828
-
4829
-
4830
-
4831
  function wplc_random_quote_mrg() {
4832
- $rand = rand(0,7);
4833
-
4834
- $array = array(
4835
- 0 => "&ldquo;The true entrepreneur is a doer, not a dreamer.&rdquo; Unknown",
4836
- 1 => "&ldquo;Please think about your legacy, because you’re writing it every day.&rdquo; Gary Vaynerchuck",
4837
- 2 => "&ldquo;A man should never neglect his family for business.&rdquo; Walt Disney",
4838
- 3 => "&ldquo;Every accomplishment starts with a decision to try.&rdquo; Unknown",
4839
- 4 => "&ldquo;There’s no shortage of remarkable ideas, what’s missing is the will to execute them.&rdquo; Seth Godin",
4840
- 5 => "&ldquo;You only have to do a very few things right in your life so long as you don’t do too many things wrong.&rdquo; Warren Buffett",
4841
- 6 => "&ldquo;One finds limits by pushing them.&rdquo; Herbert Simon",
4842
- 7 => "&ldquo;Wishes cost nothing unless you want them to come true&rdquo; - Steve Jobs",
4843
- 8 => "&ldquo;Hire character. Train skill.&rdquo; Peter Schutz",
4844
- 9 => "&ldquo;A calm sea does not make a skilled sailor.&rdquo; Unknown",
4845
- 10 => "&ldquo;Leadership is doing what is right when no one is watching.&rdquo; George Van Valkenburg",
4846
- 11 => "&ldquo;Genius is one percent inspiration and ninety–nine percent perspiration.&rdquo; Thomas A. Edison",
4847
- 12 => "&ldquo;Are you a serial idea–starting person? The goal is to be an idea–shipping person.&rdquo; Seth Godin",
4848
- 13 => "&ldquo;To win without risk is to triumph without glory.&rdquo; Pierre Corneille",
4849
- 14 => "&ldquo;The golden rule for every business man is this: Put yourself in your customer’s place.&rdquo; – Orison Swett Marden"
4850
-
4851
- );
4852
- return $array[$rand];
4853
  }
4854
 
4855
  function wplc_enqueue_admin_styles_mrg(){
@@ -4858,57 +4327,49 @@ function wplc_enqueue_admin_styles_mrg(){
4858
 
4859
  add_filter("wplc_filter_admin_from","wplc_filter_control_admin_from_mrg",10,3);
4860
  function wplc_filter_control_admin_from_mrg($content, $cid, $chat_data = false) {
4861
- $acbc_settings = get_option("WPLC_ACBC_SETTINGS");
4862
 
4863
- if (!$chat_data) {
4864
- $chat_data = wplc_get_chat_data($cid,__LINE__);
 
 
 
 
 
 
 
4865
  }
4866
- if (isset($chat_data->agent_id)) {
4867
- if(isset($acbc_settings)){
4868
- if(isset($acbc_settings['wplc_use_wp_name'])){
4869
- if(intval($acbc_settings['wplc_use_wp_name']) == 1){
4870
- $user_object = get_user_by("id", $chat_data->agent_id);
4871
- if( is_object( $user_object ) ){
4872
- $content = $user_object->data->display_name;
4873
- }
4874
- }
4875
- }
4876
- }
4877
- }
4878
- return $content;
4879
  }
4880
 
4881
  add_action("wplc_add_js_admin_chat_area", "wplc_add_js_admin_chat_area_control_mrg", 10, 2);
4882
  function wplc_add_js_admin_chat_area_control_mrg($cid, $chat_data = false){
4883
- $acbc_settings = get_option("WPLC_ACBC_SETTINGS");
4884
- if (!$chat_data) { $chat_data = wplc_get_chat_data($cid,__LINE__); }
4885
- if ($chat_data) {
4886
- if(isset($acbc_settings)){
4887
- if(isset($acbc_settings['wplc_use_wp_name']) && intval($acbc_settings['wplc_use_wp_name']) == 1){
4888
-
4889
- $tuser = get_user_by('id', $chat_data->agent_id);
4890
- if ($tuser) {
4891
- $tname = $tuser->display_name;
4892
- } else {
4893
- $tname = stripslashes($acbc_settings['wplc_chat_name']);
4894
- }
4895
-
4896
- ?>
4897
- <script>
4898
- var wplc_name_override = "<?php echo sanitize_text_field($tname); ?>";
4899
- </script>
4900
- <?php
4901
- } else if(isset($acbc_settings['wplc_chat_name'])){
4902
- ?>
4903
- <script>
4904
- var wplc_name_override = "<?php echo sanitize_text_field(stripslashes($acbc_settings['wplc_chat_name'])) ?>";
4905
- </script>
4906
- <?php
4907
- }
4908
- }
4909
- } else {
4910
- exit("Error connecting to the cloud server. Please refresh this page");
4911
- }
4912
  }
4913
 
4914
  register_activation_hook( __FILE__, 'wplc_auto_responder_activate_mrg' );
@@ -4939,13 +4400,13 @@ function wplc_offline_message_autoresponder_mrg( $data ){
4939
  $wplc_user_name = $data['name'];
4940
  $wplc_user_email = $data['email'];
4941
 
4942
- $wplc_settings = get_option("WPLC_AUTO_RESPONDER_SETTINGS");
4943
 
4944
- if( isset( $wplc_settings['wplc_ar_enable'] ) && $wplc_settings['wplc_ar_enable'] == '1' ) { $wplc_ar_enable = $wplc_settings['wplc_ar_enable']; } else { $wplc_ar_enable = FALSE; }
4945
- if( isset( $wplc_settings['wplc_ar_from_name'] ) ) { $wplc_ar_from_name = $wplc_settings['wplc_ar_from_name']; } else { $wplc_ar_from_name = ""; }
4946
- if( isset( $wplc_settings['wplc_ar_from_email'] ) ) { $wplc_ar_from_email = $wplc_settings['wplc_ar_from_email']; } else { $wplc_ar_from_email = ""; }
4947
- if( isset( $wplc_settings['wplc_ar_subject'] ) ) { $wplc_ar_subject = $wplc_settings['wplc_ar_subject']; } else { $wplc_ar_subject = ""; }
4948
- if( isset( $wplc_settings['wplc_ar_body'] ) ) { $wplc_ar_body = $wplc_settings['wplc_ar_body']; } else { $wplc_ar_body = ""; }
4949
 
4950
  if( $wplc_ar_enable ){
4951
 
@@ -4976,7 +4437,9 @@ function wplc_offline_message_autoresponder_mrg( $data ){
4976
  * Using contents of wplcmail function as we need additional functionality for this
4977
  */
4978
  $headers[] = 'Content-type: text/html';
4979
- $headers[] = 'Reply-To: '.$wplc_ar_from_name.'<'.$wplc_ar_from_email.'>';
 
 
4980
  $overbody = apply_filters("wplc_filter_mail_body",$wplc_ar_subject, htmlspecialchars_decode(stripslashes( $wplc_ar_body ) ) );
4981
  if (!wp_mail($wplc_user_email, $wplc_ar_subject, $overbody, $headers)) {
4982
  $error = date("Y-m-d H:i:s") . " WP-Mail Failed to send \n";
@@ -4995,10 +4458,10 @@ function wplc_auto_responder_settings_mrg(){
4995
  if (isset($_POST['wplc_save_settings'])) {
4996
  $wplc_data = array();
4997
  if (isset($_POST['wplc_ar_enable'])) { $wplc_data['wplc_ar_enable'] = sanitize_text_field($_POST['wplc_ar_enable']); }
4998
- if (isset($_POST['wplc_ar_from_name'])) { $wplc_data['wplc_ar_from_name'] = sanitize_text_field($_POST['wplc_ar_from_name']); }
4999
- if (isset($_POST['wplc_ar_from_email'])) { $wplc_data['wplc_ar_from_email'] = sanitize_text_field($_POST['wplc_ar_from_email']); }
5000
- if (isset($_POST['wplc_ar_subject'])) { $wplc_data['wplc_ar_subject'] = sanitize_text_field($_POST['wplc_ar_subject']); }
5001
- if (isset($_POST['wplc_ar_body'])) { $wplc_data['wplc_ar_body'] = sanitize_text_field($_POST['wplc_ar_body']); }
5002
 
5003
  update_option( "WPLC_AUTO_RESPONDER_SETTINGS", $wplc_data );
5004
 
@@ -5006,10 +4469,6 @@ function wplc_auto_responder_settings_mrg(){
5006
 
5007
  }
5008
 
5009
-
5010
-
5011
-
5012
-
5013
  function wplc_return_times_array_mrg(){
5014
  $hours = array();
5015
  for( $i = 0; $i <= 23; $i++){
@@ -5026,111 +4485,57 @@ function wplc_return_times_array_mrg(){
5026
  return $time;
5027
  }
5028
 
5029
- add_action( "wplc_hook_head", "wplc_business_hours_settings_save_mrg" );
5030
-
5031
- function wplc_business_hours_settings_save_mrg(){
5032
-
5033
- if( isset( $_POST['wplc_save_settings'] ) ){
5034
-
5035
- if( isset( $_POST['wplc_bh_enable'] ) && $_POST['wplc_bh_enable'] == '1' ){ $wplc_bh_enabled = true; } else { $wplc_bh_enabled = false; }
5036
- if( isset( $_POST['wplc_bh_interval'] ) ){ $wplc_bh_interval = sanitize_text_field( $_POST['wplc_bh_interval'] ); } else { $wplc_bh_interval = '0'; }
5037
-
5038
- if( isset( $_POST['wplc_bh_hours_start'] ) ){ $wplc_bh_hours_start = sanitize_text_field( $_POST['wplc_bh_hours_start'] ); } else { $wplc_bh_hours_start = ''; }
5039
- if( isset( $_POST['wplc_bh_minutes_start'] ) ){ $wplc_bh_minutes_start = sanitize_text_field( $_POST['wplc_bh_minutes_start'] ); } else { $wplc_bh_minutes_start = ''; }
5040
-
5041
- if( isset( $_POST['wplc_bh_hours_end'] ) ){ $wplc_bh_hours_end = sanitize_text_field( $_POST['wplc_bh_hours_end'] ); } else { $wplc_bh_hours_end = ''; }
5042
- if( isset( $_POST['wplc_bh_minutes_end'] ) ){ $wplc_bh_minutes_end = sanitize_text_field( $_POST['wplc_bh_minutes_end'] ); } else { $wplc_bh_minutes_end = ''; }
5043
-
5044
-
5045
- $wplc_bh_settings = array(
5046
- 'enabled' => $wplc_bh_enabled,
5047
- 'interval' => $wplc_bh_interval,
5048
- 'start' => array( 'h' => $wplc_bh_hours_start, 'm' => $wplc_bh_minutes_start ),
5049
- 'end' => array( 'h' => $wplc_bh_hours_end, 'm' => $wplc_bh_minutes_end ),
5050
- );
5051
-
5052
- update_option( "wplc_bh_settings", $wplc_bh_settings );
5053
-
5054
- }
5055
-
5056
- }
5057
-
5058
  function wplc_check_business_hours_mrg() {
5059
- $business_hours_enabled = true;
5060
- $wplc_bh_settings = get_option( "wplc_bh_settings" );
5061
 
5062
- if( isset( $wplc_bh_settings['enabled'] ) && $wplc_bh_settings['enabled'] ){
5063
  /**
5064
  * Enabled, check if the current day fits in the interval
5065
  */
5066
  $chat_box_interval = false;
5067
 
5068
  $current_day = current_time(date("N"));
5069
- $current_day = intval( $current_day );
5070
-
5071
- if( isset( $wplc_bh_settings['interval'] ) ){
5072
-
5073
- if( $wplc_bh_settings['interval'] == '0' ){
5074
- /**
5075
- * Show everyday
5076
- */
5077
- $chat_box_interval = true;
5078
- } else if ( $wplc_bh_settings['interval'] == '1' ){
5079
- /**
5080
- * Weekdays only
5081
- */
5082
- if( $current_day <= 5 ){
5083
- $chat_box_interval = true;
5084
- }
5085
- } else if ( $wplc_bh_settings['interval'] == '2' ){
5086
- /**
5087
- * Weekends only
5088
- */
5089
- if( $current_day == 6 || $current_day == 7 ){
5090
- $chat_box_interval = true;
5091
- }
5092
- }
5093
-
5094
- }
5095
 
5096
- if( $chat_box_interval ){
5097
- /**
5098
- * Lets check if it's the right time to show it now
5099
- */
5100
- if( isset( $wplc_bh_settings['start'] ) && isset( $wplc_bh_settings['end'] ) ){
5101
- if( isset( $wplc_bh_settings['start']['h'] ) && isset( $wplc_bh_settings['start']['m'] ) ){
5102
- $start_time = $wplc_bh_settings['start']['h'] . ":" . $wplc_bh_settings['start']['m'];
5103
- } else {
5104
- $start_time = "00:00";
5105
- }
5106
- if( isset( $wplc_bh_settings['end']['h'] ) && isset( $wplc_bh_settings['end']['m'] ) ){
5107
- $end_time = $wplc_bh_settings['end']['h'] . ":" . $wplc_bh_settings['end']['m'];
5108
- } else {
5109
- $end_time = "00:00";
5110
- }
5111
- }
5112
-
5113
- $current_date_day = date('Y-m-d', current_time('timestamp'));
5114
-
5115
- $current_time = current_time('timestamp');
5116
- $start_time = strtotime( $current_date_day.' '.$start_time );
5117
- $end_time = strtotime( $current_date_day.' '.$end_time );
5118
-
5119
- if( ( $current_time >= $start_time ) && ( $current_time <= $end_time ) ){
5120
- $business_hours_enabled = true;
5121
- } else {
5122
- $business_hours_enabled = false;
5123
- }
5124
- } else {
5125
- $business_hours_enabled = false;
5126
- }
5127
-
5128
- }
5129
-
5130
- return $business_hours_enabled;
5131
  }
5132
 
5133
-
5134
  add_filter("wplc_loggedin_filter","wplc_hook_control_business_hours_mrg",99,1);
5135
  function wplc_hook_control_business_hours_mrg($logged_in) {
5136
 
@@ -5149,12 +4554,13 @@ function wplc_hook_control_business_hours_mrg($logged_in) {
5149
  if ( ! function_exists( "wplc_active_business_hours_chat_box_notice" ) ) {
5150
  add_filter( "wplc_filter_active_chat_box_notice", "wplc_active_business_hours_chat_box_notice" );
5151
  function wplc_active_business_hours_chat_box_notice( $notice ) {
5152
- $wplc_settings = get_option( "WPLC_SETTINGS" );
5153
  if ( $wplc_settings["wplc_settings_enabled"] == 1 ) {
5154
  $is_chat_enabled = wplc_check_business_hours_mrg();
5155
  if ( ! $is_chat_enabled ) {
5156
  $notice = '<div class="wplc-chat-box-notification wplc-chat-box-notification--disabled">';
5157
- $notice .= '<p>' . sprintf( __( 'The Live Chat box is currently disabled on your website due to : <a href="%s">Business Hours Settings</a>', 'wp-livechat' ), admin_url( 'admin.php?page=wplivechat-menu-settings#wplc-business-hours' ) ) . '</p>';
 
5158
  $notice .= '</div>';
5159
  }
5160
  }
@@ -5172,9 +4578,9 @@ if ( ! function_exists( "wplc_active_business_hours_chat_box_notice" ) ) {
5172
  * @return array
5173
  */
5174
  add_filter( "wplc_get_images_to_preload", "wplc_mrg_get_images_to_preload", 10, 2);
5175
- function wplc_mrg_get_images_to_preload( $images, $wplc_acbc_data ) {
5176
- if ( isset($wplc_acbc_data) && $wplc_acbc_data['wplc_chat_pic'] ) {
5177
- array_push( $images, urldecode($wplc_acbc_data['wplc_chat_pic']) );
5178
  }
5179
  return $images;
5180
  }
@@ -5191,14 +4597,9 @@ function wplc_mrg_get_images_to_preload( $images, $wplc_acbc_data ) {
5191
  * @return string
5192
  */
5193
  add_filter( "wplc_decide_agents_name", "wplc_filter_control_decide_agents_name_mrg", 10, 2 );
5194
- function wplc_filter_control_decide_agents_name_mrg( $name, $settings ) {
5195
- if( isset( $settings['wplc_use_wp_name'] ) && $settings['wplc_use_wp_name'] == '1' ){
5196
- return $name;
5197
-
5198
- } else {
5199
- if (!empty($settings['wplc_chat_name'])) {
5200
- $name = $settings['wplc_chat_name'];
5201
- }
5202
  }
5203
  return $name;
5204
  }
@@ -5225,9 +4626,6 @@ function wplc_mrg_drag_and_drop_div_frontend($ret_msg) {
5225
  return $ret_msg;
5226
  }
5227
 
5228
-
5229
-
5230
-
5231
  /*
5232
  * Add voice notes scripts to admin side
5233
  */
@@ -5235,8 +4633,8 @@ if ( isset( $_GET['page'] ) && $_GET['page'] === 'wplivechat-menu' ) {
5235
  add_action( 'wplc_admin_remoter_dashboard_scripts_localizer', 'wplc_voice_notes_admin_javascript' );
5236
  add_action( 'wplc_hook_admin_javascript_chat', 'wplc_voice_notes_admin_javascript' );
5237
  function wplc_voice_notes_admin_javascript() {
5238
- $wplc_settings = get_option( "WPLC_SETTINGS" );
5239
- if ( isset( $wplc_settings['wplc_enable_voice_notes_on_admin'] ) && ( $wplc_settings['wplc_enable_voice_notes_on_admin'] === '1' ) ) {
5240
  wp_register_script( 'wplc-user-voice-notes-audio-recorder-wav', plugins_url( '/js/WebAudioRecorderWav.min.js', __FILE__ ), true );
5241
  wp_register_script( 'wplc-user-voice-notes-audio-recorder', plugins_url( '/js/WebAudioRecorder.min.js', __FILE__ ), true );
5242
  wp_register_script( 'wplc-user-voice-notes-audio-wave-surfer', plugins_url( '/js/wavesurfer.min.js', __FILE__ ), true );
@@ -5259,7 +4657,6 @@ if ( isset( $_GET['page'] ) && $_GET['page'] === 'wplivechat-menu' ) {
5259
  }
5260
  }
5261
 
5262
-
5263
  /*
5264
  * Add voice notes wrapper to admin remote dashboard
5265
  */
@@ -5281,8 +4678,8 @@ if ( ! function_exists( 'wplc_admin_remote_voice_notes' ) ) {
5281
  if ( ! function_exists( 'wplc_voice_notes_front_scripts' ) ) {
5282
  add_action( 'wplc_hook_push_js_to_front', 'wplc_voice_notes_front_scripts' );
5283
  function wplc_voice_notes_front_scripts() {
5284
- $wplc_settings = get_option( "WPLC_SETTINGS" );
5285
- if ( isset( $wplc_settings['wplc_enable_voice_notes_on_visitor'] ) && ( $wplc_settings['wplc_enable_voice_notes_on_visitor'] === '1' ) ) {
5286
  wp_register_script( 'wplc-visitor-voice-notes-audio-recorder-wav', plugins_url( '/js/WebAudioRecorderWav.min.js', __FILE__ ), null, '', true );
5287
  wp_register_script( 'wplc-visitor-voice-notes-audio-recorder', plugins_url( '/js/WebAudioRecorder.min.js', __FILE__ ), null, '', true );
5288
  wp_register_script( 'wplc-user-voice-notes-audio-wave-surfer', plugins_url( '/js/wavesurfer.min.js', __FILE__ ), true );
@@ -5315,162 +4712,525 @@ if ( ! function_exists( 'wplc_save_voice_notes_ajax' ) ) {
5315
  add_action( 'wp_ajax_wplc_save_voice_notes', 'wplc_save_voice_notes_ajax' );
5316
 
5317
  function wplc_save_voice_notes_ajax() {
5318
- if ( isset( $_FILES['file'] ) and ! $_FILES['file']['error'] ) {
5319
- $upload_dir = wp_upload_dir();
5320
- $base_dirname = $upload_dir['basedir'] . '/wp_live_chat/';
5321
- $base_url = $upload_dir['baseurl'] . '/wp_live_chat/';
5322
-
5323
- if ( ! file_exists( $base_dirname ) ) {
5324
- @mkdir( $base_dirname );
5325
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5326
 
5327
- $fname = preg_replace('/[^A-Za-z0-9 _ .-]/', '', $_FILES['file']['name']);
5328
- $fname = time().str_replace(" ", "_", $fname);
 
 
 
 
 
5329
 
5330
- if ( file_exists($base_dirname .$fname)) {
5331
- $fname = rand( 0, 200 ) . "-" . $fname;
 
 
 
 
 
 
 
 
 
5332
  }
5333
-
5334
- if ( move_uploaded_file( $_FILES['file']['tmp_name'], $base_dirname . $fname . '.wav')) {
5335
- echo $base_url . $fname . '.wav';
5336
- } else {
5337
- echo 0;
5338
  }
5339
  }
5340
- die();
5341
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5342
  }
5343
 
5344
  /**
5345
- * Checks if the file contains an extension which is unsafe
5346
  */
5347
- function wplc_check_file_name_for_unsafe_extension($filename){
5348
- $do_not_allowed_extensions = array(
5349
- '.ph', '.asp', '.js',
5350
- '.svg', '.html', '.css',
5351
- '.txt', '.exe', '.batch',
5352
- '.msi', '.rar', '.bin',
5353
- '.dll', '.tor', '.ini',
5354
- '.phtml', '.shtml', '.asa',
5355
- '.cer', '.asax', '.swf',
5356
- '.xap', '.sh', '.con',
5357
- '.config', '.htaccess', '.htac',
5358
- '.prn', '.aux', '.nul', '.com',
5359
- '>', '*', '<', '::', '$',
5360
- '..', '.lpt', '.tar', '.gz', '.bz',
5361
- '%2F', '%5C'
5362
- );
5363
 
5364
- $filename = strtolower($filename);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5365
 
5366
- foreach ($do_not_allowed_extensions as $key => $value) {
5367
- if(strpos($filename, $value) !== FALSE){
5368
- return true;
5369
- }
 
 
 
 
 
 
 
5370
  }
5371
- return false; //Return false, meaning no violations were found
5372
-
5373
  }
5374
 
5375
- /**
5376
- * Checks if the file contains an extension which is allowed safe
5377
  */
5378
- function wplc_check_file_name_for_safe_extension($filename){
5379
- $allowed_extensions = array(
5380
- '.jpg', '.jpeg', '.png',
5381
- '.bmp', '.mp4', '.mp3',
5382
- '.mpeg', '.mpeg4', '.gif',
5383
- '.tiff', '.tif', '.zip',
5384
- '.oog', '.webm', '.avi',
5385
- '.wav', '.doc', '.pdf'
5386
- );
 
 
 
5387
 
5388
- $filename = strtolower($filename);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5389
 
5390
- foreach ($allowed_extensions as $key => $value) {
5391
- if(strpos($filename, $value) !== FALSE){
5392
- return true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5393
  }
5394
  }
5395
- return false; //Always fail if no matches are found
5396
  }
5397
 
 
 
 
 
 
5398
 
5399
- /**
5400
- * Check the mime type if possible on this server
5401
- */
5402
- function wplc_check_file_mime_type($filepath){
5403
-
5404
- $mime = false;
5405
- if(function_exists('mime_content_type')){
5406
- $mime = mime_content_type($filepath);
5407
- } else if(class_exists('finfo')){
5408
- $result = new finfo();
5409
- if (is_resource($result) === true) {
5410
- $mime = $result->file(realpath($filepath), FILEINFO_MIME_TYPE);
5411
- }
5412
- }
5413
 
5414
- if($mime !== false){
5415
- //We have managed to pull the mime type
5416
- $allowed_mime_types = array(
5417
- 'audio/aac', 'video/x-msvideo',
5418
- 'text/csv', 'application/msword',
5419
- 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
5420
- 'image/gif', 'image/jpeg', 'application/json', 'video/mpeg',
5421
- 'image/png', 'application/pdf', 'image/tiff',
5422
- 'audio/wav', 'video/webm', 'application/zip'
5423
- );
5424
-
5425
 
5426
- if(in_array($mime, $allowed_mime_types)){
5427
- return true;
5428
- } else {
5429
- return false;
5430
- }
5431
- } else {
5432
- return false;
5433
- }
5434
  }
5435
 
5436
- /**
5437
- * Adds compatibility for start chat notifications back into the node system
5438
- */
5439
- function wplc_mrg_chat_notification_extender($data){
5440
- $wplc_acbc_data = get_option("WPLC_ACBC_SETTINGS");
5441
- if (isset($wplc_acbc_data['wplc_pro_chat_notification']) && $wplc_acbc_data['wplc_pro_chat_notification'] == "yes") {
5442
- if (isset($wplc_acbc_data['wplc_pro_chat_email_address'])) { $email_address = $wplc_acbc_data['wplc_pro_chat_email_address']; } else { $email_address = ""; }
5443
- if (!$email_address || $email_address == "") { $email_address = get_option('admin_email'); }
5444
-
5445
- $subject = sprintf( __( 'Incoming chat from %s (%s) on %s', 'wplivechat' ),
5446
- $data['name'],
5447
- $data['email'],
5448
- get_option('blogname')
5449
- );
5450
 
5451
- $msg = sprintf( __( '%s (%s) wants to chat with you. <br /><br />Log in: %s', 'wplivechat' ),
5452
- $data['name'],
5453
- $data['email'],
5454
- get_option('home')."/wp-login.php"
5455
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5456
 
5457
- wplcmail($email_address,"WP Live Chat Support", $subject, $msg);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5458
  }
 
 
 
 
 
5459
 
5460
- }
5461
- add_action('wplc_hook_initiate_chat', 'wplc_mrg_chat_notification_extender', 99, 1);
 
 
 
 
 
5462
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5463
 
5464
- /*
5465
- * registers wplc_common_node.js passing WPLC_PLUGIN_URL and WPLC_CHAT_SERVER
5466
- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5467
 
5468
- function wplc_register_common_node() {
5469
- wp_register_script('wplc-admin-js-agent-common', WPLC_PLUGIN_URL.'/js/wplc_common_node.js', null, WPLC_PLUGIN_VERSION, false);
5470
- $node_config=array(
5471
- 'baseurl'=>WPLC_PLUGIN_URL,
5472
- 'serverurl'=>WPLC_CHAT_SERVER
5473
- );
5474
- wp_localize_script( 'wplc-admin-js-agent-common', 'config', $node_config );
5475
- wp_enqueue_script('wplc-admin-js-agent-common');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5476
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  exit;
5
  }
6
 
7
+ $wplc_images='jpg|jpeg|png|gif|bmp';
8
+ $wplc_multimedia='mp4|mp3|mpeg|ogg|ogm|ogv|webm|avi|wav|mov';
9
+ $wplc_documents='doc|docx|xls|xlsx|pub|pubx|pdf|csv|txt';
10
+ //$wplc_others='zip|rar|7z|gz|tgz';
11
+ $wplc_allowed_extensions = $wplc_images.'|'.$wplc_multimedia.'|'.$wplc_documents; //.'|'.$wplc_others;
12
+
13
  function wplc_log_user_on_page($name,$email,$session, $is_mobile = false) {
14
  global $wpdb;
15
  global $wplc_tblname_chats;
16
 
 
 
 
17
  $user_data = array(
18
+ 'ip' => wplc_get_user_ip(),
19
+ 'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
20
  );
21
 
 
22
  /* user types
23
  * 1 = new
24
  * 2 = returning
80
  function wplc_update_user_on_page($cid, $status = 5,$session) {
81
  global $wpdb;
82
  global $wplc_tblname_chats;
 
 
83
 
84
  $user_data = array(
85
+ 'ip' => wplc_get_user_ip(),
86
  'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
87
  );
88
 
118
  function wplc_record_chat_msg($from, $cid, $msg, $rest_check = false, $aid = false, $other = false) {
119
  global $wpdb;
120
  global $wplc_tblname_msgs;
121
+ $wplc_settings = wplc_get_options();
122
 
123
  if( ! filter_var($cid, FILTER_VALIDATE_INT) ) {
124
 
135
  */
136
 
137
  global $wplc_tblname_chats;
138
+ $results = $wpdb->get_results(
139
+ $wpdb->prepare("SELECT * FROM $wplc_tblname_chats WHERE `rel` = %s OR `id` = %s LIMIT 1", $cid, $cid)
140
+ );
141
  if (!$results) {
142
  /* it doesnt exist, lets put it in the table */
143
 
149
  'name' => 'agent-to-agent chat',
150
  'email' => 'none',
151
  'session' => '1',
152
+ 'ip' => wplc_get_user_ip(),
153
  'url' => '',
154
  'last_active_timestamp' => current_time('mysql'),
155
  'other' => '',
183
 
184
  if ($from == "1") {
185
  $fromname = wplc_return_chat_name(sanitize_text_field($cid));
186
+ if (empty($fromname)) { $fromname = $wplc_settings['wplc_user_default_visitor_name']; }
187
  $orig = '2';
188
  }
189
  else {
222
  }
223
  }
224
 
 
 
 
 
225
  $wpdb->insert(
226
  $wplc_tblname_msgs,
227
  array(
252
  'msg' => $orig_msg,
253
  'orig' => $orig
254
  );
255
+ //do_action("wplc_hook_message_sent",$data);
256
 
257
  wplc_update_active_timestamp(sanitize_text_field($cid));
258
 
283
  global $wplc_tblname_chats;
284
 
285
  $results = $wpdb->get_results(
286
+ $wpdb->prepare("SELECT * FROM $wplc_tblname_chats WHERE `id` = %s", $cid)
 
 
 
 
287
  );
288
  foreach ($results as $result) {
289
  return $result->name;
305
  global $wplc_tblname_chats;
306
  $rel = sanitize_text_field($rel);
307
 
308
+ $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wplc_tblname_chats WHERE `rel` = %s LIMIT 1", $rel));
309
  if ($results) {
310
  foreach ($results as $result) {
311
  if (isset($result->id)) {
323
  global $wpdb;
324
  global $wplc_tblname_chats;
325
  $cid = intval($cid);
326
+ $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wplc_tblname_chats WHERE `id` = %s", $cid));
 
 
 
 
 
 
327
  foreach ($results as $result) {
328
  return $result->email;
329
  }
403
  * @return void
404
  * @since 6.0.00
405
  * @version 6.0.04 Updated to ensure those with the correct access can access this function
 
406
  */
407
  function wplc_filter_control_list_chats_actions($actions,$result,$post_data) {
408
  $aid = apply_filters("wplc_filter_aid_in_action","");
463
 
464
  // Retrieve data
465
  $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)";
466
+ $wplc_chat_sql .= apply_filters("wplc_alter_chat_list_sql_before_sorting", ""); // this one forces integers into sql, assume it's ok
467
 
468
  $wplc_chat_sql .= " ORDER BY `timestamp` ASC";
469
 
478
  unset($actions);
479
 
480
  $user_data = maybe_unserialize($result->ip);
 
481
  $browser = @wplc_return_browser_string($user_data['user_agent']);
482
  $browser_image = wplc_return_browser_image($browser,"16");
483
 
 
 
 
 
 
 
 
484
  $actions = apply_filters("wplc_filter_list_chats_actions","",$result,$post_data);
485
 
486
 
516
  }
517
 
518
  $data_array[$result->id]['data']['browser'] = "<img src='" . WPLC_PLUGIN_URL . "/images/$browser_image' alt='$browser' title='$browser' /> ";
519
+ $data_array[$result->id]['data']['ip'] = '';
520
  $data_array[$result->id]['other'] = $other_data;
521
  }
522
 
528
 
529
 
530
 
531
+ function wplc_return_user_chat_messages($cid, $wplc_settings = false, $cdata = false) {
532
+ global $wpdb;
533
+ global $wplc_tblname_msgs;
534
 
535
+ if (!$wplc_settings) {
536
+ $wplc_settings = wplc_get_options();
537
+ }
538
 
539
+ $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wplc_tblname_msgs WHERE `chat_sess_id` = '%d' AND `status` = '0' AND (`originates` = '1' OR `originates` = '0') ORDER BY `timestamp` ASC", $cid));
540
+ if (!$cdata) {
541
+ $cdata = wplc_get_chat_data($cid,__LINE__);
542
+ }
543
 
544
+ $msg_hist = array();
545
+ foreach ($results as $result) {
546
+ $system_notification = false;
547
+ $id = $result->id;
548
+ $msg = $result->msg;
549
+
550
+ if ( isset( $result->other ) ) { $other_data = maybe_unserialize( $result->other ); } else { $other_data = array(); }
551
+ if ($other_data == '') { $other_data = array(); }
552
+ $timestamp = strtotime( $result->timestamp );
553
+ $other_data['datetime'] = $timestamp;
554
+ $other_data['datetimeUTC'] = strtotime( get_gmt_from_date( $result->timestamp ) );
555
+ if (intval($result->originates) == 0) {
556
+ // system notifications from version 7
557
+ $system_notification = true;
558
  }
559
 
560
+ if (!$system_notification) {
561
+ /* this is a normal message */
562
+ if (function_exists('wplc_encrypt_decrypt_msg')) {
563
+ $msg = wplc_encrypt_decrypt_msg($msg);
564
+ }
565
 
566
+ $msg_array = maybe_unserialize($msg);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
567
 
568
+ if (is_array($msg_array)) {
569
+ $msg = $msg_array['m'];
570
+ }
571
 
572
+ $msg = stripslashes($msg);
573
+ $msg = apply_filters("wplc_filter_message_control_out",$msg);
574
+ $msg = sanitize_text_field(stripslashes($msg)); // TODO: check not optimal sanitization - check all wplc_return_user_chat_messages references too
575
 
576
+ $msg_hist[$id]['msg'] = $msg;
577
+ $msg_hist[$id]['originates'] = intval($result->originates);
578
+ $msg_hist[$id]['other'] = $other_data;
579
+ } else {
580
+ /* add the system notification to the list */
581
+ if ( isset( $msg_hist[$id] ) ) { $msg_hist[$id] = array(); }
582
+ $msg_hist[$id]['msg'] = $msg;
583
+ $msg_hist[$id]['other'] = $other_data;
584
+ $msg_hist[$id]['originates'] = intval($result->originates);
585
  }
586
+ }
587
+ return $msg_hist;
 
 
588
  }
589
 
 
 
 
 
590
  function wplc_return_no_answer_string($cid) {
591
 
592
+ $wplc_settings = wplc_get_options();
593
  if (isset($wplc_settings['wplc_user_no_answer'])) {
594
  $string = stripslashes($wplc_settings['wplc_user_no_answer']);
595
  } else {
607
  * @return string
608
  */
609
  function wplc_filter_control_no_answer_string($string,$cid) {
610
+ $string = $string. " <br /><button class='wplc_retry_chat wplc-color-bg-1 wplc-color-2' cid='".$cid."'>".__("End Chat","wplivechat")."</button>"; // Request new chat
611
  return $string;
612
  }
613
 
618
 
619
  if ($aid > 0) {
620
  /* only run when accepting a chat */
621
+ $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wplc_tblname_chats." WHERE `id` = %d LIMIT 1", $id));
622
  foreach ($results as $result) {
623
  $other = maybe_unserialize($result->other);
624
  if (isset($other['aid']) && $other['aid'] > 0) {
631
  }
632
  }
633
 
 
 
 
634
  if ($aid > 0) {
635
  $wpdb->update(
636
  $wplc_tblname_chats,
667
 
668
  //come back here
669
  function wplc_return_chat_messages($cid, $transcript = false, $html = true, $wplc_settings = false, $cdata = false, $display = 'string', $only_read_message = false) {
670
+ if (!$wplc_settings) {
671
+ $wplc_settings = wplc_get_options();
672
+ }
 
 
 
 
673
 
674
+ $results = wplc_get_chat_messages($cid, $only_read_message, $wplc_settings);
675
+ if (!$results) { return; }
676
 
677
+ if (!$cdata) {
678
+ $cdata = wplc_get_chat_data($cid,__LINE__);
679
+ }
680
 
681
+ $msg_array = array();
682
+ $msg_hist = "";
683
+ foreach ($results as $result) {
684
+ $display_notification = false;
685
+ $system_notification = false;
686
+
687
+ /* added a control here to see if we should use the NODE ID instead of the SQL ID */
688
+ if (empty($result->rel)) {
689
+ $id = $result->id;
690
+ } else {
691
+ $id = $result->rel;
692
  }
693
+ $msg = $result->msg;
 
 
 
 
 
 
 
 
694
 
695
+ if (isset($result->other)) {
696
+ $other_data = maybe_unserialize( $result->other );
697
+ } else {
698
+ $other_data = array();
699
+ }
700
+
701
+ if ($other_data == '') {
702
+ $other_data = array();
703
+ }
704
 
705
+ $timestamp = strtotime( $result->timestamp );
706
+ $other_data['datetime'] = $timestamp;
707
+ $other_data['datetimeUTC'] = strtotime( get_gmt_from_date( $result->timestamp ) );
708
+ $nice_time = date("d M Y H:i:s",$timestamp);
709
+ $agent_from = false;
710
+
711
+ if ($result->originates == 1) {
712
+ $agent_from = 'Agent';
713
+ } else if ($result->originates == 2) {
714
+ // nothing
715
+ } else if ($result->originates == 0 || $result->originates == 3) {
716
+ $system_notification = true;
717
+ $cuid = get_current_user_id();
718
+ $is_agent = get_user_meta(intval( $cuid ), 'wplc_ma_agent', true);
719
+ if ($is_agent && $result->originates == 3 ) {
720
+ /* this user is an agent and the notification is meant for an agent, therefore display it */
721
+ $display_notification = true;
722
+
723
+ /* 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) */
724
+ if (isset($_POST) && isset($_POST['action']) && sanitize_text_field( $_POST['action'] ) == "wplc_call_to_server_visitor") {
725
+ $display_notification = false;
726
  }
727
+ }
728
+ else if (!$is_agent && $result->originates == 0) {
729
+ /* this user is a not an agent and the notification is meant for a users, therefore display it */
730
+ $display_notification = true;
731
+ } else {
732
+ /* this notification is not intended for this user */
733
+ $display_notification = false;
734
+ }
735
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
736
 
737
+ if (!$system_notification) {
738
+ if (function_exists('wplc_encrypt_decrypt_msg')) {
739
+ $msg = wplc_encrypt_decrypt_msg($msg);
740
+ }
741
 
742
+ $msg = apply_filters("wplc_filter_message_control_out", $msg);
 
 
 
 
 
743
 
744
+ if (is_serialized($msg)) {
745
+ $msg_array = maybe_unserialize( $msg );
746
+ if (is_array($msg_array)) {
747
+ $msg = $msg_array['m'];
 
 
 
 
 
 
 
 
748
  }
749
+ //$msg = sanitize_text_field(stripslashes($msg));
750
+ }
751
 
752
+ if ($transcript) {
753
+ $msg = str_replace('img:', '', $msg);
754
+ $msg = str_replace(':img', '', $msg);
755
+ $msg = str_replace('video:', '', $msg);
756
+ $msg = str_replace(':video', '', $msg);
757
+ $msg = str_replace('vid:', '', $msg);
758
+ $msg = str_replace(':vid', '', $msg);
759
+ $msg = str_replace('link:', '', $msg);
760
+ $msg = str_replace(':link', '', $msg);
761
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
762
 
763
+ if (isset($result->afrom) && intval($result->afrom)>0) {
764
+ $msg_array[$id]['afrom'] = intval($result->afrom);
765
+ $other_data['aid'] = intval($result->afrom);
766
+ }
767
 
768
+ if (isset($result->ato) && intval($result->ato)>0) {
769
+ $msg_array[$id]['ato'] = intval($result->ato);
770
+ }
771
 
772
+ /* use the new "other" array to get the AID and agent name */
773
+ if ($result->originates == '1' && isset($result->other)) {
774
+ $other_data = maybe_unserialize($result->other);
775
+ if (isset($other_data['aid'])) {
776
+ $user_info = get_userdata(intval($other_data['aid']));
777
+ $agent_from = $user_info->display_name;
778
+ }
779
+ }
 
 
 
 
 
780
 
781
+ /* get the name of the USER if there is one */
782
+ if ($result->originates == '2' && isset($result->msgfrom)) {
783
+ $user_from = $result->msgfrom;
784
+ } else {
785
+ $user_from = 'User';
786
+ }
787
+
788
+ $msg_array[$id]['msg'] = $msg;
789
+
790
+ if ($agent_from !== false) {
791
+ $msg_hist .= $agent_from . ": " . $msg . "<br />";
792
+ } else {
793
+ $msg_hist .= $user_from . ": " . $msg . "<br />";
794
+ }
795
 
796
+ $msg_array[$id]['originates'] = $result->originates;
797
+ $msg_array[$id]['other'] = $other_data;
798
+ } else {
799
+ /* this is a system notification */
800
+ if ($display_notification) {
801
+ if (is_serialized($msg)) {
802
+ $tmp_array = maybe_unserialize($msg);
803
+ if (is_array($tmp_array)) {
804
+ $msg = $tmp_array['m'];
805
+ }
806
+ }
807
+ $str = "<span class='chat_time wplc-color-4'>".$nice_time."</span> <span class='wplc-system-notification wplc-color-4'>".htmlentities($msg)."</span>";
808
 
809
+ if ($transcript) {
810
+ $str = "<span class='wplc-system-notification wplc-color-4'>".htmlentities($msg)."</span><br />";
811
  }
812
 
813
+ if (!isset($msg_array[$id])) {
814
+ $msg_array[$id] = array();
815
+ }
816
 
817
+ $other_data['preformatted'] = true; // this tells html must not be escaped
818
+ $msg_array[$id]['msg'] = $str;
819
+ $msg_array[$id]['other'] = $other_data;
820
+ $msg_array[$id]['originates'] = $result->originates;
821
 
822
+ $msg_hist .= $str;
823
+ }
824
+ }
825
+ }
826
 
827
+ if ($display == 'string') {
828
+ return $msg_hist;
829
+ } else {
830
+ return $msg_array;
831
+ }
832
  }
833
 
834
 
842
  global $wpdb;
843
  global $wplc_tblname_msgs;
844
 
845
+ $results = $wpdb->get_results($wpdb->prepare("SELECT *
846
  FROM $wplc_tblname_msgs
847
+ WHERE `chat_sess_id` = %s AND `status` = '0' AND (`originates` = 1 OR `originates` = 0)
848
+ ORDER BY `timestamp` DESC", $cid));
 
849
 
850
  foreach ($results as $result) {
851
  $id = $result->id;
860
  array('%d')
861
  );
862
 
 
863
  }
864
  return "ok";
865
 
875
  global $wpdb;
876
  global $wplc_tblname_msgs;
877
 
878
+ $results = $wpdb->get_results($wpdb->prepare("SELECT *
879
  FROM $wplc_tblname_msgs
880
+ WHERE `chat_sess_id` = %s AND `ato` = %d
881
+ ORDER BY `timestamp` DESC", $cid, intval($aid)));
 
882
 
883
  foreach ($results as $result) {
884
  $id = $result->id;
893
  array('%d')
894
  );
895
 
 
896
  }
897
  return "ok";
898
 
 
899
  }
900
 
 
 
901
  function wplc_return_admin_chat_messages($cid) {
902
+ $wplc_current_user = get_current_user_id();
903
+ if (get_user_meta( $wplc_current_user, 'wplc_ma_agent', true)) {
904
+ global $wpdb;
905
+ global $wplc_tblname_msgs;
906
+ /**
907
+ * `Originates` - codes:
908
+ * 0 - System notification to be delivered to users
909
+ * 1 - Message from an agent
910
+ * 2 - Message from a user
911
+ * 3 - System notification to be delivered to agents
912
+ *
913
+ */
914
+ $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wplc_tblname_msgs WHERE `chat_sess_id` = %s AND `status` = '0' AND (`originates` = '2' OR `originates` = '3') ORDER BY `timestamp` ASC", $cid));
915
+ $msg_hist = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
916
 
917
+ foreach ($results as $result) {
918
+ $system_notification = false;
919
+ $id = $result->id;
920
+ wplc_mark_as_read_admin_chat_messages($id);
921
+ $msg = $result->msg;
922
+ if ( isset( $result->other ) ) { $other_data = maybe_unserialize( $result->other ); } else { $other_data = array(); }
923
+ if ($other_data == '') { $other_data = array(); }
924
+ $timestamp = strtotime( $result->timestamp );
925
+ $other_data['datetime'] = $timestamp;
926
+ $other_data['datetimeUTC'] = strtotime( get_gmt_from_date( $result->timestamp ) );
927
+ if (intval($result->originates) == 3) {
928
+ // system notifications from version 7
929
+ $system_notification = true;
930
+ }
931
 
932
+ if (!$system_notification) {
933
+ /* this is a normal message */
934
+ if (function_exists('wplc_encrypt_decrypt_msg')) {
935
+ $msg = wplc_encrypt_decrypt_msg($msg);
936
  }
937
 
938
+ $msg_array = maybe_unserialize( $msg );
 
939
 
940
+ if (is_array( $msg_array)) {
941
+ $msg = $msg_array['m'];
942
+ }
943
+ $msg = stripslashes($msg);
944
+ $msg = apply_filters("wplc_filter_message_control_out",$msg);
945
+ $msg = sanitize_text_field(stripslashes($msg)); // TODO: check not optimal sanitization - check all wplc_return_admin_chat_messages references too
946
 
947
+ $msg_hist[$id]['msg'] = $msg;
948
+ $msg_hist[$id]['originates'] = intval($result->originates);
949
+ $msg_hist[$id]['other'] = $other_data;
950
 
951
+ } else {
952
+ /* add the system notification to the list */
953
+ if ( isset( $msg_hist[$id] ) ) { $msg_hist[$id] = array(); }
954
+ $msg_hist[$id]['msg'] = $msg;
955
+ $msg_hist[$id]['other'] = $other_data;
956
+ $msg_hist[$id]['originates'] = intval($result->originates);
957
+ }
958
  }
959
+ return $msg_hist;
960
+ } else {
961
+ return "security issue";
962
+ }
963
  }
964
 
965
  /**
997
  function wplc_return_chat_session_variable($cid) {
998
  global $wpdb;
999
  global $wplc_tblname_chats;
1000
+ $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wplc_tblname_chats WHERE `id` = %d", $cid));
 
 
 
 
 
 
1001
  foreach ($results as $result) {
1002
  return $result->session;
1003
  }
1012
  function wplc_return_chat_status($cid) {
1013
  global $wpdb;
1014
  global $wplc_tblname_chats;
1015
+ $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wplc_tblname_chats WHERE `id` = %s", $cid));
 
 
 
 
 
 
1016
  foreach ($results as $result) {
1017
  return intval($result->status);
1018
  }
1019
  }
1020
 
 
1021
  function wplc_return_status($status) {
1022
  if ($status == 1) {
1023
  return __("complete","wplivechat");
1048
 
1049
  add_filter("wplc_filter_mail_body","wplc_filter_control_mail_body",10,2);
1050
  function wplc_filter_control_mail_body($header,$msg) {
1051
+ $primary_bg_color = apply_filters("wplc_mailer_bg_color", "#0596d4"); //Default orange
1052
  $body = '
1053
  <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">
1054
  <html>
1117
 
1118
  add_filter("wplc_mailer_bg_color","wplc_fitler_mailer_bg_color",10,1);
1119
  function wplc_fitler_mailer_bg_color($default_color) {
1120
+ $wplc_settings = wplc_get_options();
1121
+ $wplc_theme = wplc_get_theme();
1122
+
1123
+ if($wplc_theme == 'theme-1') {
1124
+ $default_color = "#DB0000";
1125
+ } else if ($wplc_theme == 'theme-2'){
1126
+ $default_color = "#000000";
1127
+ } else if ($wplc_theme == 'theme-3'){
1128
+ $default_color = "#B97B9D";
1129
+ } else if ($wplc_theme == 'theme-4'){
1130
+ $default_color = "#1A14DB";
1131
+ } else if ($wplc_theme == 'theme-5'){
1132
+ $default_color = "#3DCC13";
1133
+ } else if ($wplc_theme == 'theme-6'){
1134
+ //Check what color is selected in palette
1135
+ if (isset($wplc_settings["wplc_settings_color1"])) {
1136
+ $default_color = "#" . $wplc_settings["wplc_settings_color1"];
 
 
 
 
 
1137
  }
1138
  }
 
1139
  return $default_color;
1140
  }
1141
 
1149
  * @since 5.1.00
1150
  */
1151
  function wplcmail($reply_to,$reply_to_name,$subject,$msg) {
1152
+ $wplc_settings = wplc_get_options();
1153
+ if (isset($wplc_settings['wplc_pro_chat_email_address'])) {
1154
+ $email_address = $wplc_settings['wplc_pro_chat_email_address'];
1155
+ } else {
1156
+ $email_address = get_option('admin_email');
1157
+ }
1158
+ $email_address = explode(',', $email_address);
1159
+ $headers[] = 'Content-type: text/html';
1160
+ $headers[] = 'Reply-To: '.$reply_to_name.'<'.$reply_to.'>';
1161
+ if ($email_address) {
1162
+ foreach($email_address as $email) {
1163
+ /* Send offline message to each email address */
1164
+ $overbody = apply_filters("wplc_filter_mail_body",$subject,$msg);
1165
+ if (!wp_mail($email, $subject, $overbody, $headers)) {
1166
+ $error = date("Y-m-d H:i:s") . " WP-Mail Failed to send \n";
1167
+ error_log($error);
1168
+ }
 
 
 
 
 
 
1169
  }
1170
+ }
1171
+ return;
 
1172
  }
1173
+
1174
  /**
1175
  * Sends offline messages to the admin (normally via ajax)
1176
  * @param string $name Name of the user
1180
  * @return void
1181
  */
1182
  function wplc_send_offline_msg($name,$email,$msg,$cid) {
1183
+ $subject = apply_filters("wplc_offline_message_subject_filter", __("WP Live Chat by 3CX - Offline Message from ", "wplivechat") );
1184
  $msg = __("Name", "wplivechat").": $name \n".
1185
  __("Email", "wplivechat").": $email\n".
1186
  __("Message", "wplivechat").": $msg\n\n".
1187
+ __("Via WP Live Chat by 3CX", "wplivechat");
1188
  wplcmail($email,$name, $subject, $msg);
1189
  return;
1190
  }
1202
  global $wpdb;
1203
  global $wplc_tblname_offline_msgs;
1204
 
 
 
 
 
 
1205
  $ins_array = array(
1206
  'timestamp' => current_time('mysql'),
1207
  'name' => sanitize_text_field($name),
1208
  'email' => sanitize_email($email),
1209
  'message' => implode( "\n", array_map( 'sanitize_text_field', explode( "\n", $message ) ) ),
1210
+ 'ip' => wplc_get_user_ip(),
1211
  'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
1212
  );
1213
 
1222
  global $wpdb;
1223
  global $wplc_tblname_chats;
1224
 
 
 
 
1225
  $user_data = array(
1226
+ 'ip' => wplc_get_user_ip(),
1227
  'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
1228
  );
1229
  $wplc_ce_ip = null;
1458
 
1459
  global $wpdb;
1460
  global $wplc_tblname_chats;
1461
+
1462
+ $delete_missed_chats_nonce = wp_create_nonce('delete_missed_chats');
1463
 
1464
  if (isset($_GET['wplc_action']) && $_GET['wplc_action'] == 'remove_missed_cid') {
1465
  if (isset($_GET['cid'])) {
1466
+ $cid = "";
1467
+ if (!empty($_GET['cid'])) {
 
 
 
 
1468
  $cid = intval($_GET['cid']);
1469
+ }
1470
+
1471
+ if (isset($_GET['wplc_confirm']) && isset($_GET['nonce'])) {
1472
+
1473
+ $nonce = $_GET['nonce'];
1474
+
1475
+ if ( wp_verify_nonce( $nonce, 'delete_missed_chats' ) ) {
1476
+ //Confirmed - delete
1477
+ $delete_sql = "";
1478
+ if (empty($_GET['cid'])) {
1479
+ exit('No CID?');
1480
+ }
1481
+ $cid = intval($_GET['cid']);
1482
+ $delete_sql = "DELETE FROM $wplc_tblname_chats WHERE `id` = '%d' LIMIT 1";
1483
+ $delete_sql = $wpdb->prepare($delete_sql, $cid);
1484
+ $wpdb->query($delete_sql);
1485
+ if ($wpdb->last_error) {
1486
+ echo "<div class='update-nag' style='margin-top: 0px;margin-bottom: 5px;'>".__("Error: Could not delete chat", "wplivechat")."<br></div>";
1487
+ } else {
1488
+ echo "<div class='update-nag' style='margin-top: 0px;margin-bottom: 5px;border-color:#67d552;'>".__("Chat Deleted", "wplivechat")."<br></div>";
1489
+ }
1490
+ }else {
1491
+ wp_die(__("You do not have permission do perform this action", "wplivechat"));
1492
+ }
1493
+
1494
+
1495
  } else {
1496
  //Prompt
1497
  echo "<div class='update-nag' style='margin-top: 0px;margin-bottom: 5px;'>".__("Are you sure you would like to delete this chat?", "wplivechat")."<br>
1498
+ <a class='button' href='?page=wplivechat-menu-missed-chats&wplc_action=remove_missed_cid&cid=".$cid."&wplc_confirm=1&nonce=".$delete_missed_chats_nonce."'>".__("Yes", "wplivechat")."</a> <a class='button' href='?page=wplivechat-menu-missed-chats'>".__("No", "wplivechat")."</a>
1499
  </div>";
1500
  }
1501
  }
1519
  $total = $wpdb->get_var( "SELECT COUNT(`id`) FROM $wplc_tblname_chats WHERE `status` = 0" );
1520
  $num_of_pages = ceil( $total / $limit );
1521
 
1522
+ $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wplc_tblname_chats WHERE `status` = 0 ORDER BY `timestamp` DESC LIMIT %d OFFSET %d", $limit, $offset));
 
 
1523
 
1524
  if (!$results) {
1525
  echo "<tr><td></td><td>" . __("You have not missed any chat requests.", "wplivechat") . "</td></tr>";
1533
 
1534
  echo "<tr id=\"record_" . intval($result->id) . "\">";
1535
  echo "<td class='chat_id column-chat_d'>" . sanitize_text_field($result->timestamp) . "</td>";
1536
+ echo "<td class='chat_name column_chat_name' id='chat_name_" . intval($result->id) . "'><img src=\"//www.gravatar.com/avatar/" . md5($result->email) . "?s=30&d=mm\" class='wplc-user-message-avatar' align=\"absmiddle\"/> " . sanitize_text_field($result->name) . "</td>";
1537
  echo "<td class='chat_email column_chat_email' id='chat_email_" . intval($result->id) . "'><a href='mailto:" . sanitize_text_field($result->email) . "' title='Email " . ".$result->email." . "'>" . sanitize_text_field($result->email) . "</a></td>";
1538
  echo "<td class='chat_name column_chat_url' id='chat_url_" . intval($result->id) . "'>" . esc_url($result->url) . "</td>";
1539
  echo "<td class='chat_name column_chat_url'>".$actions."</td>";
1546
  $page_links = paginate_links(array(
1547
  'base' => add_query_arg( 'pagenum', '%#%' ),
1548
  'format' => '',
1549
+ 'prev_text' => '&laquo;',
1550
+ 'next_text' => '&raquo;',
1551
  'total' => $num_of_pages,
1552
  'current' => $pagenum
1553
  ));
1597
 
1598
  function wplc_return_animations(){
1599
 
1600
+ $wplc_settings = wplc_get_options();
1601
 
1602
  if ($wplc_settings["wplc_settings_align"] == 1) {
1603
  $original_pos = "bottom_left";
1720
 
1721
 
1722
  add_action("wplc_advanced_settings_above_performance", "wplc_advanced_settings_above_performance_control", 10, 1);
1723
+ function wplc_advanced_settings_above_performance_control($wplc_settings) {
1724
+ echo "<tr>
1725
+ <td width='350'>
1726
+ ".__("Open chat window via", "wplivechat").":
1727
+ </td>
1728
+ <td>
1729
+ <select name='wplc_elem_trigger_action'>
1730
+ <option value='0' ".($wplc_settings['wplc_elem_trigger_action'] == 0 ? "selected" : "").">".__("Click", "wplivechat")."</option>
1731
+ <option value='1' ".($wplc_settings['wplc_elem_trigger_action'] == 1 ? "selected" : "").">".__("Hover", "wplivechat")."</option>
1732
+ </select>
1733
+ ".__("element with", "wplivechat").":
1734
+ <select name='wplc_elem_trigger_type'>
1735
+ <option value='0' ".($wplc_settings['wplc_elem_trigger_type'] == 0 ? "selected" : "").">".__("Class", "wplivechat")."</option>
1736
+ <option value='1' ".($wplc_settings['wplc_elem_trigger_type'] == 1 ? "selected" : "").">".__("ID", "wplivechat")."</option>
1737
+ </select>
1738
+ <input type='text' name='wplc_elem_trigger_id' value='".htmlentities($wplc_settings['wplc_elem_trigger_id'])."'>
1739
+ </td>
1740
+ </tr>";
 
 
 
 
 
1741
  }
1742
 
1743
  /**
1747
  global $wpdb;
1748
  global $wplc_tblname_chats;
1749
 
1750
+ $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wplc_tblname_chats WHERE `id` = %s LIMIT 1", $cid));
1751
  if ($results) {
1752
  foreach ($results as $result) {
1753
  if (isset($result->rel)) {
1774
  }
1775
 
1776
  function wplc_get_avatar($id) {
1777
+ $wplc_settings = wplc_get_options();
1778
  $user = get_user_by( 'id', $id );
1779
+ if ($wplc_settings['wplc_avatar_source'] == 'gravatar') {
 
1780
  return '//www.gravatar.com/avatar/' . md5( strtolower( trim( $user->data->user_email ) ) );
1781
+ } elseif ($wplc_settings['wplc_avatar_source'] == 'wp_avatar') {
1782
  if (function_exists('get_wp_user_avatar')) {
1783
  return get_wp_user_avatar_src($id);
1784
  } else {
1789
  }
1790
  }
1791
 
1792
+ function wplc_get_admin_picture() {
1793
+ $wplc_settings = wplc_get_options();
1794
+ if ($wplc_settings['wplc_chat_pic']) {
1795
+ return urldecode($wplc_settings['wplc_chat_pic']);
1796
+ }
1797
  }
1798
 
 
1799
  /**
1800
+ * Decides whether or not to show the chat box based on the include/exclude pages in the settings page
1801
  * @return [type] [description]
1802
  */
1803
+ function wplc_display_chat_contents() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1804
 
1805
+ if (in_array($GLOBALS['pagenow'], array('wp-login.php', 'wp-register.php'))) {
1806
+ return false;
1807
+ }
 
 
 
 
 
1808
 
1809
+ $wplc_settings = wplc_get_options();
1810
+ $display_contents = true;
1811
 
1812
+ $post_id = get_the_ID();
1813
+ if (!$post_id || $post_id === NULL) {
1814
+ $url = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
1815
+ $post_id = url_to_postid($url);
1816
+ }
1817
 
1818
+ if (!empty($wplc_settings['wplc_include_on_pages']) || !empty($wplc_settings['wplc_exclude_from_pages'])) {
1819
+ if (!empty($wplc_settings['wplc_include_on_pages'])) {
1820
+ $include_on_pages = explode(',', $wplc_settings['wplc_include_on_pages']);
1821
+ foreach($include_on_pages as $key => $val) {
1822
+ $include_on_pages[$key] = intval($val);
1823
+ }
1824
+ $include_array = array();
1825
+ foreach($include_on_pages as $page){
1826
+ $include_array [intval($page)] = intval($page);
1827
+ }
1828
+ if (!isset($include_array[$post_id])) {
1829
+ $display_contents = false;
1830
+ }
1831
  } else {
1832
+ /* Exclude from the following pages */
1833
+ $exclude_from_pages = explode(',', $wplc_settings['wplc_exclude_from_pages']);
1834
+ $exclude_array = array();
1835
+ foreach($exclude_from_pages as $page) {
1836
+ $exclude_array[$page] = intval($page);
1837
+ }
1838
+ $exclude_from_page = array_search($post_id, $exclude_array);
1839
+ if ($exclude_from_page !== false) {
1840
+ $display_contents = false;
1841
+ }
1842
+ }
1843
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1844
 
1845
+ if ($wplc_settings['wplc_exclude_home'] && (is_home() || is_front_page() || $_SERVER['REQUEST_URI'] == '/')) {
1846
+ $display_contents = false;
1847
+ }
 
 
 
 
 
1848
 
1849
+ if ($wplc_settings['wplc_exclude_archive'] && is_archive()) {
1850
+ $display_contents = false;
1851
+ }
1852
 
1853
+ if (!empty($wplc_settings['wplc_exclude_post_types'] ) && in_array( get_post_type($post_id), $wplc_settings['wplc_exclude_post_types'] ) ) {
1854
+ $display_contents = false;
1855
+ }
1856
 
1857
+ return $display_contents;
1858
  }
1859
 
1860
  add_action("admin_init","wplc_control_logged_in_mrg");
1934
  $sql = " SHOW COLUMNS FROM {$wpdb->prefix}wplc_chat_sessions WHERE `Field` = 'agent_id'";
1935
  $results = $wpdb->get_results($sql);
1936
  if (!$results) {
 
 
 
 
 
 
 
 
1937
  $sql = "ALTER TABLE {$wpdb->prefix}wplc_chat_sessions ADD `agent_id` INT(11) NOT NULL ;";
1938
  $wpdb->query($sql);
1939
  }
2019
  );
2020
  $args = array(
2021
  'labels' => $labels,
2022
+ 'description' => __('Quick Responses for WP Live Chat by 3CX', 'wplivechat'),
2023
  'public' => false,
2024
  'menu_position' => 80,
2025
  'show_in_nav_menus' => true,
2044
  ),
2045
  'register_meta_box_cb' => 'wplc_add_quick_response_metaboxes_mrg'
2046
  );
2047
+
2048
+ if ( current_user_can( 'manage_options' ) ) {
2049
+ register_post_type('wplc_quick_response', $args);
2050
+ }
2051
+
2052
  }
2053
 
2054
  add_action( 'add_meta_boxes', 'wplc_add_quick_response_metaboxes_mrg' );
2130
  add_action("wplc_hook_admin_below_chat_box","wplc_hook_control_admin_below_chat_box",1,1);
2131
  function wplc_hook_control_admin_below_chat_box($result) {
2132
  if ($result->status == 3) {
2133
+ $wplc_settings = wplc_get_options();
2134
  $wplc_quick_response_order_by = isset( $wplc_settings['wplc_quick_response_orderby'] ) ? sanitize_text_field( $wplc_settings['wplc_quick_response_orderby'] ) : 'title';
2135
  $wplc_quick_response_order = isset( $wplc_settings['wplc_quick_response_order'] ) ? sanitize_text_field( $wplc_settings['wplc_quick_response_order'] ) : 'DESC';
2136
  echo "<div class='admin_chat_quick_controls'>";
2137
+ echo " <p style=\"text-align:left; font-size:11px;\">".__("Press ENTER to send your message","wplivechat")."</p>";
2138
+ echo "<div class='wplc_on_premise_chat_quick_response'";
2139
  echo wplc_return_macros_mrg( 0, $wplc_quick_response_order_by, $wplc_quick_response_order );
2140
  echo " </div>";
2141
+ echo " </div>";
2142
  echo "</div>";
2143
  }
2144
 
2184
 
2185
  foreach ($posts_array as $post) {
2186
 
2187
+ $msg .= " <option value='" . $post->ID . "'>" . esc_html($post->post_title) . "</option>";
2188
  }
2189
+ $msg .= " </select> <small><a href='https://www.3cx.com/wp-live-chat/docs/quick-responses/' title='What are quick responses?' target='_BLANK'>" . __("What is this?", "wplivechat") . "</a></small>";
2190
  $msg .= " </td>";
2191
  $msg .= "</tr></table>";
2192
  return $msg;
2193
  }
2194
 
2195
+ add_filter("wplc_filter_microicon","wplc_acbc_filter_control_microicon",10,1);
2196
+ function wplc_acbc_filter_control_microicon($ret_msg) {
2197
+ $wplc_settings = wplc_get_options();
2198
+ if (!empty($wplc_settings['wplc_chat_pic'])) {
2199
+ /* overwrite the $ret_msg variable */
2200
+ $ret_msg = "<div class='wplc_left_logo' style='background:url(".urldecode($wplc_settings['wplc_chat_pic']).") no-repeat; background-size: cover;'></div>";
2201
+ }
2202
+ return $ret_msg;
 
 
 
 
 
 
 
 
 
2203
  }
2204
 
2205
  if (!function_exists("wplc_acbc_filter_control_chaticon")) {
2206
  add_filter("wplc_filter_chaticon","wplc_acbc_filter_control_chaticon",10,1);
2207
  function wplc_acbc_filter_control_chaticon($icon) {
2208
+ $wplc_settings = wplc_get_options();
2209
+ if (!empty($wplc_settings['wplc_chat_icon'])) {
2210
+ $icon = urldecode($wplc_settings['wplc_chat_icon']);
 
2211
  }
2212
  return $icon;
 
2213
  }
2214
  }
2215
+
2216
+ function wplc_determine_admin_email($wplc_settings) {
2217
+ $email_address = "";
2218
+ if (!empty($wplc_settings['wplc_pro_chat_email_address'])) { $email_address = $wplc_settings['wplc_pro_chat_email_address']; }
2219
+ if (empty($email_address)) { $email_address = get_option('admin_email'); }
2220
+ return $email_address;
2221
+ }
2222
+
2223
  /**
2224
  * Notify the admin that someone wants to chat
2225
  * @param array $array CID, Name, Email
2226
  * @return bool
2227
  */
2228
  function wplc_mrg_notify_via_email($data) {
2229
+ $wplc_settings = wplc_get_options();
2230
+ if ($wplc_settings['wplc_pro_chat_notification']) {
 
 
 
2231
  $subject = sprintf( __( 'Incoming chat from %s (%s) on %s', 'wplivechat' ),
2232
  $data['name'],
2233
  $data['email'],
2234
  get_option('blogname')
2235
+ );
2236
+
2237
+ $msg=sprintf( __( '%s (%s) wants to chat with you.', 'wplivechat' ),
2238
  $data['name'],
2239
+ $data['email']
2240
+ ).'<br/><br/>';
2241
+
2242
+ $msg.=sprintf( __('Log in: %s', 'wplivechat' ),
2243
  wp_login_url()
2244
  );
2245
+ wplcmail(wplc_determine_admin_email($wplc_settings), "WP Live Chat by 3CX", $subject, $msg);
 
2246
  }
2247
  return true;
2248
  }
2249
 
 
2250
  if (!function_exists("wplc_acbc_admin_scripts")) {
2251
  add_action('admin_print_scripts', 'wplc_acbc_admin_scripts');
2252
  function wplc_acbc_admin_scripts() {
2260
  }
2261
  }
2262
 
2263
+ add_action("wplc_hook_push_js_to_front","wplc_acbc_hook_control_push_js_to_front");
2264
+ function wplc_acbc_hook_control_push_js_to_front() {
2265
+ $wplc_settings = wplc_get_options();
2266
 
2267
+ $wpc_misc_js_strings = array(
2268
+ 'typing_enabled' => $wplc_settings['wplc_typing_enabled'],
2269
+ 'wplc_delay' => intval($wplc_settings['wplc_chat_delay'])*1000
2270
+ );
2271
+ if ($wplc_settings['wplc_typing_enabled']) {
2272
+ $wpc_misc_js_strings['typingimg'] = plugins_url('/images/comment.svg', __FILE__);
2273
+ }
2274
+ wp_localize_script('wplc-user-script', 'wplc_misc_strings', $wpc_misc_js_strings);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2275
 
2276
+ if ($wplc_settings['wplc_use_node_server']) {
2277
+ wp_register_script('wplc-user-pro-events-script', plugins_url('/js/wplc_u_node_pro_events.js', __FILE__), array('jquery', 'wplc-server-script'), WPLC_PLUGIN_VERSION);
2278
+ wp_register_script('tcx-action-script', plugins_url('/js/tcx_action_events.js', __FILE__), false, WPLC_PLUGIN_VERSION);
2279
+ wp_enqueue_script('tcx-action-script');
2280
+ } else {
2281
+ /* not using the node server, load traditional event handler JS */
2282
+ wp_register_script('wplc-user-pro-events-script', plugins_url('/js/wplc_u_pro_events.js', __FILE__), array('jquery', 'wplc-server-script'), WPLC_PLUGIN_VERSION);
2283
+ }
2284
 
2285
+ wp_register_script('wplc-user-pro-features', plugins_url('/js/wplc_pro_features.js', __FILE__), array('wplc-user-script'), false, false);
2286
+ wp_enqueue_script( 'wplc-user-pro-features' );
2287
+ wp_enqueue_script( 'wplc-user-pro-events-script' );
2288
 
2289
+ wp_register_script('wplc-user-pro-editor', plugins_url('/js/wplc_u_editor.js', __FILE__), array('wplc-user-script', 'jquery'), false, false);
2290
+ wp_enqueue_script('wplc-user-pro-editor');
 
2291
 
2292
+ if (!empty($wplc_settings["wplc_pro_auto_first_response_chat_msg"])) {
2293
+ wp_localize_script('wplc-user-pro-features', 'wplc_pro_auto_resp_chat_msg', strval(apply_filters('wplc_pro_auto_first_response_chat_msg_filter', strval($wplc_settings["wplc_pro_auto_first_response_chat_msg"]))));
2294
+ }
2295
 
2296
+ wp_enqueue_style('wplc-user-pro-styles', plugins_url('/css/wplc_styles_pro.css', __FILE__));
 
 
 
 
 
 
 
2297
 
2298
+ $post_id = get_the_ID();
2299
+ if (!$post_id || $post_id === NULL) {
2300
+ $url = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
2301
+ $post_id = url_to_postid($url);
2302
+ }
2303
+ if (wplc_check_trigger_filters_mrg($post_id)) {
2304
+ wplc_tirggers_enqueue_user_styles_scripts(wplc_check_trigger_filters_mrg($post_id));
2305
+ }
2306
  }
2307
 
2308
  /**
2319
  }
2320
 
2321
 
2322
+ add_filter("wplc_filter_live_chat_box_above_main_div","wplc_acbc_filter_control_live_chat_box_above_main_div");
2323
+ function wplc_acbc_filter_control_live_chat_box_above_main_div($ret_msg) {
2324
+ $wplc_settings = wplc_get_options();
2325
+ if (!empty($wplc_settings['wplc_chat_logo'])) {
2326
+ $ret_msg .= "<div id=\"wplc_logo\">";
2327
+ $ret_msg .= " <img class=\"wplc_logo_class\" src=\"".urldecode(sanitize_text_field(stripslashes($wplc_settings['wplc_chat_logo'])))."\" style=\"display:block; margin-bottom:5px; margin-left:auto; margin-right:auto;\" alt=\"".get_bloginfo('name')."\" title=\"".get_bloginfo('name')."\" />";
2328
+ $ret_msg .= "</div>";
2329
+ }
2330
+ return $ret_msg;
2331
+ }
2332
+
2333
+ add_filter("wplc_filter_chat_header_under","wplc_acbc_filter_control_chat_header_under");
2334
+ function wplc_acbc_filter_control_chat_header_under($ret_msg) {
2335
+ $wplc_settings = wplc_get_options();
2336
+ if ($wplc_settings['wplc_chat_pic']) {
2337
+ $ret_msg .= "<div id=\"wp-live-chat-image\">";
2338
+ $ret_msg .= "<div id=\"wp-live-chat-inner-image-div\">";
2339
+ $ret_msg .= "<img src=\"".urldecode(esc_url($wplc_settings['wplc_chat_pic']))."\" width=\"40px\"/>";
2340
+ $ret_msg .= "</div>";
2341
+ $ret_msg .= "</div>";
2342
+ }
2343
+ return $ret_msg;
 
 
 
 
 
 
 
2344
  }
2345
 
 
 
2346
  /**
2347
  * Check if this is the first time the user has run the plugin. If yes, set the default settings
2348
  * @since 1.0.2
2349
  * @return string
 
2350
  */
2351
+ add_filter("wplc_filter_admin_name","wplc_acbc_filter_admin_name");
2352
+ function wplc_acbc_filter_admin_name($fromname) {
2353
+ $wplc_settings = wplc_get_options();
2354
+ if (!empty($wplc_settings['wplc_chat_name'])) {
2355
+ $fromname = esc_html($wplc_settings['wplc_chat_name']);
2356
+ }
2357
+ return $fromname;
 
 
 
 
 
2358
  }
2359
 
 
 
2360
  add_filter( "wplc_admin_dashboard_layout_node_request_variable_filter", "wplc_admin_mrg_filter_control_dashboard_layout_node_request_variable_filter", 10, 1);
2361
  function wplc_admin_mrg_filter_control_dashboard_layout_node_request_variable_filter( $form_data ) {
2362
+ $wplc_settings = wplc_get_options();
2363
+ $form_data['choose'] = $wplc_settings['wplc_allow_agents_set_status'];
2364
  return $form_data;
2365
  }
2366
 
 
 
2367
  /**
2368
  * Display the switchery button at the top of the chat dashboard
2369
  * @return void
2370
  * @since 1.0.00
 
2371
  */
2372
+ add_action("wplc_hook_chat_dashboard_above","wplc_choose_hook_control_chat_dashboard_above");
2373
+ function wplc_choose_hook_control_chat_dashboard_above() {
2374
+ $wplc_settings = wplc_get_options();
2375
+ if (!$wplc_settings['wplc_allow_agents_set_status']) {
2376
+ return;
2377
+ }
2378
+ $status = wplc_get_agent_status(get_current_user_id());
2379
+ ?>
2380
+ <div class="wplc_admin_chat_switchery_a">
2381
+ <input type="checkbox" class="wplc_switchery" name="wplc_agent_status" id="wplc_agent_status" <?php if ($status) { echo 'checked'; } ?> />
2382
+ <div id="wplc_agent_status_text"></div>
2383
+ </div>
2384
+ <?php
 
 
 
2385
  }
2386
 
 
 
2387
  /**
2388
  * Latch onto the set transient filter and decide to show the agent online or not.
2389
  * @param bool $set_transient Should we set the transient or not?
2390
  * @return bool
2391
  * @since 1.0.00
 
2392
  */
2393
+ add_filter("wplc_filter_control_set_transient","wplc_choose_filter_control_set_set_transient",10,1);
2394
+ function wplc_choose_filter_control_set_set_transient($set_transient) {
2395
+ return wplc_get_agent_status(get_current_user_id());
 
 
 
 
 
 
 
 
 
 
2396
  }
2397
 
 
 
2398
  /**
2399
  * Latch onto the loggedin filter and set to true if any agent has selected that they can take chats.
2400
  * @param bool $logged_in Is the agent logged in and available?
2401
  * @return bool
2402
  * @since 1.0.01
 
2403
  */
2404
+ add_filter("wplc_final_loggedin_control","wplc_choose_final_loggedin_control",10,2);
2405
+ function wplc_choose_final_loggedin_control($logged_in,$logged_in_via_app) {
2406
+ /* get actuall logged in users and create an array to check with below */
2407
+ add_action('pre_get_users', 'wplc_advanced_access_manager_compatibility_mrg', 1000);
2408
+ $users = get_users(array('meta_key'=> 'wplc_chat_agent_online'));
2409
+ $one_logged_in = false;
2410
+
2411
+ foreach ($users as $wplc_user) {
2412
+ $check = get_user_meta($wplc_user->ID,"wplc_chat_agent_online");
2413
+ $logged_in = false;
2414
+ if (!empty($check)) {
2415
+ $last_logged_in_time = $check[0];
2416
+ if ($last_logged_in_time > 0) {
2417
+ if ((time() - $last_logged_in_time) < 70) {
2418
+ $logged_in = true;
2419
+ $one_logged_in = true;
2420
+ }
2421
+ }
2422
+ }
2423
+ if (!$logged_in) {
2424
+ wplc_set_agent_status($wplc_user->ID, false);
2425
+ }
2426
+ }
2427
+ return $one_logged_in;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2428
  }
2429
 
2430
  /**
2435
  function wplc_choose_hook_control_action_callback() {
2436
 
2437
  if ($_POST['action'] == 'wplc_choose_accepting') {
 
 
 
 
 
2438
  $user_id = get_current_user_id();
2439
+ wplc_set_agent_status($user_id, true);
2440
  do_action("wplc_hook_set_transient");
2441
  echo "done";
2442
  }
2443
 
2444
  if ($_POST['action'] == 'wplc_choose_not_accepting') {
 
2445
  $user_id = get_current_user_id();
2446
+ wplc_set_agent_status($user_id, false);
2447
+ delete_user_meta($user_id, "wplc_chat_agent_online");
 
2448
  delete_transient('wplc_is_admin_logged_in');
2449
  echo "done";
2450
  }
2451
 
2452
  if ($_POST['action'] == "wplc_typing") {
2453
  if (isset($_POST['cid']) && isset($_POST['user']) && isset($_POST['type'])) {
2454
+ if((wplc_ic_check_if_user_is_agent() === "not_user_agent" && wplc_check_user_request($_POST['cid'])) || (wplc_ic_check_if_user_is_agent() !== "not_user_agent")){
2455
+ echo wplc_typing_mrg(sanitize_text_field($_POST['user']), intval($_POST['cid']), sanitize_text_field($_POST['type']));
2456
+ }
2457
  }
2458
  }
2459
 
2461
  $upload_dir = wp_upload_dir();
2462
  $user_dirname = $upload_dir['basedir'];
2463
  $cid=0;
2464
+ $u_id_check=0;
2465
  if (isset($_POST['cid'])) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2466
 
2467
+ if(wplc_ic_check_if_user_is_agent() === "not_user_agent") {
2468
+ if(wplc_check_user_request($_POST['cid'])){
2469
+ $u_id_check = 1;
2470
+ }
2471
+ }else {
2472
+ $u_id_check = 1;
2473
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2474
 
2475
+ if($u_id_check === 1){
2476
+ $cid = sanitize_text_field($_POST['cid']);
2477
+ if( ! filter_var($cid, FILTER_VALIDATE_INT) ) {
2478
+ /* We need to identify if this CID is a node CID, and if so, return the WP CID */
2479
+ $cid = wplc_return_chat_id_by_rel($cid);
2480
+ }
2481
 
2482
+ $cid = intval($cid);
2483
+
2484
+
2485
+ if( !file_exists( $user_dirname."/wp_live_chat/")) {
2486
+ @mkdir($user_dirname.'/wp_live_chat/');
2487
+ }
2488
+
2489
+ if (!realpath($user_dirname."/wp_live_chat/" . $cid)) {
2490
+ @mkdir( $user_dirname.'/wp_live_chat/'. $cid );
2491
+ }
2492
+
2493
+ if (isset($_FILES['file']) && isset($_POST['timestamp'])) {
2494
+ $file_name = strtolower( sanitize_file_name($_FILES['file']['name']) );
2495
+ $file_name = basename($file_name); //This prevents traversal
2496
+ if (wplc_check_file_name_for_safe_extension($file_name) && wplc_check_file_mime_type($_FILES['file']['tmp_name'])) {
2497
+ $upload_file_name = $file_name;
2498
+ while (file_exists($user_dirname . "/wp_live_chat/" . $cid . "/" . $upload_file_name)) {
2499
+ $upload_file_name = substr($file_name,0,strrpos($file_name, '.')).mt_rand(1000,9999).substr($file_name,strrpos($file_name, '.'));
2500
+ }
2501
+ if (move_uploaded_file($_FILES['file']['tmp_name'], $user_dirname."/wp_live_chat/" . $cid . "/" . $upload_file_name)) {
2502
+ //File has been uploaded, let's now go ahead and check the mime type
2503
+ $response = $upload_dir['baseurl']."/wp_live_chat/" . $cid . "/" . $upload_file_name;
2504
+ echo $response;
2505
+ } else {
2506
+ echo "ERROR: Upload failed";
2507
+ }
2508
+ } else {
2509
+ echo "ERROR: Security Violation";
2510
+ }
2511
+ }
2512
+ }else {
2513
+ echo "ERROR: Chat ID Tampering Detected.";
2514
+ }
2515
+ }else {
2516
+ echo "ERROR: Upload failed. Invalid Chat ID.";
2517
+ }
2518
  wp_die();
2519
  }
2520
  }
2551
  }
2552
  }
2553
 
 
2554
  /**
2555
  * Add switchery JS & CSS button to the chat dashboard
2556
  * @since 1.0.00
 
2557
  * @return void
2558
  */
2559
+ add_action('admin_print_scripts', 'wplc_choose_admin_scripts');
2560
+ function wplc_choose_admin_scripts() {
2561
+ wp_register_script('wplc_switchery', plugins_url('js/switchery.min.js', __FILE__), array('jquery'),WPLC_PLUGIN_VERSION);
2562
+ wp_enqueue_script('wplc_switchery');
2563
+ wp_register_style('wplc_switchery_css', plugins_url('css/switchery.min.css', __FILE__),false,WPLC_PLUGIN_VERSION);
2564
+ wp_enqueue_style('wplc_switchery_css');
2565
+ wp_register_script('wplc-choose-script', plugins_url('/js/wplc_choose.js', __FILE__),array('jquery'),WPLC_PLUGIN_VERSION);
2566
+ wp_enqueue_script('wplc-choose-script');
2567
+
2568
+ $wpc_admin_js_strings = array(
2569
+ 'accepting_status' => __('Status (Online)', 'wplivechat'),
2570
+ 'accepting_chats' => __('Online', 'wplivechat'),
2571
+ 'not_accepting_chats' => __('Offline', 'wplivechat'),
2572
+ 'not_accepting_status' => __('Status (Offline)', 'wplivechat')
2573
+ );
2574
+ wp_localize_script('wplc-choose-script', 'wplc_choose_admin_strings', $wpc_admin_js_strings);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2575
 
2576
+ $wplc_current_user_id = get_current_user_id();
2577
 
2578
+ if (wplc_get_agent_status($wplc_current_user_id)) {
2579
+ /* user is online */
2580
+ wp_localize_script('wplc-choose-script', 'wplc_choose_accept_chats', array('value'=>true));
2581
+ } else {
2582
+ wp_localize_script('wplc-choose-script', 'wplc_choose_accept_chats', array('value'=>false));
2583
+ $offline_string = "<p><span class='offline-status'>".__("You have set your status to offline. To view visitors and accept chats please set your status to online using the switch above.","wplivechat")."</span></p>";
2584
+ $quote_string = "<p><span class='offline-quote'>".wplc_random_quote_mrg()."</span></p>";
2585
+ wp_localize_script('wplc-choose-script', 'wplc_localized_offline_string', $offline_string);
2586
+ wp_localize_script('wplc-choose-script', 'wplc_localized_quote_string', $quote_string);
2587
+ }
2588
 
2589
+ wp_register_script('wplc-qr-script', plugins_url('/js/quick_responses.js', __FILE__),array('jquery'),WPLC_PLUGIN_VERSION);
2590
+ wp_enqueue_script('wplc-qr-script');
2591
+ wp_register_script('wplc-triggers', plugins_url('/js/triggers.js', __FILE__),array('jquery'),WPLC_PLUGIN_VERSION);
2592
+ wp_enqueue_script('wplc-triggers');
2593
+ wp_register_script('wplc-admin-editor', plugins_url('/js/wplc_admin_editor.js', __FILE__),array('jquery'),WPLC_PLUGIN_VERSION);
2594
+ wp_enqueue_script('wplc-admin-editor');
2595
  }
2596
 
 
2597
  /**
2598
  * Remove default transient renewer if option is enabled
2599
  * @since 1.0.00
 
2600
  * @return void
2601
  */
2602
  if (!function_exists("wplc_choose_hook_control_head")) {
2603
  add_action("wplc_maa_hook_head","wplc_choose_hook_control_head",1);
2604
  function wplc_choose_hook_control_head() {
2605
+ $wplc_settings = wplc_get_options();
2606
+ if (!$wplc_settings['wplc_allow_agents_set_status']) {
2607
+ remove_action("wplc_maa_hook_head","wplc_maa_hook_control_head");
2608
+ }
 
2609
  }
2610
  }
2611
 
2614
  * @param string $msg The message
2615
  * @return string
2616
  * @since 1.0.00
 
2617
  */
2618
  if (!function_exists("wplc_encrypt_filter_control_message_control")) {
2619
  add_filter("wplc_filter_message_control","wplc_encrypt_filter_control_message_control",10,1);
2628
  * @param string $msg The message
2629
  * @return string
2630
  * @since 1.0.00
 
2631
  */
2632
  if (!function_exists("wplc_encrypt_filter_control_out_message_control")) {
2633
  add_filter("wplc_filter_message_control_out","wplc_encrypt_filter_control_out_message_control",10,1);
2642
  * Add to the tabs filter
2643
  * @return void
2644
  * @since 1.0.00
 
2645
  */
2646
 
2647
  if (!function_exists("wplc_business_hours_filter_control_setting_tabs")) {
2667
  * Encrypt the message
2668
  * @since 1.0.0
2669
  * @return void
 
2670
  */
2671
  if (!function_exists("wplc_encrypt_encrypt_msg")) {
2672
+ function wplc_encrypt_encrypt_msg($plaintext) {
2673
+ $wplc_settings = wplc_get_options();
2674
+ if ($wplc_settings['wplc_enable_encryption']) {
 
2675
 
2676
  $encrypted_salt = get_option( "wp-live-chat-support-pro_key" );
2677
  $api_key = get_option('wplc_api_key');
2697
  }
2698
  if($api_key != ''){
2699
  $api_key = substr($api_key, 0, 10);
 
 
2700
  $inputData = cryptoHelpers::convertStringToByteArray($plaintext);
2701
  $keyAsNumbers = cryptoHelpers::toNumbers(bin2hex($api_key));
2702
  $keyLength = count($keyAsNumbers);
2741
  * Updated in 8.0.32 for backwards compatibility
2742
  * @since 1.0.0
2743
  * @return void
 
2744
  */
2745
+ function wplc_encrypt_decrypt_msg($input){
2746
+ $messages = maybe_unserialize($input);
2747
+ if (is_array($messages)) {
2748
+ /** Check already in place to determine if a message was previously encrypted */
2749
+ if ($messages['e'] == 1) {
2750
+ /* This message was encrypted */
2751
+ $encrypted_salt = get_option( "wp-live-chat-support-pro_key" );
2752
+ $api_key = get_option('wplc_api_key');
2753
+
2754
+ if (empty($api_key)) {
2755
+ if (!empty($encrypted_salt)) {
2756
+ $api_key = $encrypted_salt;
2757
+ }
2758
+ }
2759
+ if (empty($api_key)) {
2760
+ error_log('wplc_encrypt_decrypt_msg warning: empty API key, cannot decrypt');
2761
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2762
 
2763
+ $api_key = substr($api_key, 0, 10);
2764
+ $cipherSplit = explode( " ", $messages['m']);
2765
+ $originalSize = intval($cipherSplit[0]);
2766
+ $iv = cryptoHelpers::toNumbers($cipherSplit[1]);
2767
+ $cipherText = $cipherSplit[2];
2768
+
2769
+ $cipherIn = cryptoHelpers::toNumbers($cipherText);
2770
+ $keyAsNumbers = cryptoHelpers::toNumbers(bin2hex($api_key));
2771
+ $keyLength = count($keyAsNumbers);
2772
+
2773
+ $decrypted = AES::decrypt(
2774
+ $cipherIn,
2775
+ $originalSize,
2776
+ AES::modeOfOperation_CBC,
2777
+ $keyAsNumbers,
2778
+ $keyLength,
2779
+ $iv
2780
+ );
2781
+
2782
+ $hexDecrypted = cryptoHelpers::toHex($decrypted);
2783
+ return pack("H*" , $hexDecrypted);
2784
+ } else {
2785
+ return $messages['m'];
2786
+ }
2787
+ } else {
2788
+ return $input;
2789
+ }
2790
  }
2791
 
2792
+ add_action('wplc_hook_admin_chatbox_javascript','wplc_ic_admin_javascript');
2793
+ add_action('wplc_hook_admin_menu_layout_display' , 'wplc_hook_control_admin_menu_layout_display', 1, 3);
2794
+ add_action('wplc_hook_wplc_draw_chat_area', 'wplc_hook_control_wplc_draw_chat_area',1, 1);
2795
+ add_filter('wplc_filter_list_chats_actions', 'wplc_ic_initiate_chat_button', 14, 3);
2796
+ add_filter('wplc_filter_wplc_call_to_server_visitor_new_status_check', 'wplc_filter_control_wplc_call_to_server_visitor_new_status_check', 1, 1);
2797
+ add_filter("wplc_filter_run_override","wplc_ic_filter_control_run_override");
2798
 
2799
+ function wplc_ic_filter_control_run_override($ret) {
2800
+ $wplc_settings = wplc_get_options();
2801
+ return !$wplc_settings['wplc_enable_initiate_chat'];
2802
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2803
 
2804
  /**
2805
  * Add an item to the data_array ajax variable
2807
  * @since 1.0.0
2808
  * @param
2809
  * @return void
 
2810
  *
2811
  */
2812
  if (!function_exists("wplc_ic_filter_control_admin_javascript")) {
2827
  * @since 1.0.0
2828
  * @param
2829
  * @return string
 
2830
  *
2831
  */
2832
  if (!function_exists("wplc_ic_check_if_user_is_agent")) {
2833
  function wplc_ic_check_if_user_is_agent(){
2834
  $user_id = get_current_user_id();
2835
+ if (sanitize_text_field(get_the_author_meta('wplc_ma_agent', $user_id ) ) === "1"){
2836
  return $user_id;
2837
  } else {
2838
  return "not_user_agent";
2840
  }
2841
  }
2842
 
 
 
 
2843
  /**
2844
  * Initiate chat button
2845
  * @param string $default The default text that gets passed through
2846
  * @param int $id2 ID of the chat
2847
  * @return string
2848
  * @since 1.0.00
 
2849
  */
2850
+ function wplc_ic_initiate_chat_button($actions, $result, $post_data) {
2851
+ if (intval($result->status) == 5 ) {
2852
+ $aid = "";
2853
+ if ($post_data['wplc_extra_data']['agent_id']) {
2854
+ if (is_numeric($post_data['wplc_extra_data']['agent_id'])) {
2855
+ $aid = "&aid=".$post_data['wplc_extra_data']['agent_id'];
2856
+ }
2857
+ }
2858
+ $url = admin_url( 'admin.php?page=wplivechat-menu&action=rc&cid='.$result->id.$aid);
2859
+ $wplc_settings = wplc_get_options();
2860
+ if ($wplc_settings['wplc_use_node_server'] && $wplc_settings['wplc_enable_initiate_chat']) {
2861
+ $actions = "<a href=\"".$url."\" class=\"wplc_open_chat button wplc_initiate_chat button-secondary\" window-title=\"WP_Live_Chat_".$result->id."\">".__("Initiate Chat","wplivechat")."</a>";
2862
+ }
2863
+ }
2864
+ return $actions;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2865
  }
2866
 
2867
  /**
2868
  * Localize the action2 variable that is required
2869
  * @return void
2870
  * @since 1.0.00
 
2871
  */
2872
+ function wplc_ic_admin_javascript() {
2873
+ $wplc_settings = wplc_get_options();
2874
+ if ($wplc_settings['wplc_typing_enabled']) {
2875
+ $wpc_misc_js_strings = array(
2876
+ 'typing_enabled' => true,
2877
+ 'typingimg' => plugins_url('/images/comment.svg', __FILE__)
2878
+ );
2879
+ } else {
2880
+ $wpc_misc_js_strings = array(
2881
+ 'typing_enabled' => false
2882
+ );
2883
+ }
 
 
 
 
 
 
 
 
 
 
2884
 
2885
+ wp_localize_script('wplc-admin-chat-js', 'wplc_misc_strings', $wpc_misc_js_strings);
2886
 
2887
+ if (isset($_GET['action']) && $_GET['action'] == 'rc') {
2888
+ wp_localize_script( 'wplc-admin-chat-js', 'wplc_action2', 'wplc_long_poll_check_user_opened_chat' );
2889
+ } else {
2890
+ return;
2891
+ }
 
 
2892
  }
2893
 
2894
  if (!function_exists("wplc_hook_control_intiate_check")) {
2908
  * @param string $action The action GET param
2909
  * @return void
2910
  * @since 1.0.00
 
2911
  */
2912
  if (!function_exists("wplc_hook_control_admin_menu_layout_display")) {
2913
  function wplc_hook_control_admin_menu_layout_display($action, $cid,$aid) {
2922
  * @param array $array
2923
  * @return array
2924
  * @since 1.0.00
 
2925
  */
2926
  if (!function_exists("wplc_filter_control_wplc_call_to_server_visitor_new_status_check")) {
2927
  function wplc_filter_control_wplc_call_to_server_visitor_new_status_check($array) {
2941
  * @param array $array
2942
  * @return array
2943
  * @since 1.0.00
 
2944
  */
2945
+ function wplc_hook_control_wplc_draw_chat_area($result) {
2946
+ $wplc_settings = wplc_get_options();
2947
+ if (!empty($result->name)) {
2948
+ wp_localize_script('wplc-admin-chat-js', 'wplc_chat_name', $result->name);
2949
+ } else {
2950
+ wp_localize_script('wplc-admin-chat-js', 'wplc_chat_name', $wplc_settings['wplc_user_default_visitor_name']);
2951
+ }
2952
+ if (intval($result->status) == 6) {
2953
+ echo "<strong>" . __("Attempting to open the chat window... Please be patient.", "wp-live-chat-support-initiate-chats") . "</strong>";
2954
+ $result->continue = false;
2955
+ return $result;
2956
+ }
2957
+ return $result;
 
 
 
 
 
2958
  }
2959
 
 
 
 
 
 
2960
  /**
2961
  * Checks if user is an agent while on the chat dashboard page
2962
  * @return void
2963
  * @since 1.0.00
 
2964
  */
2965
  if (!function_exists("wplc_ma_hook_control_admin_meny_layout_display_top")) {
2966
  function wplc_ma_hook_control_admin_meny_layout_display_top() {
2984
  * @since 1.0.0
2985
  * @param
2986
  * @return void
 
2987
  *
2988
  */
2989
  if (!function_exists("wplc_maa_update_agent_id")) {
3013
  * @since 1.0.0
3014
  * @param
3015
  * @return string
 
3016
  *
3017
  */
3018
  if (!function_exists("wplc_maa_check_if_user_is_agent")) {
3034
  * @param int $cid Chat ID
3035
  * @param int $aid Agent ID
3036
  * @return bool
 
3037
  */
3038
  if (!function_exists("wplc_maa_check_if_chat_answered_by_other_agent")) {
3039
  function wplc_maa_check_if_chat_answered_by_other_agent($cid, $aid){
3066
  * @param int $cid Chat ID
3067
  * @param int $aid Agent ID
3068
  * @since 1.0.0
 
3069
  * @return void
3070
  */
3071
  if (!function_exists("wplc_ma_hook_control_update_agent_id")) {
3083
  * @since 1.0.0
3084
  * @param
3085
  * @return void
 
3086
  */
3087
  if (!function_exists("wplc_ma_first_time_install")) {
3088
  function wplc_ma_first_time_install() {
3115
  * @since 1.0.0
3116
  * @param
3117
  * @return void
 
3118
  */
3119
  if (!function_exists("wplc_maa_set_user_as_agent")) {
3120
  function wplc_maa_set_user_as_agent( $user_id ) {
3152
  * @since 1.0.0
3153
  * @param
3154
  * @return void
 
3155
  *
3156
  */
3157
  if (!function_exists("wplc_maa_custom_user_profile_fields")) {
3158
  function wplc_maa_custom_user_profile_fields($user) {
3159
+ $wplc_settings = wplc_get_options();
3160
+ if ($wplc_settings['wplc_make_agent']) {
3161
  ?>
3162
  <table class="form-table">
3163
  <tr>
3253
  * @since 1.0.0
3254
  * @param
3255
  * @return array
 
3256
  */
3257
 
3258
  if (!function_exists("wplc_ma_filter_control_wplc_admin_long_poll_chat_iteration")) {
3343
  * @since 1.0.0
3344
  * @param
3345
  * @return array
 
3346
  */
3347
 
3348
  if (!function_exists("wplc_ma_filter_control_wplc_user_long_poll_chat_iteration")) {
3399
  * @since 1.0.0
3400
  * @param
3401
  * @return void
 
3402
  *
3403
  */
3404
  if (!function_exists("wplc_ma_hook_control_accept_chat_url")) {
3433
  * @since 1.0.0
3434
  * @param
3435
  * @return void
 
3436
  *
3437
  */
3438
  if (!function_exists("wplc_ma_filter_control_admin_javascript")) {
3458
  if (!function_exists("wplc_ma_filter_control_chat_dashboard_visitors_online_bottom")) {
3459
  add_action("wplc_filter_chat_dahsboard_visitors_online_bottom","wplc_ma_filter_control_chat_dashboard_visitors_online_bottom",11);
3460
  function wplc_ma_filter_control_chat_dashboard_visitors_online_bottom($text) {
3461
+ $text = " <span class='wplc_agents_online'>".wplc_maa_total_agents_online()."</span> ";
3462
+ $text .= __("Agent(s) online","wplivechat");
 
 
 
3463
  return $text;
3464
  }
3465
  }
3468
  * Count how many agents are online
3469
  * @return int number of agents
3470
  */
3471
+ function wplc_maa_total_agents_online() {
3472
+ $user_array = get_users(array(
3473
+ 'meta_key'=> 'wplc_chat_agent_online',
3474
+ ));
3475
+ $wplc_settings = wplc_get_options();
3476
+ if ($wplc_settings['wplc_allow_agents_set_status']) {
3477
+ $agent_status = wplc_get_all_agent_status();
3478
+ $count = 0;
3479
+ foreach($user_array as $v) {
3480
+ if (isset($agent_status[$v->ID]) && $agent_status[$v->ID]) {
3481
+ $count++;
3482
+ }
3483
+ }
3484
+ return $count;
3485
+ } else {
3486
+ return count($user_array);
3487
+ }
3488
  }
3489
 
3490
+ add_action('admin_bar_menu', 'wplc_maa_online_agents', 100);
3491
+ function wplc_maa_online_agents() {
3492
+ if (!current_user_can('wplc_ma_agent', array(null))) {
3493
+ return; //if user doesn't have permissions for chat agent, do not show admin bar.
3494
+ }
3495
+ ?>
3496
+ <style>
3497
+ .wplc_circle {
3498
+ width: 10px !important;
3499
+ height: 10px !important;
3500
+ display: inline-block !important;
3501
+ border-radius: 100% !important;
3502
+ margin-right: 5px !important;
3503
+ }
3504
+ .wplc_red_circle{
3505
+ background: red;
3506
+ }
3507
+ .wplc_green_circle{
3508
+ background:rgb(103, 213, 82);
3509
+ }
3510
+ </style>
3511
+ <?php
3512
+ $agent_count = wplc_maa_total_agents_online();
3513
+ if ($agent_count>0) {
3514
+ $circle_class = "wplc_green_circle";
3515
+ if ($agent_count==1) {
3516
+ $chat_agents = __('Chat Agent Online', 'wplivechat');
3517
+ } else {
3518
+ $chat_agents = __('Chat Agents Online', 'wplivechat');
3519
+ }
3520
+ } else {
3521
+ $circle_class = "wplc_red_circle";
3522
+ $chat_agents = __('Chat Agents Online', 'wplivechat');
3523
+ }
3524
 
3525
+ global $wp_admin_bar;
3526
+ $wp_admin_bar->add_menu( array(
3527
+ 'id' => 'wplc_ma_online_agents',
3528
+ 'title' => '<span class="wplc_circle '.$circle_class.'" id="wplc_ma_online_agents_circle"></span><span id="wplc_ma_online_agents_count">'.$agent_count.'</span> '.$chat_agents,
3529
+ 'href' => false
3530
+ ));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3531
 
3532
+ if ($agent_count > 0) {
3533
+ $user_array = get_users(array('meta_key'=> 'wplc_chat_agent_online'));
3534
+ foreach($user_array as $user) {
3535
+ if (wplc_get_agent_status($user->ID)) {
3536
+ $wp_admin_bar->add_menu(array(
3537
+ 'id' => 'wplc_user_online_'.$user->ID,
3538
+ 'parent' => 'wplc_ma_online_agents',
3539
+ 'title' => $user->display_name,
3540
+ 'href' => false,
3541
+ ));
3542
+ }
3543
+ }
3544
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3545
  }
3546
 
 
 
 
 
3547
  /**
3548
  * Logs the agent out
3549
  * @return void
3550
  * @since 1.0.00
 
3551
  */
3552
 
3553
  if (!function_exists("wplc_maa_remove_agents_online")) {
3578
  * @param bool $logged_in
3579
  * @return array
3580
  * @since 1.0.00
 
3581
  */
3582
  if (!function_exists("wplc_maa_filter_control_check_if_logged_in")) {
3583
  add_filter("wplc_filter_is_admin_logged_in","wplc_maa_filter_control_check_if_logged_in",10,1);
3592
  * Logs the agent out
3593
  * @return void
3594
  * @since 1.0.00
 
3595
  */
3596
  if (!function_exists("wplc_maa_agent_logout")) {
3597
  add_action('wp_logout', 'wplc_maa_agent_logout');
3602
  }
3603
 
3604
  /**
3605
+ * Is there at least one agent online?
3606
  * @return bool
3607
  * @since 1.0.00
 
3608
  */
3609
 
3610
+ function wplc_maa_is_agent_online() {
3611
+ return wplc_maa_total_agents_online()>0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3612
  }
3613
 
 
 
3614
  /**
3615
  * Add the JS file to the admin screen
3616
  * @return void
3617
  * @since 1.0.00
 
3618
  */
3619
  if (!function_exists("wplc_control_admin_javascript")) {
3620
  function wplc_control_admin_javascript() {
3633
  'typing_string' => __('Typing...', 'wplivechat')
3634
  );
3635
  wp_localize_script('wplc-ma-js', 'wplc_admin_strings', $wpc_ma_js_strings);
 
 
3636
  }
3637
  do_action("wplc_maa_hook_head");
3638
  }
3663
  * AJAX callback control
3664
  * @return void
3665
  * @since 1.0.00
 
3666
  */
3667
  if (!function_exists("wplc_ma_hook_control_action_callback")) {
3668
  add_action("wplc_hook_action_callback","wplc_ma_hook_control_action_callback");
3692
  }
3693
 
3694
  if ($_POST['action'] == "wplc_macro") {
3695
+ if(wplc_ic_check_if_user_is_agent() !== "not_user_agent") {
3696
+ if (isset($_POST['postid'])) {
3697
+ $post_id = sanitize_text_field($_POST['postid']);
3698
+ } else {
3699
+ return false;
3700
+ }
3701
 
3702
+ if ($post_id > 0) {
3703
+ $post_details = get_post($post_id);
3704
+ if ($post_details) {
3705
+ echo json_encode(nl2br($post_details->post_content));
3706
+ } else {
3707
+ echo json_encode("No post with that ID");
3708
+ die();
3709
+ }
3710
+ } else {
3711
+ echo json_encode("No macro with that ID");
3712
+ die();
3713
+ }
3714
+ }else {
3715
+ echo json_encode("You do not have permission to perform this action.");
3716
  die();
3717
+ }
3718
  }
3719
 
3720
  if( $_POST['action'] == 'wplc_record_chat_rating' ){
3721
  $rating_id = sanitize_text_field($_POST['cid']);
3722
  $rating_score = sanitize_text_field($_POST['rating']);
3723
+ $u_id_check=0;
3724
+
3725
+ if(wplc_check_user_request($_POST['cid'])){
3726
+ $u_id_check = 1;
3727
+ }
3728
+
3729
+ if($u_id_check === 1){
3730
 
3731
+ if( ! filter_var($rating_id, FILTER_VALIDATE_INT) ) {
3732
+ /* We need to identify if this CID is a node CID, and if so, return the WP CID */
3733
+ $rating_id = wplc_return_chat_id_by_rel($rating_id);
3734
+ }
3735
+
3736
+
3737
+ $nifty_record_rating = nifty_record_rating_mrg($rating_id, $rating_score);
3738
+ if ($nifty_record_rating) {
3739
+ echo 'rating added';
3740
+ wp_die();
3741
+ } else {
3742
+ echo "There was an error sending your chat message. Please contact support";
3743
+ wp_die();
3744
+ }
3745
+ }else {
3746
+ echo "There was an error sending your chat rating. Please contact support";
3747
+ wp_die();
3748
+ }
3749
  }
3750
 
3751
  }
3755
  * Mark the agent as "online"
3756
  * @return void
3757
  * @since 1.0.00
 
3758
  */
3759
 
3760
  if (!function_exists("wplc_maa_set_agents_online")) {
3782
  // add_filter("wplc_filter_chat_header_above","wplc_chat_social_div_mrg",5,2);
3783
  // add_filter("wplc_filter_chat_4th_layer_below_input","wplc_chat_social_div_mrg",5,2);
3784
  add_filter("wplc_filter_chat_social_div_hook","wplc_chat_social_div_mrg",5,2);
3785
+ function wplc_chat_social_div_mrg($msg, $wplc_settings=false) {
3786
+ if (!$wplc_settings) {
3787
+ $wplc_settings = wplc_get_options();
3788
+ }
3789
+ if (!$wplc_settings["wplc_ux_exp_rating"] && $wplc_settings['wplc_newtheme'] == "theme-2") {
3790
+ //$top_offset = "bottom:-4px !important;";
3791
+ }
3792
+ $msg .= "<div id='wplc_social_holder' ".($wplc_settings['wplc_newtheme'] == "theme-2" ? "class='wplc_modern'" : "" )." >";
3793
+ if (!empty($wplc_settings['wplc_social_fb'])) {
3794
+ $msg .= "<a class='wplc-color-1' href=".urldecode($wplc_settings['wplc_social_fb'])." target='_blank'><i class='wplc_social_icon fa fa-facebook-square' id='wplc_social_fb' ></i></a>";
3795
+ }
3796
+ if (!empty($wplc_settings['wplc_social_tw'])) {
3797
+ $msg .= "<a class='wplc-color-1' href=".urldecode($wplc_settings['wplc_social_tw'])." target='_blank'><i class='wplc_social_icon fa fa-twitter-square' id='wplc_social_tw' ></i></a>";
3798
+ }
3799
+ $msg .= "</div>";
3800
+ return $msg;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3801
  }
3802
 
3803
  /*Upload Div*/
3804
  add_filter("wplc_filter_chat_upload","nifty_file_upload_div_mrg",1,1);
3805
  function nifty_file_upload_div_mrg($msg){
3806
+ $wplc_settings = wplc_get_options();
3807
+ if ($wplc_settings["wplc_ux_file_share"]) {
3808
+ // $editor_enabled = !$wplc_settings["wplc_ux_exp_rating"] ? "bottom: 35px !important;" : "";
3809
+ $editor_enabled = "";
3810
  $msg .= "<div id='nifty_file_holder'>";
3811
  $msg .= "<label for='nifty_file_input' id='nifty_select_file'><i class='nifty_attach_icon nifty_attach_open_icon fa fa-paperclip' id='nifty_attach' style='$editor_enabled' ></i></label>";
3812
  $msg .= "<i class='nifty_attach_icon fa fa-circle-o-notch fa-spin' id='nifty_attach_uploading_icon' style='display:none; $editor_enabled' ></i>";
3821
  // add_filter("wplc_filter_chat_header_above","nifty_chat_ratings_div_mrg",1,2);
3822
  add_filter("wplc_filter_chat_4th_layer_below_input","nifty_chat_ratings_div_mrg",1,2);
3823
  function nifty_chat_ratings_div_mrg($msg, $wplc_setting){
3824
+ $wplc_settings = wplc_get_options();
3825
+ if ($wplc_settings["wplc_ux_exp_rating"]) {
3826
  $msg .= "<div id='nifty_ratings_holder' style='display:none;'>";
3827
  $msg .= "<i class='nifty_rating_icon fa fa-thumbs-o-up' id='nifty_rating_pos' ></i>";
3828
  $msg .= "";
3891
  global $wpdb;
3892
  global $wplc_tblname_chat_ratings;
3893
  if ($force) {
3894
+ $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wplc_tblname_chat_ratings WHERE `cid` = %d LIMIT 1", $cid));
 
 
3895
  } else {
3896
+ $results = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wplc_tblname_chat_ratings WHERE `cid` = %d AND `notified` = 0 LIMIT 1", $cid));
 
 
3897
  }
3898
  if ($wpdb->num_rows) {
3899
+ foreach ($results as $result) {
3900
+ $id = $result->id;
3901
+ $wpdb->Query($wpdb->prepare("UPDATE $wplc_tblname_chat_ratings SET `notified` = 1 WHERE `id` = %d LIMIT 1", $id));
3902
+ return array("rating" => $result->rating, "comment" => $result->comment);
3903
+ }
3904
+ } else {
3905
+ return false;
 
 
 
3906
  }
3907
  }
3908
 
3911
  $rating = apply_filters("wplc_rating_data_filter","",$cid,$name);
3912
  if ($rating) {
3913
 
3914
+ $msg .= "<div class='admin_visitor_advanced_info admin_agent_rating wplc_on_premise_chat_box_user_info_rating'>
 
3915
  <div class='rating " .(isset($rating['rating']) && $rating['rating'] == '1' ? "rating-good" : ($rating['rating'] == '0' ? "rating-bad" : "" ))."'>".(isset($rating['rating']) && $rating['rating'] == '1' ? "Satisfied" : ($rating['rating'] == '0' ? "Unsatisfied" : "No Rating" ))."</div>
 
 
3916
  </div>";
3917
  } else{
3918
  //No Rating Provided
3919
  $msg .= "<div class='admin_visitor_advanced_info admin_agent_rating'>
 
3920
  <div class='rating'>No Rating</div>
 
 
3921
  </div>";
3922
  }
3923
  return $msg;
3942
  global $wpdb;
3943
  global $wplc_tblname_chat_ratings;
3944
 
3945
+ $sql = "SELECT * FROM $wplc_tblname_chat_ratings WHERE `aid` = %s";
3946
  if($filter == 1){
3947
+ $sql = "SELECT * FROM $wplc_tblname_chat_ratings WHERE `aid` = %s AND `timestamp` > DATE_SUB(NOW(), INTERVAL 7 DAY)";
3948
  }else if($filter == 2){
3949
+ $sql = "SELECT * FROM $wplc_tblname_chat_ratings WHERE `aid` = %s AND `timestamp` > DATE_SUB(NOW(), INTERVAL 14 DAY)";
3950
  }else if($filter == 3){
3951
+ $sql = "SELECT * FROM $wplc_tblname_chat_ratings WHERE `aid` = %s AND `timestamp` > DATE_SUB(NOW(), INTERVAL 30 DAY)";
3952
  }else if($filter == 4){
3953
+ $sql = "SELECT * FROM $wplc_tblname_chat_ratings WHERE `aid` = %s AND `timestamp` > DATE_SUB(NOW(), INTERVAL 60 DAY)";
3954
  }else if($filter == 5){
3955
+ $sql = "SELECT * FROM $wplc_tblname_chat_ratings WHERE `aid` = %s AND `timestamp` > DATE_SUB(NOW(), INTERVAL 90 DAY)";
3956
  }
3957
 
3958
  $sql .= " ORDER BY `cid` DESC"; //Sort
3963
 
3964
  $data_array = array();
3965
  $current_index = 0;
3966
+ $results = $wpdb->get_results($wpdb->prepare($sql, $uid));
3967
  if($wpdb->num_rows){
3968
  foreach ($results as $res) {
3969
  $data_array[$uid][$current_index] = array(
4025
  display: inline-block;
4026
  margin-right: 13px;
4027
  vertical-align: top;
4028
+ margin-bottom:10px;
4029
  }";
4030
  $ratings .= ".wplc_agent_data {
4031
  max-height: 200px;
4161
 
4162
  $tabs .= "<style>" . $styling_reporting . "</style>";
4163
 
4164
+ $tabs .= "<div class='wrap wplc_wrap'><h2>".__('Reports', 'wp-livechat')."</h2><div id='reporting_tabs'>";
4165
  $tabs .= "<ul>";
4166
  $tab = array(
4167
  'overview' => __('Overview', 'wp-livechat'),
4261
  'other_data' => apply_filters('wplc_additional_statistic_data', '')
4262
  );
4263
  }
4264
+ function return_stats_strings_mrg() {
4265
  return array(
4266
  'url' => __('URL', 'wp-livechat'),
4267
  'count' => __('Count', 'wp-livechat')
4268
  );
4269
  }
4270
 
4271
+ add_filter( 'wplc_filter_message_sound', 'wplc_mrg_filter_control_message_sound', 10);
4272
+ function wplc_mrg_filter_control_message_sound() {
4273
+ $wplc_settings = wplc_get_options();
4274
+ if (isset($wplc_settings['wplc_messagetone'])) {
4275
+ return wplc_get_messagetone_url($wplc_settings['wplc_messagetone']);
4276
+ }
4277
+ return wplc_get_messagetone_url('');
4278
  }
4279
 
4280
+ add_filter("wplc_filter_wav_file","wplc_filter_control_wav_file",10);
4281
+ function wplc_filter_control_wav_file() {
4282
+ $wplc_settings = wplc_get_options();
4283
+ if (isset($wplc_settings['wplc_ringtone'])) {
4284
+ return wplc_get_ringtone_url($wplc_settings['wplc_ringtone']);
4285
+ }
4286
+ return wplc_get_ringtone_url('');
4287
  }
4288
 
4289
  add_action("wplc_advanced_settings_settings","wplc_hook_control_advanced_settings_settings",10);
4290
  function wplc_hook_control_advanced_settings_settings() {
4291
+ $wplc_settings = wplc_get_options();
4292
  echo "<tr>";
4293
+ echo " <td>".__("Enable Manual Chat Initiation:","wplivechat")." <i class=\"fa fa-question-circle wplc_light_grey wplc_settings_tooltip\" title=\"".__("Enabling this feature will allow agents to start a chat with website visitors. This feature increases server load while enabled.","wplivechat")."\"></i></td>";
4294
+ if ($wplc_settings['wplc_use_node_server']) {
4295
+ echo " <td><input type='checkbox' name='wplc_enable_initiate_chat' value='1'".($wplc_settings['wplc_enable_initiate_chat'] ? ' checked' : '')."/></td>";
4296
+ } else {
4297
+ echo " <td>".__("This feature is only available when you select 3CX High Performance Cloud Servers in Advanced Features.")."</td>";
4298
+ }
4299
  echo "</tr>";
4300
  }
4301
 
 
 
 
 
 
4302
  function wplc_random_quote_mrg() {
4303
+ $array = array(
4304
+ 0 => "&ldquo;The true entrepreneur is a doer, not a dreamer.&rdquo; &ndash; Unknown",
4305
+ 1 => "&ldquo;Please think about your legacy, because you're writing it every day.&rdquo; &ndash; Gary Vaynerchuck",
4306
+ 2 => "&ldquo;A man should never neglect his family for business.&rdquo; &ndash; Walt Disney",
4307
+ 3 => "&ldquo;Every accomplishment starts with a decision to try.&rdquo; &ndash; Unknown",
4308
+ 4 => "&ldquo;There's no shortage of remarkable ideas, what's missing is the will to execute them.&rdquo; &ndash; Seth Godin",
4309
+ 5 => "&ldquo;You only have to do a very few things right in your life so long as you don't do too many things wrong.&rdquo; &ndash; Warren Buffett",
4310
+ 6 => "&ldquo;One finds limits by pushing them.&rdquo; &ndash; Herbert Simon",
4311
+ 7 => "&ldquo;Wishes cost nothing unless you want them to come true&rdquo; &ndash; Steve Jobs",
4312
+ 8 => "&ldquo;Hire character. Train skill.&rdquo; &ndash; Peter Schutz",
4313
+ 9 => "&ldquo;A calm sea does not make a skilled sailor.&rdquo; &ndash; Unknown",
4314
+ 10 => "&ldquo;Leadership is doing what is right when no one is watching.&rdquo; &ndash; George Van Valkenburg",
4315
+ 11 => "&ldquo;Genius is one percent inspiration and ninety-nine percent perspiration.&rdquo; &ndash; Thomas A. Edison",
4316
+ 12 => "&ldquo;Are you a serial idea-starting person? The goal is to be an idea-shipping person.&rdquo; &ndash; Seth Godin",
4317
+ 13 => "&ldquo;To win without risk is to triumph without glory.&rdquo; &ndash; Pierre Corneille",
4318
+ 14 => "&ldquo;The golden rule for every business man is this: Put yourself in your customer's place.&rdquo; &ndash; Orison Swett Marden",
4319
+ 15 => "&ldquo;Darmok and Jalad at Tanagra.&rdquo; &ndash; Captain Dathon"
4320
+ );
4321
+ return $array[mt_rand(0,count($array))];
 
 
4322
  }
4323
 
4324
  function wplc_enqueue_admin_styles_mrg(){
4327
 
4328
  add_filter("wplc_filter_admin_from","wplc_filter_control_admin_from_mrg",10,3);
4329
  function wplc_filter_control_admin_from_mrg($content, $cid, $chat_data = false) {
4330
+ $wplc_settings = wplc_get_options();
4331
 
4332
+ if (!$chat_data) {
4333
+ $chat_data = wplc_get_chat_data($cid,__LINE__);
4334
+ }
4335
+ if (isset($chat_data->agent_id)) {
4336
+ if ($wplc_settings['wplc_use_wp_name']) {
4337
+ $user_object = get_user_by("id", $chat_data->agent_id);
4338
+ if (is_object($user_object)) {
4339
+ $content = $user_object->data->display_name;
4340
+ }
4341
  }
4342
+ }
4343
+ return $content;
 
 
 
 
 
 
 
 
 
 
 
4344
  }
4345
 
4346
  add_action("wplc_add_js_admin_chat_area", "wplc_add_js_admin_chat_area_control_mrg", 10, 2);
4347
  function wplc_add_js_admin_chat_area_control_mrg($cid, $chat_data = false){
4348
+ $wplc_settings = wplc_get_options();
4349
+ if (!$chat_data) { $chat_data = wplc_get_chat_data($cid,__LINE__); }
4350
+ if ($chat_data) {
4351
+ if ($wplc_settings['wplc_use_wp_name']) {
4352
+ $tuser = get_user_by('id', $chat_data->agent_id);
4353
+ if ($tuser) {
4354
+ $tname = $tuser->display_name;
4355
+ } else {
4356
+ $tname = stripslashes($wplc_settings['wplc_chat_name']);
4357
+ }
4358
+ ?>
4359
+ <script>
4360
+ var wplc_name_override = "<?php echo sanitize_text_field($tname); ?>";
4361
+ </script>
4362
+ <?php
4363
+ } else if (!empty($wplc_settings['wplc_chat_name'])) {
4364
+ ?>
4365
+ <script>
4366
+ var wplc_name_override = "<?php echo sanitize_text_field(stripslashes($wplc_settings['wplc_chat_name'])) ?>";
4367
+ </script>
4368
+ <?php
4369
+ }
4370
+ } else {
4371
+ exit("Error connecting to the cloud server. Please refresh this page");
4372
+ }
 
 
 
 
4373
  }
4374
 
4375
  register_activation_hook( __FILE__, 'wplc_auto_responder_activate_mrg' );
4400
  $wplc_user_name = $data['name'];
4401
  $wplc_user_email = $data['email'];
4402
 
4403
+ $wplc_ar_settings = get_option("WPLC_AUTO_RESPONDER_SETTINGS");
4404
 
4405
+ if( isset( $wplc_ar_settings['wplc_ar_enable'] ) && $wplc_ar_settings['wplc_ar_enable'] == '1' ) { $wplc_ar_enable = $wplc_ar_settings['wplc_ar_enable']; } else { $wplc_ar_enable = FALSE; }
4406
+ if( isset( $wplc_ar_settings['wplc_ar_from_name'] ) ) { $wplc_ar_from_name = $wplc_ar_settings['wplc_ar_from_name']; } else { $wplc_ar_from_name = ""; }
4407
+ if( isset( $wplc_ar_settings['wplc_ar_from_email'] ) ) { $wplc_ar_from_email = $wplc_ar_settings['wplc_ar_from_email']; } else { $wplc_ar_from_email = ""; }
4408
+ if( isset( $wplc_ar_settings['wplc_ar_subject'] ) ) { $wplc_ar_subject = $wplc_ar_settings['wplc_ar_subject']; } else { $wplc_ar_subject = ""; }
4409
+ if( isset( $wplc_ar_settings['wplc_ar_body'] ) ) { $wplc_ar_body = $wplc_ar_settings['wplc_ar_body']; } else { $wplc_ar_body = ""; }
4410
 
4411
  if( $wplc_ar_enable ){
4412
 
4437
  * Using contents of wplcmail function as we need additional functionality for this
4438
  */
4439
  $headers[] = 'Content-type: text/html';
4440
+ if (!empty($wplc_ar_from_name) && !empty($wplc_ar_from_email)) {
4441
+ $headers[] = 'Reply-To: '.$wplc_ar_from_name.' <'.$wplc_ar_from_email.'>';
4442
+ }
4443
  $overbody = apply_filters("wplc_filter_mail_body",$wplc_ar_subject, htmlspecialchars_decode(stripslashes( $wplc_ar_body ) ) );
4444
  if (!wp_mail($wplc_user_email, $wplc_ar_subject, $overbody, $headers)) {
4445
  $error = date("Y-m-d H:i:s") . " WP-Mail Failed to send \n";
4458
  if (isset($_POST['wplc_save_settings'])) {
4459
  $wplc_data = array();
4460
  if (isset($_POST['wplc_ar_enable'])) { $wplc_data['wplc_ar_enable'] = sanitize_text_field($_POST['wplc_ar_enable']); }
4461
+ if (isset($_POST['wplc_ar_from_name'])) { $wplc_data['wplc_ar_from_name'] = stripslashes(sanitize_text_field($_POST['wplc_ar_from_name'])); }
4462
+ if (isset($_POST['wplc_ar_from_email'])) { $wplc_data['wplc_ar_from_email'] = filter_var(sanitize_text_field($_POST['wplc_ar_from_email']), FILTER_SANITIZE_EMAIL); }
4463
+ if (isset($_POST['wplc_ar_subject'])) { $wplc_data['wplc_ar_subject'] = stripslashes(sanitize_text_field($_POST['wplc_ar_subject'])); }
4464
+ if (isset($_POST['wplc_ar_body'])) { $wplc_data['wplc_ar_body'] = stripslashes(sanitize_text_field($_POST['wplc_ar_body'])); }
4465
 
4466
  update_option( "WPLC_AUTO_RESPONDER_SETTINGS", $wplc_data );
4467
 
4469
 
4470
  }
4471
 
 
 
 
 
4472
  function wplc_return_times_array_mrg(){
4473
  $hours = array();
4474
  for( $i = 0; $i <= 23; $i++){
4485
  return $time;
4486
  }
4487
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4488
  function wplc_check_business_hours_mrg() {
4489
+ $business_hours_enabled = true;
4490
+ $wplc_settings = wplc_get_options();
4491
 
4492
+ if ($wplc_settings['wplc_bh_enable']) {
4493
  /**
4494
  * Enabled, check if the current day fits in the interval
4495
  */
4496
  $chat_box_interval = false;
4497
 
4498
  $current_day = current_time(date("N"));
4499
+ $current_day = intval( $current_day );
4500
+
4501
+ switch($wplc_settings['wplc_bh_interval']) {
4502
+ case 0: // everyday
4503
+ $chat_box_interval = true;
4504
+ break;
4505
+ case 1: // weekdays only
4506
+ if ($current_day<=5) {
4507
+ $chat_box_interval = true;
4508
+ }
4509
+ break;
4510
+ case 2: // weekends only
4511
+ if ($current_day==6 || $current_day==7) {
4512
+ $chat_box_interval = true;
4513
+ }
4514
+ break;
4515
+ }
 
 
 
 
 
 
 
 
 
4516
 
4517
+ if ($chat_box_interval) {
4518
+ /**
4519
+ * Lets check if it's the right time to show it now
4520
+ */
4521
+ $start_time = substr('00'.$wplc_settings['wplc_bh_hours_start'],-2,2).":".substr('00'.$wplc_settings['wplc_bh_minutes_start'],-2,2).':00';
4522
+ $end_time = substr('00'.$wplc_settings['wplc_bh_hours_end'],-2,2).":".substr('00'.$wplc_settings['wplc_bh_minutes_end'],-2,2).':00';
4523
+ $current_date_day = date('Y-m-d', current_time('timestamp'));
4524
+ $current_time = current_time('timestamp');
4525
+ $start_time = strtotime( $current_date_day.' '.$start_time );
4526
+ $end_time = strtotime( $current_date_day.' '.$end_time );
4527
+ if (($current_time >= $start_time ) && ( $current_time <= $end_time )) {
4528
+ $business_hours_enabled = true;
4529
+ } else {
4530
+ $business_hours_enabled = false;
4531
+ }
4532
+ } else {
4533
+ $business_hours_enabled = false;
4534
+ }
4535
+ }
4536
+ return $business_hours_enabled;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4537
  }
4538
 
 
4539
  add_filter("wplc_loggedin_filter","wplc_hook_control_business_hours_mrg",99,1);
4540
  function wplc_hook_control_business_hours_mrg($logged_in) {
4541
 
4554
  if ( ! function_exists( "wplc_active_business_hours_chat_box_notice" ) ) {
4555
  add_filter( "wplc_filter_active_chat_box_notice", "wplc_active_business_hours_chat_box_notice" );
4556
  function wplc_active_business_hours_chat_box_notice( $notice ) {
4557
+ $wplc_settings = wplc_get_options();
4558
  if ( $wplc_settings["wplc_settings_enabled"] == 1 ) {
4559
  $is_chat_enabled = wplc_check_business_hours_mrg();
4560
  if ( ! $is_chat_enabled ) {
4561
  $notice = '<div class="wplc-chat-box-notification wplc-chat-box-notification--disabled">';
4562
+ $notice .= '<p>' . __( 'The Live Chat box is currently disabled on your website due to:', 'wp-livechat' );
4563
+ $notice .= ' <a href="'.admin_url( 'admin.php?page=wplivechat-menu-settings#wplc-business-hours' ).'">' . __( 'Business Hours Settings', 'wp-livechat' ) . '</a></p>';
4564
  $notice .= '</div>';
4565
  }
4566
  }
4578
  * @return array
4579
  */
4580
  add_filter( "wplc_get_images_to_preload", "wplc_mrg_get_images_to_preload", 10, 2);
4581
+ function wplc_mrg_get_images_to_preload( $images, $wplc_settings ) {
4582
+ if ( isset($wplc_settings) && $wplc_settings['wplc_chat_pic'] ) {
4583
+ array_push( $images, urldecode($wplc_settings['wplc_chat_pic']) );
4584
  }
4585
  return $images;
4586
  }
4597
  * @return string
4598
  */
4599
  add_filter( "wplc_decide_agents_name", "wplc_filter_control_decide_agents_name_mrg", 10, 2 );
4600
+ function wplc_filter_control_decide_agents_name_mrg( $name, $wplc_settings ) {
4601
+ if (!$wplc_settings['wplc_use_wp_name'] && !empty($wplc_settings['wplc_chat_name'])) {
4602
+ $name = $wplc_settings['wplc_chat_name'];
 
 
 
 
 
4603
  }
4604
  return $name;
4605
  }
4626
  return $ret_msg;
4627
  }
4628
 
 
 
 
4629
  /*
4630
  * Add voice notes scripts to admin side
4631
  */
4633
  add_action( 'wplc_admin_remoter_dashboard_scripts_localizer', 'wplc_voice_notes_admin_javascript' );
4634
  add_action( 'wplc_hook_admin_javascript_chat', 'wplc_voice_notes_admin_javascript' );
4635
  function wplc_voice_notes_admin_javascript() {
4636
+ $wplc_settings = wplc_get_options();
4637
+ if (false) { // TODO: check and reactivate $wplc_settings['wplc_enable_voice_notes_on_admin']) {
4638
  wp_register_script( 'wplc-user-voice-notes-audio-recorder-wav', plugins_url( '/js/WebAudioRecorderWav.min.js', __FILE__ ), true );
4639
  wp_register_script( 'wplc-user-voice-notes-audio-recorder', plugins_url( '/js/WebAudioRecorder.min.js', __FILE__ ), true );
4640
  wp_register_script( 'wplc-user-voice-notes-audio-wave-surfer', plugins_url( '/js/wavesurfer.min.js', __FILE__ ), true );
4657
  }
4658
  }
4659
 
 
4660
  /*
4661
  * Add voice notes wrapper to admin remote dashboard
4662
  */
4678
  if ( ! function_exists( 'wplc_voice_notes_front_scripts' ) ) {
4679
  add_action( 'wplc_hook_push_js_to_front', 'wplc_voice_notes_front_scripts' );
4680
  function wplc_voice_notes_front_scripts() {
4681
+ $wplc_settings = wplc_get_options();
4682
+ if (false) { // TODO: check and re-enable $wplc_settings['wplc_enable_voice_notes_on_visitor']) {
4683
  wp_register_script( 'wplc-visitor-voice-notes-audio-recorder-wav', plugins_url( '/js/WebAudioRecorderWav.min.js', __FILE__ ), null, '', true );
4684
  wp_register_script( 'wplc-visitor-voice-notes-audio-recorder', plugins_url( '/js/WebAudioRecorder.min.js', __FILE__ ), null, '', true );
4685
  wp_register_script( 'wplc-user-voice-notes-audio-wave-surfer', plugins_url( '/js/wavesurfer.min.js', __FILE__ ), true );
4712
  add_action( 'wp_ajax_wplc_save_voice_notes', 'wplc_save_voice_notes_ajax' );
4713
 
4714
  function wplc_save_voice_notes_ajax() {
4715
+ if((wplc_ic_check_if_user_is_agent() === "not_user_agent" && isset($_SESSION['wplc_session_chat_session_id'])) ||(wplc_ic_check_if_user_is_agent() !== "not_user_agent")) {
4716
+
4717
+ if ( isset( $_FILES['file'] ) and ! $_FILES['file']['error'] ) {
4718
+ $upload_dir = wp_upload_dir();
4719
+ $base_dirname = $upload_dir['basedir'] . '/wp_live_chat/';
4720
+ $base_url = $upload_dir['baseurl'] . '/wp_live_chat/';
4721
+
4722
+ if ( ! file_exists( $base_dirname ) ) {
4723
+ @mkdir( $base_dirname );
4724
+ }
4725
+
4726
+ $fname = preg_replace('/[^A-Za-z0-9 _ .-]/', '', $_FILES['file']['name']);
4727
+ $fname = time().str_replace(" ", "_", $fname);
4728
+
4729
+ if ( file_exists($base_dirname .$fname)) {
4730
+ $fname = rand( 0, 200 ) . "-" . $fname;
4731
+ }
4732
+
4733
+ if ( move_uploaded_file( $_FILES['file']['tmp_name'], $base_dirname . $fname . '.wav')) {
4734
+ echo $base_url . $fname . '.wav';
4735
+ } else {
4736
+ echo 0;
4737
+ }
4738
+ }
4739
+ }
4740
+
4741
+ die();
4742
+
4743
+ }
4744
+ }
4745
 
4746
+ /**
4747
+ * Checks if the file contains an extension which is allowed safe
4748
+ */
4749
+ function wplc_check_file_name_for_safe_extension($filename) {
4750
+ global $wplc_allowed_extensions;
4751
+ return preg_match('/^.*\\.('.$wplc_allowed_extensions.')$/i', $filename);
4752
+ }
4753
 
4754
+ /**
4755
+ * Check the mime type if possible on this server
4756
+ */
4757
+ function wplc_check_file_mime_type($filepath) {
4758
+
4759
+ $mime = false;
4760
+ if (file_exists($filepath)){
4761
+ if (class_exists('finfo')) { // best option is using fileinfo class
4762
+ $result = new finfo();
4763
+ if (is_resource($result) === true) {
4764
+ $mime = $result->file(realpath($filepath), FILEINFO_MIME_TYPE);
4765
  }
4766
+ }
4767
+ if ($mime === false) { // fallback on mime_content_type()
4768
+ if (function_exists('mime_content_type')) {
4769
+ $mime = mime_content_type($filepath);
 
4770
  }
4771
  }
 
4772
  }
4773
+
4774
+ if ($mime !== false) {
4775
+ //We have managed to pull the mime type
4776
+ $allowed_mime_types = array(
4777
+ 'image/gif', 'image/jpeg', 'image/tiff', 'image/bmp','image/png',
4778
+ 'audio/aac', 'video/x-msvideo', 'video/mpeg','audio/wav', 'audio/mpeg', 'video/webm', 'audio/ogg', 'video/ogg',
4779
+ 'application/pdf', 'text/csv', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
4780
+ 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
4781
+ 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'text/plain',
4782
+ 'application/zip', 'application/gzip', 'application/x-rar-compressed', 'application/x-7z-compressed'
4783
+ );
4784
+ return in_array($mime, $allowed_mime_types);
4785
+ }
4786
+ return false;
4787
  }
4788
 
4789
  /**
4790
+ * Adds compatibility for start chat notifications back into the node system
4791
  */
4792
+ function wplc_mrg_chat_notification_extender($data) {
4793
+ return wplc_mrg_notify_via_email($data);
4794
+ }
4795
+ add_action('wplc_hook_initiate_chat', 'wplc_mrg_chat_notification_extender', 99, 1);
 
 
 
 
 
 
 
 
 
 
 
 
4796
 
4797
+ /*
4798
+ * registers wplc_common_node.js passing WPLC_PLUGIN_URL and WPLC_CHAT_SERVER
4799
+ */
4800
+ function wplc_register_common_node() {
4801
+ global $wplc_allowed_extensions;
4802
+ $wplc_settings = wplc_get_options();
4803
+ wp_register_script('wplc-admin-js-agent-common', WPLC_PLUGIN_URL.'/js/wplc_common_node.js', null, WPLC_PLUGIN_VERSION, false);
4804
+ $current_user=wp_get_current_user();
4805
+ $node_config=array(
4806
+ 'baseurl'=>WPLC_PLUGIN_URL,
4807
+ 'serverurl'=>WPLC_CHAT_SERVER,
4808
+ 'enable_typing_preview'=>wplc_get_enable_typing_preview(),
4809
+ 'ring_override'=>wplc_get_ringtone_url_from_config(),
4810
+ 'message_override'=>wplc_get_messagetone_url_from_config(),
4811
+ 'current_wpuserid'=>$current_user->ID,
4812
+ 'allowed_upload_extensions'=>$wplc_allowed_extensions,
4813
+ 'wplc_use_node_server'=>$wplc_settings['wplc_use_node_server'],
4814
+ 'wplc_localized_string_is_typing_single'=>' '.__("is typing...","wplivechat"),
4815
+ 'wplc_user_default_visitor_name' => $wplc_settings['wplc_user_default_visitor_name']
4816
+ );
4817
+ wp_localize_script( 'wplc-admin-js-agent-common', 'config', $node_config );
4818
+ wp_enqueue_script('wplc-admin-js-agent-common');
4819
+ }
4820
 
4821
+ /*
4822
+ * Fetches news feed from the WPLC website
4823
+ */
4824
+ function wplc_fetch_feed(){
4825
+ $response = wp_remote_get('https://feed.wp-livechat.com', array( 'timeout' => 2, 'httpversion' => '1.1', 'user-agent' => 'WordPress'));
4826
+ $response_code = wp_remote_retrieve_response_code($response);
4827
+
4828
+ if ( is_wp_error( $response ) || !is_array( $response ) || $response_code !== 200 ) {
4829
+ _e("An error has occured while fetching the news feed.","wplivechat");
4830
+ } else {
4831
+ echo $response['body'];
4832
  }
4833
+
 
4834
  }
4835
 
4836
+ /*
4837
+ * Get Visitor's IP
4838
  */
4839
+ function wplc_get_user_ip() {
4840
+ if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {
4841
+ $ip = $_SERVER['HTTP_CLIENT_IP'];
4842
+ } elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
4843
+ $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
4844
+ } else {
4845
+ $ip = $_SERVER['REMOTE_ADDR'];
4846
+ }
4847
+
4848
+ if (!filter_var($ip, FILTER_VALIDATE_IP)) {
4849
+ $ip = "0";
4850
+ }
4851
 
4852
+ return sanitize_text_field($ip);
4853
+ }
4854
+
4855
+ function wplc_get_theme() {
4856
+ $wplc_theme = "theme-default";
4857
+ $wplc_settings = wplc_get_options();
4858
+ if (isset($wplc_settings['wplc_theme'])) {
4859
+ $wplc_theme = $wplc_settings['wplc_theme'];
4860
+ }
4861
+ return $wplc_theme;
4862
+ }
4863
+
4864
+ function wplc_get_enable_typing_preview() {
4865
+ $wplc_settings = wplc_get_options();
4866
+ if ($wplc_settings['wplc_gdpr_enabled'] || !$wplc_settings['wplc_use_node_server']) {
4867
+ return false;
4868
+ }
4869
+ return $wplc_settings['wplc_node_enable_typing_preview'];
4870
+ }
4871
+
4872
+ function wplc_get_tone_name($tone, $path) {
4873
+ $tonename = '';
4874
+ if (!empty($tone)) {
4875
+ $tonename = basename($tone);
4876
+ }
4877
+ if (!file_exists($path.$tonename)) {
4878
+ $tonename='';
4879
+ }
4880
+ return $tonename;
4881
+ }
4882
+
4883
+ function wplc_get_tone_url($tone, $path, $url, $default) {
4884
+ $tonename=wplc_get_tone_name($tone, $path);
4885
+ if (empty($tonename)){
4886
+ return $default;
4887
+ }
4888
+ return $url.$tonename;
4889
+ }
4890
+
4891
+ function wplc_get_ringtone_name($ringtone) {
4892
+ return wplc_get_tone_name($ringtone, WPLC_PLUGIN_DIR."/includes/sounds/");
4893
+ }
4894
+
4895
+ function wplc_get_messagetone_name($messagetone) {
4896
+ return wplc_get_tone_name($messagetone, WPLC_PLUGIN_DIR."/includes/sounds/message/");
4897
+ }
4898
+
4899
+ function wplc_get_ringtone_url($ringtone) {
4900
+ return wplc_get_tone_url($ringtone, WPLC_PLUGIN_DIR."/includes/sounds/", WPLC_PLUGIN_URL.'includes/sounds/', WPLC_PLUGIN_URL.'includes/sounds/general/ring.wav');
4901
+ }
4902
+
4903
+ function wplc_get_messagetone_url($messagetone) {
4904
+ return wplc_get_tone_url($messagetone, WPLC_PLUGIN_DIR."/includes/sounds/message/", WPLC_PLUGIN_URL.'includes/sounds/message/', WPLC_PLUGIN_URL.'includes/sounds/general/ding.mp3');
4905
+ }
4906
+
4907
+ function wplc_get_ringtone_url_from_config() {
4908
+ $wplc_settings = wplc_get_options();
4909
+ $ringtone='';
4910
+ if (isset($wplc_settings['wplc_ringtone'])) {
4911
+ $ringtone=$wplc_settings['wplc_ringtone'];
4912
+ }
4913
+ return wplc_get_ringtone_url($ringtone);
4914
+ }
4915
 
4916
+ function wplc_get_messagetone_url_from_config() {
4917
+ $wplc_settings = wplc_get_options();
4918
+ $messagetone='';
4919
+ if (isset($wplc_settings['wplc_messagetone'])) {
4920
+ $messagetone=$wplc_settings['wplc_messagetone'];
4921
+ }
4922
+ return wplc_get_messagetone_url($messagetone);
4923
+ }
4924
+
4925
+ function wplc_sounds_get_array($path) {
4926
+ $wplc_ringtones = array('' => __("Default","wplivechat"));
4927
+ $files = scandir($path);
4928
+ foreach ($files as $value) {
4929
+ if (empty($value) || is_dir($path.$value)) {
4930
+ continue;
4931
+ }
4932
+ $value=basename($value);
4933
+ $wplc_ringtones[$value] = str_replace('_', ' ', pathinfo($value, PATHINFO_FILENAME));
4934
+ }
4935
+ return $wplc_ringtones;
4936
+ }
4937
+
4938
+ if(!function_exists('wplc_clean_session')){
4939
+ function wplc_clean_session() {
4940
+
4941
+ $_SESSION = array();
4942
+ session_write_close();
4943
+ session_start();
4944
+ session_regenerate_id();
4945
+ }
4946
+ }
4947
+
4948
+ function wplc_set_u_session($cid) {
4949
+
4950
+ if(!empty($cid)){
4951
+
4952
+ wplc_clean_session();
4953
+
4954
+ if( session_status() ) {
4955
+
4956
+
4957
+ $rest_token = get_option("wplc_api_secret_token");
4958
+ $wplc_node_token = wplc_node_server_token_get();
4959
+
4960
+ if(!isset($_SESSION['wplc_session_chat_session_id'])){
4961
+
4962
+ $_SESSION['wplc_session_chat_session_id'] = intval($cid);
4963
+ $_SESSION['wplc_session_chat_session_active'] = 1;
4964
+
4965
+ if($rest_token){
4966
+ $_SESSION['wplc_rest_token'] = $rest_token;
4967
+ }
4968
+
4969
+ if($wplc_node_token){
4970
+ $_SESSION['wplc_cloud_token'] = $wplc_node_token;
4971
+ }
4972
+
4973
+ }
4974
+
4975
+ session_commit();
4976
+
4977
+ return $cid;
4978
  }
4979
  }
 
4980
  }
4981
 
4982
+ function wplc_start_session() {
4983
+ if (session_status() !== PHP_SESSION_ACTIVE) {
4984
+ session_start();
4985
+ }
4986
+ }
4987
 
4988
+ function wplc_force_bool($arr, $key, $default=false) {
4989
+ if (isset($arr[$key])) {
4990
+ return boolval($arr[$key]);
4991
+ }
4992
+ if (is_array($default)) {
4993
+ return $default[$key];
4994
+ }
4995
+ return $default;
4996
+ }
 
 
 
 
 
4997
 
4998
+ function wplc_force_int($arr, $key, $default=0) {
4999
+ if (isset($arr[$key])) {
5000
+ return intval($arr[$key]);
5001
+ }
5002
+ if (is_array($default)) {
5003
+ return $default[$key];
5004
+ }
5005
+ return $default;
5006
+ }
 
 
5007
 
5008
+ function wplc_force_string($arr, $key, $default='') {
5009
+ if (isset($arr[$key])) {
5010
+ return trim(strval($arr[$key]));
5011
+ }
5012
+ if (is_array($default)) {
5013
+ return $default[$key];
5014
+ }
5015
+ return $default;
5016
  }
5017
 
5018
+ function wplc_force_url($arr, $key, $default='') {
5019
+ if (isset($arr[$key]) && filter_var($arr[$key], FILTER_VALIDATE_URL)) {
5020
+ return trim(strval($arr[$key]));
5021
+ }
5022
+ if (is_array($default)) {
5023
+ return $default[$key];
5024
+ }
5025
+ return $default;
5026
+ }
 
 
 
 
 
5027
 
5028
+ function wplc_cleanup_old_options($wplc_settings) {
5029
+ // parameters migration from WPLC_ACBC_SETTINGS to WPLC_SETTINGS
5030
+ $wplc_acbc_settings = get_option('WPLC_ACBC_SETTINGS');
5031
+ if (!empty($wplc_acbc_settings)) {
5032
+ if (isset($wplc_acbc_settings['wplc_chat_delay'])) {
5033
+ $wplc_settings['wplc_chat_delay'] = intval($wplc_acbc_settings['wplc_chat_delay']);
5034
+ }
5035
+ if (isset($wplc_acbc_settings['wplc_chat_icon'])) {
5036
+ $wplc_settings['wplc_chat_icon'] = strval($wplc_acbc_settings['wplc_chat_icon']);
5037
+ }
5038
+ if (isset($wplc_acbc_settings['wplc_chat_logo'])) {
5039
+ $wplc_settings['wplc_chat_logo'] = strval($wplc_acbc_settings['wplc_chat_logo']);
5040
+ }
5041
+ if (isset($wplc_acbc_settings['wplc_chat_name'])) {
5042
+ $wplc_settings['wplc_chat_name'] = strval($wplc_acbc_settings['wplc_chat_name']);
5043
+ }
5044
+ if (isset($wplc_acbc_settings['wplc_chat_pic'])) {
5045
+ $wplc_settings['wplc_chat_pic'] = strval($wplc_acbc_settings['wplc_chat_pic']);
5046
+ }
5047
+ if (isset($wplc_acbc_settings['wplc_pro_chat_email_address'])) {
5048
+ $wplc_settings['wplc_pro_chat_email_address'] = strval($wplc_acbc_settings['wplc_pro_chat_email_address']);
5049
+ }
5050
+ if (isset($wplc_acbc_settings['wplc_pro_chat_notification'])) {
5051
+ $wplc_settings['wplc_pro_chat_notification'] = strval($wplc_acbc_settings['wplc_pro_chat_notification']);
5052
+ }
5053
+ if (isset($wplc_acbc_settings['wplc_social_fb'])) {
5054
+ $wplc_settings['wplc_social_fb'] = strval($wplc_acbc_settings['wplc_social_fb']);
5055
+ }
5056
+ if (isset($wplc_acbc_settings['wplc_social_tw'])) {
5057
+ $wplc_settings['wplc_social_tw'] = strval($wplc_acbc_settings['wplc_social_tw']);
5058
+ }
5059
+ if (isset($wplc_acbc_settings['wplc_use_wp_name'])) {
5060
+ $wplc_settings['wplc_use_wp_name'] = boolval($wplc_acbc_settings['wplc_use_wp_name']);
5061
+ }
5062
+ delete_option('WPLC_ACBC_SETTINGS');
5063
+ }
5064
+
5065
+ $wplc_encrypt_data = get_option("WPLC_ENCRYPT_SETTINGS");
5066
+ if (!empty($wplc_encrypt_data)) {
5067
+ $wplc_settings['wplc_enable_encryption'] = boolval($wplc_encrypt_data['wplc_enable_encryption']);
5068
+ delete_option('WPLC_ENCRYPT_SETTINGS');
5069
+ }
5070
 
5071
+ $wplc_inex_data = get_option("WPLC_INEX_SETTINGS");
5072
+ if (!empty($wplc_inex_data)) {
5073
+ if (isset($wplc_inex_data['wplc_exclude_from_pages'])) {
5074
+ $wplc_settings['wplc_exclude_from_pages'] = strval($wplc_inex_data['wplc_exclude_from_pages']);
5075
+ }
5076
+ if (isset($wplc_inex_data['wplc_include_on_pages'])) {
5077
+ $wplc_settings['wplc_include_on_pages'] = strval($wplc_inex_data['wplc_include_on_pages']);
5078
+ }
5079
+ if (isset($wplc_inex_data['wplc_exclude_home'])) {
5080
+ $wplc_settings['wplc_exclude_home'] = boolval($wplc_inex_data['wplc_exclude_home']);
5081
+ }
5082
+ if (isset($wplc_inex_data['wplc_exclude_archive'])) {
5083
+ $wplc_settings['wplc_exclude_archive'] = strval($wplc_inex_data['wplc_exclude_archive']);
5084
+ }
5085
+ if (isset($wplc_inex_data['wplc_exclude_post_types'])) {
5086
+ $wplc_settings['wplc_exclude_post_types'] = strval($wplc_inex_data['wplc_exclude_post_types']);
5087
  }
5088
+ if (isset($wplc_inex_data['wplc_make_agent'])) {
5089
+ $wplc_settings['wplc_make_agent'] = boolval($wplc_inex_data['wplc_make_agent']);
5090
+ }
5091
+ delete_option('WPLC_INEX_SETTINGS');
5092
+ }
5093
 
5094
+ $wplc_choose_data = get_option("WPLC_CHOOSE_SETTINGS");
5095
+ if (!empty($wplc_choose_data)) {
5096
+ if (isset($wplc_choose_data['wplc_auto_online'])) {
5097
+ $wplc_settings['wplc_allow_agents_set_status'] = boolval($wplc_choose_data['wplc_auto_online']);
5098
+ }
5099
+ delete_option('WPLC_CHOOSE_SETTINGS');
5100
+ }
5101
 
5102
+ $wplc_et_data = get_option("WPLC_ET_SETTINGS");
5103
+ if (!empty($wplc_et_data)) {
5104
+ if (isset($wplc_et_data['wplc_enable_transcripts'])) {
5105
+ $wplc_settings['wplc_enable_transcripts'] = boolval($wplc_et_data['wplc_enable_transcripts']);
5106
+ }
5107
+ if (isset($wplc_et_data['wplc_send_transcripts_when_chat_ends'])) {
5108
+ $wplc_settings['wplc_send_transcripts_when_chat_ends'] = boolval($wplc_et_data['wplc_send_transcripts_when_chat_ends']);
5109
+ }
5110
+ if (isset($wplc_et_data['wplc_send_transcripts_to'])) {
5111
+ $wplc_settings['wplc_send_transcripts_to'] = strval($wplc_et_data['wplc_send_transcripts_to']);
5112
+ }
5113
+ if (isset($wplc_et_data['wplc_et_email_body'])) {
5114
+ $wplc_settings['wplc_et_email_body'] = strval($wplc_et_data['wplc_et_email_body']);
5115
+ }
5116
+ if (isset($wplc_et_data['wplc_et_email_header'])) {
5117
+ $wplc_settings['wplc_et_email_header'] = strval($wplc_et_data['wplc_et_email_header']);
5118
+ }
5119
+ if (isset($wplc_et_data['wplc_et_email_footer'])) {
5120
+ $wplc_settings['wplc_et_email_footer'] = strval($wplc_et_data['wplc_et_email_footer']);
5121
+ }
5122
+ delete_option('WPLC_ET_SETTINGS');
5123
+ }
5124
 
5125
+ $wplc_bh_settings = get_option("WPLC_BH_SETTINGS");
5126
+ if (!empty($wplc_bh_settings)) {
5127
+ if (isset($wplc_bh_settings['enabled'])) {
5128
+ $wplc_settings['wplc_bh_enable'] = boolval($wplc_bh_settings['enabled']);
5129
+ }
5130
+ if (isset($wplc_bh_settings['interval'])) {
5131
+ $wplc_settings['wplc_bh_interval'] = intval($wplc_bh_settings['interval']);
5132
+ }
5133
+ if (isset($wplc_bh_settings['start'])) {
5134
+ if (isset($wplc_bh_settings['start']['h'])) {
5135
+ $wplc_settings['wplc_bh_hours_start'] = intval($wplc_bh_settings['start']['h']);
5136
+ }
5137
+ if (isset($wplc_bh_settings['start']['m'])) {
5138
+ $wplc_settings['wplc_bh_minutes_start'] = intval($wplc_bh_settings['start']['m']);
5139
+ }
5140
+ }
5141
+ if (isset($wplc_bh_settings['end'])) {
5142
+ if (isset($wplc_bh_settings['end']['h'])) {
5143
+ $wplc_settings['wplc_bh_hours_end'] = intval($wplc_bh_settings['end']['h']);
5144
+ }
5145
+ if (isset($wplc_bh_settings['end']['m'])) {
5146
+ $wplc_settings['wplc_bh_minutes_end'] = intval($wplc_bh_settings['end']['m']);
5147
+ }
5148
+ }
5149
+ delete_option('WPLC_BH_SETTINGS');
5150
+ }
5151
 
5152
+ $wplc_advanced_settings = get_option("WPLC_ADVANCED_SETTINGS");
5153
+ if (!empty($wplc_advanced_settings)) {
5154
+ if (isset($wplc_advanced_settings['wplc_iterations'])) {
5155
+ $wplc_settings['wplc_iterations'] = intval($wplc_advanced_settings['wplc_iterations']);
5156
+ }
5157
+ if (isset($wplc_advanced_settings['wplc_delay_between_loops'])) {
5158
+ $wplc_settings['wplc_delay_between_loops'] = intval($wplc_advanced_settings['wplc_delay_between_loops']);
5159
+ }
5160
+ delete_option('WPLC_ADVANCED_SETTINGS');
5161
+ }
5162
+
5163
+ // fixes
5164
+ if ($wplc_settings['wplc_require_user_info']=='1') {
5165
+ $wplc_settings['wplc_require_user_info']='both';
5166
+ }
5167
+ if ($wplc_settings['wplc_require_user_info']=='0') {
5168
+ $wplc_settings['wplc_require_user_info']='none';
5169
+ }
5170
+
5171
+ return $wplc_settings;
5172
+ }
5173
+
5174
+ function wplc_get_agent_status($uid) {
5175
+ $wplc_settings = wplc_get_options();
5176
+ $choose_array = wplc_get_all_agent_status();
5177
+ if (!isset($choose_array[$uid])) {
5178
+ $choose_array[$uid]=true;
5179
+ update_option("WPLC_CHOOSE_ACCEPTING", $choose_array);
5180
+ }
5181
+ if (!$wplc_settings['wplc_allow_agents_set_status'] && !$choose_array[$uid]) { // force online if agents cannot set status
5182
+ $choose_array[$uid]=true;
5183
+ update_option("WPLC_CHOOSE_ACCEPTING", $choose_array);
5184
+ }
5185
+ return $choose_array[$uid];
5186
+ }
5187
+
5188
+ function wplc_set_agent_status($uid,$online) {
5189
+ $choose_array = wplc_get_all_agent_status();
5190
+ if (!isset($choose_array[$uid]) || $choose_array[$uid]!=boolval($online)) {
5191
+ $choose_array[$uid]=boolval($online);
5192
+ update_option("WPLC_CHOOSE_ACCEPTING", $choose_array);
5193
+ }
5194
  }
5195
+
5196
+ function wplc_get_all_agent_status() {
5197
+ $choose_array = get_option("WPLC_CHOOSE_ACCEPTING");
5198
+ if (!is_array($choose_array)) {
5199
+ $choose_array = array();
5200
+ }
5201
+ return $choose_array;
5202
+ }
5203
+
5204
+ function wplc_ajax_generate_new_tokens() {
5205
+ if (isset($_POST['action']) && ($_POST['action'] === "wplc_generate_new_node_token" || $_POST['action'] === "wplc_new_secret_key") && isset($_POST['nonce']) && wplc_maa_check_if_user_is_agent() !== "not_user_agent") {
5206
+
5207
+ $nonce = $_POST['nonce'];
5208
+ $action = $_POST['action'];
5209
+ $error = false;
5210
+
5211
+ if($action === "wplc_generate_new_node_token") {
5212
+ if(wp_verify_nonce( $nonce, 'generate_new_token')) {
5213
+ $res = wplc_node_server_token_get(true);
5214
+ echo $res;
5215
+ }else {
5216
+ $error = true;
5217
+ }
5218
+ }elseif ($action === "wplc_new_secret_key") {
5219
+ if(wp_verify_nonce( $nonce, 'generate_new_secret_token')) {
5220
+ $user_token = wplc_api_s_key_create();
5221
+ update_option("wplc_api_secret_token", $user_token);
5222
+ echo $user_token;
5223
+ }else {
5224
+ $error = true;
5225
+ }
5226
+ }
5227
+
5228
+ if($error === true){
5229
+ _e("You do not have permission to perform this action","wplivechat");
5230
+ }
5231
+
5232
+ }else {
5233
+ _e("You do not have permission to perform this action","wplivechat");
5234
+ }
5235
+ wp_die();
5236
+ }
images/48px.png DELETED
Binary file
images/48px_n.png DELETED
Binary file
images/Survey_Box_Standard.jpg DELETED
Binary file
images/codecabin.png DELETED
Binary file
images/iconmicro.png CHANGED
Binary file
images/logo-for-chat-box.jpg CHANGED
Binary file
images/picture-for-chat-box.jpg CHANGED
Binary file
images/support.png CHANGED
Binary file
images/tcx48_n.png ADDED
Binary file
images/tcx48px.png ADDED
Binary file
images/wplc-logo.png CHANGED
Binary file
images/wplc_dashboard_department_selector.png ADDED
Binary file
images/wplc_loading.png CHANGED
Binary file
images/wplc_notification_icon.png CHANGED
Binary file
includes/blocks/wplc-chat-box/block.js CHANGED
@@ -1,4 +1,4 @@
1
- /* BLOCK: WP Live Chat Support Chat Box */
2
 
3
  ( function() {
4
 
1
+ /* BLOCK: WP Live Chat by 3CX Chat Box */
2
 
3
  ( function() {
4
 
includes/blocks/wplc-chat-box/editor.css CHANGED
@@ -50,7 +50,7 @@
50
  width: 100%;
51
  bottom: 0;
52
  left: 0;
53
- background: #ED832F;
54
  opacity: .9;
55
  }
56
 
@@ -64,7 +64,7 @@
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);
50
  width: 100%;
51
  bottom: 0;
52
  left: 0;
53
+ background: #0596d4;
54
  opacity: .9;
55
  }
56
 
64
  margin:0;
65
  background-size: cover;
66
  background-position: center;
67
+ background-color:#0596d4 !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);
includes/blocks/wplc-chat-box/index.php CHANGED
@@ -7,9 +7,18 @@ 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');
@@ -51,7 +60,7 @@ function wplc_gutenberg_settings_content() {
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>
@@ -62,7 +71,7 @@ function wplc_gutenberg_settings_content() {
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"/>
@@ -73,7 +82,7 @@ function wplc_gutenberg_settings_content() {
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 ?>"/>
@@ -81,13 +90,13 @@ function wplc_gutenberg_settings_content() {
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 ?>"/>
@@ -95,7 +104,7 @@ function wplc_gutenberg_settings_content() {
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>
@@ -162,13 +171,13 @@ function wplc_gutenberg_save_settings() {
162
  }
163
 
164
  if (isset($_POST['wplc_gutenberg_text']) && $_POST['wplc_gutenberg_text'] !== '0') {
165
- $wplc_gutenberg_data['wplc_gutenberg_text'] = sanitize_text_field($_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'] = sanitize_text_field($_POST['wplc_gutenberg_icon']);
172
  } else {
173
  $wplc_gutenberg_data['wplc_gutenberg_icon'] = 'fa-commenting-o';
174
  }
@@ -190,53 +199,60 @@ function wplc_gutenberg_save_settings() {
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'] ? sanitize_text_field( $gutenberg_settings['wplc_gutenberg_size'] ) : 2 );
210
- $settings['wplc_logo'] = $gutenberg_logo;
211
- $settings['wplc_text'] = ( $gutenberg_settings['wplc_gutenberg_text'] ? sanitize_text_field( $gutenberg_settings['wplc_gutenberg_text'] ) : __( 'Live Chat', 'wplivechat' ) );
212
-
213
- $settings['wplc_icon'] = ( $gutenberg_settings['wplc_gutenberg_icon'] ? sanitize_text_field( $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
  }
7
  exit;
8
  }
9
 
10
+ function wplc_get_gutenberg_options() {
11
+ global $get_gutenberg_options;
12
+ if (!$get_gutenberg_options) {
13
+ $get_gutenberg_options = get_option('wplc_gutenberg_settings');
14
+ }
15
+ }
16
+
17
  function wplc_gutenberg_block_settings() {
18
  add_filter('wplc_filter_setting_tabs','wplc_gutenberg_setting_tabs');
19
  add_action("wplc_hook_settings_page_more_tabs","wplc_gutenberg_settings_content");
20
+ global $get_gutenberg_options;
21
+ wplc_get_gutenberg_options();
22
  }
23
 
24
  add_action('admin_init', 'wplc_gutenberg_block_settings');
60
  </tr>
61
 
62
  <tr>
63
+ <td width='300' valign='top'><?php _e('Block size', 'wplivechat') ?>:</td>
64
  <td>
65
  <select id="wplc_gutenberg_size" name="wplc_gutenberg_size" value="1">
66
  <option <?php echo ($gutenberg_size == 1) ? 'selected' : ''; ?> value="1">Small</option>
71
  </tr>
72
 
73
  <tr>
74
+ <td width='300' valign='top'><?php _e('Set block logo', 'wplivechat') ?>:</td>
75
 
76
  <td>
77
  <input type="button" id="wplc_gutenberg_upload_logo" class="button button-primary" value="Upload Logo"/>
82
  </tr>
83
 
84
  <tr>
85
+ <td width='300' valign='top'><?php _e('Text in block', 'wplivechat') ?>:</td>
86
 
87
  <td>
88
  <input type="text" id="wplc_gutenberg_text" name="wplc_gutenberg_text" placeholder="Block text" value="<?php echo $gutenberg_text ?>"/>
90
  </tr>
91
 
92
  <tr>
93
+ <td width='300' valign='top'><?php _e('Use icon', 'wplivechat') ?>:<td>
94
  <input type="checkbox" id="wplc_gutenberg_enable_icon" name="wplc_gutenberg_enable_icon" <?php echo $icon_checked; ?>/>
95
  </td>
96
  </tr>
97
 
98
  <tr>
99
+ <td width='300' valign='top'><?php _e('Icon in block', 'wplivechat') ?>:</td>
100
 
101
  <td>
102
  <input type="text" id="wplc_gutenberg_icon" name="wplc_gutenberg_icon" placeholder="Block icon" value="<?php echo $gutenberg_icon ?>"/>
104
  </tr>
105
 
106
  <tr>
107
+ <td width='300' valign='top'><?php _e("Preview block", "wplivechat") ?>:</td>
108
 
109
  <td>
110
  <div id="wplc-chat-box" class="wplc_gutenberg_preview"></div>
171
  }
172
 
173
  if (isset($_POST['wplc_gutenberg_text']) && $_POST['wplc_gutenberg_text'] !== '0') {
174
+ $wplc_gutenberg_data['wplc_gutenberg_text'] = stripslashes(sanitize_text_field($_POST['wplc_gutenberg_text']));
175
  } else {
176
  $wplc_gutenberg_data['wplc_gutenberg_text'] = 'Live Chat';
177
  }
178
 
179
  if (isset($_POST['wplc_gutenberg_icon']) && $_POST['wplc_gutenberg_icon'] !== '0') {
180
+ $wplc_gutenberg_data['wplc_gutenberg_icon'] = stripslashes(sanitize_text_field($_POST['wplc_gutenberg_icon']));
181
  } else {
182
  $wplc_gutenberg_data['wplc_gutenberg_icon'] = 'fa-commenting-o';
183
  }
199
  update_option('wplc_gutenberg_settings', $wplc_gutenberg_data);
200
  }
201
  }
202
+
203
  add_action( 'enqueue_block_editor_assets', 'wplc_chat_box_block_editor_assets' );
204
 
205
  function wplc_chat_box_block_editor_assets() {
206
+ global $get_gutenberg_options;
207
+ $gutenberg_settings = $get_gutenberg_options;
208
+ if($get_gutenberg_options['wplc_gutenberg_enable']) {
209
+ // Scripts
210
+ wp_enqueue_script(
211
+ 'wplc_chat_box',
212
+ plugins_url( 'block.js', __FILE__ ),
213
+ array( 'wp-blocks', 'wp-i18n', 'wp-element' ),
214
+ filemtime( plugin_dir_path( __FILE__ ) . 'block.js' )
215
+ );
216
+
217
+ $gutenberg_logo = $gutenberg_settings['wplc_gutenberg_logo'];
218
+ $settings['wplc_typing'] = __("Type here","wplivechat");
219
+ $settings['wplc_enabled'] = $gutenberg_settings['wplc_gutenberg_enable'];
220
+ $settings['wplc_size'] = ( $gutenberg_settings['wplc_gutenberg_size'] ? sanitize_text_field( $gutenberg_settings['wplc_gutenberg_size'] ) : 2 );
221
+ $settings['wplc_logo'] = $gutenberg_logo;
222
+ $settings['wplc_text'] = ( $gutenberg_settings['wplc_gutenberg_text'] ? sanitize_text_field( $gutenberg_settings['wplc_gutenberg_text'] ) : __( 'Live Chat', 'wplivechat' ) );
223
+
224
+ $settings['wplc_icon'] = ( $gutenberg_settings['wplc_gutenberg_icon'] ? sanitize_text_field( $gutenberg_settings['wplc_gutenberg_icon'] ) : 'fa-commenting-o' );
225
+ $settings['wplc_icon_enabled'] = $gutenberg_settings['wplc_gutenberg_enable_icon'];
226
+ $settings['wplc_custom_html'] = $gutenberg_settings['wplc_custom_html'];
227
+
228
+ wp_localize_script( 'wplc_chat_box', 'wplc_settings', $settings );
229
+
230
+ // Styles
231
+ wp_enqueue_style(
232
+ 'wplc_chat_box-editor',
233
+ plugins_url( 'editor.css', __FILE__ ),
234
+ array( 'wp-edit-blocks' ),
235
+ filemtime( plugin_dir_path( __FILE__ ) . 'editor.css' )
236
+ );
237
+ }
238
  }
239
 
240
+
241
  add_action( 'enqueue_block_assets', 'wplc_chat_box_block_block_assets' );
242
 
243
  function wplc_chat_box_block_block_assets() {
244
+ global $get_gutenberg_options;
245
+ if($get_gutenberg_options['wplc_gutenberg_enable']) {
246
+ // Styles for front-end
247
+ wp_enqueue_style(
248
+ 'wplc_chat_box-front-end',
249
+ plugins_url( 'style.css', __FILE__ ),
250
+ array( 'wp-blocks' ),
251
+ filemtime( plugin_dir_path( __FILE__ ) . 'style.css' )
252
+ );
253
+ wp_enqueue_style(
254
+ 'wplc_chat_box-front-end-template', plugins_url( 'wplc_gutenberg_template_styles.css', __FILE__ ), array( 'wp-blocks' ),
255
+ filemtime( plugin_dir_path( __FILE__ ) . 'wplc_gutenberg_template_styles.css' )
256
+ );
257
+ }
258
  }
includes/blocks/wplc-chat-box/style.css CHANGED
@@ -56,7 +56,7 @@
56
  width: 100%;
57
  bottom: 0;
58
  left: 0;
59
- background: #ED832F;
60
  opacity: .9;
61
  }
62
 
@@ -70,7 +70,7 @@
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);
56
  width: 100%;
57
  bottom: 0;
58
  left: 0;
59
+ background: #0596d4;
60
  opacity: .9;
61
  }
62
 
70
  margin:0;
71
  background-size: cover;
72
  background-position: center;
73
+ background-color:#0596d4 !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);
includes/blocks/wplc-chat-box/wplc_gutenberg_template_styles.css CHANGED
@@ -57,7 +57,7 @@
57
  width: 100%;
58
  bottom: 0;
59
  left: 0;
60
- background: #ED832F;
61
  opacity: .9;
62
  }
63
 
@@ -71,7 +71,7 @@
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);
57
  width: 100%;
58
  bottom: 0;
59
  left: 0;
60
+ background: #0596d4;
61
  opacity: .9;
62
  }
63
 
71
  margin:0;
72
  background-size: cover;
73
  background-position: center;
74
+ background-color:#0596d4 !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);
includes/blocks/wplc-inline-chat-box/block.js CHANGED
@@ -1,121 +1,121 @@
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.children;
8
- var registerBlockType = wp.blocks.registerBlockType;
9
-
10
- var chat_preview_loader = '<span><small><em>Your chat box will show up here when page is viewed</em></small></span>';
11
-
12
- registerBlockType( 'wp-live-chat-support/wplc-inline-chat-box', {
13
- title: __( 'WP Live Chat Box', 'WPLC' ),
14
- icon: 'format-chat',
15
- category: 'common',
16
-
17
- edit: function( props ) {
18
-
19
- var content = typeof props.attributes.content !== 'undefined' ? props.attributes.content : 'normal' ;
20
- var focus = props.focus;
21
-
22
- function onChangeContent( newContent ) {
23
- props.setAttributes( { content: newContent } );
24
- }
25
-
26
- /*jQuery(document).on('change', '.wplc_select_theme', function(){
27
- var id = $(this).val();
28
- onChangeContent( id );
29
- });*/
30
-
31
- theme_classes = 'wplc_' + content ;
32
-
33
- element = el(
34
- 'h4',
35
- { },
36
- 'Live Chat Box'
37
- );
38
-
39
- /*select_text = el(
40
- 'span',
41
- { },
42
- 'Select a style: '
43
- );*/
44
-
45
- icon = el(
46
- 'span',
47
- { className: "wplc_gutenberg_icon dashicons dashicons-format-chat" }
48
- );
49
-
50
- chat_box_preview = el(
51
- 'div',
52
- {
53
- className: 'wplc_gutenberg_preview',
54
- dangerouslySetInnerHTML: { __html: chat_preview_loader }
55
- }
56
- );
57
-
58
- /*var option_1 = el(
59
- 'option',
60
- { value: 'normal', selected: 'selected' },
61
- 'Normal'
62
- );
63
- var option_2 = el(
64
- 'option',
65
- { value: 'center' },
66
- 'Center'
67
- );
68
- var option_3 = el(
69
- 'option',
70
- { value: 'wide' },
71
- 'Wide'
72
- );
73
-
74
- var select = el(
75
- 'select',
76
- { className: 'wplc_select_theme' },
77
- option_1,
78
- option_2,
79
- option_3
80
- );*/
81
-
82
- var style = {
83
- display: 'none'
84
- }
85
-
86
- /*var editable_content = el(
87
- Editable,
88
- {
89
- tagName: 'p',
90
- className: 'wplc_selected_theme',
91
- value: content,
92
- onChange: onChangeContent,
93
- focus: focus,
94
- onFocus: props.setFocus,
95
- style: style
96
- },
97
- );*/
98
-
99
- return el(
100
- 'div',
101
- { id: 'wplc-inline-chat-box',
102
- className: theme_classes
103
- },
104
- element,
105
- chat_box_preview
106
- );
107
- },
108
-
109
- save: function( props ) {
110
- var style_class = props.attributes.content;
111
- var content = '[wplc_live_chat style="' + style_class + '"]';
112
-
113
- return el(
114
- 'div',
115
- { id: 'wplc-inline-chat-box',
116
- dangerouslySetInnerHTML: { __html: content }
117
- }
118
- );
119
- },
120
- } );
121
- })();
1
+ /* BLOCK: WP Live Chat by 3CX - 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.children;
8
+ var registerBlockType = wp.blocks.registerBlockType;
9
+
10
+ var chat_preview_loader = '<span><small><em>Your chat box will show up here when page is viewed</em></small></span>';
11
+
12
+ registerBlockType( 'wp-live-chat-support/wplc-inline-chat-box', {
13
+ title: __( 'WP Live Chat Box', 'WPLC' ),
14
+ icon: 'format-chat',
15
+ category: 'common',
16
+
17
+ edit: function( props ) {
18
+
19
+ var content = typeof props.attributes.content !== 'undefined' ? props.attributes.content : 'normal' ;
20
+ var focus = props.focus;
21
+
22
+ function onChangeContent( newContent ) {
23
+ props.setAttributes( { content: newContent } );
24
+ }
25
+
26
+ /*jQuery(document).on('change', '.wplc_select_theme', function(){
27
+ var id = $(this).val();
28
+ onChangeContent( id );
29
+ });*/
30
+
31
+ theme_classes = 'wplc_' + content ;
32
+
33
+ element = el(
34
+ 'h4',
35
+ { },
36
+ 'Live Chat Box'
37
+ );
38
+
39
+ /*select_text = el(
40
+ 'span',
41
+ { },
42
+ 'Select a style: '
43
+ );*/
44
+
45
+ icon = el(
46
+ 'span',
47
+ { className: "wplc_gutenberg_icon dashicons dashicons-format-chat" }
48
+ );
49
+
50
+ chat_box_preview = el(
51
+ 'div',
52
+ {
53
+ className: 'wplc_gutenberg_preview',
54
+ dangerouslySetInnerHTML: { __html: chat_preview_loader }
55
+ }
56
+ );
57
+
58
+ /*var option_1 = el(
59
+ 'option',
60
+ { value: 'normal', selected: 'selected' },
61
+ 'Normal'
62
+ );
63
+ var option_2 = el(
64
+ 'option',
65
+ { value: 'center' },
66
+ 'Center'
67
+ );
68
+ var option_3 = el(
69
+ 'option',
70
+ { value: 'wide' },
71
+ 'Wide'
72
+ );
73
+
74
+ var select = el(
75
+ 'select',
76
+ { className: 'wplc_select_theme' },
77
+ option_1,
78
+ option_2,
79
+ option_3
80
+ );*/
81
+
82
+ var style = {
83
+ display: 'none'
84
+ }
85
+
86
+ /*var editable_content = el(
87
+ Editable,
88
+ {
89
+ tagName: 'p',
90
+ className: 'wplc_selected_theme',
91
+ value: content,
92
+ onChange: onChangeContent,
93
+ focus: focus,
94
+ onFocus: props.setFocus,
95
+ style: style
96
+ },
97
+ );*/
98
+
99
+ return el(
100
+ 'div',
101
+ { id: 'wplc-inline-chat-box',
102
+ className: theme_classes
103
+ },
104
+ element,
105
+ chat_box_preview
106
+ );
107
+ },
108
+
109
+ save: function( props ) {
110
+ var style_class = props.attributes.content;
111
+ var content = '[wplc_live_chat style="' + style_class + '"]';
112
+
113
+ return el(
114
+ 'div',
115
+ { id: 'wplc-inline-chat-box',
116
+ dangerouslySetInnerHTML: { __html: content }
117
+ }
118
+ );
119
+ },
120
+ } );
121
+ })();
includes/blocks/wplc-inline-chat-box/editor.css CHANGED
@@ -120,7 +120,7 @@
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;
120
 
121
  .wplc_gutenberg_loader {
122
  border: 7px solid #f3f3f3;
123
+ border-top: 7px solid #0596d4;
124
  border-radius: 50%;
125
  width: 50px;
126
  height: 50px;
includes/blocks/wplc-inline-chat-box/index.php CHANGED
@@ -1,61 +1,66 @@
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
+ global $get_gutenberg_options;
14
+ if($get_gutenberg_options['wplc_gutenberg_enable']) {
15
+ $agent_data['id'] = get_current_user_id();
16
+ $agent_data['info'] = get_userdata( $agent_data['id'] );
17
+ $agent_data['name'] = $agent_data['info']->display_name;
18
+ $agent_data['email'] = md5($agent_data['info']->user_email);
19
+
20
+ $wplc_settings = wplc_get_options();
21
+ $style_settings['settings'] = wplc_get_options();
22
+ $style_settings['color_1'] = $wplc_settings['wplc_settings_color1'];
23
+
24
+ $wplc_images['background_image'] = plugins_url( '../../../images/bg/' . $wplc_settings['wplc_settings_bg'], __FILE__ );
25
+ $wplc_images['open_icon'] = plugins_url( '../../../images/iconRetina.png', __FILE__ );
26
+ $wplc_images['close_icon'] = plugins_url( '../../../images/iconCloseRetina.png', __FILE__ );
27
+
28
+ // Scripts
29
+ wp_enqueue_script( 'wplc_inline_chat_box',
30
+ plugins_url( 'block.js', __FILE__ ),
31
+ array( 'wp-blocks', 'wp-i18n', 'wp-element' ),
32
+ filemtime( plugin_dir_path( __FILE__ ) . 'block.js' )
33
+ );
34
+
35
+ wp_localize_script( 'wplc_inline_chat_box', 'wplc_agent_info', $agent_data );
36
+ wp_localize_script( 'wplc_inline_chat_box', 'wplc_styles', $style_settings );
37
+ wp_localize_script( 'wplc_inline_chat_box', 'wplc_images', $wplc_images );
38
+
39
+ wp_enqueue_script( 'wplc_chat_box_functions',
40
+ plugins_url( 'wplc_functions.js', __FILE__ ),
41
+ array( 'wp-blocks', 'wp-i18n', 'wp-element' )
42
+ );
43
+
44
+
45
+ // Styles
46
+ wp_enqueue_style( 'wplc_inline_chat_box-editor',
47
+ plugins_url( 'editor.css', __FILE__ ),
48
+ array( 'wp-edit-blocks' ),
49
+ filemtime( plugin_dir_path( __FILE__ ) . 'editor.css' )
50
+ );
51
+ }
52
+ }
53
+
54
+ add_action( 'enqueue_block_assets', 'wplc_inline_chat_box_block_block_assets' );
55
+
56
+ function wplc_inline_chat_box_block_block_assets() {
57
+ global $get_gutenberg_options;
58
+ if($get_gutenberg_options['wplc_gutenberg_enable']) {
59
+ // Styles for front-end
60
+ wp_enqueue_style( 'wplc_inline_chat_box_front_end',
61
+ plugins_url( 'style.css', __FILE__ ),
62
+ array( 'wp-blocks' ),
63
+ filemtime( plugin_dir_path( __FILE__ ) . 'style.css' )
64
+ );
65
+ }
66
  }
includes/dashboard_page.php CHANGED
@@ -5,55 +5,96 @@ if ( ! defined( 'ABSPATH' ) ) {
5
  ?>
6
 
7
  <script>
8
- var nifty_api_key = '<?php echo get_option("wplc_node_server_secret_token"); ?>';
9
  </script>
10
 
11
  <?php
12
  $user = wp_get_current_user();
 
13
 
14
  global $wpdb;
15
  global $wplc_tblname_chats;
16
- $sql = "SELECT COUNT(id) as total_chats FROM `$wplc_tblname_chats` WHERE `agent_id` <> 0";
 
 
 
 
 
 
 
 
17
  $results = $wpdb->get_row( $sql );
 
18
  if ($results) {
19
- $total_count = intval($results->total_chats);
20
- } else {
21
- $total_count = 0;
22
- }
 
 
 
 
 
 
23
  ?>
24
 
25
  <div class="wrap wplc_wrap">
26
- <h2 id="wplc_dashboard_page_title"><?php _e( 'WP Live Chat Support Dashboard', 'wplivechat' ) ?></h2>
27
  <div class="wplc_dashboard_container">
28
- <div class="wplc_dashboard_row">
29
- <div class="wplc_panel_col wplc_col_6">
30
- <div class="wplc_panel">
31
- <h3 class="wplc_panel_title"><?php printf( __( 'Welcome, %s', 'wplivechat' ), $user->display_name ); ?></h3>
32
- </div>
33
- </div>
34
- <div class="wplc_panel_col wplc_col_6">
35
- <div class="wplc_panel pull-right">
36
- </div>
37
- </div>
38
- </div>
39
-
40
  <div class="wplc_dashboard_row">
41
  <div class="wplc_panel_col wplc_col_12">
42
  <div class="wplc_panel">
 
43
  <div class="wplc_material_panel">
44
- <div class="wplc_panel_col wplc_col_4 wplc-center">
45
- <h4><?php _e("Actions","wplivechat"); ?></h4>
46
- <p><a href='admin.php?page=wplivechat-menu&subaction=override' class='button-primary'><?php echo __("Chat with Visitors","wplivechat"); ?></a></p>
47
- <p><a href='admin.php?page=wplivechat-menu-settings' class='button-secondary'><?php echo __("Settings","wplivechat"); ?></a></p>
48
- </div>
49
- <div class="wplc_panel_col wplc_col_4 wplc-center">
50
- <h4><?php _e("Active Visitors","wplivechat"); ?><br />&nbsp;</h4>
51
- <span class='wplc-stat' id='totalVisitors'>...</span>
52
- <p><a href='admin.php?page=wplivechat-menu&subaction=override' class='button-secondary'><?php echo __("Chat now","wplivechat"); ?></a></p>
53
- </div>
54
- <div class="wplc_panel_col wplc_col_4 wplc-center">
55
- <h4><?php _e("Conversations","wplivechat"); ?><br /><span class='smaller'><?php _e("Last 90 days","wplivechat"); ?></span></h4>
56
- <span class='wplc-stat'><?php echo $total_count; ?></span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  </div>
58
  </div>
59
  </div>
@@ -63,7 +104,12 @@ if ( ! defined( 'ABSPATH' ) ) {
63
  <div class="wplc_dashboard_row">
64
  <div class="wplc_panel_col wplc_col_12">
65
  <div class="wplc_panel">
66
- <div id="wplc_blog_posts" class="wplc_material_panel"></div>
 
 
 
 
 
67
  </div>
68
  </div>
69
  </div>
5
  ?>
6
 
7
  <script>
8
+ var nifty_api_key = '<?php echo wplc_node_server_token_get(); ?>';
9
  </script>
10
 
11
  <?php
12
  $user = wp_get_current_user();
13
+ $total_count = $total_2day_chat_count = $total_30day_chat_count = $total_60day_chat_count = $total_90day_chat_count = $total_2day_missed_chat_count = $total_30day_missed_chat_count = $total_60day_missed_chat_count = $total_90day_missed_chat_count = 0;
14
 
15
  global $wpdb;
16
  global $wplc_tblname_chats;
17
+ $sql = "SELECT COUNT(IF(`timestamp` > CURDATE() AND `agent_id` <> 0 AND `status` != 0, 1, null)) AS today,
18
+ COUNT(IF(`timestamp` > DATE_SUB(NOW(), INTERVAL 30 DAY) AND `agent_id` <> 0 AND `status` != 0, 1, null)) AS day30,
19
+ COUNT(IF(`timestamp` > DATE_SUB(NOW(), INTERVAL 60 DAY) AND `agent_id` <> 0 AND `status` != 0, 1, null)) AS day60,
20
+ COUNT(IF(`timestamp` > DATE_SUB(NOW(), INTERVAL 90 DAY) AND `agent_id` <> 0 AND `status` != 0, 1, null)) AS day90,
21
+ COUNT(IF(`timestamp` > CURDATE() AND `status` = 0, 1, null)) AS missedtoday,
22
+ COUNT(IF(`timestamp` > DATE_SUB(NOW(), INTERVAL 30 DAY) AND `status` = 0, 1, null)) AS missed30,
23
+ COUNT(IF(`timestamp` > DATE_SUB(NOW(), INTERVAL 60 DAY) AND `status` = 0, 1, null)) AS missed60,
24
+ COUNT(IF(`timestamp` > DATE_SUB(NOW(), INTERVAL 90 DAY) AND `status` = 0, 1, null)) AS missed90
25
+ FROM `$wplc_tblname_chats`";
26
  $results = $wpdb->get_row( $sql );
27
+
28
  if ($results) {
29
+ $total_2day_chat_count = $results->today;
30
+ $total_30day_chat_count = $results->day30;
31
+ $total_60day_chat_count = $results->day60;
32
+ $total_90day_chat_count = $results->day90;
33
+ $total_2day_missed_chat_count = $results->missedtoday;
34
+ $total_30day_missed_chat_count = $results->missed30;
35
+ $total_60day_missed_chat_count = $results->missed60;
36
+ $total_90day_missed_chat_count = $results->missed90;
37
+ }
38
+
39
  ?>
40
 
41
  <div class="wrap wplc_wrap">
 
42
  <div class="wplc_dashboard_container">
 
 
 
 
 
 
 
 
 
 
 
 
43
  <div class="wplc_dashboard_row">
44
  <div class="wplc_panel_col wplc_col_12">
45
  <div class="wplc_panel">
46
+ <div class="wplc_panel_heading"><i class="fa fa-tasks" aria-hidden="true"></i> <?php _e("Dashboard","wplivechat"); ?></div>
47
  <div class="wplc_material_panel">
48
+ <div class="wplc_dashboard_activity">
49
+ <h3><?php printf( __( 'Hi %s! Current activity: %s Active Visitor(s) and %s Active Agent(s).', 'wplivechat' ), $user->display_name, '<span id=\'totalVisitors\' class="wplc_dashboard_activity_numbers">...</span>', '<span class="wplc_dashboard_activity_numbers">'.wplc_maa_total_agents_online().'</span>'); ?></h3>
50
+ </div>
51
+ <div class="wplc_panel_col wplc_dashboard_buttons_outer">
52
+ <div class="wplc_dashboard_button_item">
53
+ <a href="<?php echo admin_url('admin.php?page=wplivechat-menu');?>"><i class="fa fa-comments" aria-hidden="true"></i> <?php _e("Chats","wplivechat"); ?></a>
54
+ <a href="<?php echo admin_url('admin.php?page=wplivechat-menu-missed-chats');?>"><i class="fa fa-user-times" aria-hidden="true"></i> <?php _e("Missed","wplivechat"); ?></a>
55
+ <a href="<?php echo admin_url('admin.php?page=wplivechat-menu-history');?>"><i class="fa fa-clock-o" aria-hidden="true"></i> <?php _e("History","wplivechat"); ?></a>
56
+ <a href="<?php echo admin_url('admin.php?page=wplivechat-menu-reporting');?>"><i class="fa fa-area-chart" aria-hidden="true"></i> <?php _e("Reports","wplivechat"); ?></a>
57
+ <a href="<?php echo admin_url('admin.php?page=wplivechat-menu-offline-messages');?>"><i class="fa fa-ellipsis-h" aria-hidden="true"></i> <?php _e("Offline Messages","wplivechat"); ?></a>
58
+ <a href="<?php echo admin_url('edit.php?post_type=wplc_quick_response');?>"><i class="fa fa-paper-plane" aria-hidden="true"></i> <?php _e("Quick Responses","wplivechat"); ?></a>
59
+ <a href="<?php echo admin_url('admin.php?page=wplivechat-menu-at');?>"><i class="fa fa-code-fork" aria-hidden="true"></i> <?php _e("Tools","wplivechat"); ?></a>
60
+ <a href="<?php echo admin_url('admin.php?page=wplivechat-menu-settings');?>"><i class="fa fa-cog" aria-hidden="true"></i> <?php _e("Settings","wplivechat"); ?></a>
61
+ </div>
62
+ </div>
63
+ <div class="wplc_panel_col wplc-center wplc-dashboard-stats">
64
+ <table width="100%" border="0" cellspacing="0" cellpadding="0" class="wplc_dashboard_stats_table">
65
+ <tbody>
66
+ <tr>
67
+ <th width="18%"><div class="wplc-dashboard-stats-title"><?php _e("Chats","wplivechat"); ?></div></th>
68
+ <th width="19%" align="center"><div class="wplc-dashboard-stats-sub-title"><?php _e("Missed","wplivechat"); ?></div></th>
69
+ <th width="19%" align="center"><div class="wplc-dashboard-stats-sub-title"><?php _e("Engaged","wplivechat"); ?></div></th>
70
+ <th width="19%" align="center"><div class="wplc-dashboard-stats-sub-title"><?php _e("Total","wplivechat"); ?></div></th>
71
+ </tr>
72
+ <tr>
73
+ <td height="20" align="right"><div class="wplc-dashboard-stats-side-title"><?php _e("Today","wplivechat"); ?></div></td>
74
+ <td align="center"><?php echo $total_2day_missed_chat_count; ?></td>
75
+ <td align="center"><?php echo $total_2day_chat_count; ?></td>
76
+ <td align="center"><?php echo ($total_2day_chat_count+$total_2day_missed_chat_count); ?></td>
77
+ </tr>
78
+ <tr>
79
+ <td align="right"><div class="wplc-dashboard-stats-side-title"><?php _e("Last 30 days","wplivechat"); ?></div></td>
80
+ <td align="center"><?php echo $total_30day_missed_chat_count; ?></td>
81
+ <td align="center"><?php echo $total_30day_chat_count; ?></td>
82
+ <td align="center"><?php echo ($total_30day_missed_chat_count+$total_30day_chat_count); ?></td>
83
+ </tr>
84
+ <tr>
85
+ <td align="right"><div class="wplc-dashboard-stats-side-title"><?php _e("Last 60 days","wplivechat"); ?></div></td>
86
+ <td align="center"><?php echo $total_60day_missed_chat_count; ?></td>
87
+ <td align="center"><?php echo $total_60day_chat_count; ?></td>
88
+ <td align="center"><?php echo ($total_60day_missed_chat_count+$total_60day_chat_count); ?></td>
89
+ </tr>
90
+ <tr>
91
+ <td align="right"><div class="wplc-dashboard-stats-side-title"><?php _e("Last 90 days","wplivechat"); ?></div></td>
92
+ <td align="center"><?php echo $total_90day_missed_chat_count; ?></td>
93
+ <td align="center"><?php echo $total_90day_chat_count; ?></td>
94
+ <td align="center"><?php echo ($total_90day_chat_count+$total_90day_missed_chat_count); ?></td>
95
+ </tr>
96
+ </tbody>
97
+ </table>
98
  </div>
99
  </div>
100
  </div>
104
  <div class="wplc_dashboard_row">
105
  <div class="wplc_panel_col wplc_col_12">
106
  <div class="wplc_panel">
107
+ <div class="wplc_panel_heading"><i class="fa fa-newspaper-o" aria-hidden="true"></i> <?php _e("Latest News","wplivechat"); ?></div>
108
+ <div id="wplc_blog_posts" class="wplc_material_panel">
109
+ <?php
110
+ wplc_fetch_feed();
111
+ ?>
112
+ </div>
113
  </div>
114
  </div>
115
  </div>
includes/documentation_suggestions.php DELETED
@@ -1,155 +0,0 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
5
-
6
- add_action("wplc_hook_message_sent","wplc_mrg_filter_control_message_control",10,1);
7
- function wplc_mrg_filter_control_message_control($data) {
8
-
9
- $string = wplc_tokenise_mrg($data['msg'],'string');
10
- $string = wplc_remove_stop_words_mrg($string);
11
- if (count(explode(' ',$string)) >= 3) {
12
- /* only start searching if we have 3 or more words to look for */
13
- if (function_exists("wplc_record_chat_notification")) {
14
-
15
-
16
- $returned_data = wplc_documentation_find_mrg($string);
17
- if ($returned_data) {
18
- $formatted_msg = "<div class='wplc_doc_suggestion'><h3>Are you looking for help with:</h3>";
19
- foreach ($returned_data as $dataset) {
20
- $formatted_msg = $formatted_msg . "<a href='".$dataset['url']."' >".$dataset['title']. "[".$dataset['proximity']."%]</a><br /><small>".$dataset['excerpt']."</small>";
21
- }
22
- $formatted_msg = $formatted_msg."</div>";
23
- $suggestion_data = array(
24
- 'cid' => $cid,
25
- 'msg' => $msg,
26
- 'formatted_msg' => $formatted_msg
27
- );
28
- wplc_record_chat_notification('doc_suggestion',$data['cid'],$suggestion_data);
29
- }
30
- }
31
- }
32
- return;
33
- }
34
-
35
- function wplc_documentation_find_mrg($string) {
36
- $my_query = new WP_Query( array( 's' => $string ) );
37
- $returned_data = array();
38
- $i = 0;
39
- if ( $my_query->have_posts() ) {
40
-
41
- while ( $my_query->have_posts() ) {
42
- $my_query->the_post();
43
- $i++;
44
- $pid = get_the_ID();
45
- $returned_data[$i]['title'] = get_the_title();
46
- $returned_data[$i]['uri'] = get_the_permalink();
47
-
48
- $description = wplc_remove_stop_words_mrg(wplc_tokenise_mrg(get_the_content(),'string'));
49
- $lev = levenshtein($description, $string);
50
-
51
- $returned_data[$i]['excerpt'] = get_the_excerpt();
52
- $returned_data[$i]['levenshtein'] = $lev;
53
- $returned_data[$i]['proximity'] = similar_text($description, $string);
54
-
55
- }
56
- }
57
- return $returned_data;
58
-
59
-
60
-
61
-
62
- }
63
- function wplc_remove_stop_words_mrg($string) {
64
- $tokenised_array = explode(" ",$string);
65
-
66
- $stopwords = array("#", "a", "about", "above", "above", "across", "after", "afterwards", "again", "against", "all", "almost", "alone", "along", "already", "also","although","always","am","among", "amongst", "amoungst", "amount", "an", "and", "another", "any","anyhow","anyone","anything","anyway", "anywhere", "are", "around", "as", "at", "back","be","became", "because","become","becomes", "becoming", "been", "before", "beforehand", "behind", "being", "below", "beside", "besides", "between", "beyond", "bill", "both", "bottom","but", "by", "call", "can", "co", "con", "could", "cry", "de", "describe", "detail", "do", "done", "down", "due", "during", "each", "eg", "eight", "either", "eleven","else", "elsewhere", "empty", "enough", "etc", "even", "ever", "every", "everyone", "everything", "everywhere", "except", "few", "fifteen", "fify", "fill", "find", "fire", "first", "five", "for", "former", "formerly", "forty", "found", "four", "from", "front", "full", "further", "get", "give", "go", "had", "has", "hasnt", "have", "he", "hence", "her", "here", "hereafter", "hereby", "herein", "hereupon", "hers", "herself", "him", "himself", "his", "how", "however", "hundred", "ie", "if", "in", "inc", "indeed", "interest", "into", "is", "it", "its", "itself", "keep", "last", "latter", "latterly", "least", "less", "ltd", "made", "many", "may", "me", "meanwhile", "might", "mill", "mine", "more", "moreover", "most", "mostly", "move", "much", "must", "my", "myself", "name", "namely", "neither", "nevertheless", "next", "nine", "no", "nobody", "none", "noone", "nor", "nothing", "now", "nowhere", "of", "off", "often", "on", "once", "one", "only", "onto", "or", "other", "others", "otherwise", "our", "ours", "ourselves", "out", "over", "own","part", "per", "perhaps", "please", "put", "rather", "re", "same", "see", "seem", "seemed", "seeming", "seems", "serious", "several", "she", "should", "show", "side", "since", "sincere", "six", "sixty", "so", "some", "somehow", "someone", "something", "sometime", "sometimes", "somewhere", "still", "such", "system", "take", "ten", "than", "that", "the", "their", "them", "themselves", "then", "thence", "there", "thereafter", "thereby", "therefore", "therein", "thereupon", "these", "they", "thickv", "thin", "third", "this", "those", "though", "three", "through", "throughout", "thru", "thus", "to", "together", "too", "top", "toward", "towards", "twelve", "twenty", "two", "un", "under", "until", "up", "upon", "us", "via", "was", "we", "well", "were", "what", "whatever", "when", "whence", "whenever", "where", "whereafter", "whereas", "whereby", "wherein", "whereupon", "wherever", "whether", "which", "while", "whither", "who", "whoever", "whole", "whom", "whose", "why", "will", "with", "within", "without", "would", "yet", "you", "your", "yours", "yourself", "yourselves", "the");
67
- $new_array = array();
68
- foreach ($stopwords as $word) {
69
- foreach ($tokenised_array as $key => $val) {
70
- if ($val == $word) {
71
- unset($tokenised_array[$key]);
72
- }
73
- preg_match('/(\s+|^)@\S+/',$val,$match);
74
- if (isset($match[0])) {
75
- unset($tokenised_array[$key]);
76
- }
77
- }
78
- }
79
- $cnt = 0;
80
- foreach ($tokenised_array as $key => $val) {
81
- $new_array[$cnt] = $val;
82
- $cnt++;
83
- }
84
-
85
- return implode(" ",$new_array);
86
-
87
- }
88
-
89
- function wplc_tokenise_mrg($string,$method = 'array') {
90
- $text = strtolower($string);
91
- $matches = wp_filter_post_kses(html_entity_decode($text)); // strip the rest of the HTML code
92
- $matches = str_replace(" "," ",$matches);
93
- $matches = preg_replace("/http(s)*:\/\/.+/i"," ",$matches);
94
- $matches = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $matches); // remove all non-utf8 characters
95
- $matches = preg_replace('/[,.]/', ' ', $matches); // Replace commas, hyphens etc (count them as spaces)
96
- $matches = preg_replace('/\<script.*?\<\/script\>/ism', '', $matches); //remove script tags
97
- $matches = preg_replace('/\<style.*?\<\/style\>/ism', '', $matches); // remove style tags
98
- $matches = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $matches); // remove square bracket tags
99
- $matches = wp_filter_post_kses(html_entity_decode($matches)); // strip the rest of the HTML code
100
- $matches = preg_replace('/\s+/', ' ',$matches);
101
- $matches = str_replace("?","",$matches);
102
- $matches = str_replace("!","",$matches);
103
- $matches = str_replace("@","",$matches);
104
- $matches = str_replace("#","",$matches);
105
- $matches = str_replace("$","",$matches);
106
- $matches = str_replace("%","",$matches);
107
- $matches = str_replace("^","",$matches);
108
- $matches = str_replace("&","",$matches);
109
- $matches = str_replace("*","",$matches);
110
- $matches = str_replace(")","",$matches);
111
- $matches = str_replace("(","",$matches);
112
- if ($method == 'array') {
113
- $matches = explode(" ",$matches);
114
- }
115
-
116
-
117
- return $matches;
118
-
119
- }
120
-
121
-
122
-
123
- add_action("wplc_hook_chat_notification","wplc_mrg_filter_control_chat_notification_documentation_suggestion",10,3);
124
- function wplc_mrg_filter_control_chat_notification_documentation_suggestion($type,$cid,$data) {
125
-
126
- if ($type == "doc_suggestion") {
127
-
128
- global $wpdb;
129
- global $wplc_tblname_msgs;
130
-
131
-
132
- $msg = $data['formatted_msg'];
133
-
134
- $wpdb->insert(
135
- $wplc_tblname_msgs,
136
- array(
137
- 'chat_sess_id' => $cid,
138
- 'timestamp' => current_time('mysql'),
139
- 'msgfrom' => __('System notification',"wplivechat"),
140
- 'msg' => $msg,
141
- 'status' => 0,
142
- 'originates' => 0
143
- ),
144
- array(
145
- '%s',
146
- '%s',
147
- '%s',
148
- '%s',
149
- '%d',
150
- '%d'
151
- )
152
- );
153
- }
154
- return;
155
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/js/wplc_user_triggers.js CHANGED
@@ -30,9 +30,9 @@ jQuery(function(){
30
  if(wplc_trigger_data["secs"] !== null && typeof wplc_trigger_data["secs"] !== 'undefined' && wplc_trigger_data["secs"] !== ""){
31
  var wplc_trigger_seconds = parseInt(wplc_trigger_data["secs"]);
32
  var wplc_add_seconds = 0;
33
- if(wplc_delay !== null && typeof wplc_delay !== "undefined"){
34
  //Chat delay present
35
- wplc_add_seconds = parseInt(wplc_delay);
36
  }
37
  setTimeout(function(){
38
  jQuery("#wplc_hovercard").fadeIn();
30
  if(wplc_trigger_data["secs"] !== null && typeof wplc_trigger_data["secs"] !== 'undefined' && wplc_trigger_data["secs"] !== ""){
31
  var wplc_trigger_seconds = parseInt(wplc_trigger_data["secs"]);
32
  var wplc_add_seconds = 0;
33
+ if(wplc_misc_strings.wplc_delay){
34
  //Chat delay present
35
+ wplc_add_seconds = parseInt(wplc_misc_strings.wplc_delay);
36
  }
37
  setTimeout(function(){
38
  jQuery("#wplc_hovercard").fadeIn();
includes/notification_control.php CHANGED
@@ -24,7 +24,7 @@ function wplc_filter_control_chat_notification_user_loaded($type,$cid,$data) {
24
  global $wplc_tblname_msgs;
25
 
26
 
27
- $msg = sprintf(__("User is browsing <small><a href='%s' target='_BLANK'>%s</a></small>","wplivechat"),wp_filter_post_kses($data['uri']),wp_filter_post_kses(wplc_shortenurl($data['uri'])));
28
 
29
  $wpdb->insert(
30
  $wplc_tblname_msgs,
@@ -56,13 +56,10 @@ function wplc_filter_control_chat_notification_user_loaded($type,$cid,$data) {
56
 
57
  add_action("wplc_hook_chat_notification","wplc_filter_control_chat_notification_await_agent",10,3);
58
  function wplc_filter_control_chat_notification_await_agent($type,$cid,$data) {
59
- $wplc_settings = get_option("WPLC_SETTINGS");
60
- if(isset($wplc_settings['wplc_use_node_server']) && intval($wplc_settings['wplc_use_node_server']) == 1){ } else {
61
 
62
  if ($type == "await_agent") {
63
-
64
-
65
-
66
  global $wpdb;
67
  global $wplc_tblname_msgs;
68
  $wpdb->insert(
@@ -91,77 +88,55 @@ function wplc_filter_control_chat_notification_await_agent($type,$cid,$data) {
91
 
92
 
93
  add_action("wplc_hook_chat_notification","wplc_filter_control_chat_notification_agent_joined",10,3);
94
- function wplc_filter_control_chat_notification_agent_joined($type,$cid,$data) {
95
-
96
-
97
- if ($type == "joined") {
98
-
99
- global $wpdb;
100
- global $wplc_tblname_msgs;
101
-
102
- $chat_data = wplc_get_chat_data( $cid );
103
-
104
- $wplc_acbc_data = get_option("WPLC_ACBC_SETTINGS");
105
- $user_info = get_userdata(intval($data['aid']));
106
-
107
- $agent_tagline = '';
108
- $agent_bio = '';
109
- $a_twitter = '';
110
- $a_linkedin = '';
111
- $a_facebook = '';
112
- $a_website = '';
113
- $social_links = '';
114
-
115
- if( isset( $wplc_acbc_data['wplc_use_wp_name'] ) && $wplc_acbc_data['wplc_use_wp_name'] == '1' ){
116
-
117
- $agent = $user_info->display_name;
118
- } else {
119
- if (!empty($wplc_acbc_data['wplc_chat_name'])) {
120
- $agent = $wplc_acbc_data['wplc_chat_name'];
121
- } else {
122
- $agent = 'Admin';
123
- }
124
- }
125
-
126
-
127
- $agent_tagline = apply_filters( "wplc_filter_agent_data_agent_tagline", $agent_tagline, $cid, $chat_data, $agent, $wplc_acbc_data, $user_info, $data );
128
- $agent_bio = apply_filters( "wplc_filter_agent_data_agent_bio", $agent_bio, $cid, $chat_data, $agent, $wplc_acbc_data, $user_info, $data );
129
- $social_links = apply_filters( "wplc_filter_agent_data_social_links", $social_links, $cid, $chat_data, $agent, $wplc_acbc_data, $user_info, $data);
130
-
131
- $msg = $agent . " ". __("has joined the chat.","wplivechat");
132
-
133
- $data_array = array(
134
- 'chat_sess_id' => $cid,
135
- 'timestamp' => current_time('mysql'),
136
- 'msgfrom' => __('System notification',"wplivechat"),
137
- 'msg' => $msg,
138
- 'status' => 0,
139
- 'originates' => 0,
140
- 'other' => maybe_serialize(array(
141
- 'ntype' => 'joined',
142
- 'email' => md5($user_info->user_email),
143
- 'name' => $agent,
144
- 'aid' => $user_info->ID,
145
- 'agent_tagline' => $agent_tagline,
146
- 'agent_bio' => $agent_bio,
147
- "social_links" => $social_links
148
- ))
149
- );
150
- $type_array = array(
151
- '%s',
152
- '%s',
153
- '%s',
154
- '%s',
155
- '%d',
156
- '%d',
157
- '%s'
158
- );
159
-
160
- do_action( "wplc_store_agent_joined_notification", $data_array, $type_array );
161
-
162
-
163
- }
164
- return $type;
165
  }
166
 
167
 
24
  global $wplc_tblname_msgs;
25
 
26
 
27
+ $msg = __("User is browsing", "wplivechat").' '.wp_filter_post_kses($data['uri']);
28
 
29
  $wpdb->insert(
30
  $wplc_tblname_msgs,
56
 
57
  add_action("wplc_hook_chat_notification","wplc_filter_control_chat_notification_await_agent",10,3);
58
  function wplc_filter_control_chat_notification_await_agent($type,$cid,$data) {
59
+ $wplc_settings = wplc_get_options();
60
+ if (!$wplc_settings['wplc_use_node_server']) {
61
 
62
  if ($type == "await_agent") {
 
 
 
63
  global $wpdb;
64
  global $wplc_tblname_msgs;
65
  $wpdb->insert(
88
 
89
 
90
  add_action("wplc_hook_chat_notification","wplc_filter_control_chat_notification_agent_joined",10,3);
91
+ function wplc_filter_control_chat_notification_agent_joined($type, $cid, $data) {
92
+ if ($type == "joined") {
93
+ $chat_data = wplc_get_chat_data( $cid );
94
+ $wplc_settings = wplc_get_options();
95
+ $user_info = get_userdata(intval($data['aid']));
96
+ $agent_tagline = '';
97
+
98
+ if ($wplc_settings['wplc_use_wp_name']) {
99
+ $agent = $user_info->display_name;
100
+ } else {
101
+ if (!empty($wplc_settings['wplc_chat_name'])) {
102
+ $agent = $wplc_settings['wplc_chat_name'];
103
+ } else {
104
+ $agent = 'Admin';
105
+ }
106
+ }
107
+
108
+ $agent_tagline = apply_filters( "wplc_filter_agent_data_agent_tagline", $agent_tagline, $cid, $chat_data, $agent, $wplc_settings, $user_info, $data );
109
+ $msg = $agent . " ". __("has joined the chat.","wplivechat");
110
+
111
+ $data_array = array(
112
+ 'chat_sess_id' => $cid,
113
+ 'timestamp' => current_time('mysql'),
114
+ 'msgfrom' => __('System notification',"wplivechat"),
115
+ 'msg' => $msg,
116
+ 'status' => 0,
117
+ 'originates' => 0,
118
+ 'other' => maybe_serialize(array(
119
+ 'ntype' => 'joined',
120
+ 'email' => md5($user_info->user_email),
121
+ 'name' => $agent,
122
+ 'aid' => $user_info->ID,
123
+ 'agent_tagline' => $agent_tagline
124
+ ))
125
+ );
126
+
127
+ $type_array = array(
128
+ '%s',
129
+ '%s',
130
+ '%s',
131
+ '%s',
132
+ '%d',
133
+ '%d',
134
+ '%s'
135
+ );
136
+
137
+ do_action( "wplc_store_agent_joined_notification", $data_array, $type_array );
138
+ }
139
+ return $type;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
  }
141
 
142
 
includes/settings_page.php CHANGED
@@ -4,6 +4,8 @@ if ( ! defined( 'ABSPATH' ) ) {
4
  exit;
5
  }
6
 
 
 
7
  ?>
8
  <style>
9
  .ui-tabs-vertical { }
@@ -13,15 +15,27 @@ if ( ! defined( 'ABSPATH' ) ) {
13
  max-width: 20%;
14
  min-width: 190px;
15
  }
16
- .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; }
17
  .ui-tabs-vertical .ui-tabs-nav li a { display:block; }
18
  .ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active { padding-bottom: 0; padding-right: .1em; border-right-width: 1px; }
19
  .ui-tabs-vertical .ui-tabs-panel {
 
20
  float: left;
21
  min-width: 67%;
22
  max-width: 67%;
23
  }
24
  textarea, input[type='text'], input[type='email'], input[type='password']{ width: 100% !important; }
 
 
 
 
 
 
 
 
 
 
 
25
  </style>
26
 
27
  <?php
@@ -43,50 +57,29 @@ if ( ! defined( 'ABSPATH' ) ) {
43
 
44
  <?php wplc_stats("settings");
45
 
46
-
47
- if (function_exists("wplc_string_check")) { wplc_string_check(); }
48
- $wplc_settings = get_option("WPLC_SETTINGS");
49
 
50
  ?>
51
 
52
- <?php
53
- if (get_option("WPLC_HIDE_CHAT") == true) {
54
- $wplc_hide_chat = "checked";
55
- } else {
56
- $wplc_hide_chat = "";
57
- };
58
-
59
- ?>
60
  <img src='<?php echo WPLC_PLUGIN_URL.'images/ajax-loader.gif'; ?>' id='wplc_settings_page_loader' style='display: block; margin: 20px auto;' />
61
- <div class="wrap wplc_wrap" style='display: none;'>
62
-
63
- <style>
64
  .wplc_light_grey{
65
- color: #666;
66
  }
67
- </style>
68
- <div id="icon-edit" class="icon32 icon32-posts-post">
69
- <br>
70
- </div>
71
- <h2><?php _e("WP Live Chat Support Settings","wplivechat")?></h2>
72
  <?php
73
  if (isset($wplc_settings["wplc_settings_align"])) { $wplc_settings_align[intval($wplc_settings["wplc_settings_align"])] = "SELECTED"; }
74
  if (isset($wplc_settings["wplc_settings_enabled"])) { $wplc_settings_enabled[intval($wplc_settings["wplc_settings_enabled"])] = "SELECTED"; }
75
- if (isset($wplc_settings["wplc_settings_fill"])) { $wplc_settings_fill = $wplc_settings["wplc_settings_fill"]; } else { $wplc_settings_fill = "ed832f"; }
76
  if (isset($wplc_settings["wplc_settings_font"])) { $wplc_settings_font = $wplc_settings["wplc_settings_font"]; } else { $wplc_settings_font = "FFFFFF"; }
77
- if (isset($wplc_settings["wplc_settings_color1"])) { $wplc_settings_color1 = $wplc_settings["wplc_settings_color1"]; } else { $wplc_settings_color1 = "ED832F"; }
78
  if (isset($wplc_settings["wplc_settings_color2"])) { $wplc_settings_color2 = $wplc_settings["wplc_settings_color2"]; } else { $wplc_settings_color2 = "FFFFFF"; }
79
  if (isset($wplc_settings["wplc_settings_color3"])) { $wplc_settings_color3 = $wplc_settings["wplc_settings_color3"]; } else { $wplc_settings_color3 = "EEEEEE"; }
80
- if (isset($wplc_settings["wplc_settings_color4"])) { $wplc_settings_color4 = $wplc_settings["wplc_settings_color4"]; } else { $wplc_settings_color4 = "666666"; }
81
-
82
 
83
- if(get_option("WPLC_HIDE_CHAT") == true) { $wplc_hide_chat = "checked"; } else { $wplc_hide_chat = ""; };
84
- $wplc_choose_data = get_option("WPLC_CHOOSE_SETTINGS");
85
- $wplc_inex_data = get_option("WPLC_INEX_SETTINGS");
86
  $wplc_auto_responder_settings = get_option( "WPLC_AUTO_RESPONDER_SETTINGS" );
87
- $wplc_acbc_data = get_option("WPLC_ACBC_SETTINGS");
88
- $wplc_bh_settings = get_option( "wplc_bh_settings" );
89
- $wplc_encrypt_data = get_option("WPLC_ENCRYPT_SETTINGS");
90
 
91
  $wplc_quick_response_order_by = isset( $wplc_settings['wplc_quick_response_orderby'] ) ? sanitize_text_field( $wplc_settings['wplc_quick_response_orderby'] ) : 'title';
92
  $wplc_quick_response_order = isset( $wplc_settings['wplc_quick_response_order'] ) ? sanitize_text_field( $wplc_settings['wplc_quick_response_order'] ) : 'DESC';
@@ -159,19 +152,19 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
159
  </td>
160
  <td valign='top'>
161
  <div class="wplc-require-user-info__item">
162
- <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"; } ?> />
163
  <label for="wplc_require_user_info_both"><?php _e( 'Name and email', 'wplivechat' ); ?></label>
164
  </div>
165
  <div class="wplc-require-user-info__item">
166
- <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"; } ?> />
167
  <label for="wplc_require_user_info_email"><?php _e( 'Email', 'wplivechat' ); ?></label>
168
  </div>
169
  <div class="wplc-require-user-info__item">
170
- <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"; } ?> />
171
  <label for="wplc_require_user_info_name"><?php _e( 'Name', 'wplivechat' ); ?></label>
172
  </div>
173
  <div class="wplc-require-user-info__item">
174
- <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"; } ?> />
175
  <label for="wplc_require_user_info_none"><?php _e( 'No fields', 'wplivechat' ); ?></label>
176
  </div>
177
  </td>
@@ -181,7 +174,7 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
181
  <?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>
182
  </td>
183
  <td valign='top'>
184
- <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" ); } ?>" />
185
  </td>
186
  </tr>
187
  <tr>
@@ -189,7 +182,7 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
189
  <?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>
190
  </td>
191
  <td valign='top'>
192
- <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>
193
  </td>
194
  </tr>
195
  <tr>
@@ -197,25 +190,17 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
197
  <?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>
198
  </td>
199
  <td valign='top'>
200
- <input type="checkbox" value="1" name="wplc_loggedin_user_info" <?php if(isset($wplc_settings['wplc_loggedin_user_info']) && intval($wplc_settings['wplc_loggedin_user_info']) == 1 ) { echo "checked"; } ?> />
201
- </td>
202
- </tr>
203
- <tr>
204
- <td width='200' valign='top'>
205
- <?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>
206
- </td>
207
- <td valign='top'>
208
- <input type="checkbox" value="1" name="wplc_enabled_on_mobile" <?php if(isset($wplc_settings['wplc_enabled_on_mobile']) && intval($wplc_settings['wplc_enabled_on_mobile']) == 1 ) { echo "checked"; } ?> />
209
  </td>
210
  </tr>
211
 
212
- <?php if( isset( $wplc_settings['wplc_use_node_server'] ) && intval( $wplc_settings['wplc_use_node_server'] ) == 1 ){ ?>
213
  <tr>
214
  <td width='300' valign='top'>
215
  <?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>
216
  </td>
217
  <td valign='top'>
218
- <input type="checkbox" value="1" name="wplc_enable_visitor_sound" <?php if(isset($wplc_settings['wplc_enable_visitor_sound']) && intval($wplc_settings['wplc_enable_visitor_sound']) == 1 ) { echo "checked"; } ?> />
219
  </td>
220
  </tr>
221
  <?php } ?>
@@ -224,7 +209,7 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
224
  <?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>
225
  </td>
226
  <td valign='top'>
227
- <input type="checkbox" value="1" name="wplc_enable_msg_sound" <?php if(isset($wplc_settings['wplc_enable_msg_sound']) && intval($wplc_settings['wplc_enable_msg_sound']) == 1 ) { echo "checked"; } ?> />
228
  </td>
229
  </tr>
230
 
@@ -233,7 +218,7 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
233
  <?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>
234
  </td>
235
  <td valign='top'>
236
- <input type="checkbox" value="1" name="wplc_enable_font_awesome" <?php if(isset($wplc_settings['wplc_enable_font_awesome']) && intval($wplc_settings['wplc_enable_font_awesome']) == 1 ) { echo "checked"; } ?> />
237
  </td>
238
  </tr>
239
  <tr>
@@ -241,22 +226,29 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
241
  <?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>
242
  </td>
243
  <td valign='top'>
244
- <input type="checkbox" value="1" name="wplc_enable_all_admin_pages" <?php if(isset($wplc_settings['wplc_enable_all_admin_pages']) && intval($wplc_settings['wplc_enable_all_admin_pages']) == 1 ) { echo "checked"; } ?> />
245
  </td>
246
  </tr>
 
 
 
 
 
 
 
 
247
  </table>
248
 
249
  <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='700'>
250
  <tr>
251
  <td width='350' valign='top'>
252
- <?php _e("Choose when I want to be online", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e('Checking this will allow you to change your status to Online or Offline on the Live Chat page.', 'wplivechat'); ?>"></i>
253
  </td>
254
  <td>
255
- <input type="checkbox" value="1" name="wplc_auto_online" <?php if (isset($wplc_choose_data['wplc_auto_online']) && intval($wplc_choose_data['wplc_auto_online']) == 1) { echo "checked"; } ?> />
256
  </td>
257
  </tr>
258
  </table>
259
- <hr>
260
 
261
  <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='700'>
262
  <tr>
@@ -264,7 +256,7 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
264
  <?php _e("Exclude chat from 'Home' page:", "wplivechat"); ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Leaving this unchecked will allow the chat window to display on your home page.", "wplivechat") ?>"></i>
265
  </td>
266
  <td valign='top'>
267
- <input type="checkbox" name="wplc_exclude_home" <?php if (isset($wplc_inex_data['wplc_exclude_home'])) { echo 'checked'; } ?> value='1' />
268
  </td>
269
  </tr>
270
  <tr>
@@ -272,7 +264,7 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
272
  <?php _e("Exclude chat from 'Archive' pages:", "wplivechat"); ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Leaving this unchecked will allow the chat window to display on your archive pages.", "wplivechat") ?>"></i>
273
  </td>
274
  <td valign='top'>
275
- <input type="checkbox" name="wplc_exclude_archive" <?php if (isset($wplc_inex_data['wplc_exclude_archive'])) { echo 'checked'; } ?> value='1' />
276
  </td>
277
  </tr>
278
  <tr>
@@ -280,7 +272,7 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
280
  <?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>
281
  </td>
282
  <td valign='top'>
283
- <input type="text" name="wplc_include_on_pages" value="<?php if (isset($wplc_inex_data['wplc_include_on_pages'])) { echo $wplc_inex_data['wplc_include_on_pages']; } ?>" />
284
  </td>
285
  </tr>
286
  <tr>
@@ -288,7 +280,7 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
288
  <?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>
289
  </td>
290
  <td valign='top'>
291
- <input type="text" name="wplc_exclude_from_pages" value="<?php if (isset($wplc_inex_data['wplc_exclude_from_pages'])) { echo $wplc_inex_data['wplc_exclude_from_pages']; } ?>" />
292
  </td>
293
  </tr>
294
  <tr class="wplc-exclude-post-types__row">
@@ -296,7 +288,6 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
296
  <?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>
297
  </td>
298
  <td valign='top'><?php
299
- $wplc_inex_settings = get_option('WPLC_INEX_SETTINGS');
300
  $wplc_posts_types = get_post_types(
301
  array(
302
  '_builtin' => false,
@@ -307,7 +298,7 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
307
  if ( ! empty( $wplc_posts_types ) ) {
308
  foreach ( $wplc_posts_types as $posts_type ) { ?>
309
  <div class="wplc-exclude-post-types__item">
310
- <input type="checkbox" value="<?php echo $posts_type->name; ?>" id="wplc_exclude_post_types_<?php echo $posts_type->name; ?>" name="wplc_exclude_post_types[]" <?php echo ( ! empty( $wplc_inex_settings['wplc_exclude_post_types'] ) && in_array( $posts_type->name, $wplc_inex_settings['wplc_exclude_post_types'] ) ) ? 'checked' : ''; ?> />
311
  <label for="wplc_exclude_post_types_<?php echo $posts_type->name; ?>"><?php _e( $posts_type->label, "wplivechat" ) ?></label>
312
  </div>
313
  <?php
@@ -319,15 +310,14 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
319
  </tr>
320
  <tr>
321
  <td width='300' valign='top'>
322
- <?php _e("Allow any user to make themselves a chat agent", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e('Checking this will allow any of your users to make themselves a chat agent when editing their profile.', 'wplivechat'); ?>"></i>
323
  </td>
324
  <td>
325
- <input type="checkbox" value="1" name="wplc_make_agent" <?php if (isset($wplc_inex_data['wplc_make_agent']) && intval($wplc_inex_data['wplc_make_agent']) == 1) { echo "checked"; } ?> />
326
  </td>
327
  </tr>
328
 
329
  </table>
330
- <hr>
331
 
332
  <h4><?php _e( "Quick Response", "wplivechat" ); ?></h4>
333
  <table class="wp-list-table wplc_list_table widefat fixed striped pages">
@@ -346,7 +336,7 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
346
  </tr>
347
  <tr>
348
  <td width="350" valign="top">
349
- <label for="wplc_quick_response_order"><?php _e( "Order", "wplivechat" ); ?></label>
350
  </td>
351
  <td valign="top">
352
  <select id='wplc_quick_response_order' name='wplc_quick_response_order'>
@@ -357,9 +347,9 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
357
  </tr>
358
  </tbody>
359
  </table>
360
- <br>
361
-
362
- <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='700'>
363
  <tr>
364
  <td width='350' valign='top'>
365
  <?php _e( "Enable Voice Notes on admin side", "wplivechat" ); ?>: <i
@@ -367,10 +357,7 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
367
  title="<?php _e( "Enabling this will allow you to record the voice during the chat and send it to visitor once you hold on CTRL + SPACEBAR in main chat window", "wplivechat" ) ?>"></i>
368
  </td>
369
  <td valign='top'>
370
- <input type="checkbox" value="1"
371
- name="wplc_enable_voice_notes_on_admin" <?php if ( isset( $wplc_settings['wplc_enable_voice_notes_on_admin'] ) && intval($wplc_settings['wplc_enable_voice_notes_on_admin']) == 1 ) {
372
- echo "checked";
373
- } ?> />
374
  </td>
375
  </tr>
376
  <tr>
@@ -380,23 +367,21 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
380
  title="<?php _e( "Enabling this will allow the visitors to record the voice during the chat and send it to agent once they hold on CTRL + SPACEBAR", "wplivechat" ) ?>"></i>
381
  </td>
382
  <td valign='top'>
383
- <input type="checkbox" value="1"
384
- name="wplc_enable_voice_notes_on_visitor" <?php if ( isset( $wplc_settings['wplc_enable_voice_notes_on_visitor'] ) && intval($wplc_settings['wplc_enable_voice_notes_on_visitor']) == 1 ) {
385
- echo "checked";
386
- } ?> />
387
  </td>
388
  </tr>
389
  </table>
 
390
 
391
  <?php do_action('wplc_hook_admin_settings_main_settings_after'); ?>
392
 
393
 
394
  </div>
395
  <div id="tabs-2">
396
- <h3><?php _e("Chat Window Settings",'wplivechat')?></h3>
397
  <table class='wp-list-table wplc_list_table widefat fixed striped pages'>
398
  <tr>
399
- <td width='300' valign='top'><?php _e("Chat box alignment","wplivechat")?>:</td>
400
  <td>
401
  <select id='wplc_settings_align' name='wplc_settings_align'>
402
  <option value="1" <?php if (isset($wplc_settings_align[1])) { echo $wplc_settings_align[1]; } ?>><?php _e("Bottom left","wplivechat"); ?></option>
@@ -411,51 +396,52 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
411
  <?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>
412
  </td>
413
  <td>
414
- <input type="checkbox" name="wplc_auto_pop_up" value="1" <?php if(isset($wplc_settings['wplc_auto_pop_up']) && intval($wplc_settings['wplc_auto_pop_up']) == 1 ) { echo "checked"; } ?>/>
415
  </td>
416
  </tr>
417
 
418
  <tr>
419
  <td>
420
- <?php _e("Display details in chat message", "wplivechat") ?>
421
  </td>
422
  <td>
423
- <?php if (isset($wplc_settings['wplc_show_name']) && intval($wplc_settings['wplc_show_name']) == 1) { $checked = "checked"; } else { $checked = ''; } ?>
424
- <input type="checkbox" name="wplc_show_name" value="1" <?php echo $checked; ?>/> <label><?php _e("Show Name", "wplivechat"); ?></label><br/>
425
- <?php if (isset($wplc_settings['wplc_show_avatar']) && intval($wplc_settings['wplc_show_avatar']) == 1) { $checked = "checked"; } else { $checked = ''; } ?>
426
- <input type="checkbox" name="wplc_show_avatar" value="1" <?php echo $checked; ?>/> <label><?php _e("Show Avatar", "wplivechat"); ?></label>
427
  </td>
428
  </tr>
 
 
 
 
 
 
 
 
 
429
  <tr>
430
  <td>
431
- <?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>
432
  </td>
433
  <td>
434
- <input type="checkbox" name="wplc_display_to_loggedin_only" value="1" <?php
435
- if (isset($wplc_settings['wplc_display_to_loggedin_only']) && $wplc_settings['wplc_display_to_loggedin_only'] == 1) {
436
- echo "checked";
437
- }
438
- ?>/>
439
  </td>
440
  </tr>
441
  <tr>
442
  <td>
443
- <?php _e("Display a timestamp in the chat window", "wplivechat") ?>
444
  </td>
445
  <td>
446
- <?php if (isset($wplc_settings['wplc_show_date']) && intval($wplc_settings['wplc_show_date']) == 1) { $checked = "checked"; } else { $checked = ''; } ?>
447
- <input type="checkbox" name="wplc_show_date" value="1" <?php echo $checked; ?>/> <label><?php _e("Show Date", "wplivechat"); ?></label><br/>
448
- <?php if (isset($wplc_settings['wplc_show_time']) && intval($wplc_settings['wplc_show_time']) == 1) { $checked = "checked"; } else { $checked = ''; } ?>
449
- <input type="checkbox" name="wplc_show_time" value="1" <?php echo $checked; ?>/> <label><?php _e("Show Time", "wplivechat"); ?></label>
450
  </td>
451
  </tr>
452
  <tr>
453
  <td>
454
- <?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>
455
  </td>
456
  <td>
457
- <input type="checkbox" name="wplc_redirect_to_thank_you_page" value="1" <?php echo (isset($wplc_settings['wplc_redirect_to_thank_you_page']) && intval($wplc_settings['wplc_redirect_to_thank_you_page']) == 1 ? "checked" : "" ); ?> />
458
- <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'); ?>" class='wplc_check_url' />
459
  </td>
460
  </tr>
461
  <?php
@@ -469,12 +455,7 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
469
  ?>
470
  </td>
471
  <td>
472
- <input type="checkbox" name="wplc_disable_emojis"
473
- <?php
474
- if(!empty($wplc_settings['wplc_disable_emojis']))
475
- echo 'checked="checked"';
476
- ?>
477
- />
478
  </tr>
479
  <?php
480
  }
@@ -482,157 +463,83 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
482
  </table>
483
 
484
  <?php
485
- if (isset($wplc_acbc_data['wplc_pro_chat_notification']) && $wplc_acbc_data['wplc_pro_chat_notification'] == "yes") { $wplc_pro_chat_notification = "CHECKED"; } else { }
486
-
487
  echo "<table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='700'>";
488
- echo " <tr>";
489
- echo " <td width='300'>";
490
- echo " ".__("Display typing indicator", "wplivechat")." <i class='fa fa-question-circle wplc_light_grey wplc_settings_tooltip' title='".__("Display the \"typing...\" animation in the chat window as soon as an agent or visitor is typing.", "wplivechat")."'></i>";
491
- echo " </td>";
492
- echo " <td>";
493
- echo " <input type=\"checkbox\" name=\"wplc_typing_enabled\" value=\"1\"";
494
- if (isset($wplc_settings['wplc_typing_enabled']) && intval($wplc_settings['wplc_typing_enabled']) == 1) { echo "checked"; }
495
- echo "/>";
496
- echo " <small><em>".__("For non-cloud server users, please note that this will increase the amount of server resources required.", "wplivechat")." </em></small>";
497
- echo " </td>";
498
- echo "</tr>";
499
-
500
-
501
- ?>
502
 
503
  <tr>
504
  <td width='420' valign='top'>
505
- <?php _e("Name ", "wplivechat") ?>:
506
  </td>
507
  <td>
508
- <input id='wplc_pro_name' name='wplc_pro_name' type='text' size='50' maxlength='50' class='regular-text' value='<?php echo isset( $wplc_acbc_data['wplc_chat_name'] ) ? stripslashes($wplc_acbc_data['wplc_chat_name']) : ''; ?>' />
509
  </td>
510
  </tr>
511
  <tr>
512
  <td width='420' valign='top'>
513
- - <?php _e("Use WordPress name instead", "wplivechat") ?>:
514
  </td>
515
  <td>
516
- <input id='wplc_use_wp_name' name='wplc_use_wp_name' value='1' type='checkbox' <?php echo (isset($wplc_acbc_data['wplc_use_wp_name']) && intval($wplc_acbc_data['wplc_use_wp_name']) == 1 ? "checked" : "") ?>/> <small><em><?php _e("Note: 'Name' field will be ignored", "wplivechat")?></em></small>
517
  </td>
518
  </tr>
519
 
520
- <?php
521
-
522
- if (isset($wplc_settings['wplc_ringtone'])) {
523
- $wplc_ringtone_selected = str_replace("http:", "", $wplc_settings['wplc_ringtone'] );
524
- } else {
525
- $wplc_ringtone_selected = WPLC_PLUGIN_URL.'includes/sounds/general/ring.wav';
526
- }
 
 
 
 
 
527
 
 
528
 
529
- ?>
 
 
 
 
 
 
530
 
 
531
 
532
- <tr>
533
- <td width='420' valign='top'>
534
- <?php _e("Incoming chat ring tone", "wplivechat") ?>:
535
- </td>
536
- <td>
537
- <select name='wplc_ringtone' id='wplc_ringtone'>
538
- <?php $wplc_ringtone = str_replace("http:", "", WPLC_PLUGIN_URL.'includes/sounds/general/ring.wav' ); ?>
539
- <option <?php if ($wplc_ringtone_selected == WPLC_PLUGIN_URL.'includes/sounds/general/ring.wav') { echo "selected"; } ?> value='<?php echo $wplc_ringtone; ?>'><?php _e("Default","wplivechat"); ?></option>
540
- <?php
541
-
542
- /* Thank you to the following authors of the sound files used in WP Live Chat Support
543
-
544
- (1) Mike Koenig Sound - Store door chime, Mario jump, ringing phone, Rooster, ship bell
545
- (2) Freesfx.com
546
- (3) Corsica - Elevator ding sound, Air plane ding
547
- (4) Brian Rocca - Pin dropping
548
- (5) Marianne Gagnon - Robot blip
549
- (6) Caroline Ford - Drop metal thing
550
- (7) bennstir - Doorbell
551
-
552
- */
553
- $path = WPLC_PLUGIN_DIR."/includes/sounds/";
554
-
555
- $files = scandir($path);
556
-
557
- foreach ($files as &$value) {
558
-
559
- if ( is_dir( $path . $value ) ) {
560
- continue;
561
- }
562
-
563
- $available_tones = plugin_dir_url( $path.$value ).$value;
564
- $http_stripped_tone = str_replace( "http:", "", $available_tones );
565
- $wplc_new_sanitized_tone = str_replace( "https:", "", $http_stripped_tone );
566
-
567
- if ($value == "." || $value == "..") { } else {
568
- $fname = $withoutExt = preg_replace('/\\.[^.\\s]{3,4}$/', '', $value);
569
- $fname = str_replace("_"," ",$fname);
570
- if ($wplc_ringtone_selected == $wplc_new_sanitized_tone) { $sel = "selected"; } else { $sel = ""; }
571
- $new_ringtone = str_replace("http:", "", plugin_dir_url( $path.$value ).$value );
572
- echo "<option value='".$new_ringtone."' $sel>".$fname."</option>";
573
- }
574
- }
575
- ?>
576
- </select>
577
- <button type='button' id='wplc_sample_ring_tone'><i class='fa fa-play'></i></button>
578
- </td>
579
- </tr>
580
-
581
- <?php
582
-
583
- if (isset($wplc_settings['wplc_messagetone'])) {
584
- $wplc_messagetone_selected = str_replace("http:", "", $wplc_settings['wplc_messagetone'] );
585
- } else {
586
- $wplc_messagetone_selected = WPLC_PLUGIN_URL.'includes/sounds/general/ring.wav';
587
- }
588
-
589
-
590
- ?>
591
-
592
-
593
- <tr>
594
- <td width='420' valign='top'>
595
- <?php _e("Incoming message tone", "wplivechat") ?>:
596
- </td>
597
- <td>
598
- <select name='wplc_messagetone' id='wplc_messagetone'>
599
- <?php $wplc_messagetone = str_replace("http:", "", WPLC_PLUGIN_URL.'includes/sounds/general/ding.mp3' ); ?>
600
- <option <?php if ($wplc_messagetone_selected == WPLC_PLUGIN_URL.'includes/sounds/general/ding.mp3') { echo "selected"; } ?> value='<?php echo $wplc_messagetone; ?>'><?php _e("Default","wplivechat"); ?></option>
601
- <?php
602
- $path = WPLC_PLUGIN_DIR."/includes/sounds/message/";
603
- $files = scandir($path);
604
-
605
- foreach ($files as &$value) {
606
-
607
- if ( is_dir( $path . $value ) ) {
608
- continue;
609
- }
610
-
611
- $available_tones = plugin_dir_url( $path.$value ).$value;
612
- $http_stripped_tone = str_replace( "http:", "", $available_tones );
613
- $wplc_new_sanitized_tone = str_replace( "https:", "", $http_stripped_tone );
614
-
615
- if ($value == "." || $value == "..") { } else {
616
- $fname = $withoutExt = preg_replace('/\\.[^.\\s]{3,4}$/', '', $value);
617
- $fname = str_replace("_"," ",$fname);
618
- if ($wplc_messagetone_selected == $wplc_new_sanitized_tone) { $sel = "selected"; } else { $sel = ""; }
619
- $new_messagetone = str_replace("http:", "", plugin_dir_url( $path.$value ).$value );
620
- echo "<option value='".$new_messagetone."' $sel>".$fname."</option>";
621
- }
622
- }
623
- ?>
624
- </select>
625
- <button type='button' id='wplc_sample_message_tone'><i class='fa fa-play'></i></button>
626
- </td>
627
- </tr>
628
-
629
- <?php
630
- $wplc_current_user = wp_get_current_user();
631
- $wplc_current_picture = isset( $wplc_acbc_data['wplc_chat_pic'] ) ? urldecode($wplc_acbc_data['wplc_chat_pic']) : '';
632
- $wplc_current_logo = isset( $wplc_acbc_data['wplc_chat_logo'] ) ? urldecode($wplc_acbc_data['wplc_chat_logo']) : '';
633
- $wplc_current_icon = isset( $wplc_acbc_data['wplc_chat_icon'] ) ? urldecode($wplc_acbc_data['wplc_chat_icon']) : '';
634
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
635
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
636
 
637
  <!-- Chat Icon-->
638
  <tr class='wplc-icon-area'>
@@ -640,16 +547,16 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
640
  <?php _e("Icon", "wplivechat") ?>:
641
  </td>
642
  <td>
643
- <span id="wplc_icon_area">
644
- <img src="<?php echo trim($wplc_current_icon); ?>" width="50px"/>
645
- </span>
646
- <input id="wplc_upload_icon" name="wplc_upload_icon" type="hidden" size="35" class="regular-text" maxlength="700" value=" <?php echo base64_encode($wplc_current_icon) ?>"/>
647
  <br/>
648
  <input id="wplc_btn_upload_icon" name="wplc_btn_upload_icon" type="button" value="<?php _e("Upload Icon", "wplivechat") ?>" />
649
  <input id="wplc_btn_select_default_icon" name="wplc_btn_select_default_icon" type="button" value="<?php _e("Select Default Icon", "wplivechat") ?>" />
650
  <br/>
651
  <input id="wplc_btn_remove_icon" name="wplc_btn_remove_icon" type="button" value="<?php _e("Remove Icon", "wplivechat") ?>" />
652
- <?php _e("Recomended Size 50px x 50px", "wplivechat") ?>
653
 
654
  <div id="wplc_default_chat_icons" style="display: none">
655
  <strong><?php _e("Select Default Icon", "wplivechat"); ?></strong>
@@ -695,15 +602,15 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
695
  <?php _e("Picture", "wplivechat") ?>:
696
  </td>
697
  <td>
698
- <span id="wplc_pic_area">
699
- <img src="<?php echo $wplc_current_picture ?>" width="60px"/>
700
- </span>
701
- <input id="wplc_upload_pic" name="wplc_upload_pic" type="hidden" size="35" class="regular-text" maxlength="700" value="<?php echo base64_encode($wplc_current_picture) ?>"/>
702
  <br/>
703
  <input id="wplc_btn_upload_pic" name="wplc_btn_upload_pic" type="button" value="<?php _e("Upload Image", "wplivechat") ?>" />
704
  <br/>
705
  <input id="wplc_btn_remove_pic" name="wplc_btn_remove_pic" type="button" value="<?php _e("Remove Image", "wplivechat") ?>" />
706
- <?php _e("Recomended Size 60px x 60px", "wplivechat") ?>
707
  </td>
708
  </tr>
709
 
@@ -713,24 +620,24 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
713
  <?php _e("Logo", "wplivechat") ?>:
714
  </td>
715
  <td>
716
- <span id="wplc_logo_area">
717
- <img src="<?php echo trim($wplc_current_logo); ?>" width="100px"/>
718
- </span>
719
- <input id="wplc_upload_logo" name="wplc_upload_logo" type="hidden" size="35" class="regular-text" maxlength="700" value=" <?php echo base64_encode($wplc_current_logo) ?>"/>
720
  <br/>
721
  <input id="wplc_btn_upload_logo" name="wplc_btn_upload_logo" type="button" value="<?php _e("Upload Logo", "wplivechat") ?>" />
722
  <br/>
723
  <input id="wplc_btn_remove_logo" name="wplc_btn_remove_logo" type="button" value="<?php _e("Remove Logo", "wplivechat") ?>" />
724
- <?php _e("Recomended Size 250px x 40px", "wplivechat") ?>
725
  </td>
726
  </tr>
727
 
728
  <tr>
729
  <td width='300' valign='top'>
730
- <?php _e("Chat delay (seconds)", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("How long it takes for your chat window to pop up", "wplivechat") ?>"></i>
731
  </td>
732
  <td>
733
- <input id="wplc_pro_delay" name="wplc_pro_delay" type="text" size="6" maxlength="4" value="<?php echo isset( $wplc_acbc_data['wplc_chat_delay'] ) ? stripslashes($wplc_acbc_data['wplc_chat_delay']) : ''; ?>" />
734
  </td>
735
  </tr>
736
  <!-- Chat Notification if want to chat -->
@@ -739,38 +646,35 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
739
  <?php _e("Chat notifications", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Alert me via email as soon as someone wants to chat (while online only)", "wplivechat"); ?>"></i>
740
  </td>
741
  <td>
742
- <input id="wplc_pro_chat_notification" name="wplc_pro_chat_notification" type="checkbox" value="yes" <?php if (isset($wplc_pro_chat_notification)) { echo $wplc_pro_chat_notification; } ?>/>
743
  </td>
744
  </tr>
745
 
746
  </table>
747
 
748
  <h3><?php _e("User Experience", 'wplivechat') ?></h3>
749
- <hr>
750
  <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='100%'>
751
  <tbody>
752
  <tr>
753
- <td width='300' valign='top'><?php _e("Enable File Sharing", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Adds file sharing to your chat box!", "wplivechat") ?>"></i></td>
754
- <td><input id='wplc_ux_file_share' name='wplc_ux_file_share' type='checkbox' <?php echo((isset($wplc_settings['wplc_ux_file_share']) && $wplc_settings['wplc_ux_file_share'] != "0") ? "checked" : "") ?> /> </td>
755
  </tr>
756
  <tr>
757
- <td width='300' valign='top'><?php _e("Enable Experience Ratings", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Allows users to rate the chat experience with an agent.", "wplivechat") ?>"></i></td>
758
- <td><input id='wplc_ux_exp_rating' name='wplc_ux_exp_rating' type='checkbox' <?php echo((isset($wplc_settings['wplc_ux_exp_rating']) && $wplc_settings['wplc_ux_exp_rating'] != "0") ? "checked" : "") ?> /> </td>
759
  </tr>
760
  </tbody>
761
  </table>
762
 
763
  <h3><?php _e("Social", 'wplivechat') ?></h3>
764
- <hr>
765
-
766
  <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='100%'>
767
  <tbody>
768
  <tr>
769
  <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>
770
- <td><input id='wplc_social_fb' class='wplc_check_url' name='wplc_social_fb' placeholder="<?php _e("Facebook URL...", "wplivechat") ?>" type='text' value="<?php echo (isset($wplc_acbc_data['wplc_social_fb']) ? urldecode($wplc_acbc_data['wplc_social_fb']) : "") ?>" />
771
 
772
  <?php
773
- if(isset($wplc_acbc_data['wplc_social_fb']) && !filter_var($wplc_acbc_data['wplc_social_fb'], FILTER_VALIDATE_URL) && trim($wplc_acbc_data['wplc_social_fb']) !== ""){
774
  ?><br><strong>Note: </strong>This does not appear to be a valid URL<?php
775
  }
776
  ?>
@@ -779,10 +683,10 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
779
  </tr>
780
  <tr>
781
  <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>
782
- <td><input id='wplc_social_tw' class='wplc_check_url' name='wplc_social_tw' placeholder="<?php _e("Twitter URL...", "wplivechat") ?>" type='text' value="<?php echo (isset($wplc_acbc_data['wplc_social_tw']) ? urldecode($wplc_acbc_data['wplc_social_tw']) : "") ?>" />
783
 
784
  <?php
785
- if(isset($wplc_acbc_data['wplc_social_tw']) && !filter_var($wplc_acbc_data['wplc_social_tw'], FILTER_VALIDATE_URL) && trim($wplc_acbc_data['wplc_social_tw']) !== ""){
786
  ?><br><strong>Note: </strong>This does not appear to be a valid URL<?php
787
  }
788
  ?>
@@ -801,50 +705,48 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
801
  <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='100%'>
802
  <tr>
803
  <td width='300'>
804
- <?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>
805
  </td>
806
  <td>
807
- <input type="checkbox" name="wplc_hide_when_offline" value="1" <?php
808
- if (isset($wplc_settings['wplc_hide_when_offline']) && intval($wplc_settings['wplc_hide_when_offline']) == 1) {
809
- echo "checked";
810
- }
811
- ?>/>
812
  </td>
813
  </tr>
814
  <tr>
815
- <td width="300" valign="top"><?php _e("Offline Chat Box Title", "wplivechat") ?>:</td>
816
  <td>
817
- <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 />
818
 
819
 
820
  </td>
821
  </tr>
822
  <tr>
823
- <td width="300" valign="top"><?php _e("Offline Text Fields", "wplivechat") ?>:</td>
824
  <td>
825
- <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 />
826
- <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 />
827
- <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 />
828
-
829
-
830
  </td>
831
  </tr>
832
  <tr>
833
- <td width="300" valign="top"><?php _e("Offline Button Text", "wplivechat") ?>:</td>
834
  <td>
835
- <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 />
836
  </td>
837
  </tr>
838
  <tr>
839
- <td width="300" valign="top"><?php _e("Offline Send Button Text", "wplivechat") ?>:</td>
840
  <td>
841
- <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 />
842
  </td>
843
  </tr>
844
  <tr>
845
- <td width="300" valign="top"><?php _e("Custom fields", "wplivechat") ?>:</td>
846
  <td>
847
- <?php do_action( "wplc_hook_offline_custom_fields_integration_settings" ); ?>
 
 
 
 
 
 
848
  </td>
849
  </tr>
850
 
@@ -856,7 +758,7 @@ if (isset($wplc_settings['wplc_hide_when_offline']) && intval($wplc_settings['wp
856
  <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages'>
857
  <tr>
858
  <td width='300' valign='top'>
859
- <?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>
860
  </td>
861
  <td>
862
  <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'])) {
@@ -869,7 +771,7 @@ if (isset($wplc_settings['wplc_hide_when_offline']) && intval($wplc_settings['wp
869
  <?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>
870
  </td>
871
  <td>
872
- <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"); ?>"/>
873
  </td>
874
  </tr>
875
 
@@ -879,33 +781,33 @@ if (isset($wplc_settings['wplc_hide_when_offline']) && intval($wplc_settings['wp
879
 
880
  <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages'>
881
  <tr>
882
- <td width="300" valign="top"><?php _e("Enable an Auto Responder", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Send your visitors an email as soon as they send you an offline message", "wplivechat") ?>"></i></td>
883
  <td>
884
  <input id="wplc_ar_enable" name="wplc_ar_enable" type="checkbox" value="1" <?php if( isset( $wplc_auto_responder_settings['wplc_ar_enable'] ) ) { echo "checked"; } ?> /> <br />
885
  </td>
886
  </tr>
887
  <tr>
888
- <td width="300" valign="top"><?php _e("Auto Responder 'From' Name", "wplivechat") ?>: </td>
889
  <td>
890
  <input type="text" name="wplc_ar_from_name" id="wplc_ar_from_name" class="regular-text" value="<?php if( isset( $wplc_auto_responder_settings['wplc_ar_from_name'] ) ) { echo stripslashes($wplc_auto_responder_settings['wplc_ar_from_name']); } ?>" />
891
  </td>
892
  </tr>
893
  <tr>
894
- <td width="300" valign="top"><?php _e("Auto Responder 'From' Email Address", "wplivechat") ?>: </td>
895
  <td>
896
  <input type="text" name="wplc_ar_from_email" id="wplc_ar_from_email" class="regular-text" value="<?php if( isset( $wplc_auto_responder_settings['wplc_ar_from_email'] ) ) { echo $wplc_auto_responder_settings['wplc_ar_from_email']; } ?>" />
897
  </td>
898
  </tr>
899
  <tr>
900
- <td width="300" valign="top"><?php _e("Auto Responder Subject Line", "wplivechat") ?>: </td>
901
  <td>
902
  <input type="text" name="wplc_ar_subject" id="wplc_ar_subject" class="regular-text" value="<?php if( isset( $wplc_auto_responder_settings['wplc_ar_subject'] ) ) { echo $wplc_auto_responder_settings['wplc_ar_subject']; } ?>" />
903
  </td>
904
  </tr>
905
  <tr>
906
- <td width="300" valign="top"><?php _e("Auto Responder Body", "wplivechat") ?>: <br/></td>
907
  <td>
908
- <textarea name="wplc_ar_body" id="wplc_ar_body" rows="6" style="width:50%;"><?php if( isset( $wplc_auto_responder_settings['wplc_ar_body'] ) ) { echo stripslashes( $wplc_auto_responder_settings['wplc_ar_body'] ); } ?></textarea>
909
  <p class="description"><small><?php _e("HTML and the following shortcodes can be used", "wplivechat"); ?>: <?php _e("User's name", "wplivechat"); ?>: {wplc-user-name} <?php _e("User's email address", "wplivechat"); ?>: {wplc-email-address}</small></p>
910
  </td>
911
  </tr>
@@ -945,10 +847,10 @@ if (isset($wplc_settings['wplc_hide_when_offline']) && intval($wplc_settings['wp
945
  line-height: 150px;
946
  }
947
  .wplc_animation_block .wplc_red{
948
- color: #E31230;
949
  }
950
  .wplc_animation_block .wplc_orange{
951
- color: #EB832C;
952
  }
953
  .wplc_animation_active, .wplc_theme_active {
954
  border: 2px solid #616161 !important;
@@ -969,74 +871,50 @@ if (isset($wplc_settings['wplc_hide_when_offline']) && intval($wplc_settings['wp
969
  line-height: 150px;
970
  }
971
  .wplc_animation_block .wplc_red{
972
- color: #E31230;
973
  }
974
  .wplc_animation_block .wplc_orange{
975
- color: #EB832C;
976
  }
977
  </style>
978
  <h3><?php _e("Styling",'wplivechat')?></h3>
979
  <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages'>
980
-
981
-
982
- <tr style='margin-bottom: 10px;'>
983
- <td width='200'><label for=""><?php _e('Choose a theme', 'wplivechat'); ?></label></td>
984
- <td>
985
- <div class='wplc_theme_block'>
986
- <div class='wplc_theme_image' id=''>
987
- <div class='wplc_theme_single'>
988
- <img style='width:162px;' src='<?php echo WPLC_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'/>
989
- <?php _e('Classic', 'wplivechat'); ?>
990
- </div>
991
- <div class='wplc_theme_single'>
992
- <img style='width:162px;' src='<?php echo WPLC_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'/>
993
- <?php _e('Modern', 'wplivechat'); ?>
994
- </div>
995
-
996
- </div>
997
- </div>
998
- <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'; } ?>/>
999
- <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'; } ?>/>
1000
-
1001
- </td>
1002
- </tr>
1003
- <tr height="30">
1004
- <td>&nbsp;</td>
1005
- <td>&nbsp;</td>
1006
- </tr>
1007
 
1008
  <tr style='margin-bottom: 10px;'>
1009
- <td><label for=""><?php _e('Color Scheme', 'wplivechat'); ?></label></td>
1010
  <td>
1011
  <div class='wplc_theme_block'>
1012
  <div class='wplc_palette'>
1013
  <div class='wplc_palette_single'>
1014
- <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'>
1015
- <div class='wplc-palette-top' style='background-color:#ED832F;'></div>
1016
  <div class='wplc-palette-top' style='background-color:#FFF;'></div>
1017
- <div class='wplc-palette-top' style='background-color:#EEE;'></div>
1018
- <div class='wplc-palette-top' style='background-color:#666;'></div>
1019
  </div>
1020
  </div>
1021
 
1022
  <div class='wplc_palette_single'>
1023
- <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'>
1024
  <div class='wplc-palette-top' style='background-color:#DB0000;'></div>
1025
  <div class='wplc-palette-top' style='background-color:#FFF;'></div>
1026
  <div class='wplc-palette-top' style='background-color:#000;'></div>
1027
- <div class='wplc-palette-top' style='background-color:#666;'></div>
1028
  </div>
1029
  </div>
1030
  <div class='wplc_palette_single'>
1031
- <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'>
1032
  <div class='wplc-palette-top' style='background-color:#000;'></div>
1033
  <div class='wplc-palette-top' style='background-color:#FFF;'></div>
1034
  <div class='wplc-palette-top' style='background-color:#888;'></div>
1035
- <div class='wplc-palette-top' style='background-color:#666;'></div>
1036
  </div>
1037
  </div>
1038
  <div class='wplc_palette_single'>
1039
- <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'>
1040
  <div class='wplc-palette-top' style='background-color:#B97B9D;'></div>
1041
  <div class='wplc-palette-top' style='background-color:#FFF;'></div>
1042
  <div class='wplc-palette-top' style='background-color:#EEE;'></div>
@@ -1044,23 +922,23 @@ if (isset($wplc_settings['wplc_hide_when_offline']) && intval($wplc_settings['wp
1044
  </div>
1045
  </div>
1046
  <div class='wplc_palette_single'>
1047
- <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'>
1048
  <div class='wplc-palette-top' style='background-color:#1A14DB;'></div>
1049
  <div class='wplc-palette-top' style='background-color:#FDFDFF;'></div>
1050
  <div class='wplc-palette-top' style='background-color:#7F7FB3;'></div>
1051
- <div class='wplc-palette-top' style='background-color:#666;'></div>
1052
  </div>
1053
  </div>
1054
  <div class='wplc_palette_single'>
1055
- <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'>
1056
  <div class='wplc-palette-top' style='background-color:#3DCC13;'></div>
1057
  <div class='wplc-palette-top' style='background-color:#FDFDFF;'></div>
1058
  <div class='wplc-palette-top' style='background-color:#EEE;'></div>
1059
- <div class='wplc-palette-top' style='background-color:#666;'></div>
1060
  </div>
1061
  </div>
1062
  <div class='wplc_palette_single'>
1063
- <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'>
1064
  <div class='wplc-palette-top' style='padding-top:3px'>&nbsp;</div>
1065
  <div class='wplc-palette-top' style='padding-top:18px'><?php _e("Custom Scheme","wplivechat"); ?></div>
1066
  <div class='wplc-palette-top' style='padding-top:3px'>&nbsp;</div>
@@ -1070,40 +948,40 @@ if (isset($wplc_settings['wplc_hide_when_offline']) && intval($wplc_settings['wp
1070
 
1071
  </div>
1072
  </div>
1073
- <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'; } ?>/>
1074
- <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'; } ?>/>
1075
- <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'; } ?>/>
1076
- <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'; } ?>/>
1077
- <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'; } ?>/>
1078
- <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'; } ?>/>
1079
- <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'; } ?>/>
1080
 
1081
  </td>
1082
  </tr>
1083
 
1084
 
1085
- <tr class='wplc_custom_pall_rows' style='<?php echo isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-6' ? '' : 'display:none;'; ?>' >
1086
  <td width='200' valign='top'><?php _e("Palette Color 1","wplivechat")?>:</td>
1087
  <td>
1088
- <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'; } ?>" />
1089
  </td>
1090
  </tr>
1091
- <tr class='wplc_custom_pall_rows' style='<?php echo isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-6' ? '' : 'display:none;'; ?>' >
1092
  <td width='200' valign='top'><?php _e("Palette Color 2","wplivechat")?>:</td>
1093
  <td>
1094
  <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'; } ?>" />
1095
  </td>
1096
  </tr>
1097
- <tr class='wplc_custom_pall_rows' style='<?php echo isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-6' ? '' : 'display:none;'; ?>' >
1098
  <td width='200' valign='top'><?php _e("Palette Color 3","wplivechat")?>:</td>
1099
  <td>
1100
  <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'; } ?>" />
1101
  </td>
1102
  </tr>
1103
- <tr class='wplc_custom_pall_rows' style='<?php echo isset($wplc_settings['wplc_theme']) && $wplc_settings['wplc_theme'] == 'theme-6' ? '' : 'display:none;'; ?>' >
1104
  <td width='200' valign='top'><?php _e("Palette Color 4","wplivechat")?>:</td>
1105
  <td>
1106
- <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'; } ?>" />
1107
  </td>
1108
  </tr>
1109
 
@@ -1122,38 +1000,48 @@ if (isset($wplc_settings['wplc_hide_when_offline']) && intval($wplc_settings['wp
1122
  </tr>
1123
 
1124
  <tr>
1125
- <td width="200" valign="top"><?php _e("I'm using a localization plugin", "wplivechat") ?></td>
1126
  <td>
1127
- <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'; } ?>/>
1128
- <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/docs/features/quickview/plugin-features/localization/' target='_BLANK'>".__("here", "wplivechat") ); ?></small>
1129
  </td>
1130
  </tr>
1131
 
1132
  <tr style='height:30px;'><td></td><td></td></tr>
1133
- <tr class="wplc_localization_strings">
1134
- <td width="200" valign="top"><?php _e("First Section Text", "wplivechat") ?>:</td>
 
 
 
 
 
 
 
 
 
 
 
 
1135
  <td>
1136
- <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 />
1137
- <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 />
1138
  </td>
1139
  </tr>
1140
  <tr class="wplc_localization_strings">
1141
- <td width="200" valign="top"><?php _e("Intro Text", "wplivechat") ?>:</td>
1142
  <td>
1143
- <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 />
1144
  </td>
1145
  </tr>
1146
  <tr class="wplc_localization_strings">
1147
- <td width="200" valign="top"><?php _e("Second Section Text", "wplivechat") ?>:</td>
1148
  <td>
1149
- <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 />
1150
- <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 />
1151
  </td>
1152
  </tr>
1153
  <tr class="wplc_localization_strings">
1154
- <td width="200" valign="top"><?php _e("Reactivate Chat Section Text", "wplivechat") ?>:</td>
1155
  <td>
1156
- <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 />
1157
 
1158
 
1159
  </td>
@@ -1165,21 +1053,21 @@ if (isset($wplc_settings['wplc_hide_when_offline']) && intval($wplc_settings['wp
1165
  </td>
1166
  </tr>
1167
  <tr class="wplc_localization_strings">
1168
- <td width="200" valign="top"><?php _e("No answer", "wplivechat") ?>:</td>
1169
  <td>
1170
- <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 />
1171
  </td>
1172
  </tr>
1173
  <tr class="wplc_localization_strings">
1174
  <td width="200" valign="top"><?php _e("Other text", "wplivechat") ?>:</td>
1175
  <td>
1176
  <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 />
1177
- <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 />
1178
  </td>
1179
  </tr>
1180
 
1181
  <tr>
1182
- <td><label for=""><?php _e('Choose an animation', 'wplivechat'); ?></label></td>
1183
 
1184
  <td>
1185
  <div class='wplc_animation_block'>
@@ -1223,7 +1111,7 @@ if (isset($wplc_settings['wplc_hide_when_offline']) && intval($wplc_settings['wp
1223
  </td>
1224
  </tr>
1225
  <tr>
1226
- <td width='300' valign='top'><?php _e("Auto First Response Message","wplivechat")?>:</td>
1227
  <td>
1228
  <input type="text" name="wplc_pro_auto_first_response_chat_msg" value="<?php echo $wplc_pro_auto_first_response_chat_msg; ?>">
1229
  <span class='description'><?php _e('This message will be sent automatically after the first message is sent from the user side. Leave empty to disable.', 'wplivechat'); ?></span>
@@ -1241,7 +1129,7 @@ if (isset($wplc_settings['wplc_hide_when_offline']) && intval($wplc_settings['wp
1241
  'meta_key' => 'wplc_ma_agent',
1242
  ));
1243
 
1244
- echo "<h3>".__('Current Users that are Chat Agents', 'wplivechat')."</h3>";
1245
 
1246
  $wplc_agents = "<div class='wplc_agent_container'><ul>";
1247
 
@@ -1249,14 +1137,14 @@ if (isset($wplc_settings['wplc_hide_when_offline']) && intval($wplc_settings['wp
1249
  foreach ($user_array as $user) {
1250
 
1251
  $wplc_agents .= "<li id=\"wplc_agent_li_".$user->ID."\">";
1252
- $wplc_agents .= "<p><img src=\"//www.gravatar.com/avatar/" . md5($user->user_email) . "?s=80&d=mm\" /></p>";
1253
  $check = get_user_meta($user->ID,"wplc_chat_agent_online");
1254
  if ($check) {
1255
  $wplc_agents .= "<span class='wplc_status_box wplc_type_returning'>".__("Logged In","wplivechat")."</span>";
1256
  }
1257
- $wplc_agents .= "<h3>" . $user->display_name . "</h3>";
1258
 
1259
- $wplc_agents .= "<small>" . $user->user_email . "</small>";
1260
 
1261
  $wplc_agents .= apply_filters("wplc_pro_agent_list_before_button_filter", "", $user);
1262
 
@@ -1279,19 +1167,19 @@ if (isset($wplc_settings['wplc_hide_when_offline']) && intval($wplc_settings['wp
1279
  // Array of stdClass objects.
1280
  foreach ( $blogusers as $user ) {
1281
  $is_agent = get_user_meta(intval( $user->ID ), 'wplc_ma_agent', true);
1282
- if(!$is_agent){ echo '<option id="wplc_selected_agent_'. intval( $user->ID ) .'" em="' . md5(sanitize_email( $user->user_email )) . '" uid="' . intval( $user->ID ) . '" em2="' . sanitize_email( $user->user_email ) . '" name="' . sanitize_text_field( $user->display_name ) . '" value="' . intval( $user->ID ) . '">' . sanitize_text_field( $user->display_name ) . ' ('.__('Administrator','wplivechat').')</option>'; }
1283
  }
1284
  $blogusers = get_users( array( 'role' => 'editor', 'fields' => array( 'display_name','ID','user_email' ) ) );
1285
  // Array of stdClass objects.
1286
  foreach ( $blogusers as $user ) {
1287
  $is_agent = get_user_meta(intval( $user->ID ), 'wplc_ma_agent', true);
1288
- if(!$is_agent){ echo '<option id="wplc_selected_agent_'. intval( $user->ID ) .'" em="' . md5(sanitize_email( $user->user_email )) . '" uid="' . intval( $user->ID ) . '" em2="' . sanitize_email( $user->user_email ) . '" name="' . sanitize_text_field( $user->display_name ) . '" value="' . intval( $user->ID ) . '">' . sanitize_text_field( $user->display_name ) . ' ('.__('Editor','wplivechat').')</option>'; }
1289
  }
1290
  $blogusers = get_users( array( 'role' => 'author', 'fields' => array( 'display_name','ID','user_email' ) ) );
1291
  // Array of stdClass objects.
1292
  foreach ( $blogusers as $user ) {
1293
  $is_agent = get_user_meta(intval( $user->ID ), 'wplc_ma_agent', true);
1294
- if(!$is_agent){ echo '<option id="wplc_selected_agent_'. intval( $user->ID ) .'" em="' . md5(sanitize_email( $user->user_email )) . '" uid="' . intval( $user->ID ) . '" em2="' . sanitize_email( $user->user_email ) . '" name="' . sanitize_text_field( $user->display_name ) . '" value="' . intval( $user->ID ) . '">' . sanitize_text_field( $user->display_name ) . ' ('.__('Author','wplivechat').')</option>'; }
1295
  }
1296
  ?>
1297
  </select>
@@ -1301,13 +1189,13 @@ if (isset($wplc_settings['wplc_hide_when_offline']) && intval($wplc_settings['wp
1301
  </div>
1302
 
1303
  <hr/>
1304
- <p class="description"><?php _e("Should you wish to add a user that has a role less than 'Author', please go to the <a href='./users.php'>Users</a> page, select the relevant user, click Edit and scroll to the bottom of the page and enable the 'Chat Agent' checkbox.", "wplivechat"); ?></p>
1305
  <p class="description"><?php _e("If there are no chat agents online, the chat will show as offline", "wplivechat"); ?></p>
1306
 
1307
 
1308
  </div>
1309
  <div id="tabs-7">
1310
- <h3><?php _e("Blocked Visitors - Based on IP Address", "wplivechat") ?></h3>
1311
  <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='100%'>
1312
  <tr>
1313
  <td>
@@ -1317,7 +1205,7 @@ if (isset($wplc_settings['wplc_hide_when_offline']) && intval($wplc_settings['wp
1317
  $ip_addresses = maybe_unserialize($ip_addresses);
1318
  if ($ip_addresses && is_array($ip_addresses)) {
1319
  foreach($ip_addresses as $ip){
1320
- echo $ip."\n";
1321
  }
1322
  }
1323
  }
@@ -1334,17 +1222,16 @@ if (isset($wplc_settings['wplc_hide_when_offline']) && intval($wplc_settings['wp
1334
 
1335
  $content .= "<div id='wplc-business-hours'>";
1336
 
1337
- $content .= "<h2>".__("Business Hours", "wplivechat")."</h2>";
1338
  $content .= "<table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' >";
1339
 
1340
  $content .= "<tr>";
1341
  $content .= "<td width='300'>".__("Enable Business Hours", "wplivechat")."</td>";
1342
- if( isset( $wplc_bh_settings['enabled'] ) && $wplc_bh_settings['enabled'] === true ) { $checked = 'checked'; } else { $checked = ''; }
1343
- $content .= "<td><input type='checkbox' name='wplc_bh_enable' id='wplc_bh_enable' value='1' $checked /></td>";
1344
  $content .= "</tr>";
1345
 
1346
  $content .= "<tr>";
1347
- $content .= "<td width='300'>".__("Display Interval", "wplivechat")."</td>";
1348
  $content .= "<td>";
1349
  $content .= "<select name='wplc_bh_interval' id='wplc_bh_interval'>";
1350
  $wplc_intervals = array(
@@ -1353,53 +1240,38 @@ if (isset($wplc_settings['wplc_hide_when_offline']) && intval($wplc_settings['wp
1353
  '2' => __("Weekends", "wplivechat")
1354
  );
1355
  $wplc_intervals = apply_filters( "wplc_bg_intervals_array", $wplc_intervals );
1356
- if( $wplc_intervals ){
1357
-
1358
  foreach( $wplc_intervals as $key => $val ){
1359
- if( isset( $wplc_bh_settings['interval'] ) && $wplc_bh_settings['interval'] == $key ){ $sel = 'selected'; } else { $sel = ''; }
1360
- $content .= "<option value='$key' $sel>$val</option>";
1361
  }
1362
-
1363
  }
1364
  $content .= "</select><br/>";
1365
 
1366
  $wplc_times_array = wplc_return_times_array_mrg();
1367
 
1368
- $content .= __(" Between ", "wplivechat")."<select name='wplc_bh_hours_start' id='wplc_bh_hours_start'>";
1369
- if( $wplc_times_array ){
1370
- $hours = $wplc_times_array['hours'];
1371
- foreach( $hours as $hour ){
1372
- if( (isset( $wplc_bh_settings['start'] ) ) && ( isset( $wplc_bh_settings['start']['h'] ) && $wplc_bh_settings['start']['h'] == $hour ) ){ $sel = 'selected'; } else { $sel = ''; }
1373
- $content .= "<option value='$hour' $sel>$hour</option>";
1374
- }
1375
- }
1376
  $content .= "</select>:";
1377
  $content .= "<select name='wplc_bh_minutes_start' id='wplc_bh_minutes_start'>";
1378
- if( $wplc_times_array ){
1379
- $minutes = $wplc_times_array['minutes'];
1380
- foreach( $minutes as $minute ){
1381
- if( (isset( $wplc_bh_settings['start'] ) ) && ( isset( $wplc_bh_settings['start']['m'] ) && $wplc_bh_settings['start']['m'] == $minute ) ){ $sel = 'selected'; } else { $sel = ''; }
1382
- $content .= "<option value='$minute' $sel>$minute</option>";
1383
- }
1384
- }
1385
- $content .= "</select>".__(" and ", "wplivechat");
1386
  $content .= "<select name='wplc_bh_hours_end' id='wplc_bh_hours_end'>";
1387
- if( $wplc_times_array ){
1388
- $hours = $wplc_times_array['hours'];
1389
- foreach( $hours as $hour ){
1390
- if( (isset( $wplc_bh_settings['end'] ) ) && ( isset( $wplc_bh_settings['end']['h'] ) && $wplc_bh_settings['end']['h'] == $hour ) ){ $sel = 'selected'; } else { $sel = ''; }
1391
- $content .= "<option value='$hour' $sel>$hour</option>";
1392
- }
1393
- }
1394
- $content .= "</select>";
1395
  $content .= "<select name='wplc_bh_minutes_end' id='wplc_bh_minutes_end'>";
1396
- if( $wplc_times_array ){
1397
- $minutes = $wplc_times_array['minutes'];
1398
- foreach( $minutes as $minute ){
1399
- if( (isset( $wplc_bh_settings['end'] ) ) && ( isset( $wplc_bh_settings['end']['m'] ) && $wplc_bh_settings['end']['m'] == $minute ) ){ $sel = 'selected'; } else { $sel = ''; }
1400
- $content .= "<option value='$minute' $sel>$minute</option>";
1401
- }
1402
- }
1403
  $content .= "</select>";
1404
  $content .= "</td>";
1405
  $content .= "</tr>";
@@ -1423,20 +1295,15 @@ if (isset($wplc_settings['wplc_hide_when_offline']) && intval($wplc_settings['wp
1423
  <tr>
1424
  <td width='300' valign='top'><?php _e("Enable Encryption", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e('All messages will be encrypted when being sent to and from the user and agent.', 'wplivechat'); ?>"></i></td>
1425
  <td>
1426
- <input type="checkbox" name="wplc_enable_encryption" id="wplc_enable_encryption" value="1" <?php if(isset($wplc_encrypt_data['wplc_enable_encryption']) && $wplc_encrypt_data['wplc_enable_encryption'] == 1){ echo 'checked'; } ?>/>
1427
  </td>
1428
  </tr>
1429
  <tr>
1430
  <td width='300'></td>
1431
  <td>
1432
  <p class='notice notice-error'>
1433
- <?php _e('Please note: Chat messages will only be encrypted and decrypted if you have inserted your WP Live Chat Support API Key with a previous version of our Pro add-on as this key was required.', 'wplivechat'); ?>
1434
  <?php _e('Once enabled, all messages sent will be encrypted. This cannot be undone.', 'wplivechat'); ?>
1435
  </p>
1436
-
1437
- <p class='update-nag'>
1438
- <?php _e('Please note: Message encryption will be deprecated in our next major release.', 'wplivechat'); ?>
1439
- </p>
1440
  </td>
1441
  </tr>
1442
  </table>
4
  exit;
5
  }
6
 
7
+ global $wplc_default_settings_array;
8
+
9
  ?>
10
  <style>
11
  .ui-tabs-vertical { }
15
  max-width: 20%;
16
  min-width: 190px;
17
  }
18
+ .ui-tabs-vertical .ui-tabs-nav li { clear: left; width: 100%; border-bottom-width: 1px !important; border-right-width: 1px !important; margin: 0 -1px .2em 0; }
19
  .ui-tabs-vertical .ui-tabs-nav li a { display:block; }
20
  .ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active { padding-bottom: 0; padding-right: .1em; border-right-width: 1px; }
21
  .ui-tabs-vertical .ui-tabs-panel {
22
+ padding-top:4px;
23
  float: left;
24
  min-width: 67%;
25
  max-width: 67%;
26
  }
27
  textarea, input[type='text'], input[type='email'], input[type='password']{ width: 100% !important; }
28
+ .ui-tabs-panel > h3, .ui-tabs-panel > h4{ display: block;
29
+ background: #0596d4;
30
+ margin-top: 0;
31
+ padding: 6px;
32
+ color: #FFF;
33
+ margin-bottom:3px;
34
+ border-radius:2px;
35
+ font-weight:normal;
36
+ font-size:16px;
37
+ }
38
+
39
  </style>
40
 
41
  <?php
57
 
58
  <?php wplc_stats("settings");
59
 
60
+ $wplc_settings = wplc_get_options();
 
 
61
 
62
  ?>
63
 
 
 
 
 
 
 
 
 
64
  <img src='<?php echo WPLC_PLUGIN_URL.'images/ajax-loader.gif'; ?>' id='wplc_settings_page_loader' style='display: block; margin: 20px auto;' />
65
+ <style>
 
 
66
  .wplc_light_grey{
67
+ color: #373737;
68
  }
69
+ </style>
70
+ <div class="wrap wplc_wrap" style='display: none;'>
71
+ <h2><?php _e("Settings","wplivechat")?></h2>
 
 
72
  <?php
73
  if (isset($wplc_settings["wplc_settings_align"])) { $wplc_settings_align[intval($wplc_settings["wplc_settings_align"])] = "SELECTED"; }
74
  if (isset($wplc_settings["wplc_settings_enabled"])) { $wplc_settings_enabled[intval($wplc_settings["wplc_settings_enabled"])] = "SELECTED"; }
75
+ if (isset($wplc_settings["wplc_settings_fill"])) { $wplc_settings_fill = $wplc_settings["wplc_settings_fill"]; } else { $wplc_settings_fill = "0596d4"; }
76
  if (isset($wplc_settings["wplc_settings_font"])) { $wplc_settings_font = $wplc_settings["wplc_settings_font"]; } else { $wplc_settings_font = "FFFFFF"; }
77
+ if (isset($wplc_settings["wplc_settings_color1"])) { $wplc_settings_color1 = $wplc_settings["wplc_settings_color1"]; } else { $wplc_settings_color1 = "0596d4"; }
78
  if (isset($wplc_settings["wplc_settings_color2"])) { $wplc_settings_color2 = $wplc_settings["wplc_settings_color2"]; } else { $wplc_settings_color2 = "FFFFFF"; }
79
  if (isset($wplc_settings["wplc_settings_color3"])) { $wplc_settings_color3 = $wplc_settings["wplc_settings_color3"]; } else { $wplc_settings_color3 = "EEEEEE"; }
80
+ if (isset($wplc_settings["wplc_settings_color4"])) { $wplc_settings_color4 = $wplc_settings["wplc_settings_color4"]; } else { $wplc_settings_color4 = "373737"; }
 
81
 
 
 
 
82
  $wplc_auto_responder_settings = get_option( "WPLC_AUTO_RESPONDER_SETTINGS" );
 
 
 
83
 
84
  $wplc_quick_response_order_by = isset( $wplc_settings['wplc_quick_response_orderby'] ) ? sanitize_text_field( $wplc_settings['wplc_quick_response_orderby'] ) : 'title';
85
  $wplc_quick_response_order = isset( $wplc_settings['wplc_quick_response_order'] ) ? sanitize_text_field( $wplc_settings['wplc_quick_response_order'] ) : 'DESC';
152
  </td>
153
  <td valign='top'>
154
  <div class="wplc-require-user-info__item">
155
+ <input type="radio" value="both" name="wplc_require_user_info" id="wplc_require_user_info_both"<?php echo ($wplc_settings['wplc_require_user_info'] == 'both' ? ' checked' : '');?> />
156
  <label for="wplc_require_user_info_both"><?php _e( 'Name and email', 'wplivechat' ); ?></label>
157
  </div>
158
  <div class="wplc-require-user-info__item">
159
+ <input type="radio" value="email" name="wplc_require_user_info" id="wplc_require_user_info_email"<?php echo ($wplc_settings['wplc_require_user_info'] == 'email' ? ' checked' : '');?> />
160
  <label for="wplc_require_user_info_email"><?php _e( 'Email', 'wplivechat' ); ?></label>
161
  </div>
162
  <div class="wplc-require-user-info__item">
163
+ <input type="radio" value="name" name="wplc_require_user_info" id="wplc_require_user_info_name"<?php echo ($wplc_settings['wplc_require_user_info'] == 'name' ? ' checked' : '');?> />
164
  <label for="wplc_require_user_info_name"><?php _e( 'Name', 'wplivechat' ); ?></label>
165
  </div>
166
  <div class="wplc-require-user-info__item">
167
+ <input type="radio" value="none" name="wplc_require_user_info" id="wplc_require_user_info_none"<?php echo ($wplc_settings['wplc_require_user_info'] == 'none' ? ' checked' : '');?> />
168
  <label for="wplc_require_user_info_none"><?php _e( 'No fields', 'wplivechat' ); ?></label>
169
  </div>
170
  </td>
174
  <?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>
175
  </td>
176
  <td valign='top'>
177
+ <input type="text" name="wplc_user_default_visitor_name" maxlength="25" id="wplc_user_default_visitor_name" value="<?php if ( isset( $wplc_settings['wplc_user_default_visitor_name'] ) ) { echo esc_attr( $wplc_settings['wplc_user_default_visitor_name'] ); } else { echo __( "Guest", "wplivechat" ); } ?>" />
178
  </td>
179
  </tr>
180
  <tr>
182
  <?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>
183
  </td>
184
  <td valign='top'>
185
+ <textarea cols="45" rows="5" name="wplc_user_alternative_text" ><?php echo esc_textarea($wplc_settings['wplc_user_alternative_text']); ?></textarea>
186
  </td>
187
  </tr>
188
  <tr>
190
  <?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>
191
  </td>
192
  <td valign='top'>
193
+ <input type="checkbox" value="1" name="wplc_loggedin_user_info"<?php echo ($wplc_settings['wplc_loggedin_user_info'] ? ' checked' : '');?> />
 
 
 
 
 
 
 
 
194
  </td>
195
  </tr>
196
 
197
+ <?php if ($wplc_settings['wplc_use_node_server']) { ?>
198
  <tr>
199
  <td width='300' valign='top'>
200
  <?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>
201
  </td>
202
  <td valign='top'>
203
+ <input type="checkbox" value="1" name="wplc_enable_visitor_sound"<?php echo ($wplc_settings['wplc_enable_visitor_sound'] ? ' checked' : '');?> />
204
  </td>
205
  </tr>
206
  <?php } ?>
209
  <?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>
210
  </td>
211
  <td valign='top'>
212
+ <input type="checkbox" value="1" name="wplc_enable_msg_sound"<?php echo ($wplc_settings['wplc_enable_msg_sound'] ? ' checked' : '');?> />
213
  </td>
214
  </tr>
215
 
218
  <?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>
219
  </td>
220
  <td valign='top'>
221
+ <input type="checkbox" value="1" name="wplc_enable_font_awesome"<?php echo ($wplc_settings['wplc_enable_font_awesome'] ? ' checked' : '');?>/>
222
  </td>
223
  </tr>
224
  <tr>
226
  <?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>
227
  </td>
228
  <td valign='top'>
229
+ <input type="checkbox" value="1" name="wplc_enable_all_admin_pages"<?php echo ($wplc_settings['wplc_enable_all_admin_pages'] ? ' checked' : '');?> />
230
  </td>
231
  </tr>
232
+ <tr>
233
+ <td width='300' valign='top'>
234
+ <?php _e("Delete database entries on uninstall","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("This will delete all WP Live Chat by 3CX related database entries such as options and chats on uninstall.", "wplivechat") ?>"></i>
235
+ </td>
236
+ <td valign='top'>
237
+ <input type="checkbox" value="1" name="wplc_delete_db_on_uninstall"<?php echo ($wplc_settings['wplc_delete_db_on_uninstall'] ? ' checked' : '');?>/>
238
+ </td>
239
+ </tr>
240
  </table>
241
 
242
  <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='700'>
243
  <tr>
244
  <td width='350' valign='top'>
245
+ <?php _e("Agents can set their online status", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php echo __('Checking this will allow you to change your status to Online or Offline on the Live Chat page.', 'wplivechat').' '.__('If this option is disabled, agents will be always automatically online.', 'wplivechat'); ?>"></i>
246
  </td>
247
  <td>
248
+ <input type="checkbox" value="1" name="wplc_allow_agents_set_status"<?php echo ($wplc_settings['wplc_allow_agents_set_status'] ? ' checked' : '');?> />
249
  </td>
250
  </tr>
251
  </table>
 
252
 
253
  <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='700'>
254
  <tr>
256
  <?php _e("Exclude chat from 'Home' page:", "wplivechat"); ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Leaving this unchecked will allow the chat window to display on your home page.", "wplivechat") ?>"></i>
257
  </td>
258
  <td valign='top'>
259
+ <input type="checkbox" name="wplc_exclude_home"<?php echo ($wplc_settings['wplc_exclude_home'] ? ' checked' : ''); ?> value='1' />
260
  </td>
261
  </tr>
262
  <tr>
264
  <?php _e("Exclude chat from 'Archive' pages:", "wplivechat"); ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Leaving this unchecked will allow the chat window to display on your archive pages.", "wplivechat") ?>"></i>
265
  </td>
266
  <td valign='top'>
267
+ <input type="checkbox" name="wplc_exclude_archive"<?php echo ($wplc_settings['wplc_exclude_archive'] ? ' checked' : ''); ?> value='1' />
268
  </td>
269
  </tr>
270
  <tr>
272
  <?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>
273
  </td>
274
  <td valign='top'>
275
+ <input type="text" name="wplc_include_on_pages" value="<?php echo esc_attr($wplc_settings['wplc_include_on_pages']); ?>" />
276
  </td>
277
  </tr>
278
  <tr>
280
  <?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>
281
  </td>
282
  <td valign='top'>
283
+ <input type="text" name="wplc_exclude_from_pages" value="<?php echo esc_attr($wplc_settings['wplc_exclude_from_pages']); ?>" />
284
  </td>
285
  </tr>
286
  <tr class="wplc-exclude-post-types__row">
288
  <?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>
289
  </td>
290
  <td valign='top'><?php
 
291
  $wplc_posts_types = get_post_types(
292
  array(
293
  '_builtin' => false,
298
  if ( ! empty( $wplc_posts_types ) ) {
299
  foreach ( $wplc_posts_types as $posts_type ) { ?>
300
  <div class="wplc-exclude-post-types__item">
301
+ <input type="checkbox" value="<?php echo $posts_type->name; ?>" id="wplc_exclude_post_types_<?php echo $posts_type->name; ?>" name="wplc_exclude_post_types[]" <?php echo ( ! empty( $wplc_settings['wplc_exclude_post_types'] ) && in_array( $posts_type->name, $wplc_settings['wplc_exclude_post_types'] ) ) ? 'checked' : ''; ?> />
302
  <label for="wplc_exclude_post_types_<?php echo $posts_type->name; ?>"><?php _e( $posts_type->label, "wplivechat" ) ?></label>
303
  </div>
304
  <?php
310
  </tr>
311
  <tr>
312
  <td width='300' valign='top'>
313
+ <?php _e("Allow WP users to self-assign as a chat agent", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e('Checking this will allow any of your users to make themselves a chat agent when editing their profile.', 'wplivechat'); ?>"></i>
314
  </td>
315
  <td>
316
+ <input type="checkbox" value="1" name="wplc_make_agent"<?php echo ($wplc_settings['wplc_make_agent'] ? ' checked' : ''); ?> />
317
  </td>
318
  </tr>
319
 
320
  </table>
 
321
 
322
  <h4><?php _e( "Quick Response", "wplivechat" ); ?></h4>
323
  <table class="wp-list-table wplc_list_table widefat fixed striped pages">
336
  </tr>
337
  <tr>
338
  <td width="350" valign="top">
339
+ <label for="wplc_quick_response_order"><?php _e( "Sort", "wplivechat" ); ?></label>
340
  </td>
341
  <td valign="top">
342
  <select id='wplc_quick_response_order' name='wplc_quick_response_order'>
347
  </tr>
348
  </tbody>
349
  </table>
350
+ <div style="display:none">
351
+ <h4><?php _e( "Voice Notes", "wplivechat" ); ?></h4>
352
+ <table class='wp-list-table wplc_list_table widefat fixed striped pages' width='700'>
353
  <tr>
354
  <td width='350' valign='top'>
355
  <?php _e( "Enable Voice Notes on admin side", "wplivechat" ); ?>: <i
357
  title="<?php _e( "Enabling this will allow you to record the voice during the chat and send it to visitor once you hold on CTRL + SPACEBAR in main chat window", "wplivechat" ) ?>"></i>
358
  </td>
359
  <td valign='top'>
360
+ <input type="checkbox" value="1" name="wplc_enable_voice_notes_on_admin"<?php echo ($wplc_settings['wplc_enable_voice_notes_on_admin'] ? ' checked' : '' ) ?> />
 
 
 
361
  </td>
362
  </tr>
363
  <tr>
367
  title="<?php _e( "Enabling this will allow the visitors to record the voice during the chat and send it to agent once they hold on CTRL + SPACEBAR", "wplivechat" ) ?>"></i>
368
  </td>
369
  <td valign='top'>
370
+ <input type="checkbox" value="1" name="wplc_enable_voice_notes_on_visitor"<?php echo ($wplc_settings['wplc_enable_voice_notes_on_visitor'] ? ' checked' : '' ) ?> />
 
 
 
371
  </td>
372
  </tr>
373
  </table>
374
+ </div>
375
 
376
  <?php do_action('wplc_hook_admin_settings_main_settings_after'); ?>
377
 
378
 
379
  </div>
380
  <div id="tabs-2">
381
+ <h3><?php _e("Chat Box Settings",'wplivechat')?></h3>
382
  <table class='wp-list-table wplc_list_table widefat fixed striped pages'>
383
  <tr>
384
+ <td width='300' valign='top'><?php _e("Alignment","wplivechat")?>:</td>
385
  <td>
386
  <select id='wplc_settings_align' name='wplc_settings_align'>
387
  <option value="1" <?php if (isset($wplc_settings_align[1])) { echo $wplc_settings_align[1]; } ?>><?php _e("Bottom left","wplivechat"); ?></option>
396
  <?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>
397
  </td>
398
  <td>
399
+ <input type="checkbox" name="wplc_auto_pop_up" value="1" <?php echo ($wplc_settings['wplc_auto_pop_up'] ? ' checked' : ''); ?>/>
400
  </td>
401
  </tr>
402
 
403
  <tr>
404
  <td>
405
+ <?php _e("Display for chat message:", "wplivechat") ?>
406
  </td>
407
  <td>
408
+ <input type="checkbox" name="wplc_show_name" value="1"<?php echo ($wplc_settings['wplc_show_name'] ? ' checked' : '');?>/> <label><?php _e("Name", "wplivechat"); ?></label><br/>
409
+ <input type="checkbox" name="wplc_show_avatar" value="1"<?php echo ($wplc_settings['wplc_show_avatar'] ? ' checked' : '');?>/> <label><?php _e("Avatar", "wplivechat"); ?></label><br/>
 
 
410
  </td>
411
  </tr>
412
+ <tr>
413
+ <td width='300'>
414
+ <?php echo __("Display typing indicator", "wplivechat");?> <i class='fa fa-question-circle wplc_light_grey wplc_settings_tooltip' title="<?php _e("Display the 'typing...' animation in the chat window as soon as an agent or visitor is typing.", "wplivechat");?>"></i>
415
+ </td>
416
+ <td>
417
+ <input type="checkbox" name="wplc_typing_enabled" value="1"<?php echo ($wplc_settings['wplc_typing_enabled'] ? ' checked' : '');?>/>
418
+ <small><em><?php echo __("For non-cloud server users, please note that this will increase the amount of server resources required.", "wplivechat"); ?> </em></small>
419
+ </td>
420
+ </tr>
421
  <tr>
422
  <td>
423
+ <?php _e("Chat box for logged in users only:", "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>
424
  </td>
425
  <td>
426
+ <input type="checkbox" name="wplc_display_to_loggedin_only" value="1"<?php echo ($wplc_settings['wplc_display_to_loggedin_only'] ? ' checked' : ''); ?>/>
 
 
 
 
427
  </td>
428
  </tr>
429
  <tr>
430
  <td>
431
+ <?php _e("Display a timestamp in the chat window:", "wplivechat") ?>
432
  </td>
433
  <td>
434
+ <input type="checkbox" name="wplc_show_date" value="1"<?php echo ($wplc_settings['wplc_show_date'] ? ' checked' : ''); ?>/> <label><?php _e("Date", "wplivechat"); ?></label><br/>
435
+ <input type="checkbox" name="wplc_show_time" value="1"<?php echo ($wplc_settings['wplc_show_time'] ? ' checked' : ''); ?>/> <label><?php _e("Time", "wplivechat"); ?></label>
 
 
436
  </td>
437
  </tr>
438
  <tr>
439
  <td>
440
+ <?php _e("Redirect to “Thank You” page on chat end:", "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>
441
  </td>
442
  <td>
443
+ <input type="checkbox" name="wplc_redirect_to_thank_you_page" value="1"<?php echo ($wplc_settings['wplc_redirect_to_thank_you_page'] ? ' checked' : ''); ?>/>
444
+ <input type="text" name="wplc_redirect_thank_you_url" value="<?php echo (!empty($wplc_settings['wplc_redirect_thank_you_url']) ? urldecode($wplc_settings['wplc_redirect_thank_you_url']) : '' ); ?>" placeholder="<?php _e('Thank You Page URL', 'wplivechat'); ?>" class='wplc_check_url' />
445
  </td>
446
  </tr>
447
  <?php
455
  ?>
456
  </td>
457
  <td>
458
+ <input type="checkbox" name="wplc_disable_emojis"<?php if ($wplc_settings['wplc_disable_emojis']) {echo ' checked="checked"';} ?>/>
 
 
 
 
 
459
  </tr>
460
  <?php
461
  }
463
  </table>
464
 
465
  <?php
 
 
466
  echo "<table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='700'>";
467
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
468
 
469
  <tr>
470
  <td width='420' valign='top'>
471
+ <?php _e("User / Agent name", "wplivechat") ?>:
472
  </td>
473
  <td>
474
+ <input id='wplc_chat_name' name='wplc_chat_name' type='text' size='50' maxlength='50' class='regular-text' value='<?php echo stripslashes($wplc_settings['wplc_chat_name']); ?>' />
475
  </td>
476
  </tr>
477
  <tr>
478
  <td width='420' valign='top'>
479
+ - <?php _e("Use WordPress name", "wplivechat") ?>:
480
  </td>
481
  <td>
482
+ <input id='wplc_use_wp_name' name='wplc_use_wp_name' value='1' type='checkbox'<?php echo ($wplc_settings['wplc_use_wp_name'] ? ' checked' : '');?>/> <small><em><?php _e("Note: 'Name' field will be ignored", "wplivechat")?></em></small>
483
  </td>
484
  </tr>
485
 
486
+ <?php
487
+
488
+ $wplc_ringtones = wplc_sounds_get_array(WPLC_PLUGIN_DIR."/includes/sounds/");
489
+ $wplc_messagetones = wplc_sounds_get_array(WPLC_PLUGIN_DIR."/includes/sounds/message/");
490
+ $wplc_ringtone_selected = '';
491
+ $wplc_messagetone_selected = '';
492
+ if (isset($wplc_settings['wplc_ringtone'])) {
493
+ $wplc_ringtone_selected = wplc_get_ringtone_name($wplc_settings['wplc_ringtone']);
494
+ }
495
+ if (isset($wplc_settings['wplc_messagetone'])) {
496
+ $wplc_messagetone_selected = wplc_get_messagetone_name($wplc_settings['wplc_messagetone']);
497
+ }
498
 
499
+ /* Thank you to the following authors of the sound files used in WP Live Chat Support
500
 
501
+ (1) Mike Koenig Sound - Store door chime, Mario jump, ringing phone, Rooster, ship bell
502
+ (2) Freesfx.com
503
+ (3) Corsica - Elevator ding sound, Air plane ding
504
+ (4) Brian Rocca - Pin dropping
505
+ (5) Marianne Gagnon - Robot blip
506
+ (6) Caroline Ford - Drop metal thing
507
+ (7) bennstir - Doorbell
508
 
509
+ */
510
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
511
  ?>
512
+ <tr>
513
+ <td width='420' valign='top'>
514
+ <?php _e("Incoming chat ring tone", "wplivechat") ?>:
515
+ </td>
516
+ <td>
517
+ <select name='wplc_ringtone' id='wplc_ringtone'>
518
+ <?php
519
+ foreach($wplc_ringtones as $k=>$v) {
520
+ echo '<option playurl="'.wplc_get_ringtone_url($k).'" value="'.$k.'" '.(($k==$wplc_ringtone_selected) ? 'selected' : '').'>'.$v.'</option>';
521
+ }
522
+ ?>
523
+ </select>
524
+ <button type='button' id='wplc_sample_ring_tone'><i class='fa fa-play'></i></button>
525
+ </td>
526
+ </tr>
527
 
528
+ <tr>
529
+ <td width='420' valign='top'>
530
+ <?php _e("Incoming message tone", "wplivechat") ?>:
531
+ </td>
532
+ <td>
533
+ <select name='wplc_messagetone' id='wplc_messagetone'>
534
+ <?php
535
+ foreach($wplc_messagetones as $k=>$v) {
536
+ echo '<option playurl="'.wplc_get_messagetone_url($k).'" value="'.$k.'" '.(($k==$wplc_messagetone_selected) ? 'selected' : '').'>'.$v.'</option>';
537
+ }
538
+ ?>
539
+ </select>
540
+ <button type='button' id='wplc_sample_message_tone'><i class='fa fa-play'></i></button>
541
+ </td>
542
+ </tr>
543
 
544
  <!-- Chat Icon-->
545
  <tr class='wplc-icon-area'>
547
  <?php _e("Icon", "wplivechat") ?>:
548
  </td>
549
  <td>
550
+ <div class="wplc_default_chat_icon_selector" style="display:block;max-height:50px;background-color:#<?php echo $wplc_settings['wplc_settings_color1'];?>" id="wplc_icon_area">
551
+ <img src="<?php echo trim(urldecode($wplc_settings['wplc_chat_icon'])); ?>" width="50px"/>
552
+ </div>
553
+ <input id="wplc_upload_icon" name="wplc_upload_icon" type="hidden" size="35" class="regular-text" maxlength="700" value=""/>
554
  <br/>
555
  <input id="wplc_btn_upload_icon" name="wplc_btn_upload_icon" type="button" value="<?php _e("Upload Icon", "wplivechat") ?>" />
556
  <input id="wplc_btn_select_default_icon" name="wplc_btn_select_default_icon" type="button" value="<?php _e("Select Default Icon", "wplivechat") ?>" />
557
  <br/>
558
  <input id="wplc_btn_remove_icon" name="wplc_btn_remove_icon" type="button" value="<?php _e("Remove Icon", "wplivechat") ?>" />
559
+ <?php _e("Recommended Size 50px x 50px", "wplivechat") ?>
560
 
561
  <div id="wplc_default_chat_icons" style="display: none">
562
  <strong><?php _e("Select Default Icon", "wplivechat"); ?></strong>
602
  <?php _e("Picture", "wplivechat") ?>:
603
  </td>
604
  <td>
605
+ <div style="display:block" id="wplc_pic_area">
606
+ <img src="<?php echo urldecode($wplc_settings['wplc_chat_pic']); ?>" width="60px"/>
607
+ </div>
608
+ <input id="wplc_upload_pic" name="wplc_upload_pic" type="hidden" size="35" class="regular-text" maxlength="700" value=""/>
609
  <br/>
610
  <input id="wplc_btn_upload_pic" name="wplc_btn_upload_pic" type="button" value="<?php _e("Upload Image", "wplivechat") ?>" />
611
  <br/>
612
  <input id="wplc_btn_remove_pic" name="wplc_btn_remove_pic" type="button" value="<?php _e("Remove Image", "wplivechat") ?>" />
613
+ <?php _e("Recommended Size 60px x 60px", "wplivechat") ?>
614
  </td>
615
  </tr>
616
 
620
  <?php _e("Logo", "wplivechat") ?>:
621
  </td>
622
  <td>
623
+ <div style="display:block" id="wplc_logo_area">
624
+ <img src="<?php echo urldecode($wplc_settings['wplc_chat_logo']); ?>" width="100px"/>
625
+ </div>
626
+ <input id="wplc_upload_logo" name="wplc_upload_logo" type="hidden" size="35" class="regular-text" maxlength="700" value=""/>
627
  <br/>
628
  <input id="wplc_btn_upload_logo" name="wplc_btn_upload_logo" type="button" value="<?php _e("Upload Logo", "wplivechat") ?>" />
629
  <br/>
630
  <input id="wplc_btn_remove_logo" name="wplc_btn_remove_logo" type="button" value="<?php _e("Remove Logo", "wplivechat") ?>" />
631
+ <?php _e("Recommended Size 250px x 40px", "wplivechat") ?>
632
  </td>
633
  </tr>
634
 
635
  <tr>
636
  <td width='300' valign='top'>
637
+ <?php _e("Chat button delayed startup (seconds)", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("How long to delay showing the Live Chat button on a page", "wplivechat") ?>"></i>
638
  </td>
639
  <td>
640
+ <input id="wplc_chat_delay" name="wplc_chat_delay" type="text" size="6" maxlength="4" value="<?php echo intval($wplc_settings['wplc_chat_delay']); ?>" />
641
  </td>
642
  </tr>
643
  <!-- Chat Notification if want to chat -->
646
  <?php _e("Chat notifications", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Alert me via email as soon as someone wants to chat (while online only)", "wplivechat"); ?>"></i>
647
  </td>
648
  <td>
649
+ <input id="wplc_pro_chat_notification" name="wplc_pro_chat_notification" type="checkbox" value="1"<?php echo($wplc_settings['wplc_pro_chat_notification'] ? ' checked' : '') ?> />
650
  </td>
651
  </tr>
652
 
653
  </table>
654
 
655
  <h3><?php _e("User Experience", 'wplivechat') ?></h3>
 
656
  <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='100%'>
657
  <tbody>
658
  <tr>
659
+ <td width='300' valign='top'><?php _e("Share files", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Adds file sharing to your chat box!", "wplivechat") ?>"></i></td>
660
+ <td><input id='wplc_ux_file_share' name='wplc_ux_file_share' type='checkbox'<?php echo($wplc_settings['wplc_ux_file_share'] ? ' checked' : '') ?> /> </td>
661
  </tr>
662
  <tr>
663
+ <td width='300' valign='top'><?php _e("Visitor experience ratings", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Allows users to rate the chat experience with an agent.", "wplivechat") ?>"></i></td>
664
+ <td><input id='wplc_ux_exp_rating' name='wplc_ux_exp_rating' type='checkbox'<?php echo($wplc_settings['wplc_ux_exp_rating'] ? ' checked' : '') ?> /> </td>
665
  </tr>
666
  </tbody>
667
  </table>
668
 
669
  <h3><?php _e("Social", 'wplivechat') ?></h3>
 
 
670
  <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='100%'>
671
  <tbody>
672
  <tr>
673
  <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>
674
+ <td><input id='wplc_social_fb' class='wplc_check_url' name='wplc_social_fb' placeholder="<?php _e("Facebook URL...", "wplivechat") ?>" type='text' value="<?php echo urldecode($wplc_settings['wplc_social_fb']); ?>" />
675
 
676
  <?php
677
+ if(!empty($wplc_settings['wplc_social_fb']) && !filter_var($wplc_settings['wplc_social_fb'], FILTER_VALIDATE_URL)) {
678
  ?><br><strong>Note: </strong>This does not appear to be a valid URL<?php
679
  }
680
  ?>
683
  </tr>
684
  <tr>
685
  <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>
686
+ <td><input id='wplc_social_tw' class='wplc_check_url' name='wplc_social_tw' placeholder="<?php _e("Twitter URL...", "wplivechat") ?>" type='text' value="<?php echo urldecode($wplc_settings['wplc_social_tw']); ?>" />
687
 
688
  <?php
689
+ if (!empty($wplc_settings['wplc_social_tw']) && !filter_var($wplc_settings['wplc_social_tw'], FILTER_VALIDATE_URL)) {
690
  ?><br><strong>Note: </strong>This does not appear to be a valid URL<?php
691
  }
692
  ?>
705
  <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='100%'>
706
  <tr>
707
  <td width='300'>
708
+ <?php _e("Disable 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>
709
  </td>
710
  <td>
711
+ <input type="checkbox" name="wplc_hide_when_offline" value="1" <?php echo ($wplc_settings['wplc_hide_when_offline'] ? ' checked' : '');?>/>
 
 
 
 
712
  </td>
713
  </tr>
714
  <tr>
715
+ <td width="300" valign="top"><?php _e("Offline Form Title", "wplivechat") ?>:</td>
716
  <td>
717
+ <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 esc_attr($wplc_settings['wplc_pro_na']); } ?>" /> <br />
718
 
719
 
720
  </td>
721
  </tr>
722
  <tr>
723
+ <td width="300" valign="top"><?php _e("Offline form initial message", "wplivechat") ?>:</td>
724
  <td>
725
+ <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 esc_attr($wplc_settings['wplc_pro_offline1']); } ?>" />
 
 
 
 
726
  </td>
727
  </tr>
728
  <tr>
729
+ <td width="300" valign="top"><?php _e("Offline form message on send", "wplivechat") ?>:</td>
730
  <td>
731
+ <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 esc_attr($wplc_settings['wplc_pro_offline2']); } ?>" />
732
  </td>
733
  </tr>
734
  <tr>
735
+ <td width="300" valign="top"><?php _e("Offline form finish message", "wplivechat") ?>:</td>
736
  <td>
737
+ <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 esc_attr($wplc_settings['wplc_pro_offline3']); } ?>" />
738
  </td>
739
  </tr>
740
  <tr>
741
+ <td width="300" valign="top"><?php _e("Offline Button Text", "wplivechat") ?>:</td>
742
  <td>
743
+ <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 esc_attr($wplc_settings['wplc_pro_offline_btn']); } ?>" /> <br />
744
+ </td>
745
+ </tr>
746
+ <tr>
747
+ <td width="300" valign="top"><?php _e("Offline Send Button Text", "wplivechat") ?>:</td>
748
+ <td>
749
+ <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 esc_attr($wplc_settings['wplc_pro_offline_btn_send']); } ?>" /> <br />
750
  </td>
751
  </tr>
752
 
758
  <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages'>
759
  <tr>
760
  <td width='300' valign='top'>
761
+ <?php _e("Send to agent(s)", "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>
762
  </td>
763
  <td>
764
  <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'])) {
771
  <?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>
772
  </td>
773
  <td>
774
+ <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 by 3CX - Offline Message from ", "wplivechat"); ?>"/>
775
  </td>
776
  </tr>
777
 
781
 
782
  <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages'>
783
  <tr>
784
+ <td width="300" valign="top"><?php _e("Auto-respond to visitor", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Send your visitors an email as soon as they send you an offline message", "wplivechat") ?>"></i></td>
785
  <td>
786
  <input id="wplc_ar_enable" name="wplc_ar_enable" type="checkbox" value="1" <?php if( isset( $wplc_auto_responder_settings['wplc_ar_enable'] ) ) { echo "checked"; } ?> /> <br />
787
  </td>
788
  </tr>
789
  <tr>
790
+ <td width="300" valign="top"><?php _e("Auto-responder 'From' name", "wplivechat") ?>: </td>
791
  <td>
792
  <input type="text" name="wplc_ar_from_name" id="wplc_ar_from_name" class="regular-text" value="<?php if( isset( $wplc_auto_responder_settings['wplc_ar_from_name'] ) ) { echo stripslashes($wplc_auto_responder_settings['wplc_ar_from_name']); } ?>" />
793
  </td>
794
  </tr>
795
  <tr>
796
+ <td width="300" valign="top"><?php _e("Auto-responder 'From' email", "wplivechat") ?>: </td>
797
  <td>
798
  <input type="text" name="wplc_ar_from_email" id="wplc_ar_from_email" class="regular-text" value="<?php if( isset( $wplc_auto_responder_settings['wplc_ar_from_email'] ) ) { echo $wplc_auto_responder_settings['wplc_ar_from_email']; } ?>" />
799
  </td>
800
  </tr>
801
  <tr>
802
+ <td width="300" valign="top"><?php _e("Auto-responder subject", "wplivechat") ?>: </td>
803
  <td>
804
  <input type="text" name="wplc_ar_subject" id="wplc_ar_subject" class="regular-text" value="<?php if( isset( $wplc_auto_responder_settings['wplc_ar_subject'] ) ) { echo $wplc_auto_responder_settings['wplc_ar_subject']; } ?>" />
805
  </td>
806
  </tr>
807
  <tr>
808
+ <td width="300" valign="top"><?php _e("Auto-responder body", "wplivechat") ?>: <br/></td>
809
  <td>
810
+ <textarea name="wplc_ar_body" id="wplc_ar_body" rows="6" style="width:50%;"><?php if( isset( $wplc_auto_responder_settings['wplc_ar_body'] ) ) { echo esc_textarea( $wplc_auto_responder_settings['wplc_ar_body'] ); } ?></textarea>
811
  <p class="description"><small><?php _e("HTML and the following shortcodes can be used", "wplivechat"); ?>: <?php _e("User's name", "wplivechat"); ?>: {wplc-user-name} <?php _e("User's email address", "wplivechat"); ?>: {wplc-email-address}</small></p>
812
  </td>
813
  </tr>
847
  line-height: 150px;
848
  }
849
  .wplc_animation_block .wplc_red{
850
+ color: #0596d4;
851
  }
852
  .wplc_animation_block .wplc_orange{
853
+ color: #0596d4;
854
  }
855
  .wplc_animation_active, .wplc_theme_active {
856
  border: 2px solid #616161 !important;
871
  line-height: 150px;
872
  }
873
  .wplc_animation_block .wplc_red{
874
+ color: #0596d4;
875
  }
876
  .wplc_animation_block .wplc_orange{
877
+ color: #0596d4;
878
  }
879
  </style>
880
  <h3><?php _e("Styling",'wplivechat')?></h3>
881
  <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages'>
882
+ <?php
883
+ $wplc_theme = wplc_get_theme();
884
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
885
 
886
  <tr style='margin-bottom: 10px;'>
887
+ <td style="width:300px;"><label for=""><?php _e('Color scheme', 'wplivechat'); ?></label></td>
888
  <td>
889
  <div class='wplc_theme_block'>
890
  <div class='wplc_palette'>
891
  <div class='wplc_palette_single'>
892
+ <div class='wplc-palette-selection <?php if ($wplc_theme == 'theme-default') { echo 'wplc_theme_active'; } ?>' id='wplc_theme_default'>
893
+ <div class='wplc-palette-top' style='background-color:#0596d4;'></div>
894
  <div class='wplc-palette-top' style='background-color:#FFF;'></div>
895
+ <div class='wplc-palette-top' style='background-color:#06B4FF;'></div>
896
+ <div class='wplc-palette-top' style='background-color:#373737;'></div>
897
  </div>
898
  </div>
899
 
900
  <div class='wplc_palette_single'>
901
+ <div class='wplc-palette-selection <?php if ($wplc_theme == 'theme-1') { echo 'wplc_theme_active'; } ?>' id='wplc_theme_1'>
902
  <div class='wplc-palette-top' style='background-color:#DB0000;'></div>
903
  <div class='wplc-palette-top' style='background-color:#FFF;'></div>
904
  <div class='wplc-palette-top' style='background-color:#000;'></div>
905
+ <div class='wplc-palette-top' style='background-color:#373737;'></div>
906
  </div>
907
  </div>
908
  <div class='wplc_palette_single'>
909
+ <div class='wplc-palette-selection <?php if ($wplc_theme == 'theme-2') { echo 'wplc_theme_active'; } ?>' id='wplc_theme_2'>
910
  <div class='wplc-palette-top' style='background-color:#000;'></div>
911
  <div class='wplc-palette-top' style='background-color:#FFF;'></div>
912
  <div class='wplc-palette-top' style='background-color:#888;'></div>
913
+ <div class='wplc-palette-top' style='background-color:#373737;'></div>
914
  </div>
915
  </div>
916
  <div class='wplc_palette_single'>
917
+ <div class='wplc-palette-selection <?php if ($wplc_theme == 'theme-3') { echo 'wplc_theme_active'; } ?>' id='wplc_theme_3'>
918
  <div class='wplc-palette-top' style='background-color:#B97B9D;'></div>
919
  <div class='wplc-palette-top' style='background-color:#FFF;'></div>
920
  <div class='wplc-palette-top' style='background-color:#EEE;'></div>
922
  </div>
923
  </div>
924
  <div class='wplc_palette_single'>
925
+ <div class='wplc-palette-selection <?php if ($wplc_theme == 'theme-4') { echo 'wplc_theme_active'; } ?>' id='wplc_theme_4'>
926
  <div class='wplc-palette-top' style='background-color:#1A14DB;'></div>
927
  <div class='wplc-palette-top' style='background-color:#FDFDFF;'></div>
928
  <div class='wplc-palette-top' style='background-color:#7F7FB3;'></div>
929
+ <div class='wplc-palette-top' style='background-color:#373737;'></div>
930
  </div>
931
  </div>
932
  <div class='wplc_palette_single'>
933
+ <div class='wplc-palette-selection <?php if ($wplc_theme == 'theme-5') { echo 'wplc_theme_active'; } ?>' id='wplc_theme_5'>
934
  <div class='wplc-palette-top' style='background-color:#3DCC13;'></div>
935
  <div class='wplc-palette-top' style='background-color:#FDFDFF;'></div>
936
  <div class='wplc-palette-top' style='background-color:#EEE;'></div>
937
+ <div class='wplc-palette-top' style='background-color:#373737;'></div>
938
  </div>
939
  </div>
940
  <div class='wplc_palette_single'>
941
+ <div class='wplc-palette-selection <?php if ($wplc_theme == 'theme-6') { echo 'wplc_theme_active'; } ?>' id='wplc_theme_6'>
942
  <div class='wplc-palette-top' style='padding-top:3px'>&nbsp;</div>
943
  <div class='wplc-palette-top' style='padding-top:18px'><?php _e("Custom Scheme","wplivechat"); ?></div>
944
  <div class='wplc-palette-top' style='padding-top:3px'>&nbsp;</div>
948
 
949
  </div>
950
  </div>
951
+ <input type="radio" name="wplc_theme" value="theme-default" class="wplc_hide_input" id="wplc_rb_theme_default" <?php if ($wplc_theme == 'theme-default') { echo 'checked'; } ?>/>
952
+ <input type="radio" name="wplc_theme" value="theme-1" class="wplc_hide_input" id="wplc_rb_theme_1" <?php if ($wplc_theme == 'theme-1') { echo 'checked'; } ?>/>
953
+ <input type="radio" name="wplc_theme" value="theme-2" class="wplc_hide_input" id="wplc_rb_theme_2" <?php if ($wplc_theme == 'theme-2') { echo 'checked'; } ?>/>
954
+ <input type="radio" name="wplc_theme" value="theme-3" class="wplc_hide_input" id="wplc_rb_theme_3" <?php if ($wplc_theme == 'theme-3') { echo 'checked'; } ?>/>
955
+ <input type="radio" name="wplc_theme" value="theme-4" class="wplc_hide_input" id="wplc_rb_theme_4" <?php if ($wplc_theme == 'theme-4') { echo 'checked'; } ?>/>
956
+ <input type="radio" name="wplc_theme" value="theme-5" class="wplc_hide_input" id="wplc_rb_theme_5" <?php if ($wplc_theme == 'theme-5') { echo 'checked'; } ?>/>
957
+ <input type="radio" name="wplc_theme" value="theme-6" class="wplc_hide_input" id="wplc_rb_theme_6" <?php if ($wplc_theme == 'theme-6') { echo 'checked'; } ?>/>
958
 
959
  </td>
960
  </tr>
961
 
962
 
963
+ <tr class='wplc_custom_pall_rows' style='<?php echo (($wplc_theme == 'theme-6') ? '' : 'display:none;'); ?>' >
964
  <td width='200' valign='top'><?php _e("Palette Color 1","wplivechat")?>:</td>
965
  <td>
966
+ <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 '0596d4'; } ?>" />
967
  </td>
968
  </tr>
969
+ <tr class='wplc_custom_pall_rows' style='<?php echo (($wplc_theme == 'theme-6') ? '' : 'display:none;'); ?>' >
970
  <td width='200' valign='top'><?php _e("Palette Color 2","wplivechat")?>:</td>
971
  <td>
972
  <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'; } ?>" />
973
  </td>
974
  </tr>
975
+ <tr class='wplc_custom_pall_rows' style='<?php echo (($wplc_theme == 'theme-6') ? '' : 'display:none;'); ?>' >
976
  <td width='200' valign='top'><?php _e("Palette Color 3","wplivechat")?>:</td>
977
  <td>
978
  <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'; } ?>" />
979
  </td>
980
  </tr>
981
+ <tr class='wplc_custom_pall_rows' style='<?php echo (($wplc_theme == 'theme-6') ? '' : 'display:none;'); ?>' >
982
  <td width='200' valign='top'><?php _e("Palette Color 4","wplivechat")?>:</td>
983
  <td>
984
+ <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 '373737'; } ?>" />
985
  </td>
986
  </tr>
987
 
1000
  </tr>
1001
 
1002
  <tr>
1003
+ <td width="200" valign="top"><?php _e("Use localization plugin", "wplivechat") ?></td>
1004
  <td>
1005
+ <input type="checkbox" name="wplc_using_localization_plugin" id="wplc_using_localization_plugin" value="1"<?php echo ($wplc_settings['wplc_using_localization_plugin'] ? ' checked' : ''); ?> />
1006
+ <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://www.3cx.com/wp-live-chat/docs/localization/' target='_BLANK'>".__("here", "wplivechat") ); ?></small>
1007
  </td>
1008
  </tr>
1009
 
1010
  <tr style='height:30px;'><td></td><td></td></tr>
1011
+ <tr class="wplc_localization_strings">
1012
+ <td width="200" valign="top"><?php _e("Chat box title", "wplivechat") ?>:</td>
1013
+ <td>
1014
+ <input id="wplc_pro_fst1" name="wplc_pro_fst1" type="text" size="50" maxlength="50" class="regular-text" value="<?php echo esc_attr($wplc_settings['wplc_pro_fst1']) ?>" /> <br />
1015
+ </td>
1016
+ </tr>
1017
+ <tr class="wplc_localization_strings">
1018
+ <td width="200" valign="top"><?php _e("Chat box sub-title", "wplivechat") ?>:</td>
1019
+ <td>
1020
+ <input id="wplc_pro_fst2" name="wplc_pro_fst2" type="text" size="50" maxlength="50" class="regular-text" value="<?php echo esc_attr($wplc_settings['wplc_pro_fst2']) ?>" /> <br />
1021
+ </td>
1022
+ </tr>
1023
+ <tr class="wplc_localization_strings">
1024
+ <td width="200" valign="top"><?php _e("Chat box intro", "wplivechat") ?>:</td>
1025
  <td>
1026
+ <input id="wplc_pro_intro" name="wplc_pro_intro" type="text" size="50" maxlength="150" class="regular-text" value="<?php echo esc_attr($wplc_settings['wplc_pro_intro']) ?>" /> <br />
 
1027
  </td>
1028
  </tr>
1029
  <tr class="wplc_localization_strings">
1030
+ <td width="200" valign="top"><?php _e("Start chat button label", "wplivechat") ?>:</td>
1031
  <td>
1032
+ <input id="wplc_pro_sst1" name="wplc_pro_sst1" type="text" size="50" maxlength="30" class="regular-text" value="<?php echo esc_attr($wplc_settings['wplc_pro_sst1']) ?>" /> <br />
1033
  </td>
1034
  </tr>
1035
  <tr class="wplc_localization_strings">
1036
+ <td width="200" valign="top"><?php _e("Start chat status message", "wplivechat") ?>:</td>
1037
  <td>
1038
+ <input id="wplc_pro_sst2" name="wplc_pro_sst2" type="text" size="50" maxlength="70" class="regular-text" value="<?php echo esc_attr($wplc_settings['wplc_pro_sst2']) ?>" /> <br />
 
1039
  </td>
1040
  </tr>
1041
  <tr class="wplc_localization_strings">
1042
+ <td width="200" valign="top"><?php _e("Re-activate chat message", "wplivechat") ?>:</td>
1043
  <td>
1044
+ <input id="wplc_pro_tst1" name="wplc_pro_tst1" type="text" size="50" maxlength="50" class="regular-text" value="<?php echo esc_attr($wplc_settings['wplc_pro_tst1']) ?>" /> <br />
1045
 
1046
 
1047
  </td>
1053
  </td>
1054
  </tr>
1055
  <tr class="wplc_localization_strings">
1056
+ <td width="200" valign="top"><?php _e("Agent no answer message", "wplivechat") ?>:</td>
1057
  <td>
1058
+ <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']) : $wplc_default_settings_array['wplc_user_no_answer']); ?>" /> <span class='description'><?php _e('This text is shown to the user when an agent has failed to answer a chat', 'wplivechat'); ?></span><br />
1059
  </td>
1060
  </tr>
1061
  <tr class="wplc_localization_strings">
1062
  <td width="200" valign="top"><?php _e("Other text", "wplivechat") ?>:</td>
1063
  <td>
1064
  <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 />
1065
+ <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 agent.", "wplivechat")) : stripslashes( $wplc_settings['wplc_text_chat_ended'] ) ?>" /> <br />
1066
  </td>
1067
  </tr>
1068
 
1069
  <tr>
1070
+ <td><label for=""><?php _e('Chat box animation', 'wplivechat'); ?></label></td>
1071
 
1072
  <td>
1073
  <div class='wplc_animation_block'>
1111
  </td>
1112
  </tr>
1113
  <tr>
1114
+ <td width='300' valign='top'><?php _e("Auto-response to first message","wplivechat")?>:</td>
1115
  <td>
1116
  <input type="text" name="wplc_pro_auto_first_response_chat_msg" value="<?php echo $wplc_pro_auto_first_response_chat_msg; ?>">
1117
  <span class='description'><?php _e('This message will be sent automatically after the first message is sent from the user side. Leave empty to disable.', 'wplivechat'); ?></span>
1129
  'meta_key' => 'wplc_ma_agent',
1130
  ));
1131
 
1132
+ echo "<h3>".__('Chat Agents', 'wplivechat')."</h3>";
1133
 
1134
  $wplc_agents = "<div class='wplc_agent_container'><ul>";
1135
 
1137
  foreach ($user_array as $user) {
1138
 
1139
  $wplc_agents .= "<li id=\"wplc_agent_li_".$user->ID."\">";
1140
+ $wplc_agents .= "<p><img src=\"//www.gravatar.com/avatar/" . md5($user->user_email) . "?s=60&d=mm\" /></p>";
1141
  $check = get_user_meta($user->ID,"wplc_chat_agent_online");
1142
  if ($check) {
1143
  $wplc_agents .= "<span class='wplc_status_box wplc_type_returning'>".__("Logged In","wplivechat")."</span>";
1144
  }
1145
+ $wplc_agents .= "<h3>" . esc_html($user->display_name) . "</h3>";
1146
 
1147
+ $wplc_agents .= "<small>" . esc_html($user->user_email) . "</small>";
1148
 
1149
  $wplc_agents .= apply_filters("wplc_pro_agent_list_before_button_filter", "", $user);
1150
 
1167
  // Array of stdClass objects.
1168
  foreach ( $blogusers as $user ) {
1169
  $is_agent = get_user_meta(intval( $user->ID ), 'wplc_ma_agent', true);
1170
+ if(!$is_agent){ echo '<option id="wplc_selected_agent_'. intval( $user->ID ) .'" em="' . md5(sanitize_email( $user->user_email )) . '" uid="' . intval( $user->ID ) . '" em2="' . esc_attr( $user->user_email ) . '" name="' . esc_attr( $user->display_name ) . '" value="' . intval( $user->ID ) . '">' . esc_html( $user->display_name ) . ' ('.__('Administrator','wplivechat').')</option>'; }
1171
  }
1172
  $blogusers = get_users( array( 'role' => 'editor', 'fields' => array( 'display_name','ID','user_email' ) ) );
1173
  // Array of stdClass objects.
1174
  foreach ( $blogusers as $user ) {
1175
  $is_agent = get_user_meta(intval( $user->ID ), 'wplc_ma_agent', true);
1176
+ if(!$is_agent){ echo '<option id="wplc_selected_agent_'. intval( $user->ID ) .'" em="' . md5(sanitize_email( $user->user_email )) . '" uid="' . intval( $user->ID ) . '" em2="' . esc_attr( $user->user_email ) . '" name="' . esc_attr( $user->display_name ) . '" value="' . intval( $user->ID ) . '">' . esc_html( $user->display_name ) . ' ('.__('Editor','wplivechat').')</option>'; }
1177
  }
1178
  $blogusers = get_users( array( 'role' => 'author', 'fields' => array( 'display_name','ID','user_email' ) ) );
1179
  // Array of stdClass objects.
1180
  foreach ( $blogusers as $user ) {
1181
  $is_agent = get_user_meta(intval( $user->ID ), 'wplc_ma_agent', true);
1182
+ if(!$is_agent){ echo '<option id="wplc_selected_agent_'. intval( $user->ID ) .'" em="' . md5(sanitize_email( $user->user_email )) . '" uid="' . intval( $user->ID ) . '" em2="' . esc_attr( $user->user_email ) . '" name="' . esc_attr( $user->display_name ) . '" value="' . intval( $user->ID ) . '">' . esc_html( $user->display_name ) . ' ('.__('Author','wplivechat').')</option>'; }
1183
  }
1184
  ?>
1185
  </select>
1189
  </div>
1190
 
1191
  <hr/>
1192
+ <p class="description"><?php echo sprintf(__("Should you wish to add a user that has a role less than 'Author', please go to the %s page, select the relevant user, click Edit and scroll to the bottom of the page and enable the 'Chat Agent' checkbox.", "wplivechat"), "<a href='./users.php'>".__("Users","wplivechat")."</a>"); ?></p>
1193
  <p class="description"><?php _e("If there are no chat agents online, the chat will show as offline", "wplivechat"); ?></p>
1194
 
1195
 
1196
  </div>
1197
  <div id="tabs-7">
1198
+ <h3><?php _e("Blocked Visitors / IP Addresses", "wplivechat") ?></h3>
1199
  <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='100%'>
1200
  <tr>
1201
  <td>
1205
  $ip_addresses = maybe_unserialize($ip_addresses);
1206
  if ($ip_addresses && is_array($ip_addresses)) {
1207
  foreach($ip_addresses as $ip){
1208
+ echo esc_textarea($ip)."\n";
1209
  }
1210
  }
1211
  }
1222
 
1223
  $content .= "<div id='wplc-business-hours'>";
1224
 
1225
+ $content .= "<h3>".__("Business Hours", "wplivechat")."</h3>";
1226
  $content .= "<table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' >";
1227
 
1228
  $content .= "<tr>";
1229
  $content .= "<td width='300'>".__("Enable Business Hours", "wplivechat")."</td>";
1230
+ $content .= "<td><input type='checkbox' name='wplc_bh_enable' id='wplc_bh_enable' value='1' ".($wplc_settings['wplc_bh_enable'] ? ' checked' : '')." /></td>";
 
1231
  $content .= "</tr>";
1232
 
1233
  $content .= "<tr>";
1234
+ $content .= "<td width='300'>".__("Active schedule", "wplivechat")."</td>";
1235
  $content .= "<td>";
1236
  $content .= "<select name='wplc_bh_interval' id='wplc_bh_interval'>";
1237
  $wplc_intervals = array(
1240
  '2' => __("Weekends", "wplivechat")
1241
  );
1242
  $wplc_intervals = apply_filters( "wplc_bg_intervals_array", $wplc_intervals );
1243
+ if ($wplc_intervals) {
 
1244
  foreach( $wplc_intervals as $key => $val ){
1245
+ $content .= "<option value='$key'".($wplc_settings['wplc_bh_interval'] == $key ? ' selected' : '').">$val</option>";
 
1246
  }
 
1247
  }
1248
  $content .= "</select><br/>";
1249
 
1250
  $wplc_times_array = wplc_return_times_array_mrg();
1251
 
1252
+ $content .= ' '.__("Between", "wplivechat")." <select name='wplc_bh_hours_start' id='wplc_bh_hours_start'>";
1253
+ foreach( $wplc_times_array['hours'] as $hour) {
1254
+ $hh = intval($hour);
1255
+ $content .= "<option value='$hh'".($wplc_settings['wplc_bh_hours_start'] == $hh ? ' selected' : '').">$hour</option>";
1256
+ }
 
 
 
1257
  $content .= "</select>:";
1258
  $content .= "<select name='wplc_bh_minutes_start' id='wplc_bh_minutes_start'>";
1259
+ foreach( $wplc_times_array['minutes'] as $minute ){
1260
+ $mm = intval($minute);
1261
+ $content .= "<option value='$mm'".($wplc_settings['wplc_bh_minutes_start'] == $mm ? ' selected' : '').">$minute</option>";
1262
+ }
1263
+ $content .= "</select>".' '.__("and", "wplivechat").' ';
 
 
 
1264
  $content .= "<select name='wplc_bh_hours_end' id='wplc_bh_hours_end'>";
1265
+ foreach( $wplc_times_array['hours'] as $hour) {
1266
+ $hh = intval($hour);
1267
+ $content .= "<option value='$hh'".($wplc_settings['wplc_bh_hours_end'] == $hh ? ' selected' : '').">$hour</option>";
1268
+ }
1269
+ $content .= "</select>:";
 
 
 
1270
  $content .= "<select name='wplc_bh_minutes_end' id='wplc_bh_minutes_end'>";
1271
+ foreach( $wplc_times_array['minutes'] as $minute ){
1272
+ $mm = intval($minute);
1273
+ $content .= "<option value='$mm'".($wplc_settings['wplc_bh_minutes_end'] == $mm ? ' selected' : '').">$minute</option>";
1274
+ }
 
 
 
1275
  $content .= "</select>";
1276
  $content .= "</td>";
1277
  $content .= "</tr>";
1295
  <tr>
1296
  <td width='300' valign='top'><?php _e("Enable Encryption", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e('All messages will be encrypted when being sent to and from the user and agent.', 'wplivechat'); ?>"></i></td>
1297
  <td>
1298
+ <input type="checkbox" name="wplc_enable_encryption" id="wplc_enable_encryption" value="1"<?php echo ($wplc_settings['wplc_enable_encryption'] ? ' checked' : ''); ?>/>
1299
  </td>
1300
  </tr>
1301
  <tr>
1302
  <td width='300'></td>
1303
  <td>
1304
  <p class='notice notice-error'>
 
1305
  <?php _e('Once enabled, all messages sent will be encrypted. This cannot be undone.', 'wplivechat'); ?>
1306
  </p>
 
 
 
 
1307
  </td>
1308
  </tr>
1309
  </table>
includes/shortcodes.php CHANGED
@@ -9,20 +9,21 @@ function wplc_add_shortcode() {
9
  }
10
 
11
  function wplc_live_chat_box_shortcode( $atts, $content = null ) {
12
- $wplc_settings = get_option("WPLC_SETTINGS");
 
13
  $logged_in = apply_filters("wplc_loggedin_filter",false);
14
- $wplc_using_locale = (isset($wplc_settings['wplc_using_localization_plugin']) && $wplc_settings['wplc_using_localization_plugin'] == 1) ? true : false;
15
- $cid = intval($_COOKIE['wplc_cid']);
16
- $wplc_chat_box_content = wplc_theme_control_function($wplc_settings, $logged_in, $wplc_using_locale, $cid);
 
 
 
 
 
 
17
 
18
  // get attributes
19
- $atts = shortcode_atts(
20
- array(
21
- 'style' => 'normal'
22
- ),
23
- $atts,
24
- 'wplc_live_chat'
25
- );
26
 
27
  $output = '<div class="wplc_live_chat_support_shortcode wplc_' . $atts['style'] . '">';
28
  $output .= $wplc_chat_box_content;
9
  }
10
 
11
  function wplc_live_chat_box_shortcode( $atts, $content = null ) {
12
+ $get_gutenberg_options = get_option('wplc_gutenberg_settings');
13
+ $wplc_settings = wplc_get_options();
14
  $logged_in = apply_filters("wplc_loggedin_filter",false);
15
+ if (isset($_COOKIE['wplc_cid']) && wplc_check_user_request($_COOKIE['wplc_cid'])) {
16
+ $cid = intval($_COOKIE['wplc_cid']);
17
+ } else {
18
+ $cid=null;
19
+ }
20
+ $wplc_chat_box_content = wplc_theme_control_function($wplc_settings, $logged_in, $wplc_settings['wplc_using_localization_plugin'], $cid);
21
+ if (!$get_gutenberg_options['wplc_gutenberg_enable']) {
22
+ return;
23
+ }
24
 
25
  // get attributes
26
+ $atts = shortcode_atts(array('style' => 'normal'),$atts,'wplc_live_chat');
 
 
 
 
 
 
27
 
28
  $output = '<div class="wplc_live_chat_support_shortcode wplc_' . $atts['style'] . '">';
29
  $output .= $wplc_chat_box_content;
includes/surveys.php DELETED
@@ -1,391 +0,0 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- }
6
-
7
- add_filter("wplc_filter_setting_tabs","wplc_survey_filter_control_setting_tabs");
8
- function wplc_survey_filter_control_setting_tabs($tab_array) {
9
- $tab_array['survey'] = array(
10
- "href" => "#tabs-survey",
11
- "icon" => 'fa fa-comment',
12
- "label" => __("Surveys & Lead Forms","wplivechat")
13
- );
14
- return $tab_array;
15
- }
16
-
17
-
18
- add_action("wplc_hook_settings_page_more_tabs","wplc_survey_hook_control_settings_page_more_tabs");
19
- function wplc_survey_hook_control_settings_page_more_tabs() {
20
- $wplc_survey_data = get_option("WPLC_SURVEY_SETTINGS");
21
- $wplc_settings = get_option('WPLC_SETTINGS');
22
- ?>
23
- <div id="tabs-survey">
24
- <h3><?php _e("Surveys & Lead Forms", "wplivechat") ?></h3>
25
- <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages'>
26
- <tr>
27
- <td width='300' valign='top'><?php _e("Enable Surveys & Lead Forms", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e('Enable surveys and lead forms within your live chat box, either before or after a live chat session.', 'wplivechat'); ?>"></i></td>
28
- <td>
29
- <input type="checkbox" name="wplc_enable_surveys" id="wplc_enable_surveys" value="1" <?php if(isset($wplc_survey_data['wplc_enable_surveys']) && $wplc_survey_data['wplc_enable_surveys'] == 1){ echo 'checked'; } ?>/>
30
- </td>
31
- </tr>
32
- <tr>
33
- <td>Select a survey: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e('Choosing a survey will reset the lead form selection: the items are alternatives, if you select a survey no lead form can be selected.', 'wplivechat'); ?>"></i></td>
34
- <td><?php
35
- $surveys = wplc_return_nimble_surveys_forms('return_surveys');
36
- $link1 = sprintf( __( 'No surveys created. Please <a href="%s" target="_BLANK" title="NimbleSquirrel">create a survey and then refresh this page.</a>', 'wplivechat' ),
37
- 'http://app.nimblesquirrel.com/?utm_source=wplc&utm_medium=click&utm_campaign=no_surveys'
38
- );
39
- if( $surveys ){
40
- $surveys = json_decode( $surveys );
41
- if( $surveys ){
42
- echo "<select name='nimble_survey' id='nimble_survey'>";
43
- echo "<option value='0'>".__('Select a survey', 'nimble-squirrel')."</option>";
44
- $cnt = 0;
45
- foreach( $surveys as $survey ){
46
- $nimble_user_id = $survey->uid;
47
- if (isset($survey->name)) {
48
- $cnt++;
49
- if( isset( $wplc_survey_data['survey'] ) && $wplc_survey_data['survey'] == $survey->id ){ $sel = 'selected'; } else { $sel = ''; }
50
- echo "<option value='".$survey->id."' $sel>".$survey->name."</option>";
51
- }
52
- }
53
- echo "</select>";
54
- if ($cnt == 0) { echo "<p>".$link1."</p>"; }
55
- } else {
56
- echo "<p>".$link1."</p>";
57
- }
58
- } else {
59
- echo "<p>".$link1."</p>";
60
- }
61
-
62
- if (isset($nimble_user_id)) {
63
- echo "<input name='survey_user' type='hidden' value='".$nimble_user_id."' />";
64
- }
65
-
66
- ?></td>
67
- </tr>
68
- <tr>
69
- <td>Select a lead form: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e('Choosing a lead form will reset the survey selection: the items are alternatives, if you select a lead form no survey can be selected.', 'wplivechat'); ?>"></i></td>
70
- <td><?php
71
- $lead_forms = wplc_return_nimble_surveys_forms('return_leads');
72
- $link1 = sprintf( __( 'No lead forms created. Please <a href="%s" target="_BLANK" title="NimbleSquirrel">create a lead form and then refresh this page.</a>', 'wplivechat' ),
73
- 'http://app.nimblesquirrel.com/?utm_source=wplc&utm_medium=click&utm_campaign=no_surveys'
74
- );
75
- if( $lead_forms ){
76
- $lead_forms = json_decode( $lead_forms );
77
- if( $lead_forms ){
78
- echo "<select name='nimble_lead_form' id='nimble_lead_form'>";
79
- echo "<option value='0'>".__('Select a lead form', 'nimble-squirrel')."</option>";
80
- $cnt = 0;
81
- foreach( $lead_forms as $lead_form ){
82
- $nimble_user_id = $lead_form->uid;
83
- if (isset($lead_form->name)) {
84
- $cnt++;
85
- if( isset( $wplc_survey_data['lead_form'] ) && intval($wplc_survey_data['lead_form']) == intval($lead_form->id) ){ $sel = 'selected'; } else { $sel = ''; }
86
- echo "<option value='".intval($lead_form->id)."' $sel>".sanitize_text_field($lead_form->name)."</option>";
87
- }
88
- }
89
- echo "</select>";
90
- if ($cnt == 0) { echo "<p>".$link1."</p>"; }
91
- } else {
92
- echo "<p>".$link1."</p>";
93
- }
94
- } else {
95
- echo "<p>".$link1."</p>";
96
- }
97
- ?>
98
- </td>
99
- </tr>
100
- <tr>
101
- <td><?php _e("Display survey/form","wplivechat"); ?></td>
102
- <td>
103
- <select name='survey_display'>
104
- <option value='1' <?php if (isset($wplc_survey_data['survey_display']) && $wplc_survey_data['survey_display'] == "1") { echo 'selected'; }?>><?php _e("Before chat","wplivechat"); ?></option>
105
- <option value='2' <?php if (isset($wplc_survey_data['survey_display']) && $wplc_survey_data['survey_display'] == "2") { echo 'selected'; }?>><?php _e("After chat","wplivechat"); ?></option>
106
- </select>
107
- </td>
108
- </tr>
109
- <tr>
110
- <td><?php _e("Chat button text","wplivechat"); ?></td>
111
- <td>
112
- <input type='text' name='wplc_pro_sst1_survey' value='<?php echo $wplc_settings['wplc_pro_sst1_survey']; ?>' />
113
- </td>
114
- </tr>
115
- <tr>
116
- <td><?php _e("Change title of chat box when chat ended to","wplivechat"); ?></td>
117
- <td>
118
- <input type='text' name='wplc_pro_sst1e_survey' value='<?php echo $wplc_settings['wplc_pro_sst1e_survey']; ?>' />
119
- </td>
120
- </tr>
121
- </table>
122
- </div>
123
-
124
- <?php
125
-
126
- wp_register_script('wplc-lead-form-script', plugins_url('../js/wplc_lead_forms.js', __FILE__),array('jquery'),WPLC_PLUGIN_VERSION);
127
- wp_enqueue_script('wplc-lead-form-script');
128
- }
129
-
130
-
131
- add_action('wplc_hook_admin_settings_save','wplc_survey_save_settings');
132
- function wplc_survey_save_settings() {
133
- if (isset($_POST['wplc_save_settings'])) {
134
-
135
- if (isset($_POST['wplc_enable_surveys'])) {
136
- $wplc_survey_data['wplc_enable_surveys'] = intval($_POST['wplc_enable_surveys']);
137
- } else {
138
- $wplc_survey_data['wplc_enable_surveys'] = 0;
139
- }
140
- if (isset($_POST['nimble_survey']) && $_POST['nimble_survey'] !== '0') {
141
- $wplc_survey_data['survey'] = sanitize_text_field($_POST['nimble_survey']);
142
- } else {
143
- $wplc_survey_data['survey'] = null;
144
- }
145
- if (isset($_POST['nimble_lead_form']) && $_POST['nimble_lead_form'] !== '0') {
146
- $wplc_survey_data['lead_form'] = sanitize_text_field($_POST['nimble_lead_form']);
147
- } else {
148
- $wplc_survey_data['lead_form'] = null;
149
- }
150
- if (isset($_POST['survey_user']) && $_POST['survey_user'] !== '0') {
151
- $wplc_survey_data['survey_user'] = sanitize_text_field($_POST['survey_user']);
152
- } else {
153
- $wplc_survey_data['survey_user'] = null;
154
- }
155
- if (isset($_POST['survey_display']) && $_POST['survey_display'] !== '0') {
156
- $wplc_survey_data['survey_display'] = sanitize_text_field($_POST['survey_display']);
157
- } else {
158
- $wplc_survey_data['survey_display'] = "1";
159
- }
160
-
161
-
162
- update_option('WPLC_SURVEY_SETTINGS', $wplc_survey_data);
163
-
164
- }
165
- }
166
-
167
-
168
- function wplc_return_nimble_surveys_forms($action) {
169
- $nimble_api = 'http://nimblesquirrel.com/api/wordpress.php';
170
-
171
- $response = wp_remote_post( $nimble_api,
172
- array(
173
- 'method' => 'POST',
174
- 'body' => array(
175
- 'wordpress_plugin' => 1,
176
- 'action' => $action,
177
- 'siteurl' => site_url()
178
- )
179
- )
180
- );
181
-
182
- if ( is_wp_error( $response ) ) {
183
-
184
- $error_message = $response->get_error_message();
185
- echo $error_message;
186
- } else {
187
- return $response['body'];
188
- }
189
- }
190
-
191
-
192
- add_filter("wplc_filter_live_chat_box_pre_layer1","wplc_filter_control_live_chat_box_pre_layer1",10,1);
193
- function wplc_filter_control_live_chat_box_pre_layer1($content) {
194
- $settings = get_option('WPLC_SURVEY_SETTINGS');
195
- if( isset( $settings['wplc_enable_surveys'] ) && intval($settings['wplc_enable_surveys']) == 1 && !isset($_COOKIE['ns_participated'])){
196
-
197
- if( isset( $settings['survey_display']) && $settings['survey_display'] == '1' ) {
198
- $content .= "<img src='".plugins_url('../images/loader2.gif', __FILE__)."' style='display:block; margin-left:auto; margin-right:auto;' / >";
199
- return $content;
200
- }
201
- }
202
- }
203
-
204
-
205
-
206
- add_action('wp_enqueue_scripts', 'wplc_nimble_load_scripts' , 99 );
207
- function wplc_nimble_load_scripts() {
208
- $settings = get_option('WPLC_SURVEY_SETTINGS');
209
- $wplc_settings = get_option('WPLC_SETTINGS');
210
-
211
- if( isset( $settings['wplc_enable_surveys'] ) && intval($settings['wplc_enable_surveys']) == 1 && !isset($_COOKIE['ns_participated'])){
212
-
213
-
214
-
215
- if( isset( $settings['survey_user'] ) ){ $ns_id = $settings['survey_user']; } else { $ns_id = 'false'; }
216
- if( isset( $settings['survey'] ) ){ $ns_sid = $settings['survey']; } else { $ns_sid = 'false'; }
217
- if( isset( $settings['lead_form'] ) ){ $ns_lfid = $settings['lead_form']; } else { $ns_lfid = 'false'; }
218
-
219
- //wp_enqueue_script( 'nimble-squirrel-user-script', '//nimblesquirrel.com/api/nimblesquirrel.js', array(), '1.0.0', true );
220
- //wp_enqueue_script( 'nimble-squirrel-user-script', 'https://nimblesquirrel.com/api/v2.0/nimblesquirrel.js', array(), '1.0.0', true );
221
- wp_enqueue_script( 'nimble-squirrel-user-script', plugins_url('../js/nimblesquirrel.js', __FILE__), array(), '1.0.0', true );
222
- wp_localize_script( 'nimble-squirrel-user-script', 'ns_id', $ns_id );
223
-
224
-
225
- if (isset($wplc_settings['wplc_newtheme'])) { $wplc_newtheme = $wplc_settings['wplc_newtheme']; } else { $wplc_newtheme == 'theme-2'; }
226
- if (isset($wplc_newtheme)) {
227
- if($wplc_newtheme == 'theme-1') {
228
- if( isset( $settings['survey_display']) && $settings['survey_display'] == '1' ) {
229
- $div = "wp-live-chat-2";
230
- $clear_div = '0';
231
- $hide_div = 'wp-live-chat-2-inner';
232
- wp_localize_script( 'nimble-squirrel-user-script', 'ns_hide_div', $hide_div );
233
- } else if (isset( $settings['survey_display']) && $settings['survey_display'] == '2' ) {
234
- $div = "wplc-extra-div";
235
- $clear_div = '1';
236
- wp_localize_script( 'nimble-squirrel-user-script', 'wplc_extra_div_enabled', "1" );
237
- } else {
238
- $div = "wp-live-chat-2";
239
- $clear_div = '0';
240
- $hide_div = 'wp-live-chat-2-inner';
241
- wp_localize_script( 'nimble-squirrel-user-script', 'ns_hide_div', $hide_div );
242
- }
243
- }
244
- else if($wplc_newtheme == 'theme-2') {
245
- if( isset( $settings['survey_display']) && $settings['survey_display'] == '1' ) {
246
- $div = 'wplc_hovercard_content';
247
- $clear_div = '1';
248
- } else if (isset( $settings['survey_display']) && $settings['survey_display'] == '2' ) {
249
- $div = "wplc-extra-div";
250
- $clear_div = '1';
251
- wp_localize_script( 'nimble-squirrel-user-script', 'wplc_extra_div_enabled', "1" );
252
- } else {
253
- $div = 'wplc_hovercard_content';
254
- $clear_div = '1';
255
-
256
- }
257
-
258
- }
259
- }
260
-
261
- wp_localize_script( 'nimble-squirrel-user-script', 'ns_div', $div );
262
-
263
-
264
- wp_localize_script( 'nimble-squirrel-user-script', 'ns_hide_min', '1' );
265
-
266
- if ( '' != $ns_sid ) {
267
- wp_localize_script( 'nimble-squirrel-user-script', 'ns_sid', $ns_sid );
268
- }
269
- else {
270
- wp_localize_script( 'nimble-squirrel-user-script', 'ns_lfid', $ns_lfid );
271
- }
272
-
273
- wp_localize_script( 'nimble-squirrel-user-script', 'ns_clear_div', $clear_div );
274
-
275
-
276
- wp_register_style('wplc-survey-style', plugins_url('../css/wplc-survey-style.css', __FILE__));
277
- wp_enqueue_style('wplc-survey-style');
278
- if( isset( $settings['survey_display']) && $settings['survey_display'] == '1' ) {
279
- wp_register_style('wplc-survey-before-style', plugins_url('../css/wplc-survey-style-before.css', __FILE__));
280
- wp_enqueue_style('wplc-survey-before-style');
281
- }
282
- }
283
- }
284
-
285
-
286
-
287
- add_filter("wplc_filter_live_chat_box_hover_html_start_chat_button","wplc_filter_survey_control_live_chat_box_html_hovercard_chat_button",1,3);
288
- function wplc_filter_survey_control_live_chat_box_html_hovercard_chat_button($wplc_settings,$logged_in,$wplc_using_locale ) {
289
-
290
- $settings = get_option('WPLC_SURVEY_SETTINGS');
291
-
292
- if( isset( $settings['wplc_enable_surveys'] ) && intval($settings['wplc_enable_surveys']) == 1 && !isset($_COOKIE['ns_participated'])){
293
- if( isset( $settings['survey_display']) && $settings['survey_display'] == '1' ) {
294
- remove_filter("wplc_filter_live_chat_box_hover_html_start_chat_button","wplc_filter_control_live_chat_box_html_hovercard_chat_button");
295
- if ($logged_in) {
296
- $wplc_sst_1 = __('Or chat to an agent now', 'wplivechat');
297
- if (!isset($settings['wplc_pro_sst1_survey']) || $settings['wplc_pro_sst1_survey'] == "") { $settings['wplc_pro_sst1_survey'] = $wplc_sst_1; }
298
- $text = ($wplc_using_locale ? $wplc_sst_1 : stripslashes($settings['wplc_pro_sst1_survey']));
299
- return "<button id=\"speeching_button\" type=\"button\" class='wplc-color-bg-1 wplc-color-2'>$text</button>";
300
- } else {
301
- $wplc_sst_1 = __('Leave a message', 'wplivechat');
302
- return "<button id=\"speeching_button\" type=\"button\" class='wplc-color-bg-1 wplc-color-2'>$wplc_sst_1</button>";
303
-
304
- }
305
- }
306
- }
307
- }
308
-
309
-
310
- add_action("wplc_hook_push_js_to_front","wplc_hook_survey_push_js_to_front",10,1);
311
- function wplc_hook_survey_push_js_to_front() {
312
- $settings = get_option('WPLC_SURVEY_SETTINGS');
313
-
314
- if( isset( $settings['wplc_enable_surveys'] ) && intval($settings['wplc_enable_surveys']) == 1 ){
315
-
316
- $wplc_settings = get_option('WPLC_SETTINGS');
317
- wp_register_script('wplc-survey-script', plugins_url('../js/wplc_surveys.js', __FILE__),array('jquery'),WPLC_PLUGIN_VERSION);
318
- wp_enqueue_script('wplc-survey-script');
319
- wp_localize_script( 'wplc-survey-script', 'wplc_end_chat_string', $wplc_settings['wplc_pro_sst1e_survey'] );
320
- wp_localize_script( 'wplc-survey-script', 'wplc_button_string', $wplc_settings['wplc_pro_sst1_survey'] );
321
- }
322
-
323
-
324
- }
325
-
326
-
327
-
328
- function wplc_admin_survey_layout() {
329
- wplc_stats("surveys");
330
- $settings = get_option('WPLC_SURVEY_SETTINGS');
331
-
332
- echo"<div class=\"wrap wplc_wrap\">";
333
- echo "<h1>" . __("WP Live Chat Surveys & Lead Forms with Nimble Squirrel", "wplivechat") . "</h1>";
334
- echo "<div style='width:100%; display:block; overflow:auto; background-color:#FFF; padding:10px; border-radius:10px;'>";
335
-
336
-
337
- if( isset( $settings['wplc_enable_surveys'] ) && intval($settings['wplc_enable_surveys']) == 1 ){
338
- echo "<h2>".__("Surveys & Lead Forms","wplivechat")."</h2>";
339
- echo "<p>".__("To view your responses, click the button below and log in to your NimbleSquirrel account.","wplivechat")."</p>";
340
- echo "<a href='http://app.nimblesquirrel.com/?utm_source=wplc&utm_medium=click&utm_campaign=view_responses' target='_BLANK' class='button button-primary'>View your responses</a>";
341
- echo "<p>&nbsp;</p>";
342
- echo "";
343
- echo "";
344
- echo "";
345
- echo "";
346
- echo "";
347
-
348
- }
349
- else {
350
-
351
- $link1 = sprintf( __( 'Register on <a href="%s" target="_BLANK" title="NimbleSquirrel">NimbleSquirrel</a> (It\'s free)', 'wplivechat' ),
352
- 'http://app.nimblesquirrel.com/join.php?email='.get_option("admin_email")."&site=".site_url().'&utm_source=wplc&utm_medium=click&utm_campaign=plugin_register'
353
- );
354
- $link2 = sprintf( __( '<a href="%s" target="_BLANK" title="Create a survey">Create a survey</a>.', 'wplivechat' ),
355
- 'http://app.nimblesquirrel.com/my_account.php?a=add_survey_wizard&utm_source=wplc&utm_medium=click&utm_campaign=add_survey'
356
- );
357
-
358
-
359
- echo " <div style='display:block; width:50%; float:left; overflow:auto;'>";
360
- echo " <div style='display:block; padding:10px;'>";
361
- echo " <h2>".__("Add a Survey to your live chat box","wplivechat")."</h2>";
362
- echo " <p>".__("Three simple steps:","wplivechat")."</p>";
363
- echo " <ol>";
364
- echo " <li>".$link1."</li>";
365
- echo " <li>".$link2."</li>";
366
- echo " <li>".__("Enable surveys in your live chat <a href='admin.php?page=wplivechat-menu-settings#tabs-survey'>settings page</a>.","wplivechat")."</li>";
367
- echo " </ol>";
368
- echo "";
369
- echo "";
370
- echo " </div>";
371
- echo " </div>";
372
- echo " <div style='display:block; width:50%; float:left; overflow:auto;'>";
373
- echo " <div style='display:block; padding:10px;'>";
374
- echo "";
375
- echo "";
376
- echo "";
377
- echo "";
378
- echo " <img src='" . WPLC_PLUGIN_URL . "/images/Survey_Box_Standard.jpg' style='max-width:100%;' />";
379
- echo "";
380
- echo "";
381
- echo "";
382
- echo "";
383
- echo "";
384
- echo " </div>";
385
- echo " </div>";
386
-
387
- }
388
- echo "</div>";
389
- echo "</div>";
390
-
391
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/templates/documentation-suggestion-item.html DELETED
@@ -1 +0,0 @@
1
- <li class='wplc-ds-li'><a href='{doc_uri}' title='{doc_proximity}' class='wplc-ds-1'>{doc_title}</a></li>
 
includes/templates/documentation-suggestion.html DELETED
@@ -1 +0,0 @@
1
- <div class='wplc-ds-wrapper'><p class='wplc-ds-p'><strong class='wplc-ds-strong'>{doc_suggestion_header}</strong></p><ul class='wplc-ds-ul'>{doc_suggestion_list}</ul></div>
 
includes/wplc_agent_data.php CHANGED
@@ -1,294 +1,86 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
  }
5
 
6
  add_action( 'edit_user_profile', 'wplc_user_profile_fields_mrg' );
7
  add_action( 'show_user_profile', 'wplc_user_profile_fields_mrg' );
8
- function wplc_user_profile_fields_mrg( $user ){
9
- $ret = "";
10
- $ret .= "<a name='wplc-user-fields'></a><h2>".__( 'WP Live Chat Support - User Fields', 'wplivechat' )."</h2>";
11
- $ret .= "<table class='form-table'>";
12
- $ret .= "<tr>";
13
- $ret .= "<th>";
14
- $ret .= "<label for='wplc_user_tagline'>".__('User tagline', 'wplivechat')."</label>";
15
- $ret .= "</th>";
16
- $ret .= "<td>";
17
- $ret .= "<label for='wplc_user_tagline'>";
18
- if ( get_the_author_meta( 'wplc_user_tagline', $user->ID ) != "" ) { $predefined = sanitize_text_field( get_the_author_meta( 'wplc_user_tagline', $user->ID ) ); } else { $predefined = ""; }
19
- $ret .= "<textarea name='wplc_user_tagline' id='wplc_user_tagline' rows='6'>$predefined</textarea><br/>";
20
- $ret .= "<small>".__( 'This will show up at the top of the chatbox - Leave blank to disable.', 'wplivechat' )."</small>";
21
- $ret .= "</label>";
22
- $ret .= "</td>";
23
- $ret .= "</tr>";
24
-
25
- $ret .= "<tr>";
26
- $ret .= "<th>";
27
- $ret .= "<label for='wplc_user_bio'>".__('User bio', 'wplivechat')."</label>";
28
- $ret .= "</th>";
29
- $ret .= "<td>";
30
- $ret .= "<label for='wplc_user_bio'>";
31
- if ( get_the_author_meta( 'wplc_user_bio', $user->ID ) != "" ) { $predefined = sanitize_text_field( get_the_author_meta( 'wplc_user_bio', $user->ID ) ); } else { $predefined = ""; }
32
- $ret .= "<textarea name='wplc_user_bio' id='wplc_user_bio' rows='6'>$predefined</textarea><br/>";
33
- $ret .= "<small>".__( 'This will show up at the top of the chatbox - Leave blank to disable.', 'wplivechat' )."</small>";
34
- $ret .= "</label>";
35
- $ret .= "</td>";
36
- $ret .= "</tr>";
37
-
38
- $ret .= "<tr>";
39
- $ret .= "<th>";
40
- $ret .= "<label for='wplc_user_social_accounts'>".__('User social accounts', 'wplivechat')."</label>";
41
- $ret .= "</th>";
42
- $ret .= "<td>";
43
- $ret .= "<label for='wplc_user_twitter'>";
44
- if ( get_the_author_meta( 'wplc_user_twitter', $user->ID ) != "" ) { $predefined = sanitize_text_field( get_the_author_meta( 'wplc_user_twitter', $user->ID ) ); } else { $predefined = ""; }
45
- $ret .= "<input name='wplc_user_twitter' id='wplc_user_twitter' value='$predefined' /> <em>".__("Twitter URL","wplivechat")."</em><br/>";
46
- $ret .= "</label>";
47
- $ret .= "<label for='wplc_user_linkedin'>";
48
- if ( get_the_author_meta( 'wplc_user_linkedin', $user->ID ) != "" ) { $predefined = sanitize_text_field( get_the_author_meta( 'wplc_user_linkedin', $user->ID ) ); } else { $predefined = ""; }
49
- $ret .= "<input name='wplc_user_linkedin' id='wplc_user_linkedin' value='$predefined' /> <em>".__("LinkedIn URL","wplivechat")."</em><br/>";
50
- $ret .= "</label>";
51
- $ret .= "<label for='wplc_user_facebook'>";
52
- if ( get_the_author_meta( 'wplc_user_facebook', $user->ID ) != "" ) { $predefined = sanitize_text_field( get_the_author_meta( 'wplc_user_facebook', $user->ID ) ); } else { $predefined = ""; }
53
- $ret .= "<input name='wplc_user_facebook' id='wplc_user_facebook' value='$predefined' /> <em>".__("Facebook URL","wplivechat")."</em><br/>";
54
- $ret .= "</label>";
55
- $ret .= "<label for='wplc_user_website'>";
56
- if ( get_the_author_meta( 'wplc_user_website', $user->ID ) != "" ) { $predefined = sanitize_text_field( get_the_author_meta( 'wplc_user_website', $user->ID ) ); } else { $predefined = ""; }
57
- $ret .= "<input name='wplc_user_website' id='wplc_user_website' value='$predefined' /> <em>".__("Website URL","wplivechat")."</em><br/>";
58
- $ret .= "</label>";
59
- $ret .= "<small>".__( "This will show up at the top of the chatbox, in the agent's description - Leave each item blank to disable it.", 'wplivechat' )."</small>";
60
- $ret .= "</label>";
61
- $ret .= "</td>";
62
- $ret .= "</tr>";
63
 
64
- $ret .= "</table>";
65
- echo $ret;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  }
 
67
  add_action('edit_user_profile_update', 'wplc_save_user_profile_data_mrg');
68
  add_action('personal_options_update', 'wplc_save_user_profile_data_mrg');
69
- function wplc_save_user_profile_data_mrg( $user_id ){
70
- if (!current_user_can('edit_user', $user_id)) {
71
- return false;
72
- }
73
- if( isset( $_POST['wplc_user_tagline'] ) ){
74
- $predefined_response = wp_kses( nl2br( $_POST['wplc_user_tagline'] ), array( 'br' ) );
75
- update_user_meta( $user_id, 'wplc_user_tagline', $predefined_response );
76
- }
77
- if( isset( $_POST['wplc_user_bio'] ) ){
78
- $predefined_response = wp_kses( nl2br( $_POST['wplc_user_bio'] ), array( 'br' ) );
79
- update_user_meta( $user_id, 'wplc_user_bio', $predefined_response );
80
- }
81
- if( isset( $_POST['wplc_user_twitter'] ) ){
82
- $predefined_response = wp_kses( nl2br( $_POST['wplc_user_twitter'] ), array( 'br' ) );
83
- update_user_meta( $user_id, 'wplc_user_twitter', $predefined_response );
84
- }
85
- if( isset( $_POST['wplc_user_linkedin'] ) ){
86
- $predefined_response = wp_kses( nl2br( $_POST['wplc_user_linkedin'] ), array( 'br' ) );
87
- update_user_meta( $user_id, 'wplc_user_linkedin', $predefined_response );
88
- }
89
- if( isset( $_POST['wplc_user_facebook'] ) ){
90
- $predefined_response = wp_kses( nl2br( $_POST['wplc_user_facebook'] ), array( 'br' ) );
91
- update_user_meta( $user_id, 'wplc_user_facebook', $predefined_response );
92
- }
93
- if( isset( $_POST['wplc_user_website'] ) ){
94
- $predefined_response = wp_kses( nl2br( $_POST['wplc_user_website'] ), array( 'br' ) );
95
- update_user_meta( $user_id, 'wplc_user_website', $predefined_response );
96
- }
97
 
 
 
 
 
 
 
 
 
98
  }
99
 
100
-
101
-
102
  add_filter("wplc_filter_further_live_chat_box_above_main_div","wplc_mrg_filter_control_live_chat_box_above_main_div",10,5);
103
- function wplc_mrg_filter_control_live_chat_box_above_main_div( $msg, $wplc_settings, $cid, $chat_data, $agent ) {
104
- if (isset($wplc_settings['wplc_newtheme']) && $wplc_settings['wplc_newtheme'] == "theme-2") {
105
-
106
- $agent_info = '';
107
- $cbox_header_bg = '';
108
- $agent_tagline = '';
109
- $agent_bio = '';
110
-
111
- $a_twitter = '';
112
- $a_linkedin = '';
113
- $a_facebook = '';
114
- $a_website = '';
115
- $social_links = '';
116
- if ( $cid ) {
117
-
118
-
119
- if ( isset( $chat_data->agent_id ) ) {
120
- $agent_id = intval( $chat_data->agent_id );
121
- } else {
122
- $agent_id = get_current_user_id();
123
- }
124
-
125
- if ( $agent_id ) {
126
-
127
-
128
- $tagline = get_user_meta( $agent_id, 'wplc_user_tagline', true );
129
- if( $tagline !== "" ){
130
- $agent_tagline = $tagline;
131
- $agent_tagline = '<span class="wplc_agent_infosection wplc_agent_tagline wplc-color-2" title="'.$agent_tagline.'">'.$agent_tagline.'</span>';
132
- }
133
- $bio = get_user_meta( $agent_id, 'wplc_user_bio', true );
134
- if( $bio !== "" ){
135
- $agent_bio = $bio;
136
- $agent_bio = '<span class="wplc_agent_infosection wplc_agent_bio wplc-color-2">'.$agent_bio.'</span>';
137
- }
138
-
139
- $a_twitter = get_user_meta( $agent_id, 'wplc_user_twitter', true );
140
- $a_linkedin = get_user_meta( $agent_id, 'wplc_user_linkedin', true );
141
- $a_facebook = get_user_meta( $agent_id, 'wplc_user_facebook', true );
142
- $a_website = get_user_meta( $agent_id, 'wplc_user_website', true );
143
 
144
-
145
-
146
- if ($a_twitter === '' && $a_linkedin === '' && $a_facebook === '' && $a_website === '') {
147
- $social_links = '';
148
- } else {
149
- $social_links = '<span class="wplc_agent_infosection wplc_agent_social_links wplc-color-2">';
150
- if ($a_twitter !== '') {
151
- $social_links .= '<a href="'.$a_twitter.'" title="'.$agent.' - Twitter" border="0" rel="nofollow" target="_BLANK"><img src="'.plugins_url('/images/social/twitter.png',dirname(__FILE__)).'" title="'.$agent.' - Twitter" border="0" /></a> &nbsp; ';
152
- }
153
- if ($a_linkedin !== '') {
154
- $social_links .= '<a href="'.$a_linkedin.'" title="'.$agent.' - Twitter" border="0" rel="nofollow" target="_BLANK"><img src="'.plugins_url('/images/social/linkedin.png',dirname(__FILE__)).'" title="'.$agent.' - LinkedIn" border="0" /></a> &nbsp; ';
155
- }
156
- if ($a_facebook !== '') {
157
- $social_links .= '<a href="'.$a_facebook.'" title="'.$agent.' - Twitter" border="0" rel="nofollow" target="_BLANK"><img src="'.plugins_url('/images/social/facebook.png',dirname(__FILE__)).'" title="'.$agent.' - Facebook" border="0" /></a> &nbsp; ';
158
- }
159
- if ($a_website !== '') {
160
- $social_links .= '<a href="'.$a_website.'" title="'.$agent.' - Twitter" border="0" rel="nofollow" target="_BLANK"><img src="'.plugins_url('/images/social/website.png',dirname(__FILE__)).'" title="'.$agent.' - Website" border="0" /></a> &nbsp; ';
161
- }
162
- $social_links .= '</span>';
163
- }
164
-
165
- $msg = $agent_tagline.''.$agent_bio.''.$social_links;
166
-
167
- }
168
- }
169
-
170
-
171
-
172
- }
173
- return $msg;
174
- }
175
-
176
- add_filter( "wplc_filter_agent_data_social_links", "wplc_mrg_filter_control_agent_data_social_links", 10, 7 );
177
- function wplc_mrg_filter_control_agent_data_social_links( $social_links, $cid, $chat_data, $agent, $wplc_acbc_data, $user_info, $data ) {
178
- if( !isset( $data ) ){ $data = false; }
179
- if (!isset($data) || !isset($data['aid'])) {
180
- $data = array();
181
- if (isset($chat_data) && is_object($chat_data) && isset($chat_data->agent_id)) {
182
- $data['aid'] = $chat_data->agent_id;
183
- }
184
- }
185
-
186
-
187
- $a_twitter = get_user_meta( intval($data['aid']), 'wplc_user_twitter', true );
188
- $a_linkedin = get_user_meta( intval($data['aid']), 'wplc_user_linkedin', true );
189
- $a_facebook = get_user_meta( intval($data['aid']), 'wplc_user_facebook', true );
190
- $a_website = get_user_meta( intval($data['aid']), 'wplc_user_website', true );
191
-
192
- if ($a_twitter === '' && $a_linkedin === '' && $a_facebook === '' && $a_website === '') {
193
- $social_links = '';
194
- } else {
195
- $social_links = '<span class="wplc_agent_infosection wplc_agent_social_links wplc-color-2">';
196
- if ($a_twitter !== '') {
197
- $social_links .= '<a href="'.$a_twitter.'" title="'.$agent.'" border="0" rel="nofollow" target="_BLANK"><img src="'.plugins_url('/images/social/twitter.png',dirname(__FILE__)).'" title="'.$agent.' - Twitter" border="0" /></a> &nbsp; ';
198
- }
199
- if ($a_linkedin !== '') {
200
- $social_links .= '<a href="'.$a_linkedin.'" title="'.$agent.'" border="0" rel="nofollow" target="_BLANK"><img src="'.plugins_url('/images/social/linkedin.png',dirname(__FILE__)).'" title="'.$agent.' - LinkedIn" border="0" /></a> &nbsp; ';
201
- }
202
- if ($a_facebook !== '') {
203
- $social_links .= '<a href="'.$a_facebook.'" title="'.$agent.'" border="0" rel="nofollow" target="_BLANK"><img src="'.plugins_url('/images/social/facebook.png',dirname(__FILE__)).'" title="'.$agent.' - Facebook" border="0" /></a> &nbsp; ';
204
- }
205
- if ($a_website !== '') {
206
- $social_links .= '<a href="'.$a_website.'" title="'.$agent.'" border="0" rel="nofollow" target="_BLANK"><img src="'.plugins_url('/images/social/website.png',dirname(__FILE__)).'" title="'.$agent.' - Website" border="0" /></a> &nbsp; ';
207
  }
208
- $social_links .= '</span>';
209
- }
210
- return $social_links;
211
- }
212
-
213
- add_filter( "wplc_filter_agent_data_agent_bio", "wplc_mrg_filter_control_agent_data_agent_bio", 10, 7 );
214
- function wplc_mrg_filter_control_agent_data_agent_bio( $agent_bio, $cid, $chat_data, $agent, $wplc_acbc_data, $user_info, $data ) {
215
- if( !isset( $data ) ){ $data = false; }
216
- $bio = get_user_meta( intval($chat_data->agent_id), 'wplc_user_bio', true );
217
- if( $bio !== "" ){
218
- $agent_bio = $bio;
219
- $agent_bio = '<span class="wplc_agent_infosection wplc_agent_bio wplc-color-2">'.$agent_bio.'</span>';
220
  }
221
- return $agent_bio;
 
222
  }
223
 
224
  add_filter( "wplc_filter_agent_data_agent_tagline", "wplc_mrg_filter_control_agent_data_agent_tagline", 10, 7 );
225
- function wplc_mrg_filter_control_agent_data_agent_tagline( $agent_tagline, $cid, $chat_data, $agent, $wplc_acbc_data, $user_info, $data ) {
226
- if( !isset( $data ) ){ $data = false; }
227
- $tagline = get_user_meta( intval($chat_data->agent_id), 'wplc_user_tagline', true );
228
- if( $tagline !== "" ){
229
- $agent_tagline = $tagline;
230
- $agent_tagline = '<span class="wplc_agent_infosection wplc_agent_tagline wplc-color-2" title="'.$agent_tagline.'">'.$agent_tagline.'</span>';
231
- }
232
- return $agent_tagline;
233
- }
234
-
235
-
236
-
237
-
238
-
239
-
240
- add_filter( "wplc_filter_simple_agent_data_agent_bio", "wplc_mrg_filter_simple_control_agent_data_agent_bio", 10, 2 );
241
- function wplc_mrg_filter_simple_control_agent_data_agent_bio( $agent_bio, $agent_id ) {
242
- if( !isset( $data ) ){ $data = false; }
243
- $bio = get_user_meta( intval($agent_id), 'wplc_user_bio', true );
244
- if( $bio !== "" ){
245
- $agent_bio = $bio;
246
- $agent_bio = '<span class="wplc_agent_infosection wplc_agent_bio wplc-color-2">'.$agent_bio.'</span>';
247
- }
248
- return $agent_bio;
249
  }
250
 
251
  add_filter( "wplc_filter_simple_agent_data_agent_tagline", "wplc_mrg_filter_simple_control_agent_data_agent_tagline", 10, 2 );
252
  function wplc_mrg_filter_simple_control_agent_data_agent_tagline( $agent_tagline, $agent_id ) {
253
- if( !isset( $data ) ){ $data = false; }
254
- $tagline = get_user_meta( intval($agent_id), 'wplc_user_tagline', true );
255
- if( $tagline !== "" ){
256
- $agent_tagline = $tagline;
257
- $agent_tagline = '<span class="wplc_agent_infosection wplc_agent_tagline wplc-color-2" title="'.$agent_tagline.'">'.$agent_tagline.'</span>';
258
- }
259
- return $agent_tagline;
260
- }
261
-
262
-
263
-
264
-
265
- add_filter( "wplc_filter_simple_agent_data_social_links", "wplc_mrg_filter_simple_control_agent_data_social_links", 10, 2 );
266
- function wplc_mrg_filter_simple_control_agent_data_social_links( $social_links, $agent_id ) {
267
-
268
-
269
- $a_twitter = get_user_meta( intval($agent_id), 'wplc_user_twitter', true );
270
- $a_linkedin = get_user_meta( intval($agent_id), 'wplc_user_linkedin', true );
271
- $a_facebook = get_user_meta( intval($agent_id), 'wplc_user_facebook', true );
272
- $a_website = get_user_meta( intval($agent_id), 'wplc_user_website', true );
273
-
274
- if ($a_twitter === '' && $a_linkedin === '' && $a_facebook === '' && $a_website === '') {
275
- $social_links = '';
276
- } else {
277
- $social_links = '<span class="wplc_agent_infosection wplc_agent_social_links wplc-color-2">';
278
- if ($a_twitter !== '') {
279
- $social_links .= '<a href="'.$a_twitter.'" title="'.__("Twitter","wplivechat").'" border="0" rel="nofollow" target="_BLANK"><img src="'.plugins_url('/images/social/twitter.png',dirname(__FILE__)).'" title="'.__("Twitter","wplivechat").'" border="0" /></a> &nbsp; ';
280
- }
281
- if ($a_linkedin !== '') {
282
- $social_links .= '<a href="'.$a_linkedin.'" title="'.__("LinkedIn","wplivechat").'" border="0" rel="nofollow" target="_BLANK"><img src="'.plugins_url('/images/social/linkedin.png',dirname(__FILE__)).'" title="'.__("LinkedIn","wplivechat").'" border="0" /></a> &nbsp; ';
283
- }
284
- if ($a_facebook !== '') {
285
- $social_links .= '<a href="'.$a_facebook.'" title="'.__("Facebook","wplivechat").'" border="0" rel="nofollow" target="_BLANK"><img src="'.plugins_url('/images/social/facebook.png',dirname(__FILE__)).'" title="'.__("Facebook","wplivechat").'" border="0" /></a> &nbsp; ';
286
- }
287
- if ($a_website !== '') {
288
- $social_links .= '<a href="'.$a_website.'" title="'.__("Website","wplivechat").'" border="0" rel="nofollow" target="_BLANK"><img src="'.plugins_url('/images/social/website.png',dirname(__FILE__)).'" title="'.__("Website","wplivechat").'" - Website" border="0" /></a> &nbsp; ';
289
- }
290
- $social_links .= '</span>';
291
- }
292
- return $social_links;
293
- }
294
-
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
  }
5
 
6
  add_action( 'edit_user_profile', 'wplc_user_profile_fields_mrg' );
7
  add_action( 'show_user_profile', 'wplc_user_profile_fields_mrg' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
+ function wplc_user_profile_fields_mrg( $user ){
10
+ $ret = "";
11
+ $ret .= "<a name='wplc-user-fields'></a><h2>".__( 'WP Live Chat by 3CX - User Fields', 'wplivechat' )."</h2>";
12
+ $ret .= "<table class='form-table'>";
13
+ $ret .= "<tr>";
14
+ $ret .= "<th>";
15
+ $ret .= "<label for='wplc_user_tagline'>".__('User tagline', 'wplivechat')."</label>";
16
+ $ret .= "</th>";
17
+ $ret .= "<td>";
18
+ $ret .= "<label for='wplc_user_tagline'>";
19
+ $predefined = "";
20
+ if ( get_the_author_meta( 'wplc_user_tagline', $user->ID ) != "" ) {
21
+ $predefined = sanitize_text_field( get_the_author_meta( 'wplc_user_tagline', $user->ID ) );
22
+ }
23
+ $ret .= "<textarea name='wplc_user_tagline' id='wplc_user_tagline' rows='6'>".$predefined."</textarea><br/>";
24
+ $ret .= "<small>".__( 'This will show up at the top of the chatbox - Leave blank to disable.', 'wplivechat' )."</small>";
25
+ $ret .= "</label>";
26
+ $ret .= "</td>";
27
+ $ret .= "</tr>";
28
+ $ret .= "</table>";
29
+ echo $ret;
30
  }
31
+
32
  add_action('edit_user_profile_update', 'wplc_save_user_profile_data_mrg');
33
  add_action('personal_options_update', 'wplc_save_user_profile_data_mrg');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
+ function wplc_save_user_profile_data_mrg( $user_id ){
36
+ if (!current_user_can('edit_user', $user_id)) {
37
+ return false;
38
+ }
39
+ if( isset( $_POST['wplc_user_tagline'] ) ){
40
+ $predefined_response = wp_kses( nl2br( $_POST['wplc_user_tagline'] ), array( 'br' ) );
41
+ update_user_meta( $user_id, 'wplc_user_tagline', $predefined_response );
42
+ }
43
  }
44
 
 
 
45
  add_filter("wplc_filter_further_live_chat_box_above_main_div","wplc_mrg_filter_control_live_chat_box_above_main_div",10,5);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
+ function wplc_mrg_filter_control_live_chat_box_above_main_div( $msg, $wplc_settings, $cid, $chat_data, $agent ) {
48
+ if ($wplc_settings['wplc_newtheme'] == "theme-2") {
49
+ $agent_tagline = '';
50
+ if ( $cid ) {
51
+ if ( isset( $chat_data->agent_id ) ) {
52
+ $agent_id = intval( $chat_data->agent_id );
53
+ } else {
54
+ $agent_id = get_current_user_id();
55
+ }
56
+ if ( $agent_id ) {
57
+ $tagline = get_user_meta( $agent_id, 'wplc_user_tagline', true );
58
+ if( $tagline !== "" ){
59
+ $agent_tagline = '<span class="wplc_agent_infosection wplc_agent_tagline wplc-color-2">'.$tagline.'</span>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  }
61
+ $msg = $agent_tagline;
62
+ }
 
 
 
 
 
 
 
 
 
 
63
  }
64
+ }
65
+ return $msg;
66
  }
67
 
68
  add_filter( "wplc_filter_agent_data_agent_tagline", "wplc_mrg_filter_control_agent_data_agent_tagline", 10, 7 );
69
+ function wplc_mrg_filter_control_agent_data_agent_tagline( $agent_tagline, $cid, $chat_data, $agent, $wplc_settings, $user_info, $data ) {
70
+ if( !isset( $data ) ){ $data = false; }
71
+ $tagline = get_user_meta( intval($chat_data->agent_id), 'wplc_user_tagline', true );
72
+ if( $tagline !== "" ){
73
+ return $tagline;
74
+ }
75
+ return '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  }
77
 
78
  add_filter( "wplc_filter_simple_agent_data_agent_tagline", "wplc_mrg_filter_simple_control_agent_data_agent_tagline", 10, 2 );
79
  function wplc_mrg_filter_simple_control_agent_data_agent_tagline( $agent_tagline, $agent_id ) {
80
+ if( !isset( $data ) ){ $data = false; }
81
+ $tagline = get_user_meta( intval($agent_id), 'wplc_user_tagline', true );
82
+ if( $tagline !== "" ){
83
+ return $tagline;
84
+ }
85
+ return '';
86
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/wplc_custom_fields.php CHANGED
@@ -68,7 +68,7 @@ function wplc_custom_fields_display_page_mrg(){
68
 
69
  $content = "<div class='wrap wplc_wrap'>";
70
 
71
- $content .= "<h2>".__('WP Live Chat Support Custom Fields', 'wp-livechat'). $wplc_add_button . "</h2>";
72
 
73
  $results = wplc_get_all_custom_fields_mrg();
74
 
@@ -90,26 +90,10 @@ function wplc_custom_fields_display_page_mrg(){
90
  foreach ($results as $result) {
91
 
92
  $content .= "<tr>";
93
-
94
  $content .= "<td>".$result->id."</td>";
95
- $content .= "<td>".$result->field_name."</td>";
96
- $content .= "<td>".wplc_return_custom_field_type_mrg( $result->field_type )."</td>";
97
- if( $result->field_type == 0 ){
98
- $content .= "<td>".$result->field_content."</td>";
99
- } else {
100
-
101
- $current_content = $result->field_content;
102
- $current_content = str_replace("\\r", "", $current_content);
103
- $current_content = json_decode( stripslashes( $current_content ) );
104
- $content .= "<td>";
105
- if($current_content !== NULL){
106
- foreach( $current_content as $val ){
107
- $content .= "<span>".$val."</span><br/>";
108
- }
109
- }
110
- $content .= "</td>";
111
-
112
- }
113
 
114
  if( $result->status ){
115
  $status_string = __("Active", "wplivechat");
@@ -151,7 +135,7 @@ function wplc_custom_fields_add_page_mrg(){
151
  $content = "";
152
  $content .= "<div class='wrap wplc_wrap'>";
153
  $content .= " <h2>".__("Create a Custom Field", "wplivechat")."</h2>";
154
- $content .= " <form method='POST'>";
155
  $content .= " <table class='wp-list-table wplc_list_table widefat fixed wpgmza-listing'>";
156
  $content .= " <tbody>";
157
  $content .= " <tr>";
@@ -177,7 +161,7 @@ function wplc_custom_fields_add_page_mrg(){
177
  $content .= " </tr>";
178
  $content .= " <tr>";
179
  $content .= " <td></td>";
180
- $content .= " <td><input type='submit' class='button button-primary' name='wplc_create_custom_field' value='".__('Create Custom Field', 'wplivechat')."' /></td>";
181
  $content .= " </tr>";
182
  $content .= " </tbody>";
183
  $content .= " </table>";
@@ -212,23 +196,23 @@ function wplc_custom_fields_edit_page_mrg( $id ){
212
  $field_content = str_replace(",", "\n", $field_content);
213
  $field_content = str_replace("]", "", $field_content);
214
  }
 
 
 
 
 
 
215
 
216
  $content = "";
217
  $content .= "<div class='wrap wplc_wrap'>";
218
  $content .= " <h2>".__("Edit a Custom Field", "wplivechat")."</h2>";
219
- $content .= " <form method='POST'>";
220
  $content .= " <table class='wp-list-table wplc_list_table widefat fixed wpgmza-listing'>";
221
  $content .= " <tbody>";
222
  $content .= " <tr>";
223
  $content .= " <td>".__('Field Name', 'wplivechat')."</td>";
224
- $content .= " <td><input type='text' name='wplc_field_name' id='wplc_field_name' style='width: 250px;' value='".$result->field_name."'/></td>";
225
  $content .= " </tr>";
226
- if( intval($result->field_type) != 1) {
227
- $content .= " <tr>";
228
- $content .= " <td>".__('Default Field Value', 'wplivechat')."</td>";
229
- $content .= " <td><input type='text' name='wplc_field_value' id='wplc_field_value' style='width: 250px;' value='".$field_content."'/></td>";
230
- $content .= " </tr>";
231
- }
232
  $content .= " <tr>";
233
  $content .= " <td>".__('Field Type', 'wplivechat')."</td>";
234
  $content .= " <td>";
@@ -240,16 +224,17 @@ function wplc_custom_fields_edit_page_mrg( $id ){
240
  $content .= " </select>";
241
  $content .= " </td>";
242
  $content .= " </tr>";
243
-
244
- if( intval($result->field_type) == 1) {
245
- $content .= " <tr>";
246
- $content .= " <td>".__('Drop Down Contents', 'wplivechat')."</td>";
247
- $content .= " <td><textarea name='wplc_drop_down_values' id='wplc_drop_down_values' rows='6' style='width: 250px;'>".$field_content."</textarea><br/><small>".__("Enter each option on a new line", "wplivechat")."</small></td>";
248
- $content .= " </tr>";
249
- }
 
250
  $content .= " <tr>";
251
  $content .= " <td></td>";
252
- $content .= " <td><input type='submit' class='button button-primary' name='wplc_update_custom_field' value='".__('Update Custom Field', 'wplivechat')."' /></td>";
253
  $content .= " </tr>";
254
  $content .= " </tbody>";
255
  $content .= " </table>";
@@ -337,20 +322,20 @@ function wplc_display_custom_fields_in_chatbox_mrg( $string ){
337
 
338
  if( $field->field_type == 0 ){
339
 
340
- $ret .= "<input type='text' name='wplc_custom_field[".$field->id."]' id='wplc_custom_field_".$field->id."' fname='".$field->field_name."' placeholder='".$field->field_content."' />";
341
 
342
  } else if( $field->field_type == 1 ){
343
 
344
- $ret .= "<select class='wplc_custom_dropdown unselected' name='wplc_custom_field[".$field->id."]' id='wplc_custom_field_".$field->id."' fname='".$field->field_name."'>";
345
  $content = $field->field_content;
346
  $content = str_replace("\\r", "", $content);
347
  $options = json_decode( $content );
348
 
349
- $ret .= " <option value='$field->field_name' wplc-holder='true'>".trim( $field->field_name )."</option>";
350
 
351
  if( $options ){
352
  foreach( $options as $key => $val ){
353
- $ret .= " <option value='$val'>".trim( $val )."</option>";
354
  }
355
  }
356
 
@@ -381,13 +366,12 @@ function wplc_advanced_info_custom_fields_mrg( $string, $cid, $name, $chat_data
381
  $content .= "<br/><div class='admin_visitor_advanced_info admin_agent_rating'>";
382
  $content .= "<strong>".__("Custom Field Data", "wplivechat")."</strong>";
383
  $content .= "<hr>";
384
- $the_extra_data = maybe_unserialize( $extra_data['wplc_extra_data']);
385
  $the_extra_data = json_decode( stripslashes( $extra_data['wplc_extra_data']['custom_fields'] ) );
386
 
387
  if( $the_extra_data ){
388
  foreach( $the_extra_data as $data ){
389
  $atleast_one_field = true;
390
- $content .= "<span class='part1'>".$data->{0}.":</span> <span class='part2'>".$data->{1}."</span><br/>";
391
  }
392
  }
393
 
@@ -435,14 +419,28 @@ function wplc_custom_fields_admin_head_mrg(){
435
 
436
  } else {
437
 
438
- $field_value = sanitize_text_field( $_POST['wplc_field_value'] );
439
 
440
  }
441
 
442
- if ( isset( $_POST['wplc_create_custom_field'] ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
443
  if (!isset($_POST['wplc_custom_field_nonce']) || !wp_verify_nonce($_POST['wplc_custom_field_nonce'], 'wplc_custom_field_nonce')){
444
  wp_die(__("You do not have permission do perform this action", "wplivechat"));
445
  }
 
446
 
447
  $wpdb->insert(
448
  $custom_field_table,
@@ -459,7 +457,7 @@ function wplc_custom_fields_admin_head_mrg(){
459
  '%d',
460
  )
461
  );
462
- } else if ( isset( $_POST['wplc_update_custom_field'] ) ) {
463
  if (!isset($_POST['wplc_custom_field_nonce']) || !wp_verify_nonce($_POST['wplc_custom_field_nonce'], 'wplc_custom_field_nonce')){
464
  wp_die(__("You do not have permission do perform this action", "wplivechat"));
465
  }
@@ -482,11 +480,10 @@ function wplc_custom_fields_admin_head_mrg(){
482
  array( '%d' )
483
  );
484
  }
485
-
486
  ?><script>window.location = "<?php echo admin_url( 'admin.php?page=wplivechat-menu-custom-fields' ); ?>" </script><?php
487
 
488
  }
489
-
490
  }
491
 
492
 
@@ -509,25 +506,30 @@ function wplc_custom_field_rest_end_points_mrg(){
509
  }
510
 
511
  function wplc_custom_field_rest_get_info_mrg(WP_REST_Request $request){
512
- $request = wplc_api_sanitize_request_params($request);
513
 
514
  $return_array = array();
515
  if(isset($request)){
516
  if(isset($request['security'])){
517
  $check_token = get_option('wplc_api_secret_token');
518
  if($check_token !== false && $request['server_token'] === $check_token){
519
- if(isset($request['cid'])){
520
- $cid = $request['cid'];
521
- if( ! filter_var($cid, FILTER_VALIDATE_INT) ) {
522
- $cid = wplc_return_chat_id_by_rel($cid);
523
- }
524
-
525
- $html = wplc_advanced_info_custom_fields_mrg("", $cid, "", false);
526
-
527
- $return_array['response'] = "Success";
528
- $return_array['code'] = "200";
529
- $return_array['data'] = $html;
530
-
 
 
 
 
 
 
531
  } else {
532
  $return_array['response'] = "No 'cid' found";
533
  $return_array['code'] = "401";
68
 
69
  $content = "<div class='wrap wplc_wrap'>";
70
 
71
+ $content .= "<h2>".__('Custom Fields', 'wp-livechat'). $wplc_add_button . "</h2>";
72
 
73
  $results = wplc_get_all_custom_fields_mrg();
74
 
90
  foreach ($results as $result) {
91
 
92
  $content .= "<tr>";
 
93
  $content .= "<td>".$result->id."</td>";
94
+ $content .= "<td>".esc_html($result->field_name)."</td>";
95
+ $content .= "<td>".esc_html(wplc_return_custom_field_type_mrg( $result->field_type ))."</td>";
96
+ $content .= "<td>".esc_html($result->field_content)."</td>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
 
98
  if( $result->status ){
99
  $status_string = __("Active", "wplivechat");
135
  $content = "";
136
  $content .= "<div class='wrap wplc_wrap'>";
137
  $content .= " <h2>".__("Create a Custom Field", "wplivechat")."</h2>";
138
+ $content .= " <form method='POST' class='wplc_custom_field_form'>";
139
  $content .= " <table class='wp-list-table wplc_list_table widefat fixed wpgmza-listing'>";
140
  $content .= " <tbody>";
141
  $content .= " <tr>";
161
  $content .= " </tr>";
162
  $content .= " <tr>";
163
  $content .= " <td></td>";
164
+ $content .= " <td><input type='hidden' name='wplc_create_custom_field'><input type='submit' class='button button-primary' value='".__('Create Custom Field', 'wplivechat')."' /> <input type='button' class='button button-primary' onclick='history.back();' value='".__('Cancel', 'wplivechat')."' /></td>";
165
  $content .= " </tr>";
166
  $content .= " </tbody>";
167
  $content .= " </table>";
196
  $field_content = str_replace(",", "\n", $field_content);
197
  $field_content = str_replace("]", "", $field_content);
198
  }
199
+
200
+ if( intval($result->field_type) != 1) {
201
+ echo "<style>#wplc_field_value_dropdown_row{display:none}#wplc_field_value_row{display:table-row}</style>";
202
+ }else if( intval($result->field_type) == 1) {
203
+ echo "<style>#wplc_field_value_row{display:none}#wplc_field_value_dropdown_row{display:table-row}</style>";
204
+ }
205
 
206
  $content = "";
207
  $content .= "<div class='wrap wplc_wrap'>";
208
  $content .= " <h2>".__("Edit a Custom Field", "wplivechat")."</h2>";
209
+ $content .= " <form method='POST' class='wplc_custom_field_form'>";
210
  $content .= " <table class='wp-list-table wplc_list_table widefat fixed wpgmza-listing'>";
211
  $content .= " <tbody>";
212
  $content .= " <tr>";
213
  $content .= " <td>".__('Field Name', 'wplivechat')."</td>";
214
+ $content .= " <td><input type='text' name='wplc_field_name' id='wplc_field_name' style='width: 250px;' value='".esc_html($result->field_name)."'/></td>";
215
  $content .= " </tr>";
 
 
 
 
 
 
216
  $content .= " <tr>";
217
  $content .= " <td>".__('Field Type', 'wplivechat')."</td>";
218
  $content .= " <td>";
224
  $content .= " </select>";
225
  $content .= " </td>";
226
  $content .= " </tr>";
227
+ $content .= " <tr id='wplc_field_value_row'>";
228
+ $content .= " <td>".__('Default Field Value', 'wplivechat')."</td>";
229
+ $content .= " <td><input type='text' name='wplc_field_value' id='wplc_field_value' style='width: 250px;' value='".esc_attr($field_content)."'/></td>";
230
+ $content .= " </tr>";
231
+ $content .= " <tr id='wplc_field_value_dropdown_row'>";
232
+ $content .= " <td>".__('Drop Down Contents', 'wplivechat')."</td>";
233
+ $content .= " <td><textarea name='wplc_drop_down_values' id='wplc_drop_down_values' rows='6' style='width: 250px;'>".esc_textarea($field_content)."</textarea><br/><small>".__("Enter each option on a new line", "wplivechat")."</small></td>";
234
+ $content .= " </tr>";
235
  $content .= " <tr>";
236
  $content .= " <td></td>";
237
+ $content .= " <td><input type='hidden' name='wplc_update_custom_field'><input type='submit' class='button button-primary' value='".__('Update Custom Field', 'wplivechat')."' /> <input type='button' class='button button-primary' onclick='history.back();' value='".__('Cancel', 'wplivechat')."' /></td>";
238
  $content .= " </tr>";
239
  $content .= " </tbody>";
240
  $content .= " </table>";
322
 
323
  if( $field->field_type == 0 ){
324
 
325
+ $ret .= "<input type='text' name='wplc_custom_field[".$field->id."]' id='wplc_custom_field_".$field->id."' fname='".esc_attr($field->field_name)."' placeholder='".$field->field_content."' />";
326
 
327
  } else if( $field->field_type == 1 ){
328
 
329
+ $ret .= "<select class='wplc_custom_dropdown unselected' name='wplc_custom_field[".$field->id."]' id='wplc_custom_field_".$field->id."' fname='".esc_attr($field->field_name)."'>";
330
  $content = $field->field_content;
331
  $content = str_replace("\\r", "", $content);
332
  $options = json_decode( $content );
333
 
334
+ $ret .= " <option value='". esc_attr($field->field_name)."' wplc-holder='true'>".trim( esc_html($field->field_name) )."</option>";
335
 
336
  if( $options ){
337
  foreach( $options as $key => $val ){
338
+ $ret .= " <option value='".esc_attr($val)."'>".trim( esc_html($val) )."</option>";
339
  }
340
  }
341
 
366
  $content .= "<br/><div class='admin_visitor_advanced_info admin_agent_rating'>";
367
  $content .= "<strong>".__("Custom Field Data", "wplivechat")."</strong>";
368
  $content .= "<hr>";
 
369
  $the_extra_data = json_decode( stripslashes( $extra_data['wplc_extra_data']['custom_fields'] ) );
370
 
371
  if( $the_extra_data ){
372
  foreach( $the_extra_data as $data ){
373
  $atleast_one_field = true;
374
+ $content .= "<span class='part1'>".htmlentities($data->{0}).":</span> <span class='part2'>".htmlentities($data->{1})."</span><br/>";
375
  }
376
  }
377
 
419
 
420
  } else {
421
 
422
+ $field_value = stripslashes(sanitize_text_field( $_POST['wplc_field_value'] ));
423
 
424
  }
425
 
426
+ $fielderror = false;
427
+
428
+ if(mb_strlen(trim($field_name)) == 0){
429
+ $fielderror = true;
430
+ }
431
+
432
+
433
+
434
+
435
+
436
+ if ( isset( $_POST['wplc_create_custom_field'] ) && !$fielderror) {
437
+
438
+
439
+
440
  if (!isset($_POST['wplc_custom_field_nonce']) || !wp_verify_nonce($_POST['wplc_custom_field_nonce'], 'wplc_custom_field_nonce')){
441
  wp_die(__("You do not have permission do perform this action", "wplivechat"));
442
  }
443
+
444
 
445
  $wpdb->insert(
446
  $custom_field_table,
457
  '%d',
458
  )
459
  );
460
+ } else if ( isset( $_POST['wplc_update_custom_field'] ) && !$fielderror) {
461
  if (!isset($_POST['wplc_custom_field_nonce']) || !wp_verify_nonce($_POST['wplc_custom_field_nonce'], 'wplc_custom_field_nonce')){
462
  wp_die(__("You do not have permission do perform this action", "wplivechat"));
463
  }
480
  array( '%d' )
481
  );
482
  }
483
+
484
  ?><script>window.location = "<?php echo admin_url( 'admin.php?page=wplivechat-menu-custom-fields' ); ?>" </script><?php
485
 
486
  }
 
487
  }
488
 
489
 
506
  }
507
 
508
  function wplc_custom_field_rest_get_info_mrg(WP_REST_Request $request){
 
509
 
510
  $return_array = array();
511
  if(isset($request)){
512
  if(isset($request['security'])){
513
  $check_token = get_option('wplc_api_secret_token');
514
  if($check_token !== false && $request['server_token'] === $check_token){
515
+ if(isset($request['cid'])){
516
+ if(wplc_ic_check_if_user_is_agent() !== "not_user_agent") {
517
+ $cid = $request['cid'];
518
+ if( ! filter_var($cid, FILTER_VALIDATE_INT) ) {
519
+ $cid = wplc_return_chat_id_by_rel($cid);
520
+ }
521
+
522
+ $html = wplc_advanced_info_custom_fields_mrg("", $cid, "", false);
523
+
524
+ $return_array['response'] = "Success";
525
+ $return_array['code'] = "200";
526
+ $return_array['data'] = $html;
527
+ }else {
528
+ $return_array['response'] = "You do not have permission to perform this action.";
529
+ $return_array['code'] = "401";
530
+ $return_array['requirements'] = array("security" => "YOUR_SECRET_TOKEN",
531
+ "cid" => "Chat ID");
532
+ }
533
  } else {
534
  $return_array['response'] = "No 'cid' found";
535
  $return_array['code'] = "401";
includes/wplc_data_triggers.php CHANGED
@@ -8,7 +8,7 @@ function wplc_triggers_page(){
8
  $wplc_add_trigger_btn = isset($_GET['wplc_action']) ? "" : "<a href='?page=wplivechat-menu-triggers&wplc_action=add_trigger' class='wplc_add_new_btn'>". __("Add New", 'wp-livechat') ."</a>";
9
 
10
  $content = "<div class='wrap wplc_wrap'>";
11
- $content .= "<h2>".__('WP Live Chat Support Triggers', 'wp-livechat')." (beta) " . $wplc_add_trigger_btn . "</h2>";
12
 
13
  echo $content;
14
 
@@ -70,7 +70,7 @@ function wplc_mrg_get_add_trigger_content(){
70
 
71
  $content .= "<tr>";
72
  $content .= "<td>".__("Trigger Name", "wplivechat").":</td>";
73
- $content .= "<td><input type='text' name='wplc_trigger_name' value='$trigger_name'></td>";
74
  $content .= "</tr>";
75
 
76
  $content .= "<tr>";
@@ -89,7 +89,7 @@ function wplc_mrg_get_add_trigger_content(){
89
 
90
  $content .= "<tr id='wplc_trigger_page_row'>";
91
  $content .= "<td>".__("Page ID", "wplivechat").":</td>";
92
- $content .= "<td><input type='text' name='wplc_trigger_pages' value='".(isset($trigger_content["pages"]) ? $trigger_content["pages"] : "")."'> <i>".__("Note: Leave empty for 'all' pages", "wplivechat")."</i></td>";
93
  $content .= "</tr>";
94
 
95
  $content .= "<tr id='wplc_trigger_secs_row'>";
@@ -296,7 +296,7 @@ function wplc_mrg_trigger_admin_head(){
296
  if($trigger_data){
297
  if($trigger_data !== false && is_array($trigger_data)){
298
  //Got the data
299
- if(isset($trigger_data[0]->name) && $trigger_data[0]->name !== ""){ $edit_array["trigger_name"] = $trigger_data[0]->name; }
300
  if(isset($trigger_data[0]->type) && $trigger_data[0]->type !== ""){ $edit_array["trigger_type"] = intval($trigger_data[0]->type); }
301
  if(isset($trigger_data[0]->content) && $trigger_data[0]->content !== ""){ $edit_array['trigger_content'] = $trigger_data[0]->content ; }
302
  if(isset($trigger_data[0]->show_content) && intval($trigger_data[0]->show_content) == 1){ $edit_array["trigger_replace"] = 1; }
@@ -443,6 +443,8 @@ function wplc_mrg_get_trigger_table(){
443
  $results = wplc_get_all_triggers_mrg();
444
 
445
  $conflict_array = wplc_triggers_check_for_conflicts_mrg($results);
 
 
446
 
447
  if(count($conflict_array) > 0){
448
  $content .= "<div class='update-nag' style='margin-top:0px;margin-bottom:10px;padding-top:8px;padding-bottom:8px;font-size:12px;'>";
@@ -485,7 +487,7 @@ function wplc_mrg_get_trigger_table(){
485
  $content .= "<td>".trim(substr(wp_filter_post_kses($trigger_content["html"]), 0, 120))."...</td>";
486
  $content .= "<td>";
487
  $content .= "<div class='wplc_trigger_status ".($result->status == 1 ? "wplc_trigger_enabled" : "wplc_trigger_disabled")."'>";
488
- $content .= "<a href='?page=wplivechat-menu-triggers&wplc_action=trigger_status_change&trigger_id=".$result->id."&trigger_status=".($result->status == 1 ? "0" : "1")."' title='".__("Click to change trigger status", "wplivechat")."'>";
489
  $content .= __(($result->status == 1 ? "Enabled" : "Disabled"), "wplivechat");
490
  $content .= "</a>";
491
  $content .= "</div>";
@@ -504,6 +506,11 @@ function wplc_mrg_get_trigger_table(){
504
 
505
  function wplc_mrg_trigger_table_head(){
506
  if(isset($_GET['wplc_action']) && isset($_GET['trigger_id']) && isset($_GET['trigger_status'])){
 
 
 
 
 
507
  if($_GET['wplc_action'] == 'trigger_status_change'){
508
  $trigger_id = intval($_GET['trigger_id']);
509
  if(isset($trigger_id)){
@@ -601,7 +608,7 @@ function wplc_mrg_get_delete_trigger_content(){
601
  $content .= "<table class=\"wp-list-table wplc_list_table widefat fixed form-table\" cellspacing=\"0\" style='width:50%'>";
602
  $content .= "<tr>";
603
  $content .= "<td>";
604
- $content .= __("Are you sure you would like to delete trigger") . ": <strong>" . $trigger_name . "</strong>";
605
  $content .= "</td>";
606
  $content .= "</tr>";
607
  $content .= "<tr>";
@@ -620,24 +627,26 @@ function wplc_mrg_get_delete_trigger_content(){
620
 
621
  add_filter("wplc_filter_hovercard_content","wplc_filter_control_modern_theme_hovercard_content_triggers_mrg",10,1);
622
  function wplc_filter_control_modern_theme_hovercard_content_triggers_mrg($msg) {
623
- $unaltered_msg = $msg;
624
- $post_id = url_to_postid($_SERVER['HTTP_REFERER']); //User Admin-Ajax Referrer
625
- $matched_trigger = wplc_check_trigger_filters_mrg($post_id); //Find first matching trigger for page
626
- if($matched_trigger != false){
627
- $trigger_data = wplc_get_trigger_mrg($matched_trigger);
628
- if($trigger_data !== false && is_array($trigger_data)){
629
- $trigger_data = $trigger_data[0];
630
- if(intval($trigger_data->show_content) == 1){
631
- $unserialized_content = maybe_unserialize($trigger_data->content);
632
- if($unserialized_content){
633
- $msg = do_shortcode(wplc_shortcode_filter_mrg($unserialized_content['html'], true));
634
- }
635
- }
636
- }
637
- }else{
638
- $msg = $unaltered_msg;
639
- }
640
- return $msg;
 
 
641
  }
642
 
643
  function wplc_check_trigger_filters_mrg($page){
@@ -697,7 +706,7 @@ function wplc_tirggers_enqueue_user_styles_scripts($trigger_id){
697
  $localized_array["perc"] = intval($unserialized_content['perc']);
698
  }
699
 
700
- wp_localize_script("wplc_trigger_js", "wplc_trigger_data",$localized_array);
701
  }
702
  wp_enqueue_script("wplc_trigger_js");
703
  }
8
  $wplc_add_trigger_btn = isset($_GET['wplc_action']) ? "" : "<a href='?page=wplivechat-menu-triggers&wplc_action=add_trigger' class='wplc_add_new_btn'>". __("Add New", 'wp-livechat') ."</a>";
9
 
10
  $content = "<div class='wrap wplc_wrap'>";
11
+ $content .= "<h2>".__('Triggers', 'wp-livechat'). $wplc_add_trigger_btn . "</h2>";
12
 
13
  echo $content;
14
 
70
 
71
  $content .= "<tr>";
72
  $content .= "<td>".__("Trigger Name", "wplivechat").":</td>";
73
+ $content .= "<td><input type='text' name='wplc_trigger_name' value='".esc_attr($trigger_name)."'></td>";
74
  $content .= "</tr>";
75
 
76
  $content .= "<tr>";
89
 
90
  $content .= "<tr id='wplc_trigger_page_row'>";
91
  $content .= "<td>".__("Page ID", "wplivechat").":</td>";
92
+ $content .= "<td><input type='text' name='wplc_trigger_pages' value='".(isset($trigger_content["pages"]) ? esc_attr($trigger_content["pages"]) : "")."'> <i>".__("Note: Leave empty for 'all' pages", "wplivechat")."</i></td>";
93
  $content .= "</tr>";
94
 
95
  $content .= "<tr id='wplc_trigger_secs_row'>";
296
  if($trigger_data){
297
  if($trigger_data !== false && is_array($trigger_data)){
298
  //Got the data
299
+ if(isset($trigger_data[0]->name) && $trigger_data[0]->name !== ""){ $edit_array["trigger_name"] = esc_html($trigger_data[0]->name); }
300
  if(isset($trigger_data[0]->type) && $trigger_data[0]->type !== ""){ $edit_array["trigger_type"] = intval($trigger_data[0]->type); }
301
  if(isset($trigger_data[0]->content) && $trigger_data[0]->content !== ""){ $edit_array['trigger_content'] = $trigger_data[0]->content ; }
302
  if(isset($trigger_data[0]->show_content) && intval($trigger_data[0]->show_content) == 1){ $edit_array["trigger_replace"] = 1; }
443
  $results = wplc_get_all_triggers_mrg();
444
 
445
  $conflict_array = wplc_triggers_check_for_conflicts_mrg($results);
446
+
447
+ $wplc_trigger_status_nonce = wp_create_nonce('wplc_trigger_status_nonce');
448
 
449
  if(count($conflict_array) > 0){
450
  $content .= "<div class='update-nag' style='margin-top:0px;margin-bottom:10px;padding-top:8px;padding-bottom:8px;font-size:12px;'>";
487
  $content .= "<td>".trim(substr(wp_filter_post_kses($trigger_content["html"]), 0, 120))."...</td>";
488
  $content .= "<td>";
489
  $content .= "<div class='wplc_trigger_status ".($result->status == 1 ? "wplc_trigger_enabled" : "wplc_trigger_disabled")."'>";
490
+ $content .= "<a href='?page=wplivechat-menu-triggers&wplc_action=trigger_status_change&trigger_id=".$result->id."&trigger_status=".($result->status == 1 ? "0" : "1")."&wplc_trigger_status_nonce=".$wplc_trigger_status_nonce."' title='".__("Click to change trigger status", "wplivechat")."'>";
491
  $content .= __(($result->status == 1 ? "Enabled" : "Disabled"), "wplivechat");
492
  $content .= "</a>";
493
  $content .= "</div>";
506
 
507
  function wplc_mrg_trigger_table_head(){
508
  if(isset($_GET['wplc_action']) && isset($_GET['trigger_id']) && isset($_GET['trigger_status'])){
509
+
510
+ if (!isset($_GET['wplc_trigger_status_nonce']) || !wp_verify_nonce($_GET['wplc_trigger_status_nonce'], 'wplc_trigger_status_nonce')){
511
+ wp_die(__("You do not have permission do perform this action", "wplivechat"));
512
+ }
513
+
514
  if($_GET['wplc_action'] == 'trigger_status_change'){
515
  $trigger_id = intval($_GET['trigger_id']);
516
  if(isset($trigger_id)){
608
  $content .= "<table class=\"wp-list-table wplc_list_table widefat fixed form-table\" cellspacing=\"0\" style='width:50%'>";
609
  $content .= "<tr>";
610
  $content .= "<td>";
611
+ $content .= __("Are you sure you would like to delete trigger") . ": <strong>" . esc_html($trigger_name) . "</strong>";
612
  $content .= "</td>";
613
  $content .= "</tr>";
614
  $content .= "<tr>";
627
 
628
  add_filter("wplc_filter_hovercard_content","wplc_filter_control_modern_theme_hovercard_content_triggers_mrg",10,1);
629
  function wplc_filter_control_modern_theme_hovercard_content_triggers_mrg($msg) {
630
+ $unaltered_msg = $msg;
631
+ if (!empty($_SERVER['HTTP_REFERER'])) {
632
+ $post_id = url_to_postid($_SERVER['HTTP_REFERER']); //User Admin-Ajax Referrer
633
+ $matched_trigger = wplc_check_trigger_filters_mrg($post_id); //Find first matching trigger for page
634
+ if ($matched_trigger != false) {
635
+ $trigger_data = wplc_get_trigger_mrg($matched_trigger);
636
+ if ($trigger_data !== false && is_array($trigger_data)) {
637
+ $trigger_data = $trigger_data[0];
638
+ if (intval($trigger_data->show_content) == 1) {
639
+ $unserialized_content = maybe_unserialize($trigger_data->content);
640
+ if ($unserialized_content) {
641
+ $msg = do_shortcode(wplc_shortcode_filter_mrg($unserialized_content['html'], true));
642
+ }
643
+ }
644
+ }
645
+ } else {
646
+ $msg = $unaltered_msg;
647
+ }
648
+ }
649
+ return $msg;
650
  }
651
 
652
  function wplc_check_trigger_filters_mrg($page){
706
  $localized_array["perc"] = intval($unserialized_content['perc']);
707
  }
708
 
709
+ wp_localize_script("wplc_trigger_js", "wplc_trigger_data", $localized_array);
710
  }
711
  wp_enqueue_script("wplc_trigger_js");
712
  }
includes/wplc_departments.php CHANGED
@@ -55,7 +55,7 @@ function wplc_mrg_agent_list_department_span($content, $user){
55
  if($user_department){
56
  $selected_department = wplc_get_department_mrg(intval($user_department));
57
  if($selected_department){
58
- $content .= "<small style='height:30px'>" . $selected_department[0]->name . "</small>";
59
  } else {
60
  $content .= "<small style='height:30px'>" . __("No Department", "wplivechat") . "</small>";
61
  }
@@ -126,7 +126,7 @@ function wplc_mrg_department_save($user_id){
126
  */
127
  add_action("wplc_hook_menu_mid","wplc_mrg_department_menu",10,1);
128
  function wplc_mrg_department_menu($cap){
129
- add_submenu_page('wplivechat-menu', __('Departments', 'wplivechat'), __('Departments', 'edit_posts'), $cap[0], 'wplivechat-menu-departments', 'wplc_mrg_departments_page');
130
  }
131
 
132
  /**
@@ -142,7 +142,7 @@ function wplc_mrg_departments_page(){
142
  $wplc_department_settings_btn = "<a href='?page=wplivechat-menu-settings#tabs-departments' class='wplc_add_new_btn'>". __("Department Settings", 'wp-livechat') ."</a>";
143
 
144
  $content = "<div class='wrap wplc_wrap'>";
145
- $content .= "<h2>".__('WP Live Chat Support Departments', 'wp-livechat')." (beta) " . $wplc_add_department_btn . " " . $wplc_department_settings_btn . "</h2>";
146
 
147
  if(isset($_GET['wplc_action']) && ($_GET['wplc_action'] == "add_department" || $_GET['wplc_action'] == "edit_department")){
148
  $content .= wplc_mrg_get_add_department_content();
@@ -186,7 +186,7 @@ function wplc_mrg_get_departments_table(){
186
 
187
  $content .= "<tr>";
188
  $content .= "<td>".$result->id."</td>";
189
- $content .= "<td>".$result->name."</td>";
190
  $content .= "<td>".$department_actions."</td>";
191
  $content .= "</tr>";
192
 
@@ -339,7 +339,7 @@ function wplc_mrg_department_admin_head(){
339
  if($data){
340
  if($data !== false && is_array($data)){
341
  //Got the data
342
- if(isset($data[0]->name) && $data[0]->name !== ""){ $edit_array["wplc_department_name"] = $data[0]->name; }
343
  }
344
  } else{
345
  $edit_array["errors"][count($edit_array["errors"]) >= 1 ? count($edit_array["errors"]) : 0] = "Department ID not found";
@@ -383,8 +383,6 @@ function wplc_add_department_mrg($data){
383
  global $wpdb;
384
  global $wplc_tblname_chat_departments;
385
  if($data){
386
- $data_name;
387
-
388
  //Validation - 1
389
  if($data['wplc_department_name'] != ""){ $data_name = $data['wplc_department_name']; } else { return false; }
390
 
@@ -411,7 +409,6 @@ function wplc_edit_department_mrg($data, $id){
411
  global $wpdb;
412
  global $wplc_tblname_chat_departments;
413
  if($data){
414
- $department_name;
415
 
416
  //Validation - 1
417
  if($data['wplc_department_name'] != ""){ $department_name = $data['wplc_department_name']; } else { return false; }
@@ -487,7 +484,6 @@ function wplc_mrg_delete_department_content(){
487
  return $content;
488
  }
489
 
490
-
491
  /**
492
  * Removes a Department
493
  *
@@ -503,6 +499,12 @@ function wplc_delete_department_mrg($id){
503
  if ($wpdb->last_error) {
504
  return false;
505
  } else {
 
 
 
 
 
 
506
  return true;
507
  }
508
  }
@@ -529,10 +531,8 @@ add_action("wplc_hook_settings_page_more_tabs","wplc_mrg_department_settings_tab
529
  * @return string (html)
530
  */
531
  function wplc_mrg_department_settings_tab_content() {
532
- $wplc_settings = get_option("WPLC_SETTINGS");
533
- $selected_department = isset($wplc_settings['wplc_default_department']) ? $wplc_settings['wplc_default_department'] : -1;
534
-
535
- $allow_department_selection = isset($wplc_settings['wplc_allow_department_selection']) ? intval($wplc_settings['wplc_allow_department_selection']) : 0;
536
  ?>
537
  <div id="tabs-departments">
538
  <h3><?php _e("Departments", "wplivechat") ?></h3>
@@ -551,7 +551,7 @@ function wplc_mrg_department_settings_tab_content() {
551
  if($departments){
552
  foreach($departments as $dep){
553
  ?>
554
- <option value="<?php echo $dep->id;?>" <?php echo ($selected_department === intval($dep->id) ? "SELECTED" : "" ); ?> ><?php echo sanitize_text_field($dep->name); ?></option>
555
  <?php
556
  }
557
  }
@@ -566,7 +566,7 @@ function wplc_mrg_department_settings_tab_content() {
566
  <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Allow user to select a department before starting a chat?", "wplivechat"); ?>"></i>
567
  </td>
568
  <td>
569
- <input type="checkbox" name="wplc_allow_department_selection" id="wplc_allow_department_selection" value="1" <?php echo($allow_department_selection == 1 ? "CHECKED" : "") ?> />
570
  </td>
571
  </tr>
572
 
@@ -583,7 +583,7 @@ function wplc_mrg_department_settings_tab_content() {
583
 
584
  </tbody>
585
  </table>
586
- <p><?php echo sprintf(__("Create departments <a href='%s'>here</a>."),admin_url('admin.php?page=wplivechat-menu-departments')); ?></p>
587
  <br>
588
 
589
  <?php do_action("wplc_pro_departments_settings_below_table_hook"); ?>
@@ -594,19 +594,6 @@ function wplc_mrg_department_settings_tab_content() {
594
 
595
  }
596
 
597
- add_filter("wplc_pro_setting_save_filter", "wplc_mrg_department_settings_save", 10, 1);
598
- /**
599
- * Handles saving Department settings
600
- *
601
- * @param array $settings (Pro Settings)
602
- * @return array (Pro Settings array)
603
- */
604
- function wplc_mrg_department_settings_save($settings){
605
- if (isset($_POST['wplc_default_department'])) { $settings['wplc_default_department'] = intval($_POST['wplc_default_department']); } else { $settings['wplc_default_department'] = -1; }
606
- if (isset($_POST['wplc_allow_department_selection'])) { $settings['wplc_allow_department_selection'] = intval($_POST['wplc_allow_department_selection']); } else { $settings['wplc_allow_department_selection'] = 0; }
607
-
608
- return $settings;
609
- }
610
 
611
  add_filter("wplc_alter_chat_list_sql_before_sorting", "wplc_mrg_add_department_sql", 10, 1);
612
  /**
@@ -619,10 +606,10 @@ function wplc_mrg_add_department_sql($content){
619
  $user_id = get_current_user_id();
620
  $user_department = get_user_meta($user_id ,"wplc_user_department", true);
621
  if($user_department && $user_department !== "" && $user_department !== "-1" && $user_department !== -1){
622
- $content .= " AND (`department_id` = '" . intval($user_department) . "') ";
623
  } else {
624
  if(isset($_POST['wplc_department_view'])){
625
- $content .= " AND (`department_id` = '" . intval($_POST['wplc_department_view']) . "') ";
626
  }
627
  }
628
 
@@ -642,7 +629,7 @@ function wplc_user_department_label_mrg(){
642
  if($user_department !== "-1"){
643
  $selected_department = wplc_get_department_mrg(intval($user_department));
644
  if($selected_department){
645
- echo "<span class='wplc_dashboard_additional_label' title='" . __("Department you have been assigned to as an agent", "wplivechat") . "'><strong>".__("Department", "wplivechat").":</strong> " . $selected_department[0]->name . "</span>";
646
  }
647
  } else {
648
  wplc_dashboard_department_selector_mrg();
@@ -662,14 +649,14 @@ function wplc_dashboard_department_selector_mrg(){
662
  $departments = wplc_get_all_deparments_mrg();
663
  $current_selection = isset($_GET['wplc_department_view']) ? $_GET['wplc_department_view'] : -1;
664
  if($departments){
665
- $content .= "<select style='max-width:60%; margin-left:auto; margin-right:auto;' class='wplc_dashboard_additional_label' id='wplc_dashboard_department_selector'>";
666
  $content .= "<option value='0' >" . __("No Department", "wplivechat") . "</option>";
667
  foreach($departments as $dep){
668
  // $content .= "<option value='" . $dep->id ."' " . (intval($default_department) === intval($dep->id) ? "SELECTED" : ""). ">" . $dep->name . "</option>";
669
  $content .= "<option value='" . $dep->id ."' ". (intval($current_selection) === intval($dep->id) ? "SELECTED" : ""). ">" . sanitize_text_field($dep->name) . "</option>";
670
 
671
  }
672
- $content .= "</select>";
673
  }
674
 
675
  echo $content;
@@ -725,7 +712,7 @@ add_filter("wplc_log_user_on_page_insert_filter", "wplc_log_user_default_departm
725
  * @return array
726
  */
727
  function wplc_log_user_default_department_mrg($insert_data){
728
- $wplc_settings = get_option("WPLC_SETTINGS");
729
  $selected_department = isset($wplc_settings['wplc_default_department']) ? $wplc_settings['wplc_default_department'] : -1;
730
  if($selected_department && $selected_department !== -1){
731
  //Set the default department
@@ -741,18 +728,17 @@ add_filter("wplc_start_chat_user_form_after_filter", "wplc_allow_department_sele
741
  * @param string $content
742
  * @return string
743
  */
744
- function wplc_allow_department_selection_user_form_mrg($content){
745
- $wplc_settings = get_option("WPLC_SETTINGS");
746
- $allow_department_selection = isset($wplc_settings['wplc_allow_department_selection']) ? intval($wplc_settings['wplc_allow_department_selection']) : 0;
747
- $default_department = isset($wplc_settings['wplc_default_department']) ? $wplc_settings['wplc_default_department'] : -1;
748
 
749
- if($allow_department_selection && $allow_department_selection !== 0){
750
  $departments = wplc_get_all_deparments_mrg();
751
- if($departments){
752
  $content .= "<select id='wplc_user_selected_department'>";
753
  $content .= "<option value='0' >" . __("Select Department", "wplivechat") . "</option>";
754
  foreach($departments as $dep){
755
- $content .= "<option value='" . $dep->id ."' " . (intval($default_department) === intval($dep->id) ? "SELECTED" : ""). ">" . $dep->name . "</option>";
756
  }
757
  $content .= "</select>";
758
  }
55
  if($user_department){
56
  $selected_department = wplc_get_department_mrg(intval($user_department));
57
  if($selected_department){
58
+ $content .= "<small style='height:30px'>" . esc_html($selected_department[0]->name) . "</small>";
59
  } else {
60
  $content .= "<small style='height:30px'>" . __("No Department", "wplivechat") . "</small>";
61
  }
126
  */
127
  add_action("wplc_hook_menu_mid","wplc_mrg_department_menu",10,1);
128
  function wplc_mrg_department_menu($cap){
129
+ add_submenu_page('wplivechat-menu', __('Departments', 'wplivechat'), __('Departments', 'edit_posts').' ('.__('beta').')', $cap[1], 'wplivechat-menu-departments', 'wplc_mrg_departments_page');
130
  }
131
 
132
  /**
142
  $wplc_department_settings_btn = "<a href='?page=wplivechat-menu-settings#tabs-departments' class='wplc_add_new_btn'>". __("Department Settings", 'wp-livechat') ."</a>";
143
 
144
  $content = "<div class='wrap wplc_wrap'>";
145
+ $content .= "<h2>".__('Departments', 'wp-livechat'). $wplc_add_department_btn . " " . $wplc_department_settings_btn . "</h2>";
146
 
147
  if(isset($_GET['wplc_action']) && ($_GET['wplc_action'] == "add_department" || $_GET['wplc_action'] == "edit_department")){
148
  $content .= wplc_mrg_get_add_department_content();
186
 
187
  $content .= "<tr>";
188
  $content .= "<td>".$result->id."</td>";
189
+ $content .= "<td>".esc_html($result->name)."</td>";
190
  $content .= "<td>".$department_actions."</td>";
191
  $content .= "</tr>";
192
 
339
  if($data){
340
  if($data !== false && is_array($data)){
341
  //Got the data
342
+ if(isset($data[0]->name) && $data[0]->name !== ""){ $edit_array["wplc_department_name"] = esc_html($data[0]->name); }
343
  }
344
  } else{
345
  $edit_array["errors"][count($edit_array["errors"]) >= 1 ? count($edit_array["errors"]) : 0] = "Department ID not found";
383
  global $wpdb;
384
  global $wplc_tblname_chat_departments;
385
  if($data){
 
 
386
  //Validation - 1
387
  if($data['wplc_department_name'] != ""){ $data_name = $data['wplc_department_name']; } else { return false; }
388
 
409
  global $wpdb;
410
  global $wplc_tblname_chat_departments;
411
  if($data){
 
412
 
413
  //Validation - 1
414
  if($data['wplc_department_name'] != ""){ $department_name = $data['wplc_department_name']; } else { return false; }
484
  return $content;
485
  }
486
 
 
487
  /**
488
  * Removes a Department
489
  *
499
  if ($wpdb->last_error) {
500
  return false;
501
  } else {
502
+ $users = get_users(array('meta_key' => 'wplc_user_department', 'meta_value' => $id));
503
+ if($users){
504
+ foreach($users as $user) {
505
+ delete_user_meta( $user->ID, 'wplc_user_department' );
506
+ }
507
+ }
508
  return true;
509
  }
510
  }
531
  * @return string (html)
532
  */
533
  function wplc_mrg_department_settings_tab_content() {
534
+ $wplc_settings = wplc_get_options();
535
+ $selected_department = intval($wplc_settings['wplc_default_department']);
 
 
536
  ?>
537
  <div id="tabs-departments">
538
  <h3><?php _e("Departments", "wplivechat") ?></h3>
551
  if($departments){
552
  foreach($departments as $dep){
553
  ?>
554
+ <option value="<?php echo $dep->id;?>" <?php echo ($selected_department == intval($dep->id) ? "SELECTED" : "" ); ?> ><?php echo sanitize_text_field($dep->name); ?></option>
555
  <?php
556
  }
557
  }
566
  <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Allow user to select a department before starting a chat?", "wplivechat"); ?>"></i>
567
  </td>
568
  <td>
569
+ <input type="checkbox" name="wplc_allow_department_selection" id="wplc_allow_department_selection" value="1" <?php echo(boolval($wplc_settings['wplc_allow_department_selection']) ? "CHECKED" : "") ?> />
570
  </td>
571
  </tr>
572
 
583
 
584
  </tbody>
585
  </table>
586
+ <p><?php echo sprintf(__("Create departments %s.",'wplivechat'),'<a href="'.admin_url('admin.php?page=wplivechat-menu-departments').'">'.__('here','wplivechat').'</a>'); ?></p>
587
  <br>
588
 
589
  <?php do_action("wplc_pro_departments_settings_below_table_hook"); ?>
594
 
595
  }
596
 
 
 
 
 
 
 
 
 
 
 
 
 
 
597
 
598
  add_filter("wplc_alter_chat_list_sql_before_sorting", "wplc_mrg_add_department_sql", 10, 1);
599
  /**
606
  $user_id = get_current_user_id();
607
  $user_department = get_user_meta($user_id ,"wplc_user_department", true);
608
  if($user_department && $user_department !== "" && $user_department !== "-1" && $user_department !== -1){
609
+ $content .= " AND (`department_id` = '" . intval($user_department) . "' || `department_id` = 0) ";
610
  } else {
611
  if(isset($_POST['wplc_department_view'])){
612
+ $content .= " AND (`department_id` = '" . intval($_POST['wplc_department_view']) . "' || `department_id` = 0) ";
613
  }
614
  }
615
 
629
  if($user_department !== "-1"){
630
  $selected_department = wplc_get_department_mrg(intval($user_department));
631
  if($selected_department){
632
+ echo "<span class='wplc_dashboard_additional_label' title='" . __("Department you have been assigned to as an agent", "wplivechat") . "'><strong>".__("Department", "wplivechat").":</strong> " . esc_html($selected_department[0]->name) . "</span>";
633
  }
634
  } else {
635
  wplc_dashboard_department_selector_mrg();
649
  $departments = wplc_get_all_deparments_mrg();
650
  $current_selection = isset($_GET['wplc_department_view']) ? $_GET['wplc_department_view'] : -1;
651
  if($departments){
652
+ $content .= "<span class=\"wplc_dashboard_department_selector_outer\"><select id='wplc_dashboard_department_selector'>";
653
  $content .= "<option value='0' >" . __("No Department", "wplivechat") . "</option>";
654
  foreach($departments as $dep){
655
  // $content .= "<option value='" . $dep->id ."' " . (intval($default_department) === intval($dep->id) ? "SELECTED" : ""). ">" . $dep->name . "</option>";
656
  $content .= "<option value='" . $dep->id ."' ". (intval($current_selection) === intval($dep->id) ? "SELECTED" : ""). ">" . sanitize_text_field($dep->name) . "</option>";
657
 
658
  }
659
+ $content .= "</select></span>";
660
  }
661
 
662
  echo $content;
712
  * @return array
713
  */
714
  function wplc_log_user_default_department_mrg($insert_data){
715
+ $wplc_settings = wplc_get_options();
716
  $selected_department = isset($wplc_settings['wplc_default_department']) ? $wplc_settings['wplc_default_department'] : -1;
717
  if($selected_department && $selected_department !== -1){
718
  //Set the default department
728
  * @param string $content
729
  * @return string
730
  */
731
+ function wplc_allow_department_selection_user_form_mrg($content) {
732
+ $wplc_settings = wplc_get_options();
733
+ $default_department = intval($wplc_settings['wplc_default_department']);
 
734
 
735
+ if ($wplc_settings['wplc_allow_department_selection'] && $default_department>=0) {
736
  $departments = wplc_get_all_deparments_mrg();
737
+ if ($departments) {
738
  $content .= "<select id='wplc_user_selected_department'>";
739
  $content .= "<option value='0' >" . __("Select Department", "wplivechat") . "</option>";
740
  foreach($departments as $dep){
741
+ $content .= "<option value='" . $dep->id ."' " . ($default_department == intval($dep->id) ? "SELECTED" : ""). ">" . esc_html($dep->name) . "</option>";
742
  }
743
  $content .= "</select>";
744
  }
includes/wplc_roi.php CHANGED
@@ -16,8 +16,9 @@ $wplc_tblname_chat_roi_conversions = $wpdb->prefix . "wplc_roi_conversions";
16
 
17
  /*
18
  * Hooks into 'wp_print_footer_scripts' to check if the a goal is present
 
19
  */
20
- add_action("wp_print_footer_scripts", "wplc_mrg_roi_goals_page_check", 10);
21
  function wplc_mrg_roi_goals_page_check(){
22
  $post_id = url_to_postid($_SERVER['REQUEST_URI']);
23
  $goal_id = wplc_mrg_roi_check_page_id($post_id);
@@ -36,6 +37,27 @@ function wplc_mrg_roi_goals_page_check(){
36
  }
37
  }
38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  /*
40
  * Updates/Creates the required tables in order to use roi in WPLC
41
  */
@@ -72,9 +94,14 @@ function wplc_mrg_update_db_roi(){
72
  /*
73
  * Adds a menu item to WPLC for the roi Goal Area
74
  */
 
75
  add_action("wplc_hook_menu_mid","wplc_mrg_roi_menu",10,1);
76
  function wplc_mrg_roi_menu($cap){
77
- add_submenu_page('wplivechat-menu', __('ROI Goals', 'wplivechat'), __('ROI Goals', 'edit_posts'), $cap[0], 'wplivechat-menu-roi-goals', 'wplc_mrg_roi_goals_page');
 
 
 
 
78
  }
79
 
80
  /*
@@ -89,7 +116,7 @@ function wplc_mrg_roi_goals_page(){
89
  $wplc_view_reports_btn = isset($_GET['wplc_action']) ? "" : "<a href='?page=wplivechat-menu-reporting#rio_reports' class='wplc_add_new_btn'>". __("View Reports", 'wp-livechat') ."</a>";
90
 
91
  $content = "<div class='wrap wplc_wrap'>";
92
- $content .= "<h2>".__('WP Live Chat Support ROI Goals', 'wp-livechat')." (beta) " . $wplc_add_goal_btn . " " . $wplc_view_reports_btn . "</h2>";
93
 
94
  if(isset($_GET['wplc_action']) && ($_GET['wplc_action'] == "add_goal" || $_GET['wplc_action'] == "edit_goal")){
95
  $content .= wplc_mrg_get_add_goal_content();
@@ -146,7 +173,7 @@ function wplc_mrg_get_roi_goals_table(){
146
 
147
  $content .= "<tr>";
148
  $content .= "<td>".$result->id."</td>";
149
- $content .= "<td>".$result->name."</td>";
150
  $content .= "<td>".trim(substr(sanitize_text_field($result->overview), 0, 120))."</td>";
151
  $content .= "<td>".(sanitize_text_field($result->pages) == "" ? __("None", "wp-livechat") : sanitize_text_field($result->pages))."</td>";
152
  $content .= "<td>".$result->amount."</td>";
@@ -207,19 +234,19 @@ function wplc_mrg_get_add_goal_content(){
207
 
208
  $pages_on_site = wplc_mrg_goal_dropdown_selector("wplc_goal_page", intval($goal_page));
209
 
210
- $wplc_submit_label = (isset($_GET['wplc_action']) && $_GET['wplc_action'] !== "edit_goal" ? "Create Goal" : "Edit Goal"); //Default
211
 
212
  $content .= "<form method='POST'>";
213
  $content .= "<table class=\"wp-list-table wplc_list_table widefat fixed form-table\" cellspacing=\"0\" style='width:50%'>";
214
 
215
  $content .= "<tr>";
216
  $content .= "<td>".__("Goal Name", "wp-livechat").":</td>";
217
- $content .= "<td><input type='text' name='wplc_goal_name' value='$goal_name'></td>";
218
  $content .= "</tr>";
219
 
220
  $content .= "<tr>";
221
  $content .= "<td>".__("Goal Overview", "wp-livechat").":</td>";
222
- $content .= "<td><input type='text' name='wplc_goal_overview' value='$goal_overview'></td>";
223
  $content .= "</tr>";
224
 
225
  $content .= "<tr>";
@@ -233,12 +260,12 @@ function wplc_mrg_get_add_goal_content(){
233
 
234
  $content .= "<tr>";
235
  $content .= "<td>".__("Goal Value", "wp-livechat").":</td>";
236
- $content .= "<td><input type='text' name='wplc_goal_value' value='$goal_value'></td>";
237
  $content .= "</tr>";
238
 
239
  $content .= "<tr>";
240
  $content .= "<td></td>";
241
- $content .= "<td><input class='button button-primary' type='submit' name='wplc_goal_submit' value='".__($wplc_submit_label, "wp-livechat")."'> <a href='".admin_url()."admin.php?page=wplivechat-menu-roi-goals"."' class='button'>".__("Close", "wp-livechat")."</a></td>";
242
  $content .= "</tr>";
243
 
244
  $content .= "</table>";
@@ -306,7 +333,7 @@ function wplc_mrg_goal_dropdown_selector($name, $selected_value){
306
  $output = "<select name='" . sanitize_text_field( $r['name'] ) . "'" . $class . " id='" . sanitize_text_field( $r['id'] ) . "' value=".intval($selected_value).">\n";
307
 
308
  foreach ($posts_pages as $key => $value) {
309
- $output .= "\t<option value='".$value->ID."' ".(intval($value->ID) === intval($selected_value) ? "selected" : "").">" . $value->ID . " - " . $value->post_title . "</option>\n";
310
  }
311
 
312
  $output .= "</select>\n";
@@ -385,7 +412,6 @@ function wplc_mrg_goal_admin_head(){
385
  //All good continue
386
  if(isset($_GET['goal_id'])){
387
  if(wplc_edit_goal_mrg($return_array, intval($_GET['goal_id']))){
388
- //Show edit message
389
  $edit_array['success'] = "<div>".__("Goal has been edited.", "wp-livechat")."</div>";
390
  }
391
  } else {
@@ -443,10 +469,10 @@ function wplc_add_goal_mrg($goal_data){
443
  global $wpdb;
444
  global $wplc_tblname_chat_roi_goals;
445
  if($goal_data){
446
- $goal_name;
447
- $goal_overview;
448
- $goal_page;
449
- $goal_value;
450
 
451
  //Validation - 1
452
  if($goal_data['wplc_goal_name'] != ""){ $goal_name = $goal_data['wplc_goal_name']; } else { return false; }
@@ -476,10 +502,10 @@ function wplc_edit_goal_mrg($goal_data, $goal_id){
476
  global $wpdb;
477
  global $wplc_tblname_chat_roi_goals;
478
  if($goal_data){
479
- $goal_name;
480
- $goal_overview;
481
- $goal_page;
482
- $goal_value;
483
 
484
  //Validation - 1
485
  if($goal_data['wplc_goal_name'] != ""){ $goal_name = $goal_data['wplc_goal_name']; } else { return false; }
@@ -557,7 +583,7 @@ function wplc_mrg_delete_goal_content(){
557
  $content .= "<table class=\"wp-list-table wplc_list_table widefat fixed form-table\" cellspacing=\"0\" style='width:50%'>";
558
  $content .= "<tr>";
559
  $content .= "<td>";
560
- $content .= __("Are you sure you would like to delete goal") . ": <strong>" . $goal_name . "</strong>";
561
  $content .= "</td>";
562
  $content .= "</tr>";
563
  $content .= "<tr>";
@@ -605,7 +631,8 @@ function wplc_mrg_roi_conversion($cid, $goal_id){
605
  $cid = intval($cid);
606
  $goal_id = intval($goal_id);
607
 
608
- $sql = "INSERT INTO $wplc_tblname_chat_roi_conversions SET `goal_id` = '%d', `chat_id` = '%d', `timestamp` = '%s' LIMIT 1";
 
609
  $sql = $wpdb->prepare($sql, $goal_id, $cid, date("Y-m-d H:i:s"));
610
  $wpdb->query($sql);
611
  if ($wpdb->last_error) {
@@ -626,7 +653,7 @@ function wplc_mrg_roi_safe_to_add($cid){
626
 
627
  $cid = intval($cid);
628
 
629
- $sql = "SELECT * FROM $wplc_tblname_chat_roi_conversions WHERE `chat_id` = '%d'";
630
  $sql = $wpdb->prepare($sql, $cid);
631
  $results = $wpdb->get_results($sql);
632
  if($wpdb->num_rows){
@@ -641,7 +668,10 @@ function wplc_mrg_roi_safe_to_add($cid){
641
  */
642
  add_filter('wplc_reporting_tabs', 'wplc_reporting_tabs_roi_reporting_tab_mrg', 10, 1);
643
  function wplc_reporting_tabs_roi_reporting_tab_mrg($tabs_array){
644
- $tabs_array['rio_reports'] = __("ROI Reporting", "wp-livechat");
 
 
 
645
  return $tabs_array;
646
  }
647
 
@@ -650,6 +680,10 @@ function wplc_reporting_tabs_roi_reporting_tab_mrg($tabs_array){
650
  */
651
  add_filter('wplc_reporting_tab_content', 'wplc_reporting_tabs_roi_reporting_content_mrg', 10, 1);
652
  function wplc_reporting_tabs_roi_reporting_content_mrg($tabs_array){
 
 
 
 
653
  wplc_enqueue_admin_styles_mrg();
654
 
655
  wp_register_script('wplc_roi_reporting_js', plugins_url('js/wplc_admin_roi_reporting.js', __FILE__), array('jquery'));
@@ -663,7 +697,7 @@ function wplc_reporting_tabs_roi_reporting_content_mrg($tabs_array){
663
  if($goals){
664
  $count = 0;
665
  foreach ($goals as $goal) {
666
- $content .= "<div class='wplc_roi_report_list_item' id='wplc_roi_report_list_item_".$count."' goal='".$goal->id."'>".$goal->name."</div>";
667
  $count ++;
668
  }
669
  } else{
@@ -721,7 +755,7 @@ function wplc_get_goal_stats_mrg($goal_id, $term){
721
 
722
  $content = "";
723
  if($goal_info){
724
- $content .= "<h3>" . $goal_info[0]->name . "</h3>";
725
 
726
  $content .= "<hr>";
727
 
16
 
17
  /*
18
  * Hooks into 'wp_print_footer_scripts' to check if the a goal is present
19
+ * Replaced by log hook seen below
20
  */
21
+ // add_action("wp_print_footer_scripts", "wplc_mrg_roi_goals_page_check", 10);
22
  function wplc_mrg_roi_goals_page_check(){
23
  $post_id = url_to_postid($_SERVER['REQUEST_URI']);
24
  $goal_id = wplc_mrg_roi_check_page_id($post_id);
37
  }
38
  }
39
 
40
+ /**
41
+ * New hook for the ROI logging
42
+ */
43
+ add_action('wplc_log_roi_conversion', 'wplc_mrg_roi_goal_log_conversion', 10, 2);
44
+ function wplc_mrg_roi_goal_log_conversion($cid, $page_url){
45
+ $post_id = url_to_postid($page_url);
46
+ $goal_id = wplc_mrg_roi_check_page_id($post_id);
47
+ if($goal_id){
48
+ if(!filter_var($cid, FILTER_VALIDATE_INT) ) {
49
+ /* We need to identify if this CID is a node CID, and if so, return the WP CID */
50
+ $cid = wplc_return_chat_id_by_rel($cid);
51
+ }
52
+
53
+ $cid = intval($cid);
54
+ $goal_id = intval($goal_id);
55
+ if(wplc_mrg_roi_conversion($cid, $goal_id)){
56
+ //Added
57
+ }
58
+ }
59
+ }
60
+
61
  /*
62
  * Updates/Creates the required tables in order to use roi in WPLC
63
  */
94
  /*
95
  * Adds a menu item to WPLC for the roi Goal Area
96
  */
97
+
98
  add_action("wplc_hook_menu_mid","wplc_mrg_roi_menu",10,1);
99
  function wplc_mrg_roi_menu($cap){
100
+ $wplc_settings = wplc_get_options();
101
+ if ($wplc_settings['wplc_use_node_server']) {
102
+ return;
103
+ }
104
+ add_submenu_page('wplivechat-menu', __('ROI Goals', 'wplivechat'), __('ROI Goals', 'edit_posts'), $cap[1], 'wplivechat-menu-roi-goals', 'wplc_mrg_roi_goals_page');
105
  }
106
 
107
  /*
116
  $wplc_view_reports_btn = isset($_GET['wplc_action']) ? "" : "<a href='?page=wplivechat-menu-reporting#rio_reports' class='wplc_add_new_btn'>". __("View Reports", 'wp-livechat') ."</a>";
117
 
118
  $content = "<div class='wrap wplc_wrap'>";
119
+ $content .= "<h2>".__('ROI Goals', 'wp-livechat') . $wplc_add_goal_btn . " " . $wplc_view_reports_btn . "</h2>";
120
 
121
  if(isset($_GET['wplc_action']) && ($_GET['wplc_action'] == "add_goal" || $_GET['wplc_action'] == "edit_goal")){
122
  $content .= wplc_mrg_get_add_goal_content();
173
 
174
  $content .= "<tr>";
175
  $content .= "<td>".$result->id."</td>";
176
+ $content .= "<td>".esc_html($result->name)."</td>";
177
  $content .= "<td>".trim(substr(sanitize_text_field($result->overview), 0, 120))."</td>";
178
  $content .= "<td>".(sanitize_text_field($result->pages) == "" ? __("None", "wp-livechat") : sanitize_text_field($result->pages))."</td>";
179
  $content .= "<td>".$result->amount."</td>";
234
 
235
  $pages_on_site = wplc_mrg_goal_dropdown_selector("wplc_goal_page", intval($goal_page));
236
 
237
+ $wplc_submit_label = (isset($_GET['wplc_action']) && $_GET['wplc_action'] !== "edit_goal" ? "Create Goal" : "Update Goal"); //Default
238
 
239
  $content .= "<form method='POST'>";
240
  $content .= "<table class=\"wp-list-table wplc_list_table widefat fixed form-table\" cellspacing=\"0\" style='width:50%'>";
241
 
242
  $content .= "<tr>";
243
  $content .= "<td>".__("Goal Name", "wp-livechat").":</td>";
244
+ $content .= "<td><input type='text' name='wplc_goal_name' value='".esc_attr($goal_name)."'></td>";
245
  $content .= "</tr>";
246
 
247
  $content .= "<tr>";
248
  $content .= "<td>".__("Goal Overview", "wp-livechat").":</td>";
249
+ $content .= "<td><input type='text' name='wplc_goal_overview' value='".esc_attr($goal_overview)."'></td>";
250
  $content .= "</tr>";
251
 
252
  $content .= "<tr>";
260
 
261
  $content .= "<tr>";
262
  $content .= "<td>".__("Goal Value", "wp-livechat").":</td>";
263
+ $content .= "<td><input type='text' name='wplc_goal_value' value='".esc_attr($goal_value)."'></td>";
264
  $content .= "</tr>";
265
 
266
  $content .= "<tr>";
267
  $content .= "<td></td>";
268
+ $content .= "<td><input class='button button-primary' type='submit' name='wplc_goal_submit' value='".__($wplc_submit_label, "wp-livechat")."'> <a href='".admin_url()."admin.php?page=wplivechat-menu-roi-goals"."' class='button'>".__("Cancel", "wp-livechat")."</a></td>";
269
  $content .= "</tr>";
270
 
271
  $content .= "</table>";
333
  $output = "<select name='" . sanitize_text_field( $r['name'] ) . "'" . $class . " id='" . sanitize_text_field( $r['id'] ) . "' value=".intval($selected_value).">\n";
334
 
335
  foreach ($posts_pages as $key => $value) {
336
+ $output .= "\t<option value='".$value->ID."' ".(intval($value->ID) === intval($selected_value) ? "selected" : "").">" . $value->ID . " - " . esc_html($value->post_title) . "</option>\n";
337
  }
338
 
339
  $output .= "</select>\n";
412
  //All good continue
413
  if(isset($_GET['goal_id'])){
414
  if(wplc_edit_goal_mrg($return_array, intval($_GET['goal_id']))){
 
415
  $edit_array['success'] = "<div>".__("Goal has been edited.", "wp-livechat")."</div>";
416
  }
417
  } else {
469
  global $wpdb;
470
  global $wplc_tblname_chat_roi_goals;
471
  if($goal_data){
472
+ $goal_name = '';
473
+ $goal_overview = '';
474
+ $goal_page = '';
475
+ $goal_value = '';
476
 
477
  //Validation - 1
478
  if($goal_data['wplc_goal_name'] != ""){ $goal_name = $goal_data['wplc_goal_name']; } else { return false; }
502
  global $wpdb;
503
  global $wplc_tblname_chat_roi_goals;
504
  if($goal_data){
505
+ $goal_name = '';
506
+ $goal_overview = '';
507
+ $goal_page = 0;
508
+ $goal_value = 0;
509
 
510
  //Validation - 1
511
  if($goal_data['wplc_goal_name'] != ""){ $goal_name = $goal_data['wplc_goal_name']; } else { return false; }
583
  $content .= "<table class=\"wp-list-table wplc_list_table widefat fixed form-table\" cellspacing=\"0\" style='width:50%'>";
584
  $content .= "<tr>";
585
  $content .= "<td>";
586
+ $content .= __("Are you sure you would like to delete goal") . ": <strong>" . esc_html($goal_name) . "</strong>";
587
  $content .= "</td>";
588
  $content .= "</tr>";
589
  $content .= "<tr>";
631
  $cid = intval($cid);
632
  $goal_id = intval($goal_id);
633
 
634
+ $sql = "INSERT INTO $wplc_tblname_chat_roi_conversions SET `goal_id` = %d, `chat_id` = %d, `timestamp` = '%s'";
635
+
636
  $sql = $wpdb->prepare($sql, $goal_id, $cid, date("Y-m-d H:i:s"));
637
  $wpdb->query($sql);
638
  if ($wpdb->last_error) {
653
 
654
  $cid = intval($cid);
655
 
656
+ $sql = "SELECT * FROM $wplc_tblname_chat_roi_conversions WHERE `chat_id` = %d";
657
  $sql = $wpdb->prepare($sql, $cid);
658
  $results = $wpdb->get_results($sql);
659
  if($wpdb->num_rows){
668
  */
669
  add_filter('wplc_reporting_tabs', 'wplc_reporting_tabs_roi_reporting_tab_mrg', 10, 1);
670
  function wplc_reporting_tabs_roi_reporting_tab_mrg($tabs_array){
671
+ $wplc_settings = wplc_get_options();
672
+ if (!$wplc_settings['wplc_use_node_server']) { // disable for chat server
673
+ $tabs_array['rio_reports'] = __("ROI Reports", "wp-livechat");
674
+ }
675
  return $tabs_array;
676
  }
677
 
680
  */
681
  add_filter('wplc_reporting_tab_content', 'wplc_reporting_tabs_roi_reporting_content_mrg', 10, 1);
682
  function wplc_reporting_tabs_roi_reporting_content_mrg($tabs_array){
683
+ $wplc_settings = wplc_get_options();
684
+ if ($wplc_settings['wplc_use_node_server']) { // disable for chat server
685
+ return $tabs_array;
686
+ }
687
  wplc_enqueue_admin_styles_mrg();
688
 
689
  wp_register_script('wplc_roi_reporting_js', plugins_url('js/wplc_admin_roi_reporting.js', __FILE__), array('jquery'));
697
  if($goals){
698
  $count = 0;
699
  foreach ($goals as $goal) {
700
+ $content .= "<div class='wplc_roi_report_list_item' id='wplc_roi_report_list_item_".$count."' goal='".$goal->id."'>".esc_html($goal->name)."</div>";
701
  $count ++;
702
  }
703
  } else{
755
 
756
  $content = "";
757
  if($goal_info){
758
+ $content .= "<h3>" . esc_html($goal_info[0]->name) . "</h3>";
759
 
760
  $content .= "<hr>";
761
 
includes/wplc_transfer_chats.php CHANGED
@@ -441,72 +441,66 @@ add_action("wplc_hook_chat_notification","wplc_filter_control_chat_notification_
441
  * @return string
442
  */
443
  function wplc_filter_control_chat_notification_department_transfer_mrg($type,$cid,$data) {
444
- if ($type == "transfer") {
445
- global $wpdb;
446
- global $wplc_tblname_msgs;
447
-
448
-
449
- $user_info = get_userdata(intval($data['aid']));
450
- if( $user_info ){
451
- $agent = $user_info->display_name;
452
- } else {
453
- $agent = "";
454
- }
455
-
456
- if(isset($data["auto_transfer"]) && $data["auto_transfer"] == true){
457
-
458
- if(intval($data['aid']) === 0){
459
- //Came from a department originally
460
- $msg = __("Department took too long to respond, we are transferring this chat to the next available agent.","wplivechat");
461
- } else {
462
- $msg = $agent . " " . __("took too long to respond, we are transferring this chat to the next available agent.","wplivechat");
463
- }
464
- } else {
465
- $msg = $agent . " ". __("has transferred the chat.","wplivechat");
466
- }
467
-
468
- $wpdb->insert(
469
- $wplc_tblname_msgs,
470
- array(
471
- 'chat_sess_id' => $cid,
472
- 'timestamp' => current_time('mysql'),
473
- 'msgfrom' => __('System notification',"wplivechat"),
474
- 'msg' => $msg,
475
- 'status' => 0,
476
- 'originates' => 0
477
- ),
478
- array(
479
- '%s',
480
- '%s',
481
- '%s',
482
- '%s',
483
- '%d',
484
- '%d'
485
- )
486
- );
487
-
488
- $msg = "<strong>" . __("User received this message", "wplivechat") . ":</strong> " . $msg;
489
- $wpdb->insert(
490
- $wplc_tblname_msgs,
491
- array(
492
- 'chat_sess_id' => $cid,
493
- 'timestamp' => current_time('mysql'),
494
- 'msgfrom' => __('System notification',"wplivechat"),
495
- 'msg' => $msg,
496
- 'status' => 0,
497
- 'originates' => 3
498
- ),
499
- array(
500
- '%s',
501
- '%s',
502
- '%s',
503
- '%s',
504
- '%d',
505
- '%d'
506
- )
507
- );
508
  }
509
- return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
510
  }
511
 
512
  add_action("wplc_hook_chat_notification","wplc_filter_control_chat_notification_auto_department_transfer_mrg",10,3);
@@ -569,7 +563,7 @@ function wplc_filter_control_chat_notification_auto_department_transfer_mrg($typ
569
  )
570
  );
571
 
572
- $msg = __("User has been transferred from ","wplivechat") . " ";
573
  if($from_department === null){
574
  $msg .= __("department", "wplivechat");
575
  } else {
@@ -580,7 +574,7 @@ function wplc_filter_control_chat_notification_auto_department_transfer_mrg($typ
580
 
581
  if($to_department !== null){
582
  if(!empty($to_department[0]) && !empty($to_department[0]->name)){
583
- $msg .= __(" to ", "wplivechat") . " " . $to_department[0]->name;
584
  }
585
  }
586
  $msg .= " " . __("as there were no agents online") . ".";
441
  * @return string
442
  */
443
  function wplc_filter_control_chat_notification_department_transfer_mrg($type,$cid,$data) {
444
+ if ($type == "transfer") {
445
+ global $wpdb;
446
+ global $wplc_tblname_msgs;
447
+ $user_info = get_userdata(intval($data['aid']));
448
+ $agent = "";
449
+ if ($user_info ) {
450
+ $agent = $user_info->display_name;
451
+ }
452
+ if (isset($data["auto_transfer"]) && $data["auto_transfer"] == true) {
453
+ if (intval($data['aid']) === 0) {
454
+ //Came from a department originally
455
+ $msg=__("Department took too long to respond, we are transferring this chat to the next available agent.","wplivechat");
456
+ } else {
457
+ $msg = $agent." ".__("took too long to respond, we are transferring this chat to the next available agent.","wplivechat");
458
+ }
459
+ } else {
460
+ $msg = $agent." ".__("has transferred the chat.","wplivechat");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
461
  }
462
+
463
+ $wpdb->insert( // for user
464
+ $wplc_tblname_msgs,
465
+ array(
466
+ 'chat_sess_id' => $cid,
467
+ 'timestamp' => current_time('mysql'),
468
+ 'msgfrom' => __('System notification',"wplivechat"),
469
+ 'msg' => $msg,
470
+ 'status' => 0,
471
+ 'originates' => 0
472
+ ),
473
+ array(
474
+ '%s',
475
+ '%s',
476
+ '%s',
477
+ '%s',
478
+ '%d',
479
+ '%d'
480
+ )
481
+ );
482
+
483
+ $msg="*".__("User received this message", "wplivechat") . ":* ".$msg;
484
+ $wpdb->insert( // for agent
485
+ $wplc_tblname_msgs,
486
+ array(
487
+ 'chat_sess_id' => $cid,
488
+ 'timestamp' => current_time('mysql'),
489
+ 'msgfrom' => __('System notification',"wplivechat"),
490
+ 'msg' => $msg,
491
+ 'status' => 0,
492
+ 'originates' => 3
493
+ ),
494
+ array(
495
+ '%s',
496
+ '%s',
497
+ '%s',
498
+ '%s',
499
+ '%d',
500
+ '%d'
501
+ )
502
+ );
503
+ }
504
  }
505
 
506
  add_action("wplc_hook_chat_notification","wplc_filter_control_chat_notification_auto_department_transfer_mrg",10,3);
563
  )
564
  );
565
 
566
+ $msg = __("User has been transferred from","wplivechat") . " ";
567
  if($from_department === null){
568
  $msg .= __("department", "wplivechat");
569
  } else {
574
 
575
  if($to_department !== null){
576
  if(!empty($to_department[0]) && !empty($to_department[0]->name)){
577
+ $msg .= ' '.__("to", "wplivechat") . " " . $to_department[0]->name;
578
  }
579
  }
580
  $msg .= " " . __("as there were no agents online") . ".";
js/agent_status.js DELETED
@@ -1,10 +0,0 @@
1
- jQuery(document).load(function () {
2
-
3
- var wplc_agent_status = new Switchery("#wplc_agent_status", { size: 'small' });
4
- var changeCheckbox = document.querySelector('#wplc_agent_status');
5
-
6
- changeCheckbox.onchange = function () {
7
-
8
- };
9
-
10
- });
 
 
 
 
 
 
 
 
 
 
js/bleeper_action_events.js DELETED
@@ -1,155 +0,0 @@
1
- function wplc_emit_custom_data_event( action, event_object ){
2
-
3
- if (typeof socket !== "undefined" && socket.connected === true) {
4
-
5
- var a_wplc_cid = Cookies.get('wplc_cid');
6
-
7
- if( typeof a_wplc_cid !== 'undefined' ) {
8
-
9
- socket.emit('custom data',{ action: action, chatid: a_wplc_cid, ndata: event_object } );
10
-
11
- }
12
-
13
- }
14
-
15
- }
16
-
17
-
18
- var scrolling = false;
19
- jQuery(document).scroll(function() {
20
- if( !scrolling ){
21
- scrolling = true;
22
- }
23
- clearTimeout(jQuery.data(this, 'scrollTimer'));
24
- jQuery.data(this, 'scrollTimer', setTimeout(function() {
25
- // do something
26
- wplc_emit_custom_data_event( 'user_scrolling', { scrolling: true } );
27
- scrolling = false;
28
- }, 250));
29
- });
30
-
31
- jQuery(function(){
32
-
33
- jQuery("input, textarea").on("focus", function(){
34
-
35
- var input_field_id = jQuery(this).attr('id');
36
- var input_field_class = jQuery(this).attr('class');
37
- var input_field_value = jQuery(this).val();
38
-
39
- var input_field_obj = {
40
- id: input_field_id,
41
- class: input_field_class,
42
- content: input_field_value,
43
- fields: true
44
- }
45
- wplc_emit_custom_data_event( 'input_field_change', input_field_obj );
46
-
47
- });
48
- });
49
-
50
- jQuery(document).on("click", function(e) {
51
- if ( (jQuery(e.target).closest('a').length) || (jQuery(e.target).closest('input').length) || (jQuery(e.target).closest('select').length) || (jQuery(e.target).closest('textarea').length) ) { return; /* handled elsewhere */ } else {
52
-
53
- var parent1 = jQuery(e.target).parent().attr('id');
54
- var parent2 = jQuery(e.target).parent().parent().attr('id');
55
- var parent3 = jQuery(e.target).parent().parent().parent().attr('id');
56
- var parent4 = jQuery(e.target).parent().parent().parent().parent().attr('id');
57
- var parent5 = jQuery(e.target).parent().parent().parent().parent().parent().attr('id');
58
- var parent6 = jQuery(e.target).parent().parent().parent().parent().parent().parent().attr('id');
59
- var parent7 = jQuery(e.target).parent().parent().parent().parent().parent().parent().parent().attr('id');
60
- var parent8 = jQuery(e.target).parent().parent().parent().parent().parent().parent().parent().parent().attr('id');
61
- var parent9 = jQuery(e.target).parent().parent().parent().parent().parent().parent().parent().parent().parent().attr('id');
62
- var parent10 = jQuery(e.target).parent().parent().parent().parent().parent().parent().parent().parent().parent().parent().attr('id');
63
-
64
-
65
- if (parent1 !== "wp-live-chat" &&
66
- parent2 !== "wp-live-chat" &&
67
- parent3 !== "wp-live-chat" &&
68
- parent4 !== "wp-live-chat" &&
69
- parent5 !== "wp-live-chat" &&
70
- parent6 !== "wp-live-chat" &&
71
- parent7 !== "wp-live-chat" &&
72
- parent8 !== "wp-live-chat" &&
73
- parent9 !== "wp-live-chat" &&
74
- parent10 !== "wp-live-chat") {
75
-
76
-
77
-
78
- //html2canvas(e.target).then(function(canvas) {
79
- //wplc_emit_custom_data_event( 'send_user_canvas', canvas.toDataURL("image/png"));
80
- //});
81
- var elem_id = jQuery(e.target).attr('id');
82
- var elem_class = jQuery(e.target).attr('class');
83
-
84
- var event_data = {
85
- elem_id: elem_id,
86
- elem_class: elem_class
87
-
88
- }
89
-
90
- wplc_emit_custom_data_event( 'send_user_click_data', event_data );
91
- }
92
-
93
- }
94
- });
95
-
96
- var timeout = null;
97
-
98
- jQuery(document).on('mousemove', function() {
99
- clearTimeout(timeout);
100
-
101
- timeout = setTimeout(function() {
102
- wplc_emit_custom_data_event( 'send_user_mouse_idling', { idle: true } );
103
- }, 300000);
104
- });
105
-
106
- jQuery(document).mousedown(function(ev){
107
- if(ev.which == 3){
108
- wplc_emit_custom_data_event( 'send_user_right_clicked', { right_clicked: true } );
109
- }
110
- });
111
-
112
-
113
- jQuery(document).on("click", "a", function() {
114
- //this == the link that was clicked
115
- var href = jQuery(this).attr("href");
116
- var text = jQuery(this).html();
117
- wplc_emit_custom_data_event( 'send_link_click', { link_click: true, text: text } );
118
- });
119
-
120
- window.onkeydown = function(e){
121
-
122
-
123
-
124
- if(e.keyCode == 70 && e.ctrlKey){
125
- wplc_emit_custom_data_event( 'send_user_ctrl_f', { ctrl_f: true } );
126
- }
127
-
128
- if(e.keyCode == 80 && e.ctrlKey){
129
- wplc_emit_custom_data_event( 'send_user_ctrl_p', { ctrl_p: true } );
130
- }
131
-
132
- if(e.keyCode == 67 && e.ctrlKey){
133
- wplc_emit_custom_data_event( 'send_user_ctrl_c', { ctrl_c: true } );
134
- }
135
-
136
- if(e.keyCode == 86 && e.ctrlKey){
137
- wplc_emit_custom_data_event( 'send_user_ctrl_v', { ctrl_v: true } );
138
- }
139
-
140
- if(e.keyCode == 44){
141
- // Multiple ways to go about this due to different OS's
142
- // wplc_emit_custom_data_event( { ctrl_: true } );
143
- }
144
-
145
- if( ( e.ctrlKey && e.keyCode == 16 && ( e.keyCode == 74 || e.keyCode == 73 ) ) || e.keyCode == 123 ){
146
- wplc_emit_custom_data_event( 'send_user_console_opened', { console_log_opened: true } );
147
- }
148
-
149
- if ( e.ctrlKey && e.shiftKey && e.keyCode === 74) {
150
- wplc_emit_custom_data_event( 'send_user_console_opened', { console_log_opened: true } );
151
- }
152
-
153
-
154
-
155
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/bleeper_action_events.min.js DELETED
@@ -1 +0,0 @@
1
- function wplc_emit_custom_data_event(e,t){if("undefined"!=typeof socket&&!0===socket.connected){var r=Cookies.get("wplc_cid");void 0!==r&&socket.emit("custom data",{action:e,chatid:r,ndata:t})}}var scrolling=!1;jQuery(document).scroll(function(){scrolling||(scrolling=!0),clearTimeout(jQuery.data(this,"scrollTimer")),jQuery.data(this,"scrollTimer",setTimeout(function(){wplc_emit_custom_data_event("user_scrolling",{scrolling:!0}),scrolling=!1},250))}),jQuery(function(){jQuery("input, textarea").on("focus",function(){wplc_emit_custom_data_event("input_field_change",{id:jQuery(this).attr("id"),class:jQuery(this).attr("class"),content:jQuery(this).val(),fields:!0})})}),jQuery(document).on("click",function(e){if(!(jQuery(e.target).closest("a").length||jQuery(e.target).closest("input").length||jQuery(e.target).closest("select").length||jQuery(e.target).closest("textarea").length)){var t=jQuery(e.target).parent().attr("id"),r=jQuery(e.target).parent().parent().attr("id"),a=jQuery(e.target).parent().parent().parent().attr("id"),n=jQuery(e.target).parent().parent().parent().parent().attr("id"),c=jQuery(e.target).parent().parent().parent().parent().parent().attr("id"),i=jQuery(e.target).parent().parent().parent().parent().parent().parent().attr("id"),o=jQuery(e.target).parent().parent().parent().parent().parent().parent().parent().attr("id"),_=jQuery(e.target).parent().parent().parent().parent().parent().parent().parent().parent().attr("id"),l=jQuery(e.target).parent().parent().parent().parent().parent().parent().parent().parent().parent().attr("id"),p=jQuery(e.target).parent().parent().parent().parent().parent().parent().parent().parent().parent().parent().attr("id");"wp-live-chat"!==t&&"wp-live-chat"!==r&&"wp-live-chat"!==a&&"wp-live-chat"!==n&&"wp-live-chat"!==c&&"wp-live-chat"!==i&&"wp-live-chat"!==o&&"wp-live-chat"!==_&&"wp-live-chat"!==l&&"wp-live-chat"!==p&&wplc_emit_custom_data_event("send_user_click_data",{elem_id:jQuery(e.target).attr("id"),elem_class:jQuery(e.target).attr("class")})}});var timeout=null;jQuery(document).on("mousemove",function(){clearTimeout(timeout),timeout=setTimeout(function(){wplc_emit_custom_data_event("send_user_mouse_idling",{idle:!0})},3e5)}),jQuery(document).mousedown(function(e){3==e.which&&wplc_emit_custom_data_event("send_user_right_clicked",{right_clicked:!0})}),jQuery(document).on("click","a",function(){jQuery(this).attr("href");wplc_emit_custom_data_event("send_link_click",{link_click:!0,text:jQuery(this).html()})}),window.onkeydown=function(e){70==e.keyCode&&e.ctrlKey&&wplc_emit_custom_data_event("send_user_ctrl_f",{ctrl_f:!0}),80==e.keyCode&&e.ctrlKey&&wplc_emit_custom_data_event("send_user_ctrl_p",{ctrl_p:!0}),67==e.keyCode&&e.ctrlKey&&wplc_emit_custom_data_event("send_user_ctrl_c",{ctrl_c:!0}),86==e.keyCode&&e.ctrlKey&&wplc_emit_custom_data_event("send_user_ctrl_v",{ctrl_v:!0}),e.keyCode,(e.ctrlKey&&16==e.keyCode&&(74==e.keyCode||73==e.keyCode)||123==e.keyCode)&&wplc_emit_custom_data_event("send_user_console_opened",{console_log_opened:!0}),e.ctrlKey&&e.shiftKey&&74===e.keyCode&&wplc_emit_custom_data_event("send_user_console_opened",{console_log_opened:!0})};
 
js/media.js CHANGED
@@ -110,9 +110,8 @@ jQuery(function($){
110
 
111
  $(".wplc_default_chat_icon_selector").click(function() {
112
  var image_url = $(this).attr("src");
113
-
114
  $('#wplc_upload_icon').val(btoa(image_url));
115
- $("#wplc_icon_area").html("<img src=\""+image_url+"\" width='100px'/>");
116
  $("#wplc_default_chat_icons").slideToggle();
117
  });
118
 
110
 
111
  $(".wplc_default_chat_icon_selector").click(function() {
112
  var image_url = $(this).attr("src");
 
113
  $('#wplc_upload_icon').val(btoa(image_url));
114
+ $("#wplc_icon_area").html("<img src=\""+image_url+"\" width='50px'/>");
115
  $("#wplc_default_chat_icons").slideToggle();
116
  });
117
 
js/nimblesquirrel.js DELETED
@@ -1 +0,0 @@
1
- var ns_load_delay,ns_bg_color,ns_font_color,ns_width,ns_gap,ns_height,ns_footer,ns_header,ns_type,ns_question,ns_thank_you_text,ns_question_array_js,ns_trigger,ns_cookie_name,ns_cookie_value,ns_gdpr_company_name,ns_gdpr_purpose,ns_gdpr_retention_period,ns_emoji,ns_question_array=new Array,ns_triggered=!1,ns_trigger_normal=!1,ns_trigger_exit=!1,ns_trigger_cookie=!1,ns_google_form="",ns_theme=1,ns_dark=0;if(void 0===ns_id)var ns_id=0;if(void 0===ns_sid)var ns_sid=0;if(void 0===ns_lfid)var ns_lfid=0;var ns_start=nimblesquirrel_start();function nimblesquirrel_start(){if(null==ns_id);else{var e=getCookie("ns_participated");if(null!=e&&""!=e);else"no"===getCookie("ns_display")||(ns_load_emoticons(),ns_loadsettings())}}function ns_loadsettings(){var e;(e=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP")).onreadystatechange=function(){if(4==e.readyState&&200==e.status)if(ns_obj=json_parse(e.responseText),null!=ns_obj.error)nslog("nimbleSquirrel error:"+e.responseText);else{ns_override_html=ns_obj.override_html,ns_type=parseInt(ns_obj.type),ns_bg_color=ns_obj.bgcolor,ns_font_color=ns_obj.textcolor,ns_load_delay=parseInt(ns_obj.delay),ns_gap=ns_obj.div_gap,ns_width=ns_obj.div_width,ns_height=ns_obj.div_height,ns_footer=ns_obj.footer,ns_header=ns_obj.header,ns_question=ns_obj.question,ns_thank_you_text=ns_obj.thank_you_text,ns_question_array_js=ns_obj.question_array,ns_trigger=ns_obj.trigger,ns_cookie_name=ns_obj.cookie_name,ns_cookie_value=ns_obj.cookie_value,ns_gdpr_company_name=ns_obj.gdpr_company,ns_gdpr_purpose=ns_obj.gdpr_purpose,ns_gdpr_retention_period=ns_obj.gdpr_retention,ns_google_form=ns_obj.google_form,ns_id=parseInt(ns_obj.ns_id),ns_sid=parseInt(ns_obj.ns_sid),ns_lfid=parseInt(ns_obj.ns_lfid),null!==ns_obj.other_data&&"undefined"!==ns_obj.other_data&&(null!==ns_obj.other_data.survey_theme&&"undefined"!==ns_obj.other_data.survey_theme&&(ns_theme=parseInt(ns_obj.other_data.survey_theme)),null!==ns_obj.other_data.survey_dark&&"undefined"!==ns_obj.other_data.survey_dark&&(ns_dark=parseInt(ns_obj.other_data.survey_dark)));for(var i in ns_question_array_js)ns_question_array_js.hasOwnProperty(i)&&!isNaN(+i)&&(ns_question_array[+i]=ns_question_array_js[i]);if(ns_load_delay<1&&(ns_load_delay=1),ns_load_delay*=1e3,"undefined"!=typeof ns_div)check_for_parent_element(ns_div);else{if(-1===ns_trigger.indexOf("exit")&&-1===ns_trigger.indexOf("cookie")&&(ns_trigger_normal=!0),-1!==ns_trigger.indexOf("exit")&&(ns_trigger_exit=!0),-1!==ns_trigger.indexOf("cookie")&&(ns_trigger_cookie=!0),(ns_trigger_normal||/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)&&ns_trigger_exit&&!ns_trigger_cookie)&&(nsto=setTimeout(function(){ns_create_panel()},ns_load_delay),ns_triggered=!0),!ns_triggered&&ns_trigger_cookie){var n=ns_get_cookie(ns_cookie_name),r=!1;!1!==n?-1!==ns_trigger.indexOf("exists")&&-1===ns_trigger.indexOf("notexists")?r=!0:-1!==ns_trigger.indexOf("empty")?-1!==ns_trigger.indexOf("notempty")?n.length>0&&(r=!0):n.length<1&&(r=!0):-1!==ns_trigger.indexOf("valueis")&&n==ns_cookie_value&&(r=!0):-1!==ns_trigger.indexOf("notexists")&&(r=!0),r?ns_trigger_exit||(nsto=setTimeout(function(){ns_create_panel()},ns_load_delay),ns_triggered=!0):ns_trigger_exit=!1}!ns_triggered&&ns_trigger_exit&&document.documentElement.addEventListener("mousemove",function(e){!ns_triggered&&e.pageY<60&&(nsto=setTimeout(function(){ns_create_panel()},ns_load_delay),ns_triggered=!0)})}}},void 0!==ns_sid&&parseInt(ns_sid)>0?(e.open("GET","https://nimblesquirrel.com/api/v2.0/api.php?a=get_settings&id="+ns_id+"&sid="+ns_sid,!0),e.send()):void 0!==ns_lfid&&parseInt(ns_lfid)>0?(e.open("GET","https://nimblesquirrel.com/api/v2.0/api.php?a=get_settings_lf&id="+ns_id+"&lfid="+ns_lfid,!0),e.send()):"undefined"!=typeof Shopify&&void 0!==Shopify.shop&&Shopify.shop.length>0&&(e.open("GET","https://nimblesquirrel.com/api/v2.0/api.php?a=get_settings_shopify&shop_url="+Shopify.shop,!0),e.send())}function ns_get_cookie(e){for(var i=e+"=",n=decodeURIComponent(document.cookie).split(";"),r=0;r<n.length;r++){for(var t=n[r];" "==t.charAt(0);)t=t.substring(1);if(0==t.indexOf(i))return t.substring(i.length,t.length)}return!1}function check_for_parent_element(e){setTimeout(function(){if(null!==document.getElementById(e))return ns_create_panel();check_for_parent_element(e)},500)}function ns_load_emoticons(){var e=document.createElement("link");e.rel="stylesheet",e.href="https://nimblesquirrel.com/api/js-emoji/emoji.css",document.getElementsByTagName("head")[0].appendChild(e);var i=document.createElement("script");i.type="text/javascript",i.src="https://nimblesquirrel.com/api/js-emoji/emoji.js",document.getElementsByTagName("head")[0].appendChild(i)}function ns_initialize_emoji(){null!==(ns_emoji=new EmojiConvertor)&&void 0!==ns_emoji?(ns_emoji.img_sets.apple.path="https://nimblesquirrel.com/api/js-emoji/sheet_64/",ns_emoji.img_sets={apple:{path:"https://nimblesquirrel.com/api/js-emoji/sheet_64/",sheet:"https://nimblesquirrel.com/api/js-emoji/sheet_64.png",mask:1}},ns_emoji.use_sheet=!0,ns_emoji.init_env(),ns_emoji.img_set="apple",ns_emoji.replace_mode=ns_emoji.replace_mode,ns_emoji.text_mode=!1):nslog("Nimble Squirrel: Emoji could not be included")}function ns_process_emoji(e){setTimeout(function(){if("undefined"!=typeof EmojiConvertor)return real_ns_process_emoji(e);ns_process_emoji(e)},500)}function real_ns_process_emoji(e){null!==ns_emoji&&"undefined"!==ns_emoji&&(e=ns_emoji.replace_colons(e));var i=document.getElementById("nimblesquirrel_question_81400_answers");null!==i&&(i.innerHTML=e)}function ns_create_panel(){var e="html #nimblesquirrel_main { overflow: hidden; padding: 4px 0; -webkit-box-sizing: content-box; background: #f3f3f3; border: solid 1px #e2e2e2; border-bottom: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; -webkit-border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; border-top-left-radius: 4px; }#nimblesquirrel_div { background: none; border: 0; border-radius: 0; -webkit-border-radius: 0; -moz-border-radius: 0; bottom: 0px; height: auto; margin: 0; padding: 0; position: fixed !important; right: 30px; width: 287px; z-index: 99999; }#nimblesquirrel_div hr { }#nimblesquirrel_tab { display: block; height: 23px; position: absolute; top: -23px; right: 0; z-index: 900; text-decoration: none; text-align: center; color: #53575a; font-size: 19px; font-weight: bold; background: #f3f3f3; border: solid 1px #e2e2e2; border-bottom: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none;}#nimblesquirrel_tab_text { width: 30px; display: block; float: left; }#nimblesquirrel_div #nimblesquirrel_buttons { position: relative; }#nimblesquirrel_div #nimblesquirrel_gdpr_messages { font: normal 10px/13px helvetica,arial,sans-serif; color: #53575a; padding: 0 16px; }#nimblesquirrel_div #nimblesquirrel_gdpr_messages a, #nimblesquirrel_div #nimblesquirrel_gdpr_messages a:visited, #nimblesquirrel_div #nimblesquirrel_gdpr_messages a:hover { color: #53575a; }#nimblesquirrel_div .nimblesquirrel_button, #nimblesquirrel_div .nimblesquirrel_button:hover { border-top: 1px solid #a8a8a8; background: #bababa; -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; color: #555454; vertical-align: middle; padding: 6px 16px 6px 16px; text-decoration: none; text-transform: uppercase; display:inline-block; font: normal 12px/normal helvetica,arial,sans-serif; float: right; margin-right: 16px; margin-top: 3px; }#nimblesquirrel_div .nimblesquirrel_powered_by, #nimblesquirrel_div .nimblesquirrel_powered_by:hover { color: #53575a; margin-left: 5px; font: normal 10px/13px helvetica,arial,sans-serif; height: 13px;text-decoration: none; padding-left: 11px; float: left; margin-top: 11px; }html div#nimblesquirrel_div hr { border-collapse: collapse; border:none; border-top: 1px solid #e2e2e2; border-bottom: 1px solid #fff; display: block; margin: 13px 0 5px; }#nimblesquirrel_div ul.nimblesquirrel_answers { margin-left: 0; margin-right: 0; display: block; list-style: none; margin-bottom: 2px; overflow: hidden; padding: 0 15px; border: 1px solid #e2e2e2; background-color: #d8d8d8; padding: 10px; margin-left: 15px; margin-right: 15px; border-radius: 2px; -webkit-border-radius: 2px; -moz-border-radius: 2px; }#nimblesquirrel_div ul.nimblesquirrel_answers li { display: block; list-style: none; margin: 0; border-bottom: 1px solid #ccc; }#nimblesquirrel_div li.nimblesquirrel_answer_li label { background: #d8d8d8; color: #5e6367; display: block; font: normal 11px/15px helvetica,arial,sans-serif; margin-bottom: 4px; padding: 10px 10px 10px 28px; position: relative; text-align: left; text-transform: none; cursor: pointer; }#nimblesquirrel_div li.nimblesquirrel_answer_li:last-child { border-bottom: none; }#nimblesquirrel_div input.nimblesquirrel_extra_small, #nimblesquirrel_div input.nimblesquirrel_explain_extra:focus { background: #fff; border: 2px solid #cbcbcb; border-radius: 0; -webkit-border-radius: 0; -moz-border-radius: 0; color: #333; font-size: 12px; margin: 4px 10px 4px 0; padding: 5px; width: 165px; }#nimblesquirrel_div li.nimblesquirrel_answer_li input.nimblesquirrel_radio, #nimblesquirrel_div li.ki_answer_li input.nimblesquirrel_checkbox { background: none; border: 0; left: 7px; margin: 0 0 0 2px; padding: 0; position: absolute; top: 11px; min-width: 0; }.nps_1_p { font-size:12px; text-align:center; }.nps_score { width: 20px; height: 20px; display: block; background-color: #e5e5e5; text-align: center; box-shadow: 1px 1px #afadad; border-radius: 3px; float: left; margin-right: 3px; font-size: 12px; cursor: pointer; font-family: sans-serif; }.nps_score_box {width: 100%; display: block; }html div#nimblesquirrel_div .nimblesquirrel_h1 { color: #404040; display: block; font: bold 14px/18px helvetica,arial,sans-serif; padding: 8px 15px 8px; text-align: center; text-transform: none; white-space: normal;}.ns_lead_form { text-align: left; font-size: 12px; }.ns_lead_form label { clear:left; display:block; margin-top:10px; }.ns_lead_form .select { font-size: 12px; }.ns_lead_form .radio-group label {clear:none; display:inline-block; }.ns_lead_form .checkbox-group label {clear:none; display:inline-block; }.ns_lead_form .text-input { padding: 2px; margin: 0; width: 95%; font-size:12px; }.ns_lead_form .text-area { padding:2px; margin: 0; width: 95%; font-size:12px; height:100px; } .ns_lead_form .calendar { padding: 2px; margin: 0; width: 95%; font-size: 12px; }";void 0!==ns_theme&&2===ns_theme&&(e="html #nimblesquirrel_main { overflow: hidden; padding: 4px 0; -webkit-box-sizing: content-box; background: #f3f3f3; border: solid 1px #f3efef; border-bottom: none; -webkit-box-shadow: #ccc 1px 2px 3px -2px; -moz-box-shadow: #ccc 1px 2px 3px -2px; box-shadow: #ccc 1px 2px 3px -2px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; border-top-left-radius: 4px; -webkit-border-top-right-radius: 4px; -moz-border-radius-topright: 4px; border-top-right-radius: 4px; }#nimblesquirrel_div { background: none; border: 0; border-radius: 0; -webkit-border-radius: 0; -moz-border-radius: 0; bottom: 0px; height: auto; margin: 0; padding: 0; position: fixed !important; right: 30px; width: 287px; z-index: 99999; }#nimblesquirrel_div hr { }#nimblesquirrel_tab { display: block; border-radius:50px; height: 25px; border: solid 1px #f3f3f3; position: absolute; top: -30px; right: 0; z-index: 900; text-decoration: none; text-align: center; color: #53575a; font-size: 17px; line-height:25px; font-weight: bold; background: #f3f3f3;-webkit-box-shadow: #ccc 1px 2px 3px -2px; -moz-box-shadow: #ccc 1px 2px 3px -2px; box-shadow: #ccc 1px 2px 3px -2px;}#nimblesquirrel_tab_text { width: 25px; display: block; float: left; }#nimblesquirrel_div #nimblesquirrel_buttons { height: 34px; position: relative; }#nimblesquirrel_div #nimblesquirrel_gdpr_messages { font: normal 10px/13px helvetica,arial,sans-serif; color: #53575a; padding: 0 16px; }#nimblesquirrel_div #nimblesquirrel_gdpr_messages a, #nimblesquirrel_div #nimblesquirrel_gdpr_messages a:visited, #nimblesquirrel_div #nimblesquirrel_gdpr_messages a:hover { color: #53575a; }#nimblesquirrel_div .nimblesquirrel_button, #nimblesquirrel_div .nimblesquirrel_button:hover { border-top: 1px solid #cacaca; background: #d8d8d8; color: #3e3e3e; vertical-align: middle; padding: 6px 16px 6px 16px;text-align:center; text-decoration: none; text-transform: uppercase; display:inline-block; font: normal 12px/normal helvetica,arial,sans-serif; float: right; margin-right: 16px; margin-top: 3px; }#nimblesquirrel_div .nimblesquirrel_powered_by, #nimblesquirrel_div .nimblesquirrel_powered_by:hover {display: inline-block; color: #53575a; margin-left: 5px; font: normal 10px/13px helvetica,arial,sans-serif; height: 13px; text-decoration: none; padding-left: 11px; float: left; margin-top: 11px; }html div#nimblesquirrel_div hr { border-collapse: collapse; border:none; border-top: 1px solid #e2e2e2; display: block; margin: 13px 0 5px; }#nimblesquirrel_div ul.nimblesquirrel_answers { margin-left: 10px; margin-right: 10px; display: block; list-style: none; margin-bottom: 2px; overflow: hidden; padding: 0 15px; border: 1px solid #e2e2e2; background-color: #dfdfdf; padding: 10px;}#nimblesquirrel_div ul.nimblesquirrel_answers li { display: block; list-style: none; margin: 0; border-bottom: 1px solid #ccc; }#nimblesquirrel_div li.nimblesquirrel_answer_li label { background: #dfdfdf; color: #5e6367; display: block; font: normal 11px/15px helvetica,arial,sans-serif; margin-bottom: 4px; padding: 10px 10px 10px 28px; position: relative; text-align: left; text-transform: none; cursor: pointer; }#nimblesquirrel_div li.nimblesquirrel_answer_li:last-child { border-bottom: none; }#nimblesquirrel_div input.nimblesquirrel_extra_small, #nimblesquirrel_div input.nimblesquirrel_explain_extra:focus { background: #fff; border: 2px solid #cbcbcb; border-radius: 0; -webkit-border-radius: 0; -moz-border-radius: 0; color: #333; font-size: 12px; margin: 10px 10px -5px 0; padding: 5px; width: 90%; }#nimblesquirrel_div li.nimblesquirrel_answer_li input.nimblesquirrel_radio, #nimblesquirrel_div li.ki_answer_li input.nimblesquirrel_checkbox { background: none; border: 0; left: 7px; margin: 0 0 0 2px; padding: 0; position: absolute; top: 11px; min-width: 0; }.nps_1_p { font-size:12px; text-align:center; }.nps_score { width: 20px; height: 20px; display: block; background-color: #e5e5e5; text-align: center; box-shadow: 1px 1px #afadad; border-radius: 3px; float: left; margin-right: 3px; font-size: 12px; cursor: pointer; font-family: sans-serif; }.nps_score_box {width: 100%; display: block; }html div#nimblesquirrel_div .nimblesquirrel_h1 { color: ##3e3e3e; display: block; font: bold 14px/18px helvetica,arial,sans-serif; padding: 8px 15px 8px; text-align: center; text-transform: none; white-space: normal;}"),void 0!==ns_dark&&1===ns_dark&&(e+="html #nimblesquirrel_main {background-color: #555555; color: white; border: 1px solid #464646;} #nimblesquirrel_tab {background-color: #555555; color:white; border: 1px solid #464646; "+(void 0!==ns_theme&&1===ns_theme?" border-bottom:none;":"")+"}html div#nimblesquirrel_div h1.nimblesquirrel_h1 { color:white; }#nimblesquirrel_div ul.nimblesquirrel_answers{ margin-left: 0; margin-right: 0; background-color: #424242; border: 1px solid #464646; margin-left: 0; margin-right: 0;}#nimblesquirrel_div li.nimblesquirrel_answer_li label{ background-color: #424242; color:white;}html div#nimblesquirrel_div hr { border-top: 1px solid #4f4f4f; }#nimblesquirrel_div .nimblesquirrel_button, #nimblesquirrel_div .nimblesquirrel_button:hover {background-color: #424242; border: 1px solid #464646; color:white;}#nimblesquirrel_div input.nimblesquirrel_extra_small, #nimblesquirrel_div input.nimblesquirrel_explain_extra:focus {background-color: #555555; border-color: #424242;}#nimblesquirrel_div #nimblesquirrel_gdpr_messages, #nimblesquirrel_div #nimblesquirrel_gdpr_messages a, #nimblesquirrel_div #nimblesquirrel_gdpr_messages a:visited, #nimblesquirrel_div #nimblesquirrel_gdpr_messages a:hover, #nimblesquirrel_div .nimblesquirrel_powered_by, #nimblesquirrel_div .nimblesquirrel_powered_by:hover {color:white;}.nps_1_p { font-size:12px; text-align:center; }.nps_score { width: 23px; height: 20px; display: block; background-color: #555555; color:#FFF; text-align: center; box-shadow: 1px 1px #666666; border-radius: 3px; float: left; margin-right: 3px; font-size: 12px; cursor: pointer; font-family: sans-serif; }.nps_score_box {width: 100%; display: block; }"),"undefined"!=typeof ns_override_html&&(e+="span.emoji-outer { height:2.5em; width:2.5em; margin-left:10px; margin-right:10px; cursor:pointer; }",e+="ul.nimblesquirrel_answers { text-align:center; }"),"undefined"!=typeof ns_hide_min&&"1"===ns_hide_min&&(e+="#nimblesquirrel_tab { display: none !important; }"),"undefined"!=typeof ns_div&&(e+="div#nimblesquirrel_div { position: static !important; right: initial !important; }"),head=document.getElementsByTagName("head")[0],style=document.createElement("style"),style.type="text/css",style.styleSheet?style.styleSheet.cssText=e:style.appendChild(document.createTextNode(e)),head.appendChild(style),speechingfunction(),question_string_output="";for(var i=ns_question_array.length,n=0;n<i;n++)if(void 0===window.ns_question_array[n].ns_string);else{question_string_output+="<li id='nimblesquirrel_answer_230184' class='nimblesquirrel_answer_li'>";var r=ns_question_array[n].ns_string;r=r.replace(/\\/g,""),"1"==window.ns_question_array[n].ns_extra?(question_string_output+="<label><input type='radio' name='ns_radio_choice' value='"+ns_question_array[n].ns_choice_id+"' ncid='"+ns_question_array[n].ns_choice_id+"' class='nimblesquirrel_radio'>"+r,question_string_output+="<input type='text' name='ns_input_extra' class='nimblesquirrel_extra_small' value='' id='ns_extra_input_"+ns_question_array[n].ns_choice_id+"' style='display:block;'>",question_string_output+="</label></li>"):question_string_output+="<label><input type='radio' name='ns_radio_choice' value='"+ns_question_array[n].ns_choice_id+"' class='nimblesquirrel_radio'>"+r+"</label></li>"}"undefined"!=typeof ns_override_html&&""!==ns_override_html&&(question_string_output=ns_override_html),question_string_output=ns_process_emoji(question_string_output);var t=document.createElement("div");if(t.id="nimblesquirrel_div","undefined"!=typeof ns_div){var o=document.getElementById(ns_div);if("undefined"!=typeof ns_clear_div&&"1"===ns_clear_div&&(o.innerHTML=""),o.appendChild(t),"undefined"!=typeof ns_hide_div)document.getElementById(ns_hide_div).style.display="none"}else document.body.appendChild(t);var s=document.createElement("div");s.id="nimblesquirrel_main",s.style.display="block",(d=document.getElementById("nimblesquirrel_div")).appendChild(s);var l=document.createElement("a");l.title="",l.href="#",l.id="nimblesquirrel_tab",l.innerHTML="<span id='nimblesquirrel_tab_text'>-</span>";var d=document.getElementById("nimblesquirrel_div");if(l.onclick=function(){var e=document.getElementById("nimblesquirrel_main"),i=document.getElementById("nimblesquirrel_tab_text");"block"==e.style.display?(e.style.display="none",setCookie("ns_display","no",7),i.innerHTML="+"):(e.style.display="block",setCookie("ns_display","yes",7),i.innerHTML="-")},d.appendChild(l),ns_google_form.length>0){d=document.getElementById("nimblesquirrel_main");var a=document.createElement("div");a.id="nimblesquirrel_googleform",a.innerHTML=ns_google_form,d.appendChild(a),(f=document.createElement("div")).id="nimblesquirrel_buttons",d.appendChild(f)}else{var _=document.createElement("h1");_.id="nimblesquirrel_h1id",_.setAttribute("class","nimblesquirrel_h1"),_.setAttribute("className","nimblesquirrel_h1"),_.innerHTML=ns_question,_.style.display="block",(d=document.getElementById("nimblesquirrel_main")).appendChild(_);var p=document.createElement("form");p.method="POST",p.action="#",p.id="nimblesquirrel_form",p.style.display="block",p.innerHTML="",(d=document.getElementById("nimblesquirrel_main")).appendChild(p);var m=document.createElement("div");m.id="nimblesquirrel_questions",(d=document.getElementById("nimblesquirrel_form")).appendChild(m);var u=document.createElement("div");u.id="nimblesquirrel_question_81400",u.setAttribute("class","nimblesquirrel_question"),u.setAttribute("className","nimblesquirrel_question"),u.setAttribute("class","nimblesquirrel_top"),u.setAttribute("className","nimblesquirrel_top"),(d=document.getElementById("nimblesquirrel_questions")).appendChild(u);var c=document.createElement("div");c.id="nimblesquirrel_thank_you",c.setAttribute("class","nimblesquirrel_h1"),c.setAttribute("className","nimblesquirrel_h1"),c.innerHTML=ns_thank_you_text,c.style.display="none",(d=document.getElementById("nimblesquirrel_main")).appendChild(c);var b=document.createElement("h1");b.id="nimblesquirrel_processing",b.setAttribute("class","nimblesquirrel_h1"),b.setAttribute("className","nimblesquirrel_h1"),b.innerHTML="Sending data...",b.style.display="none",(d=document.getElementById("nimblesquirrel_main")).appendChild(b);var g=document.createElement("ul");g.id="nimblesquirrel_question_81400_answers",g.setAttribute("class","nimblesquirrel_answers"),g.setAttribute("className","nimblesquirrel_answers"),(d=document.getElementById("nimblesquirrel_question_81400")).appendChild(g);var f,x=document.createElement("hr");if((d=document.getElementById("nimblesquirrel_form")).appendChild(x),(f=document.createElement("div")).id="nimblesquirrel_buttons",(d=document.getElementById("nimblesquirrel_form")).appendChild(f),void 0!==ns_type&&ns_type<1){var h=document.createElement("div");h.id="nimblesquirrel_gdpr_messages",h.innerHTML='<label><input type="checkbox" id="nimblesquirrel_gdpr"> I agree for my personal data, provided to this survey/lead form, to be processed by '+ns_gdpr_company_name+" and NimbleSquirrel, for the purpose of "+ns_gdpr_purpose+", for the time of "+ns_gdpr_retention_period+' days as per the GDPR.</label><br><br><span>We use NimbleSquirrel as our survey/lead form collector. By clicking below to submit this form, you acknowledge that the information you provide will be transferred to NimbleSquirrel for processing in accordance with their <a href="" target="_blank">Privacy Policy</a>.</span>';var v=document.createElement("a");v.id="nimblesquirrel_submit_button",v.href="#",v.title="Send",v.innerHTML="Send",v.setAttribute("class","nimblesquirrel_button"),v.setAttribute("className","nimblesquirrel_button"),v.onclick=function(){for(var e,i=document.getElementsByName("ns_radio_choice"),n=0,r=i.length;n<r;n++){if(void 0!==i[n]&&i[n].checked)if(e=i[n].value,null==document.getElementById("ns_extra_input_"+e))var t="";else t=document.getElementById("ns_extra_input_"+e).value}if(void 0!==ns_lfid&&parseInt(ns_lfid)>0){var o=document.getElementById("nimblesquirrel_form").elements,s=new Object;for(n=0;n<o.length;n++){var l=o[n].name;if("date"===o[n].type||"text"===o[n].type||"email"===o[n].type||"number"===o[n].type||"textarea"===o[n].type)val=null===o[n].value?"":o[n].value,s[l]=new Object,s[l]=val;else if("checkbox"===o[n].type||"radio"===o[n].type){document.getElementById(o[n].id).checked&&(val=null===o[n].value?"":o[n].value,s[l]=new Object,s[l]=val)}else"select-one"===o[n].type?(val=null===o[n].value?"":o[n].value,s[l]=new Object,s[l]=val):"hidden"===o[n].type&&(s[l]=new Object,s[l]="")}var d=JSON.stringify(s)}document.getElementById("nimblesquirrel_form").style.display="none",document.getElementById("nimblesquirrel_h1id").style.display="none";var a,_,p=document.getElementById("nimblesquirrel_processing");p.style.display="block",(a=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP")).onload=function(){"received"==this.responseText&&(p.style.display="none",setCookie("ns_participated","yes",14),"undefined"!=typeof ns_hide_div?document.getElementById(ns_hide_div).style.display="block":document.getElementById("nimblesquirrel_thank_you").style.display="block")},_="id="+encodeURIComponent(ns_id);var m=new Object;void 0!==ns_sid&&parseInt(ns_sid)>0?(_+="&sid="+encodeURIComponent(ns_sid),_+="&choice="+encodeURIComponent(e),_+="&extra="+encodeURIComponent(t),_+="&page="+encodeURIComponent(document.URL),a.open("POST","https://nimblesquirrel.com/api/v2.0/api.php?a=receive_response",!0),m.sid=ns_sid,m.choice=e,m.extra=t,m.page=document.URL):void 0!==ns_lfid&&parseInt(ns_lfid)>0&&(_+="&lfid="+encodeURIComponent(ns_lfid),_+="&data="+encodeURIComponent(d),_+="&page="+encodeURIComponent(document.URL),a.open("POST","https://nimblesquirrel.com/api/v2.0/api.php?a=receive_response_lf",!0),m.lfid=ns_lfid,m.data=s,m.page=document.URL),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(_)},(d=document.getElementById("nimblesquirrel_buttons")).appendChild(v)}}var y=document.createElement("a");y.innerHTML="Powered by nimbleSquirrel",y.target="_BLANK",y.href="https://nimblesquirrel.com/?utm_source=survey&utm_medium=survey&utm_campaign="+window.location.hostname,y.setAttribute("class","nimblesquirrel_powered_by"),y.setAttribute("className","nimblesquirrel_powered_by"),(d=document.getElementById("nimblesquirrel_buttons")).appendChild(y)}function speechingfunction(){setTimeout(function(){"undefined"!=typeof EmojiConvertor?ns_initialize_emoji():speechingfunction()},500)}function submitNpsScore(e){document.getElementById("nimblesquirrel_form").style.display="none",document.getElementById("nimblesquirrel_h1id").style.display="none";var i,n,r=document.getElementById("nimblesquirrel_processing");r.style.display="block",(i=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP")).onload=function(){"received"==this.responseText&&(r.style.display="none",setCookie("ns_participated","yes",14),"undefined"!=typeof ns_hide_div?document.getElementById(ns_hide_div).style.display="block":document.getElementById("nimblesquirrel_thank_you").style.display="block")},n="id="+encodeURIComponent(ns_id),n+="&sid="+encodeURIComponent(ns_sid),n+="&nps="+encodeURIComponent(e),n+="&page="+encodeURIComponent(document.URL),i.open("POST","https://nimblesquirrel.com/api/v2.0/api.php?a=receive_response",!0),i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.send(n)}function setCookie(e,i,n){var r=new Date;r.setDate(r.getDate()+n);var t=escape(i)+(null==n?"":"; expires="+r.toUTCString());document.cookie=e+"="+t}function getCookie(e){var i=document.cookie,n=i.indexOf(" "+e+"=");if(-1==n&&(n=i.indexOf(e+"=")),-1==n)i=null;else{n=i.indexOf("=",n)+1;var r=i.indexOf(";",n);-1==r&&(r=i.length),i=unescape(i.substring(n,r))}return i}window.onload=ns_start,document.body.onclick=function(e){(e=window.event?event.srcElement:e.target).className&&-1!=e.className.indexOf("nps_score")&&submitNpsScore(e.getAttribute("nps")),e.className&&-1!=e.className.indexOf("emoji-inner")&&(parent1=e.parentNode.parentNode,parent1.className&&-1!=parent1.className.indexOf("happy_score")&&submitNpsScore(parent1.getAttribute("nps")))};var json_parse=function(){"use strict";var e,i,n,r,t={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},o=function(i){throw{name:"SyntaxError",message:i,at:e,text:n}},s=function(r){return r&&r!==i&&o("Expected '"+r+"' instead of '"+i+"'"),i=n.charAt(e),e+=1,i},l=function(){var e,n="";for("-"===i&&(n="-",s("-"));i>="0"&&i<="9";)n+=i,s();if("."===i)for(n+=".";s()&&i>="0"&&i<="9";)n+=i;if("e"===i||"E"===i)for(n+=i,s(),"-"!==i&&"+"!==i||(n+=i,s());i>="0"&&i<="9";)n+=i,s();if(e=+n,isFinite(e))return e;o("Bad number")},d=function(){var e,n,r,l="";if('"'===i)for(;s();){if('"'===i)return s(),l;if("\\"===i)if(s(),"u"===i){for(r=0,n=0;n<4&&(e=parseInt(s(),16),isFinite(e));n+=1)r=16*r+e;l+=String.fromCharCode(r)}else{if("string"!=typeof t[i])break;l+=t[i]}else l+=i}o("Bad string")},a=function(){for(;i&&i<=" ";)s()};return r=function(){switch(a(),i){case"{":return function(){var e,n={};if("{"===i){if(s("{"),a(),"}"===i)return s("}"),n;for(;i;){if(e=d(),a(),s(":"),Object.hasOwnProperty.call(n,e)&&o('Duplicate key "'+e+'"'),n[e]=r(),a(),"}"===i)return s("}"),n;s(","),a()}}o("Bad object")}();case"[":return function(){var e=[];if("["===i){if(s("["),a(),"]"===i)return s("]"),e;for(;i;){if(e.push(r()),a(),"]"===i)return s("]"),e;s(","),a()}}o("Bad array")}();case'"':return d();case"-":return l();default:return i>="0"&&i<="9"?l():function(){switch(i){case"t":return s("t"),s("r"),s("u"),s("e"),!0;case"f":return s("f"),s("a"),s("l"),s("s"),s("e"),!1;case"n":return s("n"),s("u"),s("l"),s("l"),null}o("Unexpected '"+i+"'")}()}},function(t,s){var l;return n=t,e=0,i=" ",l=r(),a(),i&&o("Syntax error"),"function"==typeof s?function e(i,n){var r,t,o=i[n];if(o&&"object"==typeof o)for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(void 0!==(t=e(o,r))?o[r]=t:delete o[r]);return s.call(i,n,o)}({"":l},""):l}}();function nslog(e){window.console&&window.console.log(e)}
 
js/quick_responses.js CHANGED
@@ -13,7 +13,7 @@ jQuery(function() {
13
  };
14
  jQuery.post(wplc_home_ajaxurl, data, function (response) {
15
  var post_content = jQuery.parseJSON(response);
16
- jQuery("#wplc_admin_chatmsg").val(jQuery("#wplc_admin_chatmsg").val() + post_content);
17
 
18
  });
19
 
13
  };
14
  jQuery.post(wplc_home_ajaxurl, data, function (response) {
15
  var post_content = jQuery.parseJSON(response);
16
+ jQuery("#wplc_admin_chatmsg").val(jQuery("#wplc_admin_chatmsg").val() + post_content).focus();
17
 
18
  });
19
 
js/tcx_action_events.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function wplc_emit_custom_data_event( action, event_object ){
2
+
3
+ if (typeof socket !== "undefined" && socket.connected === true) {
4
+
5
+ var a_wplc_cid = Cookies.get('wplc_cid');
6
+
7
+ if( typeof a_wplc_cid !== 'undefined' ) {
8
+
9
+ socket.emit('custom data',{ action: action, chatid: a_wplc_cid, ndata: event_object } );
10
+
11
+ }
12
+
13
+ }
14
+
15
+ }
16
+
js/themes/classic.min.js DELETED
@@ -1 +0,0 @@
1
- jQuery(document).on("wplc_minimize_chat",function(e){jQuery("#wp-live-chat").height(""),"bottom_right"===jQuery("#wp-live-chat").attr("original_pos")?(jQuery("#wp-live-chat").css("left",""),jQuery("#wp-live-chat").css("bottom","0"),jQuery("#wp-live-chat").css("right","20px")):"bottom_left"===jQuery("#wp-live-chat").attr("original_pos")?(jQuery("#wp-live-chat").css("left","20px"),jQuery("#wp-live-chat").css("bottom","0"),jQuery("#wp-live-chat").css("right","")):"left"===jQuery("#wp-live-chat").attr("original_pos")?(jQuery("#wp-live-chat").css("left","0"),jQuery("#wp-live-chat").css("bottom","100px"),jQuery("#wp-live-chat").css("width",""),jQuery("#wp-live-chat").css("height","")):"right"===jQuery("#wp-live-chat").attr("original_pos")&&(jQuery("#wp-live-chat").css("left",""),jQuery("#wp-live-chat").css("right","0"),jQuery("#wp-live-chat").css("bottom","100px"),jQuery("#wp-live-chat").css("width",""),jQuery("#wp-live-chat").css("height","")),jQuery("#wp-live-chat").addClass("wplc_close"),jQuery("#wp-live-chat").removeClass("wplc_open"),jQuery("#wp-live-chat").css("top",""),jQuery("#wp-live-chat-1").show(),jQuery("#wp-live-chat-1").css("cursor","pointer"),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()}),jQuery(document).on("click","#wp-live-chat",function(e){}),jQuery(document).on("wplc_start_chat",function(e){jQuery("#wp-live-chat-2-inner").hide("slow"),jQuery.event.trigger({type:"wplc_open_chat_1"}),jQuery.event.trigger({type:"wplc_open_chat_2",wplc_online:wplc_online})}),jQuery(document).on("wplc_open_chat_1",function(e){jQuery("#wp-live-chat").removeClass("wplc_close"),jQuery("#wp-live-chat").addClass("wplc_open"),jQuery("#wp-live-chat-react").hide(),jQuery("#wp-live-chat-header").css("cursor","all-scroll"),Cookies.set("wplc_hide","",{expires:1,path:"/"}),jQuery("#wp-live-chat-minimize").show(),"left"===jQuery("#wp-live-chat").attr("original_pos")?(jQuery("#wp-live-chat").css("width","280px"),jQuery("#wp-live-chat").css("height","auto !important")):"right"===jQuery("#wp-live-chat").attr("original_pos")&&(jQuery("#wp-live-chat").css("width","280px"),jQuery("#wp-live-chat").css("height","auto !important")),jQuery(function(){jQuery("#wp-live-chat").draggable({handle:"#wp-live-chat-header",drag:function(e,t){jQuery(this).css("right",""),jQuery(this).css("bottom","inherit")}})})}),jQuery(document).on("wplc_open_chat_2",function(e){jQuery("#wp-live-chat-2").hide(),jQuery("#wp-live-chat").hasClass("wplc_open")||jQuery("#wplc_chatmsg").focus(),jQuery("#wp-live-chat-header").addClass("active"),jQuery("#wp-live-chat").addClass("mobile-active"),wplc_chat_status=Cookies.get("wplc_chat_status"),void 0!==e.wplc_online&&!0===e.wplc_online?(jQuery("#wp-live-chat-4").show(),jQuery("#wplc_social_holder").show(),jQuery("#nifty_ratings_holder").show(),jQuery("#wp-live-chat-1").css("cursor","pointer")):!1===e.wplc_online&&(jQuery("#wp-live-chat-2").show(),jQuery("#wp-live-chat").css("height","auto !important"),jQuery("#wp-live-chat-4").hide(),jQuery("#wplc_social_holder").hide(),jQuery("#nifty_ratings_holder").hide(),jQuery("#wp-live-chat-1").css("cursor","pointer")),jQuery("#wp-live-chat-3").hide(),jQuery("#wp-live-chat-close").hide(),Cookies.set("wplc_minimize","",{expires:1,path:"/"})}),jQuery(function(){jQuery("body").on("click",".wplc_retry_chat",function(){Cookies.set("wplc_chat_status",5),jQuery("#wplc_chatbox").html(""),jQuery("#wp-live-chat-4").fadeOut(),jQuery("#wp-live-chat-2").fadeIn(),jQuery("#wp-live-chat-2-inner").fadeIn(),wplc_shown_welcome=!1}),jQuery("body").on("click","#speeching_button",function(){jQuery("#wplc_hovercard").hide(),wplc_is_chat_open=!0,jQuery.event.trigger({type:"wplc_open_chat"}),jQuery("#wp-live-chat-minimize").show()}),jQuery("body").on("click","#wplc_hovercard_min",function(){jQuery("#wplc_hovercard").fadeOut()}),jQuery("body").on("click","#wp-live-chat-header",function(){jQuery("#wplc_hovercard").hide(),jQuery("#wp-live-chat").css("height",""),jQuery("#wplc-chat-alert").removeClass("is-active"),jQuery("#wplc_gdpr_end_chat_notice_container").hide()}),jQuery("body").on("click","#wp-live-chat-header",function(){jQuery(this).hasClass("active")?(jQuery(this).removeClass("active"),jQuery.event.trigger({type:"wplc_minimize_chat"}),Cookies.set("wplc_minimize","yes",{expires:1,path:"/"})):(jQuery.event.trigger({type:"wplc_open_chat"}),jQuery("#wp-live-chat-minimize").show(),Cookies.set("wplc_minimize","",{expires:1,path:"/"}))})});
 
js/themes/modern.js CHANGED
@@ -1,12 +1,4 @@
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("");
@@ -76,14 +68,10 @@ jQuery(document).on("wplc_agent_joined", function(e) {
76
  var tname = '';
77
  var taid = '';
78
  var ta_tagline = '';
79
- var ta_bio = '';
80
- var ta_social_links = '';
81
  if (typeof e.ndata.other.email !== "undefined") { temail = e.ndata.other.email; }
82
- if (typeof e.ndata.other.name !== "undefined") { tname = e.ndata.other.name; }
83
  if (typeof e.ndata.other.aid !== "undefined") { taid = parseInt(e.ndata.other.aid); }
84
- if (typeof e.ndata.other.agent_tagline !== "undefined" && jQuery('.wplc_agent_tagline').length == 0) { ta_tagline = '<span class="wplc_agent_infosection wplc_agent_tagline wplc-color-2" title="' + e.ndata.other.agent_tagline + '">' + e.ndata.other.agent_tagline + '</span>'; }
85
- if (typeof e.ndata.other.agent_bio !== "undefined") { ta_bio = e.ndata.other.agent_bio; }
86
- if (typeof e.ndata.other.social_links !== "undefined") { ta_social_links = e.ndata.other.social_links; }
87
 
88
  //Ensure this agent ID is valid before proceeding
89
  if(!isNaN(taid)){
@@ -105,12 +93,13 @@ jQuery(document).on("wplc_agent_joined", function(e) {
105
  jQuery('<p/>', {
106
  'class': '',
107
  'style': 'text-align:center;',
108
- 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&d=mm" /><br /><span class="wplc_agent_name wplc-color-2" title="' + tname + '">'+tname+'</span>'+ta_tagline+ta_bio+ta_social_links
109
  }).appendTo('.wplc_agent_info');
110
 
111
  jQuery('<span/>', {
112
- 'class': 'bleeper_pullup down',
113
- html: '<i class="fa fa-angle-up"></i>'
 
114
 
115
  }).appendTo('.wplc_agent_info');
116
  }
@@ -174,7 +163,7 @@ jQuery(document).on("wplc_agent_joined", function(e) {
174
 
175
  });
176
 
177
- jQuery(document).on("bleeper_build_involved_agents_header", function(e){
178
  if(typeof e.ndata !== "undefined"){
179
  if(typeof e.ndata.chatid !== "undefined" && typeof e.ndata.agents !== "undefined"){
180
  if(e.ndata.chatid === chatid){
@@ -211,9 +200,6 @@ jQuery(document).on("wplc_animation_done", function(e) {
211
  jQuery("#wplc_logo").prependTo("#wplc_chatbox_header");
212
 
213
 
214
-
215
-
216
-
217
  if (jQuery("wplc_chatbox").hasClass("wplc-shrink")) {
218
  /**
219
  * The +18px is to compensate for the 18px of padding at the bottom of the header box
@@ -287,52 +273,26 @@ var wplc_currently_animating_agent_header = false;
287
  jQuery(function() {
288
 
289
 
290
- /*jQuery("body").on("mousewheel", "#wplc_chatbox", function(turn, delta){
291
- var tmpChatboxContainer = document.getElementById('wplc_chatbox');
292
- if(tmpChatboxContainer.scrollHeight > tmpChatboxContainer.clientHeight){
293
- if (delta == 1) {*/
294
- /**
295
- * The +18px is to compensate for the 18px of padding at the bottom of the header box
296
- */
297
- /*
298
- wplc_animate_agent_header_up();
299
-
300
- } else {*/
301
- // going down
302
- /**
303
- * The +18px is to compensate for the 18px of padding at the bottom of the header box
304
- */
305
- /*
306
- wplc_animate_agent_header_down();
307
-
308
- }
309
- }
310
-
311
- });*/
312
 
313
- jQuery("body").on("click", ".bleeper_pullup", function() {
314
- if (jQuery(".bleeper_pullup").hasClass('down')) {
315
- wplc_animate_agent_header_down();
316
-
317
- } else {
318
- wplc_animate_agent_header_up();
319
-
320
- }
321
- });
322
-
323
-
324
- //opens chat when clicked on top bar
325
- jQuery("body").on("click", "#wp-live-chat-header", function() {
326
-
327
-
328
  });
329
 
330
 
331
- jQuery("body").on("click", ".wplc_retry_chat", function() {
 
 
 
 
 
 
 
332
  jQuery("#wplc_chatbox").html("");
333
  jQuery("#wp-live-chat-4").fadeOut();
334
  Cookies.remove('wplc_chat_status');
335
- jQuery("#wp-live-chat-2-inner").fadeIn();
 
 
336
  wplc_shown_welcome = false;
337
  });
338
 
@@ -358,7 +318,7 @@ jQuery(function() {
358
  nc_status = Cookies.get('nc_status');
359
  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') {
360
 
361
- jQuery("#bleeper_bell").hide();
362
 
363
  jQuery("#speeching_button").click();
364
  }
@@ -396,9 +356,9 @@ function wplc_animate_agent_header_up() {
396
  if(!wplc_currently_animating_agent_header && jQuery("#wplc_chatbox_header").hasClass("wplc-shrink") && jQuery('#wplc_chatbox_header .wplc_agent_info:first-child').html() !== ""){
397
  wplc_currently_animating_agent_header = true;
398
 
399
- jQuery(".bleeper_pullup").removeClass('up');
400
- jQuery(".bleeper_pullup").addClass('down');
401
- jQuery(".bleeper_pullup").html("<i class='fa fa-angle-up'></i>");
402
 
403
  jQuery("#wplc_chatbox_header").removeClass("wplc-shrink");
404
  jQuery('#wplc_end_chat_button').removeClass('shrink');
@@ -432,9 +392,9 @@ function wplc_animate_agent_header_down() {
432
  if(!wplc_currently_animating_agent_header && !jQuery("#wplc_chatbox_header").hasClass("wplc-shrink") && jQuery('#wplc_chatbox_header .wplc_agent_info:first-child').html() !== ""){
433
  wplc_currently_animating_agent_header = true;
434
 
435
- jQuery(".bleeper_pullup").removeClass('down');
436
- jQuery(".bleeper_pullup").addClass('up');
437
- jQuery(".bleeper_pullup").html("<i class='fa fa-angle-down'></i>");
438
 
439
  jQuery("#wplc_chatbox_header").addClass("wplc-shrink");
440
  jQuery('#wplc_end_chat_button').addClass('shrink');
1
+ jQuery(document).on("tcx_agent_left", function(e) {
 
 
 
 
 
 
 
 
2
  var taid = jQuery(".wplc_agent_info").attr('aid');
3
  if (taid == e.ndata.agent) {
4
  jQuery(".wplc_agent_info").html("");
68
  var tname = '';
69
  var taid = '';
70
  var ta_tagline = '';
 
 
71
  if (typeof e.ndata.other.email !== "undefined") { temail = e.ndata.other.email; }
72
+ if (typeof e.ndata.other.name !== "undefined") { tname = wplc_safe_html(e.ndata.other.name); }
73
  if (typeof e.ndata.other.aid !== "undefined") { taid = parseInt(e.ndata.other.aid); }
74
+ if (typeof e.ndata.other.agent_tagline !== "undefined" && jQuery('.wplc_agent_tagline').length == 0) { ta_tagline = '<span class="wplc_agent_infosection wplc_agent_tagline wplc-color-2">' + e.ndata.other.agent_tagline + '</span>'; }
 
 
75
 
76
  //Ensure this agent ID is valid before proceeding
77
  if(!isNaN(taid)){
93
  jQuery('<p/>', {
94
  'class': '',
95
  'style': 'text-align:center;',
96
+ 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&d=mm" /><br /><span class="wplc_agent_name wplc-color-2">'+tname+'</span>'+ta_tagline
97
  }).appendTo('.wplc_agent_info');
98
 
99
  jQuery('<span/>', {
100
+ 'class': 'tcx_pullup down',
101
+ 'title': 'Minimize Chat',
102
+ html: '<i class="fa fa-angle-down"></i>'
103
 
104
  }).appendTo('.wplc_agent_info');
105
  }
163
 
164
  });
165
 
166
+ jQuery(document).on("tcx_build_involved_agents_header", function(e){
167
  if(typeof e.ndata !== "undefined"){
168
  if(typeof e.ndata.chatid !== "undefined" && typeof e.ndata.agents !== "undefined"){
169
  if(e.ndata.chatid === chatid){
200
  jQuery("#wplc_logo").prependTo("#wplc_chatbox_header");
201
 
202
 
 
 
 
203
  if (jQuery("wplc_chatbox").hasClass("wplc-shrink")) {
204
  /**
205
  * The +18px is to compensate for the 18px of padding at the bottom of the header box
273
  jQuery(function() {
274
 
275
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
276
 
277
+ jQuery("body").on("click", ".tcx_pullup", function() {
278
+ jQuery("#wp-live-chat-header").click();
 
 
 
 
 
 
 
 
 
 
 
 
 
279
  });
280
 
281
 
282
+ jQuery("body").on("click", ".wplc_retry_chat", function() {
283
+ var data = {
284
+ security: wplc_nonce,
285
+ chat_id: wplc_cid,
286
+ agent_id: 0
287
+ };
288
+ wplc_rest_api('end_chat', data, 12000, null);
289
+ jQuery.event.trigger({type: "wplc_end_chat_as_user"});
290
  jQuery("#wplc_chatbox").html("");
291
  jQuery("#wp-live-chat-4").fadeOut();
292
  Cookies.remove('wplc_chat_status');
293
+ Cookies.remove('wplc_cid');
294
+ jQuery("#wp-live-chat").fadeOut();
295
+ location.reload();
296
  wplc_shown_welcome = false;
297
  });
298
 
318
  nc_status = Cookies.get('nc_status');
319
  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') {
320
 
321
+ jQuery("#tcx_bell").hide();
322
 
323
  jQuery("#speeching_button").click();
324
  }
356
  if(!wplc_currently_animating_agent_header && jQuery("#wplc_chatbox_header").hasClass("wplc-shrink") && jQuery('#wplc_chatbox_header .wplc_agent_info:first-child').html() !== ""){
357
  wplc_currently_animating_agent_header = true;
358
 
359
+ jQuery(".tcx_pullup").removeClass('up');
360
+ jQuery(".tcx_pullup").addClass('down');
361
+ jQuery(".tcx_pullup").html("<i class='fa fa-angle-down'></i>");
362
 
363
  jQuery("#wplc_chatbox_header").removeClass("wplc-shrink");
364
  jQuery('#wplc_end_chat_button').removeClass('shrink');
392
  if(!wplc_currently_animating_agent_header && !jQuery("#wplc_chatbox_header").hasClass("wplc-shrink") && jQuery('#wplc_chatbox_header .wplc_agent_info:first-child').html() !== ""){
393
  wplc_currently_animating_agent_header = true;
394
 
395
+ jQuery(".tcx_pullup").removeClass('down');
396
+ jQuery(".tcx_pullup").addClass('up');
397
+ jQuery(".tcx_pullup").html("<i class='fa fa-angle-down'></i>");
398
 
399
  jQuery("#wplc_chatbox_header").addClass("wplc-shrink");
400
  jQuery('#wplc_end_chat_button').addClass('shrink');
js/themes/modern.min.js DELETED
@@ -1 +0,0 @@
1
- jQuery(document).on("bleeper_agent_disconnected",function(e){jQuery(".wplc_agent_info").attr("aid")==e.ndata.aid&&(jQuery(".wplc_agent_info").html(""),wplc_animate_agent_header_down(),jQuery("#wplc_chatbox").css("top","18px"))}),jQuery(document).on("bleeper_agent_left",function(e){jQuery(".wplc_agent_info").attr("aid")==e.ndata.agent&&(jQuery(".wplc_agent_info").html(""),wplc_animate_agent_header_down(),jQuery("#wplc_chatbox").css("top","18px"))}),jQuery(document).on("wplc_minimize_chat",function(e){wplc_is_chat_open=!1,jQuery("#wp-live-chat").height(""),"bottom_right"===jQuery("#wp-live-chat").attr("original_pos")?(jQuery("#wp-live-chat").css("left",""),jQuery("#wp-live-chat").css("bottom","0"),jQuery("#wp-live-chat").css("right","20px")):"bottom_left"===jQuery("#wp-live-chat").attr("original_pos")?(jQuery("#wp-live-chat").css("left","20px"),jQuery("#wp-live-chat").css("bottom","0"),jQuery("#wp-live-chat").css("right","")):"left"===jQuery("#wp-live-chat").attr("original_pos")?(jQuery("#wp-live-chat").css("left","20px"),jQuery("#wp-live-chat").css("bottom","100px")):jQuery("#wp-live-chat").attr("original_pos"),jQuery("#wp-live-chat").addClass("wplc_close"),jQuery("#wp-live-chat").removeClass("wplc_open"),jQuery("#wp-live-chat").css("top",""),jQuery("#wp-live-chat").css("height",""),jQuery("#wp-live-chat-1").show(),jQuery("#wp-live-chat-1").css("cursor","pointer"),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("#nifty_ratings_holder").hide(),jQuery("#wp-live-chat-react").hide(),jQuery("#wp-live-chat-minimize").hide(),jQuery("#wp-live-chat-header").show()}),jQuery(document).on("wplc_start_chat",function(e){jQuery("#wp-live-chat-2-inner").hide("slow"),jQuery.event.trigger({type:"wplc_open_chat_1"}),jQuery.event.trigger({type:"wplc_open_chat_2",wplc_online:wplc_online})}),jQuery(document).on("wplc_open_chat_1",function(e){jQuery("#wp-live-chat").removeClass("wplc_close"),jQuery("#wp-live-chat").addClass("wplc_open"),jQuery("#wp-live-chat-react").hide(),Cookies.set("wplc_hide","",{expires:1,path:"/"}),jQuery("#wp-live-chat-minimize").show()}),jQuery(document).on("wplc_agent_joined",function(e){var t="",a="",i="",l="",n="";if(void 0!==e.ndata.other.email&&e.ndata.other.email,void 0!==e.ndata.other.name&&(t=e.ndata.other.name),void 0!==e.ndata.other.aid&&(a=parseInt(e.ndata.other.aid)),void 0!==e.ndata.other.agent_tagline&&(i=e.ndata.other.agent_tagline),void 0!==e.ndata.other.agent_bio&&(l=e.ndata.other.agent_bio),void 0!==e.ndata.other.social_links&&(n=e.ndata.other.social_links),!isNaN(a)){jQuery(".wplc_no_answer").remove(),jQuery(".admin_chat_name").html(t),wplc_node_pair_name=t,wplc_agent_name=t;var c=wplc_user_avatars[a];if(""===jQuery(".wplc_agent_info").html().trim()||void 0===jQuery(".wplc_agent_info").attr("aid")){jQuery(".wplc_agent_info").html(""),jQuery(".wplc_agent_info").attr("aid",a),jQuery("#agent_grav_"+a).length||(jQuery("<p/>",{class:"",style:"text-align:center;",html:'<img class="img-thumbnail img-circle wplc_thumb32 wplc_agent_involved" style="max-width:inherit;" id="agent_grav_'+a+'" title="'+t+'" src="'+c+'?s=60&d=mm" /><br /><span class="wplc_agent_name wplc-color-2">'+t+"</span>"+i+l+n}).appendTo(".wplc_agent_info"),jQuery("<span/>",{class:"bleeper_pullup down",html:'<i class="fa fa-angle-up"></i>'}).appendTo(".wplc_agent_info"));jQuery("#wplc_chatbox_header_bg").css("background-image","url("+c+"?s=380&d=mm)"),jQuery("#wplc_chatbox").css("top",jQuery("#wplc_chatbox_header").height()+18+"px")}else{var r=jQuery(".wplc_agent_info").attr("aid"),o=r.split(","),h=!1;for(var s in o){parseInt(o[s])===a&&(h=!0)}if(!h){r+=","+a,jQuery(".wplc_agent_info").attr("aid",r);var _=jQuery(".wplc_agent_name").text();jQuery(".wplc_agent_name").text(_+", "+t),jQuery(".wplc_agent_tagline").hide(),jQuery(".wplc_agent_social_links").hide(),jQuery("img.wplc_agent_involved").removeClass("wplc_thumb32").addClass("wplc_thumb16_stacked"),jQuery('<img class="img-thumbnail img-circle wplc_thumb16_stacked wplc_agent_involved" style="max-width:inherit;" id="agent_grav_'+a+'" title="'+t+'" src="'+c+'?s=60&d=mm" />').insertAfter("img.wplc_agent_involved:last"),jQuery("#wplc_chatbox_header").css("max-height",jQuery("#wplc_chatbox_header").outerHeight()),jQuery("#wplc_chatbox").css("top",jQuery("#wplc_chatbox_header").height()+"px"),jQuery("#wplc_chatbox_header_bg").css("background-image","none")}}}}),jQuery(document).on("bleeper_build_involved_agents_header",function(e){if(void 0!==e.ndata&&void 0!==e.ndata.chatid&&void 0!==e.ndata.agents&&e.ndata.chatid===chatid){var t=e.ndata.agents;for(var a in t){var i=t[a];if(void 0!==wplc_agent_data[i]){wplc_agent_data[i].md5,wplc_agent_data[i].name;var l={email:wplc_agent_data[i].md5,name:wplc_agent_data[i].name,aid:i};jQuery.event.trigger({type:"wplc_agent_joined",ndata:{other:l}})}}}}),jQuery(document).on("wplc_animation_done",function(e){jQuery("#nifty_text_editor_holder").remove(),jQuery("#wplc_msg_notice").remove(),jQuery("#wp-live-chat-minimize").remove(),jQuery("#wplc_logo").prependTo("#wplc_chatbox_header"),jQuery("wplc_chatbox").hasClass("wplc-shrink")?(jQuery("#wplc_chatbox").css("top",jQuery("#wplc_chatbox_header").height()+18+"px"),jQuery("#wplc_logo").show()):(jQuery("#wplc_chatbox").css("top",jQuery("#wplc_chatbox_header").height()+18+"px"),jQuery("#wplc_logo").hide()),jQuery("#wplc_chatbox").css("bottom","0")}),jQuery(document).on("wplc_open_chat_2",function(e){wplc_chat_status=Cookies.get("wplc_chat_status"),("yes"!==Cookies.get("wplc_minimize")||jQuery("#wp-live-chat-header").hasClass("active"))&&(jQuery("#wp-live-chat-1").hide(),jQuery("#wp-live-chat-2-inner").hide(),jQuery("#wp-live-chat-2").show(),jQuery("#wp-live-chat-header").hasClass("active")||jQuery("#wplc_chatmsg").focus(),jQuery("#wp-live-chat-header").addClass("active"),jQuery("#wp-live-chat").addClass("mobile-active"),wplc_chat_status=Cookies.get("wplc_chat_status"),void 0!==e.wplc_online&&!0===e.wplc_online&&(jQuery("#wp-live-chat-4").show(),jQuery("#wplc_social_holder").show(),jQuery("#nifty_ratings_holder").show(),jQuery.event.trigger({type:"wplc_animation_done"})),setTimeout(function(){wplc_scroll_to_bottom()},1e3),jQuery("#wp-live-chat-3").hide(),jQuery("#wplc_chatmsg").focus(),jQuery("#wp-live-chat-minimize").css("right","23px"),Cookies.set("wplc_minimize","",{expires:1,path:"/"}))});var wplc_leave_window_alone=!1,wplc_currently_animating_agent_header=!1;function wplc_animate_agent_header_up(){!wplc_currently_animating_agent_header&&jQuery("#wplc_chatbox_header").hasClass("wplc-shrink")&&""!==jQuery("#wplc_chatbox_header .wplc_agent_info:first-child").html()&&(wplc_currently_animating_agent_header=!0,jQuery("#wplc_chatbox_header").removeClass("wplc-shrink"),jQuery("#wplc_chatbox_header").animate({maxHeight:"280px"},{duration:700,complete:function(){jQuery("#wplc_logo").show(),wplc_currently_animating_agent_header=!1,jQuery("#wplc_chatbox_header").css("max-height",jQuery("#wplc_chatbox_header").outerHeight()),jQuery("#wplc_chatbox").css("top",jQuery("#wplc_chatbox_header").height()+18+"px")},progress:function(){jQuery("#wplc_chatbox").css("top",jQuery("#wplc_chatbox_header").height()+18+"px")}})),jQuery(".bleeper_pullup").removeClass("up"),jQuery(".bleeper_pullup").addClass("down"),jQuery(".bleeper_pullup").html("<i class='fa fa-angle-up'></i>"),jQuery(".bleeper_pullup").css("bottom","5px")}function wplc_animate_agent_header_down(){wplc_currently_animating_agent_header||jQuery("#wplc_chatbox_header").hasClass("wplc-shrink")||""===jQuery("#wplc_chatbox_header .wplc_agent_info:first-child").html()||(wplc_currently_animating_agent_header=!0,jQuery("#wplc_chatbox_header").addClass("wplc-shrink"),jQuery("#wplc_chatbox").css("top","50px"),jQuery("#wplc_chatbox_header").animate({height:"50px",maxHeight:"50px"},{duration:200,start:function(){jQuery("#wplc_logo").hide()},complete:function(){wplc_currently_animating_agent_header=!1,jQuery("#wplc_chatbox_header").css("max-height","50px"),jQuery("#wplc_chatbox_header").css("height","auto")}})),jQuery(".bleeper_pullup").removeClass("down"),jQuery(".bleeper_pullup").addClass("up"),jQuery(".bleeper_pullup").html("<i class='fa fa-angle-down'></i>"),jQuery(".bleeper_pullup").css("bottom","0px")}jQuery(function(){jQuery("body").on("mousewheel","#wplc_chatbox",function(e,t){1==t?wplc_animate_agent_header_up():wplc_animate_agent_header_down()}),jQuery("body").on("click",".bleeper_pullup",function(){jQuery(".bleeper_pullup").hasClass("down")?wplc_animate_agent_header_down():wplc_animate_agent_header_up()}),jQuery("body").on("click","#wp-live-chat-header",function(){}),jQuery("body").on("click",".wplc_retry_chat",function(){jQuery("#wplc_chatbox").html(""),jQuery("#wp-live-chat-4").fadeOut(),Cookies.remove("wplc_chat_status"),jQuery("#wp-live-chat-2-inner").fadeIn(),wplc_shown_welcome=!1}),jQuery("body").on("click","#wp-live-chat-header",function(){jQuery(this).hasClass("active")?(jQuery("#wplc_hovercard").fadeOut("fast"),jQuery("#wp-live-chat-2").fadeOut("fast"),jQuery(this).removeClass("active"),jQuery.event.trigger({type:"wplc_minimize_chat"}),Cookies.set("wplc_minimize","yes",{expires:1,path:"/"})):(jQuery("#wplc_hovercard").fadeIn("fast"),jQuery(this).addClass("active"),wplc_chat_status=Cookies.get("wplc_chat_status"),nc_status=Cookies.get("nc_status"),3!=parseInt(wplc_chat_status)&&2!=parseInt(wplc_chat_status)&&0!=parseInt(wplc_chat_status)&&12!=parseInt(wplc_chat_status)&&10!=parseInt(wplc_chat_status)&&"active"!==nc_status||(jQuery("#bleeper_bell").hide(),jQuery("#speeching_button").click())),jQuery("#wplc_gdpr_end_chat_notice_container").hide()}),jQuery("body").on("click","#wplc_hovercard_min",function(){jQuery("#wplc_hovercard").fadeOut("fast")}),jQuery("body").on("click","#speeching_button",function(){jQuery("#wplc_hovercard").fadeOut("fast"),jQuery("#wplc-chat-alert").removeClass("is-active"),wplc_is_chat_open=!0,jQuery.event.trigger({type:"wplc_open_chat"})}),jQuery("body").on("click","#wp-live-chat-minimize",function(){jQuery("#wp-live-chat-header").removeClass("active")})}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(e){function t(t){var c=t||window.event,r=o.call(arguments,1),h=0,_=0,p=0,u=0,d=0,w=0;if((t=e.event.fix(c)).type="mousewheel","detail"in c&&(p=-1*c.detail),"wheelDelta"in c&&(p=c.wheelDelta),"wheelDeltaY"in c&&(p=c.wheelDeltaY),"wheelDeltaX"in c&&(_=-1*c.wheelDeltaX),"axis"in c&&c.axis===c.HORIZONTAL_AXIS&&(_=-1*p,p=0),h=0===p?_:p,"deltaY"in c&&(h=p=-1*c.deltaY),"deltaX"in c&&(_=c.deltaX,0===p&&(h=-1*_)),0!==p||0!==_){if(1===c.deltaMode){var y=e.data(this,"mousewheel-line-height");h*=y,p*=y,_*=y}else if(2===c.deltaMode){var g=e.data(this,"mousewheel-page-height");h*=g,p*=g,_*=g}if(u=Math.max(Math.abs(p),Math.abs(_)),(!n||n>u)&&(n=u,i(c,u)&&(n/=40)),i(c,u)&&(h/=40,_/=40,p/=40),h=Math[h>=1?"floor":"ceil"](h/n),_=Math[_>=1?"floor":"ceil"](_/n),p=Math[p>=1?"floor":"ceil"](p/n),s.settings.normalizeOffset&&this.getBoundingClientRect){var m=this.getBoundingClientRect();d=t.clientX-m.left,w=t.clientY-m.top}return t.deltaX=_,t.deltaY=p,t.deltaFactor=n,t.offsetX=d,t.offsetY=w,t.deltaMode=0,r.unshift(t,h,_,p),l&&clearTimeout(l),l=setTimeout(a,200),(e.event.dispatch||e.event.handle).apply(this,r)}}function a(){n=null}function i(e,t){return s.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}var l,n,c=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],r="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],o=Array.prototype.slice;if(e.event.fixHooks)for(var h=c.length;h;)e.event.fixHooks[c[--h]]=e.event.mouseHooks;var s=e.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var a=r.length;a;)this.addEventListener(r[--a],t,!1);else this.onmousewheel=t;e.data(this,"mousewheel-line-height",s.getLineHeight(this)),e.data(this,"mousewheel-page-height",s.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var a=r.length;a;)this.removeEventListener(r[--a],t,!1);else this.onmousewheel=null;e.removeData(this,"mousewheel-line-height"),e.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var a=e(t),i=a["offsetParent"in e.fn?"offsetParent":"parent"]();return i.length||(i=e("body")),parseInt(i.css("fontSize"),10)||parseInt(a.css("fontSize"),10)||16},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})});
 
js/triggers.js CHANGED
@@ -9,7 +9,7 @@ jQuery(document).on( "wplc_admin_chat_loop", function( e ) {
9
  if (jQuery("#wplc_user_typing").length>0) { } else {
10
  var wplc_user_name = jQuery(".admin_chat_name").html();
11
  if(typeof wplc_user_name !== "undefined" && typeof wplc_localized_string_is_typing !== "undefined"){
12
- jQuery(".typing_indicator").html("<span id='wplc_user_typing'>"+wplc_user_name+" "+wplc_localized_string_is_typing+"</span>");
13
  } else {
14
  /* Backwards Compat */
15
  jQuery("#admin_chat_box_area_" + cid).append("<img id='wplc_user_typing' src='"+wplc_misc_strings.typingimg+"' />");
9
  if (jQuery("#wplc_user_typing").length>0) { } else {
10
  var wplc_user_name = jQuery(".admin_chat_name").html();
11
  if(typeof wplc_user_name !== "undefined" && typeof wplc_localized_string_is_typing !== "undefined"){
12
+ jQuery(".typing_indicator").html("<span id='wplc_user_typing'>"+wplc_safe_html(wplc_user_name+" "+wplc_localized_string_is_typing)+"</span>");
13
  } else {
14
  /* Backwards Compat */
15
  jQuery("#admin_chat_box_area_" + cid).append("<img id='wplc_user_typing' src='"+wplc_misc_strings.typingimg+"' />");
js/vendor/wdt-emoji/sheets/{sheet_apple_64_indexed_128.png → sheet-apple-64-indexed-128.png} RENAMED
File without changes
js/vendor/wdt-emoji/wdt-emoji-bundle.min.js CHANGED
@@ -57,7 +57,7 @@
57
  Recent: 10, Custom: 9, People: 8, Nature: 7, Foods: 6, Activity: 5, Places: 4, Objects: 3, Symbols: 2, Flags: 1
58
  }
59
  , skinColor:"skin-1", allowNative:!1, emojiType:"apple", emojiSheets: {
60
- apple: "/sheets/sheet_apple_64_indexed_128.png", google: "/sheets/sheet_google_64_indexed_128.png", twitter: "/sheets/sheet_twitter_64_indexed_128.png", emojione: "/sheets/sheet_emojione_64_indexed_128.png", facebook: "/sheets/sheet_facebook_64_indexed_128.png", messenger: "/sheets/sheet_messenger_64_indexed_128.png"
61
  }
62
  , emojiData: {
63
  Symbols:[ {
57
  Recent: 10, Custom: 9, People: 8, Nature: 7, Foods: 6, Activity: 5, Places: 4, Objects: 3, Symbols: 2, Flags: 1
58
  }
59
  , skinColor:"skin-1", allowNative:!1, emojiType:"apple", emojiSheets: {
60
+ apple: "/sheets/sheet-apple-64-indexed-128.png", google: "/sheets/sheet-google-64-indexed-128.png", twitter: "/sheets/sheet-twitter-64-indexed-128.png", emojione: "/sheets/sheet-emojione-64-indexed-128.png", facebook: "/sheets/sheet-facebook-64-indexed-128.png", messenger: "/sheets/sheet-messenger-64-indexed-128.png"
61
  }
62
  , emojiData: {
63
  Symbols:[ {
js/vendor/wdt-emoji/wdt-emoji-concat.min.js CHANGED
@@ -60,7 +60,7 @@
60
  Recent: 10, Custom: 9, People: 8, Nature: 7, Foods: 6, Activity: 5, Places: 4, Objects: 3, Symbols: 2, Flags: 1
61
  }
62
  , skinColor:"skin-1", allowNative:!1, emojiType:"apple", emojiSheets: {
63
- apple: "/sheets/sheet_apple_64_indexed_128.png", google: "/sheets/sheet_google_64_indexed_128.png", twitter: "/sheets/sheet_twitter_64_indexed_128.png", emojione: "/sheets/sheet_emojione_64_indexed_128.png", facebook: "/sheets/sheet_facebook_64_indexed_128.png", messenger: "/sheets/sheet_messenger_64_indexed_128.png"
64
  }
65
  , emojiData: {
66
  Symbols:[ {
60
  Recent: 10, Custom: 9, People: 8, Nature: 7, Foods: 6, Activity: 5, Places: 4, Objects: 3, Symbols: 2, Flags: 1
61
  }
62
  , skinColor:"skin-1", allowNative:!1, emojiType:"apple", emojiSheets: {
63
+ apple: "/sheets/sheet-apple-64-indexed-128.png", google: "/sheets/sheet-google-64-indexed-128.png", twitter: "/sheets/sheet-twitter-64-indexed-128.png", emojione: "/sheets/sheet-emojione-64-indexed-128.png", facebook: "/sheets/sheet-facebook-64-indexed-128.png", messenger: "/sheets/sheet-messenger-64-indexed-128.png"
64
  }
65
  , emojiData: {
66
  Symbols:[ {
js/wplc_admin_dynamic_translations.js CHANGED
@@ -1,5 +1,5 @@
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]);
1
  jQuery(function(){
2
+ jQuery(document).on("tcx_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]);
js/wplc_admin_editor.js CHANGED
@@ -1,5 +1,5 @@
 
1
  jQuery(function(){
2
- /*Text editor Support*/
3
  jQuery("#nifty_tedit_b").click(function(evt){
4
  evt.stopImmediatePropagation();
5
  niftyTextEdit("b");
@@ -34,80 +34,7 @@ jQuery(function(){
34
  });
35
 
36
  });
37
-
38
-
39
- function wplcFormatParser(msg){
40
- if(msg.indexOf("link:") !== -1){
41
- msg = msg.replace(/link:/g, "<a target='_blank' href='");
42
- }
43
- if(msg.indexOf(":link") !== -1){
44
- msg = msg.replace(/:link/g, "'>Link</a>");
45
- }
46
- if(msg.indexOf("img:") !== -1){
47
- msg = msg.replace(/img:/g, "<img style='max-width:100%; position: relative; left: 0 !important; border-radius: 0 !important;' src='");
48
- }
49
- if(msg.indexOf(":img") !== -1){
50
- msg = msg.replace(/:img/g, "' />");
51
- }
52
-
53
- if(msg.indexOf("video:") !== -1){
54
- msg = msg.replace(/video:/g, "<video style='background-color: black; max-width:100%;' src='");
55
- }
56
- if(msg.indexOf(":video") !== -1){
57
- msg = msg.replace(/:video/g, "' controls></video>");
58
- }
59
-
60
-
61
- if(msg.indexOf("mark:") !== -1){
62
- msg = msg.replace(/mark:/g, "<mark>");
63
- }
64
- if(msg.indexOf(":mark") !== -1){
65
- msg = msg.replace(/:mark/g, "</mark>");
66
- }
67
-
68
- if(msg.indexOf("strike:") !== -1){
69
- msg = msg.replace(/strike:/g, "<del>");
70
- }
71
- if(msg.indexOf(":strike") !== -1){
72
- msg = msg.replace(/:strike/g, "</del>");
73
- }
74
-
75
- if(msg.indexOf("sub:") !== -1){
76
- msg = msg.replace(/sub:/g, "<sub>");
77
- }
78
- if(msg.indexOf(":sub") !== -1){
79
- msg = msg.replace(/:sub/g, "</sub>");
80
- }
81
- if(msg.indexOf("sup:") !== -1){
82
- msg = msg.replace(/sup:/g, "<sup>");
83
- }
84
- if(msg.indexOf(":sup") !== -1){
85
- msg = msg.replace(/:sup/g, "</sup>");
86
- }
87
- //run singles last
88
-
89
- if(msg.indexOf("b:") !== -1){
90
- msg = msg.replace(/b:/g, "<strong>");
91
- }
92
- if(msg.indexOf(":b") !== -1){
93
- msg = msg.replace(/:b/g, "</strong>");
94
- }
95
- if(msg.indexOf("i:") !== -1){
96
- msg = msg.replace(/i:/g, "<em>");
97
- }
98
- if(msg.indexOf(":i") !== -1){
99
- msg = msg.replace(/:i/g, "</em>");
100
- }
101
-
102
- if(msg.indexOf("u:") !== -1){
103
- msg = msg.replace(/u:/g, "<ins>");
104
- }
105
- if(msg.indexOf(":u") !== -1){
106
- msg = msg.replace(/:u/g, "</ins>");
107
- }
108
- return msg;
109
-
110
- }
111
 
112
  var selectedIndexStart;
113
  var selectedIndexEnd;
1
+ /*
2
  jQuery(function(){
 
3
  jQuery("#nifty_tedit_b").click(function(evt){
4
  evt.stopImmediatePropagation();
5
  niftyTextEdit("b");
34
  });
35
 
36
  });
37
+ */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
  var selectedIndexStart;
40
  var selectedIndexEnd;
js/wplc_admin_pro.js CHANGED
@@ -191,65 +191,6 @@ jQuery(function() {
191
  }
192
  });
193
 
194
- /* Make sure switchery has been loaded on this page */
195
- if(typeof Switchery !== 'undefined'){
196
- var wplc_switchery_element = document.querySelector('.wplc_switchery');
197
- /* Make sure that the switch is being displayed */
198
- if(wplc_switchery_element !== null){
199
-
200
- var wplc_switchery_init = new Switchery(wplc_switchery_element, { color: '#00B344', secondaryColor: '#D91600': size: 'small' });
201
-
202
- var changeCheckbox = document.querySelector('#wplc_agent_status');
203
-
204
- changeCheckbox.onchange = function () {
205
-
206
- var wplc_accepting_chats = jQuery(this).attr('checked');
207
-
208
- if(wplc_accepting_chats === 'checked'){
209
- jQuery("#wplc_agent_status_text").html(wplc_admin_strings.accepting_chats);
210
- var wplc_ma_set_transient = null;
211
-
212
- wplc_ma_set_transient = setInterval(function (){wplc_ma_update_agent_transient();}, 60000);
213
-
214
- function wplc_ma_update_agent_transient() {
215
- var data = {
216
- action: 'wplc_ma_set_transient',
217
- security: wplc_admin_strings.nonce,
218
- user_id: wplc_admin_strings.user_id
219
- };
220
- jQuery.post(ajaxurl, data, function(response) {
221
- location.reload(true);
222
- });
223
- }
224
-
225
- wplc_ma_update_agent_transient();
226
-
227
- } else {
228
- jQuery("#wplc_agent_status_text").html(wplc_admin_strings.not_accepting_chats);
229
-
230
- var wplc_ma_remove_transient = null;
231
-
232
- wplc_ma_remove_transient = setInterval(function (){wplc_ma_remove_agent_transient();}, 60000);
233
-
234
-
235
- function wplc_ma_remove_agent_transient() {
236
- var data = {
237
- action: 'wplc_ma_remove_transient',
238
- security: wplc_admin_strings.nonce,
239
- user_id: wplc_admin_strings.user_id
240
- };
241
- jQuery.post(ajaxurl, data, function(response) {
242
- location.reload(true);
243
- });
244
- }
245
-
246
- wplc_ma_remove_agent_transient();
247
-
248
- }
249
- };
250
- }
251
- }
252
-
253
  jQuery("body").on("click", "#wplc_add_agent", function(e) {
254
 
255
  var uid = parseInt(jQuery("#wplc_agent_select").val());
@@ -315,7 +256,7 @@ jQuery(function() {
315
  status: '1'
316
  };
317
  jQuery.post(ajaxurl, data, function(response) {
318
- jQuery("#external_server_message").html("<p class='description'>You are now using WP Live Chat Support\'s chat server to host your chats</p>");
319
  });
320
  } else {
321
  var data = {
191
  }
192
  });
193
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  jQuery("body").on("click", "#wplc_add_agent", function(e) {
195
 
196
  var uid = parseInt(jQuery("#wplc_agent_select").val());
256
  status: '1'
257
  };
258
  jQuery.post(ajaxurl, data, function(response) {
259
+ jQuery("#external_server_message").html("<p class='description'>You are now using WP Live Chat by 3CX\'s chat server to host your chats</p>");
260
  });
261
  } else {
262
  var data = {
js/wplc_admin_pro_events.js CHANGED
@@ -1,7 +1,7 @@
1
  var init_chat_success_timeout = {};
2
 
3
  //jQuery(function(){
4
- jQuery(document).on("bleeper_dom_ready", function(e) {
5
 
6
 
7
  /**
@@ -37,7 +37,7 @@ jQuery(document).on("bleeper_dom_ready", function(e) {
37
 
38
  }
39
 
40
- jQuery(document).on("bleeper_messages_added", function(e) {
41
  var new_chat_id = typeof e.ndata.cid !== "undefined" ? e.ndata.cid : false;
42
 
43
  var data = {
@@ -52,9 +52,13 @@ jQuery(document).on("bleeper_dom_ready", function(e) {
52
  if(typeof content_returned['data'] !== "undefined"){
53
  var returned_html = content_returned["data"];
54
  the_message = wplc_generate_system_notification_object(returned_html, {}, 0);
55
- the_message.other['ignore_style_tags'] = true;
 
 
 
 
56
  wplc_push_message_to_chatbox(the_message,'a', function() {
57
- //jQuery.event.trigger({type: "bleeper_scroll_bottom"});
58
  });
59
 
60
  }
@@ -65,7 +69,7 @@ jQuery(document).on("bleeper_dom_ready", function(e) {
65
  }
66
  });
67
 
68
- jQuery(document).on("bleeper_initiate_chat", function(e) {
69
  if (typeof e.ndata === "object" && typeof e.ndata.chatid !== "undefined" && typeof e.ndata.agent !== "undefined") {
70
  var data = {
71
  aid: e.ndata.agent,
@@ -77,45 +81,45 @@ jQuery(document).on("bleeper_dom_ready", function(e) {
77
 
78
  the_message = wplc_generate_system_notification_object("Attempting to open the chat box on the visitor's side.", {}, 0);
79
 
80
- bleeper_add_message_to_sessionStorage(e.ndata.chatid, the_message);
81
 
82
  if (e.ndata.chatid === active_chatid) {
83
  wplc_push_message_to_chatbox(the_message,'a', function() {
84
- jQuery.event.trigger({type: "bleeper_scroll_bottom"});
85
  });
86
  }
87
  init_chat_success_timeout[e.ndata.chatid] = setTimeout(function() {
88
  the_message = wplc_generate_system_notification_object("The chat box could not be opened on the visitor's side. The user may have already left.", {}, 0);
89
 
90
- bleeper_add_message_to_sessionStorage(e.ndata.chatid, the_message);
91
 
92
  if (e.ndata.chatid === active_chatid) {
93
  wplc_push_message_to_chatbox(the_message,'a', function() {
94
- jQuery.event.trigger({type: "bleeper_scroll_bottom"});
95
  });
96
  }
97
  },12000)
98
  }
99
  });
100
 
101
- jQuery(document).on("bleeper_notify_agent_initiate_received", function(e) {
102
 
103
  clearTimeout(init_chat_success_timeout[e.ndata.chatid]);
104
  the_message = wplc_generate_system_notification_object("The chat box has been successfully opened on the visitor's side.", {}, 0);
105
 
106
- bleeper_add_message_to_sessionStorage(e.ndata.chatid, the_message);
107
 
108
  if (e.ndata.chatid === active_chatid) {
109
  wplc_push_message_to_chatbox(the_message,'a', function() {
110
- jQuery.event.trigger({type: "bleeper_scroll_bottom"});
111
  });
112
  }
113
 
114
- socket.emit('chat accepted',{chatid: e.ndata.chatid,agent_id:e.ndata.agent,agent_name:bleeper_agent_name});
115
- jQuery.event.trigger({type: "bleeper_send_get_chat_history", ndata:{chatid:e.ndata.chatid,agent_name:bleeper_agent_name,agent_id:e.ndata.agent}});
116
  });
117
 
118
- jQuery(document).on("bleeper_add_initiate_button", function(e) {
119
 
120
  var tmp_chatid = typeof e.cid !== "undefined" ? e.cid : false;
121
 
@@ -143,7 +147,7 @@ jQuery(document).on("bleeper_dom_ready", function(e) {
143
 
144
  });
145
 
146
- jQuery(document).on("bleeper_add_initiate_button_no_col", function(e) {
147
  if (typeof e.cid !== "undefined") {
148
  nc_clear_action_col_visitor_row(e.cid);
149
  jQuery('<div/>', {
@@ -157,7 +161,7 @@ jQuery(document).on("bleeper_dom_ready", function(e) {
157
  * Handles the pasting of images inside the text area
158
  *
159
  */
160
- jQuery(document).on("bleeper_input_paste", function(e) {
161
 
162
  var event = e.event;
163
  // use event.originalEvent.clipboard for newer chrome versions
@@ -187,41 +191,41 @@ jQuery(document).on("bleeper_dom_ready", function(e) {
187
  *
188
  * @return void
189
  */
190
- jQuery(document).on("bleeper_typing_preview_received", function(e) {
191
- if(typeof bleeper_disable_typing_preview === "undefined"){
192
- if (typeof e.ndata === "object" && typeof e.ndata.chatid !== "undefined" && typeof e.ndata.preview !== "undefined" && e.ndata.preview.tempmessage !== "undefined") {
193
- if (active_chatid === e.ndata.chatid) {
194
- message_preview_currently_being_typifcationed = e.ndata.preview.tempmessage;
195
- var tmsg = e.ndata.username+ " is typing: "+message_preview_currently_being_typifcationed;
196
-
197
-
198
- if (jQuery(".typing_preview_"+e.ndata.chatid).length) {
199
- /* typing element exists, lets modify it */
200
- jQuery(".typing_preview_"+e.ndata.chatid).html(tmsg);
201
- //jQuery.event.trigger({type: "bleeper_scroll_bottom"});
202
-
203
- } else {
204
- /* create the typing element and add contents to it */
205
- if(message_preview_currently_being_typifcationed.trim() !== ""){
206
- jQuery("#messages").append("<span class='wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1 typing_preview_"+e.ndata.chatid+"'>"+tmsg+"</span>");
207
- //jQuery.event.trigger({type: "bleeper_scroll_bottom"});
208
- }
209
- }
210
- }
211
  }
 
212
  }
 
 
213
 
214
- });
215
 
216
  /**
217
  * Clearing of the typing preview
218
  *
219
  * @return void
220
  */
221
- jQuery(document).on("bleeper_clear_typing_preview", function(e) {
222
  jQuery(".typing_preview_"+e.cid).html('');
223
  jQuery(".typing_preview_"+e.cid).remove();
224
- //jQuery.event.trigger({type: "bleeper_scroll_bottom"});
225
  });
226
 
227
 
@@ -230,19 +234,19 @@ jQuery(document).on("bleeper_dom_ready", function(e) {
230
  *
231
  * @return void
232
  */
233
- jQuery(document).on("bleeper_typing", function(e) {
234
-
235
- var tmsg = e.ndata.username+ " is typing";
236
  if (jQuery(".typing_preview_"+e.ndata.chatid).length) {
237
  /* typing element exists, lets modify it */
238
  jQuery(".typing_preview_"+e.ndata.chatid).html(tmsg);
239
- //jQuery.event.trigger({type: "bleeper_scroll_bottom"});
240
 
241
  } else {
242
  /* create the typing element and add contents to it */
243
 
244
  jQuery("#messages").append("<span class='wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1 typing_preview_"+e.ndata.chatid+"'>"+tmsg+"</span>");
245
- //jQuery.event.trigger({type: "bleeper_scroll_bottom"});
246
  }
247
  });
248
 
@@ -251,14 +255,14 @@ jQuery(document).on("bleeper_dom_ready", function(e) {
251
  *
252
  * @return void
253
  */
254
- jQuery(document).on("bleeper_stop_typing", function(e) {
255
  jQuery(".typing_preview_"+e.chatid).html('');
256
  jQuery(".typing_preview_"+e.chatid).remove();
257
- //jQuery.event.trigger({type: "bleeper_scroll_bottom"});
258
  });
259
 
260
  //Handler for edits
261
- jQuery(document).on("bleeper_edited_message", function(e){
262
  if(typeof e.ndata !== "undefined"){
263
  if(typeof e.ndata.message !== "undefined" && typeof e.ndata.chatid !== "undefined" && typeof e.ndata.msgID !== "undefined"){
264
  var current_msg = e.ndata.message;
@@ -278,11 +282,11 @@ jQuery(document).on("bleeper_dom_ready", function(e) {
278
 
279
  jQuery(document).on("mouseleave",".wplc-admin-message", function() {
280
  var tmid = jQuery(this).attr('mid');
281
- jQuery(".message_"+tmid+ " .bleeper-edit-message").hide();
282
  });
283
  jQuery(document).on("mouseenter",".wplc-admin-message", function() {
284
  var tmid = jQuery(this).attr('mid');
285
- jQuery(".message_"+tmid+ " .bleeper-edit-message").show();
286
  });
287
 
288
 
1
  var init_chat_success_timeout = {};
2
 
3
  //jQuery(function(){
4
+ jQuery(document).on("tcx_dom_ready", function(e) {
5
 
6
 
7
  /**
37
 
38
  }
39
 
40
+ jQuery(document).on("tcx_messages_added", function(e) {
41
  var new_chat_id = typeof e.ndata.cid !== "undefined" ? e.ndata.cid : false;
42
 
43
  var data = {
52
  if(typeof content_returned['data'] !== "undefined"){
53
  var returned_html = content_returned["data"];
54
  the_message = wplc_generate_system_notification_object(returned_html, {}, 0);
55
+ if (!!the_message.other) {
56
+ the_message.other.preformatted = true;
57
+ } else {
58
+ the_message.other = {preformatted: true};
59
+ }
60
  wplc_push_message_to_chatbox(the_message,'a', function() {
61
+ //jQuery.event.trigger({type: "tcx_scroll_bottom"});
62
  });
63
 
64
  }
69
  }
70
  });
71
 
72
+ jQuery(document).on("tcx_initiate_chat", function(e) {
73
  if (typeof e.ndata === "object" && typeof e.ndata.chatid !== "undefined" && typeof e.ndata.agent !== "undefined") {
74
  var data = {
75
  aid: e.ndata.agent,
81
 
82
  the_message = wplc_generate_system_notification_object("Attempting to open the chat box on the visitor's side.", {}, 0);
83
 
84
+ tcx_add_message_to_sessionStorage(e.ndata.chatid, the_message);
85
 
86
  if (e.ndata.chatid === active_chatid) {
87
  wplc_push_message_to_chatbox(the_message,'a', function() {
88
+ jQuery.event.trigger({type: "tcx_scroll_bottom"});
89
  });
90
  }
91
  init_chat_success_timeout[e.ndata.chatid] = setTimeout(function() {
92
  the_message = wplc_generate_system_notification_object("The chat box could not be opened on the visitor's side. The user may have already left.", {}, 0);
93
 
94
+ tcx_add_message_to_sessionStorage(e.ndata.chatid, the_message);
95
 
96
  if (e.ndata.chatid === active_chatid) {
97
  wplc_push_message_to_chatbox(the_message,'a', function() {
98
+ jQuery.event.trigger({type: "tcx_scroll_bottom"});
99
  });
100
  }
101
  },12000)
102
  }
103
  });
104
 
105
+ jQuery(document).on("tcx_notify_agent_initiate_received", function(e) {
106
 
107
  clearTimeout(init_chat_success_timeout[e.ndata.chatid]);
108
  the_message = wplc_generate_system_notification_object("The chat box has been successfully opened on the visitor's side.", {}, 0);
109
 
110
+ tcx_add_message_to_sessionStorage(e.ndata.chatid, the_message);
111
 
112
  if (e.ndata.chatid === active_chatid) {
113
  wplc_push_message_to_chatbox(the_message,'a', function() {
114
+ jQuery.event.trigger({type: "tcx_scroll_bottom"});
115
  });
116
  }
117
 
118
+ socket.emit('chat accepted',{chatid: e.ndata.chatid,agent_id:e.ndata.agent,agent_name:tcx_agent_name});
119
+ jQuery.event.trigger({type: "tcx_send_get_chat_history", ndata:{chatid:e.ndata.chatid,agent_name:tcx_agent_name,agent_id:e.ndata.agent}});
120
  });
121
 
122
+ jQuery(document).on("tcx_add_initiate_button", function(e) {
123
 
124
  var tmp_chatid = typeof e.cid !== "undefined" ? e.cid : false;
125
 
147
 
148
  });
149
 
150
+ jQuery(document).on("tcx_add_initiate_button_no_col", function(e) {
151
  if (typeof e.cid !== "undefined") {
152
  nc_clear_action_col_visitor_row(e.cid);
153
  jQuery('<div/>', {
161
  * Handles the pasting of images inside the text area
162
  *
163
  */
164
+ jQuery(document).on("tcx_input_paste", function(e) {
165
 
166
  var event = e.event;
167
  // use event.originalEvent.clipboard for newer chrome versions
191
  *
192
  * @return void
193
  */
194
+ jQuery(document).on("tcx_typing_preview_received", function (e) {
195
+ if (config.enable_typing_preview==1) {
196
+ if (typeof e.ndata === "object" && typeof e.ndata.chatid !== "undefined" && typeof e.ndata.preview !== "undefined" && e.ndata.preview.tempmessage !== "undefined") {
197
+ if (active_chatid === e.ndata.chatid) {
198
+ message_preview_currently_being_typifcationed = e.ndata.preview.tempmessage;
199
+ var tmsg = e.ndata.username + " is typing: " + message_preview_currently_being_typifcationed;
200
+
201
+
202
+ if (jQuery(".typing_preview_" + e.ndata.chatid).length) {
203
+ /* typing element exists, lets modify it */
204
+ jQuery(".typing_preview_" + e.ndata.chatid).html(tmsg);
205
+ //jQuery.event.trigger({type: "tcx_scroll_bottom"});
206
+
207
+ } else {
208
+ /* create the typing element and add contents to it */
209
+ if (message_preview_currently_being_typifcationed.trim() !== "") {
210
+ jQuery("#messages").append("<span class='wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1 typing_preview_" + e.ndata.chatid + "'>" + tmsg + "</span>");
211
+ //jQuery.event.trigger({type: "tcx_scroll_bottom"});
 
 
 
212
  }
213
+ }
214
  }
215
+ }
216
+ }
217
 
218
+ });
219
 
220
  /**
221
  * Clearing of the typing preview
222
  *
223
  * @return void
224
  */
225
+ jQuery(document).on("tcx_clear_typing_preview", function(e) {
226
  jQuery(".typing_preview_"+e.cid).html('');
227
  jQuery(".typing_preview_"+e.cid).remove();
228
+ //jQuery.event.trigger({type: "tcx_scroll_bottom"});
229
  });
230
 
231
 
234
  *
235
  * @return void
236
  */
237
+ jQuery(document).on("tcx_typing", function(e) {
238
+ var tmsg = wplc_safe_html(decodeURI(e.ndata.username)+ config.wplc_localized_string_is_typing_single);
239
+
240
  if (jQuery(".typing_preview_"+e.ndata.chatid).length) {
241
  /* typing element exists, lets modify it */
242
  jQuery(".typing_preview_"+e.ndata.chatid).html(tmsg);
243
+ //jQuery.event.trigger({type: "tcx_scroll_bottom"});
244
 
245
  } else {
246
  /* create the typing element and add contents to it */
247
 
248
  jQuery("#messages").append("<span class='wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1 typing_preview_"+e.ndata.chatid+"'>"+tmsg+"</span>");
249
+ //jQuery.event.trigger({type: "tcx_scroll_bottom"});
250
  }
251
  });
252
 
255
  *
256
  * @return void
257
  */
258
+ jQuery(document).on("tcx_stop_typing", function(e) {
259
  jQuery(".typing_preview_"+e.chatid).html('');
260
  jQuery(".typing_preview_"+e.chatid).remove();
261
+ //jQuery.event.trigger({type: "tcx_scroll_bottom"});
262
  });
263
 
264
  //Handler for edits
265
+ jQuery(document).on("tcx_edited_message", function(e){
266
  if(typeof e.ndata !== "undefined"){
267
  if(typeof e.ndata.message !== "undefined" && typeof e.ndata.chatid !== "undefined" && typeof e.ndata.msgID !== "undefined"){
268
  var current_msg = e.ndata.message;
282
 
283
  jQuery(document).on("mouseleave",".wplc-admin-message", function() {
284
  var tmid = jQuery(this).attr('mid');
285
+ jQuery(".message_"+tmid+ " .tcx-edit-message").hide();
286
  });
287
  jQuery(document).on("mouseenter",".wplc-admin-message", function() {
288
  var tmid = jQuery(this).attr('mid');
289
+ jQuery(".message_"+tmid+ " .tcx-edit-message").show();
290
  });
291
 
292
 
js/wplc_admin_pro_features.js CHANGED
@@ -34,6 +34,7 @@ jQuery(function () {
34
  clearTimeout(wplc_searchTimeout);
35
  wplc_usertyping('admin',0,cid);
36
  }
 
37
  function wplc_usertyping(wplc_typing_user,wplc_typing_type,wplc_typing_cid) {
38
  if (typeof wplc_cid !== "undefined" && wplc_cid !== null) {
39
  var data = {
@@ -45,12 +46,13 @@ jQuery(function () {
45
  wplc_extra_data:wplc_extra_data
46
  };
47
 
48
- if (typeof wplc_restapi_enabled !== "undefined" && wplc_restapi_enabled === '1' && typeof wplc_using_cloud === "undefined") {
49
  data.security = (typeof wplc_restapi_token !== "undefined" ? wplc_restapi_token : false);
 
50
  jQuery.post(wplc_restapi_endpoint+"/typing/", data, function(response) {});
51
- } else {
52
  jQuery.post(wplc_ajaxurl, data, function(response) {});
53
- }
54
 
55
  } else {
56
  /* no cid? */
34
  clearTimeout(wplc_searchTimeout);
35
  wplc_usertyping('admin',0,cid);
36
  }
37
+
38
  function wplc_usertyping(wplc_typing_user,wplc_typing_type,wplc_typing_cid) {
39
  if (typeof wplc_cid !== "undefined" && wplc_cid !== null) {
40
  var data = {
46
  wplc_extra_data:wplc_extra_data
47
  };
48
 
49
+ /*if (!!wplc_restapi_enabled.value && typeof wplc_using_cloud === "undefined") {
50
  data.security = (typeof wplc_restapi_token !== "undefined" ? wplc_restapi_token : false);
51
+ console.log('twplc_usertyping', wplc_restapi_endpoint, data);
52
  jQuery.post(wplc_restapi_endpoint+"/typing/", data, function(response) {});
53
+ } else {*/
54
  jQuery.post(wplc_ajaxurl, data, function(response) {});
55
+ //}
56
 
57
  } else {
58
  /* no cid? */
js/wplc_agent_node.js CHANGED
@@ -1,4059 +1,3566 @@
1
- /**
2
- * WPLC - Agent JavaScript (Main)
3
- *
4
- * Copyright (c) 2017 Code Cabin Inc.
5
- *
6
- * Questions?
7
- * Email nick@wp-livechat.com
8
- * Version 1.0
9
- * Released August 2017
10
- *
11
- *
12
- *
13
- */
14
-
15
-
16
- /**
17
- * General variables
18
- */
19
- var socket;
20
- var active_socket;
21
- var active_chatid;
22
- var active_customerID = null;
23
- var remove_visitor_timer = [];
24
- var visitor_list = {};
25
- var unread_count = [];
26
- var involved_list = {};
27
- var last_chat_messages = {};
28
- var bleeper_emoji_converter;
29
- var bleeper_delegates;
30
- var connection_lost_type;
31
- var information_received_pointer = false;
32
- var latency_dead_check;
33
- var bleepblop_running = false;
34
- var ping_list = {};
35
- var old_version_detected = false;
36
-
37
- var current_init_attempt_id = false;
38
-
39
- /**
40
- * Setup supported file suffix types
41
- */
42
- var bleeper_file_suffix_check = [
43
- "zip", "pdf", "txt", "mp3", "mpa", "ogg", "wav", "wma", "7z", "rar",
44
- "db", "xml", "csv", "sql", "apk", "exe", "jar", "otf", "ttf", "fon",
45
- "fnt", "ai", "psd", "tif", "tiff", "ps", "msi", "doc", "docx",
46
- ];
47
-
48
- /**
49
- * Variable to help identfy if we are editing a message
50
- * @type {Boolean}
51
- */
52
- var niftyIsEditing = false;
53
-
54
- /**
55
- * Identify the last message sent, so when we press UP we can edit it
56
- */
57
- var lastmessagesent;
58
-
59
- /**
60
- * Visitor data timer
61
- */
62
- var get_visitor_timer = undefined;
63
-
64
- /** Prompt and cancel callback reference */
65
- var nifty_prompt_callback = null;
66
- var nifty_cancel_callback = null;
67
-
68
- var nifty_my_socket = null;
69
-
70
- var bleeper_ping = new Audio(wplc_baseurl + "/audio/ding.mp3");
71
- var bleeper_ring = new Audio(wplc_baseurl +"/audio/ring.wav");
72
-
73
- var bleeper_dash_fullscreen_minimal = false;
74
- var bleeper_show_drag_zone = false;
75
- var bleeper_showing_quick_responses = false;
76
-
77
- var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
78
-
79
- var message_type = 'u';
80
-
81
- var bleeper_limited = true;
82
-
83
- $ = typeof $ !== "undefined" ? $ : jQuery;
84
-
85
- var $messages;
86
- var $inputMessage;
87
-
88
- var FADE_TIME = 150; // ms
89
- var TYPING_TIMER_LENGTH = 400; // ms
90
-
91
- var query_string;
92
- var username = bleeper_agent_name;
93
- var connected = false;
94
- var typing = false;
95
- var lastTypingTime;
96
-
97
- var nc_sid;
98
- var nc_name;
99
- var nc_chatid;
100
-
101
-
102
- var bleeper_favico_noti = '../wp-content/plugins/wp-live-chat-support/images/48px_n.png';
103
- var bleeper_favico = '../wp-content/plugins/wp-live-chat-support/images/48px.png';
104
-
105
- // used to validate visitors so we can double-verify their existence
106
- var visitor_validator = {};
107
- var is_domain_filter_active = false;
108
-
109
- var node_uri = "";
110
-
111
- var bleeper_active_filter = false;
112
- var bleeper_visitor_filters = {
113
- new_visitors : 0,
114
- active_chats : 1,
115
- referer : 2
116
- };
117
-
118
- /* Regex for inline links */
119
- var bleeper_link_match_regex = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!,.;:<>]*[-A-Z0-9+&@#\/%=~_|<>])/ig;
120
-
121
- (function($) {
122
- $(document).on("bleeper_dom_ready", function(e) {
123
-
124
-
125
-
126
- if (typeof bleeper_ring_override !== "undefined") {
127
- bleeper_ring = new Audio(bleeper_ring_override);
128
- }
129
- if (typeof bleeper_message_override !== "undefined") {
130
- bleeper_ping = new Audio(bleeper_message_override);
131
- }
132
-
133
- // Initialize variables
134
- var $window = $(window);
135
- $messages = $('.messages'); // Messages area
136
- $inputMessage = $('.inputMessage'); // Input message input box
137
-
138
- /* find out if we have had a chat with this visitor before */
139
- sid = nc_getCookie("nc_sid");
140
- chatid = nc_getCookie("nc_chatid");
141
-
142
- jQuery(".chatArea .messages img").on("load", function() {
143
- if(typeof $messages !== "undefined" && typeof $messages[0] !== "undefined" && typeof $messages[0].scrollHeight !== "undefined"){
144
- setTimeout(function(){
145
- $messages[0].scrollTop = $messages[0].scrollHeight;
146
- }, 300);
147
- }
148
- });
149
-
150
- if (typeof override_chatid !== "undefined") {
151
- chatid = override_chatid;
152
- }
153
-
154
- query_string = "nc_api_key="+nifty_api_key+"&nc_agent_id="+agent_id;
155
-
156
- if(typeof wplc_guid !== "undefined"){
157
- query_string += "&guid=" + wplc_guid;
158
- }
159
-
160
- if(typeof bleeper_agent_verification_end_point !== "undefined"){
161
- query_string += "&agent_verification_end_point=" + bleeper_agent_verification_end_point;
162
- }
163
-
164
- if(typeof agent_id !== "undefined"){
165
- query_string += "&agent_id=" + agent_id;
166
- }
167
-
168
- if(typeof window !== "undefined" && typeof window.location !== "undefined" && typeof window.location.href !== "undefined"){
169
- query_string += "&referer=" + window.location.href;
170
- }
171
-
172
-
173
- jQuery.event.trigger({type: "bleeper_connect", ndata:{query_string:query_string}});
174
-
175
- // Keyboard events
176
- $inputMessage.keydown(function (event) {
177
- // When the client hits ENTER on their keyboard
178
- if (event.which === 13) {
179
- event.preventDefault();
180
- jQuery("#wplc_send_msg").click();
181
- } else if (event.which === 38 && !event.shiftKey) {
182
- if (typeof lastmessagesent !== "undefined") {
183
- /*if(typeof wplc_integration_pro_active !== "undefined" && wplc_integration_pro_active === "true"){
184
- var mid = lastmessagesent;
185
- var mdiv = jQuery('.message_'+mid+ " .messageBody").html();
186
- jQuery("#inputMessage").val(mdiv);
187
- // set the niftyIsEditing variable to the msgID so we can identify if we are in the process of editing a message
188
- niftyIsEditing = mid;
189
- }*/
190
- }
191
-
192
- } else if (event.which === 27 && !event.shiftKey) {
193
- jQuery("#wplc_chatmsg").val('');
194
- niftyIsEditing = false;
195
- }
196
- });
197
-
198
- $inputMessage.keyup(function (event) {
199
- // When the client hits ENTER on their keyboard
200
- if (event.which === 13) {
201
- } else {
202
- //socket.emit('typing_preview', {tempmessage: $inputMessage.val()});
203
- }
204
- });
205
-
206
- $inputMessage.on('input', function() {
207
- t_ag_cid = nifty_api_key+''+parseInt(agent_id)+''+parseInt(agent_id);
208
- t_ag_cid = md5(t_ag_cid);
209
-
210
- if (active_chatid === t_ag_cid) {
211
- /* do nothing as we are chatting with ourselves */
212
- } else {
213
- updateTyping();
214
- }
215
- });
216
-
217
- $(document).on("click","#wplc_send_msg", function() {
218
- sendMessage();
219
- socket.emit('stop typing',{chatid:active_chatid});
220
- typing = false;
221
- });
222
-
223
-
224
- /* $(document).on("mouseout",".bleeper-edit-message", function() {
225
- $(this).hide();
226
-
227
- });
228
- $(document).on("mouseenter",".bleeper-edit-message", function() {
229
- $(this).show();
230
- });
231
- $(document).on("mouseleave",".message", function() {
232
- var tmid = $(this).attr('mid');
233
- $(".message_"+tmid+ " .bleeper-edit-message").hide();
234
- });
235
- $(document).on("mouseenter",".message", function() {
236
- var tmid = $(this).attr('mid');
237
- $(".message_"+tmid+ " .bleeper-edit-message").show();
238
- });
239
- $(document).on("click", ".bleeper-edit-message", function() {
240
- var mid = $(this).parent().attr('mid');
241
- var mdiv = $(this).siblings('.messageBody').attr("data-message");
242
- $("#inputMessage").val(mdiv);
243
- // set the niftyIsEditing variable to the msgID so we can identify if we are in the process of editing a message
244
- niftyIsEditing = mid;
245
-
246
- }); */
247
-
248
- // Click events
249
- // Focus input when clicking on the message input's border
250
- $inputMessage.click(function () {
251
- $inputMessage.focus();
252
- });
253
-
254
- document.addEventListener('click', function (e) {
255
- if (e.target.classList.contains('open_chat')) {
256
- var tcid = e.target.getAttribute('cid');
257
- nc_add_user_to_list(visitor_list[tcid], function() {
258
- $("#"+tcid).click();
259
- });
260
- }
261
- }, false);
262
-
263
- $("body").on("click", ".init_chat", function() {
264
- var tcid = $(this).attr('cid');
265
-
266
- current_init_attempt_id = tcid;
267
-
268
- jQuery.event.trigger({type: "bleeper_initiate_chat", ndata:{chatid:tcid, agent:agent_id}});
269
- socket.emit('initiate chat',{chatid: tcid});
270
- nc_add_user_to_list(visitor_list[tcid], function() {
271
- $("#"+tcid).click();
272
- setTimeout(function() {
273
- $(".bleeper_join_chat_btn").click();
274
- },100)
275
-
276
- });
277
- });
278
-
279
- $('body').on('click', '#inchat_drop_down', function(){
280
- jQuery('#chatCloseTitle').hide();
281
- if(typeof active_chatid !== 'undefined' && active_chatid !== null && active_chatid !== false && active_chatid !== undefined){
282
- if(typeof visitor_list[active_chatid] !== 'undefined'){
283
- if(visitor_list[active_chatid]['involved'].length > 1){
284
- jQuery('#chatCloseTitle').show();
285
- }
286
- }
287
- }
288
- });
289
-
290
- $("body").on("click", ".bleeper_close_item", function() {
291
- var tcid = $(this).attr('cid');
292
- $("#"+tcid).remove();
293
- bleeper_remove_chatid_from_ls(tcid);
294
- bleeper_remove_events(tcid);
295
-
296
- //delete visitor_list[tcid];
297
-
298
- setTimeout(function() {
299
- $("#user_count").click();
300
- },100);
301
- });
302
-
303
- $("body").on("click", ".accept_chat", function() {
304
- var tcid = $(this).attr('cid');
305
-
306
- involved_list[tcid] = true;
307
-
308
- $(this).remove();
309
- socket.emit('chat accepted',{chatid: tcid,agent_id:agent_id,agent_name:bleeper_agent_name});
310
- jQuery.event.trigger({type: "bleeper_add_agent", ndata:{chatid:tcid, agent:agent_id}});
311
-
312
- nc_add_user_to_list(visitor_list[tcid], function() {
313
- $("#"+tcid).click();
314
-
315
- });
316
- nifty_chat_add_agent_involved(tcid, agent_id);
317
- nifty_chat_add_agent_involved_visitor_list(tcid, agent_id);
318
-
319
- jQuery.event.trigger({type: "bleeper_agent_accepted_chat", ndata:{chat_id:tcid,agent_id:agent_id}});
320
- });
321
-
322
-
323
- $("body").on("click", "#user_count", function() {
324
- $('.infoArea').show();
325
- $('.chatArea').hide();
326
- $('.messages').empty();
327
-
328
- active_chatid = undefined;
329
-
330
- if (typeof visitor_list === "undefined" || Object.keys(visitor_list).length === 0) {
331
- nc_no_visitors();
332
- }
333
-
334
- /* remove the active state of any agent chat item */
335
- $(".online_agent").each(function() {
336
- jQuery(this).removeClass('active');
337
- });
338
-
339
- /* remove the active state of any user chat item */
340
- $(".userList").each(function() {
341
- jQuery(this).removeClass('active');
342
- });
343
-
344
-
345
-
346
-
347
- });
348
-
349
- $("body").on("click", ".chatTransfer", function() {
350
- var tmp_chatid_transfer = $(this).attr('cid');
351
- message = '<p class="chat_agent_list">Please select an agent:</p>';
352
- message += '<div class="t_agent_list"></div>';
353
-
354
-
355
- params = {
356
- token: '2d86b9f53059d3f4efed1ea51a888eb8',
357
- api_key: nifty_api_key
358
- },
359
-
360
-
361
- jQuery.ajax({
362
- url : nc_buildUrl(node_uri+'/api/v1/list_online_agents/', params),
363
- type : 'GET',
364
- cache: false,
365
- processData: false,
366
- contentType: false,
367
- success : function(data) {
368
- information_received_pointer = 'transfer';
369
- online_ag_array = JSON.parse(data);
370
- var atleast_one_added = false;
371
- for (l in online_ag_array) {
372
- if (online_ag_array[l] !== nifty_my_socket) {
373
- atleast_one_added = true;
374
- socket.emit('request information',{socketid: online_ag_array[l]});
375
- $('<div/>', {
376
- 'class': 'active_agent_in_list',
377
- html: '<input type="radio" value="" name="ag_t_selection" cid="'+tmp_chatid_transfer+'" id="ag_t_'+online_ag_array[l]+'" /> <span class="ag_t_span_'+online_ag_array[l]+'">getting information...</span> <br/>'
378
- }).appendTo(".t_agent_list");
379
- }
380
- }
381
-
382
- if(!atleast_one_added){
383
- $('<div/>', {
384
- 'class': 'no_active_agents_notice',
385
- html: '<span class="no_active_agents_notice_inner">No other agents online...</span> <br/>'
386
- }).appendTo(".t_agent_list");
387
- }
388
-
389
- },
390
- error : function (){
391
-
392
- }
393
- });
394
-
395
-
396
- niftyShowDialog("Invite Agent", message, 'Invite', 'Cancel', function() {
397
- var ag_selection = $('input[name=ag_t_selection]:checked', '.t_agent_list').val();
398
- var transfer_chat_id = $('input[name=ag_t_selection]:checked', '.t_agent_list').attr('cid');
399
- if (typeof ag_selection !== "undefined") {
400
- socket.emit('transfer chat',{socketid: ag_selection,chatid:transfer_chat_id,from_agent:bleeper_agent_name});
401
- }
402
-
403
- },null);
404
-
405
- jQuery('#nifty_admin_chat_prompt_confirm').hide();
406
-
407
- });
408
-
409
- $("body").on("click", ".chatTransferDepartment", function() {
410
- var tmp_chatid_transfer = active_chatid;
411
- message = '<p class="chat_department_list">Please select a department:</p>';
412
- message += '<div class="t_department_list">';
413
- if(typeof bleeper_departments !== "undefined"){
414
- for(var index in bleeper_departments){
415
- message += "<input type='radio' name='dp_t_selection' cid='"+tmp_chatid_transfer+"' value='"+index+"' /><span>" + bleeper_departments[index] + "</span> <br/>";
416
- }
417
- }
418
- message += '</div>';
419
-
420
-
421
- niftyShowDialog("Invite Department", message, 'Invite', 'Cancel', function() {
422
- var dp_selection = $('input[name=dp_t_selection]:checked', '.t_department_list').val();
423
- var transfer_chat_id = $('input[name=dp_t_selection]:checked', '.t_department_list').attr('cid');
424
- if (typeof dp_selection !== "undefined") {
425
- socket.emit('transfer chat department',{socketid: dp_selection,department:dp_selection,chatid:transfer_chat_id,from_agent:bleeper_agent_name});
426
- }
427
-
428
- },null);
429
-
430
- jQuery('#nifty_admin_chat_prompt_confirm').hide();
431
-
432
- });
433
-
434
- $('body').on('click', 'input[name=dp_t_selection],input[name=ag_t_selection]', function(){
435
- jQuery('#nifty_admin_chat_prompt_confirm').show();
436
- });
437
-
438
-
439
- //Direct to page handler
440
- $("body").on("click", ".chatDirectUserToPagePrompt", function() {
441
- if (typeof active_chatid !== "undefined") {
442
- if(typeof bleeper_valid_direct_to_page_array !== "undefined"){
443
-
444
- var select_html_for_modal = bleeper_generate_dropdown("bleeper_direct_to_page_select", bleeper_valid_direct_to_page_array);
445
-
446
- niftyShowDialog("Direct User To Page", select_html_for_modal , 'Direct User To Selected Page', 'Cancel', function() {
447
- //What to do wena
448
- var selected_page_url = jQuery("#bleeper_direct_to_page_select").val();
449
-
450
- socket.emit('custom data',{action:'send_user_direct_to_page',chatid:active_chatid,agent_name:bleeper_agent_name, direction: selected_page_url, pretty_name: bleeper_valid_direct_to_page_array[selected_page_url]});
451
-
452
- /** Store this for later retrieval */
453
- var direct_to_page_message = {}
454
- direct_to_page_message.originates = 0;
455
- direct_to_page_message.msg = bleeper_agent_name + ' would like to direct you to the following page: ' + bleeper_valid_direct_to_page_array[selected_page_url] + ' - ' + selected_page_url;
456
- direct_to_page_message.other = {};
457
-
458
- var wplc_d = new Date();
459
- direct_to_page_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
460
- direct_to_page_message.other.agent_id = 0;
461
-
462
- var randomNum = Math.floor((Math.random() * 100) + 1);
463
- var msgID = Date.now()+randomNum;
464
-
465
- wplc_push_message_to_chatbox(direct_to_page_message, 0, function() {
466
- jQuery.event.trigger({type: "bleeper_scroll_bottom"});
467
- });
468
-
469
- if(direct_to_page_message.msg !== false){
470
- /* this message is going to another agent */
471
- var api_endpoint = 'send_agent_message';
472
- var ato = 0;
473
- var data = {
474
- relay_action: 'wplc_admin_send_msg',
475
- agent_id: 0,
476
- security: wplc_nonce,
477
- chat_id: active_chatid,
478
- message: direct_to_page_message.msg,
479
- ato: ato,
480
- msg_id: msgID,
481
- orig_override: direct_to_page_message.originates
482
-
483
- };
484
- wplc_rest_api(api_endpoint, data, 12000, function(){
485
-
486
- data.orig_override = 3;
487
- wplc_rest_api(api_endpoint, data, 12000, null);
488
- });
489
-
490
-
491
-
492
- }
493
-
494
- },null);
495
-
496
- jQuery.event.trigger({type: "bleeper_direct_user_to_page_prompt"});
497
- }
498
- }
499
- });
500
- $("body").on("click", ".chatClose", function() {
501
- var tmp_chatid_close = $(this).attr('cid');
502
-
503
-
504
- involved_list[tmp_chatid_close] = false;
505
- $(this).attr('cid',null);
506
- $(this).hide();
507
- $("#user_count").click();
508
- socket.emit('agent left',{chatid:tmp_chatid_close,agent:agent_id,agent_name:username});
509
- nifty_chat_remove_agent_involved(tmp_chatid_close, agent_id);
510
- if (typeof active_chatid !== "undefined") {
511
- active_chatid = undefined;
512
- }
513
- $("#"+tmp_chatid_close).remove();
514
- //bleeper_remove_chatid_from_ls(tmp_chatid_close);
515
- bleeper_remove_events(tmp_chatid_close);
516
- });
517
- $("body").on("click", ".endChat", function() {
518
- var tmp_chatid_close = $(this).attr('cid');
519
-
520
- involved_list[tmp_chatid_close] = false;
521
- $(this).attr('cid',null);
522
- $(this).hide();
523
- $("#user_count").click();
524
- socket.emit('agent left', {chatid:tmp_chatid_close,agent:agent_id,agent_name:username});
525
- socket.emit('end chat', {chatid:tmp_chatid_close,agent:agent_id,agent_name:username, visitor_socket: active_socket});
526
- nifty_chat_remove_agent_involved(tmp_chatid_close, agent_id);
527
- if (typeof active_chatid !== "undefined") {
528
- active_chatid = undefined;
529
- }
530
-
531
- $("#"+tmp_chatid_close).remove();
532
- //bleeper_remove_chatid_from_ls(tmp_chatid_close);
533
- bleeper_remove_events(tmp_chatid_close);
534
- visitor_list[tmp_chatid_close].state = 'browsing';
535
- visitor_list[tmp_chatid_close].involved = undefined;
536
- jQuery.event.trigger({type: "bleeper_add_initiate_button_no_col", cid:tmp_chatid_close});
537
- nc_remove_open_chat_visitor_row(tmp_chatid_close);
538
-
539
- var data = {
540
- agent_id: agent_id,
541
- security: wplc_nonce,
542
- chat_id: tmp_chatid_close,
543
- };
544
- wplc_rest_api('end_chat', data, 12000, function(){
545
-
546
- });
547
-
548
- setTimeout(function() {
549
- $("#user_count").click();
550
- },100);
551
-
552
- });
553
- $("body").on("click", ".minChat", function() {
554
- var tmp_chatid_close = $(this).attr('cid');
555
-
556
- $(this).attr('cid',null);
557
- $(this).hide();
558
- $("#user_count").click();
559
- if (typeof active_chatid !== "undefined") {
560
- active_chatid = undefined;
561
- }
562
-
563
- jQuery.event.trigger({type: "bleeper_min_chat"});
564
-
565
- jQuery('.eventbox-close').click();
566
- });
567
-
568
- $("body").on("click", ".userList", function() {
569
- $(".nifty_bg_holder").fadeOut();
570
- message_type = 'u';
571
-
572
- $('.inchat-menu').show();
573
- $('.infoArea').hide();
574
- $('.chatArea').show();
575
- $('.messages').empty();
576
- //nc_log('Fetching messages...',"fetchinglog",{prepend: true});
577
- active_socket = $(this).attr('socket');
578
- active_customerID = $(this).attr('customerID');
579
- var tmp_chatid = $(this).attr('id');
580
- active_chatid = tmp_chatid;
581
-
582
- //involved_list[tmp_chatid] = true;
583
-
584
- unread_count[tmp_chatid] = 0;
585
- bleeper_check_if_all_read();
586
- nc_update_unread_count(tmp_chatid);
587
-
588
- /* remove the active state of any agent chat item */
589
- $(".online_agent").each(function() {
590
- jQuery(this).removeClass('active');
591
- });
592
-
593
- $(".userList").removeClass("active");
594
- $(this).removeClass("newmessage");
595
- $(".chatClose").show();
596
- $(".endChat").show();
597
- $(".minChat").show();
598
- $(".chatClose").attr("cid",active_chatid);
599
- $(".endChat").attr("cid",active_chatid);
600
- $(".chatTransfer").attr("cid",active_chatid);
601
-
602
-
603
- $(".eventbox").show();
604
- $(".events-ul").empty();
605
-
606
- jQuery.event.trigger({type: "bleeper_send_get_chat_history", ndata:{chatid:tmp_chatid,agent_name:username,agent_id:agent_id}});
607
- jQuery.event.trigger({type: "bleeper_clear_typing_preview", cid: tmp_chatid});
608
-
609
- bleeper_update_event_box(active_chatid);
610
-
611
-
612
- bleeper_add_socket_to_ping(active_socket,active_chatid);
613
-
614
-
615
- $(".chatInfoArea-Name").html("");
616
- $(".chatInfoArea-Email").html("");
617
- $(".chatInfoArea-Info1").html("");
618
- $(".user_gravatar").html("");
619
- if (typeof visitor_list[active_chatid] !== "undefined") {
620
- if(typeof visitor_list[active_chatid].username !== "undefined"){
621
- $(".chatInfoArea-Name").html( bleeper_strip_tags(visitor_list[active_chatid].username) );
622
- } else {
623
- $(".chatInfoArea-Name").html("Guest");
624
- }
625
-
626
- $(".chatInfoArea-Info1").html("from: <a href='"+bleeper_strip_tags(visitor_list[active_chatid].referer)+"' target='_BLANK'>"+bleeper_string_limiter(bleeper_strip_tags(visitor_list[active_chatid].referer),45)+"</a>");
627
-
628
- if(typeof visitor_list[active_chatid].email !== "undefined"){
629
- $(".user_gravatar").html("<img src='https://www.gravatar.com/avatar/"+md5(visitor_list[active_chatid].email)+"?s=100&d=mm' />");
630
- $(".chatInfoArea-Email").html('<a href="mailto:'+ bleeper_strip_tags( visitor_list[active_chatid].email )+'" target="_BLANK">'+ bleeper_strip_tags( visitor_list[active_chatid].email )+'</a>');
631
- } else {
632
- $(".user_gravatar").html("<img src='https://www.gravatar.com/avatar/unknown?s=100&d=mm' />");
633
- $(".chatInfoArea-Email").html('Email Unknown');
634
- }
635
-
636
- jQuery.event.trigger({type: "bleeper_open_chat", cid:active_chatid, username: visitor_list[active_chatid].username});
637
- }
638
-
639
-
640
- /* removed - only triggered now when you click on the "Join chat" button */
641
- //nifty_chat_add_agent_involved(active_chatid, agent_id);
642
-
643
- if (typeof involved_list[active_chatid] === "undefined" || involved_list[active_chatid] === false) {
644
- $("#inputMessage").prop('disabled',true);
645
- $(".bleeper_join_chat_div").show();
646
-
647
- } else {
648
- $(".bleeper_join_chat_div").hide();
649
- $("#inputMessage").prop('disabled',false);
650
- $("#inputMessage").focus();
651
-
652
-
653
- }
654
-
655
-
656
- if ($(this).hasClass('inactive')) {} else {
657
- $(this).addClass('active');
658
- }
659
-
660
-
661
-
662
- setTimeout(function() {
663
- $("#fetchinglog").fadeOut("slow");
664
- },2000);
665
-
666
-
667
- /**
668
- * This makes sure that "agent joined" gets sent back to the customer (if the agent previously disconnected)
669
- *
670
- */
671
- if (typeof involved_list[active_chatid] !== "undefined" && involved_list[active_chatid] === true) {
672
-
673
- jQuery.event.trigger({type: "bleeper_add_agent", ndata:{chatid:active_chatid, agent:agent_id}});
674
- nifty_chat_add_agent_involved(active_chatid, agent_id);
675
- nifty_chat_add_agent_involved_visitor_list(active_chatid, agent_id);
676
- socket.emit('chat accepted',{
677
- chatid: active_chatid,
678
- agent_id:agent_id,
679
- agent_name:bleeper_agent_name
680
- });
681
- }
682
-
683
-
684
- });
685
- $("body").on("click", ".bleeper_join_chat_btn", function(e) {
686
- involved_list[active_chatid] = true;
687
- socket.emit('chat accepted',{chatid: active_chatid,agent_id:agent_id,agent_name:bleeper_agent_name});
688
- jQuery.event.trigger({type: "bleeper_add_agent", ndata:{chatid:active_chatid, agent:agent_id}});
689
- nifty_chat_add_agent_involved(active_chatid, agent_id);
690
- nifty_chat_add_agent_involved_visitor_list(active_chatid, agent_id);
691
- $(".bleeper_join_chat_div").hide();
692
- $("#inputMessage").prop('disabled',false);
693
- $("#inputMessage").focus();
694
-
695
- });
696
- $("body").on("click", ".online_agent", function() {
697
-
698
- $(".eventbox").hide();
699
- $(".eventbox-wrapper").hide();
700
-
701
- /* remove the active state of any agent chat item */
702
- $(".online_agent").each(function() {
703
- jQuery(this).removeClass('active');
704
- });
705
-
706
- /* remove the active state of any user chat item */
707
- $(".userList").each(function() {
708
- jQuery(this).removeClass('active');
709
- });
710
-
711
- $('.inchat-menu').hide();
712
- $('.nifty_bg_holder').hide();
713
- $('.infoArea').hide();
714
- $('.chatArea').show();
715
- $('.messages').empty();
716
- $(this).removeClass("newmessage");
717
- $(".chatClose").show();
718
- $(".endChat").show();
719
- $(".minChat").show();
720
- $(".chatClose").attr("cid",active_chatid);
721
- $(".endChat").attr("cid",active_chatid);
722
-
723
- var selected_agentid = $(this).attr('aid');
724
- message_type = parseInt(selected_agentid);
725
-
726
-
727
-
728
- //nc_log('Fetching messages...',"fetchinglog",{prepend: true});
729
- active_socket = $(this).attr('socket');
730
-
731
-
732
- var tmp_chatid = $(this).attr('id');
733
- active_chatid = tmp_chatid;
734
- involved_list[tmp_chatid] = true;
735
- unread_count[tmp_chatid] = 0;
736
- nc_update_unread_count(tmp_chatid);
737
-
738
- jQuery.event.trigger({type: "bleeper_send_get_chat_history", ndata:{chatid:tmp_chatid,agent_name:username,agent_id:agent_id}});
739
-
740
- $(".chatInfoArea-Name").html("");
741
- $(".chatInfoArea-Info1").html("");
742
- $(".user_gravatar").html("");
743
-
744
-
745
- $(".chatInfoArea-Name").html( bleeper_strip_tags(wplc_agent_data[selected_agentid].name) );
746
- $(".user_gravatar").html("<img src='https://www.gravatar.com/avatar/"+wplc_agent_data[selected_agentid].md5+"?s=100&d=mm' />");
747
-
748
- if ($(this).hasClass('inactive')) {} else {
749
- $(this).addClass('active');
750
- }
751
- setTimeout(function() {
752
- $("#fetchinglog").fadeOut("slow");
753
- },2000);
754
-
755
- jQuery.event.trigger({type: "bleeper_open_chat", cid:active_chatid, username: wplc_agent_data[selected_agentid].name});
756
- });
757
-
758
-
759
-
760
-
761
-
762
-
763
-
764
-
765
-
766
-
767
- $("#nifty_file_input").on("change", function(){
768
- var file = this.files[0]; //Last file in array
769
- wplcShareFile(file,'#nifty_attach_fail_icon', '#nifty_attach_success_icon', '#nifty_attach_uploading_icon', "#nifty_attach");
770
- jQuery("#chat_drag_zone").fadeOut();
771
-
772
- this.value = "";
773
-
774
- });
775
-
776
-
777
-
778
- /*Add in filter click handlers */
779
- $("body").on("click", ".filter-new-visitors", function(){
780
- bleeper_active_filter = bleeper_visitor_filters.new_visitors;
781
- bleeper_refresh_visitor_list();
782
- });
783
-
784
- $("body").on("click", ".filter-active-chats", function(){
785
- bleeper_active_filter = bleeper_visitor_filters.active_chats;
786
- bleeper_refresh_visitor_list();
787
- });
788
-
789
- $('body').on('click', '.filter-referer', function(){
790
- bleeper_active_filter = bleeper_visitor_filters.referer;
791
- bleeper_refresh_visitor_list();
792
- });
793
-
794
- $('body').on('click', '#nifty_referer_contains', function(){
795
- bleeper_refresh_visitor_list();
796
- });
797
-
798
- $('body').on('change keyup paste mouseup', '#nifty_referer_url', function(){
799
- var last_val = $('#nifty_referer_url').attr('last-val');
800
- var cur_val = $('#nifty_referer_url').val();
801
- if(typeof last_val === 'undefined' || last_val !== cur_val){
802
- $('#nifty_referer_url').attr('last-val',cur_val);
803
- bleeper_refresh_visitor_list();
804
- }
805
- });
806
-
807
- $("body").on("click", ".filter-clear", function(){
808
- $('#nifty_referer_options').fadeOut('slow');
809
- bleeper_active_filter = false;
810
- bleeper_refresh_visitor_list();
811
- });
812
-
813
- $("body").on("click", ".filter-menu .dropdown-menu li a[class!='filter-clear']", function(){
814
- //Not trying to clear the filter persay
815
- var current_filter = jQuery(this).text();
816
- current_filter = bleeper_string_limiter(current_filter, 12);
817
- $('#nifty_referer_options').fadeOut('slow');
818
- jQuery(".filter-active-tag-container").fadeOut("slow", function(){
819
- jQuery(".filter-active-tag-inner").text(current_filter);
820
- if(bleeper_active_filter === bleeper_visitor_filters.referer) {
821
- $('#nifty_referer_options').fadeIn('slow');
822
- }
823
- jQuery(".filter-active-tag-container").fadeIn("slow");
824
- });
825
- });
826
-
827
- /* socket delegates were here */
828
- });
829
- })(jQuery);
830
-
831
- /* MOBILE CONTROL */
832
- jQuery(function(){
833
- jQuery(document).on("bleeper_open_chat", function(e){
834
- if(jQuery(window).width() < 700){
835
- jQuery("label[for=user_list_mobile_control]").click();
836
- }
837
- });
838
-
839
- jQuery(document).on("bleeper_min_chat", function(e){
840
- if(jQuery(window).width() < 700){
841
- jQuery("label[for=user_list_mobile_control]").click();
842
- }
843
- });
844
- });
845
- /* END MOBILE CONTROL */
846
-
847
- jQuery(document).on("bleeper_dom_ready", function(e) {
848
-
849
-
850
- if (document.getElementById('inputMessage') !== null) {
851
-
852
- /** Image pasting functionality */
853
- document.getElementById('inputMessage').onpaste = function (event) {
854
- jQuery.event.trigger({type: "bleeper_input_paste", event: event});
855
- }
856
- }
857
- });
858
-
859
-
860
- jQuery(document).on("bleeper_dom_ready", function(e) {
861
-
862
- jQuery("#nifty_admin_chat_prompt_confirm").click(function(){
863
- niftyExecuteDialogCallback();
864
- });
865
-
866
- jQuery("#nifty_admin_chat_prompt_cancel").click(function(){
867
- niftyCloseDialog();
868
- });
869
-
870
- jQuery("#quick_response_drawer_handle").click(function(){
871
-
872
- if(bleeper_showing_quick_responses){
873
- jQuery("#quick_response_drawer_handle i").removeClass("fa-times").addClass("fa-bolt");
874
- jQuery("#quick_response_drawer_container").fadeOut("fast");
875
- } else {
876
- jQuery("#quick_response_drawer_handle i").removeClass("fa-bolt").addClass("fa-times");
877
- jQuery("#quick_response_drawer_container").fadeIn("fast");
878
- }
879
-
880
- bleeper_showing_quick_responses = !bleeper_showing_quick_responses;
881
-
882
- });
883
-
884
- jQuery("#nifty_wrapper").click(function(e){
885
- if(bleeper_showing_quick_responses){
886
- if(typeof e !== "undefined" && typeof e.target !== "undefined" && typeof e.target.id !== "undefined"){
887
- if(e.target.id !== "quick_response_drawer_handle" && (e.target.nodeName !== "I" && e.target.nodeName !== "I")) {
888
- jQuery("#quick_response_drawer_handle").click();
889
- }
890
- }
891
- }
892
- });
893
- jQuery("body").on("click", ".eventbox", function() {
894
- jQuery(".eventbox-wrapper").show();
895
- })
896
- jQuery("body").on("click", ".eventbox-close", function() {
897
- jQuery(".eventbox-wrapper").hide();
898
- })
899
-
900
- jQuery("body").on("click", ".quick_response_item", function(){
901
- var response = jQuery(this).text();
902
- var current_text = jQuery("#inputMessage").val();
903
-
904
- jQuery("#inputMessage").val(current_text + response);
905
- jQuery("#quick_response_drawer_handle").click();
906
- });
907
-
908
- jQuery("#toolbar-item-fullscreen").click(function(){
909
- if(bleeper_dash_fullscreen_minimal){
910
- //Show bars again
911
- jQuery("section").removeClass("strip_margins");
912
- jQuery("footer").removeClass("strip_margins");
913
- jQuery(".topnavbar[role=navigation]").fadeIn();
914
- jQuery(".aside[role=navigation]").fadeIn();
915
- } else {
916
- //Hide them now
917
- jQuery(".topnavbar[role=navigation]").fadeOut("fast");
918
- jQuery(".aside[role=navigation]").fadeOut("fast");
919
-
920
- setTimeout(function(){
921
- jQuery("section").addClass("strip_margins");
922
- jQuery("footer").addClass("strip_margins");
923
- }, 300);
924
- }
925
- bleeper_dash_fullscreen_minimal = !bleeper_dash_fullscreen_minimal; //Flips this state
926
- });
927
-
928
- if (document.getElementById('messages') !== null) {
929
- bleeper_mutation_observer_init();
930
- bleeper_init_emoji_picker();
931
- bleeper_init_emoji_converter(0);
932
- }
933
- });
934
-
935
- /**
936
- * Initialize the mutation observer
937
- */
938
- function bleeper_mutation_observer_init(){
939
- if (document.getElementById('messages') !== null) {
940
- var target = document.getElementById('messages');
941
- var observer = new MutationObserver(function(mutations) {
942
- mutations.forEach(bleeper_mutation_observer_callback);
943
- });
944
-
945
- var config = { attributes: true, childList: true, characterData: true };
946
-
947
-
948
- observer.observe(target, config);
949
- }
950
- }
951
-
952
- /**
953
- * Mutation observer for attachments
954
- *
955
- * @param {object} mutation The mutation object
956
- */
957
- function bleeper_mutation_observer_callback(mutation){
958
- if (mutation.type === 'childList') {
959
- //Now try find
960
- jQuery(".bleeper_in_chat_card a").each(function() {
961
- var last_dynamic_link = jQuery(this);
962
- if(typeof last_dynamic_link !== "undefined"){
963
- //We have a dynamic link. Let's do dis now
964
- var dynamic_href = last_dynamic_link.attr("href");
965
- var breakdown_href = dynamic_href;
966
- var generate_simple_title = false;
967
- if(dynamic_href.indexOf(".") !== -1){
968
- //There is a full stop, so we have an extension type here. (This is probably a .com though, so we will end up here no matter what in most cases)
969
- var extension = dynamic_href.substring(dynamic_href.lastIndexOf("."));
970
- if(extension !== ".zip" && extension !== ".exe" && extension !== ".bin" && extension !== ".rar" && extension !== ".7zip" && extension !== ".ai" &&
971
- extension !== ".psd" && extension !== ".psd" && extension !== ".esp" && extension !== ".eps" && extension !== ".txt" && extension !== ".js" &&
972
- extension !== ".cdr" && extension !== ".apk"){
973
- //common web file
974
- if(dynamic_href.indexOf("//") !== -1){
975
- breakdown_href = dynamic_href.substring(dynamic_href.indexOf("//") + 2);
976
- breakdown_href = breakdown_href.substring(0, breakdown_href.indexOf("/"));
977
- generate_simple_title = true;
978
- } else {
979
- breakdown_href = dynamic_href;
980
- }
981
- } else {
982
- //Probably a file, and not the end of the world if its not
983
- breakdown_href = dynamic_href.substring(dynamic_href.lastIndexOf("/"));
984
- generate_simple_title = true;
985
- }
986
- } else {
987
- //Just assumy this is a link.
988
- if(dynamic_href.indexOf("//") !== -1){
989
- breakdown_href = dynamic_href.substring(dynamic_href.indexOf("//") + 2);
990
- breakdown_href = breakdown_href.substring(0, breakdown_href.indexOf("/"));
991
- generate_simple_title = true;
992
- } else {
993
- breakdown_href = dynamic_href;
994
- }
995
- }
996
-
997
- if(generate_simple_title){
998
- var the_title = breakdown_href;
999
- if(the_title.indexOf(".") !== -1){
1000
- the_title = the_title.substring(0, the_title.lastIndexOf("."));
1001
- }
1002
- the_title = the_title.replace(new RegExp("[0-9]", "g"), ""); //Remove all numbers
1003
- the_title = the_title.replace(/-/g, " ");
1004
- the_title = the_title.replace("http://", "");
1005
- the_title = the_title.replace("https://", "");
1006
- the_title = the_title.replace("www.", "");
1007
- the_title = the_title.replace("/", "");
1008
- the_title = the_title.trim();
1009
-
1010
- if(the_title === ""){
1011
- the_title = "Link";
1012
- }
1013
-
1014
- if(breakdown_href === ""){
1015
- breakdown_href = dynamic_href;
1016
- }
1017
-
1018
- breakdown_href = "<small><strong>" + the_title + "</strong> (" + breakdown_href + ")</small>";
1019
-
1020
- }
1021
-
1022
- last_dynamic_link.html(breakdown_href);
1023
-
1024
- }
1025
-
1026
- });
1027
- }
1028
- }
1029
-
1030
- /**
1031
- * Event which gets all visitor data from the socket
1032
- */
1033
- function bleeper_get_visitor_data() {
1034
- if (typeof socket.connected !== "undefined" && socket.connected) {
1035
- socket.emit('get visitor list',{api_key: nifty_api_key});
1036
- }
1037
-
1038
- }
1039
-
1040
- /**
1041
- * Initialize the emoji picket
1042
- */
1043
- function bleeper_init_emoji_picker(){
1044
- if(typeof wdtEmojiBundle !== "undefined"){
1045
- wdtEmojiBundle.defaults.emojiSheets = {
1046
- 'apple' : wplc_baseurl + '/js/vendor/wdt-emoji/sheets/sheet_apple_64_indexed_128.png',
1047
- 'google' : wplc_baseurl + '/js/vendor/wdt-emoji/sheets/sheet_google_64_indexed_128.png',
1048
- 'twitter' : wplc_baseurl + '/js/vendor/wdt-emoji/sheets/sheet_twitter_64_indexed_128.png',
1049
- 'emojione' : wplc_baseurl + '/js/vendor/wdt-emoji/sheets/sheet_emojione_64_indexed_128.png',
1050
- 'facebook' : wplc_baseurl + '/js/vendor/wdt-emoji/sheets/sheet_facebook_64_indexed_128.png',
1051
- 'messenger': wplc_baseurl + '/js/vendor/wdt-emoji/sheets/sheet_messenger_64_indexed_128.png'
1052
- };
1053
-
1054
- wdtEmojiBundle.init('.wdt-emoji-bundle-enabled');
1055
- }
1056
- }
1057
-
1058
- /**
1059
- * Recusively initialize the input field for emoji support. If an error occurs it will attempt again.
1060
- *
1061
- * Will try to initialize up to 5 times.
1062
- * @param {int} attempt Attempt number
1063
- */
1064
- function bleeper_init_emoji_converter(attempt){
1065
- attempt = typeof attempt === "undefined" ? 0 : parseInt(attempt);
1066
- if(typeof EmojiConvertor !== "undefined"){
1067
- bleeper_emoji_converter = new EmojiConvertor(); //Used for converting colon codes to unicodes
1068
- } else {
1069
- //Dom not ready yet
1070
- if(attempt < 5){
1071
- setTimeout(function(){
1072
- bleeper_init_emoji_converter(attempt++);
1073
- }, 1000);
1074
- }
1075
- }
1076
- }
1077
-
1078
- /**
1079
- * Converts colons to unified
1080
- *
1081
- * @param {string} msg The message string
1082
- * @return {string} The formatted message
1083
- */
1084
- function bleeper_convert_colon_to_uni(msg){
1085
- if(typeof EmojiConvertor !== "undefined" && typeof bleeper_emoji_converter !== "undefined"){
1086
- bleeper_emoji_converter.init_env(); // else auto-detection will trigger when we first convert
1087
- bleeper_emoji_converter.replace_mode = 'unified';
1088
- bleeper_emoji_converter.allow_native = true;
1089
- return bleeper_emoji_converter.replace_colons(msg);
1090
- } else {
1091
- return msg;
1092
- }
1093
- }
1094
-
1095
- /**
1096
- * Render emojis within a message string
1097
- *
1098
- * @param {string} msg The chat message
1099
- * @return {string} The chat message with emojis
1100
- */
1101
- function bleeper_emoji_render(msg){
1102
- if(typeof wdtEmojiBundle !== "undefined"){
1103
- msg = wdtEmojiBundle.render(msg);
1104
- }
1105
- return msg;
1106
- }
1107
-
1108
- /**
1109
- * Add the agent to the involved list for a specific chat on the server (event)
1110
- *
1111
- * @param {string} chatid The chat ID
1112
- * @param {int} agentid The agent ID
1113
- */
1114
- function nifty_chat_add_agent_involved(chatid, agentid) {
1115
- jQuery.event.trigger({type: "bleeper_add_agent_involved", chatid:chatid, agentid:agentid});
1116
- }
1117
-
1118
- /**
1119
- * Add the agent to the involved list for a specific chat
1120
- *
1121
- * @param {string} chatid The chat ID
1122
- * @param {int} agentid The agent ID
1123
- */
1124
- function nifty_chat_add_agent_involved_visitor_list(chatid, agentid) {
1125
- jQuery.event.trigger({type: "bleeper_add_agent_involved_visitor_list", chatid:chatid, agentid:agentid});
1126
- }
1127
-
1128
- /**
1129
- * Remove the agent rom the involved list for a specific chat
1130
- *
1131
- * @param {string} chatid The chat ID
1132
- * @param {int} agentid The agent ID
1133
- */
1134
- function nifty_chat_remove_agent_involved(chatid, agentid) {
1135
- if(typeof all_agents !== "undefined"){
1136
- if(typeof all_agents !== "object"){
1137
- var check_all_agents = JSON.parse(all_agents);
1138
- } else {
1139
- var check_all_agents = all_agents;
1140
- }
1141
- if (agentid === agent_id) {
1142
-
1143
- involved_list[chatid] = false;
1144
- }
1145
- agent_involved = check_all_agents[agentid];
1146
- jQuery('#agent_grav_'+chatid+'_'+agentid).remove();
1147
- jQuery('#agent_grav_visitor_'+chatid+'_'+agentid).remove();
1148
- }
1149
-
1150
- }
1151
-
1152
- /**
1153
- * Show a popup dialog within the chat dashboard
1154
- *
1155
- * @param {string} title The dialog title
1156
- * @param {string} message The dialog message
1157
- * @param {string} accept_btn The accept/confirm button label
1158
- * @param {string} cancel_btn The cancle button label
1159
- * @param {function} callback The accept callback function
1160
- * @param {function} cancel_callback The cancel callback function
1161
- */
1162
- function niftyShowDialog(title, message, accept_btn, cancel_btn, callback, cancel_callback){
1163
- if(title !== null){
1164
- jQuery(".nifty_admin_chat_prompt_title").text(title);
1165
- } else {
1166
- jQuery(".nifty_admin_chat_prompt_title").text("Please Confirm");
1167
- }
1168
- if(message !== null){
1169
- jQuery(".nifty_admin_chat_prompt_message").html(message);
1170
- }
1171
-
1172
- if(accept_btn !== null){
1173
- jQuery("#nifty_admin_chat_prompt_confirm").text(accept_btn);
1174
- } else {
1175
- jQuery("#nifty_admin_chat_prompt_confirm").text("Confirm");
1176
- }
1177
-
1178
- if(cancel_btn !== null){
1179
- jQuery("#nifty_admin_chat_prompt_cancel").text(cancel_btn);
1180
- } else {
1181
- jQuery("#nifty_admin_chat_prompt_cancel").text("Cancel");
1182
- }
1183
-
1184
- jQuery('#nifty_admin_chat_prompt_confirm').show();
1185
-
1186
- niftyRegisterDialogCallback(callback);
1187
- niftyRegisterDialogCancelCallback(cancel_callback);
1188
- jQuery(".nifty_admin_overlay").fadeIn();
1189
- jQuery(".nifty_admin_chat_prompt").fadeIn();
1190
- }
1191
-
1192
- /**
1193
- * Registed the confirm dialog callback
1194
- *
1195
- * @param {function} callback The function to execute when confirmed
1196
- */
1197
- function niftyRegisterDialogCallback(callback){
1198
- nifty_prompt_callback = callback;
1199
- }
1200
-
1201
- /**
1202
- * Registed the cancel dialog callback
1203
- *
1204
- * @param {function} callback The function to execute when cancelled
1205
- */
1206
- function niftyRegisterDialogCancelCallback(callback){
1207
- nifty_cancel_callback = callback;
1208
- }
1209
-
1210
- /**
1211
- * Execute the accept/confirm dialog callback
1212
- */
1213
- function niftyExecuteDialogCallback(){
1214
- if(typeof nifty_prompt_callback !== "undefined" && typeof nifty_prompt_callback === "function"){
1215
- nifty_prompt_callback();
1216
- }
1217
- jQuery(".nifty_admin_chat_prompt").hide();
1218
- jQuery(".nifty_admin_overlay").hide();
1219
- }
1220
-
1221
- /**
1222
- * Execute the cancel dialog callback
1223
- */
1224
- function niftyExecuteDialogCancelCallback(){
1225
- if(typeof nifty_cancel_callback !== "undefined" && typeof nifty_cancel_callback === "function"){
1226
- nifty_cancel_callback();
1227
- }
1228
- jQuery(".nifty_admin_chat_prompt").hide();
1229
- jQuery(".nifty_admin_overlay").hide();
1230
- }
1231
-
1232
- /**
1233
- * Close the active dialog
1234
- */
1235
- function niftyCloseDialog(){
1236
- niftyRegisterDialogCallback(null); //Just incase
1237
- niftyExecuteDialogCancelCallback(nifty_cancel_callback);
1238
- }
1239
-
1240
- /**
1241
- * Send a chat message using the socket. Also checks if this is a new message, or an edit to an existing message.
1242
- */
1243
- function sendMessage () {
1244
- var message = $inputMessage.val();
1245
- // Prevent markup from being injected into the message
1246
- message = cleanInput(message);
1247
- // Fix double emojis
1248
- if(message.search(/\:(\S+)(\:)(\S+)\:/g) !== -1){
1249
- message = message.replace(/\:(\S+)(\:)(\S+)\:/g, function (match, p1, p2, p3) {
1250
- return [":", p1, "::", p3, ":"].join('');
1251
- });
1252
- }
1253
- message = bleeper_convert_colon_to_uni(message);
1254
-
1255
-
1256
- if (niftyIsEditing !== false) {
1257
- // we edited a message
1258
- msgID = parseInt(niftyIsEditing);
1259
- jQuery(".message_"+msgID+ " .messageBody").attr("data-message", message);
1260
- jQuery(".message_"+msgID+ " .messageBody").html(wplcFormatParser(message));
1261
- socket.emit('edit message', { message:message, chatid:active_chatid, msgID:msgID });
1262
-
1263
- jQuery.event.trigger({type: "bleeper_edited_message", ndata:{ message:message, chatid:active_chatid, msgID:msgID } });
1264
-
1265
- jQuery("#inputMessage").val('');
1266
- niftyIsEditing = false;
1267
-
1268
- } else {
1269
-
1270
- // this is new message
1271
- var randomNum = Math.floor((Math.random() * 100) + 1);
1272
- var msgID = Date.now()+randomNum;
1273
- lastmessagesent = msgID;
1274
-
1275
- // if there is a non-empty message and a socket connection
1276
- if (message && connected) {
1277
- $inputMessage.val('');
1278
- var msg_obj = {
1279
- username: username,
1280
- message: message,
1281
- timestamp: Date.now(),
1282
- msgID: msgID,
1283
- aoru: agent_id
1284
- };
1285
-
1286
-
1287
- addChatMessage(msg_obj,
1288
- {is_admin: false});
1289
-
1290
- jQuery.event.trigger({type: "bleeper_send_message", message:message, msg_id:msgID});
1291
-
1292
- // tell server to execute 'new message' and send along one parameter
1293
-
1294
- if (message_type === 'u') {
1295
- bleeper_append_message_to_ls(active_chatid, msg_obj);
1296
- socket.emit('new message', { message:message, chatid:active_chatid, msgID:msgID, aoru: agent_id });
1297
- } else {
1298
- /* get agent socket id */
1299
- var to_sock_id = jQuery(".online_agent_"+message_type).attr('socket');
1300
- bleeper_append_message_to_ls(active_chatid, msg_obj);
1301
- socket.emit('new admin message', { message:message, chatid:active_chatid, msgID:msgID, from: agent_id, from_socket:socket.id, to: message_type, to_socket:to_sock_id });
1302
- }
1303
-
1304
- jQuery.event.trigger({type: "bleeper_add_message_chatbox", message:message, msgID:msgID});
1305
- }
1306
- }
1307
- }
1308
-
1309
- /**
1310
- * Deprecated Send Message function
1311
- *
1312
- * @deprecated
1313
- */
1314
- function old_sendMessage () {
1315
- var message = $inputMessage.val();
1316
- // Prevent markup from being injected into the message
1317
- message = cleanInput(message);
1318
- // if there is a non-empty message and a socket connection
1319
- if (message && connected) {
1320
- $inputMessage.val('');
1321
- addChatMessage({
1322
- username: username,
1323
- message: message,
1324
- timestamp: Date.now()
1325
-
1326
- });
1327
- // tell server to execute 'new message' and send along one parameter
1328
- var randomNum = Math.floor((Math.random() * 100) + 1);
1329
- var msgID = Date.now()+randomNum;
1330
- socket.emit('new message', {message:message,chatid:active_chatid, msgID:msgID});
1331
- }
1332
- }
1333
-
1334
- /**
1335
- * Add a log to the chat box
1336
- *
1337
- * @param {string} message Log message string
1338
- * @param {object} options Options for the message being added (fade, prepend)
1339
- */
1340
- function log (message, options) {
1341
- var $el = jQuery('<li>').addClass('log').text(message);
1342
- addMessageElement($el, options);
1343
- }
1344
-
1345
- /**
1346
- * Add a log to the chat box
1347
- *
1348
- * @param {string} message Log message string
1349
- * @param {int} id ID for the list item
1350
- * @param {object} options Options for the message being added (fade, prepend)
1351
- */
1352
- function nc_log (message, id, options) {
1353
- var $el = jQuery('<li id="'+id+'">').addClass('log').text(message);
1354
- addMessageElement($el, options);
1355
- }
1356
-
1357
- /**
1358
- * Build a url with paramaters
1359
- *
1360
- * @param {string} url The current URL
1361
- * @param {object} parameters Object of key value pairs to be added
1362
- * @return {string} URL with params attached
1363
- */
1364
- function nc_buildUrl(url, parameters){
1365
- var qs = "";
1366
- for(var key in parameters) {
1367
- var value = parameters[key];
1368
- qs += encodeURIComponent(key) + "=" + encodeURIComponent(value) + "&";
1369
- }
1370
- if (qs.length > 0){
1371
- qs = qs.substring(0, qs.length-1); //chop off last "&"
1372
- url = url + "?" + qs;
1373
- }
1374
- return url;
1375
- }
1376
-
1377
- /**
1378
- * Handles uploading a file within the chat
1379
- *
1380
- * @param {file} fileToUpload The file to upload
1381
- * @param {string} failedID The id of the div to show when upload fails
1382
- * @param {string} successID The id of the div to show when upload succeeds
1383
- * @param {string} uploadingID The id of the div to show when upload is in progress
1384
- * @param {string} originalID The id of the div to show when upload final div to show after evething is complete
1385
- */
1386
- function wplcShareFile(fileToUpload, failedID, successID, uploadingID, originalID){
1387
- if(fileToUpload == undefined || fileToUpload == false || fileToUpload == null){
1388
- return;
1389
- }
1390
-
1391
- var wplc_allowed_files = ' Allowed File Types: .jpg, .jpeg, .png, .bmp, .mp4, .mp3, .mpeg, .mpeg4, .gif, .tiff, .tif, .zip, .oog, .webm, .avi, .wav, .doc, .pdf';
1392
-
1393
- var formData = new FormData();
1394
- formData.append('file', fileToUpload);
1395
- formData.append('timestamp', Date.now());
1396
- formData.append('_wpnonce', wplc_restapi_nonce);
1397
- formData.append('cid', active_chatid);
1398
- jQuery(uploadingID).show();
1399
- jQuery(originalID).hide();
1400
- jQuery(successID).hide();
1401
- jQuery(failedID).hide();
1402
-
1403
- var uploadUrl = '';
1404
- uploadUrl = (typeof bleeper_override_upload_url !== "undefined" && bleeper_override_upload_url !== "") ? bleeper_override_upload_url : uploadUrl;
1405
-
1406
- if(fileToUpload.name.indexOf(".php") === -1 && fileToUpload.name.indexOf(".html") === -1 && fileToUpload.name.indexOf(".asp") === -1 && fileToUpload.name.indexOf(".svg") === -1){
1407
- //Files allowed - continue
1408
- if(fileToUpload.size < 8000000){
1409
- jQuery.ajax({
1410
- url : uploadUrl,
1411
- type : 'POST',
1412
- data : formData,
1413
- cache: false,
1414
- processData: false,
1415
- contentType: false,
1416
- success : function(data) {
1417
- if(parseInt(data) !== 0){
1418
- jQuery(uploadingID).hide();
1419
- jQuery(successID).show();
1420
- setTimeout(function(){
1421
- jQuery(successID).hide();
1422
- jQuery(originalID).show();
1423
- }, 2000);
1424
-
1425
- //All good post the link to file
1426
- var fileLinkUrl = false;
1427
- if(!bleeperIsJson(data)){
1428
- //This is not a parsable JSON string
1429
- if(typeof data !== "object"){
1430
- fileLinkUrl = data;
1431
- } else {
1432
- if(typeof data.response !== "undefined"){
1433
- //Our url is in response index
1434
- fileLinkUrl = data.response;
1435
- } else {
1436
- fileLinkUrl = data;
1437
- }
1438
- }
1439
-
1440
- } else {
1441
- //This is a parsable JSON string which will now be converted into an object
1442
- var dataPacket = JSON.parse(data);
1443
- if(typeof dataPacket.response !== "undefined"){
1444
- //Our url is in response index
1445
- fileLinkUrl = dataPacket.response;
1446
- } else {
1447
- fileLinkUrl = data;
1448
- }
1449
- }
1450
-
1451
- if(fileLinkUrl !== false){
1452
- if(fileLinkUrl !== 'Security Violation - File unsafe'){
1453
- var tag = (fileLinkUrl.indexOf(".png") !== -1 || fileLinkUrl.indexOf(".PNG") !== -1 || fileLinkUrl.indexOf(".jpg") !== -1 || fileLinkUrl.indexOf(".JPG") !== -1 || fileLinkUrl.indexOf(".jpeg") !== -1 || fileLinkUrl.indexOf(".JPEG") !== -1 || fileLinkUrl.indexOf(".gif") !== -1 || fileLinkUrl.indexOf(".GIF") !== -1 || fileLinkUrl.indexOf(".bmp")!== -1 || fileLinkUrl.indexOf(".BMP") !== -1 ) ? "img" : "link";
1454
-
1455
- if(tag !== "img"){
1456
- tag = (fileLinkUrl.indexOf(".mp4") !== -1 || fileLinkUrl.indexOf(".mpeg4") !== -1 || fileLinkUrl.indexOf(".webm") !== -1 || fileLinkUrl.indexOf(".oog") !== -1 ) ? "video" : "link"; //video now
1457
- }
1458
- addChatMessage({
1459
- username: username,
1460
- message: (tag + ":" + fileLinkUrl + ":" + tag)
1461
- });
1462
- socket.emit("new message", {message:(tag + ":" + fileLinkUrl + ":" + tag),chatid:active_chatid, aoru: agent_id});
1463
-
1464
- var randomNum = Math.floor((Math.random() * 100) + 1);
1465
- var msgID = Date.now()+randomNum;
1466
-
1467
- jQuery.event.trigger({type: "bleeper_add_message_chatbox", message: (tag + ":" + fileLinkUrl + ":" + tag), msg_id: msgID});
1468
- jQuery.event.trigger({type: "bleeper_send_message", message: (tag + ":" + fileLinkUrl + ":" + tag), msg_id: msgID});
1469
- } else {
1470
- alert('Security Violation: File Not Allowed.' + wplc_allowed_files);
1471
- }
1472
- }
1473
- }
1474
- else{
1475
- jQuery(uploadingID).hide();
1476
- jQuery(failedID).show();
1477
- setTimeout(function(){
1478
- jQuery(failedID).hide();
1479
- jQuery(originalID).show();
1480
- }, 2000);
1481
-
1482
- }
1483
- },
1484
- error : function (){
1485
- jQuery(uploadingID).hide();
1486
- jQuery(failedID).show();
1487
- setTimeout(function(){
1488
- jQuery(failedID).hide();
1489
- jQuery(originalID).show();
1490
- }, 2000);
1491
-
1492
-
1493
- }
1494
- });
1495
- }else{
1496
- alert("File limit is 4mb");
1497
- jQuery(uploadingID).hide();
1498
- jQuery(failedID).show();
1499
- setTimeout(function(){
1500
- jQuery(failedID).hide();
1501
- jQuery(originalID).show();
1502
- }, 2000);
1503
- }
1504
- } else{
1505
- alert("File type not supported." + wplc_allowed_files);
1506
- jQuery(uploadingID).hide();
1507
- jQuery(failedID).show();
1508
- setTimeout(function(){
1509
- jQuery(failedID).hide();
1510
- jQuery(originalID).show();
1511
- }, 2000);
1512
- }
1513
- }
1514
-
1515
- /**
1516
- * Add a notice to the chat box
1517
- *
1518
- * @param {object} data Chat message data packet
1519
- * @param {object} options Options for the message being added (fade, prepend)
1520
- */
1521
- var addNotice = function(data, options) {
1522
- options = options || {};
1523
- var new_item = "";
1524
- if(options.is_admin){
1525
- new_item += "<li class='message wplc-admin-notice wplc-color-bg-3 wplc-color-2 wplc-color-border-3' />";
1526
- } else {
1527
- new_item += "<li class='message wplc-user-notice wplc-color-bg-1 wplc-color-2 wplc-color-border-1' />";
1528
- }
1529
-
1530
- var $messageBodyDiv = jQuery('<span class="noticeBody">')
1531
- .html(wplcFormatParser(data.message));
1532
-
1533
- var $messageDiv = jQuery(new_item)
1534
-
1535
- .append($messageBodyDiv)
1536
-
1537
- addMessageElement($messageDiv, options);
1538
- }
1539
-
1540
- /**
1541
- * Add a chat message to the chat box container
1542
- *
1543
- * @param {object} data The message data
1544
- * @param {object} options The options for the message
1545
- */
1546
- function addChatMessage (data, options) {
1547
- if (typeof bleeper_disable_add_message !== "undefined") {
1548
- /* do nothing as this is being controlled by an integration */
1549
- } else {
1550
-
1551
- if(typeof data.type !=='undefined' && data.type === 'event'){
1552
- return; //CRM EVENT >> Let's bail
1553
- }
1554
-
1555
- // Don't fade the message in if there is an 'X was typing'
1556
- var $typingMessages = getTypingMessages(data);
1557
- options = options || {};
1558
- if ($typingMessages.length !== 0) {
1559
- options.fade = false;
1560
- $typingMessages.remove();
1561
- }
1562
- var new_item = "";
1563
- if(data.aoru === 'u'){
1564
- new_item += "<li class='message wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1 message_"+data.msgID+"' mid='"+data.msgID+"' />";
1565
- } else {
1566
- new_item += "<li class='message wplc-admin-message wplc-color-bg-3 wplc-color-2 wplc-color-border-3 message_"+data.msgID+"' mid='"+data.msgID+"' />";
1567
- }
1568
-
1569
-
1570
- if (typeof data.timestamp !== "undefined") {
1571
- var tdate = new Date(parseInt(data.timestamp));
1572
- var hours = tdate.getHours();
1573
- var minutes = tdate.getMinutes();
1574
- var ampm = hours >= 12 ? 'pm' : 'am';
1575
- hours = hours % 12;
1576
- hours = hours ? hours : 12; // the hour '0' should be '12'
1577
- minutes = minutes < 10 ? '0'+minutes : minutes;
1578
- var strTime = hours + ':' + minutes + ' ' + ampm;
1579
- data.timestamp = strTime;
1580
-
1581
- } else {
1582
- data.timestamp = "";
1583
- }
1584
-
1585
- var $usernameDiv = jQuery('<span class="username"/>: ')
1586
- .text(bleeper_strip_tags(data.username));
1587
-
1588
- var $timeDiv = jQuery('<span class="timestamp"/>: ')
1589
- .text(data.timestamp);
1590
-
1591
-
1592
- var edit_item = "";
1593
- /*if(data.aoru !== 'u'){
1594
- var $editDiv = jQuery('<span class="bleeper-edit-message" style="display:none"/>: ').text('edit');
1595
- } else {
1596
- var $editDiv = jQuery('<span class=""/>: ').text('');
1597
- }*/
1598
-
1599
- var $editDiv = jQuery('<span class=""/>: ').text('');
1600
-
1601
-
1602
- var $messageBodyDiv = jQuery('<span class="messageBody" data-message="' + data.message + '">')
1603
- .html(wplcFormatParser(data.message));
1604
-
1605
- if(data.aoru !== 'u'){
1606
- var $messageReadBody = jQuery('<span class="messageReadReceipt" id="read_receipt_'+data.msgID+'">').html('Sent');
1607
- } else {
1608
- var $messageReadBody = '';
1609
- }
1610
-
1611
- var typingClass = data.typing ? 'typing' : '';
1612
- var $is_typing_preview = data.typing ? jQuery("<span id='typing_preview'>") : '';
1613
- var $messageDiv = jQuery(new_item)
1614
- .data('username', bleeper_strip_tags(data.username))
1615
- .addClass(typingClass)
1616
- .append($usernameDiv, $timeDiv, $messageReadBody, $editDiv, $messageBodyDiv )
1617
- .append(" ")
1618
- .append($is_typing_preview);
1619
-
1620
- addMessageElement($messageDiv, options);
1621
- jQuery.event.trigger({type: "bleeper_check_for_read_receipt_on_adding_message", ndata: data });
1622
-
1623
- socket.emit('message read',data);
1624
-
1625
- }
1626
-
1627
- }
1628
-
1629
- /**
1630
- * Add is typing to chat box
1631
- *
1632
- * @param {object} data Data to check
1633
- */
1634
- function addChatTyping (data) {
1635
- data.typing = true;
1636
- data.message = 'is typing';
1637
- addChatMessage(data);
1638
- }
1639
-
1640
- /**
1641
- * Remove any remaining 'typing messages'
1642
- *
1643
- * @param {object} data Data to check
1644
- */
1645
- function removeChatTyping (data) {
1646
- getTypingMessages(data).fadeOut(function () {
1647
- jQuery(this).remove();
1648
- });
1649
- }
1650
-
1651
- /**
1652
- * Add a message elemtn to the document. Mostly used for events as WPLC will handle message appending
1653
- *
1654
- * @param {element} el The element to add to the chat box
1655
- * @param {object} options Options for the message being added (fade, prepend)
1656
- */
1657
- function addMessageElement (el, options) {
1658
- try{
1659
- var $el = jQuery(el);
1660
- // Setup default options
1661
- if (!options) {
1662
- options = {};
1663
- }
1664
- if (typeof options.fade === 'undefined') {
1665
- options.fade = true;
1666
- }
1667
- if (typeof options.prepend === 'undefined') {
1668
- options.prepend = false;
1669
- }
1670
-
1671
- // Apply options
1672
- if (options.fade) {
1673
- $el.hide().fadeIn(FADE_TIME);
1674
- }
1675
- if (options.prepend) {
1676
- $messages.prepend($el);
1677
- } else {
1678
- $messages.append($el);
1679
- }
1680
- if(typeof $messages !== "undefined" && typeof $messages[0] !== "undefined" && typeof $messages[0].scrollHeight !== "undefined"){
1681
- $messages[0].scrollTop = $messages[0].scrollHeight;
1682
- }
1683
- } catch (ex){
1684
-
1685
- }
1686
- }
1687
-
1688
- /**
1689
- * JS Based cleanup to prevent injected code snippets from ever making it to the server.
1690
- *
1691
- * The server will also handle some cleanup in this regard
1692
- *
1693
- * @param {string} input The content to clean
1694
- * @return {string} The clean content
1695
- */
1696
- function cleanInput (input) {
1697
- var input_cleaned = input;
1698
- if(typeof input_cleaned !== 'string'){
1699
- return input_cleaned;
1700
- }
1701
- return input_cleaned.replace(/<(?:.|\n)*?>/gm, '');
1702
- }
1703
-
1704
- /**
1705
- * Update the typing statu on the socket
1706
- */
1707
- function updateTyping () {
1708
- if (connected) {
1709
- if (!niftyIsEditing) {
1710
- if (!typing) {
1711
- typing = true;
1712
- if (message_type === 'u') {
1713
- socket.emit('typing',{chatid:active_chatid});
1714
- } else {
1715
- socket.emit('typing',{chatid:active_chatid,agent:active_socket});
1716
- }
1717
-
1718
- }
1719
- lastTypingTime = (new Date()).getTime();
1720
-
1721
- setTimeout(function () {
1722
- var typingTimer = (new Date()).getTime();
1723
- var timeDiff = typingTimer - lastTypingTime;
1724
- if (timeDiff >= TYPING_TIMER_LENGTH && typing) {
1725
-
1726
- if (message_type === 'u') {
1727
- socket.emit('stop typing',{chatid:active_chatid});
1728
- } else {
1729
- socket.emit('stop typing',{chatid:active_chatid,agent:active_socket});
1730
- }
1731
-
1732
- typing = false;
1733
- }
1734
- }, TYPING_TIMER_LENGTH);
1735
- }
1736
- }
1737
- }
1738
-
1739
- /**
1740
- * Remove any remaining 'typing messages'
1741
- *
1742
- * @param {object} data Data to check
1743
- */
1744
- function getTypingMessages (data) {
1745
- return jQuery('.typing.message').filter(function (i) {
1746
- return jQuery(this).data('username') === data.username;
1747
- });
1748
- }
1749
-
1750
-
1751
- /**
1752
- * Add the agent
1753
- *
1754
- * @param {socket} socket The socket object
1755
- * @param {object} data The agent data packet
1756
- */
1757
- var nc_add_agent = function(socket, data) {
1758
- var data = {};
1759
- /* recurring visitor */
1760
- if (typeof nc_sid !== "undefined") {
1761
- if (typeof nc_name !== "undefined") { data.username = nc_name; } else { data.username = 'Agent'; }
1762
- data.api_key = nifty_api_key;
1763
- data.sid = null;
1764
- } else {
1765
- /* first time user */
1766
- data.username = bleeper_agent_name;
1767
- data.api_key = nifty_api_key;
1768
- data.agent_id = agent_id;
1769
- data.sid = null;
1770
- }
1771
- jQuery.event.trigger({type: "bleeper_add_agent", ndata:data});
1772
- }
1773
-
1774
- /**
1775
- * Get a specific cookie by name
1776
- *
1777
- * @param {string} name The name of the cookie
1778
- * @return {string} The value of the cookie
1779
- */
1780
- function nc_getCookie(name) {
1781
- var value = "; " + document.cookie;
1782
- var parts = value.split("; " + name + "=");
1783
- if (parts.length == 2) return parts.pop().split(";").shift();
1784
- }
1785
-
1786
- var bleeper_random_offline_image_count = Math.floor((Math.random() * 9) + 1);
1787
- /**
1788
- * Show the no visitors image
1789
- */
1790
- function nc_no_visitors() {
1791
- var random_img = "<img id='bleeper_offline_image' src='" + wplc_baseurl + "/images/random_images/offline_images/" + bleeper_random_offline_image_count + ".jpg' />";
1792
-
1793
- jQuery("#active_count").html("0");
1794
- jQuery(".nifty_bg_holder_text").html(random_img + "There are no visitors on your site at the moment");
1795
- jQuery(".nifty_bg_holder").css('left','25%');
1796
-
1797
- /* only fade in if were not chatting with an agent, or if we do not have a completed chat open */
1798
- if (typeof active_chatid === "undefined") {
1799
- jQuery(".nifty_bg_holder").fadeIn();
1800
- }
1801
-
1802
-
1803
-
1804
-
1805
- }
1806
-
1807
- /**
1808
- * Update the visitor counter
1809
- *
1810
- * @param {int} count The new visitor count
1811
- */
1812
- function nc_update_visitor_count(count) {
1813
- if(typeof count === 'number'){
1814
- jQuery("#active_count").html(count);
1815
- } else {
1816
- /** Wait a second and then count the elements for a more accurate count */
1817
- setTimeout(function(){
1818
- jQuery("#active_count").html(document.querySelectorAll('.visitorList').length);
1819
- }, 1000);
1820
- }
1821
- }
1822
-
1823
- /**
1824
- * Add the accept chat button to the visitor row
1825
- *
1826
- * @param {string} chatid The Chat ID
1827
- */
1828
- function nc_add_accept_chat_visitor_row(chatid) {
1829
- if(typeof bleeper_io_is_origin !== "undefined" && bleeper_io_is_origin === true){
1830
- nc_add_open_chat_visitor_row(chatid);
1831
- } else {
1832
- if ( jQuery("#vis"+chatid+" .visActionCol .accept_chat").length === 0 ) {
1833
- jQuery('<div/>', {
1834
- 'class': '',
1835
- html: "<a href='javascript:void(0);' class='accept_chat btn btn-danger pull-right' cid='"+chatid+"'>Accept Chat</a>"
1836
- }).appendTo('#vis'+chatid+" .visActionCol");
1837
- nc_remove_init_chat_visitor_row(chatid);
1838
- }
1839
- }
1840
- }
1841
-
1842
- /**
1843
- * Add the open chat button to the visitor row
1844
- *
1845
- * @param {string} chatid The Chat ID
1846
- */
1847
- function nc_add_open_chat_visitor_row(chatid) {
1848
- jQuery(".nifty_bg_holder_text").html("");
1849
- jQuery(".nifty_bg_holder").fadeOut();
1850
-
1851
- if ( jQuery(".open_chat_"+chatid).length > 0 ) { } else {
1852
- jQuery('<div/>', {
1853
- 'class': '',
1854
- html: "<a href='javascript:void(0);' class='open_chat open_chat_"+chatid+" btn btn-success pull-right' cid='"+chatid+"'>Open Chat</a>"
1855
- }).appendTo('#vis'+chatid + " .visActionCol");
1856
- }
1857
- }
1858
- /**
1859
- * Remove the open chat button from the visitor row
1860
- *
1861
- * @param {string} chatid The Chat ID
1862
- */
1863
- function nc_remove_open_chat_visitor_row(chatid) { jQuery("#vis"+chatid+" .open_chat").remove(); }
1864
-
1865
- /**
1866
- * Remove the accept chat button from the visitor row
1867
- *
1868
- * @param {string} chatid The Chat ID
1869
- */
1870
- function nc_remove_accept_chat_visitor_row(chatid) {
1871
- jQuery("#vis"+chatid+" .accept_chat").remove();
1872
- bleeper_ring.pause();
1873
- if(!isNaN(bleeper_ring.duration)){
1874
- bleeper_ring.currentTime = 0;
1875
- }
1876
-
1877
- wplc_new_chat_ringer_dismissed = true;
1878
- }
1879
-
1880
- /**
1881
- * Remove the init chat button from the visitor row
1882
- *
1883
- * @param {string} chatid The Chat ID
1884
- */
1885
- function nc_remove_init_chat_visitor_row(chatid) {
1886
- jQuery("#vis"+chatid+" .init_chat").remove();
1887
- jQuery.event.trigger({type: "bleeper_remove_initiate_button", cid:chatid});
1888
- }
1889
-
1890
- /**
1891
- * Clears the action column for the specific chat ID (visitor)
1892
- *
1893
- * @param {string} chatid The Chat ID
1894
- */
1895
- function nc_clear_action_col_visitor_row(chatid) {
1896
- jQuery("#vis"+chatid+" .visActionCol").html('');
1897
-
1898
- /**
1899
- * TO DO
1900
- * Check if there are any OTHER visitors that are wanting to chat (i.e. use jQuery to run through all buttons).
1901
- * If there are still .accept_chat's present, then dont stop the bleeper_ring.
1902
- */
1903
- bleeper_ring.pause();
1904
- if(!isNaN(bleeper_ring.duration)){
1905
- bleeper_ring.currentTime = 0;
1906
- }
1907
- wplc_new_chat_ringer_dismissed = true;
1908
-
1909
- }
1910
-
1911
- /**
1912
- * Add user to the user list
1913
- *
1914
- * @param {object} data The user data
1915
- * @param {function} next Callback to fire after this has completed
1916
- */
1917
- function nc_add_user_to_list(data, next) {
1918
- if (typeof data === "undefined")
1919
- return;
1920
-
1921
-
1922
- var date = new Date();
1923
- var minute = date.getMinutes();
1924
- var hour = date.getHours();
1925
-
1926
- if(minute < 10){
1927
- minute = '0' + minute;
1928
- }
1929
-
1930
- /* update the visitor table */
1931
- jQuery("#vis"+data.chatid+" .session-state-label").html(bleeper_pretty_chat_status(data.state));
1932
-
1933
- nc_clear_action_col_visitor_row(data.chatid);
1934
- nc_add_open_chat_visitor_row(data.chatid);
1935
-
1936
- /* add to the userList */
1937
- if (jQuery("#"+data.chatid).length) {
1938
- nc_update_user_to_list(data);
1939
- } else {
1940
-
1941
- jQuery('<div/>', {
1942
- id: data.chatid,
1943
- 'class': 'userList',
1944
- })
1945
- .css('display','none')
1946
- .attr('socket', data.socketid)
1947
- .attr('customerID', data.customerID)
1948
- .appendTo('.userListBox');
1949
-
1950
- var t_em = typeof data.email !== "undefined" ? md5(data.email) : '';
1951
-
1952
- jQuery('<img/>', {
1953
- 'src' : 'https://www.gravatar.com/avatar/'+t_em+'?s=24&d=mm',
1954
- 'class': 'bleeper_userlist_gravatar bleeper_userlist_gravatar_'+data.chatid
1955
- }).appendTo('#'+data.chatid);
1956
-
1957
- jQuery('<h3/>', {
1958
- html: "<span class='userName'>"+bleeper_strip_tags( (typeof data.username !== "undefined" ? data.username : "Guest") )+'</span>'
1959
- }).appendTo('#'+data.chatid);
1960
- jQuery('<span/>', {
1961
- text: 'x',
1962
- "class": 'bleeper_close_item bleeper_close_item_'+data.chatid,
1963
- "cid": data.chatid
1964
- }).appendTo('#'+data.chatid);
1965
-
1966
- jQuery('<p/>', {
1967
- text: hour + ":" + minute,
1968
- "class" : "userInfo"
1969
- }).appendTo('#'+data.chatid);
1970
-
1971
- jQuery('<p/>', {
1972
- text: "",
1973
- "class" : "userItemLastMessage"
1974
- })
1975
- .css('display','block')
1976
- .appendTo('#'+data.chatid);
1977
-
1978
- jQuery('<p/>', {
1979
- text: "",
1980
- "class" : "unread_count"
1981
- })
1982
- .css('display','none')
1983
- .appendTo('#'+data.chatid);
1984
-
1985
- jQuery('<div/>', {
1986
- text: "",
1987
- "class" : "agents_involved"
1988
- })
1989
- .css('display','block')
1990
- .appendTo('#'+data.chatid);
1991
-
1992
- if (typeof bleeper_departments !== "undefined") {
1993
- if (typeof data.department !== 'undefined') {
1994
- if (data.department !== 'any') {
1995
- jQuery('<div/>', {
1996
- text: (typeof data.department !== "undefined" ? bleeper_departments[data.department] : bleeper_default_department_tag),
1997
- "class" : "department_assigned"
1998
- })
1999
- .css('display','block')
2000
- .appendTo('#'+data.chatid);
2001
- }
2002
- }
2003
- }
2004
-
2005
- jQuery("#"+data.chatid).fadeIn("slow");
2006
-
2007
- }
2008
-
2009
- next(data);
2010
- }
2011
-
2012
- /**
2013
- * Update a user in the user list
2014
- *
2015
- * @param {object} data The user data
2016
- */
2017
- function nc_update_user_to_list(data) {
2018
- var date = new Date();
2019
- var minute = date.getMinutes();
2020
- var hour = date.getHours();
2021
-
2022
- if(minute < 10){
2023
- minute = '0' + minute;
2024
- }
2025
-
2026
-
2027
- jQuery("#"+data.chatid+ " .userList").attr("socket",data.socketid);
2028
- jQuery("#"+data.chatid+ " .userInfo").html(hour + ":" + minute);
2029
-
2030
- }
2031
-
2032
- /**
2033
- * Update a visitor in the visitor list
2034
- *
2035
- * @param {object} data The visitor data
2036
- */
2037
- function nc_update_visitor_to_list(data) {
2038
- var date = new Date();
2039
- var minute = date.getMinutes();
2040
- var hour = date.getHours();
2041
-
2042
- jQuery("#"+data.chatid+ " .visitorList").attr("socket",data.socketid);
2043
- jQuery("#"+data.chatid+ " .visitorInfo").html(hour + ":" + minute);
2044
- }
2045
-
2046
- /**
2047
- * Add visitor to the visitor list
2048
- *
2049
- * @param {object} data The visitor data
2050
- */
2051
- function nc_add_visitor_to_list(data) {
2052
- jQuery(".nifty_bg_holder_text").html("");
2053
- jQuery(".nifty_bg_holder").fadeOut();
2054
- if (jQuery("#vis"+data.chatid).length) {
2055
- nc_update_visitor_to_list(data);
2056
- } else {
2057
-
2058
- jQuery('<div/>', {
2059
- id: "vis"+data.chatid,
2060
- 'class': 'visitorList',
2061
- })
2062
- .css('display','none')
2063
- .attr('socket', data.socketid)
2064
- .appendTo('.visitorListBox');
2065
-
2066
- jQuery('<div/>', {
2067
- 'class': 'vcol visCol',
2068
- html: "<span class='userName'>"+bleeper_strip_tags((typeof data.username !== "undefined" ? data.username : "Guest"))+"</span>"
2069
- }).appendTo('#vis'+data.chatid);
2070
-
2071
- jQuery('<div/>', {
2072
- 'class': 'vcol visStatusCol',
2073
- html: "<span class='info_chat' cid='"+data.chatid+"' >" + nc_return_browser_details(data) + " " + nc_return_location_details(data) + " " + nc_return_device_details(data) + bleeper_return_visitor_os_data(data) + "</span>"
2074
- }).appendTo('#vis'+data.chatid);
2075
-
2076
- jQuery('<div/>', {
2077
- 'class': 'vcol visPageCol',
2078
- html: "<a href='"+bleeper_strip_tags(data.referer)+"' class='referer-link truncate' target='_BLANK'>"+bleeper_strip_tags(data.referer)+"</a>"+bleeper_return_visitor_lifetime_data(data)+"<br/>"+bleeper_return_visitor_timezone_data(data)+bleeper_return_campaign_data(bleeper_strip_tags(data.referer))+"</em>"
2079
- }).appendTo('#vis'+data.chatid);
2080
-
2081
- jQuery('<div/>', {
2082
- 'class': 'vcol visChatStatusCol',
2083
- html: "<label class='label-default session-state-label'>" + bleeper_pretty_chat_status(data.state) + "</label><div class='agents_involved_visitor'></div>"
2084
- }).appendTo('#vis'+data.chatid);
2085
-
2086
- if(typeof bleeper_departments !== "undefined"){
2087
- jQuery('<div/>', {
2088
- 'class': 'vcol visChatDepCol',
2089
- html: "<label class='label-default'>" + (typeof data.department !== "undefined" && typeof bleeper_departments[ data.department ] !== "undefined" ? bleeper_departments[ data.department ] : bleeper_default_department_tag) + "</label>"
2090
- }).appendTo('#vis'+data.chatid);
2091
- }
2092
-
2093
- jQuery('<div/>', {
2094
- 'class': 'vcol visActionCol',
2095
- html: ""
2096
- }).appendTo('#vis'+data.chatid);
2097
-
2098
- jQuery.event.trigger({type: "bleeper_add_initiate_button_no_col", cid:data.chatid});
2099
-
2100
- var show_based_on_filter = !bleeper_hide_visitor_by_filter(data); //Set it to the oposite filter
2101
- var show_based_on_domain_filter = !bleeper_hide_visitor_by_domain_filter(data);
2102
-
2103
-
2104
- if(show_based_on_filter && show_based_on_domain_filter){
2105
- jQuery.event.trigger({type: "bleeper_new_visitor", cid:data.chatid});
2106
- jQuery("#vis"+data.chatid).fadeIn("slow");
2107
- }
2108
- }
2109
- }
2110
-
2111
- /**
2112
- * Update the visitor list
2113
- *
2114
- * @param {object} data The visitor list object
2115
- */
2116
- function nc_update_visitor_to_list(data) {
2117
- var date = new Date();
2118
- var minute = date.getMinutes();
2119
- var hour = date.getHours();
2120
- jQuery("#vis"+data.chatid+ " .visitorList").attr("socket",data.socketid);
2121
- jQuery("#vis"+data.chatid+ " .session-state-label").html(bleeper_pretty_chat_status(data.state));
2122
- jQuery("#vis"+data.chatid+ " .visPageCol").html("<a href='"+bleeper_strip_tags(data.referer)+"' class='referer-link truncate' target='_BLANK'>"+bleeper_strip_tags(data.referer)+"</a>"+bleeper_return_visitor_lifetime_data(data)+"<br/>"+bleeper_return_visitor_timezone_data(data)+bleeper_return_campaign_data(bleeper_strip_tags(data.referer))+"</em>");
2123
-
2124
- jQuery("#vis"+data.chatid+ " .visitorInfo").html(hour + ":" + minute);
2125
-
2126
- if(typeof bleeper_departments !== "undefined"){
2127
- jQuery("#vis"+data.chatid+ " .visChatDepCol").html("<label class='label-default'>" + (typeof data.department !== "undefined" && typeof bleeper_departments[ data.department ] !== "undefined" ? bleeper_departments[ data.department ] : bleeper_default_department_tag) + "</label>");
2128
- }
2129
-
2130
- var hide_based_on_filter = bleeper_hide_visitor_by_filter(data); //Set it to the oposite filter
2131
- var hide_based_on_domain_filter = bleeper_hide_visitor_by_domain_filter(data); //Set it to the oposite filter
2132
-
2133
- var accept_chat_present = false;
2134
-
2135
- if (typeof data.state !== "undefined" && data.state === 'browsing' ) {
2136
-
2137
- if ( jQuery("#vis"+data.chatid+" .visActionCol .accept_chat").length > 0 ) {
2138
- accept_chat_present = true;
2139
- }
2140
-
2141
- if (accept_chat_present) {
2142
- jQuery("#vis"+data.chatid+" .visActionCol").html('');
2143
- nc_add_accept_chat_visitor_row(data.chatid);
2144
- } else {
2145
- bleeper_ring.pause();
2146
- if(!isNaN(bleeper_ring.duration)){
2147
- bleeper_ring.currentTime = 0;
2148
- }
2149
- wplc_new_chat_ringer_dismissed = true;
2150
-
2151
-
2152
- /* Add the INIT button if it is NOT there */
2153
- if ( jQuery("#vis"+data.chatid+" .visActionCol .init_chat").length > 0 || jQuery("#vis"+data.chatid+" .visActionCol .wplc_initiate_chat").length > 0 ) { } else {
2154
- jQuery("#vis"+data.chatid+" .visActionCol").html('');
2155
- jQuery.event.trigger({type: "bleeper_add_initiate_button_no_col", cid:data.chatid});
2156
- }
2157
- }
2158
- }
2159
-
2160
- var show_based_on_filter = !bleeper_hide_visitor_by_filter(data); //Set it to the oposite filter
2161
- var show_based_on_domain_filter = !bleeper_hide_visitor_by_domain_filter(data);
2162
-
2163
- if(show_based_on_filter && show_based_on_domain_filter){
2164
- jQuery("#vis"+data.chatid).fadeIn("slow");
2165
- } else {
2166
- jQuery("#vis"+data.chatid).fadeOut("slow");
2167
- }
2168
- }
2169
-
2170
- /**
2171
- * Hide visitors based on a domain
2172
- *
2173
- * @param {object} data The visitor data package
2174
- */
2175
- function bleeper_hide_visitor_by_domain_filter(data) {
2176
- /* are we filtering domains? */
2177
- var passed_domain = jQuery(".bleeper_domain_selector").val();
2178
-
2179
- var vis_id = data.chatid;
2180
- if (typeof passed_domain !== 'undefined' && passed_domain !== undefined && passed_domain !== 'false') {
2181
- if(typeof visitor_list !=='undefined' && typeof visitor_list[vis_id] !== 'undefined'){
2182
- if(typeof visitor_list[vis_id]['referer'] !== 'undefined'){
2183
- var ref = visitor_list[vis_id]['referer'];
2184
- if(ref.indexOf(passed_domain) !== -1){
2185
- return false;
2186
- } else {
2187
- return true;
2188
- }
2189
- } else {
2190
- return true;
2191
- }
2192
- } else {
2193
- return true;
2194
- }
2195
- } else {
2196
- return false;
2197
- }
2198
- }
2199
-
2200
- /**
2201
- * Update the unread count for a specific chat ID
2202
- *
2203
- * @param {string} chatid The chat ID
2204
- */
2205
- function nc_update_unread_count(chatid) {
2206
- if (typeof unread_count[chatid] === "undefined" || unread_count[chatid] < 1) {
2207
- jQuery("#"+chatid+ " .unread_count").hide();
2208
- } else {
2209
- jQuery("#"+chatid+ " .unread_count").show();
2210
- jQuery("#"+chatid+ " .unread_count").html(unread_count[chatid]);
2211
- }
2212
- bleeper_check_if_all_read();
2213
- }
2214
-
2215
- /**
2216
- * Check if all unread messages have been read
2217
- */
2218
- function bleeper_check_if_all_read() {
2219
- var tot_unread = 0;
2220
- for (k in unread_count) {
2221
- if (parseInt(unread_count[k]) > 0) {
2222
- tot_unread = tot_unread + parseInt(unread_count[k]);
2223
- }
2224
- }
2225
- if (tot_unread > 0) {
2226
- bleeper_change_favico(bleeper_favico_noti);
2227
- }
2228
- }
2229
-
2230
- /**
2231
- * Update the last message from the visitor in the list
2232
- *
2233
- * @param {string} chatid The Chat ID
2234
- * @param {object} message The message data packet
2235
- * @param {bool} update_user_list Should we update the user list...
2236
- */
2237
- function nc_update_last_message(chatid, message, update_user_list) {
2238
- if (typeof message.date !== "undefined") {
2239
- var date = new Date(message.date);
2240
- } else {
2241
- var date = new Date();
2242
- }
2243
- var minute = date.getMinutes();
2244
- var hour = date.getHours();
2245
- jQuery("#"+chatid+ " .visitorInfo").html(hour + ":" + minute);
2246
- jQuery("#vis"+chatid+" .session-state-label").html("active");
2247
- jQuery("#"+chatid+ " .userItemLastMessage").html(wplcFormatParser(message.message));
2248
- last_chat_messages[chatid] = message.message;
2249
-
2250
- /* add this message to sessionStorage */
2251
- bleeper_append_message_to_ls(chatid, message);
2252
-
2253
-
2254
- /* set this chat as active if it isnt already ... */
2255
- if (update_user_list) {
2256
- /* first check if this agent is involved in the chat, else do not add to the left chat list */
2257
- if (typeof involved_list[chatid] !== "undefined" && involved_list[chatid] === true) {
2258
- nc_add_user_to_list(visitor_list[chatid], function(data){
2259
-
2260
- });
2261
- }
2262
- }
2263
- }
2264
-
2265
- /**
2266
- * Test to make sure sessionStorage exists and is enabled
2267
- *
2268
- * @return {bool} True if session storage is available
2269
- */
2270
- function bleeper_test_sessionStorage() {
2271
- if (typeof sessionStorage !== 'undefined') {
2272
- try {
2273
- sessionStorage.setItem('bleeper_test', 'yes');
2274
- if (sessionStorage.getItem('bleeper_test') === 'yes') {
2275
- sessionStorage.removeItem('bleeper_test');
2276
- return true;
2277
- // sessionStorage is enabled
2278
- } else {
2279
- return false;
2280
- // sessionStorage is disabled
2281
- }
2282
- } catch(e) {
2283
- return false;
2284
- // sessionStorage is disabled
2285
- }
2286
- } else {
2287
- return false;
2288
- // sessionStorage is not available
2289
- }
2290
- }
2291
-
2292
- /**
2293
- * Update the event box for the current chat ID
2294
- *
2295
- * @param {string} chatid The Chat ID
2296
- */
2297
- function bleeper_update_event_box(chatid) {
2298
- if (bleeper_test_sessionStorage()) {
2299
- if (sessionStorage.getItem(chatid+"_e") !== null) {
2300
- var msg_obj = JSON.parse(sessionStorage.getItem(chatid+"_e"));
2301
- for (key in msg_obj) {
2302
- bleeper_add_event_to_eventbox(msg_obj[key].icon, msg_obj[key].desc, [key]);
2303
- }
2304
- }
2305
-
2306
- }
2307
- }
2308
-
2309
- /**
2310
- * Add a message to session storage
2311
- *
2312
- * @param {string} chatid The chat ID
2313
- * @param {object} message_obj The message object
2314
- */
2315
- function bleeper_add_message_to_sessionStorage(chatid, message_obj) {
2316
- if (bleeper_test_sessionStorage()) {
2317
-
2318
- var wplc_d = new Date();
2319
- var cdatetime = wplc_d.getTime();
2320
-
2321
- if (sessionStorage.getItem(chatid+"_m") !== null) {
2322
- var msg_obj = JSON.parse(sessionStorage.getItem(chatid+"_m"));
2323
- msg_obj[cdatetime] = message_obj;
2324
- sessionStorage.setItem(chatid+"_m", JSON.stringify(msg_obj));
2325
-
2326
- } else {
2327
- var msg_obj = {};
2328
- msg_obj[cdatetime] = message_obj;
2329
- sessionStorage.setItem(chatid+"_m", JSON.stringify(msg_obj));
2330
- }
2331
-
2332
- }
2333
- }
2334
-
2335
- /**
2336
- * Save and event to local storage and add it to the event box
2337
- *
2338
- * @param {string} chatid The chat ID
2339
- * @param {string} icon The font awesome icon to be used
2340
- * @param {string} desc Label for the event to be shown in the panel
2341
- * @param {object} data The chat data packet
2342
- */
2343
- function bleeper_save_event(chatid, icon, desc, data) {
2344
- if (bleeper_test_sessionStorage()) {
2345
-
2346
- var wplc_d = new Date();
2347
- var cdatetime = Math.round( wplc_d.getTime() / 1000 );
2348
-
2349
- if (sessionStorage.getItem(chatid+"_e") !== null) {
2350
- var msg_obj = JSON.parse(sessionStorage.getItem(chatid+"_e"));
2351
- msg_obj[cdatetime] = {};
2352
- msg_obj[cdatetime].desc = desc;
2353
- msg_obj[cdatetime].icon = icon;
2354
- msg_obj[cdatetime].data = data;
2355
- sessionStorage.setItem(chatid+"_e", JSON.stringify(msg_obj));
2356
-
2357
- } else {
2358
- var msg_obj = {};
2359
- msg_obj[cdatetime] = {};
2360
- msg_obj[cdatetime].desc = desc;
2361
- msg_obj[cdatetime].icon = icon;
2362
- msg_obj[cdatetime].data = data;
2363
- sessionStorage.setItem(chatid+"_e", JSON.stringify(msg_obj));
2364
- }
2365
-
2366
- if (active_chatid === chatid) {
2367
- bleeper_add_event_to_eventbox(icon, desc, cdatetime);
2368
- }
2369
-
2370
- }
2371
- }
2372
-
2373
- /**
2374
- * Remove events from the session storage, for a specific Chat ID
2375
- *
2376
- * @param {string} chatid The Chat ID
2377
- */
2378
- function bleeper_remove_events(chatid) {
2379
- if (bleeper_test_sessionStorage()) {
2380
- sessionStorage.removeItem(chatid+"_e");
2381
- }
2382
- }
2383
-
2384
- /**
2385
- * Add an event element to the events panel
2386
- *
2387
- * @param {string} icon The font awesome icon to be used
2388
- * @param {string} desc Label for the event to be shown in the panel
2389
- * @param {string} datetime Date/Time of the event
2390
- */
2391
- function bleeper_add_event_to_eventbox(icon, desc, datetime) {
2392
- jQuery('<li/>', {
2393
- id: "event-"+datetime,
2394
- })
2395
- .prependTo('.events-ul');
2396
-
2397
- jQuery('<div/>', {
2398
- 'class': 'event-icon',
2399
- html: "<i class='fa "+icon+"'></i>"
2400
- }).appendTo('#event-'+datetime);
2401
-
2402
- jQuery('<div/>', {
2403
- 'class': 'event-desc',
2404
- html: desc
2405
- }).appendTo('#event-'+datetime);
2406
-
2407
- jQuery('<div/>', {
2408
- 'class': 'event-meta',
2409
- html: bleeper_date_converter(datetime)
2410
- }).appendTo('#event-'+datetime);
2411
-
2412
- }
2413
-
2414
- /**
2415
- * Remove all messages for specific chat from local storage
2416
- *
2417
- * @param {string} chatid The chat ID
2418
- */
2419
- function bleeper_remove_chatid_from_ls(chatid) {
2420
- if (bleeper_test_sessionStorage()) {
2421
- sessionStorage.removeItem(chatid+"_m");
2422
- }
2423
- }
2424
-
2425
- /**
2426
- * Add message to local storage
2427
- *
2428
- * @param {string} chatid The chat ID
2429
- * @param {string} lmessage The message data object
2430
- */
2431
- function bleeper_append_message_to_ls(chatid, lmessage) {
2432
- if (bleeper_test_sessionStorage()) {
2433
-
2434
- var new_msg = {};
2435
- if(typeof lmessage !== "undefined" && typeof lmessage.msgID !== "undefined"){
2436
- new_msg.mid = lmessage.msgID.toString();
2437
- }
2438
- new_msg.originates = lmessage.aoru === "u" ? "2" : "1";
2439
- new_msg.msg = lmessage.message;
2440
- new_msg.other = {};
2441
- if (new_msg.originates === "1") {
2442
- if (typeof lmessage.aoru !== "undefined") {
2443
- new_msg.other.aid = lmessage.aoru;
2444
- }
2445
- if (typeof lmessage.aid !== "undefined") {
2446
- new_msg.other.aid = lmessage.aid;
2447
- }
2448
-
2449
- }
2450
-
2451
- var wplc_d = new Date();
2452
- new_msg.other.datetime = Math.round( wplc_d.getTime() / 1000 );
2453
-
2454
- if (sessionStorage.getItem(chatid+"_m") !== null) {
2455
- var msg_obj = JSON.parse(sessionStorage.getItem(chatid+"_m"));
2456
- msg_obj[lmessage.msgID] = new_msg;
2457
- sessionStorage.setItem(chatid+"_m", JSON.stringify(msg_obj));
2458
-
2459
- } else {
2460
- var msg_obj = {};
2461
- msg_obj[lmessage.msgID] = new_msg;
2462
- sessionStorage.setItem(chatid+"_m", JSON.stringify(msg_obj));
2463
- }
2464
- }
2465
- }
2466
-
2467
- /**
2468
- * Creates a pretty-print date from a UNIX timestamp
2469
- *
2470
- * @param {date} UNIX_timestamp The UNIX timestamp
2471
- * @return {string} Pretty printed date
2472
- */
2473
- function bleeper_date_converter(UNIX_timestamp) {
2474
- var a = new Date(UNIX_timestamp * 1000);
2475
- var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
2476
- var month = months[a.getMonth()];
2477
- var date = a.getDate();
2478
- var hour = a.getHours();
2479
- var min = a.getMinutes() < 10 ? '0' + a.getMinutes() : a.getMinutes();
2480
- var sec = sec = a.getSeconds() < 10 ? '0' + a.getSeconds() : a.getSeconds();
2481
- var time = date + ' ' + month + ' ' + hour + ':' + min + ':' + sec ;
2482
- return time;
2483
- }
2484
-
2485
- /**
2486
- * Updates the user typing flag
2487
- *
2488
- * @param {string} chatid The chat ID
2489
- */
2490
- function nc_update_user_typing(chatid) {
2491
- last_chat_messages[chatid] = jQuery("#vis"+chatid+ " .session-state-label").html();
2492
- jQuery("#"+chatid+ " .userItemLastMessage").html('<label class="label-default session-state-label">'+wplc_admin_strings.typing_string+'</label>');
2493
- }
2494
-
2495
- /**
2496
- * Removes the user typing content
2497
- *
2498
- * @param {string} chatid The chat ID
2499
- */
2500
- function nc_update_user_stop_typing(chatid) {
2501
- if (typeof last_chat_messages[chatid] !== "undefined") {
2502
- jQuery("#"+chatid+ " .userItemLastMessage").html(wplcFormatParser(last_chat_messages[chatid]));
2503
- }
2504
- }
2505
-
2506
- /**
2507
- * Process all inline formatting (For example: bold, italic, preformatted, etc) within a message
2508
- *
2509
- * @param {string} msg The chat message
2510
- * @return {string} The formatted message
2511
- */
2512
- wplcFormatParser = function(msg){
2513
- var bypass_inline_links = false;
2514
-
2515
- //Handled by inline link generator
2516
- if(msg.indexOf("link:") !== -1){
2517
- msg = msg.replace(/link:/g, "");
2518
- }
2519
- if(msg.indexOf(":link") !== -1){
2520
- msg = msg.replace(/:link/g, "");
2521
- }
2522
-
2523
- if(msg.indexOf("video:") !== -1){
2524
- msg = msg.replace(/video:/g, "<video style='background-color: black; max-width:100%;' src='");
2525
- bypass_inline_links = true;
2526
- }
2527
- if(msg.indexOf(":video") !== -1){
2528
- msg = msg.replace(/:video/g, "' controls></video>");
2529
- bypass_inline_links = true;
2530
- }
2531
-
2532
- if(msg.indexOf("vid:") !== -1){
2533
- msg = msg.replace(/vid:/g, "<video style='background-color: black; max-width:100%;' src='");
2534
- bypass_inline_links = true;
2535
- }
2536
- if(msg.indexOf(":vid") !== -1){
2537
- msg = msg.replace(/:vid/g, "' controls></video>");
2538
- bypass_inline_links = true;
2539
- }
2540
-
2541
- if(msg.indexOf("mark:") !== -1){
2542
- msg = msg.replace(/mark:/g, "<mark>");
2543
- }
2544
- if(msg.indexOf(":mark") !== -1){
2545
- msg = msg.replace(/:mark/g, "</mark>");
2546
- }
2547
-
2548
- if(msg.indexOf("strike:") !== -1){
2549
- msg = msg.replace(/strike:/g, "<del>");
2550
- }
2551
- if(msg.indexOf(":strike") !== -1){
2552
- msg = msg.replace(/:strike/g, "</del>");
2553
- }
2554
-
2555
- if(msg.indexOf("sub:") !== -1){
2556
- msg = msg.replace(/sub:/g, "<sub>");
2557
- }
2558
- if(msg.indexOf(":sub") !== -1){
2559
- msg = msg.replace(/:sub/g, "</sub>");
2560
- }
2561
- if(msg.indexOf("sup:") !== -1){
2562
- msg = msg.replace(/sup:/g, "<sup>");
2563
- }
2564
- if(msg.indexOf(":sup") !== -1){
2565
- msg = msg.replace(/:sup/g, "</sup>");
2566
- }
2567
-
2568
- // Fix double emojis
2569
- if(msg.search(/\:(\S+)(\:)(\S+)\:/g) !== -1){
2570
- msg = msg.replace(/\:(\S+)(\:)(\S+)\:/g, function (match, p1, p2, p3) {
2571
- return [":", p1, "::", p3, ":"].join('');
2572
- });
2573
- }
2574
-
2575
- msg = bleeper_emoji_render(msg); //First render emojis before processing italics
2576
- var italics_match = msg.match(/_([^*]*?)_/g);
2577
- if (italics_match !== null) {
2578
- for (var i = 0, len = italics_match.length; i < len; i++) {
2579
- var to_find = italics_match[i];
2580
- var to_replace = to_find.substring(1, to_find.length-1); // remove the starting _ and ending _
2581
- msg = msg.replace(to_find, "<em>"+to_replace+"</em>");
2582
-
2583
- }
2584
- }
2585
-
2586
- /* New IMG processor */
2587
- var image_match = msg.match(/img:([^*]*?):img/g);
2588
- if (image_match !== null) {
2589
- for (var i = 0, len = image_match.length; i < len; i++) {
2590
- var to_find = image_match[i];
2591
- var to_replace = to_find.substring(4, to_find.length-4); // remove the starting #### and ending ####
2592
- msg = msg.replace(to_find, "<img style='max-width:100%; cursor:pointer;' onclick='window.open(this.src)' src='"+bleeper_url_path_em_stripper(to_replace.replace("::", ":"))+"' />");
2593
- bypass_inline_links = true;
2594
-
2595
- }
2596
- }
2597
-
2598
- var image_match = msg.match(/####([^*]*?)####/g);
2599
- if (image_match !== null) {
2600
- for (var i = 0, len = image_match.length; i < len; i++) {
2601
- var to_find = image_match[i];
2602
- var to_replace = to_find.substring(4, to_find.length-4); // remove the starting #### and ending ####
2603
- msg = msg.replace(to_find, "<img style='max-width:100%; cursor:pointer;' onclick='window.open(this.src)' src='"+bleeper_url_path_em_stripper(to_replace)+"' />");
2604
- bypass_inline_links = true;
2605
-
2606
- }
2607
- }
2608
-
2609
- var bold_match = msg.match(/\*\s*([^*]*?)\s*\*/g);
2610
- if (bold_match !== null) {
2611
- for (var i = 0, len = bold_match.length; i < len; i++) {
2612
- var to_find = bold_match[i];
2613
- var to_replace = to_find.substring(1, to_find.length-1); // remove the starting * and ending *
2614
- msg = msg.replace(to_find, "<strong>"+to_replace+"</strong>");
2615
-
2616
- }
2617
- }
2618
-
2619
- var pre_match = msg.match(/```([^*]*?)```/g);
2620
- if (pre_match !== null) {
2621
- for (var i = 0, len = pre_match.length; i < len; i++) {
2622
- var to_find = pre_match[i];
2623
- var to_replace = to_find.substring(3, to_find.length-3); // remove the starting ``` and ending ```
2624
- msg = msg.replace(to_find, "<pre>"+to_replace+"</pre>");
2625
-
2626
- }
2627
- }
2628
-
2629
- var code_match = msg.match(/`([^*]*?)`/g);
2630
- if (code_match !== null) {
2631
- for (var i = 0, len = code_match.length; i < len; i++) {
2632
- var to_find = code_match[i];
2633
- var to_replace = to_find.substring(1, to_find.length-1); // remove the starting ` and ending `
2634
- msg = msg.replace(to_find, "<code>"+to_replace+"</code>");
2635
-
2636
- }
2637
- }
2638
-
2639
- msg = msg.replace(/\n/g, "<br />");
2640
- if(bypass_inline_links === false){
2641
- msg = bleeper_inline_link_generator(msg);
2642
- }
2643
-
2644
- return msg;
2645
- }
2646
-
2647
- /**
2648
- * Get the visitors browser icon
2649
- *
2650
- * @param {object} data The visitor data packet
2651
- * @return {string} HTML showing the browser icon
2652
- */
2653
- function nc_return_browser_details(data) {
2654
- if (typeof data === "undefined") {
2655
- return "";
2656
- }
2657
-
2658
- if (typeof data.browserName !== "undefined") { browserName = data.browserName; } else { browserName = "Unknown"; }
2659
- if (typeof data.browserVersion !== "undefined") { browserVer = data.browserVersion; } else { browserVer = "Unknown"; }
2660
-
2661
- origbrowserName = browserName;
2662
- browserName = browserName.toLowerCase();
2663
-
2664
- return "<img src='" + wplc_baseurl + "/images/browsers/"+browserName+"_16x16.png' alt='"+origbrowserName+" (v"+browserVer+")' title='"+origbrowserName+" (v"+browserVer+")' />";
2665
- }
2666
-
2667
- /**
2668
- * Get the visitors location icon - (REQUIRE MAXIND TO BE ENABLED)
2669
- *
2670
- * @param {object} data The visitor packet data
2671
- * @return {string} HTML showing the country flag
2672
- */
2673
- function nc_return_location_details(data){
2674
- if(typeof data !== "undefined" && typeof data.location_info !== "undefined"){
2675
- if (typeof data.location_info === 'string') {
2676
- if (bleeperIsJson(data.location_info)) {
2677
- data.location_info = JSON.parse(data.location_info);
2678
- } else {
2679
- data.location_info = undefined;
2680
- }
2681
- }
2682
- if(typeof data.location_info !== 'undefined' && typeof data.location_info.code !== "undefined"){
2683
- var location_code = data.location_info.code;
2684
- var location_name = (typeof data.location_info.name !== "undefined" ? data.location_info.name : "");
2685
-
2686
- return "<img src='" + wplc_baseurl + "/images/flags/"+location_code.toLowerCase()+".png' alt='"+location_name+"' title='"+location_name+"' />";
2687
- }
2688
- }
2689
-
2690
- return "";
2691
- }
2692
-
2693
- /**
2694
- * Get the device image for this visitor
2695
- *
2696
- * @param {object} data The visitor packet data
2697
- * @return {string} HTML of the image for the relevant device
2698
- */
2699
- function nc_return_device_details(data){
2700
- if(typeof data !== "undefined" && typeof data.device_in_use !== "undefined"){
2701
- var device_in_use = data.device_in_use;
2702
- return "<img src='" + wplc_baseurl + "/images/devices/"+device_in_use+".png' alt='"+device_in_use+"' title='"+device_in_use.charAt(0).toUpperCase() + device_in_use.slice(1)+"' />";
2703
- }
2704
- return "";
2705
- }
2706
-
2707
-
2708
- /**
2709
- * Adds the visitor that just left to a unique timer and then removes that user if they havent come back in x seconds
2710
- *
2711
- * @param {object} data The visitor data packet
2712
- */
2713
- function nc_remove_visitor_after_time(data) {
2714
- // var visitor_timeout_seconds = 12000; /* one second less than the a2vping */
2715
- // clearTimeout(remove_visitor_timer[data.chatid]);
2716
-
2717
- // remove_visitor_timer[data.chatid] = setTimeout(function() {
2718
- // //jQuery.event.trigger({type: "bleeper_remove_visitor", ndata:data});
2719
-
2720
- // clearTimeout(ping_list[data.socketid]);
2721
- // },visitor_timeout_seconds);
2722
-
2723
- }
2724
-
2725
-
2726
- var bleeper_update_agent_unread = function() {
2727
-
2728
- }
2729
-
2730
- /**
2731
- * Check the latency of the connection
2732
- */
2733
- var bleeper_latency_check = function() {
2734
- bleepblop_running = true;
2735
- startTime = Date.now();
2736
- socket.emit('bleep');
2737
-
2738
- latency_dead_check = setTimeout(function() {
2739
- bleepblop_running = false;
2740
- jQuery(".bleeper_stats").html(" [<em><span style='color:red'>Latency: You are offline.</span></em>] ");
2741
- },3100);
2742
- }
2743
-
2744
-
2745
- /**
2746
- * WPLC SOCKET delegate functions
2747
- *
2748
- * @return void
2749
- */
2750
- bleeper_delegates = function() {
2751
- // Socket events
2752
- socket.on('connect', function(data) {
2753
- connected = true;
2754
- nc_add_agent(socket, data);
2755
-
2756
- if (get_visitor_timer === undefined) {
2757
- var get_visitor_timer = setInterval(function() {
2758
- bleeper_get_visitor_data();
2759
- },30000);
2760
- }
2761
-
2762
- /**
2763
- * Latency checks
2764
- */
2765
- if (bleepblop_running === false) {
2766
- bleeper_latency_check();
2767
- }
2768
-
2769
- socket.emit('get online agents', {api_key:nifty_api_key});
2770
-
2771
- jQuery.event.trigger({type: "bleeper_agent_socket_connected", ndata:data});
2772
-
2773
- /* are we running this on the CRM page? If yes, trigger the events */
2774
- if (typeof bleeper_crm_page !== "undefined" && bleeper_crm_page === true) {
2775
- jQuery.event.trigger({type: "bleeper_crm_page_loaded", ndata:data});
2776
- }
2777
- /* are we running this on the CRM page? If yes, trigger the events */
2778
- if (typeof bleeper_contact_page !== "undefined" && bleeper_contact_page === true) {
2779
- jQuery.event.trigger({type: "bleeper_contact_page_loaded", ndata:data});
2780
- }
2781
-
2782
- jQuery(".nifty_bg_holder_text").html("");
2783
- jQuery(".nifty_bg_holder").fadeOut();
2784
-
2785
- });
2786
-
2787
- socket.on('blop', function() {
2788
- clearTimeout(latency_dead_check);
2789
-
2790
- latency = Date.now() - startTime;
2791
- jQuery(".bleeper_stats").html(" [<em>Latency: "+latency+"ms</em>] ");
2792
-
2793
- setTimeout(function() {
2794
- bleeper_latency_check();
2795
- },3000);
2796
-
2797
- });
2798
-
2799
-
2800
- socket.on('blip', function(data) {
2801
- if (typeof blip_trigger !== "undefined") { blip_trigger(data,'before'); }
2802
- });
2803
- socket.on('blips', function(data) {
2804
- if (typeof blip_sort_queue !== "undefined") { blip_sort_queue(data); }
2805
- });
2806
-
2807
- socket.on('a2vping returned', function(data) {
2808
- if (typeof remove_visitor_timer[data.chatid] !== "undefined") {
2809
- clearTimeout(remove_visitor_timer[data.chatid]);
2810
-
2811
-
2812
- }
2813
- clearTimeout(ping_list[data.fromsocket]);
2814
- bleeper_add_socket_to_ping(data.fromsocket, data.chatid);
2815
- })
2816
-
2817
- socket.on('is recording', function(data) {
2818
- jQuery.event.trigger({type: "bleeper_is_recording", ndata:data});
2819
- });
2820
-
2821
- socket.on('chat history', function(data) {
2822
- /* TO DO - compare against sessionStorage */
2823
- if (typeof data !== "undefined" && typeof data.history !== "undefined") {
2824
- if (data.history.length > 0) {
2825
- for (var i = 0, len = data.history.length; i < len; i++) {
2826
- addChatMessage({username: bleeper_strip_tags(data.history[i].username), message: data.history[i].message, timestamp: data.history[i].date, msgID: data.history[i].id, aoru: data.history[i].aoru, type: data.history[i].type, read: data.history[i].read, chatid: data.chatid });
2827
-
2828
- jQuery.event.trigger({type: "bleeper_add_message_chatbox", message:data.history[i].message});
2829
-
2830
- }
2831
- nc_update_last_message(data.chatid,data.history[data.history.length-1], false);
2832
- } else {
2833
- log('No chat messages');
2834
- }
2835
- } else {
2836
- log('No chat messages');
2837
- }
2838
- jQuery("#fetchinglog").remove();
2839
-
2840
- });
2841
-
2842
- socket.on('blacklisted', function(data) {
2843
- jQuery.event.trigger({type: "bleeper_blacklisted", ndata:data});
2844
-
2845
- });
2846
-
2847
- socket.on('online agents', function(data) {
2848
- if (data !== null) {
2849
- for (l in data) {
2850
- if (data[l] !== nifty_my_socket) {
2851
- information_received_pointer = 'online_agents';
2852
- socket.emit('request information',{socketid: data[l]});
2853
- }
2854
- }
2855
- }
2856
- });
2857
-
2858
- // Whenever the server emits 'login', log the login message
2859
- socket.on('login', function (data) {
2860
- connected = true;
2861
- // Display the welcome message
2862
- var message = "Connection established";
2863
- log(message, {
2864
- prepend: true
2865
- });
2866
- });
2867
-
2868
- socket.on('request chat', function(data) {
2869
- if(typeof data !== "undefined" && typeof data.data === 'undefined'){
2870
- data.data = {};
2871
- }
2872
-
2873
- if (typeof data !== 'undefined' && typeof data.data !== 'undefined' && typeof data.data.name === "undefined") {
2874
- data.data.name = "Guest";
2875
- }
2876
- if (typeof data !== 'undefined' && typeof data.data !== 'undefined' && typeof data.data.email === "undefined") {
2877
- data.data.email = "No Email";
2878
- }
2879
-
2880
- if(typeof visitor_list[data.chatid] === 'undefined'){
2881
- visitor_list[data.chatid] = {};
2882
- }
2883
-
2884
- visitor_list[data.chatid].state = 'active';
2885
- visitor_list[data.chatid].username = bleeper_strip_tags(data.data.name);
2886
- visitor_list[data.chatid].email = bleeper_strip_tags(data.data.email);
2887
- jQuery("#vis"+data.chatid+" .userName").html(bleeper_strip_tags(data.data.name));
2888
- var orig_elm = jQuery("#vis"+data.chatid);
2889
-
2890
- if(orig_elm.length == 0){
2891
- bleeper_get_visitor_data();
2892
- }
2893
-
2894
- jQuery("#vis"+data.chatid).remove();
2895
- jQuery(orig_elm).prependTo(".visitorListBox");
2896
- jQuery("#"+data.chatid+" .userName").html(bleeper_strip_tags(data.data.name));
2897
- nc_add_accept_chat_visitor_row(data.chatid);
2898
- jQuery.event.trigger({type: "bleeper_new_chat", ndata:data});
2899
- })
2900
-
2901
- socket.on('get information', function(data) {
2902
- /* we have a request to send information to the server */
2903
-
2904
- var info_obj = {};
2905
- info_obj.username = bleeper_agent_name;
2906
- info_obj.agent_id = agent_id;
2907
- socket.emit('send information', { intended_socket:data.socketid, data: info_obj });
2908
-
2909
- })
2910
-
2911
- socket.on('transferring chat', function (data) {
2912
- if (typeof data.chatid !== "undefined") {
2913
-
2914
- var message = '<h2>'+data.from_agent+' has invited you to a chat!</h2>';
2915
-
2916
- niftyShowDialog("Incoming Chat Invite", message, 'Accept', 'Reject', function() {
2917
- /* accept */
2918
- socket.emit('accept transfer', {socketid:data.socketid,chatid:data.chatid,from_agent:bleeper_agent_name})
2919
- /* add the user to the active chats */
2920
- nc_add_user_to_list(visitor_list[data.chatid], function(data){
2921
- /* open the chat */
2922
- jQuery("#"+data.chatid).click();
2923
- setTimeout(function(){
2924
- jQuery('#nifty_join_chat_button').click();
2925
- }, 500);
2926
- });
2927
- }, function() {
2928
- /* reject */
2929
- socket.emit('reject transfer', {socketid:data.socketid,chatid:data.chatid,from_agent:bleeper_agent_name})
2930
-
2931
- });
2932
- }
2933
- })
2934
-
2935
-
2936
- socket.on('transferring chat department', function (data) {
2937
- if (typeof data.chatid !== "undefined" && typeof data.department !== "undefined") {
2938
- if(data.department === bleeper_agent_department){
2939
- //This agent is a part of the desired department
2940
- var message = '<h2>Chat invite for your department!</h2>';
2941
-
2942
- niftyShowDialog("Incoming Department Invite", message, 'Accept', 'Reject', function() {
2943
- /* accept */
2944
- socket.emit('accept department transfer', {socketid:data.socketid,chatid:data.chatid,from_agent:bleeper_agent_name})
2945
- /* add the user to the active chats */
2946
- nc_add_user_to_list(visitor_list[data.chatid], function(data){
2947
- /* open the chat */
2948
- jQuery("#"+data.chatid).click();
2949
- });
2950
- }, function() {
2951
- /* reject */
2952
- socket.emit('reject department transfer', {socketid:data.socketid,chatid:data.chatid,from_agent:bleeper_agent_name})
2953
-
2954
- });
2955
- }
2956
- }
2957
- })
2958
-
2959
- socket.on('username changed', function(data) {
2960
- jQuery.event.trigger({type: "bleeper_username_changes", ndata:data});
2961
- });
2962
-
2963
- socket.on('email changed', function(data) {
2964
- jQuery.event.trigger({type: "bleeper_email_changes", ndata:data});
2965
- });
2966
-
2967
-
2968
- socket.on('new admin message', function (data) {
2969
- nc_update_last_message(data.chatid,data,false);
2970
- jQuery("#"+data.chatid).addClass('newmessage');
2971
-
2972
- if (active_chatid === data.chatid) {
2973
- addChatMessage(data);
2974
- data.other = {};
2975
- data.other.aid = data.aid;
2976
- data.aoru = data.aid;
2977
- data.other.from_an_agent = true;
2978
- jQuery.event.trigger({type: "bleeper_add_message_chatbox", message:data});
2979
- jQuery.event.trigger({type:'bleeper_stop_typing', ndata: data, chatid: data.chatid});
2980
-
2981
- } else {
2982
- if (typeof unread_count[data.chatid] === "undefined") { unread_count[data.chatid] = 1; }
2983
- else { unread_count[data.chatid] = unread_count[data.chatid] + 1; }
2984
-
2985
- beeper_notify_new_message(data.chatid);
2986
- }
2987
-
2988
- nc_update_user_stop_typing(data.chatid);
2989
- });
2990
-
2991
- socket.on('message read received', function(data) {
2992
- jQuery.event.trigger({type: "bleeper_message_read_received", ndata:data});
2993
- });
2994
-
2995
-
2996
- // Whenever the server emits 'new message', update the chat body
2997
- socket.on('new message', function (data) {
2998
- if (typeof visitor_list[data.chatid] === "undefined") {
2999
- // the agent possibly ended the chat but the user sent another message, re-add this user obj into the visitor_list array
3000
- visitor_list[data.chatid] = data.user_obj;
3001
- }
3002
-
3003
- visitor_list[data.chatid].state = 'active';
3004
-
3005
- /* remove the visitor timeout - perhaps this visitor just moved to a different page, if that is the case we dont want the agent to think that they have left us. if they have left though, they will timeout after x seconds - we are just canceling that timeout here. */
3006
- if (typeof remove_visitor_timer[data.chatid] !== "undefined") {
3007
- clearTimeout(remove_visitor_timer[data.chatid])
3008
- }
3009
-
3010
- nc_remove_init_chat_visitor_row(data.chatid);
3011
- nc_add_open_chat_visitor_row(data.chatid);
3012
-
3013
- /**
3014
- * Clear the typing preview for this specific chat ID
3015
- */
3016
- jQuery.event.trigger({type: "bleeper_clear_typing_preview", cid: data.chatid});
3017
- jQuery.event.trigger({type: "bleeper_new_message_for_cid", cid: data.chatid});
3018
-
3019
-
3020
- nc_update_last_message(data.chatid,data,false);
3021
-
3022
-
3023
- jQuery("#"+data.chatid).addClass('newmessage');
3024
- bleeper_notify_new_message(data.chatid);
3025
-
3026
- if (typeof involved_list[data.chatid] !== "undefined") {
3027
- if (active_chatid === data.chatid) {
3028
- addChatMessage(data);
3029
- jQuery.event.trigger({type: "bleeper_add_message_chatbox", message:data});
3030
- // let the server know we have 'read' the message
3031
- socket.emit('message read',data);
3032
- } else {
3033
- if (typeof unread_count[data.chatid] === "undefined") { unread_count[data.chatid] = 1; }
3034
- else { unread_count[data.chatid] = unread_count[data.chatid] + 1; }
3035
- nc_update_unread_count(data.chatid);
3036
- bleeper_change_favico(bleeper_favico_noti);
3037
- }
3038
- }
3039
-
3040
- jQuery.event.trigger({type: "bleeper_new_message_extender", message:data});
3041
- });
3042
-
3043
-
3044
-
3045
- socket.on('edit message', function (data) {
3046
- visitor_list[data.chatid].state = 'active';
3047
-
3048
- /* hide the initiate chat button */
3049
- jQuery("#vis"+data.chatid+" .init_chat").hide();
3050
-
3051
-
3052
- /**
3053
- * Clear the typing preview for this specific chat ID
3054
- */
3055
- jQuery.event.trigger({type: "bleeper_clear_typing_preview", cid: data.chatid});
3056
-
3057
-
3058
- if (active_chatid === data.chatid) {
3059
- jQuery(".message_"+data.msgID+" .messageBody").html(wplcFormatParser(data.message) + " <em><small>(edited)</small></em>");
3060
- } else {
3061
- if (typeof unread_count[data.chatid] === "undefined") { unread_count[data.chatid] = 1; }
3062
- else { unread_count[data.chatid] = unread_count[data.chatid] + 1; }
3063
- nc_update_unread_count(data.chatid);
3064
- }
3065
- nc_update_last_message(data.chatid,data,true);
3066
- jQuery("#"+data.chatid).addClass('newmessage');
3067
- });
3068
-
3069
-
3070
- socket.on('chat ended', function(data) {
3071
- var tmp_chatid_close = data.chatid;
3072
-
3073
- involved_list[tmp_chatid_close] = false;
3074
- jQuery.event.trigger({type: "bleeper_chat_ended_by_other_agent", ndata:data});
3075
-
3076
- if (active_chatid === data.chatid) {
3077
- /* current agent was also chatting and had the window active */
3078
- /* disable the input field and simulate a user disconnect */
3079
- active_chatid = undefined;
3080
- }
3081
-
3082
- jQuery("#"+tmp_chatid_close).removeClass('active');
3083
- jQuery("#"+tmp_chatid_close).addClass('inactive');
3084
- jQuery(".bleeper_close_item_"+tmp_chatid_close).show();
3085
-
3086
- nifty_chat_remove_agent_involved(tmp_chatid_close, agent_id);
3087
- bleeper_remove_events(tmp_chatid_close);
3088
-
3089
- if(typeof visitor_list[tmp_chatid_close] === 'undefined'){
3090
- visitor_list[tmp_chatid_close] = {};
3091
- }
3092
-
3093
- visitor_list[tmp_chatid_close].state = 'browsing';
3094
- visitor_list[tmp_chatid_close].involved = undefined;
3095
- jQuery.event.trigger({type: "bleeper_add_initiate_button_no_col", cid:tmp_chatid_close});
3096
-
3097
-
3098
- });
3099
-
3100
-
3101
- // Whenever the server emits 'new message', update the chat body
3102
- socket.on('socketid', function (socketid) {
3103
- nifty_my_socket = socketid.socketid;
3104
- document.cookie = "nc_sid="+socketid.socketid;
3105
- jQuery.event.trigger({type: "bleeper_socketid_received", ndata:{socketid:socketid.socketid,instanceid:socketid.instanceid}});
3106
- });
3107
-
3108
- socket.on('limited', function (socketinfo) {
3109
- if (typeof socketinfo !== "undefined" && typeof socketinfo.limited !== "undefined") {
3110
- bleeper_limited = socketinfo.limited;
3111
- jQuery.event.trigger({ type: "bleeper_limited", ndata:{limited:socketinfo.limited} });
3112
- }
3113
- });
3114
-
3115
- socket.on('invalid_agent', function (socketinfo) {
3116
- jQuery.event.trigger({ type: "bleeper_invalid_agent", socketdata: socketinfo });
3117
- });
3118
-
3119
- socket.on('visitor list', function(data) {
3120
- if (typeof data === "undefined" || data === null || (typeof data === "object" && data.total_visitors === 0 )) {
3121
- nc_no_visitors();
3122
- return;
3123
- }
3124
-
3125
- if (data !== null) {
3126
- if (typeof data !== "undefined" && typeof data.visitor_list !== "undefined") {
3127
- // run through the visitor list and identify if we are actually ONLINE for this domain
3128
- data.visitor_list = bleeper_update_visitor_data_list_per_online(data.visitor_list);
3129
-
3130
- if (typeof data.total_visitors !== "undefined") {
3131
- nc_update_visitor_count(data.total_visitors);
3132
- }
3133
-
3134
- for (k in data.visitor_list) {
3135
- visitor_list[data.visitor_list[k].chatid] = data.visitor_list[k];
3136
-
3137
- if (typeof data.visitor_list[k].chatid !== 'undefined') {
3138
- if (typeof visitor_validator[data.visitor_list[k].chatid] !== 'undefined') {
3139
- clearInterval(visitor_validator[data.visitor_list[k].chatid]);
3140
- }
3141
- var tmp_cid = data.visitor_list[k].chatid;
3142
- visitor_validator[data.visitor_list[k].chatid] = setInterval(function() {
3143
- socket.emit('validate visitor', {chatid: tmp_cid});
3144
- }, 35000);
3145
- }
3146
-
3147
- nc_add_visitor_to_list(data.visitor_list[k]);
3148
- if (data.visitor_list[k].state === "active") {
3149
-
3150
- jQuery("#vis"+data.visitor_list[k].chatid+ " .agents_involved_visitor").html('');
3151
- if (typeof data.visitor_list[k].involved !== "undefined" && data.visitor_list[k].state !== "browsing") {
3152
- if (data.visitor_list[k].involved.length > 0) {
3153
- /* set involved to FALSE as default */
3154
- involved_list[data.visitor_list[k].chatid] = false;
3155
-
3156
- for (l in data.visitor_list[k].involved) {
3157
-
3158
- nifty_chat_add_agent_involved_visitor_list(data.visitor_list[k].chatid, data.visitor_list[k].involved[l]);
3159
-
3160
- if (parseInt(data.visitor_list[k].involved[l]) === parseInt(agent_id)) {
3161
- /* this is the current agent, add it to their local variable */
3162
- nc_add_user_to_list(data.visitor_list[k], function(ret_data) {
3163
- for (q in data.visitor_list[k].involved) {
3164
- nifty_chat_add_agent_involved(data.visitor_list[k].chatid, data.visitor_list[k].involved[q]);
3165
- }
3166
- });
3167
- involved_list[data.visitor_list[k].chatid] = true;
3168
- } else {
3169
-
3170
- }
3171
-
3172
- }
3173
- nc_clear_action_col_visitor_row(data.visitor_list[k].chatid);
3174
- nc_add_open_chat_visitor_row(data.visitor_list[k].chatid);
3175
-
3176
- } else {
3177
- nc_add_accept_chat_visitor_row(data.visitor_list[k].chatid);
3178
- }
3179
- }
3180
-
3181
-
3182
- } else {
3183
- /* visitor is browsing */
3184
- jQuery("#vis"+data.visitor_list[k].chatid+" .init_chat").show();
3185
-
3186
- }
3187
- }
3188
- } else {
3189
- nc_no_visitors();
3190
- }
3191
- }
3192
-
3193
- jQuery.event.trigger({type: "bleeper_after_update_visitor_list"});
3194
-
3195
- });
3196
-
3197
- socket.on('new visitor', function(data) {
3198
- var istrack_elm = document.getElementById('bleeper-no-tracking');
3199
- if (typeof(istrack_elm) != 'undefined' && istrack_elm != null) {
3200
- istrack_elm.parentNode.removeChild(istrack_elm);
3201
- }
3202
-
3203
- if (typeof visitor_validator[data.chatid] !== 'undefined') {
3204
- clearInterval(visitor_validator[data.chatid]);
3205
- }
3206
- visitor_validator[data.chatid] = setInterval(function() {
3207
- socket.emit('validate visitor', {chatid: data.chatid});
3208
- }, 35000);
3209
-
3210
- if (bleeper_check_visitor_as_per_online(data)) {
3211
- // this visitor matches a domain from a domain that we have set to ONLINE
3212
- visitor_list[data.chatid] = data;
3213
- var current_visitor_socketid = jQuery("#"+data.chatid).attr('socket');
3214
-
3215
- nc_update_visitor_count(data.total_visitors);
3216
- nc_add_visitor_to_list(data);
3217
-
3218
- /* was this chat open and active with an agent? if yes, update the agent as to what page the user is now browsing */
3219
- if (typeof data.state !== "undefined" && data.state === "active") {
3220
- jQuery("#"+data.chatid).removeClass('inactive');
3221
- jQuery("#"+data.chatid).addClass('active');
3222
-
3223
- bleeper_save_event(data.chatid, 'fa-window-maximize', bleeper_strip_tags(data.username)+" is now browsing "+bleeper_strip_tags(data.referer), data);
3224
- if (data.chatid === active_chatid) {
3225
- jQuery(".chatInfoArea-Info1").html("from: <a href='"+bleeper_strip_tags(visitor_list[active_chatid].referer)+"' target='_BLANK'>"+bleeper_string_limiter(bleeper_strip_tags(visitor_list[active_chatid].referer),45)+"</a>");
3226
-
3227
- }
3228
-
3229
- jQuery("#vis"+data.chatid+" .init_chat").hide();
3230
- }
3231
-
3232
- /* remove the visitor timeout - perhaps this visitor just moved to a different page, if that is the case we dont want the agent to think that they have left us. if they have left though, they will timeout after x seconds - we are just canceling that timeout here. */
3233
- if (typeof remove_visitor_timer[data.chatid] !== "undefined") {
3234
- clearTimeout(remove_visitor_timer[data.chatid])
3235
- }
3236
-
3237
- jQuery.event.trigger({type: "bleeper_after_update_visitor_list"});
3238
-
3239
- }
3240
-
3241
- });
3242
-
3243
- socket.on('new chat', function(data) {
3244
-
3245
- if(typeof data !== 'undefined' && typeof data.data === "undefined"){
3246
- data.data = {};
3247
- }
3248
-
3249
- if(typeof data !== 'undefined' && typeof data.data !== 'undefined' && typeof data.data.name === "undefined") {
3250
- data.data.name = "Guest";
3251
- }
3252
-
3253
- if(typeof data !== 'undefined' && typeof data.data !== 'undefined' && typeof data.data.email === "undefined") {
3254
- data.data.email = "No Email";
3255
- }
3256
-
3257
- visitor_list[data.chatid].state = 'active';
3258
- visitor_list[data.chatid].username = bleeper_strip_tags(data.data.name);
3259
- visitor_list[data.chatid].email = bleeper_strip_tags(data.data.email);
3260
- jQuery("#vis"+data.chatid+" .userName").html(bleeper_strip_tags(data.data.name));
3261
- jQuery("#"+data.chatid+" .userName").html(bleeper_strip_tags(data.data.name));
3262
- nc_add_accept_chat_visitor_row(data.chatid);
3263
- jQuery.event.trigger({type: "bleeper_new_chat", ndata:data});
3264
-
3265
- });
3266
-
3267
- socket.on('visitor left', function(data) {
3268
- if (typeof visitor_validator[data.chatid] !== 'undefined') {
3269
- clearInterval(visitor_validator[data.chatid]);
3270
- delete visitor_validator[data.chatid];
3271
- }
3272
- jQuery.event.trigger({type: "bleeper_remove_visitor", ndata:data});
3273
- nc_update_visitor_count(false);
3274
- });
3275
-
3276
- socket.on('agent joined', function (data) {
3277
- jQuery.event.trigger({type: "bleeper_agent_joined", ndata:data});
3278
- data.apikey = nifty_api_key;
3279
- });
3280
-
3281
- socket.on('custom data received', function (data) {
3282
- jQuery.event.trigger({type: "bleeper_custom_data_received", ndata:data});
3283
- });
3284
-
3285
- /**
3286
- * This tells us when the user has received the intiate chat request
3287
- *
3288
- * We can now send custom data (like the agent header data) to the user
3289
- *
3290
- * @return void
3291
- */
3292
- socket.on('initiate received admin', function (data) {
3293
- if(current_init_attempt_id === data.chatid){
3294
- jQuery.event.trigger({type: "bleeper_add_agent", ndata:{chatid:data.chatid, agent:agent_id}});
3295
- jQuery.event.trigger({type: "bleeper_notify_agent_initiate_received", ndata:{chatid:data.chatid, agent:agent_id}});
3296
- current_init_attempt_id = false;
3297
- }
3298
- });
3299
-
3300
-
3301
- socket.on('agent connected', function(data) {
3302
- var t_c_aid = data.aid;
3303
- var t_c_sid = data.socketid;
3304
- jQuery(".online_agent_"+t_c_aid).attr('socket',t_c_sid);
3305
- jQuery(".online_agent_"+t_c_aid+ ' .online_offline').removeClass('offline');
3306
- jQuery(".online_agent_"+t_c_aid+ ' .online_offline').addClass('online');
3307
-
3308
- jQuery.event.trigger({type: "bleeper_agent_connected", ndata: data});
3309
- });
3310
-
3311
-
3312
- socket.on('agent disconnected', function(data) {
3313
- var t_c_aid = data.aid;
3314
- jQuery(".online_agent_"+t_c_aid).attr('socket',null);
3315
- jQuery(".online_agent_"+t_c_aid+ ' .online_offline').removeClass('online');
3316
- jQuery(".online_agent_"+t_c_aid+ ' .online_offline').addClass('offline');
3317
-
3318
- jQuery.event.trigger({type: "bleeper_agent_disconnected", ndata: data});
3319
- });
3320
-
3321
- socket.on('agent involved', function (data) {
3322
- nifty_chat_add_agent_involved(data.chatid, data.agentid);
3323
- nifty_chat_add_agent_involved_visitor_list(data.chatid, data.agentid);
3324
- nc_clear_action_col_visitor_row(data.chatid);
3325
- nc_add_open_chat_visitor_row(data.chatid);
3326
- });
3327
-
3328
- socket.on('information received', function(data) {
3329
- if (!information_received_pointer) {
3330
- /* default */
3331
- } else if (information_received_pointer === "transfer") {
3332
- t_ag_sock = data.from_socket;
3333
- t_ag_name = data.username;
3334
- t_ag_id = data.agent_id;
3335
-
3336
- var check_all_agents = all_agents;
3337
- if(typeof all_agents !== "object"){
3338
- check_all_agents = JSON.parse(all_agents);
3339
- }
3340
-
3341
- agent_involved = check_all_agents[t_ag_id];
3342
- agent_involved_email = agent_involved.email;
3343
- agent_involved_name = agent_involved.display_name;
3344
-
3345
- var thing = '<img class="img-thumbnail img-circle thumb32" style="max-width:inherit;" id="agent_grav_'+t_ag_id+'" title="'+agent_involved_name+'" src="https://www.gravatar.com/avatar/'+agent_involved_email+'?s=32&d=mm" />'
3346
-
3347
-
3348
-
3349
- jQuery(".ag_t_span_"+t_ag_sock).html(thing + ' ' +data.username);
3350
- jQuery("#ag_t_"+t_ag_sock).attr('value',t_ag_sock);
3351
-
3352
- } else if (information_received_pointer === "online_agents") {
3353
- jQuery.event.trigger({type: "bleeper_online_agent_packet_received", ndata:data});
3354
-
3355
- }
3356
- });
3357
-
3358
- socket.on('agent left', function (data) {
3359
- jQuery.event.trigger({type: "bleeper_agent_left", ndata:data});
3360
- removeChatTyping(data);
3361
- nifty_chat_remove_agent_involved(data.chatid, data.agent);
3362
- });
3363
-
3364
- // Whenever the server emits 'typing', show the typing message
3365
- socket.on('typing', function (data) {
3366
- if (active_chatid === data.chatid) {
3367
- jQuery.event.trigger({type:'bleeper_typing', ndata: data, chatid: data.chatid});
3368
- }
3369
- //bleeper_save_event(data.chatid, 'fa-keyboard-o', data.username+" was typing", data);
3370
- nc_update_user_typing(data.chatid);
3371
- });
3372
-
3373
- // Whenever the server emits 'stop typing', kill the typing message
3374
- socket.on('stop typing', function (data) {
3375
- if (active_chatid === data.chatid) {
3376
- jQuery.event.trigger({type:'bleeper_stop_typing', ndata: data, chatid: data.chatid});
3377
- }
3378
- nc_update_user_stop_typing(data.chatid);
3379
- });
3380
-
3381
- socket.on('typing_preview_received', function(data) {
3382
- if(typeof data !== "undefined" && typeof data.preview !== "undefined" && typeof data.preview.tempmessage !== "undefined"){
3383
- data.preview.tempmessage = cleanInput(data.preview.tempmessage);
3384
- }
3385
- jQuery.event.trigger({type: 'bleeper_typing_preview_received', ndata:data});
3386
- });
3387
-
3388
- // Receive CHAT ID from server
3389
- socket.on('chatID', function (data) {
3390
- document.cookie = "nc_chatid="+data.chatid;
3391
- });
3392
-
3393
- socket.on('disconnect', function () {
3394
- clearTimeout(get_visitor_timer);
3395
- get_visitor_timer = undefined;
3396
- jQuery.event.trigger({type: 'bleeper_disconnected'})
3397
- });
3398
-
3399
- socket.on('reconnect', function () {
3400
- log('you have been reconnected');
3401
- nc_add_agent(socket, null);
3402
- bleeper_get_visitor_data();
3403
- });
3404
-
3405
- socket.on('reconnect_error', function () {
3406
- log('attempt to reconnect has failed');
3407
- jQuery(".nifty_bg_holder_text").html("Connection to the server lost.. please be patient while we try restore the connection...");
3408
- jQuery(".nifty_bg_holder").fadeIn();
3409
- });
3410
-
3411
- socket.on('user chat notification', function(data){
3412
- //Notice has been sent to the user
3413
- jQuery.event.trigger({type: "bleeper_user_chat_notification", ndata:data});
3414
- });
3415
-
3416
- socket.on("your browser", function(data) {
3417
- });
3418
-
3419
- jQuery.event.trigger({type: "bleeper_socket_extender"});
3420
-
3421
- }
3422
-
3423
- /**
3424
- * Check if the visitor is online
3425
- *
3426
- * @param {object} visitor_data The visitor data packet
3427
- * @return {bool} True if should show
3428
- */
3429
- function bleeper_check_visitor_as_per_online(visitor_data) {
3430
-
3431
- if (typeof onlineSwitch !== 'undefined') {
3432
- if (typeof onlineSwitch.domainNameURIList !== 'undefined') {
3433
-
3434
- if (typeof onlineSwitch.onlineDomains !== 'undefined') {
3435
-
3436
- for (k in onlineSwitch.onlineDomains) {
3437
- // let's run through the first online domain and compare against all visitors
3438
- var current_domain_to_check = onlineSwitch.domainNameURIList[onlineSwitch.onlineDomains[k]];
3439
-
3440
- if (visitor_data.referer.includes(current_domain_to_check)) {
3441
- return true;
3442
-
3443
- } else {
3444
-
3445
-
3446
- }
3447
-
3448
-
3449
- }
3450
-
3451
- } else {
3452
- return false;
3453
- }
3454
-
3455
- } else {
3456
- return false;
3457
- }
3458
- } else {
3459
- return false;
3460
- }
3461
-
3462
-
3463
-
3464
- return false;
3465
-
3466
- }
3467
-
3468
- /**
3469
- * Update the visitor list
3470
- *
3471
- * @param {object} total_visitors The Visitor list packet
3472
- * @return {object} New formatted visitor list
3473
- */
3474
- function bleeper_update_visitor_data_list_per_online(total_visitors) {
3475
-
3476
- if (typeof onlineSwitch !== 'undefined') {
3477
- if (typeof onlineSwitch.domainNameURIList !== 'undefined') {
3478
-
3479
- if (typeof onlineSwitch.onlineDomains !== 'undefined') {
3480
- if (Object.keys(onlineSwitch.onlineDomains).length === 0) { return {}; }
3481
- var new_visitor_list = {};
3482
-
3483
- var cnt = 0;
3484
- var maxcnt = Object.keys(onlineSwitch.onlineDomains).length;
3485
-
3486
-
3487
- for (k in onlineSwitch.onlineDomains) {
3488
- // let's run through the first online domain and compare against all visitors
3489
- var current_domain_to_check = onlineSwitch.domainNameURIList[onlineSwitch.onlineDomains[k]];
3490
- for (l in total_visitors) {
3491
-
3492
- if (total_visitors[l].referer.includes(current_domain_to_check)) {
3493
-
3494
- new_visitor_list[total_visitors[l].chatid] = total_visitors[l];
3495
- }
3496
-
3497
- }
3498
- cnt++;
3499
-
3500
- // are we done here?
3501
- if (cnt >= maxcnt) {
3502
- // compare new visitors to old visitors so we can remove visitors that shouldnt be there.
3503
- for (m in total_visitors) {
3504
- if (typeof new_visitor_list[total_visitors[m].chatid] !== 'undefined') {
3505
- // this visitor must stay..
3506
- } else {
3507
- jQuery.event.trigger({type: "bleeper_remove_visitor", ndata:total_visitors[m]});
3508
- nc_update_visitor_count(false);
3509
- delete total_visitors[m];
3510
- }
3511
- }
3512
- return new_visitor_list;
3513
- }
3514
- }
3515
-
3516
-
3517
- } else {
3518
- //not online for anything
3519
- return {};
3520
-
3521
- }
3522
-
3523
- } else {
3524
-
3525
- return total_visitors;
3526
- }
3527
- } else {
3528
-
3529
- return total_visitors;
3530
- }
3531
- return total_visitors;
3532
- }
3533
-
3534
- /**
3535
- * Get specific URL params
3536
- *
3537
- * @param {string} url The URL to be parsed
3538
- * @param {string} name The name of the param you are looking for
3539
- * @return {string} The value of the param (or null)
3540
- */
3541
- function bleeper_getURLParameter(url, name) {
3542
- if(typeof url !== "undefined"){
3543
-
3544
- var check = url.match(name+'=([^&]*)')
3545
-
3546
- if (typeof check !== "undefined" && check !== null && typeof check[1] !== "undefined") { return check[1]; } else { return null; }
3547
- } else {
3548
- return null;
3549
- }
3550
-
3551
- }
3552
-
3553
- /**
3554
- * Parse GA UTM Campaign information
3555
- *
3556
- * @param {string} url The URL to be parsed
3557
- * @return {string} HTML with the campaign data in order
3558
- */
3559
- function bleeper_return_campaign_data(url) {
3560
- bleeper_utmsource = bleeper_getURLParameter(url,'utm_source') !== null ? "<label class='label-warning session-state-label'>"+bleeper_getURLParameter(url,'utm_source')+"</label>" : "";
3561
- bleeper_utmcampaign = bleeper_getURLParameter(url,'utm_campaign') !== null ? "<label class='label-success session-state-label'>"+bleeper_getURLParameter(url,'utm_campaign')+"</label>" : "";
3562
- bleeper_utmmedium = bleeper_getURLParameter(url,'utm_medium') !== null ? "<label class='label-info session-state-label'>"+bleeper_getURLParameter(url,'utm_medium')+"</label>" : "";
3563
-
3564
- return bleeper_utmsource+" "+bleeper_utmcampaign+" "+bleeper_utmmedium;
3565
- }
3566
-
3567
- /**
3568
- * Return liftime, total lifetime, and referrer
3569
- *
3570
- * @param {object} data The visitor data packet
3571
- * @return {string} HTML showing lifetime and referrer
3572
- */
3573
- function bleeper_return_visitor_lifetime_data(data) {
3574
- var wplc_d = new Date();
3575
- wplc_d.toUTCString();
3576
- var cdatetime = Math.floor(wplc_d.getTime()/ 1000);
3577
-
3578
- if (typeof data.date_first !== "undefined" && data.date_first !== "0") {
3579
- bleeper_date_first = cdatetime - parseInt(data.date_first);
3580
- bleeper_date_first = wplc_timeSince(bleeper_date_first) + "";
3581
- } else {
3582
- bleeper_date_first = '';
3583
- }
3584
- if (typeof data.date_current !== "undefined" && data.date_current !== "0") {
3585
- bleeper_date_current = cdatetime - parseInt(data.date_current);
3586
- bleeper_date_current = wplc_timeSince(bleeper_date_current) + "";
3587
- } else {
3588
- bleeper_date_current = '';
3589
- }
3590
- /* Removed the following in 06/2019 */
3591
- /*Lifetime: <label class='label-default time-state-label' title='Total lifetime' alt='Total lifetime'>"+bleeper_date_first+"</label> <br>*/
3592
- return "Page: <label class='label-default time-state-label' title='Current page' alt='Current page'>"+bleeper_date_current+"</label>";
3593
-
3594
- }
3595
-
3596
- /**
3597
- * Return the users timezone
3598
- *
3599
- * @param {object} data The visitor data packet
3600
- * @return {string} HTML containing the timezone
3601
- */
3602
- function bleeper_return_visitor_timezone_data(data){
3603
- var timezomeDiff = "";
3604
- if (typeof data.timezoneUTC !== "undefined"){
3605
- if(data.timezoneUTC !== "0") {
3606
- timezomeDiff = " " + data.timezoneUTC;
3607
- }
3608
- }
3609
-
3610
- return "Timezone: <label class='label-default time-state-label' title='UTC" + timezomeDiff + "' alt='UTC" + timezomeDiff + "'>UTC" + timezomeDiff + "</label><br>";
3611
- }
3612
-
3613
- /**
3614
- * Find and return the users OS icon
3615
- *
3616
- * @param {object} data The visitor data packet
3617
- * @return {string} A font awesome icon
3618
- */
3619
- function bleeper_return_visitor_os_data(data){
3620
- var user_os = "Unknown";
3621
- if (typeof data.operating_system !== "undefined"){
3622
- user_os = data.operating_system;
3623
- }
3624
-
3625
- if(user_os !== "Unknown"){
3626
- var font_awesome_icon = "";
3627
- if(user_os.indexOf("Windows") !== -1){
3628
- font_awesome_icon = "fa-windows";
3629
- } else if (user_os.indexOf("Mac") !== -1){
3630
- font_awesome_icon = "fa-apple";
3631
- } else if (user_os.indexOf("Android") !== -1){
3632
- font_awesome_icon = "fa-android";
3633
- } else if (user_os.indexOf("iOS") !== -1){
3634
- font_awesome_icon = "fa-apple";
3635
- } else if (user_os.indexOf("Linux") !== -1){
3636
- font_awesome_icon = "fa-linux";
3637
- } else if (user_os.indexOf("Search Bot") !== -1){
3638
- font_awesome_icon = "fa-bug";
3639
- } else {
3640
- //Some other os
3641
- font_awesome_icon = "fa-server";
3642
- }
3643
- return " <i class='fa " + font_awesome_icon + "' title='OS: " + user_os + "'></i>";
3644
- }
3645
- return "";
3646
-
3647
- }
3648
-
3649
- /**
3650
- * Change the favicon image if this is the chat dashboard
3651
- *
3652
- * @param {string} src Source (url) of the new favicon
3653
- */
3654
- function bleeper_change_favico(src) {
3655
- //Check if this is an allowed 'page' location - Are we allowed to change favicons?
3656
- if( (window.location.href.indexOf("page=wplivechat-menu") !== -1) ){
3657
- var link = document.createElement('link'),
3658
- oldLink = document.getElementById('dynamic-favicon');
3659
- link.id = 'dynamic-favicon';
3660
- link.rel = 'shortcut icon';
3661
- link.href = src;
3662
- if (oldLink) {
3663
- document.head.removeChild(oldLink);
3664
- }
3665
- document.head.appendChild(link);
3666
- }
3667
- }
3668
-
3669
- /**
3670
- * Checks if string is JSON
3671
- *
3672
- * @param {string} str String to be checked
3673
- * @return {bool} True if JSON object
3674
- */
3675
- function bleeperIsJson(str) {
3676
- try {
3677
- JSON.parse(str);
3678
- } catch (e) {
3679
- return false;
3680
- }
3681
- return true;
3682
- }
3683
-
3684
- /**
3685
- * Create a substring
3686
- *
3687
- * @param {string} str The string to be sliced
3688
- * @param {int} limit The maximum amount of chars
3689
- * @return {string} The substring
3690
- */
3691
- function bleeper_string_limiter(str, limit){
3692
- var char_count = str.length;
3693
- if(char_count > limit){
3694
- var first_half_cutoff = parseInt(limit / 2) - 2;
3695
- var second_half_cutoff = parseInt(limit / 2) + 1;
3696
-
3697
- var first_half = str.substring(0, first_half_cutoff);
3698
- var second_half = str.substring(char_count - second_half_cutoff);
3699
- str = first_half + "..." + second_half;
3700
- }
3701
- return str;
3702
- }
3703
-
3704
- /**
3705
- * Time passed function
3706
- *
3707
- * @param {int} seconds Time in seconds
3708
- * @return {string} Pretty print of the time in seconds
3709
- */
3710
- function wplc_timeSince(seconds) {
3711
- var interval = Math.floor(seconds / 31536000);
3712
- if (interval > 1) {
3713
- return interval + " yrs";
3714
- }
3715
- interval = Math.floor(seconds / 2592000);
3716
- if (interval > 1) {
3717
- return interval + " mo";
3718
- }
3719
- interval = Math.floor(seconds / 86400);
3720
- if (interval > 1) {
3721
- return interval + " d";
3722
- }
3723
- interval = Math.floor(seconds / 3600);
3724
- if (interval > 1) {
3725
- return interval + " h";
3726
- }
3727
- interval = Math.floor(seconds / 60);
3728
- if (interval > 1) {
3729
- return interval + " m";
3730
- }
3731
- return Math.floor(seconds) + " seconds";
3732
- }
3733
-
3734
- /**
3735
- * Lifespan function
3736
- *
3737
- * @param {int} from From time in seconds
3738
- * @param {int} to To time in secods
3739
- * @return {string} Pretty print of the time ago
3740
- */
3741
- function bleeper_timeAgo(from, to) {
3742
- var seconds = Math.floor((from - to) / 1000);
3743
- var interval = Math.floor(seconds / 31536000);
3744
- if (interval >= 1) {
3745
- if (interval === 1) {
3746
- return interval + " year";
3747
- } else {
3748
- return interval + " years";
3749
- }
3750
- }
3751
- interval = Math.floor(seconds / 2592000);
3752
- if (interval >= 1) {
3753
- if (interval === 1) {
3754
- return interval + " month";
3755
- } else {
3756
- return interval + " months";
3757
- }
3758
- }
3759
- interval = Math.floor(seconds / 86400);
3760
- if (interval >= 1) {
3761
-
3762
- if (interval === 1) {
3763
- return interval + " day";
3764
- } else {
3765
- return interval + " days";
3766
- }
3767
- }
3768
- interval = Math.floor(seconds / 3600);
3769
- if (interval >= 1) {
3770
- if (interval === 1) {
3771
- return interval + " hour";
3772
- } else {
3773
- return interval + " hours";
3774
- }
3775
- }
3776
- interval = Math.floor(seconds / 60);
3777
- if (interval >= 1) {
3778
- if (interval === 1) {
3779
- return interval + " minute";
3780
- } else {
3781
- return interval + " minutes";
3782
- }
3783
- }
3784
-
3785
- if (seconds < 60) {
3786
- return "moments";
3787
- }
3788
-
3789
- return Math.floor(seconds) + " seconds";
3790
-
3791
- }
3792
-
3793
- /**
3794
- * Message stack and queue functionality
3795
- *
3796
- * @param {string} chat_id The Chat ID
3797
- */
3798
- function bleeper_sort_and_send_messages(chat_id) {
3799
- if (bleeper_test_sessionStorage()) {
3800
- jQuery("#messages").html('');
3801
-
3802
- if (sessionStorage.getItem(chat_id+"_m") !== null) {
3803
- var msg_obj = JSON.parse(sessionStorage.getItem(chat_id+"_m"));
3804
-
3805
- var new_msg_list = {};
3806
- Object.keys(msg_obj).sort().forEach(function(key) {
3807
- new_msg_list[key] = msg_obj[key];
3808
- });
3809
-
3810
- for (var key in new_msg_list) {
3811
- var the_message = new_msg_list[key];
3812
-
3813
- the_message.mid = key;
3814
-
3815
- if(typeof the_message.afrom !== "undefined"){
3816
- if(parseInt(the_message.afrom) !== parseInt(agent_id)){
3817
- //From a different agent
3818
- if(typeof the_message.other === "undefined"){ the_message.other = {}; }
3819
- the_message.other.from_an_agent = true;
3820
- }
3821
- }
3822
-
3823
- wplc_push_message_to_chatbox(the_message, agent_id, function() {
3824
- jQuery.event.trigger({type: "bleeper_scroll_bottom"});
3825
- });
3826
- }
3827
-
3828
-
3829
- }
3830
- }
3831
- }
3832
-
3833
- /**
3834
- * Determines whether the currently selected user filter affects the current visitor items visibility.
3835
- * If conditions for the filters are met, we will return true to hide the div
3836
- *
3837
- * @param {object} data The visitor data
3838
- * @return {bool} True if the visitor should be hidden
3839
- */
3840
- function bleeper_hide_visitor_by_filter(data){
3841
- if(typeof bleeper_active_filter !== "undefined" && bleeper_active_filter !== false){
3842
- if(bleeper_active_filter === bleeper_visitor_filters.new_visitors){
3843
- //New visitors only, 3 minutes or less
3844
- var wplc_d = new Date();
3845
- wplc_d.toUTCString();
3846
- var cdatetime = Math.floor(wplc_d.getTime()/ 1000);
3847
-
3848
- if (typeof data.date_current !== "undefined" && data.date_current !== "0") {
3849
- bleeper_date_current = cdatetime - parseInt(data.date_current);
3850
- var interval = Math.floor(bleeper_date_current / 60);
3851
-
3852
- if (interval > 3) {
3853
- return true; //Less than 3 minutes passed - Show chat
3854
- }
3855
- }
3856
- }
3857
-
3858
- if(bleeper_active_filter === bleeper_visitor_filters.active_chats){
3859
- if(typeof data.state !== "undefined" && data.state !== "active"){
3860
- return true; // Hides it
3861
- }
3862
- }
3863
-
3864
- if (bleeper_active_filter === bleeper_visitor_filters.referer){
3865
- var filter_referer = jQuery('#nifty_referer_url').val().split(/[?#]/)[0].replace(/\/$/, '').toLowerCase();
3866
- if(typeof data.referer !== 'undefined' && data.referer.length > 0 && filter_referer.length > 0){
3867
- var referer = data.referer.split(/[?#]/)[0].replace(/\/$/, '').toLowerCase();
3868
- if(jQuery('#nifty_referer_contains').prop('checked')){
3869
- if (-1 === referer.indexOf(filter_referer)){
3870
- return true; // Hides it
3871
- }
3872
- } else {
3873
- if (referer !== filter_referer){
3874
- return true; // Hides it
3875
- }
3876
- }
3877
- }
3878
- }
3879
-
3880
- }
3881
- return false;
3882
- }
3883
-
3884
- /**
3885
- * Loops through the visitor data object and adds each item to the container div. This essentially forces a refresh
3886
- * This is nice for use in filters
3887
- */
3888
- function bleeper_refresh_visitor_list(){
3889
- if(typeof bleeper_active_filter !== "undefined" && bleeper_active_filter !== false){
3890
- jQuery(".filter-menu .dropdown-toggle").addClass('filter-active'); //It is active
3891
- } else {
3892
- jQuery(".filter-menu .dropdown-toggle").removeClass('filter-active');
3893
- jQuery(".filter-active-tag-container").fadeOut("slow");
3894
- }
3895
-
3896
- visitor_list = bleeper_update_visitor_data_list_per_online(visitor_list);
3897
-
3898
- for(var i in visitor_list){
3899
- nc_add_visitor_to_list(visitor_list[i]);
3900
- }
3901
-
3902
- jQuery.event.trigger({type: "bleeper_after_update_visitor_list"});
3903
- }
3904
-
3905
- /**
3906
- * Generates and returns a dropdown menu (html), based on an input array utm_sourc
3907
- *
3908
- * @param {string} id_name ID Name
3909
- * @param {array} data_array The data arrat to loop through
3910
- * @return {string} Dropdown HTML
3911
- */
3912
- function bleeper_generate_dropdown(id_name, data_array){
3913
- var dropdown_html = "<select name='" + id_name + "' id='" + id_name + "' >";
3914
- for(var i in data_array){
3915
- dropdown_html += "<option value='" + i + "'>" + bleeper_string_limiter(data_array[i], 45) + "</option>";
3916
- }
3917
- dropdown_html += "</select>";
3918
- return dropdown_html;
3919
- }
3920
-
3921
- /**
3922
- * Use Regular Exp seen above to parse any inline links automatically
3923
- * Variable defined outside of function scope to reserve resources as seen here: https://stackoverflow.com/questions/1500260/detect-urls-in-text-with-javascript
3924
- *
3925
- * @param {string} content Content to filter
3926
- * @return {string} Fitlered content
3927
- */
3928
- function bleeper_inline_link_generator(content){
3929
- return content.replace(bleeper_link_match_regex, function(url) {
3930
- if(url.indexOf("wdt-emoji") === -1){
3931
- url = bleeper_url_path_em_stripper(url);
3932
- return '<a href="' + url + '" target="_BLANK">' + bleeper_attachment_label_filter(url) + '</a>';
3933
- } else {
3934
- url = bleeper_url_path_em_stripper(url);
3935
- return url;
3936
- }
3937
- });
3938
- }
3939
-
3940
- /**
3941
- * Removes any instances of "<em>" or "</em>" from a path. Used in fixes of the image uploader, and link processing
3942
- *
3943
- * @param {string} path_url Path to cleanup
3944
- * @return {string} Clean path URL
3945
- */
3946
- function bleeper_url_path_em_stripper(path_url){
3947
- if(path_url.indexOf("<em>") !== -1){
3948
- path_url = path_url.replace(/<em>/g, "_");
3949
- }
3950
- if(path_url.indexOf("</em>") !== -1){
3951
- path_url = path_url.replace(/<\/em>/g, "_");
3952
- }
3953
-
3954
- return path_url;
3955
- }
3956
-
3957
- /**
3958
- * Check if string contains any file suffixes
3959
- * If so return 'Attachment' - Else Return self
3960
- *
3961
- * @param {string} content Content to filter
3962
- * @return {string} Fitlered content
3963
- */
3964
- function bleeper_attachment_label_filter(content){
3965
- var fileExt = content.split('.').pop();
3966
- fileExt = fileExt.toLowerCase();
3967
- for(var i in bleeper_file_suffix_check){
3968
- if(fileExt === bleeper_file_suffix_check[i]){
3969
- return "Attachment";
3970
- }
3971
- }
3972
-
3973
- return content;
3974
- }
3975
-
3976
- /**
3977
- * Notify the agent that there is a new message and display the enabled
3978
- * notification options.
3979
- *
3980
- * @param {string} chatid The Chat ID
3981
- */
3982
- function bleeper_notify_new_message(chatid) {
3983
- if(typeof current_user_is_online !== 'undefined'){
3984
- //This is bleeper specific
3985
- if(current_user_is_online == false){
3986
- return; //User is offline, just return now and kill the function
3987
- }
3988
- }
3989
-
3990
- if (typeof involved_list[chatid] !== "undefined" && involved_list[chatid] === true) {
3991
- nc_update_unread_count(chatid);
3992
-
3993
- if (typeof bleeper_ping_sound_notification_enabled !== "undefined") {
3994
- if (bleeper_ping_sound_notification_enabled === "true") {
3995
- bleeper_ping.play();
3996
- }
3997
- }
3998
-
3999
- bleeper_change_favico(bleeper_favico_noti);
4000
- }
4001
- }
4002
-
4003
- /**
4004
- * Strip tags with JS
4005
- *
4006
- * @param {string} input_string The Input string
4007
- * @return {string} The clean value
4008
- */
4009
- function bleeper_strip_tags(input_string){
4010
- var stripped_string = input_string;
4011
- if(typeof stripped_string === "string"){
4012
- stripped_string = stripped_string.replace(/(<([^\/\/]+)\/\/)/ig,"");
4013
- stripped_string = stripped_string.replace(/(<([^\/>]+)\/>)/ig,"");
4014
- stripped_string = stripped_string.replace(/(<([^>]+)>)/ig,"");
4015
- stripped_string = stripped_string.replace(/(<([^]+))/ig,"");
4016
- stripped_string = stripped_string.replace(/%20/ig, " ");
4017
- }
4018
- return stripped_string;
4019
- }
4020
-
4021
- /**
4022
- * Handles aliases for chat statuses
4023
- *
4024
- * @param {string} status The current status
4025
- * @return {string} The formatted status
4026
- */
4027
- function bleeper_pretty_chat_status(status){
4028
- var status_aliases = {
4029
- 'ticket_new' : 'active',
4030
- 'ticket_pending' : 'active',
4031
- 'ticket_open' : 'active',
4032
- 'ticket_closed' : 'active',
4033
- };
4034
-
4035
- if(typeof status_aliases[status] !== 'undefined'){
4036
- return status_aliases[status];
4037
- }
4038
- return status;
4039
- }
4040
-
4041
-
4042
- /**
4043
- * Adds a socket to the ping list
4044
- * This will check if the user is still around
4045
- *
4046
- * @param {string} socketid The socket ID to be pinged
4047
- * @param {string} chatid The chat ID
4048
- */
4049
- function bleeper_add_socket_to_ping(socketid, chatid) {
4050
- ping_list[socketid] = setTimeout(function() {
4051
- socket.emit('a2vping',{socketid:socketid, returnsocket: nifty_my_socket, chatid: chatid});
4052
- var tmpusername = 'The visitor';
4053
- if (typeof visitor_list[chatid] !== 'undefined' && visitor_list[chatid].username !== 'undefined') {
4054
- tmpusername = visitor_list[chatid].username;
4055
- }
4056
-
4057
- nc_remove_visitor_after_time({socketid: socketid, chatid: chatid, username: tmpusername})
4058
- },9000);
4059
- }
1
+ /**
2
+ * WPLC - Agent JavaScript (Main)
3
+ *
4
+ * Copyright (c) 2017 Code Cabin Inc.
5
+ *
6
+ * Version 1.0
7
+ * Released August 2017
8
+ *
9
+ *
10
+ *
11
+ */
12
+
13
+
14
+ /**
15
+ * General variables
16
+ */
17
+ var socket;
18
+ var active_socket;
19
+ var active_chatid;
20
+ var active_customerID = null;
21
+ var remove_visitor_timer = [];
22
+ var visitor_list = {};
23
+ var unread_count = [];
24
+ var involved_list = {};
25
+ var last_chat_messages = {};
26
+ var tcx_emoji_converter;
27
+ var tcx_delegates;
28
+ var connection_lost_type;
29
+ var information_received_pointer = false;
30
+ var latency_dead_check;
31
+ var pingpong_running = false;
32
+ var ping_list = {};
33
+ var old_version_detected = false;
34
+
35
+ var current_init_attempt_id = false;
36
+
37
+ display_page_refresh_alert = false;
38
+ wplc_show_reload_alert = function(event) {
39
+ event.returnValue = "Warning";
40
+ };
41
+
42
+ /**
43
+ * Variable to help identfy if we are editing a message
44
+ * @type {Boolean}
45
+ */
46
+ var niftyIsEditing = false;
47
+
48
+ /**
49
+ * Identify the last message sent, so when we press UP we can edit it
50
+ */
51
+ var lastmessagesent;
52
+
53
+ /**
54
+ * Visitor data timer
55
+ */
56
+ var get_visitor_timer = undefined;
57
+
58
+ /** Prompt and cancel callback reference */
59
+ var nifty_prompt_callback = null;
60
+ var nifty_cancel_callback = null;
61
+
62
+ var nifty_my_socket = null;
63
+
64
+ var tcx_ring = new Audio(config.ring_override);
65
+ var tcx_ping = new Audio(config.message_override);
66
+
67
+ var tcx_dash_fullscreen_minimal = false;
68
+ var tcx_show_drag_zone = false;
69
+ var tcx_showing_quick_responses = false;
70
+
71
+ var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
72
+
73
+ var message_type = 'u';
74
+
75
+ var tcx_limited = true;
76
+
77
+ $ = typeof $ !== "undefined" ? $ : jQuery;
78
+
79
+ var $messages;
80
+ var $inputMessage;
81
+
82
+ var FADE_TIME = 150; // ms
83
+ var TYPING_TIMER_LENGTH = 400; // ms
84
+
85
+ var query_string;
86
+ var username = tcx_agent_name;
87
+ var connected = false;
88
+ var typing = false;
89
+ var lastTypingTime;
90
+
91
+ var nc_sid;
92
+ var nc_name;
93
+ var nc_chatid;
94
+
95
+
96
+ var tcx_favico_noti = '../wp-content/plugins/wp-live-chat-support/images/tcx48px_n.png';
97
+ var tcx_favico = '../wp-content/plugins/wp-live-chat-support/images/tcx48px.png';
98
+
99
+ // used to validate visitors so we can double-verify their existence
100
+ var visitor_validator = {};
101
+ var is_domain_filter_active = false;
102
+
103
+ var node_uri = "";
104
+
105
+ var tcx_active_filter = false;
106
+ var tcx_visitor_filters = {
107
+ new_visitors : 0,
108
+ active_chats : 1,
109
+ referer : 2
110
+ };
111
+
112
+ (function($) {
113
+ $(document).on("tcx_dom_ready", function(e) {
114
+
115
+ // Initialize variables
116
+ var $window = $(window);
117
+ $messages = $('.messages'); // Messages area
118
+ $inputMessage = $('.inputMessage'); // Input message input box
119
+
120
+ /* find out if we have had a chat with this visitor before */
121
+ sid = nc_getCookie("nc_sid");
122
+ chatid = nc_getCookie("nc_chatid");
123
+
124
+ jQuery(".chatArea .messages img").on("load", function() {
125
+ if(typeof $messages !== "undefined" && typeof $messages[0] !== "undefined" && typeof $messages[0].scrollHeight !== "undefined"){
126
+ setTimeout(function(){
127
+ $messages[0].scrollTop = $messages[0].scrollHeight;
128
+ }, 300);
129
+ }
130
+ });
131
+
132
+ if (typeof override_chatid !== "undefined") {
133
+ chatid = override_chatid;
134
+ }
135
+
136
+ query_string = "nc_api_key="+nifty_api_key+"&nc_agent_id="+agent_id;
137
+
138
+ if(typeof wplc_guid !== "undefined"){
139
+ query_string += "&guid=" + wplc_guid;
140
+ }
141
+
142
+ if(typeof tcx_agent_verification_end_point !== "undefined"){
143
+ query_string += "&agent_verification_end_point=" + tcx_agent_verification_end_point;
144
+ }
145
+
146
+ if(typeof agent_id !== "undefined"){
147
+ query_string += "&agent_id=" + agent_id;
148
+ }
149
+
150
+ if(typeof window !== "undefined" && typeof window.location !== "undefined" && typeof window.location.href !== "undefined"){
151
+ query_string += "&referer=" + window.location.href;
152
+ }
153
+
154
+
155
+ jQuery.event.trigger({type: "tcx_connect", ndata:{query_string:query_string}});
156
+
157
+ // Keyboard events
158
+ $inputMessage.keydown(function (event) {
159
+ // When the client hits ENTER on their keyboard
160
+ if (event.which === 13) {
161
+ event.preventDefault();
162
+ jQuery("#wplc_send_msg").click();
163
+ } else if (event.which === 27 && !event.shiftKey) {
164
+ jQuery("#wplc_chatmsg").val('');
165
+ niftyIsEditing = false;
166
+ }
167
+ });
168
+
169
+ $inputMessage.keyup(function (event) {
170
+ // When the client hits ENTER on their keyboard
171
+ if (event.which === 13) {
172
+ } else {
173
+ //socket.emit('typing_preview', {tempmessage: $inputMessage.val()});
174
+ }
175
+ });
176
+
177
+ $inputMessage.on('input', function() {
178
+ t_ag_cid = nifty_api_key+''+parseInt(agent_id)+''+parseInt(agent_id);
179
+ t_ag_cid = md5(t_ag_cid);
180
+
181
+ if (active_chatid === t_ag_cid) {
182
+ /* do nothing as we are chatting with ourselves */
183
+ } else {
184
+ updateTyping();
185
+ }
186
+ });
187
+
188
+ $(document).on("click","#wplc_send_msg", function() {
189
+ sendMessage();
190
+ socket.emit('stop typing',{chatid:active_chatid});
191
+ typing = false;
192
+ });
193
+
194
+ // Click events
195
+ // Focus input when clicking on the message input's border
196
+ $inputMessage.click(function () {
197
+ $inputMessage.focus();
198
+ });
199
+
200
+ document.addEventListener('click', function (e) {
201
+ if (e.target.classList.contains('open_chat')) {
202
+ var tcid = e.target.getAttribute('cid');
203
+ nc_add_user_to_list(visitor_list[tcid], function() {
204
+ $("#"+tcid).click();
205
+ });
206
+ }
207
+ }, false);
208
+
209
+ $("body").on("click", ".init_chat", function() {
210
+ var tcid = $(this).attr('cid');
211
+
212
+ current_init_attempt_id = tcid;
213
+
214
+ jQuery.event.trigger({type: "tcx_initiate_chat", ndata:{chatid:tcid, agent:agent_id}});
215
+ socket.emit('initiate chat',{chatid: tcid});
216
+ nc_add_user_to_list(visitor_list[tcid], function() {
217
+ $("#"+tcid).click();
218
+ setTimeout(function() {
219
+ $(".tcx_join_chat_btn").click();
220
+ },100)
221
+
222
+ });
223
+ });
224
+
225
+ $('body').on('click', '#inchat_drop_down', function(){
226
+ jQuery('#chatCloseTitle').hide();
227
+ if(typeof active_chatid !== 'undefined' && active_chatid !== null && active_chatid !== false && active_chatid !== undefined){
228
+ if(typeof visitor_list[active_chatid] !== 'undefined'){
229
+ if(visitor_list[active_chatid]['involved'].length > 1){
230
+ jQuery('#chatCloseTitle').show();
231
+ }
232
+ }
233
+ }
234
+ });
235
+
236
+ $("body").on("click", ".tcx_close_item", function() {
237
+ var tcid = $(this).attr('cid');
238
+ $("#"+tcid).remove();
239
+ tcx_remove_chatid_from_ls(tcid);
240
+
241
+ //delete visitor_list[tcid];
242
+
243
+ setTimeout(function() {
244
+ $("#user_count").click();
245
+ },100);
246
+ });
247
+
248
+ $("body").on("click", ".accept_chat", function() {
249
+ var tcid = $(this).attr('cid');
250
+
251
+ involved_list[tcid] = true;
252
+
253
+ $(this).remove();
254
+ socket.emit('chat accepted',{chatid: tcid,agent_id:agent_id,agent_name:tcx_agent_name});
255
+ jQuery.event.trigger({type: "tcx_add_agent", ndata:{chatid:tcid, agent:agent_id}});
256
+
257
+ nc_add_user_to_list(visitor_list[tcid], function() {
258
+ $("#"+tcid).click();
259
+
260
+ });
261
+ nifty_chat_add_agent_involved(tcid, agent_id);
262
+ nifty_chat_add_agent_involved_visitor_list(tcid, agent_id);
263
+
264
+ jQuery.event.trigger({type: "tcx_agent_accepted_chat", ndata:{chat_id:tcid,agent_id:agent_id}});
265
+ });
266
+
267
+
268
+ $("body").on("click", "#user_count", function() {
269
+ $('.infoArea').show();
270
+ $('.chatArea').hide();
271
+ $('.messages').empty();
272
+
273
+ active_chatid = undefined;
274
+
275
+ if (typeof visitor_list === "undefined" || Object.keys(visitor_list).length === 0) {
276
+ nc_no_visitors();
277
+ }
278
+
279
+ /* remove the active state of any agent chat item */
280
+ $(".online_agent").each(function() {
281
+ jQuery(this).removeClass('active');
282
+ });
283
+
284
+ /* remove the active state of any user chat item */
285
+ $(".userList").each(function() {
286
+ jQuery(this).removeClass('active');
287
+ });
288
+
289
+
290
+
291
+
292
+ });
293
+
294
+ $("body").on("click", ".chatTransfer", function() {
295
+ var tmp_chatid_transfer = $(this).attr('cid');
296
+ message = '<p class="chat_agent_list">Please select an agent:</p>';
297
+ message += '<div class="t_agent_list"></div>';
298
+
299
+
300
+ params = {
301
+ token: 'zf6fe1399sdfgsdfg02ad09ab6a8cb7345s',
302
+ api_key: nifty_api_key
303
+ },
304
+
305
+
306
+ jQuery.ajax({
307
+ url : nc_buildUrl(node_uri+'/api/v1/list_online_agents/', params),
308
+ type : 'GET',
309
+ cache: false,
310
+ processData: false,
311
+ contentType: false,
312
+ success : function(data) {
313
+ information_received_pointer = 'transfer';
314
+ online_ag_array = JSON.parse(data);
315
+ var atleast_one_added = false;
316
+ for (l in online_ag_array) {
317
+ if (online_ag_array[l] !== nifty_my_socket) {
318
+ atleast_one_added = true;
319
+ socket.emit('request information',{socketid: online_ag_array[l]});
320
+ $('<div/>', {
321
+ 'class': 'active_agent_in_list',
322
+ html: '<input type="radio" value="" name="ag_t_selection" cid="'+wplc_safe_html(tmp_chatid_transfer)+'" id="ag_t_'+wplc_safe_html(online_ag_array[l])+'" /> <span class="ag_t_span_'+wplc_safe_html(online_ag_array[l])+'">getting information...</span> <br/>'
323
+ }).appendTo(".t_agent_list");
324
+ }
325
+ }
326
+
327
+ if(!atleast_one_added){
328
+ $('<div/>', {
329
+ 'class': 'no_active_agents_notice',
330
+ html: '<span class="no_active_agents_notice_inner">No other agents online...</span> <br/>'
331
+ }).appendTo(".t_agent_list");
332
+ }
333
+
334
+ },
335
+ error : function (){
336
+
337
+ }
338
+ });
339
+
340
+
341
+ niftyShowDialog("Invite Agent", message, 'Invite', 'Cancel', function() {
342
+ var ag_selection = $('input[name=ag_t_selection]:checked', '.t_agent_list').val();
343
+ var transfer_chat_id = $('input[name=ag_t_selection]:checked', '.t_agent_list').attr('cid');
344
+ if (typeof ag_selection !== "undefined") {
345
+ socket.emit('transfer chat',{socketid: ag_selection,chatid:transfer_chat_id,from_agent:tcx_agent_name});
346
+ }
347
+
348
+ },null);
349
+
350
+ jQuery('#nifty_admin_chat_prompt_confirm').hide();
351
+
352
+ });
353
+
354
+ $("body").on("click", ".chatTransferDepartment", function() {
355
+ var tmp_chatid_transfer = active_chatid;
356
+ message = '<p class="chat_department_list">Please select a department:</p>';
357
+ message += '<div class="t_department_list">';
358
+ if(typeof tcx_departments !== "undefined"){
359
+ for(var index in tcx_departments){
360
+ message += "<input type='radio' name='dp_t_selection' cid='"+wplc_safe_html(tmp_chatid_transfer)+"' value='"+wplc_safe_html(index)+"' /><span>" + wplc_safe_html(tcx_departments[index]) + "</span> <br/>";
361
+ }
362
+ }
363
+ message += '</div>';
364
+
365
+
366
+ niftyShowDialog("Invite Department", message, 'Invite', 'Cancel', function() {
367
+ var dp_selection = $('input[name=dp_t_selection]:checked', '.t_department_list').val();
368
+ var transfer_chat_id = $('input[name=dp_t_selection]:checked', '.t_department_list').attr('cid');
369
+ if (typeof dp_selection !== "undefined") {
370
+ socket.emit('transfer chat department',{socketid: dp_selection,department:dp_selection,chatid:transfer_chat_id,from_agent:tcx_agent_name});
371
+ }
372
+
373
+ },null);
374
+
375
+ jQuery('#nifty_admin_chat_prompt_confirm').hide();
376
+
377
+ });
378
+
379
+ $('body').on('click', 'input[name=dp_t_selection],input[name=ag_t_selection]', function(){
380
+ jQuery('#nifty_admin_chat_prompt_confirm').show();
381
+ });
382
+
383
+
384
+ //Direct to page handler
385
+ $("body").on("click", ".chatDirectUserToPagePrompt", function() {
386
+ if (typeof active_chatid !== "undefined") {
387
+ if(typeof tcx_valid_direct_to_page_array !== "undefined"){
388
+
389
+ var select_html_for_modal = tcx_generate_dropdown("tcx_direct_to_page_select", tcx_valid_direct_to_page_array);
390
+
391
+ niftyShowDialog("Direct User To Page", select_html_for_modal , 'Direct User To Selected Page', 'Cancel', function() {
392
+ //What to do wena
393
+ var selected_page_url = jQuery("#tcx_direct_to_page_select").val();
394
+
395
+ socket.emit('custom data',{action:'send_user_direct_to_page',chatid:active_chatid,agent_name:tcx_agent_name, direction: selected_page_url, pretty_name: tcx_valid_direct_to_page_array[selected_page_url]});
396
+
397
+ /** Store this for later retrieval */
398
+ var direct_to_page_message = {}
399
+ direct_to_page_message.originates = 0;
400
+ direct_to_page_message.msg = tcx_agent_name + ' would like to direct you to the following page: ' + tcx_valid_direct_to_page_array[selected_page_url] + ' - ' + selected_page_url;
401
+ direct_to_page_message.other = {};
402
+
403
+ var wplc_d = new Date();
404
+ direct_to_page_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
405
+ direct_to_page_message.other.agent_id = 0;
406
+
407
+ var randomNum = Math.floor((Math.random() * 100) + 1);
408
+ var msgID = Date.now()+randomNum;
409
+
410
+ wplc_push_message_to_chatbox(direct_to_page_message, 0, function() {
411
+ jQuery.event.trigger({type: "tcx_scroll_bottom"});
412
+ });
413
+
414
+ if(direct_to_page_message.msg !== false){
415
+ /* this message is going to another agent */
416
+ var api_endpoint = 'send_agent_message';
417
+ var ato = 0;
418
+ var data = {
419
+ relay_action: 'wplc_admin_send_msg',
420
+ agent_id: 0,
421
+ security: wplc_nonce,
422
+ chat_id: active_chatid,
423
+ message: direct_to_page_message.msg,
424
+ ato: ato,
425
+ msg_id: msgID,
426
+ orig_override: direct_to_page_message.originates
427
+
428
+ };
429
+ wplc_rest_api(api_endpoint, data, 12000, function(){
430
+
431
+ data.orig_override = 3;
432
+ wplc_rest_api(api_endpoint, data, 12000, null);
433
+ });
434
+
435
+
436
+
437
+ }
438
+
439
+ },null);
440
+
441
+ jQuery.event.trigger({type: "tcx_direct_user_to_page_prompt"});
442
+ }
443
+ }
444
+ });
445
+ $("body").on("click", ".chatClose", function() {
446
+ var tmp_chatid_close = $(this).attr('cid');
447
+
448
+ involved_list[tmp_chatid_close] = false;
449
+ $(this).attr('cid',null);
450
+ $(this).hide();
451
+ $("#user_count").click();
452
+ socket.emit('agent left',{chatid:tmp_chatid_close,agent:agent_id,agent_name:username});
453
+ nifty_chat_remove_agent_involved(tmp_chatid_close, agent_id);
454
+ if (typeof active_chatid !== "undefined") {
455
+ active_chatid = undefined;
456
+ }
457
+ $("#"+tmp_chatid_close).remove();
458
+ //tcx_remove_chatid_from_ls(tmp_chatid_close);
459
+
460
+ });
461
+ $("body").on("click", ".endChat", function() {
462
+ var tmp_chatid_close = $(this).attr('cid');
463
+
464
+ involved_list[tmp_chatid_close] = false;
465
+ $(this).attr('cid',null);
466
+ $(this).hide();
467
+ $("#user_count").click();
468
+ socket.emit('agent left', {chatid:tmp_chatid_close,agent:agent_id,agent_name:username});
469
+ socket.emit('end chat', {chatid:tmp_chatid_close,agent:agent_id,agent_name:username, visitor_socket: active_socket});
470
+ nifty_chat_remove_agent_involved(tmp_chatid_close, agent_id);
471
+ if (typeof active_chatid !== "undefined") {
472
+ active_chatid = undefined;
473
+ }
474
+
475
+ $("#"+tmp_chatid_close).remove();
476
+ //tcx_remove_chatid_from_ls(tmp_chatid_close);
477
+
478
+ visitor_list[tmp_chatid_close].state = 'browsing';
479
+ visitor_list[tmp_chatid_close].involved = undefined;
480
+ jQuery.event.trigger({type: "tcx_add_initiate_button_no_col", cid:tmp_chatid_close});
481
+ nc_remove_open_chat_visitor_row(tmp_chatid_close);
482
+
483
+ var data = {
484
+ agent_id: agent_id,
485
+ security: wplc_nonce,
486
+ chat_id: tmp_chatid_close,
487
+ };
488
+ wplc_rest_api('agent_end_chat', data, 12000, function(){
489
+
490
+ });
491
+
492
+ setTimeout(function() {
493
+ $("#user_count").click();
494
+ },100);
495
+
496
+ });
497
+ $("body").on("click", ".minChat", function() {
498
+ var tmp_chatid_close = $(this).attr('cid');
499
+
500
+ $(this).attr('cid',null);
501
+ $(this).hide();
502
+ $("#user_count").click();
503
+ if (typeof active_chatid !== "undefined") {
504
+ active_chatid = undefined;
505
+ }
506
+
507
+ jQuery.event.trigger({type: "tcx_min_chat"});
508
+
509
+ });
510
+
511
+ $("body").on("click", ".userList", function() {
512
+ if (!display_page_refresh_alert) {
513
+ display_page_refresh_alert = true;
514
+ window.addEventListener("beforeunload", wplc_show_reload_alert);
515
+ }
516
+ $(".nifty_bg_holder").fadeOut();
517
+ $("#inputMessage").prop('disabled',false);
518
+ message_type = 'u';
519
+
520
+ $('.inchat-menu').show();
521
+ $('.infoArea').hide();
522
+ $('.chatArea').show();
523
+ $('.messages').empty();
524
+ //nc_log('Fetching messages...',"fetchinglog",{prepend: true});
525
+ active_socket = $(this).attr('socket');
526
+ active_customerID = $(this).attr('customerID');
527
+ var tmp_chatid = $(this).attr('id');
528
+ active_chatid = tmp_chatid;
529
+
530
+ //involved_list[tmp_chatid] = true;
531
+
532
+ unread_count[tmp_chatid] = 0;
533
+ tcx_check_if_all_read();
534
+ nc_update_unread_count(tmp_chatid);
535
+
536
+ /* remove the active state of any agent chat item */
537
+ $(".online_agent").each(function() {
538
+ jQuery(this).removeClass('active');
539
+ });
540
+
541
+ $(".userList").removeClass("active");
542
+ $(this).removeClass("newmessage");
543
+ $(".chatClose").show();
544
+ $(".endChat").show();
545
+ $(".minChat").show();
546
+ $(".chatClose").attr("cid",active_chatid);
547
+ $(".endChat").attr("cid",active_chatid);
548
+ $(".chatTransfer").attr("cid",active_chatid);
549
+
550
+ jQuery.event.trigger({type: "tcx_send_get_chat_history", ndata:{chatid:tmp_chatid,agent_name:username,agent_id:agent_id}});
551
+ jQuery.event.trigger({type: "tcx_clear_typing_preview", cid: tmp_chatid});
552
+
553
+ tcx_add_socket_to_ping(active_socket,active_chatid);
554
+
555
+
556
+ $(".chatInfoArea-Name").html("");
557
+ $(".chatInfoArea-Email").html("");
558
+ $(".chatInfoArea-Info1").html("");
559
+ $(".user_gravatar").html("");
560
+ if (typeof visitor_list[active_chatid] !== "undefined") {
561
+ if(typeof visitor_list[active_chatid].username !== "undefined"){
562
+ $(".chatInfoArea-Name").html( wplc_safe_html(visitor_list[active_chatid].username) );
563
+ } else {
564
+ $(".chatInfoArea-Name").html(config.wplc_user_default_visitor_name);
565
+ }
566
+
567
+ $(".chatInfoArea-Info1").html("from: <a href='"+wplc_safe_html(visitor_list[active_chatid].referer)+"' target='_BLANK'>"+tcx_string_limiter(wplc_safe_html(visitor_list[active_chatid].referer),45)+"</a>");
568
+
569
+ if(typeof visitor_list[active_chatid].email !== "undefined"){
570
+ $(".user_gravatar").html("<img src='https://www.gravatar.com/avatar/"+md5(visitor_list[active_chatid].email)+"?s=100&d=mm' />");
571
+ $(".chatInfoArea-Email").html('<a href="mailto:'+ wplc_safe_html( visitor_list[active_chatid].email )+'" target="_BLANK">'+ wplc_safe_html( visitor_list[active_chatid].email )+'</a>');
572
+ } else {
573
+ $(".user_gravatar").html("<img src='https://www.gravatar.com/avatar/unknown?s=100&d=mm' />");
574
+ $(".chatInfoArea-Email").html('Email Unknown');
575
+ }
576
+
577
+ jQuery.event.trigger({type: "tcx_open_chat", cid:active_chatid, username: visitor_list[active_chatid].username});
578
+ }
579
+
580
+
581
+ /* removed - only triggered now when you click on the "Join chat" button */
582
+ //nifty_chat_add_agent_involved(active_chatid, agent_id);
583
+
584
+ if (typeof involved_list[active_chatid] === "undefined" || involved_list[active_chatid] === false) {
585
+ $("#inputMessage").prop('disabled',true);
586
+ $(".tcx_join_chat_div").show();
587
+
588
+ } else {
589
+ $(".tcx_join_chat_div").hide();
590
+ $("#inputMessage").prop('disabled',false);
591
+ $("#inputMessage").focus();
592
+
593
+
594
+ }
595
+
596
+
597
+ if ($(this).hasClass('inactive')) {} else {
598
+ $(this).addClass('active');
599
+ }
600
+
601
+
602
+
603
+ setTimeout(function() {
604
+ $("#fetchinglog").fadeOut("slow");
605
+ },2000);
606
+
607
+
608
+ /**
609
+ * This makes sure that "agent joined" gets sent back to the customer (if the agent previously disconnected)
610
+ *
611
+ */
612
+ if (typeof involved_list[active_chatid] !== "undefined" && involved_list[active_chatid] === true) {
613
+
614
+ jQuery.event.trigger({type: "tcx_add_agent", ndata:{chatid:active_chatid, agent:agent_id}});
615
+ nifty_chat_add_agent_involved(active_chatid, agent_id);
616
+ nifty_chat_add_agent_involved_visitor_list(active_chatid, agent_id);
617
+ socket.emit('chat accepted',{
618
+ chatid: active_chatid,
619
+ agent_id:agent_id,
620
+ agent_name:tcx_agent_name
621
+ });
622
+ }
623
+
624
+
625
+ });
626
+ $("body").on("click", ".tcx_join_chat_btn", function(e) {
627
+ involved_list[active_chatid] = true;
628
+ socket.emit('chat accepted',{chatid: active_chatid,agent_id:agent_id,agent_name:tcx_agent_name});
629
+ jQuery.event.trigger({type: "tcx_add_agent", ndata:{chatid:active_chatid, agent:agent_id}});
630
+ nifty_chat_add_agent_involved(active_chatid, agent_id);
631
+ nifty_chat_add_agent_involved_visitor_list(active_chatid, agent_id);
632
+ $(".tcx_join_chat_div").hide();
633
+ $("#inputMessage").prop('disabled',false);
634
+ $("#inputMessage").focus();
635
+
636
+ });
637
+ $("body").on("click", ".online_agent", function() {
638
+ if (!display_page_refresh_alert) {
639
+ display_page_refresh_alert = true;
640
+ window.addEventListener("beforeunload", wplc_show_reload_alert);
641
+ }
642
+
643
+ /* remove the active state of any agent chat item */
644
+ $(".online_agent").each(function() {
645
+ jQuery(this).removeClass('active');
646
+ });
647
+
648
+ /* remove the active state of any user chat item */
649
+ $(".userList").each(function() {
650
+ jQuery(this).removeClass('active');
651
+ });
652
+
653
+ $('.inchat-menu').hide();
654
+ $('.nifty_bg_holder').hide();
655
+ $('.infoArea').hide();
656
+ $('.chatArea').show();
657
+ $('.messages').empty();
658
+ $(this).removeClass("newmessage");
659
+ $(".chatClose").show();
660
+ $(".endChat").show();
661
+ $(".minChat").show();
662
+ $(".chatClose").attr("cid",active_chatid);
663
+ $(".endChat").attr("cid",active_chatid);
664
+
665
+ var selected_agentid = $(this).attr('aid');
666
+ jQuery("#inputMessage").removeAttr('disabled');
667
+ jQuery("#inputMessage").css('background-color','#fff');
668
+ if (selected_agentid == config.current_wpuserid){
669
+ jQuery("#inputMessage").attr('disabled','true');
670
+ }
671
+
672
+ message_type = parseInt(selected_agentid);
673
+
674
+ //nc_log('Fetching messages...',"fetchinglog",{prepend: true});
675
+ active_socket = $(this).attr('socket');
676
+
677
+ var tmp_chatid = $(this).attr('id');
678
+ active_chatid = tmp_chatid;
679
+ involved_list[tmp_chatid] = true;
680
+ unread_count[tmp_chatid] = 0;
681
+ nc_update_unread_count(tmp_chatid);
682
+
683
+ jQuery.event.trigger({type: "tcx_send_get_chat_history", ndata:{chatid:tmp_chatid,agent_name:username,agent_id:agent_id}});
684
+
685
+ $(".chatInfoArea-Name").html("");
686
+ $(".chatInfoArea-Info1").html("");
687
+ $(".user_gravatar").html("");
688
+
689
+
690
+ $(".chatInfoArea-Name").html( wplc_safe_html(wplc_agent_data[selected_agentid].name) );
691
+ $(".user_gravatar").html("<img src='https://www.gravatar.com/avatar/"+wplc_agent_data[selected_agentid].md5+"?s=100&d=mm' />");
692
+
693
+ if ($(this).hasClass('inactive')) {} else {
694
+ $(this).addClass('active');
695
+ }
696
+ setTimeout(function() {
697
+ $("#fetchinglog").fadeOut("slow");
698
+ },2000);
699
+
700
+ jQuery.event.trigger({type: "tcx_open_chat", cid:active_chatid, username: wplc_agent_data[selected_agentid].name});
701
+ });
702
+
703
+
704
+
705
+
706
+
707
+
708
+
709
+
710
+
711
+
712
+ $("#nifty_file_input").on("change", function(){
713
+ var file = this.files[0]; //Last file in array
714
+ wplcShareFile(file,'#nifty_attach_fail_icon', '#nifty_attach_success_icon', '#nifty_attach_uploading_icon', "#nifty_attach");
715
+ jQuery("#chat_drag_zone").fadeOut();
716
+
717
+ this.value = "";
718
+
719
+ });
720
+
721
+
722
+
723
+ /*Add in filter click handlers */
724
+ $("body").on("click", ".filter-new-visitors", function(){
725
+ tcx_active_filter = tcx_visitor_filters.new_visitors;
726
+ tcx_refresh_visitor_list();
727
+ });
728
+
729
+ $("body").on("click", ".filter-active-chats", function(){
730
+ tcx_active_filter = tcx_visitor_filters.active_chats;
731
+ tcx_refresh_visitor_list();
732
+ });
733
+
734
+ $('body').on('click', '.filter-referer', function(){
735
+ tcx_active_filter = tcx_visitor_filters.referer;
736
+ tcx_refresh_visitor_list();
737
+ });
738
+
739
+ $('body').on('click', '#nifty_referer_contains', function(){
740
+ tcx_refresh_visitor_list();
741
+ });
742
+
743
+ $('body').on('change keyup paste mouseup', '#nifty_referer_url', function(){
744
+ var last_val = $('#nifty_referer_url').attr('last-val');
745
+ var cur_val = $('#nifty_referer_url').val();
746
+ if(typeof last_val === 'undefined' || last_val !== cur_val){
747
+ $('#nifty_referer_url').attr('last-val',cur_val);
748
+ tcx_refresh_visitor_list();
749
+ }
750
+ });
751
+
752
+ $("body").on("click", ".filter-clear", function(){
753
+ $('#nifty_referer_options').fadeOut('slow');
754
+ tcx_active_filter = false;
755
+ tcx_refresh_visitor_list();
756
+ });
757
+
758
+ $("body").on("click", ".filter-menu .dropdown-menu li a[class!='filter-clear']", function(){
759
+ //Not trying to clear the filter persay
760
+ var current_filter = jQuery(this).text();
761
+ current_filter = tcx_string_limiter(current_filter, 12);
762
+ $('#nifty_referer_options').fadeOut('slow');
763
+ jQuery(".filter-active-tag-container").fadeOut("slow", function(){
764
+ jQuery(".filter-active-tag-inner").text(current_filter);
765
+ if(tcx_active_filter === tcx_visitor_filters.referer) {
766
+ $('#nifty_referer_options').fadeIn('slow');
767
+ }
768
+ jQuery(".filter-active-tag-container").fadeIn("slow");
769
+ });
770
+ });
771
+
772
+ /* socket delegates were here */
773
+ });
774
+ })(jQuery);
775
+
776
+ /* MOBILE CONTROL */
777
+ jQuery(function(){
778
+ jQuery(document).on("tcx_open_chat", function(e){
779
+ if(jQuery(window).width() < 700){
780
+ jQuery("label[for=user_list_mobile_control]").click();
781
+ }
782
+ });
783
+
784
+ jQuery(document).on("tcx_min_chat", function(e) {
785
+ if (display_page_refresh_alert) {
786
+ window.removeEventListener("beforeunload", wplc_show_reload_alert);
787
+ }
788
+ if(jQuery(window).width() < 700){
789
+ jQuery("label[for=user_list_mobile_control]").click();
790
+ }
791
+ });
792
+ });
793
+ /* END MOBILE CONTROL */
794
+
795
+ jQuery(document).on("tcx_dom_ready", function(e) {
796
+
797
+
798
+ if (document.getElementById('inputMessage') !== null) {
799
+
800
+ /** Image pasting functionality */
801
+ document.getElementById('inputMessage').onpaste = function (event) {
802
+ jQuery.event.trigger({type: "tcx_input_paste", event: event});
803
+ }
804
+ }
805
+ });
806
+
807
+
808
+ jQuery(document).on("tcx_dom_ready", function(e) {
809
+
810
+ jQuery("#nifty_admin_chat_prompt_confirm").click(function(){
811
+ niftyExecuteDialogCallback();
812
+ });
813
+
814
+ jQuery("#nifty_admin_chat_prompt_cancel").click(function(){
815
+ niftyCloseDialog();
816
+ });
817
+
818
+ jQuery("#quick_response_drawer_handle").click(function(){
819
+
820
+ if(tcx_showing_quick_responses){
821
+ jQuery("#quick_response_drawer_handle i").removeClass("fa-times").addClass("fa-bolt");
822
+ jQuery("#quick_response_drawer_container").fadeOut("fast");
823
+ } else {
824
+ jQuery("#quick_response_drawer_handle i").removeClass("fa-bolt").addClass("fa-times");
825
+ jQuery("#quick_response_drawer_container").fadeIn("fast");
826
+ }
827
+
828
+ tcx_showing_quick_responses = !tcx_showing_quick_responses;
829
+
830
+ });
831
+
832
+ jQuery("#nifty_wrapper").click(function(e){
833
+ if(tcx_showing_quick_responses){
834
+ if(typeof e !== "undefined" && typeof e.target !== "undefined" && typeof e.target.id !== "undefined"){
835
+ if(e.target.id !== "quick_response_drawer_handle" && (e.target.nodeName !== "I" && e.target.nodeName !== "I")) {
836
+ jQuery("#quick_response_drawer_handle").click();
837
+ }
838
+ }
839
+ }
840
+ });
841
+
842
+ jQuery("body").on("click", ".quick_response_item", function(){
843
+ var response = jQuery(this).text();
844
+ var current_text = jQuery("#inputMessage").val();
845
+
846
+ jQuery("#inputMessage").val(current_text + response).focus();
847
+ jQuery("#quick_response_drawer_handle").click();
848
+ });
849
+
850
+ jQuery("#toolbar-item-fullscreen").click(function(){
851
+ if(tcx_dash_fullscreen_minimal){
852
+ //Show bars again
853
+ jQuery("section").removeClass("strip_margins");
854
+ jQuery("footer").removeClass("strip_margins");
855
+ jQuery(".topnavbar[role=navigation]").fadeIn();
856
+ jQuery(".aside[role=navigation]").fadeIn();
857
+ } else {
858
+ //Hide them now
859
+ jQuery(".topnavbar[role=navigation]").fadeOut("fast");
860
+ jQuery(".aside[role=navigation]").fadeOut("fast");
861
+
862
+ setTimeout(function(){
863
+ jQuery("section").addClass("strip_margins");
864
+ jQuery("footer").addClass("strip_margins");
865
+ }, 300);
866
+ }
867
+ tcx_dash_fullscreen_minimal = !tcx_dash_fullscreen_minimal; //Flips this state
868
+ });
869
+
870
+ if (document.getElementById('messages') !== null) {
871
+ tcx_mutation_observer_init();
872
+ tcx_init_emoji_picker();
873
+ tcx_init_emoji_converter(0);
874
+ }
875
+ });
876
+
877
+ /**
878
+ * Initialize the mutation observer
879
+ */
880
+ function tcx_mutation_observer_init(){
881
+ if (document.getElementById('messages') !== null) {
882
+ var target = document.getElementById('messages');
883
+ var observer = new MutationObserver(function(mutations) {
884
+ mutations.forEach(tcx_mutation_observer_callback);
885
+ });
886
+
887
+ var config = { attributes: true, childList: true, characterData: true };
888
+
889
+
890
+ observer.observe(target, config);
891
+ }
892
+ }
893
+
894
+ /**
895
+ * Mutation observer for attachments
896
+ *
897
+ * @param {object} mutation The mutation object
898
+ */
899
+ function tcx_mutation_observer_callback(mutation){
900
+ if (mutation.type === 'childList') {
901
+ //Now try find
902
+ jQuery(".tcx_in_chat_card a").each(function() {
903
+ var last_dynamic_link = jQuery(this);
904
+ if(typeof last_dynamic_link !== "undefined"){
905
+ //We have a dynamic link. Let's do dis now
906
+ var dynamic_href = last_dynamic_link.attr("href");
907
+ var breakdown_href = dynamic_href;
908
+ var generate_simple_title = false;
909
+ if(dynamic_href.indexOf(".") !== -1){
910
+ //There is a full stop, so we have an extension type here. (This is probably a .com though, so we will end up here no matter what in most cases)
911
+ var extension = dynamic_href.substring(dynamic_href.lastIndexOf("."));
912
+ if(extension !== ".zip" && extension !== ".exe" && extension !== ".bin" && extension !== ".rar" && extension !== ".7zip" && extension !== ".ai" &&
913
+ extension !== ".psd" && extension !== ".psd" && extension !== ".esp" && extension !== ".eps" && extension !== ".txt" && extension !== ".js" &&
914
+ extension !== ".cdr" && extension !== ".apk"){
915
+ //common web file
916
+ if(dynamic_href.indexOf("//") !== -1){
917
+ breakdown_href = dynamic_href.substring(dynamic_href.indexOf("//") + 2);
918
+ breakdown_href = breakdown_href.substring(0, breakdown_href.indexOf("/"));
919
+ generate_simple_title = true;
920
+ } else {
921
+ breakdown_href = dynamic_href;
922
+ }
923
+ } else {
924
+ //Probably a file, and not the end of the world if its not
925
+ breakdown_href = dynamic_href.substring(dynamic_href.lastIndexOf("/"));
926
+ generate_simple_title = true;
927
+ }
928
+ } else {
929
+ //Just assumy this is a link.
930
+ if(dynamic_href.indexOf("//") !== -1){
931
+ breakdown_href = dynamic_href.substring(dynamic_href.indexOf("//") + 2);
932
+ breakdown_href = breakdown_href.substring(0, breakdown_href.indexOf("/"));
933
+ generate_simple_title = true;
934
+ } else {
935
+ breakdown_href = dynamic_href;
936
+ }
937
+ }
938
+
939
+ if(generate_simple_title){
940
+ var the_title = breakdown_href;
941
+ if(the_title.indexOf(".") !== -1){
942
+ the_title = the_title.substring(0, the_title.lastIndexOf("."));
943
+ }
944
+ the_title = the_title.replace(new RegExp("[0-9]", "g"), ""); //Remove all numbers
945
+ the_title = the_title.replace(/-/g, " ");
946
+ the_title = the_title.replace("http://", "");
947
+ the_title = the_title.replace("https://", "");
948
+ the_title = the_title.replace("www.", "");
949
+ the_title = the_title.replace("/", "");
950
+ the_title = the_title.trim();
951
+
952
+ if(the_title === ""){
953
+ the_title = "Link";
954
+ }
955
+
956
+ if(breakdown_href === ""){
957
+ breakdown_href = dynamic_href;
958
+ }
959
+
960
+ breakdown_href = "<small><strong>" + the_title + "</strong> (" + breakdown_href + ")</small>";
961
+
962
+ }
963
+
964
+ last_dynamic_link.html(breakdown_href);
965
+
966
+ }
967
+
968
+ });
969
+ }
970
+ }
971
+
972
+ /**
973
+ * Event which gets all visitor data from the socket
974
+ */
975
+ function tcx_get_visitor_data() {
976
+ if (typeof socket.connected !== "undefined" && socket.connected) {
977
+ socket.emit('get visitor list',{api_key: nifty_api_key});
978
+ }
979
+
980
+ }
981
+
982
+ /**
983
+ * Initialize the emoji picket
984
+ */
985
+ function tcx_init_emoji_picker(){
986
+ if(typeof wdtEmojiBundle !== "undefined"){
987
+ wdtEmojiBundle.defaults.emojiSheets = {
988
+ 'apple' : wplc_baseurl + 'js/vendor/wdt-emoji/sheets/sheet-apple-64-indexed-128.png',
989
+ 'google' : wplc_baseurl + 'js/vendor/wdt-emoji/sheets/sheet-google-64-indexed-128.png',
990
+ 'twitter' : wplc_baseurl + 'js/vendor/wdt-emoji/sheets/sheet-twitter-64-indexed-128.png',
991
+ 'emojione' : wplc_baseurl + 'js/vendor/wdt-emoji/sheets/sheet-emojione-64-indexed-128.png',
992
+ 'facebook' : wplc_baseurl + 'js/vendor/wdt-emoji/sheets/sheet-facebook-64-indexed-128.png',
993
+ 'messenger': wplc_baseurl + 'js/vendor/wdt-emoji/sheets/sheet-messenger-64-indexed-128.png'
994
+ };
995
+
996
+ wdtEmojiBundle.init('.wdt-emoji-bundle-enabled');
997
+ }
998
+ }
999
+
1000
+ /**
1001
+ * Recusively initialize the input field for emoji support. If an error occurs it will attempt again.
1002
+ *
1003
+ * Will try to initialize up to 5 times.
1004
+ * @param {int} attempt Attempt number
1005
+ */
1006
+ function tcx_init_emoji_converter(attempt){
1007
+ attempt = typeof attempt === "undefined" ? 0 : parseInt(attempt);
1008
+ if(typeof EmojiConvertor !== "undefined"){
1009
+ tcx_emoji_converter = new EmojiConvertor(); //Used for converting colon codes to unicodes
1010
+ } else {
1011
+ //Dom not ready yet
1012
+ if(attempt < 5){
1013
+ setTimeout(function(){
1014
+ tcx_init_emoji_converter(attempt++);
1015
+ }, 1000);
1016
+ }
1017
+ }
1018
+ }
1019
+
1020
+ /**
1021
+ * Converts colons to unified
1022
+ *
1023
+ * @param {string} msg The message string
1024
+ * @return {string} The formatted message
1025
+ */
1026
+ function tcx_convert_colon_to_uni(msg){
1027
+ if(typeof EmojiConvertor !== "undefined" && typeof tcx_emoji_converter !== "undefined"){
1028
+ tcx_emoji_converter.init_env(); // else auto-detection will trigger when we first convert
1029
+ tcx_emoji_converter.replace_mode = 'unified';
1030
+ tcx_emoji_converter.allow_native = true;
1031
+ return tcx_emoji_converter.replace_colons(msg);
1032
+ } else {
1033
+ return msg;
1034
+ }
1035
+ }
1036
+
1037
+ /**
1038
+ * Add the agent to the involved list for a specific chat on the server (event)
1039
+ *
1040
+ * @param {string} chatid The chat ID
1041
+ * @param {int} agentid The agent ID
1042
+ */
1043
+ function nifty_chat_add_agent_involved(chatid, agentid) {
1044
+ jQuery.event.trigger({type: "tcx_add_agent_involved", chatid:chatid, agentid:agentid});
1045
+ }
1046
+
1047
+ /**
1048
+ * Add the agent to the involved list for a specific chat
1049
+ *
1050
+ * @param {string} chatid The chat ID
1051
+ * @param {int} agentid The agent ID
1052
+ */
1053
+ function nifty_chat_add_agent_involved_visitor_list(chatid, agentid) {
1054
+ jQuery.event.trigger({type: "tcx_add_agent_involved_visitor_list", chatid:chatid, agentid:agentid});
1055
+ }
1056
+
1057
+ /**
1058
+ * Remove the agent rom the involved list for a specific chat
1059
+ *
1060
+ * @param {string} chatid The chat ID
1061
+ * @param {int} agentid The agent ID
1062
+ */
1063
+ function nifty_chat_remove_agent_involved(chatid, agentid) {
1064
+ if(typeof all_agents !== "undefined"){
1065
+ if(typeof all_agents !== "object"){
1066
+ var check_all_agents = JSON.parse(all_agents);
1067
+ } else {
1068
+ var check_all_agents = all_agents;
1069
+ }
1070
+ if (agentid === agent_id) {
1071
+
1072
+ involved_list[chatid] = false;
1073
+ }
1074
+ agent_involved = check_all_agents[agentid];
1075
+ jQuery('#agent_grav_'+chatid+'_'+agentid).remove();
1076
+ jQuery('#agent_grav_visitor_'+chatid+'_'+agentid).remove();
1077
+ }
1078
+
1079
+ }
1080
+
1081
+ /**
1082
+ * Show a popup dialog within the chat dashboard
1083
+ *
1084
+ * @param {string} title The dialog title
1085
+ * @param {string} message The dialog message
1086
+ * @param {string} accept_btn The accept/confirm button label
1087
+ * @param {string} cancel_btn The cancle button label
1088
+ * @param {function} callback The accept callback function
1089
+ * @param {function} cancel_callback The cancel callback function
1090
+ */
1091
+ function niftyShowDialog(title, message, accept_btn, cancel_btn, callback, cancel_callback){
1092
+ if(title !== null){
1093
+ jQuery(".nifty_admin_chat_prompt_title").text(title);
1094
+ } else {
1095
+ jQuery(".nifty_admin_chat_prompt_title").text("Please Confirm");
1096
+ }
1097
+ if(message !== null){
1098
+ jQuery(".nifty_admin_chat_prompt_message").html(message);
1099
+ }
1100
+
1101
+ if(accept_btn !== null){
1102
+ jQuery("#nifty_admin_chat_prompt_confirm").text(accept_btn);
1103
+ } else {
1104
+ jQuery("#nifty_admin_chat_prompt_confirm").text("Confirm");
1105
+ }
1106
+
1107
+ if(cancel_btn !== null){
1108
+ jQuery("#nifty_admin_chat_prompt_cancel").text(cancel_btn);
1109
+ } else {
1110
+ jQuery("#nifty_admin_chat_prompt_cancel").text("Cancel");
1111
+ }
1112
+
1113
+ jQuery('#nifty_admin_chat_prompt_confirm').show();
1114
+
1115
+ niftyRegisterDialogCallback(callback);
1116
+ niftyRegisterDialogCancelCallback(cancel_callback);
1117
+ jQuery(".nifty_admin_overlay").fadeIn();
1118
+ jQuery(".nifty_admin_chat_prompt").fadeIn();
1119
+ }
1120
+
1121
+ /**
1122
+ * Registed the confirm dialog callback
1123
+ *
1124
+ * @param {function} callback The function to execute when confirmed
1125
+ */
1126
+ function niftyRegisterDialogCallback(callback){
1127
+ nifty_prompt_callback = callback;
1128
+ }
1129
+
1130
+ /**
1131
+ * Registed the cancel dialog callback
1132
+ *
1133
+ * @param {function} callback The function to execute when cancelled
1134
+ */
1135
+ function niftyRegisterDialogCancelCallback(callback){
1136
+ nifty_cancel_callback = callback;
1137
+ }
1138
+
1139
+ /**
1140
+ * Execute the accept/confirm dialog callback
1141
+ */
1142
+ function niftyExecuteDialogCallback(){
1143
+ if(typeof nifty_prompt_callback !== "undefined" && typeof nifty_prompt_callback === "function"){
1144
+ nifty_prompt_callback();
1145
+ }
1146
+ jQuery(".nifty_admin_chat_prompt").hide();
1147
+ jQuery(".nifty_admin_overlay").hide();
1148
+ }
1149
+
1150
+ /**
1151
+ * Execute the cancel dialog callback
1152
+ */
1153
+ function niftyExecuteDialogCancelCallback(){
1154
+ if(typeof nifty_cancel_callback !== "undefined" && typeof nifty_cancel_callback === "function"){
1155
+ nifty_cancel_callback();
1156
+ }
1157
+ jQuery(".nifty_admin_chat_prompt").hide();
1158
+ jQuery(".nifty_admin_overlay").hide();
1159
+ }
1160
+
1161
+ /**
1162
+ * Close the active dialog
1163
+ */
1164
+ function niftyCloseDialog(){
1165
+ niftyRegisterDialogCallback(null); //Just incase
1166
+ niftyExecuteDialogCancelCallback(nifty_cancel_callback);
1167
+ }
1168
+
1169
+ /**
1170
+ * Send a chat message using the socket. Also checks if this is a new message, or an edit to an existing message.
1171
+ */
1172
+ function sendMessage () {
1173
+ var message = $inputMessage.val();
1174
+ // Fix double emojis
1175
+ if (message.search(/\:(\S+)(\:)(\S+)\:/g) !== -1) {
1176
+ message = message.replace(/\:(\S+)(\:)(\S+)\:/g, function (match, p1, p2, p3) {
1177
+ return [":", p1, "::", p3, ":"].join('');
1178
+ });
1179
+ }
1180
+ message = tcx_convert_colon_to_uni(message);
1181
+
1182
+ // this is new message
1183
+ var randomNum = Math.floor((Math.random() * 100) + 1);
1184
+ var msgID = Date.now()+randomNum;
1185
+ lastmessagesent = msgID;
1186
+
1187
+ // if there is a non-empty message and a socket connection
1188
+ if (message && connected) {
1189
+ $inputMessage.val('');
1190
+ var msg_obj = {
1191
+ username: username,
1192
+ message: message,
1193
+ timestamp: Date.now(),
1194
+ msgID: msgID,
1195
+ aoru: agent_id
1196
+ };
1197
+
1198
+ addChatMessage(msg_obj, {is_admin: false});
1199
+
1200
+ jQuery.event.trigger({type: "tcx_send_message", message:message, msg_id:msgID});
1201
+
1202
+ // tell server to execute 'new message' and send along one parameter
1203
+ if (message_type === 'u') {
1204
+ tcx_append_message_to_ls(active_chatid, msg_obj);
1205
+ socket.emit('new message', { message:message, chatid:active_chatid, msgID:msgID, aoru: agent_id });
1206
+ } else {
1207
+ /* get agent socket id */
1208
+ var to_sock_id = jQuery(".online_agent_"+message_type).attr('socket');
1209
+ tcx_append_message_to_ls(active_chatid, msg_obj);
1210
+ socket.emit('new admin message', { message:message, chatid:active_chatid, msgID:msgID, from: agent_id, from_socket:socket.id, to: message_type, to_socket:to_sock_id });
1211
+ }
1212
+ jQuery.event.trigger({type: "tcx_add_message_chatbox", message:message, msgID:msgID});
1213
+ }
1214
+ }
1215
+
1216
+ /**
1217
+ * Add a log to the chat box
1218
+ *
1219
+ * @param {string} message Log message string
1220
+ * @param {object} options Options for the message being added (fade, prepend)
1221
+ */
1222
+ function log (message, options) {
1223
+ var $el = jQuery('<li>').addClass('log').text(message);
1224
+ addMessageElement($el, options);
1225
+ }
1226
+
1227
+ /**
1228
+ * Add a log to the chat box
1229
+ *
1230
+ * @param {string} message Log message string
1231
+ * @param {int} id ID for the list item
1232
+ * @param {object} options Options for the message being added (fade, prepend)
1233
+ */
1234
+ function nc_log (message, id, options) {
1235
+ var $el = jQuery('<li id="'+id+'">').addClass('log').text(message);
1236
+ addMessageElement($el, options);
1237
+ }
1238
+
1239
+ /**
1240
+ * Build a url with paramaters
1241
+ *
1242
+ * @param {string} url The current URL
1243
+ * @param {object} parameters Object of key value pairs to be added
1244
+ * @return {string} URL with params attached
1245
+ */
1246
+ function nc_buildUrl(url, parameters){
1247
+ var qs = "";
1248
+ for(var key in parameters) {
1249
+ var value = parameters[key];
1250
+ qs += encodeURIComponent(key) + "=" + encodeURIComponent(value) + "&";
1251
+ }
1252
+ if (qs.length > 0){
1253
+ qs = qs.substring(0, qs.length-1); //chop off last "&"
1254
+ url = url + "?" + qs;
1255
+ }
1256
+ return url;
1257
+ }
1258
+
1259
+ /**
1260
+ * Handles uploading a file within the chat
1261
+ *
1262
+ * @param {file} fileToUpload The file to upload
1263
+ * @param {string} failedID The id of the div to show when upload fails
1264
+ * @param {string} successID The id of the div to show when upload succeeds
1265
+ * @param {string} uploadingID The id of the div to show when upload is in progress
1266
+ * @param {string} originalID The id of the div to show when upload final div to show after evething is complete
1267
+ */
1268
+ function wplcShareFile(fileToUpload, failedID, successID, uploadingID, originalID){
1269
+ if(fileToUpload == undefined || fileToUpload == false || fileToUpload == null){
1270
+ return;
1271
+ }
1272
+
1273
+ var formData = new FormData();
1274
+ formData.append('file', fileToUpload);
1275
+ formData.append('timestamp', Date.now());
1276
+ formData.append('_wpnonce', wplc_restapi_nonce);
1277
+ formData.append('cid', active_chatid);
1278
+ jQuery(uploadingID).show();
1279
+ jQuery(originalID).hide();
1280
+ jQuery(successID).hide();
1281
+ jQuery(failedID).hide();
1282
+
1283
+ var uploadUrl = '';
1284
+ uploadUrl = (typeof tcx_override_upload_url !== "undefined" && tcx_override_upload_url !== "") ? tcx_override_upload_url : uploadUrl;
1285
+
1286
+ if (fileToUpload.name.match(new RegExp('^.*\\.(' + config.allowed_upload_extensions + ')$','i'))) {
1287
+ //Files allowed - continue
1288
+ if(fileToUpload.size < 8000000){
1289
+ jQuery.ajax({
1290
+ url : uploadUrl,
1291
+ type : 'POST',
1292
+ data : formData,
1293
+ cache: false,
1294
+ processData: false,
1295
+ contentType: false,
1296
+ success : function(data) {
1297
+ if(parseInt(data) !== 0){
1298
+ jQuery(uploadingID).hide();
1299
+ jQuery(successID).show();
1300
+ setTimeout(function(){
1301
+ jQuery(successID).hide();
1302
+ jQuery(originalID).show();
1303
+ }, 2000);
1304
+
1305
+ //All good post the link to file
1306
+ var fileLinkUrl = false;
1307
+ if(!tcxIsJson(data)){
1308
+ //This is not a parsable JSON string
1309
+ if(typeof data !== "object"){
1310
+ fileLinkUrl = data;
1311
+ } else {
1312
+ if(typeof data.response !== "undefined"){
1313
+ //Our url is in response index
1314
+ fileLinkUrl = data.response;
1315
+ } else {
1316
+ fileLinkUrl = data;
1317
+ }
1318
+ }
1319
+
1320
+ } else {
1321
+ //This is a parsable JSON string which will now be converted into an object
1322
+ var dataPacket = JSON.parse(data);
1323
+ if(typeof dataPacket.response !== "undefined"){
1324
+ //Our url is in response index
1325
+ fileLinkUrl = dataPacket.response;
1326
+ } else {
1327
+ fileLinkUrl = data;
1328
+ }
1329
+ }
1330
+
1331
+ if(fileLinkUrl !== false){
1332
+ if(fileLinkUrl !== 'Security Violation - File unsafe'){
1333
+ var tag='link';
1334
+ addChatMessage({
1335
+ username: username,
1336
+ message: (tag + ":" + fileLinkUrl + ":" + tag)
1337
+ });
1338
+ socket.emit("new message", {message:(tag + ":" + fileLinkUrl + ":" + tag),chatid:active_chatid, aoru: agent_id});
1339
+
1340
+ var randomNum = Math.floor((Math.random() * 100) + 1);
1341
+ var msgID = Date.now()+randomNum;
1342
+
1343
+ jQuery.event.trigger({type: "tcx_add_message_chatbox", message: (tag + ":" + fileLinkUrl + ":" + tag), msg_id: msgID});
1344
+ jQuery.event.trigger({type: "tcx_send_message", message: (tag + ":" + fileLinkUrl + ":" + tag), msg_id: msgID});
1345
+ } else {
1346
+ alert('Security Violation: File Not Allowed.');
1347
+ }
1348
+ }
1349
+ }
1350
+ else{
1351
+ jQuery(uploadingID).hide();
1352
+ jQuery(failedID).show();
1353
+ setTimeout(function(){
1354
+ jQuery(failedID).hide();
1355
+ jQuery(originalID).show();
1356
+ }, 2000);
1357
+
1358
+ }
1359
+ },
1360
+ error : function (){
1361
+ jQuery(uploadingID).hide();
1362
+ jQuery(failedID).show();
1363
+ setTimeout(function(){
1364
+ jQuery(failedID).hide();
1365
+ jQuery(originalID).show();
1366
+ }, 2000);
1367
+
1368
+
1369
+ }
1370
+ });
1371
+ }else{
1372
+ alert("File limit is 4mb");
1373
+ jQuery(uploadingID).hide();
1374
+ jQuery(failedID).show();
1375
+ setTimeout(function(){
1376
+ jQuery(failedID).hide();
1377
+ jQuery(originalID).show();
1378
+ }, 2000);
1379
+ }
1380
+ } else{
1381
+ alert("File type not supported.");
1382
+ jQuery(uploadingID).hide();
1383
+ jQuery(failedID).show();
1384
+ setTimeout(function(){
1385
+ jQuery(failedID).hide();
1386
+ jQuery(originalID).show();
1387
+ }, 2000);
1388
+ }
1389
+ }
1390
+
1391
+ /**
1392
+ * Add a notice to the chat box
1393
+ *
1394
+ * @param {object} data Chat message data packet
1395
+ * @param {object} options Options for the message being added (fade, prepend)
1396
+ */
1397
+ var addNotice = function(data, options) {
1398
+ options = options || {};
1399
+ var new_item = "";
1400
+ if(options.is_admin){
1401
+ new_item += "<li class='message wplc-admin-notice wplc-color-bg-3 wplc-color-2 wplc-color-border-3' />";
1402
+ } else {
1403
+ new_item += "<li class='message wplc-user-notice wplc-color-bg-1 wplc-color-2 wplc-color-border-1' />";
1404
+ }
1405
+ var $messageBodyDiv = jQuery('<span class="noticeBody">').html(wplcFormatParser(data.message));
1406
+ var $messageDiv = jQuery(new_item).append($messageBodyDiv);
1407
+ addMessageElement($messageDiv, options);
1408
+ }
1409
+
1410
+ /**
1411
+ * Add a chat message to the chat box container
1412
+ *
1413
+ * @param {object} data The message data
1414
+ * @param {object} options The options for the message
1415
+ */
1416
+ function addChatMessage (data, options) {
1417
+ if (!!tcx_disable_add_message.value) {
1418
+ /* do nothing as this is being controlled by an integration */
1419
+ } else {
1420
+
1421
+ if(typeof data.type !=='undefined' && data.type === 'event'){
1422
+ return; //CRM EVENT >> Let's bail
1423
+ }
1424
+
1425
+ // Don't fade the message in if there is an 'X was typing'
1426
+ var $typingMessages = getTypingMessages(data);
1427
+ options = options || {};
1428
+ if ($typingMessages.length !== 0) {
1429
+ options.fade = false;
1430
+ $typingMessages.remove();
1431
+ }
1432
+ var new_item = "";
1433
+ if(data.aoru === 'u'){
1434
+ new_item += "<li class='message wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1 message_"+data.msgID+"' mid='"+data.msgID+"' />";
1435
+ } else {
1436
+ new_item += "<li class='message wplc-admin-message wplc-color-bg-3 wplc-color-2 wplc-color-border-3 message_"+data.msgID+"' mid='"+data.msgID+"' />";
1437
+ }
1438
+
1439
+
1440
+ if (typeof data.timestamp !== "undefined") {
1441
+ var tdate = new Date(parseInt(data.timestamp));
1442
+ var hours = tdate.getHours();
1443
+ var minutes = tdate.getMinutes();
1444
+ var ampm = hours >= 12 ? 'pm' : 'am';
1445
+ hours = hours % 12;
1446
+ hours = hours ? hours : 12; // the hour '0' should be '12'
1447
+ minutes = minutes < 10 ? '0'+minutes : minutes;
1448
+ var strTime = hours + ':' + minutes + ' ' + ampm;
1449
+ data.timestamp = strTime;
1450
+
1451
+ } else {
1452
+ data.timestamp = "";
1453
+ }
1454
+
1455
+ var $usernameDiv = jQuery('<span class="username"/>: ')
1456
+ .text(wplc_safe_html(data.username));
1457
+
1458
+ var $timeDiv = jQuery('<span class="timestamp"/>: ')
1459
+ .text(data.timestamp);
1460
+
1461
+ var $editDiv = jQuery('<span class=""/>: ').text('');
1462
+ var $messageBodyDiv = jQuery('<span class="messageBody">').html(wplcFormatParser(data.message));
1463
+
1464
+ if(data.aoru !== 'u'){
1465
+ var $messageReadBody = jQuery('<span class="messageReadReceipt" id="read_receipt_'+data.msgID+'">').html('Sent');
1466
+ } else {
1467
+ var $messageReadBody = '';
1468
+ }
1469
+
1470
+ var typingClass = data.typing ? 'typing' : '';
1471
+ var $is_typing_preview = data.typing ? jQuery("<span id='typing_preview'>") : '';
1472
+ var $messageDiv = jQuery(new_item)
1473
+ .data('username', wplc_safe_html(data.username))
1474
+ .addClass(typingClass)
1475
+ .append($usernameDiv, $timeDiv, $messageReadBody, $editDiv, $messageBodyDiv )
1476
+ .append(" ")
1477
+ .append($is_typing_preview);
1478
+
1479
+ addMessageElement($messageDiv, options);
1480
+ jQuery.event.trigger({type: "tcx_check_for_read_receipt_on_adding_message", ndata: data });
1481
+
1482
+ socket.emit('message read',data);
1483
+
1484
+ }
1485
+
1486
+ }
1487
+
1488
+ /**
1489
+ * Add is typing to chat box
1490
+ *
1491
+ * @param {object} data Data to check
1492
+ */
1493
+ function addChatTyping (data) {
1494
+ data.typing = true;
1495
+ data.message = 'is typing';
1496
+ addChatMessage(data);
1497
+ }
1498
+
1499
+ /**
1500
+ * Remove any remaining 'typing messages'
1501
+ *
1502
+ * @param {object} data Data to check
1503
+ */
1504
+ function removeChatTyping (data) {
1505
+ getTypingMessages(data).fadeOut(function () {
1506
+ jQuery(this).remove();
1507
+ });
1508
+ }
1509
+
1510
+ /**
1511
+ * Add a message elemtn to the document. Mostly used for events as WPLC will handle message appending
1512
+ *
1513
+ * @param {element} el The element to add to the chat box
1514
+ * @param {object} options Options for the message being added (fade, prepend)
1515
+ */
1516
+ function addMessageElement (el, options) {
1517
+ try{
1518
+ var $el = jQuery(el);
1519
+ // Setup default options
1520
+ if (!options) {
1521
+ options = {};
1522
+ }
1523
+ if (typeof options.fade === 'undefined') {
1524
+ options.fade = true;
1525
+ }
1526
+ if (typeof options.prepend === 'undefined') {
1527
+ options.prepend = false;
1528
+ }
1529
+
1530
+ // Apply options
1531
+ if (options.fade) {
1532
+ $el.hide().fadeIn(FADE_TIME);
1533
+ }
1534
+ if (options.prepend) {
1535
+ $messages.prepend($el);
1536
+ } else {
1537
+ $messages.append($el);
1538
+ }
1539
+ if(typeof $messages !== "undefined" && typeof $messages[0] !== "undefined" && typeof $messages[0].scrollHeight !== "undefined"){
1540
+ $messages[0].scrollTop = $messages[0].scrollHeight;
1541
+ }
1542
+ } catch (ex){
1543
+
1544
+ }
1545
+ }
1546
+
1547
+ /**
1548
+ * Update the typing statu on the socket
1549
+ */
1550
+ function updateTyping () {
1551
+ if (connected) {
1552
+ if (!niftyIsEditing) {
1553
+ if (!typing) {
1554
+ typing = true;
1555
+ if (message_type === 'u') {
1556
+ socket.emit('typing',{chatid:active_chatid});
1557
+ } else {
1558
+ socket.emit('typing',{chatid:active_chatid,agent:active_socket});
1559
+ }
1560
+
1561
+ }
1562
+ lastTypingTime = (new Date()).getTime();
1563
+
1564
+ setTimeout(function () {
1565
+ var typingTimer = (new Date()).getTime();
1566
+ var timeDiff = typingTimer - lastTypingTime;
1567
+ if (timeDiff >= TYPING_TIMER_LENGTH && typing) {
1568
+
1569
+ if (message_type === 'u') {
1570
+ socket.emit('stop typing',{chatid:active_chatid});
1571
+ } else {
1572
+ socket.emit('stop typing',{chatid:active_chatid,agent:active_socket});
1573
+ }
1574
+
1575
+ typing = false;
1576
+ }
1577
+ }, TYPING_TIMER_LENGTH);
1578
+ }
1579
+ }
1580
+ }
1581
+
1582
+ /**
1583
+ * Remove any remaining 'typing messages'
1584
+ *
1585
+ * @param {object} data Data to check
1586
+ */
1587
+ function getTypingMessages (data) {
1588
+ return jQuery('.typing.message').filter(function (i) {
1589
+ return jQuery(this).data('username') === data.username;
1590
+ });
1591
+ }
1592
+
1593
+
1594
+ /**
1595
+ * Add the agent
1596
+ *
1597
+ * @param {socket} socket The socket object
1598
+ * @param {object} data The agent data packet
1599
+ */
1600
+ var nc_add_agent = function(socket, data) {
1601
+ var data = {};
1602
+ /* recurring visitor */
1603
+ if (typeof nc_sid !== "undefined") {
1604
+ if (typeof nc_name !== "undefined") { data.username = nc_name; } else { data.username = 'Agent'; }
1605
+ data.api_key = nifty_api_key;
1606
+ data.sid = null;
1607
+ } else {
1608
+ /* first time user */
1609
+ data.username = tcx_agent_name;
1610
+ data.api_key = nifty_api_key;
1611
+ data.agent_id = agent_id;
1612
+ data.sid = null;
1613
+ }
1614
+ jQuery.event.trigger({type: "tcx_add_agent", ndata:data});
1615
+ }
1616
+
1617
+ /**
1618
+ * Get a specific cookie by name
1619
+ *
1620
+ * @param {string} name The name of the cookie
1621
+ * @return {string} The value of the cookie
1622
+ */
1623
+ function nc_getCookie(name) {
1624
+ var value = "; " + document.cookie;
1625
+ var parts = value.split("; " + name + "=");
1626
+ if (parts.length == 2) return parts.pop().split(";").shift();
1627
+ }
1628
+
1629
+ var tcx_random_offline_image_count = Math.floor((Math.random() * 9) + 1);
1630
+ /**
1631
+ * Show the no visitors image
1632
+ */
1633
+ function nc_no_visitors() {
1634
+ var random_img = "<img id='tcx_offline_image' src='" + wplc_baseurl + "/images/random_images/offline_images/" + tcx_random_offline_image_count + ".jpg' />";
1635
+
1636
+ jQuery("#active_count").html("0");
1637
+ jQuery(".nifty_bg_holder_text").html(random_img + "There are no visitors on your site at the moment");
1638
+ jQuery(".nifty_bg_holder").css('left','25%');
1639
+
1640
+ /* only fade in if were not chatting with an agent, or if we do not have a completed chat open */
1641
+ if (typeof active_chatid === "undefined") {
1642
+ jQuery(".nifty_bg_holder").fadeIn();
1643
+ }
1644
+
1645
+
1646
+
1647
+
1648
+ }
1649
+
1650
+ /**
1651
+ * Update the visitor counter
1652
+ *
1653
+ * @param {int} count The new visitor count
1654
+ */
1655
+ function nc_update_visitor_count(count) {
1656
+ if(typeof count === 'number'){
1657
+ jQuery("#active_count").html(count);
1658
+ } else {
1659
+ /** Wait a second and then count the elements for a more accurate count */
1660
+ setTimeout(function(){
1661
+ jQuery("#active_count").html(document.querySelectorAll('.visitorList').length);
1662
+ }, 1000);
1663
+ }
1664
+ }
1665
+
1666
+ /**
1667
+ * Add the accept chat button to the visitor row
1668
+ *
1669
+ * @param {string} chatid The Chat ID
1670
+ */
1671
+ function nc_add_accept_chat_visitor_row(chatid) {
1672
+ if(typeof tcx_io_is_origin !== "undefined" && tcx_io_is_origin === true){
1673
+ nc_add_open_chat_visitor_row(chatid);
1674
+ } else {
1675
+ if ( jQuery("#vis"+chatid+" .visActionCol .accept_chat").length === 0 ) {
1676
+ jQuery('<div/>', {
1677
+ 'class': '',
1678
+ html: "<a href='javascript:void(0);' class='accept_chat btn btn-danger pull-right' cid='"+chatid+"'>Accept Chat</a>"
1679
+ }).appendTo('#vis'+chatid+" .visActionCol");
1680
+ nc_remove_init_chat_visitor_row(chatid);
1681
+ }
1682
+ }
1683
+ }
1684
+
1685
+ /**
1686
+ * Add the open chat button to the visitor row
1687
+ *
1688
+ * @param {string} chatid The Chat ID
1689
+ */
1690
+ function nc_add_open_chat_visitor_row(chatid) {
1691
+ jQuery(".nifty_bg_holder_text").html("");
1692
+ jQuery(".nifty_bg_holder").fadeOut();
1693
+
1694
+ if ( jQuery(".open_chat_"+chatid).length > 0 ) { } else {
1695
+ jQuery('<div/>', {
1696
+ 'class': '',
1697
+ html: "<a href='javascript:void(0);' class='open_chat open_chat_"+chatid+" btn btn-success pull-right' cid='"+chatid+"'>Open Chat</a>"
1698
+ }).appendTo('#vis'+chatid + " .visActionCol");
1699
+ }
1700
+ }
1701
+ /**
1702
+ * Remove the open chat button from the visitor row
1703
+ *
1704
+ * @param {string} chatid The Chat ID
1705
+ */
1706
+ function nc_remove_open_chat_visitor_row(chatid) { jQuery("#vis"+chatid+" .open_chat").remove(); }
1707
+
1708
+ /**
1709
+ * Remove the accept chat button from the visitor row
1710
+ *
1711
+ * @param {string} chatid The Chat ID
1712
+ */
1713
+ function nc_remove_accept_chat_visitor_row(chatid) {
1714
+ jQuery("#vis"+chatid+" .accept_chat").remove();
1715
+ tcx_ring.pause();
1716
+ if(!isNaN(tcx_ring.duration)){
1717
+ tcx_ring.currentTime = 0;
1718
+ }
1719
+
1720
+ wplc_new_chat_ringer_dismissed = true;
1721
+ }
1722
+
1723
+ /**
1724
+ * Remove the init chat button from the visitor row
1725
+ *
1726
+ * @param {string} chatid The Chat ID
1727
+ */
1728
+ function nc_remove_init_chat_visitor_row(chatid) {
1729
+ jQuery("#vis"+chatid+" .init_chat").remove();
1730
+ jQuery.event.trigger({type: "tcx_remove_initiate_button", cid:chatid});
1731
+ }
1732
+
1733
+ /**
1734
+ * Clears the action column for the specific chat ID (visitor)
1735
+ *
1736
+ * @param {string} chatid The Chat ID
1737
+ */
1738
+ function nc_clear_action_col_visitor_row(chatid) {
1739
+ jQuery("#vis"+chatid+" .visActionCol").html('');
1740
+
1741
+ /**
1742
+ * TO DO
1743
+ * Check if there are any OTHER visitors that are wanting to chat (i.e. use jQuery to run through all buttons).
1744
+ * If there are still .accept_chat's present, then dont stop the tcx_ring.
1745
+ */
1746
+ tcx_ring.pause();
1747
+ if(!isNaN(tcx_ring.duration)){
1748
+ tcx_ring.currentTime = 0;
1749
+ }
1750
+ wplc_new_chat_ringer_dismissed = true;
1751
+
1752
+ }
1753
+
1754
+ /**
1755
+ * Add user to the user list
1756
+ *
1757
+ * @param {object} data The user data
1758
+ * @param {function} next Callback to fire after this has completed
1759
+ */
1760
+ function nc_add_user_to_list(data, next) {
1761
+ if (typeof data === "undefined")
1762
+ return;
1763
+
1764
+
1765
+ var date = new Date();
1766
+ var minute = date.getMinutes();
1767
+ var hour = date.getHours();
1768
+
1769
+ if(minute < 10){
1770
+ minute = '0' + minute;
1771
+ }
1772
+
1773
+ /* update the visitor table */
1774
+ jQuery("#vis"+data.chatid+" .session-state-label").html(tcx_pretty_chat_status(data.state));
1775
+
1776
+ nc_clear_action_col_visitor_row(data.chatid);
1777
+ nc_add_open_chat_visitor_row(data.chatid);
1778
+
1779
+ /* add to the userList */
1780
+ if (jQuery("#"+data.chatid).length) {
1781
+ nc_update_user_to_list(data);
1782
+ } else {
1783
+
1784
+ jQuery('<div/>', {
1785
+ id: data.chatid,
1786
+ 'class': 'userList',
1787
+ })
1788
+ .css('display','none')
1789
+ .attr('socket', data.socketid)
1790
+ .attr('customerID', data.customerID)
1791
+ .appendTo('.userListBox');
1792
+
1793
+ var t_em = typeof data.email !== "undefined" ? md5(data.email) : '';
1794
+
1795
+ jQuery('<img/>', {
1796
+ 'src' : 'https://www.gravatar.com/avatar/'+t_em+'?s=24&d=mm',
1797
+ 'class': 'tcx_userlist_gravatar tcx_userlist_gravatar_'+data.chatid
1798
+ }).appendTo('#'+data.chatid);
1799
+
1800
+ jQuery('<h3/>', {
1801
+ html: "<span class='userName'>"+wplc_safe_html( (typeof data.username !== "undefined" ? data.username : config.wplc_user_default_visitor_name) )+'</span>'
1802
+ }).appendTo('#'+data.chatid);
1803
+ jQuery('<span/>', {
1804
+ text: 'x',
1805
+ "class": 'tcx_close_item tcx_close_item_'+data.chatid,
1806
+ "cid": data.chatid
1807
+ }).appendTo('#'+data.chatid);
1808
+
1809
+ jQuery('<p/>', {
1810
+ text: hour + ":" + minute,
1811
+ "class" : "userInfo"
1812
+ }).appendTo('#'+data.chatid);
1813
+
1814
+ jQuery('<p/>', {
1815
+ text: "",
1816
+ "class" : "userItemLastMessage"
1817
+ })
1818
+ .css('display','block')
1819
+ .appendTo('#'+data.chatid);
1820
+
1821
+ jQuery('<p/>', {
1822
+ text: "",
1823
+ "class" : "unread_count"
1824
+ })
1825
+ .css('display','none')
1826
+ .appendTo('#'+data.chatid);
1827
+
1828
+ jQuery('<div/>', {
1829
+ text: "",
1830
+ "class" : "agents_involved"
1831
+ })
1832
+ .css('display','block')
1833
+ .appendTo('#'+data.chatid);
1834
+
1835
+ if (typeof tcx_departments !== "undefined") {
1836
+ if (typeof data.department !== 'undefined') {
1837
+ if (data.department !== 'any') {
1838
+ jQuery('<div/>', {
1839
+ text: (typeof data.department !== "undefined" ? tcx_departments[data.department] : tcx_default_department_tag),
1840
+ "class" : "department_assigned"
1841
+ })
1842
+ .css('display','block')
1843
+ .appendTo('#'+data.chatid);
1844
+ }
1845
+ }
1846
+ }
1847
+
1848
+ jQuery("#"+data.chatid).fadeIn("slow");
1849
+
1850
+ }
1851
+
1852
+ next(data);
1853
+ }
1854
+
1855
+ /**
1856
+ * Update a user in the user list
1857
+ *
1858
+ * @param {object} data The user data
1859
+ */
1860
+ function nc_update_user_to_list(data) {
1861
+ var date = new Date();
1862
+ var minute = date.getMinutes();
1863
+ var hour = date.getHours();
1864
+
1865
+ if(minute < 10){
1866
+ minute = '0' + minute;
1867
+ }
1868
+
1869
+
1870
+ jQuery("#"+data.chatid+ " .userList").attr("socket",data.socketid);
1871
+ jQuery("#"+data.chatid+ " .userInfo").html(hour + ":" + minute);
1872
+
1873
+ }
1874
+
1875
+ /**
1876
+ * Update a visitor in the visitor list
1877
+ *
1878
+ * @param {object} data The visitor data
1879
+ */
1880
+ function nc_update_visitor_to_list(data) {
1881
+ var date = new Date();
1882
+ var minute = date.getMinutes();
1883
+ var hour = date.getHours();
1884
+
1885
+ jQuery("#"+data.chatid+ " .visitorList").attr("socket",data.socketid);
1886
+ jQuery("#"+data.chatid+ " .visitorInfo").html(hour + ":" + minute);
1887
+ }
1888
+
1889
+ /**
1890
+ * Add visitor to the visitor list
1891
+ *
1892
+ * @param {object} data The visitor data
1893
+ */
1894
+ function nc_add_visitor_to_list(data) {
1895
+ jQuery(".nifty_bg_holder_text").html("");
1896
+ jQuery(".nifty_bg_holder").fadeOut();
1897
+ if (jQuery("#vis"+data.chatid).length) {
1898
+ nc_update_visitor_to_list(data);
1899
+ } else {
1900
+
1901
+ jQuery('<div/>', {
1902
+ id: "vis"+data.chatid,
1903
+ 'class': 'visitorList',
1904
+ })
1905
+ .css('display','none')
1906
+ .attr('socket', data.socketid)
1907
+ .appendTo('.visitorListBox');
1908
+
1909
+ jQuery('<div/>', {
1910
+ 'class': 'vcol visCol',
1911
+ html: "<span class='userName'>"+wplc_safe_html((typeof data.username !== "undefined" ? data.username : config.wplc_user_default_visitor_name))+"</span>"
1912
+ }).appendTo('#vis'+data.chatid);
1913
+
1914
+ jQuery('<div/>', {
1915
+ 'class': 'vcol visStatusCol',
1916
+ html: "<span class='info_chat' cid='"+data.chatid+"' >" + nc_return_browser_details(data) + " " + nc_return_location_details(data) + " " + nc_return_device_details(data) + tcx_return_visitor_os_data(data) + "</span>"
1917
+ }).appendTo('#vis'+data.chatid);
1918
+
1919
+ jQuery('<div/>', {
1920
+ 'class': 'vcol visPageCol',
1921
+ html: "<a href='"+wplc_safe_html(data.referer)+"' class='referer-link truncate' target='_BLANK'>"+wplc_safe_html(data.referer)+"</a>"+tcx_return_visitor_lifetime_data(data)+"<br/>"+tcx_return_visitor_timezone_data(data)+tcx_return_campaign_data(wplc_safe_html(data.referer))+"</em>"
1922
+ }).appendTo('#vis'+data.chatid);
1923
+
1924
+ jQuery('<div/>', {
1925
+ 'class': 'vcol visChatStatusCol',
1926
+ html: "<label class='label-default session-state-label'>" + tcx_pretty_chat_status(data.state) + "</label><div class='agents_involved_visitor'></div>"
1927
+ }).appendTo('#vis'+data.chatid);
1928
+
1929
+ if(typeof tcx_departments !== "undefined"){
1930
+ jQuery('<div/>', {
1931
+ 'class': 'vcol visChatDepCol',
1932
+ html: "<label class='label-default'>" + (typeof data.department !== "undefined" && typeof tcx_departments[ data.department ] !== "undefined" ? tcx_departments[ data.department ] : tcx_default_department_tag) + "</label>"
1933
+ }).appendTo('#vis'+data.chatid);
1934
+ }
1935
+
1936
+ jQuery('<div/>', {
1937
+ 'class': 'vcol visActionCol',
1938
+ html: ""
1939
+ }).appendTo('#vis'+data.chatid);
1940
+
1941
+ jQuery.event.trigger({type: "tcx_add_initiate_button_no_col", cid:data.chatid});
1942
+
1943
+ var show_based_on_filter = !tcx_hide_visitor_by_filter(data); //Set it to the oposite filter
1944
+ var show_based_on_domain_filter = !tcx_hide_visitor_by_domain_filter(data);
1945
+
1946
+
1947
+ if(show_based_on_filter && show_based_on_domain_filter){
1948
+ jQuery.event.trigger({type: "tcx_new_visitor", cid:data.chatid});
1949
+ jQuery("#vis"+data.chatid).fadeIn("slow");
1950
+ }
1951
+ }
1952
+ }
1953
+
1954
+ /**
1955
+ * Update the visitor list
1956
+ *
1957
+ * @param {object} data The visitor list object
1958
+ */
1959
+ function nc_update_visitor_to_list(data) {
1960
+ var date = new Date();
1961
+ var minute = date.getMinutes();
1962
+ var hour = date.getHours();
1963
+ jQuery("#vis"+data.chatid+ " .visitorList").attr("socket",data.socketid);
1964
+ jQuery("#vis"+data.chatid+ " .session-state-label").html(tcx_pretty_chat_status(data.state));
1965
+ jQuery("#vis"+data.chatid+ " .visPageCol").html("<a href='"+wplc_safe_html(data.referer)+"' class='referer-link truncate' target='_BLANK'>"+wplc_safe_html(data.referer)+"</a>"+tcx_return_visitor_lifetime_data(data)+"<br/>"+tcx_return_visitor_timezone_data(data)+tcx_return_campaign_data(wplc_safe_html(data.referer))+"</em>");
1966
+
1967
+ jQuery("#vis"+data.chatid+ " .visitorInfo").html(hour + ":" + minute);
1968
+
1969
+ if(typeof tcx_departments !== "undefined"){
1970
+ jQuery("#vis"+data.chatid+ " .visChatDepCol").html("<label class='label-default'>" + (typeof data.department !== "undefined" && typeof tcx_departments[ data.department ] !== "undefined" ? tcx_departments[ data.department ] : tcx_default_department_tag) + "</label>");
1971
+ }
1972
+
1973
+ var hide_based_on_filter = tcx_hide_visitor_by_filter(data); //Set it to the oposite filter
1974
+ var hide_based_on_domain_filter = tcx_hide_visitor_by_domain_filter(data); //Set it to the oposite filter
1975
+
1976
+ var accept_chat_present = false;
1977
+
1978
+ if (typeof data.state !== "undefined" && data.state === 'browsing' ) {
1979
+
1980
+ if ( jQuery("#vis"+data.chatid+" .visActionCol .accept_chat").length > 0 ) {
1981
+ accept_chat_present = true;
1982
+ }
1983
+
1984
+ if (accept_chat_present) {
1985
+ jQuery("#vis"+data.chatid+" .visActionCol").html('');
1986
+ nc_add_accept_chat_visitor_row(data.chatid);
1987
+ } else {
1988
+ tcx_ring.pause();
1989
+ if(!isNaN(tcx_ring.duration)){
1990
+ tcx_ring.currentTime = 0;
1991
+ }
1992
+ wplc_new_chat_ringer_dismissed = true;
1993
+
1994
+
1995
+ /* Add the INIT button if it is NOT there */
1996
+ if ( jQuery("#vis"+data.chatid+" .visActionCol .init_chat").length > 0 || jQuery("#vis"+data.chatid+" .visActionCol .wplc_initiate_chat").length > 0 ) { } else {
1997
+ jQuery("#vis"+data.chatid+" .visActionCol").html('');
1998
+ jQuery.event.trigger({type: "tcx_add_initiate_button_no_col", cid:data.chatid});
1999
+ }
2000
+ }
2001
+ }
2002
+
2003
+ var show_based_on_filter = !tcx_hide_visitor_by_filter(data); //Set it to the oposite filter
2004
+ var show_based_on_domain_filter = !tcx_hide_visitor_by_domain_filter(data);
2005
+
2006
+ if(show_based_on_filter && show_based_on_domain_filter){
2007
+ jQuery("#vis"+data.chatid).fadeIn("slow");
2008
+ } else {
2009
+ jQuery("#vis"+data.chatid).fadeOut("slow");
2010
+ }
2011
+ }
2012
+
2013
+ /**
2014
+ * Hide visitors based on a domain
2015
+ *
2016
+ * @param {object} data The visitor data package
2017
+ */
2018
+ function tcx_hide_visitor_by_domain_filter(data) {
2019
+ /* are we filtering domains? */
2020
+ var passed_domain = jQuery(".tcx_domain_selector").val();
2021
+
2022
+ var vis_id = data.chatid;
2023
+ if (typeof passed_domain !== 'undefined' && passed_domain !== undefined && passed_domain !== 'false') {
2024
+ if(typeof visitor_list !=='undefined' && typeof visitor_list[vis_id] !== 'undefined'){
2025
+ if(typeof visitor_list[vis_id]['referer'] !== 'undefined'){
2026
+ var ref = visitor_list[vis_id]['referer'];
2027
+ if(ref.indexOf(passed_domain) !== -1){
2028
+ return false;
2029
+ } else {
2030
+ return true;
2031
+ }
2032
+ } else {
2033
+ return true;
2034
+ }
2035
+ } else {
2036
+ return true;
2037
+ }
2038
+ } else {
2039
+ return false;
2040
+ }
2041
+ }
2042
+
2043
+ /**
2044
+ * Update the unread count for a specific chat ID
2045
+ *
2046
+ * @param {string} chatid The chat ID
2047
+ */
2048
+ function nc_update_unread_count(chatid) {
2049
+ if (typeof unread_count[chatid] === "undefined" || unread_count[chatid] < 1) {
2050
+ jQuery("#"+chatid+ " .unread_count").hide();
2051
+ } else {
2052
+ jQuery("#"+chatid+ " .unread_count").show();
2053
+ jQuery("#"+chatid+ " .unread_count").html(unread_count[chatid]);
2054
+ }
2055
+ tcx_check_if_all_read();
2056
+ }
2057
+
2058
+ /**
2059
+ * Check if all unread messages have been read
2060
+ */
2061
+ function tcx_check_if_all_read() {
2062
+ var tot_unread = 0;
2063
+ for (k in unread_count) {
2064
+ if (parseInt(unread_count[k]) > 0) {
2065
+ tot_unread = tot_unread + parseInt(unread_count[k]);
2066
+ }
2067
+ }
2068
+ if (tot_unread > 0) {
2069
+ tcx_change_favico(tcx_favico_noti);
2070
+ }
2071
+ }
2072
+
2073
+ /**
2074
+ * Update the last message from the visitor in the list
2075
+ *
2076
+ * @param {string} chatid The Chat ID
2077
+ * @param {object} message The message data packet
2078
+ * @param {bool} update_user_list Should we update the user list...
2079
+ */
2080
+ function nc_update_last_message(chatid, message, update_user_list) {
2081
+ if (typeof message.date !== "undefined") {
2082
+ var date = new Date(message.date);
2083
+ } else {
2084
+ var date = new Date();
2085
+ }
2086
+ var minute = date.getMinutes();
2087
+ var hour = date.getHours();
2088
+ jQuery("#"+chatid+ " .visitorInfo").html(hour + ":" + minute);
2089
+ jQuery("#vis"+chatid+" .session-state-label").html("active");
2090
+ jQuery("#"+chatid+ " .userItemLastMessage").html(wplcFormatParser(message.message));
2091
+ last_chat_messages[chatid] = message.message;
2092
+
2093
+ /* add this message to sessionStorage */
2094
+ tcx_append_message_to_ls(chatid, message);
2095
+
2096
+
2097
+ /* set this chat as active if it isnt already ... */
2098
+ if (update_user_list) {
2099
+ /* first check if this agent is involved in the chat, else do not add to the left chat list */
2100
+ if (typeof involved_list[chatid] !== "undefined" && involved_list[chatid] === true) {
2101
+ nc_add_user_to_list(visitor_list[chatid], function(data){
2102
+
2103
+ });
2104
+ }
2105
+ }
2106
+ }
2107
+
2108
+ /**
2109
+ * Test to make sure sessionStorage exists and is enabled
2110
+ *
2111
+ * @return {bool} True if session storage is available
2112
+ */
2113
+ function tcx_test_sessionStorage() {
2114
+ if (typeof sessionStorage !== 'undefined') {
2115
+ try {
2116
+ sessionStorage.setItem('tcx_test', 'yes');
2117
+ if (sessionStorage.getItem('tcx_test') === 'yes') {
2118
+ sessionStorage.removeItem('tcx_test');
2119
+ return true;
2120
+ // sessionStorage is enabled
2121
+ } else {
2122
+ return false;
2123
+ // sessionStorage is disabled
2124
+ }
2125
+ } catch(e) {
2126
+ return false;
2127
+ // sessionStorage is disabled
2128
+ }
2129
+ } else {
2130
+ return false;
2131
+ // sessionStorage is not available
2132
+ }
2133
+ }
2134
+
2135
+
2136
+ /**
2137
+ * Add a message to session storage
2138
+ *
2139
+ * @param {string} chatid The chat ID
2140
+ * @param {object} message_obj The message object
2141
+ */
2142
+ function tcx_add_message_to_sessionStorage(chatid, message_obj) {
2143
+ if (tcx_test_sessionStorage()) {
2144
+
2145
+ var wplc_d = new Date();
2146
+ var cdatetime = wplc_d.getTime();
2147
+
2148
+ if (sessionStorage.getItem(chatid+"_m") !== null) {
2149
+ var msg_obj = JSON.parse(sessionStorage.getItem(chatid+"_m"));
2150
+ msg_obj[cdatetime] = message_obj;
2151
+ sessionStorage.setItem(chatid+"_m", JSON.stringify(msg_obj));
2152
+
2153
+ } else {
2154
+ var msg_obj = {};
2155
+ msg_obj[cdatetime] = message_obj;
2156
+ sessionStorage.setItem(chatid+"_m", JSON.stringify(msg_obj));
2157
+ }
2158
+
2159
+ }
2160
+ }
2161
+
2162
+
2163
+
2164
+ /**
2165
+ * Remove all messages for specific chat from local storage
2166
+ *
2167
+ * @param {string} chatid The chat ID
2168
+ */
2169
+ function tcx_remove_chatid_from_ls(chatid) {
2170
+ if (tcx_test_sessionStorage()) {
2171
+ sessionStorage.removeItem(chatid+"_m");
2172
+ }
2173
+ }
2174
+
2175
+ /**
2176
+ * Add message to local storage
2177
+ *
2178
+ * @param {string} chatid The chat ID
2179
+ * @param {string} lmessage The message data object
2180
+ */
2181
+ function tcx_append_message_to_ls(chatid, lmessage) {
2182
+ if (tcx_test_sessionStorage()) {
2183
+
2184
+ var new_msg = {};
2185
+ if(typeof lmessage !== "undefined" && typeof lmessage.msgID !== "undefined"){
2186
+ new_msg.mid = lmessage.msgID.toString();
2187
+ }
2188
+ new_msg.originates = lmessage.aoru === "u" ? "2" : "1";
2189
+ new_msg.msg = lmessage.message;
2190
+ new_msg.other = {};
2191
+ if (new_msg.originates === "1") {
2192
+ if (typeof lmessage.aoru !== "undefined") {
2193
+ new_msg.other.aid = lmessage.aoru;
2194
+ }
2195
+ if (typeof lmessage.aid !== "undefined") {
2196
+ new_msg.other.aid = lmessage.aid;
2197
+ }
2198
+
2199
+ }
2200
+
2201
+ var wplc_d = new Date();
2202
+ new_msg.other.datetime = Math.round( wplc_d.getTime() / 1000 );
2203
+
2204
+ if (sessionStorage.getItem(chatid+"_m") !== null) {
2205
+ var msg_obj = JSON.parse(sessionStorage.getItem(chatid+"_m"));
2206
+ msg_obj[lmessage.msgID] = new_msg;
2207
+ sessionStorage.setItem(chatid+"_m", JSON.stringify(msg_obj));
2208
+
2209
+ } else {
2210
+ var msg_obj = {};
2211
+ msg_obj[lmessage.msgID] = new_msg;
2212
+ sessionStorage.setItem(chatid+"_m", JSON.stringify(msg_obj));
2213
+ }
2214
+ }
2215
+ }
2216
+
2217
+ /**
2218
+ * Creates a pretty-print date from a UNIX timestamp
2219
+ *
2220
+ * @param {date} UNIX_timestamp The UNIX timestamp
2221
+ * @return {string} Pretty printed date
2222
+ */
2223
+ function tcx_date_converter(UNIX_timestamp) {
2224
+ var a = new Date(UNIX_timestamp * 1000);
2225
+ var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
2226
+ var month = months[a.getMonth()];
2227
+ var date = a.getDate();
2228
+ var hour = a.getHours();
2229
+ var min = a.getMinutes() < 10 ? '0' + a.getMinutes() : a.getMinutes();
2230
+ var sec = sec = a.getSeconds() < 10 ? '0' + a.getSeconds() : a.getSeconds();
2231
+ var time = date + ' ' + month + ' ' + hour + ':' + min + ':' + sec ;
2232
+ return time;
2233
+ }
2234
+
2235
+ /**
2236
+ * Updates the user typing flag
2237
+ *
2238
+ * @param {string} chatid The chat ID
2239
+ */
2240
+ function nc_update_user_typing(chatid) {
2241
+ last_chat_messages[chatid] = jQuery("#vis"+chatid+ " .session-state-label").html();
2242
+ jQuery("#"+chatid+ " .userItemLastMessage").html('<label class="label-default session-state-label">'+wplc_admin_strings.typing_string+'</label>');
2243
+ }
2244
+
2245
+ /**
2246
+ * Removes the user typing content
2247
+ *
2248
+ * @param {string} chatid The chat ID
2249
+ */
2250
+ function nc_update_user_stop_typing(chatid) {
2251
+ if (typeof last_chat_messages[chatid] !== "undefined") {
2252
+ jQuery("#"+chatid+ " .userItemLastMessage").html(wplcFormatParser(last_chat_messages[chatid]));
2253
+ }
2254
+ }
2255
+
2256
+ /**
2257
+ * Get the visitors browser icon
2258
+ *
2259
+ * @param {object} data The visitor data packet
2260
+ * @return {string} HTML showing the browser icon
2261
+ */
2262
+ function nc_return_browser_details(data) {
2263
+ if (typeof data === "undefined") {
2264
+ return "";
2265
+ }
2266
+
2267
+ if (typeof data.browserName !== "undefined") { browserName = data.browserName; } else { browserName = "Unknown"; }
2268
+ if (typeof data.browserVersion !== "undefined") { browserVer = data.browserVersion; } else { browserVer = "Unknown"; }
2269
+
2270
+ origbrowserName = browserName;
2271
+ browserName = browserName.toLowerCase();
2272
+
2273
+ return "<img src='" + wplc_baseurl + "/images/browsers/"+browserName+"_16x16.png' alt='"+origbrowserName+" (v"+browserVer+")' title='"+origbrowserName+" (v"+browserVer+")' />";
2274
+ }
2275
+
2276
+ /**
2277
+ * Get the visitors location icon - (REQUIRE MAXIND TO BE ENABLED)
2278
+ *
2279
+ * @param {object} data The visitor packet data
2280
+ * @return {string} HTML showing the country flag
2281
+ */
2282
+ function nc_return_location_details(data){
2283
+ if(typeof data !== "undefined" && typeof data.location_info !== "undefined"){
2284
+ if (typeof data.location_info === 'string') {
2285
+ if (tcxIsJson(data.location_info)) {
2286
+ data.location_info = JSON.parse(data.location_info);
2287
+ } else {
2288
+ data.location_info = undefined;
2289
+ }
2290
+ }
2291
+ if(typeof data.location_info !== 'undefined' && typeof data.location_info.code !== "undefined"){
2292
+ var location_code = data.location_info.code;
2293
+ var location_name = (typeof data.location_info.name !== "undefined" ? data.location_info.name : "");
2294
+
2295
+ return "<img src='" + wplc_baseurl + "/images/flags/"+location_code.toLowerCase()+".png' alt='"+location_name+"' title='"+location_name+"' />";
2296
+ }
2297
+ }
2298
+
2299
+ return "";
2300
+ }
2301
+
2302
+ /**
2303
+ * Get the device image for this visitor
2304
+ *
2305
+ * @param {object} data The visitor packet data
2306
+ * @return {string} HTML of the image for the relevant device
2307
+ */
2308
+ function nc_return_device_details(data){
2309
+ if(typeof data !== "undefined" && typeof data.device_in_use !== "undefined"){
2310
+ var device_in_use = data.device_in_use;
2311
+ return "<img src='" + wplc_baseurl + "/images/devices/"+device_in_use+".png' alt='"+device_in_use+"' title='"+device_in_use.charAt(0).toUpperCase() + device_in_use.slice(1)+"' />";
2312
+ }
2313
+ return "";
2314
+ }
2315
+
2316
+
2317
+ /**
2318
+ * Adds the visitor that just left to a unique timer and then removes that user if they havent come back in x seconds
2319
+ *
2320
+ * @param {object} data The visitor data packet
2321
+ */
2322
+ function nc_remove_visitor_after_time(data) {
2323
+ // var visitor_timeout_seconds = 12000; /* one second less than the a2vping */
2324
+ // clearTimeout(remove_visitor_timer[data.chatid]);
2325
+
2326
+ // remove_visitor_timer[data.chatid] = setTimeout(function() {
2327
+ // //jQuery.event.trigger({type: "tcx_remove_visitor", ndata:data});
2328
+
2329
+ // clearTimeout(ping_list[data.socketid]);
2330
+ // },visitor_timeout_seconds);
2331
+
2332
+ }
2333
+
2334
+
2335
+ var tcx_update_agent_unread = function() {
2336
+
2337
+ }
2338
+
2339
+ /**
2340
+ * Check the latency of the connection
2341
+ */
2342
+ var tcx_latency_check = function() {
2343
+ pingpong_running = true;
2344
+ startTime = Date.now();
2345
+ socket.emit('ping');
2346
+
2347
+ latency_dead_check = setTimeout(function() {
2348
+ pingpong_running = false;
2349
+ jQuery(".tcx_stats").html(" [<em><span style='color:red'>Latency: You are offline.</span></em>] ");
2350
+ },3100);
2351
+ }
2352
+
2353
+
2354
+ /**
2355
+ * WPLC SOCKET delegate functions
2356
+ *
2357
+ * @return void
2358
+ */
2359
+ tcx_delegates = function() {
2360
+ // Socket events
2361
+ socket.on('connect', function(data) {
2362
+ connected = true;
2363
+ nc_add_agent(socket, data);
2364
+
2365
+ if (get_visitor_timer === undefined) {
2366
+ var get_visitor_timer = setInterval(function() {
2367
+ tcx_get_visitor_data();
2368
+ },5000);
2369
+ }
2370
+
2371
+ /**
2372
+ * Latency checks
2373
+ */
2374
+ if (pingpong_running === false) {
2375
+ tcx_latency_check();
2376
+ }
2377
+
2378
+ socket.emit('get online agents', {api_key:nifty_api_key});
2379
+
2380
+ jQuery.event.trigger({type: "tcx_agent_socket_connected", ndata:data});
2381
+
2382
+ /* are we running this on the CRM page? If yes, trigger the events */
2383
+ if (typeof tcx_crm_page !== "undefined" && tcx_crm_page === true) {
2384
+ jQuery.event.trigger({type: "tcx_crm_page_loaded", ndata:data});
2385
+ }
2386
+ /* are we running this on the CRM page? If yes, trigger the events */
2387
+ if (typeof tcx_contact_page !== "undefined" && tcx_contact_page === true) {
2388
+ jQuery.event.trigger({type: "tcx_contact_page_loaded", ndata:data});
2389
+ }
2390
+
2391
+ jQuery(".nifty_bg_holder_text").html("");
2392
+ jQuery(".nifty_bg_holder").fadeOut();
2393
+
2394
+ });
2395
+
2396
+ socket.on('pong', function() {
2397
+ clearTimeout(latency_dead_check);
2398
+
2399
+ latency = Date.now() - startTime;
2400
+ jQuery(".tcx_stats").html(" [<em>Latency: "+latency+"ms</em>] ");
2401
+
2402
+ setTimeout(function() {
2403
+ tcx_latency_check();
2404
+ },3000);
2405
+
2406
+ });
2407
+
2408
+
2409
+ socket.on('blip', function(data) {
2410
+ if (typeof blip_trigger !== "undefined") { blip_trigger(data,'before'); }
2411
+ });
2412
+ socket.on('blips', function(data) {
2413
+ if (typeof blip_sort_queue !== "undefined") { blip_sort_queue(data); }
2414
+ });
2415
+
2416
+ socket.on('a2vping returned', function(data) {
2417
+ if (typeof remove_visitor_timer[data.chatid] !== "undefined") {
2418
+ clearTimeout(remove_visitor_timer[data.chatid]);
2419
+
2420
+
2421
+ }
2422
+ clearTimeout(ping_list[data.fromsocket]);
2423
+ tcx_add_socket_to_ping(data.fromsocket, data.chatid);
2424
+ })
2425
+
2426
+ socket.on('is recording', function(data) {
2427
+ jQuery.event.trigger({type: "tcx_is_recording", ndata:data});
2428
+ });
2429
+
2430
+ socket.on('chat history', function(data) {
2431
+ /* TO DO - compare against sessionStorage */
2432
+ if (typeof data !== "undefined" && typeof data.history !== "undefined") {
2433
+ if (data.history.length > 0) {
2434
+ for (var i = 0, len = data.history.length; i < len; i++) {
2435
+ addChatMessage({username: wplc_safe_html(data.history[i].username), message: data.history[i].message, timestamp: data.history[i].date, msgID: data.history[i].id, aoru: data.history[i].aoru, type: data.history[i].type, read: data.history[i].read, chatid: data.chatid });
2436
+
2437
+ jQuery.event.trigger({type: "tcx_add_message_chatbox", message:data.history[i].message});
2438
+
2439
+ }
2440
+ nc_update_last_message(data.chatid,data.history[data.history.length-1], false);
2441
+ } else {
2442
+ log('No chat messages');
2443
+ }
2444
+ } else {
2445
+ log('No chat messages');
2446
+ }
2447
+ jQuery("#fetchinglog").remove();
2448
+
2449
+ });
2450
+
2451
+ socket.on('blacklisted', function(data) {
2452
+ jQuery.event.trigger({type: "tcx_blacklisted", ndata:data});
2453
+
2454
+ });
2455
+
2456
+ socket.on('online agents', function(data) {
2457
+ if (data !== null) {
2458
+ for (l in data) {
2459
+ if (data[l] !== nifty_my_socket) {
2460
+ information_received_pointer = 'online_agents';
2461
+ socket.emit('request information',{socketid: data[l]});
2462
+ }
2463
+ }
2464
+ }
2465
+ });
2466
+
2467
+ // Whenever the server emits 'login', log the login message
2468
+ socket.on('login', function (data) {
2469
+ connected = true;
2470
+ // Display the welcome message
2471
+ var message = "Connection established";
2472
+ log(message, {
2473
+ prepend: true
2474
+ });
2475
+ });
2476
+
2477
+ socket.on('request chat', function(data) {
2478
+ if(typeof data !== "undefined" && typeof data.data === 'undefined'){
2479
+ data.data = {};
2480
+ }
2481
+
2482
+ if (typeof data !== 'undefined' && typeof data.data !== 'undefined' && typeof data.data.name === "undefined") {
2483
+ data.data.name = config.wplc_user_default_visitor_name;
2484
+ }
2485
+ if (typeof data !== 'undefined' && typeof data.data !== 'undefined' && typeof data.data.email === "undefined") {
2486
+ data.data.email = "No Email";
2487
+ }
2488
+
2489
+ if(typeof visitor_list[data.chatid] === 'undefined'){
2490
+ visitor_list[data.chatid] = {};
2491
+ }
2492
+
2493
+ visitor_list[data.chatid].state = 'active';
2494
+ visitor_list[data.chatid].username = wplc_safe_html(data.data.name);
2495
+ visitor_list[data.chatid].email = wplc_safe_html(data.data.email);
2496
+ jQuery("#vis"+data.chatid+" .userName").html(wplc_safe_html(data.data.name));
2497
+ var orig_elm = jQuery("#vis"+data.chatid);
2498
+
2499
+ if(orig_elm.length == 0){
2500
+ tcx_get_visitor_data();
2501
+ }
2502
+
2503
+ jQuery("#vis"+data.chatid).remove();
2504
+ jQuery(orig_elm).prependTo(".visitorListBox");
2505
+ jQuery("#"+data.chatid+" .userName").html(wplc_safe_html(data.data.name));
2506
+ nc_add_accept_chat_visitor_row(data.chatid);
2507
+ jQuery.event.trigger({type: "tcx_new_chat", ndata:data});
2508
+ })
2509
+
2510
+ socket.on('get information', function(data) {
2511
+ /* we have a request to send information to the server */
2512
+
2513
+ var info_obj = {};
2514
+ info_obj.username = tcx_agent_name;
2515
+ info_obj.agent_id = agent_id;
2516
+ socket.emit('send information', { intended_socket:data.socketid, data: info_obj });
2517
+
2518
+ })
2519
+
2520
+ socket.on('transferring chat', function (data) {
2521
+ if (typeof data.chatid !== "undefined") {
2522
+
2523
+ var message = '<h2>'+data.from_agent+' has invited you to a chat!</h2>';
2524
+
2525
+ niftyShowDialog("Incoming Chat Invite", message, 'Accept', 'Reject', function() {
2526
+ /* accept */
2527
+ socket.emit('accept transfer', {socketid:data.socketid,chatid:data.chatid,from_agent:tcx_agent_name})
2528
+ /* add the user to the active chats */
2529
+ nc_add_user_to_list(visitor_list[data.chatid], function(data){
2530
+ /* open the chat */
2531
+ jQuery("#"+data.chatid).click();
2532
+ setTimeout(function(){
2533
+ jQuery('#nifty_join_chat_button').click();
2534
+ }, 500);
2535
+ });
2536
+ }, function() {
2537
+ /* reject */
2538
+ socket.emit('reject transfer', {socketid:data.socketid,chatid:data.chatid,from_agent:tcx_agent_name})
2539
+
2540
+ });
2541
+ }
2542
+ })
2543
+
2544
+
2545
+ socket.on('transferring chat department', function (data) {
2546
+ if (typeof data.chatid !== "undefined" && typeof data.department !== "undefined") {
2547
+ if(data.department === tcx_agent_department){
2548
+ //This agent is a part of the desired department
2549
+ var message = '<h2>Chat invite for your department!</h2>';
2550
+
2551
+ niftyShowDialog("Incoming Department Invite", message, 'Accept', 'Reject', function() {
2552
+ /* accept */
2553
+ socket.emit('accept department transfer', {socketid:data.socketid,chatid:data.chatid,from_agent:tcx_agent_name})
2554
+ /* add the user to the active chats */
2555
+ nc_add_user_to_list(visitor_list[data.chatid], function(data){
2556
+ /* open the chat */
2557
+ jQuery("#"+data.chatid).click();
2558
+ });
2559
+ }, function() {
2560
+ /* reject */
2561
+ socket.emit('reject department transfer', {socketid:data.socketid,chatid:data.chatid,from_agent:tcx_agent_name})
2562
+
2563
+ });
2564
+ }
2565
+ }
2566
+ })
2567
+
2568
+ socket.on('username changed', function(data) {
2569
+ jQuery.event.trigger({type: "tcx_username_changes", ndata:data});
2570
+ });
2571
+
2572
+ socket.on('email changed', function(data) {
2573
+ jQuery.event.trigger({type: "tcx_email_changes", ndata:data});
2574
+ });
2575
+
2576
+
2577
+ socket.on('new admin message', function (data) {
2578
+ nc_update_last_message(data.chatid,data,false);
2579
+ jQuery("#"+data.chatid).addClass('newmessage');
2580
+
2581
+ if (active_chatid === data.chatid) {
2582
+ addChatMessage(data);
2583
+ data.other = {};
2584
+ data.other.aid = data.aid;
2585
+ data.aoru = data.aid;
2586
+ data.other.from_an_agent = true;
2587
+ jQuery.event.trigger({type: "tcx_add_message_chatbox", message:data});
2588
+ jQuery.event.trigger({type:'tcx_stop_typing', ndata: data, chatid: data.chatid});
2589
+
2590
+ } else {
2591
+ if (typeof unread_count[data.chatid] === "undefined") { unread_count[data.chatid] = 1; }
2592
+ else { unread_count[data.chatid] = unread_count[data.chatid] + 1; }
2593
+
2594
+ tcx_notify_new_message(data.chatid);
2595
+ }
2596
+
2597
+ nc_update_user_stop_typing(data.chatid);
2598
+ });
2599
+
2600
+ socket.on('message read received', function(data) {
2601
+ jQuery.event.trigger({type: "tcx_message_read_received", ndata:data});
2602
+ });
2603
+
2604
+
2605
+ // Whenever the server emits 'new message', update the chat body
2606
+ socket.on('new message', function (data) {
2607
+ if (typeof visitor_list[data.chatid] === "undefined") {
2608
+ // the agent possibly ended the chat but the user sent another message, re-add this user obj into the visitor_list array
2609
+ visitor_list[data.chatid] = data.user_obj;
2610
+ }
2611
+
2612
+ visitor_list[data.chatid].state = 'active';
2613
+
2614
+ /* remove the visitor timeout - perhaps this visitor just moved to a different page, if that is the case we dont want the agent to think that they have left us. if they have left though, they will timeout after x seconds - we are just canceling that timeout here. */
2615
+ if (typeof remove_visitor_timer[data.chatid] !== "undefined") {
2616
+ clearTimeout(remove_visitor_timer[data.chatid])
2617
+ }
2618
+
2619
+ nc_remove_init_chat_visitor_row(data.chatid);
2620
+ nc_add_open_chat_visitor_row(data.chatid);
2621
+
2622
+ /**
2623
+ * Clear the typing preview for this specific chat ID
2624
+ */
2625
+ jQuery.event.trigger({type: "tcx_clear_typing_preview", cid: data.chatid});
2626
+ jQuery.event.trigger({type: "tcx_new_message_for_cid", cid: data.chatid});
2627
+
2628
+
2629
+ nc_update_last_message(data.chatid,data,false);
2630
+
2631
+
2632
+ jQuery("#"+data.chatid).addClass('newmessage');
2633
+ tcx_notify_new_message(data.chatid);
2634
+
2635
+ if (typeof involved_list[data.chatid] !== "undefined") {
2636
+ if (active_chatid === data.chatid) {
2637
+ addChatMessage(data);
2638
+ jQuery.event.trigger({type: "tcx_add_message_chatbox", message:data});
2639
+ // let the server know we have 'read' the message
2640
+ socket.emit('message read',data);
2641
+ } else {
2642
+ if (typeof unread_count[data.chatid] === "undefined") { unread_count[data.chatid] = 1; }
2643
+ else { unread_count[data.chatid] = unread_count[data.chatid] + 1; }
2644
+ nc_update_unread_count(data.chatid);
2645
+ tcx_change_favico(tcx_favico_noti);
2646
+ }
2647
+ }
2648
+
2649
+ jQuery.event.trigger({type: "tcx_new_message_extender", message:data});
2650
+ });
2651
+
2652
+ socket.on('chat ended', function(data) {
2653
+ var tmp_chatid_close = data.chatid;
2654
+
2655
+ involved_list[tmp_chatid_close] = false;
2656
+ jQuery.event.trigger({type: "tcx_chat_ended_by_other_agent", ndata:data});
2657
+
2658
+ if (active_chatid === data.chatid) {
2659
+ /* current agent was also chatting and had the window active */
2660
+ /* disable the input field and simulate a user disconnect */
2661
+ active_chatid = undefined;
2662
+ }
2663
+
2664
+ jQuery("#"+tmp_chatid_close).removeClass('active');
2665
+ jQuery("#"+tmp_chatid_close).addClass('inactive');
2666
+ jQuery(".tcx_close_item_"+tmp_chatid_close).show();
2667
+
2668
+ nifty_chat_remove_agent_involved(tmp_chatid_close, agent_id);
2669
+
2670
+ if(typeof visitor_list[tmp_chatid_close] === 'undefined'){
2671
+ visitor_list[tmp_chatid_close] = {};
2672
+ }
2673
+
2674
+ visitor_list[tmp_chatid_close].state = 'browsing';
2675
+ visitor_list[tmp_chatid_close].involved = undefined;
2676
+ jQuery.event.trigger({type: "tcx_add_initiate_button_no_col", cid:tmp_chatid_close});
2677
+
2678
+
2679
+ });
2680
+
2681
+
2682
+ // Whenever the server emits 'new message', update the chat body
2683
+ socket.on('socketid', function (socketid) {
2684
+ nifty_my_socket = socketid.socketid;
2685
+ document.cookie = "nc_sid="+socketid.socketid;
2686
+ jQuery.event.trigger({type: "tcx_socketid_received", ndata:{socketid:socketid.socketid,instanceid:socketid.instanceid}});
2687
+ });
2688
+
2689
+ socket.on('limited', function (socketinfo) {
2690
+ if (typeof socketinfo !== "undefined" && typeof socketinfo.limited !== "undefined") {
2691
+ tcx_limited = socketinfo.limited;
2692
+ jQuery.event.trigger({ type: "tcx_limited", ndata:{limited:socketinfo.limited} });
2693
+ }
2694
+ });
2695
+
2696
+ socket.on('invalid_agent', function (socketinfo) {
2697
+ jQuery.event.trigger({ type: "tcx_invalid_agent", socketdata: socketinfo });
2698
+ });
2699
+
2700
+ socket.on('visitor list', function(data) {
2701
+ if (typeof data === "undefined" || data === null || (typeof data === "object" && data.total_visitors === 0 )) {
2702
+ nc_no_visitors();
2703
+ return;
2704
+ }
2705
+
2706
+ if (data !== null) {
2707
+ if (typeof data !== "undefined" && typeof data.visitor_list !== "undefined") {
2708
+ // run through the visitor list and identify if we are actually ONLINE for this domain
2709
+ data.visitor_list = tcx_update_visitor_data_list_per_online(data.visitor_list);
2710
+
2711
+ if (typeof data.total_visitors !== "undefined") {
2712
+ nc_update_visitor_count(data.total_visitors);
2713
+ }
2714
+
2715
+ jQuery('.visitorList').addClass('wplcVisPendingDelete');
2716
+
2717
+ for (k in data.visitor_list) {
2718
+ visitor_list[data.visitor_list[k].chatid] = data.visitor_list[k];
2719
+
2720
+ if (typeof data.visitor_list[k].chatid !== 'undefined') {
2721
+ if (typeof visitor_validator[data.visitor_list[k].chatid] !== 'undefined') {
2722
+ clearInterval(visitor_validator[data.visitor_list[k].chatid]);
2723
+ }
2724
+ var tmp_cid = data.visitor_list[k].chatid;
2725
+ visitor_validator[data.visitor_list[k].chatid] = setInterval(function() {
2726
+ socket.emit('validate visitor', {chatid: tmp_cid});
2727
+ }, 35000);
2728
+ }
2729
+
2730
+ jQuery("#vis"+data.visitor_list[k].chatid).removeClass('wplcVisPendingDelete');
2731
+
2732
+ nc_add_visitor_to_list(data.visitor_list[k]);
2733
+ if (data.visitor_list[k].state === "active") {
2734
+
2735
+ jQuery("#vis"+data.visitor_list[k].chatid+ " .agents_involved_visitor").html('');
2736
+ if (typeof data.visitor_list[k].involved !== "undefined" && data.visitor_list[k].state !== "browsing") {
2737
+ if (data.visitor_list[k].involved.length > 0) {
2738
+ /* set involved to FALSE as default */
2739
+ involved_list[data.visitor_list[k].chatid] = false;
2740
+
2741
+ for (l in data.visitor_list[k].involved) {
2742
+
2743
+ nifty_chat_add_agent_involved_visitor_list(data.visitor_list[k].chatid, data.visitor_list[k].involved[l]);
2744
+
2745
+ if (parseInt(data.visitor_list[k].involved[l]) === parseInt(agent_id)) {
2746
+ /* this is the current agent, add it to their local variable */
2747
+ nc_add_user_to_list(data.visitor_list[k], function(ret_data) {
2748
+ for (q in data.visitor_list[k].involved) {
2749
+ nifty_chat_add_agent_involved(data.visitor_list[k].chatid, data.visitor_list[k].involved[q]);
2750
+ }
2751
+ });
2752
+ involved_list[data.visitor_list[k].chatid] = true;
2753
+ } else {
2754
+
2755
+ }
2756
+
2757
+ }
2758
+ nc_clear_action_col_visitor_row(data.visitor_list[k].chatid);
2759
+ nc_add_open_chat_visitor_row(data.visitor_list[k].chatid);
2760
+
2761
+ } else {
2762
+ nc_add_accept_chat_visitor_row(data.visitor_list[k].chatid);
2763
+ }
2764
+ }
2765
+
2766
+
2767
+ } else {
2768
+ /* visitor is browsing */
2769
+ jQuery("#vis"+data.visitor_list[k].chatid+" .init_chat").show();
2770
+
2771
+ }
2772
+ }
2773
+ jQuery('.wplcVisPendingDelete').remove(); // removes unlisted visitors from UI
2774
+ } else {
2775
+ nc_no_visitors();
2776
+ }
2777
+ }
2778
+
2779
+ jQuery.event.trigger({type: "tcx_after_update_visitor_list"});
2780
+
2781
+ });
2782
+
2783
+ socket.on('new visitor', function(data) {
2784
+ var istrack_elm = document.getElementById('tcx-no-tracking');
2785
+ if (typeof(istrack_elm) != 'undefined' && istrack_elm != null) {
2786
+ istrack_elm.parentNode.removeChild(istrack_elm);
2787
+ }
2788
+
2789
+ if (typeof visitor_validator[data.chatid] !== 'undefined') {
2790
+ clearInterval(visitor_validator[data.chatid]);
2791
+ }
2792
+ visitor_validator[data.chatid] = setInterval(function() {
2793
+ socket.emit('validate visitor', {chatid: data.chatid});
2794
+ }, 35000);
2795
+
2796
+ if (tcx_check_visitor_as_per_online(data)) {
2797
+ // this visitor matches a domain from a domain that we have set to ONLINE
2798
+ visitor_list[data.chatid] = data;
2799
+ var current_visitor_socketid = jQuery("#"+data.chatid).attr('socket');
2800
+
2801
+ nc_update_visitor_count(data.total_visitors);
2802
+ nc_add_visitor_to_list(data);
2803
+
2804
+ /* was this chat open and active with an agent? if yes, update the agent as to what page the user is now browsing */
2805
+ if (typeof data.state !== "undefined" && data.state === "active") {
2806
+ jQuery("#"+data.chatid).removeClass('inactive');
2807
+ jQuery("#"+data.chatid).addClass('active');
2808
+
2809
+ if (data.chatid === active_chatid) {
2810
+ jQuery(".chatInfoArea-Info1").html("from: <a href='"+wplc_safe_html(visitor_list[active_chatid].referer)+"' target='_BLANK'>"+tcx_string_limiter(wplc_safe_html(visitor_list[active_chatid].referer),45)+"</a>");
2811
+
2812
+ }
2813
+
2814
+ jQuery("#vis"+data.chatid+" .init_chat").hide();
2815
+ }
2816
+
2817
+ /* remove the visitor timeout - perhaps this visitor just moved to a different page, if that is the case we dont want the agent to think that they have left us. if they have left though, they will timeout after x seconds - we are just canceling that timeout here. */
2818
+ if (typeof remove_visitor_timer[data.chatid] !== "undefined") {
2819
+ clearTimeout(remove_visitor_timer[data.chatid])
2820
+ }
2821
+
2822
+ jQuery.event.trigger({type: "tcx_after_update_visitor_list"});
2823
+
2824
+ }
2825
+
2826
+ });
2827
+
2828
+ socket.on('new chat', function(data) {
2829
+
2830
+ if(typeof data !== 'undefined' && typeof data.data === "undefined"){
2831
+ data.data = {};
2832
+ }
2833
+
2834
+ if(typeof data !== 'undefined' && typeof data.data !== 'undefined' && typeof data.data.name === "undefined") {
2835
+ data.data.name = config.wplc_user_default_visitor_name;
2836
+ }
2837
+
2838
+ if(typeof data !== 'undefined' && typeof data.data !== 'undefined' && typeof data.data.email === "undefined") {
2839
+ data.data.email = "No Email";
2840
+ }
2841
+
2842
+ visitor_list[data.chatid].state = 'active';
2843
+ visitor_list[data.chatid].username = wplc_safe_html(data.data.name);
2844
+ visitor_list[data.chatid].email = wplc_safe_html(data.data.email);
2845
+ jQuery("#vis"+data.chatid+" .userName").html(wplc_safe_html(data.data.name));
2846
+ jQuery("#"+data.chatid+" .userName").html(wplc_safe_html(data.data.name));
2847
+ nc_add_accept_chat_visitor_row(data.chatid);
2848
+ jQuery.event.trigger({type: "tcx_new_chat", ndata:data});
2849
+
2850
+ });
2851
+
2852
+ socket.on('visitor left', function(data) {
2853
+ if (typeof visitor_validator[data.chatid] !== 'undefined') {
2854
+ clearInterval(visitor_validator[data.chatid]);
2855
+ delete visitor_validator[data.chatid];
2856
+ }
2857
+ jQuery.event.trigger({type: "tcx_remove_visitor", ndata:data});
2858
+ nc_update_visitor_count(false);
2859
+ });
2860
+
2861
+ socket.on('agent joined', function (data) {
2862
+ jQuery.event.trigger({type: "tcx_agent_joined", ndata:data});
2863
+ data.apikey = nifty_api_key;
2864
+ });
2865
+
2866
+ socket.on('custom data received', function (data) {
2867
+ jQuery.event.trigger({type: "tcx_custom_data_received", ndata:data});
2868
+ });
2869
+
2870
+ /**
2871
+ * This tells us when the user has received the intiate chat request
2872
+ *
2873
+ * We can now send custom data (like the agent header data) to the user
2874
+ *
2875
+ * @return void
2876
+ */
2877
+ socket.on('initiate received admin', function (data) {
2878
+ if(current_init_attempt_id === data.chatid){
2879
+ jQuery.event.trigger({type: "tcx_add_agent", ndata:{chatid:data.chatid, agent:agent_id}});
2880
+ jQuery.event.trigger({type: "tcx_notify_agent_initiate_received", ndata:{chatid:data.chatid, agent:agent_id}});
2881
+ current_init_attempt_id = false;
2882
+ }
2883
+ });
2884
+
2885
+
2886
+ socket.on('agent connected', function(data) {
2887
+ var t_c_aid = data.aid;
2888
+ var t_c_sid = data.socketid;
2889
+ jQuery(".online_agent_"+t_c_aid).attr('socket',t_c_sid);
2890
+ jQuery(".online_agent_"+t_c_aid+ ' .online_offline').removeClass('offline');
2891
+ jQuery(".online_agent_"+t_c_aid+ ' .online_offline').addClass('online');
2892
+
2893
+ jQuery.event.trigger({type: "tcx_agent_connected", ndata: data});
2894
+ });
2895
+
2896
+
2897
+ socket.on('agent disconnected', function(data) {
2898
+ var t_c_aid = data.aid;
2899
+ jQuery(".online_agent_"+t_c_aid).attr('socket',null);
2900
+ jQuery(".online_agent_"+t_c_aid+ ' .online_offline').removeClass('online');
2901
+ jQuery(".online_agent_"+t_c_aid+ ' .online_offline').addClass('offline');
2902
+
2903
+ jQuery.event.trigger({type: "tcx_agent_disconnected", ndata: data});
2904
+ });
2905
+
2906
+ socket.on('agent involved', function (data) {
2907
+ nifty_chat_add_agent_involved(data.chatid, data.agentid);
2908
+ nifty_chat_add_agent_involved_visitor_list(data.chatid, data.agentid);
2909
+ nc_clear_action_col_visitor_row(data.chatid);
2910
+ nc_add_open_chat_visitor_row(data.chatid);
2911
+ });
2912
+
2913
+ socket.on('information received', function(data) {
2914
+ if (!information_received_pointer) {
2915
+ /* default */
2916
+ } else if (information_received_pointer === "transfer") {
2917
+ t_ag_sock = data.from_socket;
2918
+ t_ag_name = data.username;
2919
+ t_ag_id = data.agent_id;
2920
+
2921
+ var check_all_agents = all_agents;