WP Live Chat Support - Version 8.0.27

Version Description

It is highly recommended that you upgrade to WP Live Chat Support version 8.0.27 for performance reasons. If you have the PRO addon installed please remove it prior updating.

Download this release

Release Info

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

Code changes from version 8.0.26 to 8.0.27

Files changed (141) hide show
  1. ajax_new.php → ajax.php +449 -458
  2. apache-ci.conf +0 -11
  3. config.php +14 -1
  4. css/ace.min.css +1 -0
  5. css/admin-chat-box-style.min.css +1 -0
  6. css/admin-chat-style.min.css +1 -0
  7. css/admin_styles.min.css +1 -0
  8. css/chat-style.min.css +1 -0
  9. css/chat_styles_pro.css +374 -0
  10. css/chat_styles_pro.min.css +1 -0
  11. css/cta_animations/bounce.css +28 -0
  12. css/cta_animations/bounce.min.css +1 -0
  13. css/cta_animations/pop.css +28 -0
  14. css/cta_animations/pop.min.css +1 -0
  15. css/cta_animations/ripple.css +37 -0
  16. css/cta_animations/ripple.min.css +1 -0
  17. css/font-awesome.min.css +1 -2334
  18. css/fontawesome-iconpicker.min.css +9 -0
  19. css/jquery-ui.min.css +5 -0
  20. css/node_history_styles.min.css +1 -0
  21. css/remote_dash_styles.css +2 -2
  22. css/remote_dash_styles.min.css +1 -0
  23. css/support-css.min.css +1 -0
  24. css/switchery.min.css +1 -0
  25. css/themes/classic.css +1 -5
  26. css/themes/classic.min.css +1 -0
  27. css/themes/modern.css +2 -130
  28. css/themes/modern.min.css +1 -0
  29. css/themes/position-bottom-left.min.css +1 -0
  30. css/themes/position-bottom-right.min.css +1 -0
  31. css/themes/position-left.min.css +1 -0
  32. css/themes/position-right.min.css +1 -0
  33. css/themes/theme-1.min.css +1 -0
  34. css/themes/theme-2.min.css +1 -0
  35. css/themes/theme-3.min.css +1 -0
  36. css/themes/theme-4.min.css +1 -0
  37. css/themes/theme-5.min.css +1 -0
  38. css/themes/theme-default.min.css +1 -0
  39. css/toastr.min.css +1 -0
  40. css/voice_note_admin.css +155 -0
  41. css/voice_note_admin.min.css +1 -0
  42. css/voice_notes_user.css +100 -0
  43. css/voice_notes_user.min.css +1 -0
  44. css/wplc-survey-style-before.min.css +1 -0
  45. css/wplc-survey-style.min.css +1 -0
  46. css/wplc_gif_integration.min.css +1 -0
  47. css/wplc_gutenberg_template_styles.min.css +1 -0
  48. css/wplc_styles_admin_pro.css +87 -0
  49. css/wplc_styles_admin_pro.min.css +1 -0
  50. css/wplc_styles_pro.css +8 -0
  51. css/wplc_styles_pro.min.css +1 -0
  52. css/wplcstyle.min.css +1 -0
  53. css/wplcstyle_old.css +0 -352
  54. functions.php +3610 -483
  55. images/comment.gif +0 -0
  56. images/comment.svg +1 -0
  57. images/default_icon_1.png +0 -0
  58. images/default_icon_2.png +0 -0
  59. images/default_icon_3.png +0 -0
  60. images/logo-for-chat-box.jpg +0 -0
  61. images/picture-for-chat-box.jpg +0 -0
  62. images/social/facebook.png +0 -0
  63. images/social/linkedin.png +0 -0
  64. images/social/twitter.png +0 -0
  65. images/social/website.png +0 -0
  66. images/themes/sola-t-layout-1.png +0 -0
  67. includes/aes_fast.php +706 -0
  68. includes/blocks/wplc-chat-box/editor.min.css +1 -0
  69. includes/blocks/wplc-chat-box/style.min.css +1 -0
  70. includes/blocks/wplc-chat-box/wplc_gutenberg_template_styles.min.css +1 -0
  71. includes/blocks/wplc-inline-chat-box/editor.min.css +1 -0
  72. includes/blocks/wplc-inline-chat-box/style.min.css +0 -0
  73. includes/credits.php +0 -91
  74. includes/cryptoHelpers.php +100 -0
  75. includes/css/wplc_trigger_styles .min.css +1 -0
  76. includes/css/wplc_trigger_styles.css +31 -0
  77. includes/dashboard_page.php +0 -3
  78. includes/deprecated.php +0 -433
  79. includes/documentation_suggestions.php +151 -0
  80. includes/js/wplc_admin_roi_reporting.js +153 -0
  81. includes/js/wplc_user_triggers.js +75 -0
  82. includes/settings_page.php +675 -285
  83. includes/shortcodes.php +28 -28
  84. includes/sounds/Air_Plane_Ding.mp3 +0 -0
  85. includes/sounds/Doorbell.mp3 +0 -0
  86. includes/sounds/Drop_Metal_Thing.mp3 +0 -0
  87. includes/sounds/Elevator_Ding.mp3 +0 -0
  88. includes/sounds/Mario_Jumping.mp3 +0 -0
  89. includes/sounds/Music_Box.mp3 +0 -0
  90. includes/sounds/Pin_Dropping.mp3 +0 -0
  91. includes/sounds/Ringing_Phone.mp3 +0 -0
  92. includes/sounds/Robot_Blip.mp3 +0 -0
  93. includes/sounds/Rooster.mp3 +0 -0
  94. includes/sounds/Ship_Bell.mp3 +0 -0
  95. includes/sounds/Store_Door_Chime.mp3 +0 -0
  96. includes/sounds/Two_Tone_Doorbell.mp3 +0 -0
  97. beep-2.mp3 → includes/sounds/general/beep-2.mp3 +0 -0
  98. ding.mp3 → includes/sounds/general/ding.mp3 +0 -0
  99. ring.wav → includes/sounds/general/ring.wav +0 -0
  100. includes/sounds/message/Open_Ended.mp3 +0 -0
  101. includes/surveys.php +2 -15
  102. includes/templates/documentation-suggestion-item.html +1 -0
  103. includes/templates/documentation-suggestion.html +8 -0
  104. includes/update_control.class.php +2 -86
  105. includes/welcome_page.php +0 -155
  106. includes/wplc_agent_data.php +291 -0
  107. includes/wplc_custom_fields.php +515 -0
  108. includes/wplc_data_triggers.php +785 -0
  109. includes/wplc_departments.php +791 -0
  110. includes/wplc_roi.php +813 -0
  111. includes/wplc_transfer_chats.php +815 -0
  112. js/WebAudioRecorder.min.js +1 -0
  113. js/WebAudioRecorderWav.min.js +1 -0
  114. js/agent_status.js +10 -0
  115. js/bleeper_action_events.js +155 -0
  116. js/bleeper_action_events.min.js +1 -0
  117. js/media.js +119 -0
  118. js/quick_responses.js +23 -0
  119. js/reporting.js +73 -0
  120. js/switchery.min.js +1 -0
  121. js/themes/classic.js +1 -10
  122. js/themes/classic.min.js +1 -0
  123. js/themes/modern.js +4 -22
  124. js/themes/modern.min.js +1 -0
  125. js/triggers.js +42 -0
  126. js/upload.js +37 -0
  127. js/wavesurfer.min.js +7 -0
  128. js/wplc_admin_editor.js +154 -0
  129. js/wplc_admin_pro.js +350 -0
  130. js/wplc_admin_pro_events.js +319 -0
  131. js/wplc_admin_pro_features.js +60 -0
  132. js/wplc_bleeper_admin_events.js +229 -0
  133. js/wplc_choose.js +131 -0
  134. js/wplc_config.js +1 -0
  135. js/wplc_config.js.php +0 -5
  136. js/wplc_initiate.js +0 -0
  137. js/wplc_ma.js +72 -0
  138. js/wplc_ma_transient.js +17 -0
  139. js/wplc_pro_features.js +241 -0
  140. js/wplc_pro_features.min.js +1 -0
  141. js/wplc_server.min.js +1 -0
ajax_new.php → ajax.php RENAMED
@@ -1,459 +1,450 @@
1
- <?php
2
-
3
- add_action('wp_ajax_wplc_admin_long_poll', 'wplc_init_ajax_callback');
4
- add_action('wp_ajax_wplc_admin_long_poll_chat', 'wplc_init_ajax_callback');
5
- add_action('wp_ajax_wplc_admin_accept_chat', 'wplc_init_ajax_callback');
6
- add_action('wp_ajax_wplc_admin_close_chat', 'wplc_init_ajax_callback');
7
- add_action('wp_ajax_wplc_admin_send_msg', 'wplc_init_ajax_callback');
8
- add_action('wp_ajax_wplc_call_to_server_visitor', 'wplc_init_ajax_callback');
9
- add_action('wp_ajax_wplc_user_close_chat', 'wplc_init_ajax_callback');
10
- add_action('wp_ajax_wplc_user_minimize_chat', 'wplc_init_ajax_callback');
11
- add_action('wp_ajax_wplc_user_maximize_chat', 'wplc_init_ajax_callback');
12
- add_action('wp_ajax_wplc_user_send_msg', 'wplc_init_ajax_callback');
13
- add_action('wp_ajax_wplc_start_chat', 'wplc_init_ajax_callback');
14
- add_action('wp_ajax_nopriv_wplc_start_chat', 'wplc_init_ajax_callback');
15
- add_action('wp_ajax_nopriv_wplc_call_to_server_visitor', 'wplc_init_ajax_callback');
16
- add_action('wp_ajax_nopriv_wplc_user_close_chat', 'wplc_init_ajax_callback');
17
- add_action('wp_ajax_nopriv_wplc_user_minimize_chat', 'wplc_init_ajax_callback');
18
- add_action('wp_ajax_nopriv_wplc_user_maximize_chat', 'wplc_init_ajax_callback');
19
- add_action('wp_ajax_nopriv_wplc_user_send_msg', 'wplc_init_ajax_callback');
20
-
21
- add_action('wp_ajax_wplc_get_chat_box', 'wplc_init_ajax_callback');
22
- add_action('wp_ajax_nopriv_wplc_get_chat_box', 'wplc_init_ajax_callback');
23
-
24
- function wplc_init_ajax_callback() {
25
- @ob_start();
26
-
27
- $wplc_session_id = rand(0,9).rand(0,9).rand(0,9).rand(0,9).rand(0,9).rand(0,9).rand(0,9);
28
- $check = is_user_logged_in() ? check_ajax_referer( 'wplc', 'security' ) : 1;
29
-
30
- if ($check == 1) {
31
-
32
- $wplc_advanced_settings = get_option("wplc_advanced_settings");
33
- if (!$wplc_advanced_settings) {
34
- $wplc_delay_between_updates = 500000;
35
- $wplc_delay_between_loops = 500000;
36
- $wplc_iterations = 55;
37
- } else {
38
- if (isset($wplc_advanced_settings['wplc_delay_between_updates'])) { $wplc_delay_between_updates = intval($wplc_advanced_settings['wplc_delay_between_updates']); } else { $wplc_delay_between_updates = 500000; }
39
- if (isset($wplc_advanced_settings['wplc_delay_between_loops'])) { $wplc_delay_between_loops = intval($wplc_advanced_settings['wplc_delay_between_loops']); } else { $wplc_delay_between_loops = 500000; }
40
- if (isset($wplc_advanced_settings['wplc_iterations'])) { $wplc_iterations = intval($wplc_advanced_settings['wplc_iterations']); } else { $wplc_iterations = 55; }
41
-
42
- if ($wplc_iterations < 10) { $wplc_iterations = 10; }
43
- if ($wplc_iterations > 200) { $wplc_iterations = 200; }
44
-
45
- if ($wplc_delay_between_updates < 250000) { $wplc_delay_between_updates = 250000; }
46
- if ($wplc_delay_between_updates > 1000000) { $wplc_delay_between_updates = 1000000; }
47
-
48
- if ($wplc_delay_between_loops < 250000) { $wplc_delay_between_loops = 250000; }
49
- if ($wplc_delay_between_loops > 1000000) { $wplc_delay_between_loops = 1000000; }
50
-
51
- }
52
-
53
-
54
- $iterations = $wplc_iterations;
55
-
56
-
57
-
58
- /* time in microseconds between updating the user on the page within the DB (lower number = higher resource usage) */
59
- define('WPLC_DELAY_BETWEEN_UPDATES', $wplc_delay_between_updates);
60
- /* time in microseconds between long poll loop (lower number = higher resource usage) */
61
- define('WPLC_DELAY_BETWEEN_LOOPS', $wplc_delay_between_loops);
62
- /* this needs to take into account the previous constants so that we dont run out of time, which in turn returns a 503 error */
63
- define('WPLC_TIMEOUT', (((WPLC_DELAY_BETWEEN_UPDATES + WPLC_DELAY_BETWEEN_LOOPS)) * $iterations) / 1000000);
64
-
65
-
66
-
67
- global $wpdb;
68
- global $wplc_tblname_chats;
69
- global $wplc_tblname_msgs;
70
- /* we're using PHP 'sleep' which may lock other requests until our script wakes up. Call this function to ensure that other requests can run without waiting for us to finish */
71
- session_write_close();
72
-
73
- if ($_POST['action'] == "wplc_get_chat_box") {
74
- $continue = apply_filters( "wplc_version_check_continue", true );
75
- if ($continue === true) {
76
- echo wplc_output_box_5100(sanitize_text_field($_POST['cid']));
77
- } else {
78
- echo $continue;
79
- }
80
- die();
81
- }
82
-
83
- if($_POST['action'] == 'wplc_admin_long_poll'){
84
- // header("HTTP/1.0 500"); //Simulate 500 error
85
- // header("HTTP/1.0 404"); //Simulate 404 error
86
- // die();
87
-
88
- if (defined('WPLC_TIMEOUT')) { @set_time_limit(WPLC_TIMEOUT); } else { @set_time_limit(120); }
89
- //sleep(6);
90
- $i = 1;
91
- $wplc_current_user = get_current_user_id();
92
-
93
- /* If user is either an agent or an admin, access the page. */
94
- if( !get_user_meta( $wplc_current_user, 'wplc_ma_agent', true )) {
95
- $array['error'] = 1;
96
- echo json_encode($array);
97
- exit();
98
- }
99
-
100
- while($i <= $iterations){
101
-
102
-
103
-
104
- if($i %round($iterations/2) == 0) {
105
- wplc_update_chat_statuses();
106
- }
107
-
108
-
109
-
110
- if($_POST['wplc_update_admin_chat_table'] == 'false'){
111
- /* this is a new load of the page, return false so we can force a send of the new visitor data */
112
- $old_chat_data = false;
113
- } else {
114
- $old_chat_data = stripslashes($_POST['wplc_update_admin_chat_table']);
115
- }
116
-
117
- $pending = wplc_check_pending_chats();
118
- $new_chat_data = wplc_list_chats_new($_POST);
119
-
120
-
121
- if ($new_chat_data == "false") { $new_chat_data = false; }
122
-
123
-
124
- if($new_chat_data !== $old_chat_data){
125
- $array['old_chat_data'] = $old_chat_data;
126
- $array['wplc_update_admin_chat_table'] = $new_chat_data;
127
- $array['pending'] = $pending;
128
- $array['action'] = "wplc_update_chat_list";
129
-
130
- }
131
-
132
- if(isset($array)){
133
- echo json_encode($array);
134
- break;
135
- }
136
- @ob_end_flush();
137
- if (defined('WPLC_DELAY_BETWEEN_LOOPS')) { usleep(WPLC_DELAY_BETWEEN_LOOPS); } else { usleep(500000); }
138
- $i++;
139
- }
140
- }
141
- if($_POST['action'] == "wplc_admin_long_poll_chat"){
142
- if (defined('WPLC_TIMEOUT')) { @set_time_limit(WPLC_TIMEOUT); } else { @set_time_limit(120); }
143
- $i = 1;
144
- $cdata = wplc_get_chat_data($_POST['cid']);
145
- $array = array();
146
- while($i <= $iterations){
147
- $array = apply_filters("wplc_filter_admin_long_poll_chat_loop_iteration",$array,$_POST,$i,$cdata);
148
- if($array){
149
- echo json_encode($array);
150
- break;
151
- }
152
- @ob_end_flush();
153
- if (defined('WPLC_DELAY_BETWEEN_LOOPS')) { usleep(WPLC_DELAY_BETWEEN_LOOPS); } else { usleep(500000); }
154
- $i++;
155
- }
156
- }
157
- if ($_POST['action'] == "wplc_admin_accept_chat") {
158
- wplc_admin_accept_chat(sanitize_text_field($_POST['cid']));
159
- }
160
- if ($_POST['action'] == "wplc_admin_close_chat") {
161
- $chat_id = sanitize_text_field($_POST['cid']);
162
- wplc_change_chat_status($chat_id,1);
163
- echo 'done';
164
- }
165
- if ($_POST['action'] == "wplc_admin_send_msg") {
166
- $chat_id = sanitize_text_field($_POST['cid']);
167
- $chat_msg = strip_tags($_POST['msg'], '<a><p><img><hr>');
168
- $wplc_rec_msg = wplc_record_chat_msg("2",$chat_id,$chat_msg);
169
- if ($wplc_rec_msg) {
170
- echo 'sent';
171
- } else {
172
- echo "There was an error sending your chat message. Please contact support";
173
- }
174
- }
175
-
176
- //User Ajax
177
-
178
- if($_POST['action'] == 'wplc_call_to_server_visitor'){
179
-
180
-
181
-
182
- $wplc_settings = get_option("WPLC_SETTINGS");
183
-
184
-
185
- if (defined('WPLC_TIMEOUT')) { @set_time_limit(WPLC_TIMEOUT); } else { @set_time_limit(120); }
186
- $i = 1;
187
- $array = array("check" => false);
188
- $array['debug'] = "";
189
-
190
- $cdata = false;
191
- if($_POST['cid'] == null || $_POST['cid'] == "" || $_POST['cid'] == "null" || $_POST['cid'] == 0){ } else {
192
- /* get agent ID */
193
-
194
-
195
- $cdata = wplc_get_chat_data(sanitize_text_field(intval($_POST['cid'])),__LINE__);
196
- $from = __("Admin","wplivechat"); /* set default */
197
-
198
- $array['aname'] = apply_filters("wplc_filter_admin_from", $from, $_POST['cid'],$cdata);
199
-
200
- }
201
-
202
- while($i <= $iterations) {
203
-
204
- if($i %round($iterations/2) == 0) {
205
- wplc_update_chat_statuses();
206
- }
207
-
208
-
209
-
210
- if($_POST['cid'] == null || $_POST['cid'] == "" || $_POST['cid'] == "null" || $_POST['cid'] == 0){
211
- // echo 1;
212
-
213
- if( isset( $_POST['wplc_name'] ) && $_POST['wplc_name'] !== '' ){
214
- $user = sanitize_text_field($_POST['wplc_name']);
215
- } else {
216
- $user = "Guest";
217
- }
218
-
219
- if( isset( $_POST['wplc_email'] ) && $_POST['wplc_email'] !== '' ){
220
- $email = sanitize_text_field($_POST['wplc_email']);
221
- } else {
222
- $email = "no email set";
223
- }
224
-
225
- if(isset($_POST['wplc_is_mobile']) && ($_POST['wplc_is_mobile'] === 'true' || $_POST['wplc_is_mobile'] === true)){
226
- $is_mobile = true;
227
- } else {
228
- $is_mobile = false;
229
- }
230
-
231
- $cid = wplc_log_user_on_page($user,$email,sanitize_text_field($_POST['wplcsession']), $is_mobile);
232
- $array['cid'] = $cid;
233
- $array['status'] = wplc_return_chat_status($cid);
234
- $array['wplc_name'] = $user;
235
- $array['wplc_email'] = $email;
236
- $array['check'] = true;
237
-
238
- } else {
239
- // echo 2;
240
-
241
-
242
-
243
-
244
- $new_status = wplc_return_chat_status(sanitize_text_field($_POST['cid']));
245
- $array['wplc_name'] = sanitize_text_field($_POST['wplc_name']);
246
- $array['wplc_email'] = sanitize_text_field($_POST['wplc_email']);
247
- $array['cid'] = sanitize_text_field($_POST['cid']);
248
- $array['aid'] = sanitize_text_field($_POST['cid']);
249
-
250
- $array = apply_filters("wplc_filter_user_long_poll_chat_loop_iteration",$array,$_POST,$i,$cdata);
251
-
252
-
253
- if($new_status == $_POST['status']){ // if status matches do the following
254
- if( intval( $_POST['status'] ) != 2){
255
- /* check if session_variable is different? if yes then stop this script completely. */
256
- if (isset($_POST['wplcsession']) && $_POST['wplcsession'] != '' && $i > 1) {
257
- $wplc_session_variable = sanitize_text_field($_POST['wplcsession']);
258
- $current_session_variable = wplc_return_chat_session_variable(sanitize_text_field($_POST['cid']));
259
- if ($current_session_variable != "" && $current_session_variable != $wplc_session_variable) {
260
- /* stop this script */
261
- $array['status'] = 11;
262
- echo json_encode($array);
263
- die();
264
- }
265
- }
266
-
267
-
268
- if ($i == 1) {
269
- if (intval( $_POST['status'] ) != 12) {
270
- /* we dont want to update the time if the user was not answered by the agent as this needs to eventually time out and become a "missed chat" - status: 0 */
271
- wplc_update_user_on_page(sanitize_text_field($_POST['cid']), sanitize_text_field($_POST['status']), sanitize_text_field($_POST['wplcsession']));
272
- }
273
- }
274
- }
275
-
276
- if ( intval( $_POST['status'] ) == 0 || intval($_POST['status'] ) == 12 ){ // browsing - user tried to chat but admin didn't answer so turn back to browsing
277
- //wplc_update_user_on_page(sanitize_text_field($_POST['cid']), 0, sanitize_text_field($_POST['wplcsession']));
278
- //$array['status'] = 5;
279
- $array['status'] = 12;
280
- //$array['check'] = true;
281
-
282
- }
283
- else if( intval($_POST['status'] ) == 3 || intval($_POST['status'] ) == 10){
284
- //wplc_update_user_on_page(sanitize_text_field($_POST['cid']), 3);
285
- $messages = wplc_return_user_chat_messages(sanitize_text_field($_POST['cid']),$wplc_settings,$cdata);
286
- if ( intval( $_POST['status'] ) == 10 ) {
287
- $array['alert'] = true;
288
- }
289
- if ($messages){
290
- wplc_mark_as_read_user_chat_messages( sanitize_text_field($_POST['cid']) );
291
- $array['status'] = 3;
292
- $array['data'] = $messages;
293
- $array['check'] = true;
294
- }
295
- }
296
- else if(intval($_POST['status']) == 2){
297
- //wplc_update_user_on_page(sanitize_text_field($_POST['cid']), 3);
298
- $messages = wplc_return_user_chat_messages(sanitize_text_field($_POST['cid']),$wplc_settings,$cdata);
299
- $array['debug'] = "we are here ".__LINE__;
300
- if ($messages){
301
- wplc_mark_as_read_user_chat_messages(sanitize_text_field($_POST['cid']));
302
- $array['status'] = 2;
303
- $array['data'] = $messages;
304
- $array['check'] = true;
305
- }
306
- }
307
- else if( intval( $new_status ) == 12){ // no answer from admin, for the second+ time.
308
- $array['data'] = wplc_return_no_answer_string(sanitize_text_field($_POST['cid']));
309
- $array['check'] = true;
310
- @do_action("wplc_hook_missed_chat",array("cid" => $_POST['cid'],"name" => $_POST['wplc_name'],"email" => $_POST['wplc_email']));
311
-
312
- }
313
-
314
-
315
- /* check if this is part of the first run */
316
- if (isset($_POST['first_run']) && sanitize_text_field($_POST['first_run']) == 1) {
317
- /* if yes, then send data now and dont wait for all iterations to complete */
318
- if (!isset($array['status'])) { $array['status'] = $new_status; }
319
- $array['check'] = true;
320
- }
321
- else if (isset($_POST['short_poll']) && sanitize_text_field($_POST['short_poll']) == "true") {
322
- /* if yes, then send data now and dont wait for all iterations to complete */
323
- if (!isset($array['status'])) { $array['status'] = $new_status; }
324
- $array['check'] = true;
325
- }
326
- } else { // statuses do not match
327
-
328
- $array['debug'] = $array['debug']. " ". "Doesnt match $new_status ".$_POST['status'];
329
- $array['status'] = $new_status;
330
- if( intval( $new_status ) == 1 ){ // completed
331
- wplc_update_user_on_page( sanitize_text_field( $_POST['cid'] ), 8, sanitize_text_field( $_POST['wplcsession'] ) );
332
- $array['check'] = true;
333
- $array['status'] = 8;
334
- $array['data'] = array();
335
- $array['data'][9999] = array();
336
- $array['data'][9999]['msg'] = __("Admin has closed and ended the chat","wplivechat");
337
-
338
- }
339
- else if( intval( $new_status ) == 2 ) { // pending
340
- $array['debug'] = "we are here ".__LINE__;
341
- $array['check'] = true;
342
- $array['wplc_name'] = wplc_return_chat_name( sanitize_text_field($_POST['cid'] ) );
343
- $array['wplc_email'] = wplc_return_chat_email( sanitize_text_field($_POST['cid'] ) );
344
- $messages = wplc_return_chat_messages( sanitize_text_field($_POST['cid']), false, true, $wplc_settings, $cdata, 'array', false );
345
- if ($messages){
346
- $array['data'] = $messages;
347
- }
348
- }
349
- else if( intval( $new_status ) == 3 ){ // active
350
- $array['data'] = null;
351
- $array['check'] = true;
352
-
353
- if($_POST['status'] == 5 || $_POST['status'] == 3){
354
- $array['sound'] = false;
355
- $messages = wplc_return_chat_messages(sanitize_text_field($_POST['cid']),false,true,$wplc_settings,$cdata,'array',false);
356
- if ($messages){
357
- $array['data'] = $messages;
358
- }
359
- }
360
- }
361
- else if( intval( $new_status ) == 7){ // timed out
362
- wplc_update_user_on_page(sanitize_text_field($_POST['cid']), 5, sanitize_text_field($_POST['wplcsession']));
363
- }
364
- else if( intval( $new_status ) == 9){ // user closed chat without inputting or starting a chat
365
- $array['check'] = true;
366
- }
367
- else if( intval( $new_status ) == 12){ // no answer from admin
368
-
369
- $array['data'] = wplc_return_no_answer_string(sanitize_text_field($_POST['cid']));
370
- $array['check'] = true;
371
- wplc_update_user_on_page(sanitize_text_field($_POST['cid']), 12, sanitize_text_field($_POST['wplcsession']));
372
- @do_action("wplc_hook_missed_chat",array("cid" => $_POST['cid'],"name" => $_POST['wplc_name'],"email" => $_POST['wplc_email']));
373
-
374
- }
375
- else if( intval( $new_status ) == 10 ) { // minimized active chat
376
- $array['check'] = true;
377
- if($_POST['status'] == 5){
378
- $messages = wplc_return_chat_messages(sanitize_text_field($_POST['cid']),false,true,$wplc_settings,$cdata,'array',false);
379
- if ($messages){
380
- $array['data'] = $messages;
381
- }
382
- }
383
- }
384
- /* check if this is part of the first run */
385
- if (isset($_POST['first_run']) && sanitize_text_field($_POST['first_run']) == "1") {
386
- /* if yes, then send data now and dont wait for all iterations to complete */
387
- if (!isset($array['status'])) { $array['status'] = $new_status; }
388
- $array['check'] = true;
389
- }
390
- else if (isset($_POST['short_poll']) && sanitize_text_field($_POST['short_poll']) == "true") {
391
- /* if yes, then send data now and dont wait for all iterations to complete */
392
- if (!isset($array['status'])) { $array['status'] = $new_status; }
393
- $array['check'] = true;
394
- }
395
- $array = apply_filters("wplc_filter_wplc_call_to_server_visitor_new_status_check",$array);
396
-
397
- }
398
- }
399
- if($array['check'] == true){
400
- echo json_encode($array);
401
- break;
402
- }
403
- $i++;
404
-
405
- if (defined('WPLC_DELAY_BETWEEN_LOOPS')) { usleep(WPLC_DELAY_BETWEEN_LOOPS); } else { usleep(500000); }
406
-
407
- @ob_end_flush();
408
- }
409
- }
410
-
411
- /* */
412
- if ($_POST['action'] == "wplc_user_close_chat") {
413
- if($_POST['status'] == 5){
414
- wplc_change_chat_status(sanitize_text_field($_POST['cid']),9);
415
- } else if($_POST['status'] == 3){
416
- wplc_change_chat_status(sanitize_text_field($_POST['cid']),8);
417
- }
418
- }
419
-
420
- if ($_POST['action'] == "wplc_user_minimize_chat") {
421
- $chat_id = sanitize_text_field($_POST['cid']);
422
- wplc_change_chat_status(sanitize_text_field($_POST['cid']),10);
423
- }
424
- if ($_POST['action'] == "wplc_user_maximize_chat") {
425
- $chat_id = sanitize_text_field($_POST['cid']);
426
- $chat_status = intval(sanitize_text_field($_POST['chat_status']));
427
- wplc_change_chat_status(sanitize_text_field($_POST['cid']),$chat_status);
428
- }
429
-
430
- if ($_POST['action'] == "wplc_user_send_msg") {
431
- $chat_id = sanitize_text_field($_POST['cid']);
432
- $chat_msg = strip_tags($_POST['msg'], '<p><a><img><hr>');
433
- $wplc_rec_msg = wplc_record_chat_msg("1",$chat_id,$chat_msg);
434
- if ($wplc_rec_msg) {
435
- echo 'sent';
436
- } else {
437
- echo "There was an error sending your chat message. Please contact support";
438
- }
439
- }
440
- if ($_POST['action'] == "wplc_start_chat") {
441
- if (isset($_POST['cid'])) {
442
- if ($_POST['name'] && $_POST['email']) {
443
- echo wplc_user_initiate_chat(sanitize_text_field($_POST['name']),sanitize_email($_POST['email']),sanitize_text_field($_POST['cid']), sanitize_text_field($_POST['wplcsession'])); // echo the chat session id
444
- } else {
445
- echo "error2";
446
- }
447
- } else {
448
- if ($_POST['name'] && $_POST['email']) {
449
- echo wplc_user_initiate_chat(sanitize_text_field($_POST['name']), sanitize_email($_POST['email']), null, sanitize_text_field($_POST['wplcsession'])); // echo the chat session id
450
- } else {
451
- echo "error2";
452
- }
453
- }
454
- }
455
-
456
- }
457
-
458
- die();
459
  }
1
+ <?php
2
+
3
+ add_action('wp_ajax_wplc_admin_long_poll', 'wplc_init_ajax_callback');
4
+ add_action('wp_ajax_wplc_admin_long_poll_chat', 'wplc_init_ajax_callback');
5
+ add_action('wp_ajax_wplc_admin_accept_chat', 'wplc_init_ajax_callback');
6
+ add_action('wp_ajax_wplc_admin_close_chat', 'wplc_init_ajax_callback');
7
+ add_action('wp_ajax_wplc_admin_send_msg', 'wplc_init_ajax_callback');
8
+ add_action('wp_ajax_wplc_call_to_server_visitor', 'wplc_init_ajax_callback');
9
+ add_action('wp_ajax_wplc_user_close_chat', 'wplc_init_ajax_callback');
10
+ add_action('wp_ajax_wplc_user_minimize_chat', 'wplc_init_ajax_callback');
11
+ add_action('wp_ajax_wplc_user_maximize_chat', 'wplc_init_ajax_callback');
12
+ add_action('wp_ajax_wplc_user_send_msg', 'wplc_init_ajax_callback');
13
+ add_action('wp_ajax_wplc_start_chat', 'wplc_init_ajax_callback');
14
+ add_action('wp_ajax_nopriv_wplc_start_chat', 'wplc_init_ajax_callback');
15
+ add_action('wp_ajax_nopriv_wplc_call_to_server_visitor', 'wplc_init_ajax_callback');
16
+ add_action('wp_ajax_nopriv_wplc_user_close_chat', 'wplc_init_ajax_callback');
17
+ add_action('wp_ajax_nopriv_wplc_user_minimize_chat', 'wplc_init_ajax_callback');
18
+ add_action('wp_ajax_nopriv_wplc_user_maximize_chat', 'wplc_init_ajax_callback');
19
+ add_action('wp_ajax_nopriv_wplc_user_send_msg', 'wplc_init_ajax_callback');
20
+
21
+ add_action('wp_ajax_wplc_get_chat_box', 'wplc_init_ajax_callback');
22
+ add_action('wp_ajax_nopriv_wplc_get_chat_box', 'wplc_init_ajax_callback');
23
+
24
+ function wplc_init_ajax_callback() {
25
+ @ob_start();
26
+
27
+ $wplc_session_id = rand(0,9).rand(0,9).rand(0,9).rand(0,9).rand(0,9).rand(0,9).rand(0,9);
28
+ $check = is_user_logged_in() ? check_ajax_referer( 'wplc', 'security' ) : 1;
29
+
30
+ if ($check == 1) {
31
+
32
+ $wplc_advanced_settings = get_option("wplc_advanced_settings");
33
+ if (!$wplc_advanced_settings) {
34
+ $wplc_delay_between_updates = 500000;
35
+ $wplc_delay_between_loops = 500000;
36
+ $wplc_iterations = 55;
37
+ } else {
38
+ if (isset($wplc_advanced_settings['wplc_delay_between_updates'])) { $wplc_delay_between_updates = intval($wplc_advanced_settings['wplc_delay_between_updates']); } else { $wplc_delay_between_updates = 500000; }
39
+ if (isset($wplc_advanced_settings['wplc_delay_between_loops'])) { $wplc_delay_between_loops = intval($wplc_advanced_settings['wplc_delay_between_loops']); } else { $wplc_delay_between_loops = 500000; }
40
+ if (isset($wplc_advanced_settings['wplc_iterations'])) { $wplc_iterations = intval($wplc_advanced_settings['wplc_iterations']); } else { $wplc_iterations = 55; }
41
+
42
+ if ($wplc_iterations < 10) { $wplc_iterations = 10; }
43
+ if ($wplc_iterations > 200) { $wplc_iterations = 200; }
44
+
45
+ if ($wplc_delay_between_updates < 250000) { $wplc_delay_between_updates = 250000; }
46
+ if ($wplc_delay_between_updates > 1000000) { $wplc_delay_between_updates = 1000000; }
47
+
48
+ if ($wplc_delay_between_loops < 250000) { $wplc_delay_between_loops = 250000; }
49
+ if ($wplc_delay_between_loops > 1000000) { $wplc_delay_between_loops = 1000000; }
50
+
51
+ }
52
+
53
+
54
+ $iterations = $wplc_iterations;
55
+
56
+
57
+
58
+ /* time in microseconds between updating the user on the page within the DB (lower number = higher resource usage) */
59
+ define('WPLC_DELAY_BETWEEN_UPDATES', $wplc_delay_between_updates);
60
+ /* time in microseconds between long poll loop (lower number = higher resource usage) */
61
+ define('WPLC_DELAY_BETWEEN_LOOPS', $wplc_delay_between_loops);
62
+ /* this needs to take into account the previous constants so that we dont run out of time, which in turn returns a 503 error */
63
+ define('WPLC_TIMEOUT', (((WPLC_DELAY_BETWEEN_UPDATES + WPLC_DELAY_BETWEEN_LOOPS)) * $iterations) / 1000000);
64
+
65
+
66
+
67
+ global $wpdb;
68
+ global $wplc_tblname_chats;
69
+ global $wplc_tblname_msgs;
70
+ /* we're using PHP 'sleep' which may lock other requests until our script wakes up. Call this function to ensure that other requests can run without waiting for us to finish */
71
+ session_write_close();
72
+
73
+ if ($_POST['action'] == "wplc_get_chat_box") {
74
+ $continue = apply_filters( "wplc_version_check_continue", true );
75
+ if ($continue === true) {
76
+ echo wplc_output_box_5100(sanitize_text_field($_POST['cid']));
77
+ } else {
78
+ echo $continue;
79
+ }
80
+ die();
81
+ }
82
+
83
+ if($_POST['action'] == 'wplc_admin_long_poll'){
84
+
85
+ if (defined('WPLC_TIMEOUT')) { @set_time_limit(WPLC_TIMEOUT); } else { @set_time_limit(120); }
86
+ $i = 1;
87
+ $wplc_current_user = get_current_user_id();
88
+
89
+ /* If user is either an agent or an admin, access the page. */
90
+ if( !get_user_meta( $wplc_current_user, 'wplc_ma_agent', true )) {
91
+ $array['error'] = 1;
92
+ echo json_encode($array);
93
+ exit();
94
+ }
95
+
96
+ while($i <= $iterations){
97
+
98
+
99
+
100
+ if($i %round($iterations/2) == 0) {
101
+ wplc_update_chat_statuses();
102
+ }
103
+
104
+
105
+
106
+ if($_POST['wplc_update_admin_chat_table'] == 'false'){
107
+ /* this is a new load of the page, return false so we can force a send of the new visitor data */
108
+ $old_chat_data = false;
109
+ } else {
110
+ $old_chat_data = stripslashes($_POST['wplc_update_admin_chat_table']);
111
+ }
112
+
113
+ $pending = wplc_check_pending_chats();
114
+ $new_chat_data = wplc_list_chats($_POST);
115
+
116
+
117
+ if ($new_chat_data == "false") { $new_chat_data = false; }
118
+
119
+
120
+ if($new_chat_data !== $old_chat_data){
121
+ $array['old_chat_data'] = $old_chat_data;
122
+ $array['wplc_update_admin_chat_table'] = $new_chat_data;
123
+ $array['pending'] = $pending;
124
+ $array['action'] = "wplc_update_chat_list";
125
+
126
+ }
127
+
128
+ if(isset($array)){
129
+ echo json_encode($array);
130
+ break;
131
+ }
132
+ @ob_end_flush();
133
+ if (defined('WPLC_DELAY_BETWEEN_LOOPS')) { usleep(WPLC_DELAY_BETWEEN_LOOPS); } else { usleep(500000); }
134
+ $i++;
135
+ }
136
+ }
137
+ if($_POST['action'] == "wplc_admin_long_poll_chat"){
138
+ if (defined('WPLC_TIMEOUT')) { @set_time_limit(WPLC_TIMEOUT); } else { @set_time_limit(120); }
139
+ $i = 1;
140
+ $cdata = wplc_get_chat_data($_POST['cid']);
141
+ $array = array();
142
+ while($i <= $iterations){
143
+ $array = apply_filters("wplc_filter_admin_long_poll_chat_loop_iteration",$array,$_POST,$i,$cdata);
144
+ if($array){
145
+ echo json_encode($array);
146
+ break;
147
+ }
148
+ @ob_end_flush();
149
+ if (defined('WPLC_DELAY_BETWEEN_LOOPS')) { usleep(WPLC_DELAY_BETWEEN_LOOPS); } else { usleep(500000); }
150
+ $i++;
151
+ }
152
+ }
153
+ if ($_POST['action'] == "wplc_admin_accept_chat") {
154
+ wplc_admin_accept_chat(sanitize_text_field($_POST['cid']));
155
+ }
156
+ if ($_POST['action'] == "wplc_admin_close_chat") {
157
+ $chat_id = sanitize_text_field($_POST['cid']);
158
+ wplc_change_chat_status($chat_id,1);
159
+ echo 'done';
160
+ }
161
+ if ($_POST['action'] == "wplc_admin_send_msg") {
162
+ $chat_id = sanitize_text_field($_POST['cid']);
163
+ $chat_msg = strip_tags($_POST['msg'], '<a><p><img><hr>');
164
+ $wplc_rec_msg = wplc_record_chat_msg("2",$chat_id,$chat_msg);
165
+ if ($wplc_rec_msg) {
166
+ echo 'sent';
167
+ } else {
168
+ echo "There was an error sending your chat message. Please contact support";
169
+ }
170
+ }
171
+
172
+ //User Ajax
173
+
174
+ if($_POST['action'] == 'wplc_call_to_server_visitor'){
175
+
176
+
177
+
178
+ $wplc_settings = get_option("WPLC_SETTINGS");
179
+
180
+
181
+ if (defined('WPLC_TIMEOUT')) { @set_time_limit(WPLC_TIMEOUT); } else { @set_time_limit(120); }
182
+ $i = 1;
183
+ $array = array("check" => false);
184
+ $array['debug'] = "";
185
+
186
+ $cdata = false;
187
+ if($_POST['cid'] == null || $_POST['cid'] == "" || $_POST['cid'] == "null" || $_POST['cid'] == 0){ } else {
188
+ /* get agent ID */
189
+
190
+
191
+ $cdata = wplc_get_chat_data(sanitize_text_field(intval($_POST['cid'])),__LINE__);
192
+ $from = __("Admin","wplivechat"); /* set default */
193
+
194
+ $array['aname'] = apply_filters("wplc_filter_admin_from", $from, $_POST['cid'],$cdata);
195
+
196
+ }
197
+
198
+ while($i <= $iterations) {
199
+
200
+ if($i %round($iterations/2) == 0) {
201
+ wplc_update_chat_statuses();
202
+ }
203
+
204
+
205
+
206
+ if($_POST['cid'] == null || $_POST['cid'] == "" || $_POST['cid'] == "null" || $_POST['cid'] == 0){
207
+ // echo 1;
208
+
209
+ if( isset( $_POST['wplc_name'] ) && $_POST['wplc_name'] !== '' ){
210
+ $user = sanitize_text_field($_POST['wplc_name']);
211
+ } else {
212
+ $user = "Guest";
213
+ }
214
+
215
+ if( isset( $_POST['wplc_email'] ) && $_POST['wplc_email'] !== '' ){
216
+ $email = sanitize_text_field($_POST['wplc_email']);
217
+ } else {
218
+ $email = "no email set";
219
+ }
220
+
221
+ if(isset($_POST['wplc_is_mobile']) && ($_POST['wplc_is_mobile'] === 'true' || $_POST['wplc_is_mobile'] === true)){
222
+ $is_mobile = true;
223
+ } else {
224
+ $is_mobile = false;
225
+ }
226
+
227
+ $cid = wplc_log_user_on_page($user,$email,sanitize_text_field($_POST['wplcsession']), $is_mobile);
228
+ $array['cid'] = $cid;
229
+ $array['status'] = wplc_return_chat_status($cid);
230
+ $array['wplc_name'] = $user;
231
+ $array['wplc_email'] = $email;
232
+ $array['check'] = true;
233
+
234
+ } else {
235
+ // echo 2;
236
+
237
+
238
+
239
+
240
+ $new_status = wplc_return_chat_status(sanitize_text_field($_POST['cid']));
241
+ $array['wplc_name'] = sanitize_text_field($_POST['wplc_name']);
242
+ $array['wplc_email'] = sanitize_text_field($_POST['wplc_email']);
243
+ $array['cid'] = sanitize_text_field($_POST['cid']);
244
+ $array['aid'] = sanitize_text_field($_POST['cid']);
245
+
246
+ $array = apply_filters("wplc_filter_user_long_poll_chat_loop_iteration",$array,$_POST,$i,$cdata);
247
+
248
+
249
+ if($new_status == $_POST['status']){ // if status matches do the following
250
+ if( intval( $_POST['status'] ) != 2){
251
+ /* check if session_variable is different? if yes then stop this script completely. */
252
+ if (isset($_POST['wplcsession']) && $_POST['wplcsession'] != '' && $i > 1) {
253
+ $wplc_session_variable = sanitize_text_field($_POST['wplcsession']);
254
+ $current_session_variable = wplc_return_chat_session_variable(sanitize_text_field($_POST['cid']));
255
+ if ($current_session_variable != "" && $current_session_variable != $wplc_session_variable) {
256
+ /* stop this script */
257
+ $array['status'] = 11;
258
+ echo json_encode($array);
259
+ die();
260
+ }
261
+ }
262
+
263
+
264
+ if ($i == 1) {
265
+ if (intval( $_POST['status'] ) != 12) {
266
+ /* 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 */
267
+ wplc_update_user_on_page(sanitize_text_field($_POST['cid']), sanitize_text_field($_POST['status']), sanitize_text_field($_POST['wplcsession']));
268
+ }
269
+ }
270
+ }
271
+
272
+ if ( intval( $_POST['status'] ) == 0 || intval($_POST['status'] ) == 12 ){ // browsing - user tried to chat but admin didn't answer so turn back to browsing
273
+ $array['status'] = 12;
274
+
275
+ }
276
+ else if( intval($_POST['status'] ) == 3 || intval($_POST['status'] ) == 10){
277
+ $messages = wplc_return_user_chat_messages(sanitize_text_field($_POST['cid']),$wplc_settings,$cdata);
278
+ if ( intval( $_POST['status'] ) == 10 ) {
279
+ $array['alert'] = true;
280
+ }
281
+ if ($messages){
282
+ wplc_mark_as_read_user_chat_messages( sanitize_text_field($_POST['cid']) );
283
+ $array['status'] = 3;
284
+ $array['data'] = $messages;
285
+ $array['check'] = true;
286
+ }
287
+ }
288
+ else if(intval($_POST['status']) == 2){
289
+ $messages = wplc_return_user_chat_messages(sanitize_text_field($_POST['cid']),$wplc_settings,$cdata);
290
+ $array['debug'] = "we are here ".__LINE__;
291
+ if ($messages){
292
+ wplc_mark_as_read_user_chat_messages(sanitize_text_field($_POST['cid']));
293
+ $array['status'] = 2;
294
+ $array['data'] = $messages;
295
+ $array['check'] = true;
296
+ }
297
+ }
298
+ else if( intval( $new_status ) == 12){ // no answer from admin, for the second+ time.
299
+ $array['data'] = wplc_return_no_answer_string(sanitize_text_field($_POST['cid']));
300
+ $array['check'] = true;
301
+ @do_action("wplc_hook_missed_chat",array("cid" => $_POST['cid'],"name" => $_POST['wplc_name'],"email" => $_POST['wplc_email']));
302
+
303
+ }
304
+
305
+
306
+ /* check if this is part of the first run */
307
+ if (isset($_POST['first_run']) && sanitize_text_field($_POST['first_run']) == 1) {
308
+ /* if yes, then send data now and dont wait for all iterations to complete */
309
+ if (!isset($array['status'])) { $array['status'] = $new_status; }
310
+ $array['check'] = true;
311
+ }
312
+ else if (isset($_POST['short_poll']) && sanitize_text_field($_POST['short_poll']) == "true") {
313
+ /* if yes, then send data now and dont wait for all iterations to complete */
314
+ if (!isset($array['status'])) { $array['status'] = $new_status; }
315
+ $array['check'] = true;
316
+ }
317
+ } else { // statuses do not match
318
+
319
+ $array['debug'] = $array['debug']. " ". "Doesnt match $new_status ".$_POST['status'];
320
+ $array['status'] = $new_status;
321
+ if( intval( $new_status ) == 1 ){ // completed
322
+ wplc_update_user_on_page( sanitize_text_field( $_POST['cid'] ), 8, sanitize_text_field( $_POST['wplcsession'] ) );
323
+ $array['check'] = true;
324
+ $array['status'] = 8;
325
+ $array['data'] = array();
326
+ $array['data'][9999] = array();
327
+ $array['data'][9999]['msg'] = __("Admin has closed and ended the chat","wplivechat");
328
+
329
+ }
330
+ else if( intval( $new_status ) == 2 ) { // pending
331
+ $array['debug'] = "we are here ".__LINE__;
332
+ $array['check'] = true;
333
+ $array['wplc_name'] = wplc_return_chat_name( sanitize_text_field($_POST['cid'] ) );
334
+ $array['wplc_email'] = wplc_return_chat_email( sanitize_text_field($_POST['cid'] ) );
335
+ $messages = wplc_return_chat_messages( sanitize_text_field($_POST['cid']), false, true, $wplc_settings, $cdata, 'array', false );
336
+ if ($messages){
337
+ $array['data'] = $messages;
338
+ }
339
+ }
340
+ else if( intval( $new_status ) == 3 ){ // active
341
+ $array['data'] = null;
342
+ $array['check'] = true;
343
+
344
+ if($_POST['status'] == 5 || $_POST['status'] == 3){
345
+ $array['sound'] = false;
346
+ $messages = wplc_return_chat_messages(sanitize_text_field($_POST['cid']),false,true,$wplc_settings,$cdata,'array',false);
347
+ if ($messages){
348
+ $array['data'] = $messages;
349
+ }
350
+ }
351
+ }
352
+ else if( intval( $new_status ) == 7){ // timed out
353
+ wplc_update_user_on_page(sanitize_text_field($_POST['cid']), 5, sanitize_text_field($_POST['wplcsession']));
354
+ }
355
+ else if( intval( $new_status ) == 9){ // user closed chat without inputting or starting a chat
356
+ $array['check'] = true;
357
+ }
358
+ else if( intval( $new_status ) == 12){ // no answer from admin
359
+
360
+ $array['data'] = wplc_return_no_answer_string(sanitize_text_field($_POST['cid']));
361
+ $array['check'] = true;
362
+ wplc_update_user_on_page(sanitize_text_field($_POST['cid']), 12, sanitize_text_field($_POST['wplcsession']));
363
+ @do_action("wplc_hook_missed_chat",array("cid" => $_POST['cid'],"name" => $_POST['wplc_name'],"email" => $_POST['wplc_email']));
364
+
365
+ }
366
+ else if( intval( $new_status ) == 10 ) { // minimized active chat
367
+ $array['check'] = true;
368
+ if($_POST['status'] == 5){
369
+ $messages = wplc_return_chat_messages(sanitize_text_field($_POST['cid']),false,true,$wplc_settings,$cdata,'array',false);
370
+ if ($messages){
371
+ $array['data'] = $messages;
372
+ }
373
+ }
374
+ }
375
+ /* check if this is part of the first run */
376
+ if (isset($_POST['first_run']) && sanitize_text_field($_POST['first_run']) == "1") {
377
+ /* if yes, then send data now and dont wait for all iterations to complete */
378
+ if (!isset($array['status'])) { $array['status'] = $new_status; }
379
+ $array['check'] = true;
380
+ }
381
+ else if (isset($_POST['short_poll']) && sanitize_text_field($_POST['short_poll']) == "true") {
382
+ /* if yes, then send data now and dont wait for all iterations to complete */
383
+ if (!isset($array['status'])) { $array['status'] = $new_status; }
384
+ $array['check'] = true;
385
+ }
386
+ $array = apply_filters("wplc_filter_wplc_call_to_server_visitor_new_status_check",$array);
387
+
388
+ }
389
+ }
390
+ if($array['check'] == true){
391
+ echo json_encode($array);
392
+ break;
393
+ }
394
+ $i++;
395
+
396
+ if (defined('WPLC_DELAY_BETWEEN_LOOPS')) { usleep(WPLC_DELAY_BETWEEN_LOOPS); } else { usleep(500000); }
397
+
398
+ @ob_end_flush();
399
+ }
400
+ }
401
+
402
+ /* */
403
+ if ($_POST['action'] == "wplc_user_close_chat") {
404
+ if($_POST['status'] == 5){
405
+ wplc_change_chat_status(sanitize_text_field($_POST['cid']),9);
406
+ } else if($_POST['status'] == 3){
407
+ wplc_change_chat_status(sanitize_text_field($_POST['cid']),8);
408
+ }
409
+ }
410
+
411
+ if ($_POST['action'] == "wplc_user_minimize_chat") {
412
+ $chat_id = sanitize_text_field($_POST['cid']);
413
+ wplc_change_chat_status(sanitize_text_field($_POST['cid']),10);
414
+ }
415
+ if ($_POST['action'] == "wplc_user_maximize_chat") {
416
+ $chat_id = sanitize_text_field($_POST['cid']);
417
+ $chat_status = intval(sanitize_text_field($_POST['chat_status']));
418
+ wplc_change_chat_status(sanitize_text_field($_POST['cid']),$chat_status);
419
+ }
420
+
421
+ if ($_POST['action'] == "wplc_user_send_msg") {
422
+ $chat_id = sanitize_text_field($_POST['cid']);
423
+ $chat_msg = strip_tags($_POST['msg'], '<p><a><img><hr>');
424
+ $wplc_rec_msg = wplc_record_chat_msg("1",$chat_id,$chat_msg);
425
+ if ($wplc_rec_msg) {
426
+ echo 'sent';
427
+ } else {
428
+ echo "There was an error sending your chat message. Please contact support";
429
+ }
430
+ }
431
+ if ($_POST['action'] == "wplc_start_chat") {
432
+ if (isset($_POST['cid'])) {
433
+ if ($_POST['name'] && $_POST['email']) {
434
+ echo wplc_user_initiate_chat(sanitize_text_field($_POST['name']),sanitize_email($_POST['email']),sanitize_text_field($_POST['cid']), sanitize_text_field($_POST['wplcsession'])); // echo the chat session id
435
+ } else {
436
+ echo "error2";
437
+ }
438
+ } else {
439
+ if ($_POST['name'] && $_POST['email']) {
440
+ echo wplc_user_initiate_chat(sanitize_text_field($_POST['name']), sanitize_email($_POST['email']), null, sanitize_text_field($_POST['wplcsession'])); // echo the chat session id
441
+ } else {
442
+ echo "error2";
443
+ }
444
+ }
445
+ }
446
+
447
+ }
448
+
449
+ die();
 
 
 
 
 
 
 
 
 
450
  }
apache-ci.conf DELETED
@@ -1,11 +0,0 @@
1
- Listen 8080
2
-
3
- <VirtualHost *:8080>
4
- LoadModule php5_module /home/ubuntu/.phpenv/versions/5.3.3/libexec/apache2/libphp5.so
5
-
6
- DocumentRoot /home/ubuntu/wp-live-chat-support-v8/wordpress
7
- ServerName wplc-plugin.dev
8
- <FilesMatch \.php$>
9
- SetHandler application/x-httpd-php
10
- </FilesMatch>
11
- </VirtualHost>
 
 
 
 
 
 
 
 
 
 
 
config.php CHANGED
@@ -1,3 +1,16 @@
1
  <?php
2
- define( 'WLPC_UPDATE_SERVER', 'https://update.wp-livechat.com' );
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ?>
1
  <?php
2
+ /*
3
+ * Define important constants
4
+ */
5
+
6
+ $wplc_version = "8.0.27";
7
+
8
+ define('WPLC_PLUGIN_DIR', dirname(__FILE__));
9
+ define('WPLC_PLUGIN_URL', plugins_url( '/', __FILE__ ) );
10
+ define('WPLC_PLUGIN', plugin_basename( __FILE__ ) );
11
+ define( 'WLPC_UPDATE_SERVER', 'https://update.wp-livechat.com' );
12
+
13
+ global $wplc_plugin_url;
14
+ $wplc_plugin_url = WPLC_PLUGIN_URL;
15
+
16
  ?>
css/ace.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .ace_editor{position:relative;overflow:hidden;font:12px/normal Monaco,Menlo,'Ubuntu Mono',Consolas,source-code-pro,monospace;direction:ltr;text-align:left;-webkit-tap-highlight-color:transparent}.ace_scroller{position:absolute;overflow:hidden;top:0;bottom:0;background-color:inherit;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none;user-select:none;cursor:text}.ace_content{position:absolute;box-sizing:border-box;min-width:100%}.ace_dragging .ace_scroller:before{position:absolute;top:0;left:0;right:0;bottom:0;content:'';background:rgba(250,250,250,.01);z-index:1000}.ace_dragging.ace_dark .ace_scroller:before{background:rgba(0,0,0,.01)}.ace_selecting,.ace_selecting *{cursor:text!important}.ace_gutter{position:absolute;overflow:hidden;width:auto;top:0;bottom:0;left:0;cursor:default;z-index:4;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none;user-select:none}.ace_gutter-active-line{position:absolute;left:0;right:0}.ace_scroller.ace_scroll-left{box-shadow:17px 0 16px -16px rgba(0,0,0,.4) inset}.ace_gutter-cell{padding-left:19px;padding-right:6px;background-repeat:no-repeat}.ace_gutter-cell.ace_error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==);background-repeat:no-repeat;background-position:2px center}.ace_gutter-cell.ace_warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==);background-position:2px center}.ace_gutter-cell.ace_info{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=);background-position:2px center}.ace_dark .ace_gutter-cell.ace_info{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC)}.ace_scrollbar{position:absolute;right:0;bottom:0;z-index:6}.ace_scrollbar-inner{position:absolute;cursor:text;left:0;top:0}.ace_scrollbar-v{overflow-x:hidden;overflow-y:scroll;top:0}.ace_scrollbar-h{overflow-x:scroll;overflow-y:hidden;left:0}.ace_print-margin{position:absolute;height:100%}.ace_text-input{position:absolute;z-index:0;width:.5em;height:1em;opacity:0;background:0 0;-moz-appearance:none;appearance:none;border:none;resize:none;outline:0;overflow:hidden;font:inherit;padding:0 1px;margin:0 -1px;text-indent:-1em;-ms-user-select:text;-moz-user-select:text;-webkit-user-select:text;user-select:text;white-space:pre!important}.ace_text-input.ace_composition{background:inherit;color:inherit;z-index:1000;opacity:1;text-indent:0}.ace_layer{z-index:1;position:absolute;overflow:hidden;word-wrap:normal;white-space:pre;height:100%;width:100%;box-sizing:border-box;pointer-events:none}.ace_gutter-layer{position:relative;width:auto;text-align:right;pointer-events:auto}.ace_text-layer{font:inherit!important}.ace_cjk{display:inline-block;text-align:center}.ace_cursor-layer{z-index:4}.ace_cursor{z-index:4;position:absolute;box-sizing:border-box;border-left:2px solid;transform:translatez(0)}.ace_multiselect .ace_cursor{border-left-width:1px}.ace_slim-cursors .ace_cursor{border-left-width:1px}.ace_overwrite-cursors .ace_cursor{border-left-width:0;border-bottom:1px solid}.ace_hidden-cursors .ace_cursor{opacity:.2}.ace_smooth-blinking .ace_cursor{transition:opacity .18s}.ace_marker-layer .ace_stack,.ace_marker-layer .ace_step{position:absolute;z-index:3}.ace_marker-layer .ace_selection{position:absolute;z-index:5}.ace_marker-layer .ace_bracket{position:absolute;z-index:6}.ace_marker-layer .ace_active-line{position:absolute;z-index:2}.ace_marker-layer .ace_selected-word{position:absolute;z-index:4;box-sizing:border-box}.ace_line .ace_fold{box-sizing:border-box;display:inline-block;height:11px;margin-top:-2px;vertical-align:middle;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=),url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=);background-repeat:no-repeat,repeat-x;background-position:center center,top left;color:transparent;border:1px solid #000;border-radius:2px;cursor:pointer;pointer-events:auto}.ace_fold:hover{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=),url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC)}.ace_tooltip{background-color:#fff;background-image:linear-gradient(to bottom,transparent,rgba(0,0,0,.1));border:1px solid gray;border-radius:1px;box-shadow:0 1px 2px rgba(0,0,0,.3);color:#000;max-width:100%;padding:3px 4px;position:fixed;z-index:999999;box-sizing:border-box;cursor:default;white-space:pre;word-wrap:break-word;line-height:normal;font-style:normal;font-weight:400;letter-spacing:normal;pointer-events:none}.ace_folding-enabled>.ace_gutter-cell{padding-right:13px}.ace_fold-widget{box-sizing:border-box;margin:0 -12px 0 1px;display:none;width:11px;vertical-align:top;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==);background-repeat:no-repeat;background-position:center;border-radius:3px;border:1px solid transparent;cursor:pointer}.ace_folding-enabled .ace_fold-widget{display:inline-block}.ace_fold-widget.ace_end{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==)}.ace_fold-widget.ace_closed{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==)}.ace_fold-widget:hover{border:1px solid rgba(0,0,0,.3);background-color:rgba(255,255,255,.2);box-shadow:0 1px 1px rgba(255,255,255,.7)}.ace_fold-widget:active{border:1px solid rgba(0,0,0,.4);background-color:rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(255,255,255,.8)}.ace_dark .ace_fold-widget{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC)}.ace_dark .ace_fold-widget.ace_end{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==)}.ace_dark .ace_fold-widget.ace_closed{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==)}.ace_dark .ace_fold-widget:hover{box-shadow:0 1px 1px rgba(255,255,255,.2);background-color:rgba(255,255,255,.1)}.ace_dark .ace_fold-widget:active{box-shadow:0 1px 1px rgba(255,255,255,.2)}.ace_fold-widget.ace_invalid{background-color:#ffb4b4;border-color:#de5555}.ace_fade-fold-widgets .ace_fold-widget{transition:opacity .4s ease 50ms;opacity:0}.ace_fade-fold-widgets:hover .ace_fold-widget{transition:opacity 50ms ease 50ms;opacity:1}.ace_underline{text-decoration:underline}.ace_bold{font-weight:700}.ace_nobold .ace_bold{font-weight:400}.ace_italic{font-style:italic}.ace_error-marker{background-color:rgba(255,0,0,.2);position:absolute;z-index:9}.ace_highlight-marker{background-color:rgba(255,255,0,.2);position:absolute;z-index:8}.ace_br1{border-top-left-radius:3px}.ace_br2{border-top-right-radius:3px}.ace_br3{border-top-left-radius:3px;border-top-right-radius:3px}.ace_br4{border-bottom-right-radius:3px}.ace_br5{border-top-left-radius:3px;border-bottom-right-radius:3px}.ace_br6{border-top-right-radius:3px;border-bottom-right-radius:3px}.ace_br7{border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px}.ace_br8{border-bottom-left-radius:3px}.ace_br9{border-top-left-radius:3px;border-bottom-left-radius:3px}.ace_br10{border-top-right-radius:3px;border-bottom-left-radius:3px}.ace_br11{border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-left-radius:3px}.ace_br12{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.ace_br13{border-top-left-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.ace_br14{border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.ace_br15{border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.ace_text-input-ios{position:absolute!important;top:-100000px!important;left:-100000px!important}
css/admin-chat-box-style.min.css ADDED
@@ -0,0 +1 @@
 
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.min.css ADDED
@@ -0,0 +1 @@
 
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.min.css ADDED
@@ -0,0 +1 @@
 
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.min.css ADDED
@@ -0,0 +1 @@
 
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_styles_pro.css ADDED
@@ -0,0 +1,374 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wplc_admin_dashboard_container{
2
+ width: 80%;
3
+ margin: 0 auto;
4
+ }
5
+ #wplc_admin_chat_area{
6
+ width: 65%;
7
+ display: inline-block;
8
+ background-color: #FFF;
9
+ float: left;
10
+ /*padding: 10px;*/
11
+ box-shadow: 1px 1px 3px #ccc;
12
+ }
13
+
14
+ #wplc_admin_visitor_area{
15
+ width: 30%;
16
+ display: inline-block;
17
+ background-color: #FFF;
18
+ float: right;
19
+ box-shadow: 1px 1px 3px #ccc;
20
+ }
21
+
22
+ .wplc_visitor_container{
23
+ padding: 10px;
24
+ }
25
+ .wplc_visitor_container h1{
26
+ text-align: center;
27
+ line-height: 22px;
28
+ }
29
+
30
+ .wplc_chats_container h2{
31
+ padding: 10px;
32
+ }
33
+
34
+ .wplc_chat_section {
35
+ width: 33.33%;
36
+ display: table-cell;
37
+ vertical-align: middle;
38
+ }
39
+
40
+ .wplc_agent_actions{
41
+ text-align: center;
42
+ }
43
+
44
+ #wplc_user_typing {
45
+ color:#666;
46
+ font-style:italic;
47
+ }
48
+
49
+ .wplc_single_chat{
50
+ width: 100%;
51
+ display: inline-block;
52
+ border: 1px solid #EEE;
53
+ border-radius: 5px;
54
+ box-shadow: 1px 1px 21px #EEE;
55
+ margin: 8px auto;
56
+ padding: 10px;
57
+ }
58
+ .wplc_single_chat .wplc_user_image {
59
+ width: 30%;
60
+ display: inline-block;
61
+ float: left;
62
+ }
63
+ .wplc_user_meta_data {
64
+ width: 70%;
65
+ display: inline-block;
66
+ }
67
+ .wplc_single_chat .wplc_user_image img{
68
+ border-radius: 100px;
69
+ }
70
+
71
+
72
+ .wplc_single_visitor{
73
+ border-bottom: 1px solid #ccc;
74
+ padding: 20px;
75
+ overflow: hidden;
76
+ }
77
+
78
+ .wplc_single_visitor .wplc_chat_status{
79
+
80
+ }
81
+
82
+ .wplc_single_visitor .wplc_user_image {
83
+ width: 120px;
84
+ display: inline-block;
85
+ margin-right: 10px;
86
+ }
87
+
88
+ .wplc_single_visitor .wplc_user_image img{
89
+ border-radius: 100px;
90
+ }
91
+
92
+ .wplc_single_visitor .wplc_user_meta_data{
93
+ display: inline-block;
94
+ vertical-align: top;
95
+ }
96
+
97
+ .wplc_single_visitor .wplc_user_name {
98
+
99
+ }
100
+
101
+ .wplc_single_visitor .wplc_user_name h3{
102
+ margin: 0;
103
+ padding: 0;
104
+ }
105
+
106
+ .wplc_single_visitor h3.ui-accordion .ui-accordion-icons{
107
+ margin: 0;
108
+ padding-left: 0;
109
+ }
110
+
111
+ .wplc_single_visitor .wplc_user_name h3 i{
112
+ padding: 0 10px;
113
+ }
114
+ .wplc_active{
115
+ color: green;
116
+ }
117
+
118
+ .wplc_pending{
119
+ color: orange;
120
+ }
121
+
122
+ .wplc_closed{
123
+ color: red;
124
+ }
125
+
126
+ .wplc_single_visitor .wplc_user_email{
127
+
128
+ }
129
+
130
+ .wplc_single_visitor .wplc_user_ip{
131
+
132
+ }
133
+
134
+ .wplc_single_visitor .wplc_current_page a{
135
+ width: 100%;
136
+ }
137
+
138
+ .wplc_single_visitor .wplc_actions{
139
+
140
+ }
141
+
142
+ .wplc_icon_message{
143
+ font-size: 10px;
144
+ font-weight: normal;
145
+ }
146
+
147
+ .wplc_page_title{
148
+ text-align: center;
149
+ }
150
+
151
+ .wplc_page_title h1{
152
+ font-size: 3em;
153
+ }
154
+
155
+ .wplc_visitor_icon{
156
+ padding-right: 10px;
157
+
158
+ }
159
+
160
+ #wplc_admin_visitor_area h2, #wplc_admin_visitor_area #wplc_visitor_accordion{
161
+ padding: 10px;
162
+ }
163
+
164
+ #wplc_visitor_accordion .wplc_single_visitor{
165
+ padding: 10px;
166
+ overflow: hidden;
167
+ }
168
+ #wplc_visitor_accordion .wplc_user_name h3{
169
+ font-size: 14px;
170
+ }
171
+ #wplc_visitor_accordion > .wplc_single_visitor {
172
+ text-align: center;
173
+ }
174
+ .wplc_single_visitor .section_1 .wplc_user_meta_data {
175
+ width: 100%;
176
+ }
177
+
178
+ @media all and (max-width: 700px) {
179
+ #wplc_admin_chat_area{
180
+ width: 100%;
181
+ padding: 0;
182
+ margin: 0 0 10px 0;
183
+ }
184
+ #wplc_admin_visitor_area{
185
+ width: 100%;
186
+ }
187
+ #wplc_admin_chat_area p{
188
+ padding: 10px
189
+ }
190
+
191
+ }
192
+ @media all and (max-width: 1440px) {
193
+ .wplc_single_chat .wplc_user_image {
194
+ width: 100%;
195
+ display: block;
196
+ text-align: center;
197
+ }
198
+ .wplc_user_meta_data {
199
+ width: 100%;
200
+ display: block;
201
+ text-align: center;
202
+ }
203
+ }
204
+
205
+ @media all and (max-width: 1700px) {
206
+ .wplc_single_visitor .wplc_chat_section {
207
+ width: 100%;
208
+ display: block;
209
+ }
210
+ }
211
+
212
+
213
+ @media all and (max-width: 1200px) {
214
+ .wplc_chat_section.section_1 {
215
+ display: inline-block;
216
+ width: 100%;
217
+ padding: 10px;
218
+ }
219
+ }
220
+
221
+ @media all and (max-width: 850px) {
222
+ .wplc_chat_section.section_2 {
223
+ display: inline-block;
224
+ width: 100%;
225
+ padding: 10px;
226
+ }
227
+ .admin_visitor_advanced_info{
228
+ width: 93%;
229
+ }
230
+ }
231
+ .wplc_admin_dashboard_container p {
232
+ padding: 0 5px;
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
+
244
+ #wplc_admin_chat_holder {
245
+ width:990px;
246
+ margin:0 auto;
247
+ display:block;
248
+ overflow:auto;
249
+ clear:both;
250
+
251
+ }
252
+ #wplc_admin_chat_area_new {
253
+ width: 750px;
254
+ font-size: 13px;
255
+ float:left;
256
+ display:block;
257
+ background-color:#FFF;
258
+ border-radius:25px;
259
+ }
260
+ #wplc_admin_chat_info_new {
261
+ float:left;
262
+ width:240px;
263
+ display:block;
264
+ margin-bottom:20px;
265
+
266
+
267
+ }
268
+ .wplc_chat_vis_count_box {
269
+ width:57%;
270
+ min-width:198px;
271
+ background-color:#FFF;
272
+ min-height:150px;
273
+ border-radius:25px;
274
+ margin-left:auto;
275
+ margin-right:auto;
276
+ display:block;
277
+ text-align:center;
278
+ padding:10px;
279
+ }
280
+
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;
288
+ display: block;
289
+ font-weight:bold;
290
+ }
291
+
292
+
293
+ #wplc_admin_chat_area_new li {
294
+ float: left;
295
+ background: none;
296
+
297
+ padding: 0 2px 0 0;
298
+ list-style:none;
299
+ margin:0;
300
+
301
+ }
302
+ .wplc_header_vh {
303
+ font: bold 14px/26px Arial;
304
+ padding: 0 0 0 0px;
305
+ color: #C2BBBE;
306
+ display: block;
307
+ text-transform: uppercase;
308
+ display:block;
309
+ }
310
+ .wplc_headerspan_v { min-width:140px; width:20%; display:block; }
311
+ .wplc_headerspan_nr { min-width:100px; width:14%; display:block; }
312
+ .wplc_headerspan_d { min-width:200px; width:30%; display:block; }
313
+ .wplc_headerspan_d a { font-style: italic; }
314
+ .wplc_headerspan_t { min-width:60px; width:9%; display:block; }
315
+ .wplc_headerspan_s { min-width:80px; width:12%; display:block; }
316
+ .wplc_headerspan_a { min-width:100px; width:15%; display:block; }
317
+ .wplc_chat_ul_header {
318
+ clear: both;
319
+ overflow:auto;
320
+ display:block;
321
+ padding:10px;
322
+
323
+ }
324
+ #wplc_chat_ul {
325
+ clear: both;
326
+ overflow:auto;
327
+ display:block;
328
+
329
+ }
330
+ .wplc_p_cul { padding:10px; clear:both; display:block; overflow: auto; }
331
+ .wplc_p_cul:hover { background-color:#eee; border-radius:5px; }
332
+
333
+ .wplc_status_box {
334
+ padding: 3px;
335
+ border-radius: 5px;
336
+ color:white;
337
+ font-size:11px;
338
+
339
+ }
340
+ .wplc-agent-info {
341
+ font: bold 12px/24px Arial;
342
+ color: #C2BBBE;
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; }
352
+ .wplc_status_8 { background-color: #CCCCCC; }
353
+
354
+ .wplc_status_5 { background-color: #B3D24B; }
355
+
356
+ .wplc_status_2 { background-color: #3278CD; }
357
+ .wplc_status_3 { background-color: #3278CD; }
358
+
359
+
360
+ .wplc_status_6 { background-color: red; }
361
+ .wplc_status_7 { background-color: #BFBCBB; }
362
+ .wplc_status_9 { background-color: #BFBCBB; }
363
+
364
+
365
+ .browser-tag { font-size:10px; }
366
+ .wplc-sub-item-header { color:#C7C3C3; font-style: italic; }
367
+
368
+ @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; } }
369
+ @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; } }
370
+ @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; } }
371
+ @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; } }
372
+ @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; } }
373
+ @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; } }
374
+
css/chat_styles_pro.min.css ADDED
@@ -0,0 +1 @@
 
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.css ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #wp-live-chat-header:not(.active) {
2
+ -webkit-animation: wplc-bounce 1.5s 5 !important;
3
+ -moz-animation: wplc-bounce 1.5s 5 !important;
4
+ -o-animation: wplc-bounce 1.5s 5 !important;
5
+ animation: wplc-bounce 1.5s 5 !important;
6
+ animation-name: wplc-bounce !important;
7
+ animation-duration: 1.5s !important;
8
+ animation-timing-function: cubic-bezier(0.25, 0.1, 0.31, 1) !important;
9
+ animation-delay: 0s !important;
10
+ animation-iteration-count: 5 !important;
11
+ animation-direction: normal !important;
12
+ animation-fill-mode: none !important;
13
+ animation-play-state: running !important;
14
+ }
15
+
16
+ @keyframes wplc-bounce {
17
+ 0% {
18
+ transform: translateY(0);
19
+ }
20
+
21
+ 50% {
22
+ transform: translateY(-30%);
23
+ }
24
+
25
+ 100% {
26
+ transform: translateY(0);
27
+ }
28
+ }
css/cta_animations/bounce.min.css ADDED
@@ -0,0 +1 @@
 
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.css ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #wp-live-chat-header:not(.active) {
2
+ -webkit-animation: wplc-pop 0.3s pop !important;
3
+ -moz-animation: wplc-pop 0.3s pop !important;
4
+ -o-animation: wplc-pop 0.3s pop !important;
5
+ animation: wplc-pop 0.3s pop !important;
6
+ animation-name: wplc-pop !important;
7
+ animation-duration: 0.3s !important;
8
+ animation-timing-function: cubic-bezier(0.25, 0.1, 0.66, 0.97) !important;
9
+ animation-delay: 0s !important;
10
+ animation-iteration-count: pop !important;
11
+ animation-direction: normal !important;
12
+ animation-fill-mode: none !important;
13
+ animation-play-state: running !important;
14
+ }
15
+
16
+ @keyframes wplc-pop {
17
+ 0% {
18
+ transform: scale(0, 0);
19
+ }
20
+
21
+ 50% {
22
+ transform: scale(1.2, 1.2);
23
+ }
24
+
25
+ 100% {
26
+ transform: scale(1, 1);
27
+ }
28
+ }
css/cta_animations/pop.min.css ADDED
@@ -0,0 +1 @@
 
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.css ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #wp-live-chat-header:not(.active) {
2
+ -webkit-animation: wplc-pulse 1s infinite !important;
3
+ -moz-animation: wplc-pulse 1s infinite !important;
4
+ -o-animation: wplc-pulse 1s infinite !important;
5
+ animation: wplc-pulse 1s infinite !important;
6
+ animation-name: wplc-pulse !important;
7
+ animation-duration: 1s !important;
8
+ animation-timing-function: ease !important;
9
+ animation-delay: 0s !important;
10
+ animation-iteration-count: infinite !important;
11
+ animation-direction: normal !important;
12
+ animation-fill-mode: none !important;
13
+ animation-play-state: running !important;
14
+ }
15
+
16
+ @keyframes wplc-pulse {
17
+ 0% {
18
+ -webkit-box-shadow: 0 0 0 0 #75757575;
19
+ -moz-box-shadow: 0 0 0 0 #75757575;
20
+ -o-box-shadow: 0 0 0 0 #75757575;
21
+ box-shadow: 0 0 0 0 #75757575
22
+ }
23
+
24
+ 70% {
25
+ -webkit-box-shadow: 0 0 0 15px rgba(218, 218, 218, 0);
26
+ -moz-box-shadow: 0 0 0 15px rgba(218, 218, 218, 0);
27
+ -o-box-shadow: 0 0 0 15px rgba(218, 218, 218, 0);
28
+ box-shadow: 0 0 0 15px rgba(218, 218, 218, 0)
29
+ }
30
+
31
+ 100% {
32
+ -webkit-box-shadow: 0 0 0 0 rgba(228, 228, 228, 0);
33
+ -moz-box-shadow: 0 0 0 0 rgba(228, 228, 228, 0);
34
+ -o-box-shadow: 0 0 0 0 rgba(228, 228, 228, 0);
35
+ box-shadow: 0 0 0 0 rgba(228, 228, 228, 0)
36
+ }
37
+ }
css/cta_animations/ripple.min.css ADDED
@@ -0,0 +1 @@
 
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/font-awesome.min.css CHANGED
@@ -1,2337 +1,4 @@
1
  /*!
2
  * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
3
  * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
4
- */
5
- /* FONT PATH
6
- * -------------------------- */
7
- @font-face {
8
- font-family: 'FontAwesome';
9
- src: url('../fonts/fontawesome-webfont.eot?v=4.7.0');
10
- src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');
11
- font-weight: normal;
12
- font-style: normal;
13
- }
14
- .fa {
15
- display: inline-block;
16
- font: normal normal normal 14px/1 FontAwesome;
17
- font-size: inherit;
18
- text-rendering: auto;
19
- -webkit-font-smoothing: antialiased;
20
- -moz-osx-font-smoothing: grayscale;
21
- }
22
- /* makes the font 33% larger relative to the icon container */
23
- .fa-lg {
24
- font-size: 1.33333333em;
25
- line-height: 0.75em;
26
- vertical-align: -15%;
27
- }
28
- .fa-2x {
29
- font-size: 2em;
30
- }
31
- .fa-3x {
32
- font-size: 3em;
33
- }
34
- .fa-4x {
35
- font-size: 4em;
36
- }
37
- .fa-5x {
38
- font-size: 5em;
39
- }
40
- .fa-fw {
41
- width: 1.28571429em;
42
- text-align: center;
43
- }
44
- .fa-ul {
45
- padding-left: 0;
46
- margin-left: 2.14285714em;
47
- list-style-type: none;
48
- }
49
- .fa-ul > li {
50
- position: relative;
51
- }
52
- .fa-li {
53
- position: absolute;
54
- left: -2.14285714em;
55
- width: 2.14285714em;
56
- top: 0.14285714em;
57
- text-align: center;
58
- }
59
- .fa-li.fa-lg {
60
- left: -1.85714286em;
61
- }
62
- .fa-border {
63
- padding: .2em .25em .15em;
64
- border: solid 0.08em #eeeeee;
65
- border-radius: .1em;
66
- }
67
- .fa-pull-left {
68
- float: left;
69
- }
70
- .fa-pull-right {
71
- float: right;
72
- }
73
- .fa.fa-pull-left {
74
- margin-right: .3em;
75
- }
76
- .fa.fa-pull-right {
77
- margin-left: .3em;
78
- }
79
- /* Deprecated as of 4.4.0 */
80
- .pull-right {
81
- float: right;
82
- }
83
- .pull-left {
84
- float: left;
85
- }
86
- .fa.pull-left {
87
- margin-right: .3em;
88
- }
89
- .fa.pull-right {
90
- margin-left: .3em;
91
- }
92
- .fa-spin {
93
- -webkit-animation: fa-spin 2s infinite linear;
94
- animation: fa-spin 2s infinite linear;
95
- }
96
- .fa-pulse {
97
- -webkit-animation: fa-spin 1s infinite steps(8);
98
- animation: fa-spin 1s infinite steps(8);
99
- }
100
- @-webkit-keyframes fa-spin {
101
- 0% {
102
- -webkit-transform: rotate(0deg);
103
- transform: rotate(0deg);
104
- }
105
- 100% {
106
- -webkit-transform: rotate(359deg);
107
- transform: rotate(359deg);
108
- }
109
- }
110
- @keyframes fa-spin {
111
- 0% {
112
- -webkit-transform: rotate(0deg);
113
- transform: rotate(0deg);
114
- }
115
- 100% {
116
- -webkit-transform: rotate(359deg);
117
- transform: rotate(359deg);
118
- }
119
- }
120
- .fa-rotate-90 {
121
- -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";
122
- -webkit-transform: rotate(90deg);
123
- -ms-transform: rotate(90deg);
124
- transform: rotate(90deg);
125
- }
126
- .fa-rotate-180 {
127
- -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";
128
- -webkit-transform: rotate(180deg);
129
- -ms-transform: rotate(180deg);
130
- transform: rotate(180deg);
131
- }
132
- .fa-rotate-270 {
133
- -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";
134
- -webkit-transform: rotate(270deg);
135
- -ms-transform: rotate(270deg);
136
- transform: rotate(270deg);
137
- }
138
- .fa-flip-horizontal {
139
- -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";
140
- -webkit-transform: scale(-1, 1);
141
- -ms-transform: scale(-1, 1);
142
- transform: scale(-1, 1);
143
- }
144
- .fa-flip-vertical {
145
- -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";
146
- -webkit-transform: scale(1, -1);
147
- -ms-transform: scale(1, -1);
148
- transform: scale(1, -1);
149
- }
150
- :root .fa-rotate-90,
151
- :root .fa-rotate-180,
152
- :root .fa-rotate-270,
153
- :root .fa-flip-horizontal,
154
- :root .fa-flip-vertical {
155
- filter: none;
156
- }
157
- .fa-stack {
158
- position: relative;
159
- display: inline-block;
160
- width: 2em;
161
- height: 2em;
162
- line-height: 2em;
163
- vertical-align: middle;
164
- }
165
- .fa-stack-1x,
166
- .fa-stack-2x {
167
- position: absolute;
168
- left: 0;
169
- width: 100%;
170
- text-align: center;
171
- }
172
- .fa-stack-1x {
173
- line-height: inherit;
174
- }
175
- .fa-stack-2x {
176
- font-size: 2em;
177
- }
178
- .fa-inverse {
179
- color: #ffffff;
180
- }
181
- /* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
182
- readers do not read off random characters that represent icons */
183
- .fa-glass:before {
184
- content: "\f000";
185
- }
186
- .fa-music:before {
187
- content: "\f001";
188
- }
189
- .fa-search:before {
190
- content: "\f002";
191
- }
192
- .fa-envelope-o:before {
193
- content: "\f003";
194
- }
195
- .fa-heart:before {
196
- content: "\f004";
197
- }
198
- .fa-star:before {
199
- content: "\f005";
200
- }
201
- .fa-star-o:before {
202
- content: "\f006";
203
- }
204
- .fa-user:before {
205
- content: "\f007";
206
- }
207
- .fa-film:before {
208
- content: "\f008";
209
- }
210
- .fa-th-large:before {
211
- content: "\f009";
212
- }
213
- .fa-th:before {
214
- content: "\f00a";
215
- }
216
- .fa-th-list:before {
217
- content: "\f00b";
218
- }
219
- .fa-check:before {
220
- content: "\f00c";
221
- }
222
- .fa-remove:before,
223
- .fa-close:before,
224
- .fa-times:before {
225
- content: "\f00d";
226
- }
227
- .fa-search-plus:before {
228
- content: "\f00e";
229
- }
230
- .fa-search-minus:before {
231
- content: "\f010";
232
- }
233
- .fa-power-off:before {
234
- content: "\f011";
235
- }
236
- .fa-signal:before {
237
- content: "\f012";
238
- }
239
- .fa-gear:before,
240
- .fa-cog:before {
241
- content: "\f013";
242
- }
243
- .fa-trash-o:before {
244
- content: "\f014";
245
- }
246
- .fa-home:before {
247
- content: "\f015";
248
- }
249
- .fa-file-o:before {
250
- content: "\f016";
251
- }
252
- .fa-clock-o:before {
253
- content: "\f017";
254
- }
255
- .fa-road:before {
256
- content: "\f018";
257
- }
258
- .fa-download:before {
259
- content: "\f019";
260
- }
261
- .fa-arrow-circle-o-down:before {
262
- content: "\f01a";
263
- }
264
- .fa-arrow-circle-o-up:before {
265
- content: "\f01b";
266
- }
267
- .fa-inbox:before {
268
- content: "\f01c";
269
- }
270
- .fa-play-circle-o:before {
271
- content: "\f01d";
272
- }
273
- .fa-rotate-right:before,
274
- .fa-repeat:before {
275
- content: "\f01e";
276
- }
277
- .fa-refresh:before {
278
- content: "\f021";
279
- }
280
- .fa-list-alt:before {
281
- content: "\f022";
282
- }
283
- .fa-lock:before {
284
- content: "\f023";
285
- }
286
- .fa-flag:before {
287
- content: "\f024";
288
- }
289
- .fa-headphones:before {
290
- content: "\f025";
291
- }
292
- .fa-volume-off:before {
293
- content: "\f026";
294
- }
295
- .fa-volume-down:before {
296
- content: "\f027";
297
- }
298
- .fa-volume-up:before {
299
- content: "\f028";
300
- }
301
- .fa-qrcode:before {
302
- content: "\f029";
303
- }
304
- .fa-barcode:before {
305
- content: "\f02a";
306
- }
307
- .fa-tag:before {
308
- content: "\f02b";
309
- }
310
- .fa-tags:before {
311
- content: "\f02c";
312
- }
313
- .fa-book:before {
314
- content: "\f02d";
315
- }
316
- .fa-bookmark:before {
317
- content: "\f02e";
318
- }
319
- .fa-print:before {
320
- content: "\f02f";
321
- }
322
- .fa-camera:before {
323
- content: "\f030";
324
- }
325
- .fa-font:before {
326
- content: "\f031";
327
- }
328
- .fa-bold:before {
329
- content: "\f032";
330
- }
331
- .fa-italic:before {
332
- content: "\f033";
333
- }
334
- .fa-text-height:before {
335
- content: "\f034";
336
- }
337
- .fa-text-width:before {
338
- content: "\f035";
339
- }
340
- .fa-align-left:before {
341
- content: "\f036";
342
- }
343
- .fa-align-center:before {
344
- content: "\f037";
345
- }
346
- .fa-align-right:before {
347
- content: "\f038";
348
- }
349
- .fa-align-justify:before {
350
- content: "\f039";
351
- }
352
- .fa-list:before {
353
- content: "\f03a";
354
- }
355
- .fa-dedent:before,
356
- .fa-outdent:before {
357
- content: "\f03b";
358
- }
359
- .fa-indent:before {
360
- content: "\f03c";
361
- }
362
- .fa-video-camera:before {
363
- content: "\f03d";
364
- }
365
- .fa-photo:before,
366
- .fa-image:before,
367
- .fa-picture-o:before {
368
- content: "\f03e";
369
- }
370
- .fa-pencil:before {
371
- content: "\f040";
372
- }
373
- .fa-map-marker:before {
374
- content: "\f041";
375
- }
376
- .fa-adjust:before {
377
- content: "\f042";
378
- }
379
- .fa-tint:before {
380
- content: "\f043";
381
- }
382
- .fa-edit:before,
383
- .fa-pencil-square-o:before {
384
- content: "\f044";
385
- }
386
- .fa-share-square-o:before {
387
- content: "\f045";
388
- }
389
- .fa-check-square-o:before {
390
- content: "\f046";
391
- }
392
- .fa-arrows:before {
393
- content: "\f047";
394
- }
395
- .fa-step-backward:before {
396
- content: "\f048";
397
- }
398
- .fa-fast-backward:before {
399
- content: "\f049";
400
- }
401
- .fa-backward:before {
402
- content: "\f04a";
403
- }
404
- .fa-play:before {
405
- content: "\f04b";
406
- }
407
- .fa-pause:before {
408
- content: "\f04c";
409
- }
410
- .fa-stop:before {
411
- content: "\f04d";
412
- }
413
- .fa-forward:before {
414
- content: "\f04e";
415
- }
416
- .fa-fast-forward:before {
417
- content: "\f050";
418
- }
419
- .fa-step-forward:before {
420
- content: "\f051";
421
- }
422
- .fa-eject:before {
423
- content: "\f052";
424
- }
425
- .fa-chevron-left:before {
426
- content: "\f053";
427
- }
428
- .fa-chevron-right:before {
429
- content: "\f054";
430
- }
431
- .fa-plus-circle:before {
432
- content: "\f055";
433
- }
434
- .fa-minus-circle:before {
435
- content: "\f056";
436
- }
437
- .fa-times-circle:before {
438
- content: "\f057";
439
- }
440
- .fa-check-circle:before {
441
- content: "\f058";
442
- }
443
- .fa-question-circle:before {
444
- content: "\f059";
445
- }
446
- .fa-info-circle:before {
447
- content: "\f05a";
448
- }
449
- .fa-crosshairs:before {
450
- content: "\f05b";
451
- }
452
- .fa-times-circle-o:before {
453
- content: "\f05c";
454
- }
455
- .fa-check-circle-o:before {
456
- content: "\f05d";
457
- }
458
- .fa-ban:before {
459
- content: "\f05e";
460
- }
461
- .fa-arrow-left:before {
462
- content: "\f060";
463
- }
464
- .fa-arrow-right:before {
465
- content: "\f061";
466
- }
467
- .fa-arrow-up:before {
468
- content: "\f062";
469
- }
470
- .fa-arrow-down:before {
471
- content: "\f063";
472
- }
473
- .fa-mail-forward:before,
474
- .fa-share:before {
475
- content: "\f064";
476
- }
477
- .fa-expand:before {
478
- content: "\f065";
479
- }
480
- .fa-compress:before {
481
- content: "\f066";
482
- }
483
- .fa-plus:before {
484
- content: "\f067";
485
- }
486
- .fa-minus:before {
487
- content: "\f068";
488
- }
489
- .fa-asterisk:before {
490
- content: "\f069";
491
- }
492
- .fa-exclamation-circle:before {
493
- content: "\f06a";
494
- }
495
- .fa-gift:before {
496
- content: "\f06b";
497
- }
498
- .fa-leaf:before {
499
- content: "\f06c";
500
- }
501
- .fa-fire:before {
502
- content: "\f06d";
503
- }
504
- .fa-eye:before {
505
- content: "\f06e";
506
- }
507
- .fa-eye-slash:before {
508
- content: "\f070";
509
- }
510
- .fa-warning:before,
511
- .fa-exclamation-triangle:before {
512
- content: "\f071";
513
- }
514
- .fa-plane:before {
515
- content: "\f072";
516
- }
517
- .fa-calendar:before {
518
- content: "\f073";
519
- }
520
- .fa-random:before {
521
- content: "\f074";
522
- }
523
- .fa-comment:before {
524
- content: "\f075";
525
- }
526
- .fa-magnet:before {
527
- content: "\f076";
528
- }
529
- .fa-chevron-up:before {
530
- content: "\f077";
531
- }
532
- .fa-chevron-down:before {
533
- content: "\f078";
534
- }
535
- .fa-retweet:before {
536
- content: "\f079";
537
- }
538
- .fa-shopping-cart:before {
539
- content: "\f07a";
540
- }
541
- .fa-folder:before {
542
- content: "\f07b";
543
- }
544
- .fa-folder-open:before {
545
- content: "\f07c";
546
- }
547
- .fa-arrows-v:before {
548
- content: "\f07d";
549
- }
550
- .fa-arrows-h:before {
551
- content: "\f07e";
552
- }
553
- .fa-bar-chart-o:before,
554
- .fa-bar-chart:before {
555
- content: "\f080";
556
- }
557
- .fa-twitter-square:before {
558
- content: "\f081";
559
- }
560
- .fa-facebook-square:before {
561
- content: "\f082";
562
- }
563
- .fa-camera-retro:before {
564
- content: "\f083";
565
- }
566
- .fa-key:before {
567
- content: "\f084";
568
- }
569
- .fa-gears:before,
570
- .fa-cogs:before {
571
- content: "\f085";
572
- }
573
- .fa-comments:before {
574
- content: "\f086";
575
- }
576
- .fa-thumbs-o-up:before {
577
- content: "\f087";
578
- }
579
- .fa-thumbs-o-down:before {
580
- content: "\f088";
581
- }
582
- .fa-star-half:before {
583
- content: "\f089";
584
- }
585
- .fa-heart-o:before {
586
- content: "\f08a";
587
- }
588
- .fa-sign-out:before {
589
- content: "\f08b";
590
- }
591
- .fa-linkedin-square:before {
592
- content: "\f08c";
593
- }
594
- .fa-thumb-tack:before {
595
- content: "\f08d";
596
- }
597
- .fa-external-link:before {
598
- content: "\f08e";
599
- }
600
- .fa-sign-in:before {
601
- content: "\f090";
602
- }
603
- .fa-trophy:before {
604
- content: "\f091";
605
- }
606
- .fa-github-square:before {
607
- content: "\f092";
608
- }
609
- .fa-upload:before {
610
- content: "\f093";
611
- }
612
- .fa-lemon-o:before {
613
- content: "\f094";
614
- }
615
- .fa-phone:before {
616
- content: "\f095";
617
- }
618
- .fa-square-o:before {
619
- content: "\f096";
620
- }
621
- .fa-bookmark-o:before {
622
- content: "\f097";
623
- }
624
- .fa-phone-square:before {
625
- content: "\f098";
626
- }
627
- .fa-twitter:before {
628
- content: "\f099";
629
- }
630
- .fa-facebook-f:before,
631
- .fa-facebook:before {
632
- content: "\f09a";
633
- }
634
- .fa-github:before {
635
- content: "\f09b";
636
- }
637
- .fa-unlock:before {
638
- content: "\f09c";
639
- }
640
- .fa-credit-card:before {
641
- content: "\f09d";
642
- }
643
- .fa-feed:before,
644
- .fa-rss:before {
645
- content: "\f09e";
646
- }
647
- .fa-hdd-o:before {
648
- content: "\f0a0";
649
- }
650
- .fa-bullhorn:before {
651
- content: "\f0a1";
652
- }
653
- .fa-bell:before {
654
- content: "\f0f3";
655
- }
656
- .fa-certificate:before {
657
- content: "\f0a3";
658
- }
659
- .fa-hand-o-right:before {
660
- content: "\f0a4";
661
- }
662
- .fa-hand-o-left:before {
663
- content: "\f0a5";
664
- }
665
- .fa-hand-o-up:before {
666
- content: "\f0a6";
667
- }
668
- .fa-hand-o-down:before {
669
- content: "\f0a7";
670
- }
671
- .fa-arrow-circle-left:before {
672
- content: "\f0a8";
673
- }
674
- .fa-arrow-circle-right:before {
675
- content: "\f0a9";
676
- }
677
- .fa-arrow-circle-up:before {
678
- content: "\f0aa";
679
- }
680
- .fa-arrow-circle-down:before {
681
- content: "\f0ab";
682
- }
683
- .fa-globe:before {
684
- content: "\f0ac";
685
- }
686
- .fa-wrench:before {
687
- content: "\f0ad";
688
- }
689
- .fa-tasks:before {
690
- content: "\f0ae";
691
- }
692
- .fa-filter:before {
693
- content: "\f0b0";
694
- }
695
- .fa-briefcase:before {
696
- content: "\f0b1";
697
- }
698
- .fa-arrows-alt:before {
699
- content: "\f0b2";
700
- }
701
- .fa-group:before,
702
- .fa-users:before {
703
- content: "\f0c0";
704
- }
705
- .fa-chain:before,
706
- .fa-link:before {
707
- content: "\f0c1";
708
- }
709
- .fa-cloud:before {
710
- content: "\f0c2";
711
- }
712
- .fa-flask:before {
713
- content: "\f0c3";
714
- }
715
- .fa-cut:before,
716
- .fa-scissors:before {
717
- content: "\f0c4";
718
- }
719
- .fa-copy:before,
720
- .fa-files-o:before {
721
- content: "\f0c5";
722
- }
723
- .fa-paperclip:before {
724
- content: "\f0c6";
725
- }
726
- .fa-save:before,
727
- .fa-floppy-o:before {
728
- content: "\f0c7";
729
- }
730
- .fa-square:before {
731
- content: "\f0c8";
732
- }
733
- .fa-navicon:before,
734
- .fa-reorder:before,
735
- .fa-bars:before {
736
- content: "\f0c9";
737
- }
738
- .fa-list-ul:before {
739
- content: "\f0ca";
740
- }
741
- .fa-list-ol:before {
742
- content: "\f0cb";
743
- }
744
- .fa-strikethrough:before {
745
- content: "\f0cc";
746
- }
747
- .fa-underline:before {
748
- content: "\f0cd";
749
- }
750
- .fa-table:before {
751
- content: "\f0ce";
752
- }
753
- .fa-magic:before {
754
- content: "\f0d0";
755
- }
756
- .fa-truck:before {
757
- content: "\f0d1";
758
- }
759
- .fa-pinterest:before {
760
- content: "\f0d2";
761
- }
762
- .fa-pinterest-square:before {
763
- content: "\f0d3";
764
- }
765
- .fa-google-plus-square:before {
766
- content: "\f0d4";
767
- }
768
- .fa-google-plus:before {
769
- content: "\f0d5";
770
- }
771
- .fa-money:before {
772
- content: "\f0d6";
773
- }
774
- .fa-caret-down:before {
775
- content: "\f0d7";
776
- }
777
- .fa-caret-up:before {
778
- content: "\f0d8";
779
- }
780
- .fa-caret-left:before {
781
- content: "\f0d9";
782
- }
783
- .fa-caret-right:before {
784
- content: "\f0da";
785
- }
786
- .fa-columns:before {
787
- content: "\f0db";
788
- }
789
- .fa-unsorted:before,
790
- .fa-sort:before {
791
- content: "\f0dc";
792
- }
793
- .fa-sort-down:before,
794
- .fa-sort-desc:before {
795
- content: "\f0dd";
796
- }
797
- .fa-sort-up:before,
798
- .fa-sort-asc:before {
799
- content: "\f0de";
800
- }
801
- .fa-envelope:before {
802
- content: "\f0e0";
803
- }
804
- .fa-linkedin:before {
805
- content: "\f0e1";
806
- }
807
- .fa-rotate-left:before,
808
- .fa-undo:before {
809
- content: "\f0e2";
810
- }
811
- .fa-legal:before,
812
- .fa-gavel:before {
813
- content: "\f0e3";
814
- }
815
- .fa-dashboard:before,
816
- .fa-tachometer:before {
817
- content: "\f0e4";
818
- }
819
- .fa-comment-o:before {
820
- content: "\f0e5";
821
- }
822
- .fa-comments-o:before {
823
- content: "\f0e6";
824
- }
825
- .fa-flash:before,
826
- .fa-bolt:before {
827
- content: "\f0e7";
828
- }
829
- .fa-sitemap:before {
830
- content: "\f0e8";
831
- }
832
- .fa-umbrella:before {
833
- content: "\f0e9";
834
- }
835
- .fa-paste:before,
836
- .fa-clipboard:before {
837
- content: "\f0ea";
838
- }
839
- .fa-lightbulb-o:before {
840
- content: "\f0eb";
841
- }
842
- .fa-exchange:before {
843
- content: "\f0ec";
844
- }
845
- .fa-cloud-download:before {
846
- content: "\f0ed";
847
- }
848
- .fa-cloud-upload:before {
849
- content: "\f0ee";
850
- }
851
- .fa-user-md:before {
852
- content: "\f0f0";
853
- }
854
- .fa-stethoscope:before {
855
- content: "\f0f1";
856
- }
857
- .fa-suitcase:before {
858
- content: "\f0f2";
859
- }
860
- .fa-bell-o:before {
861
- content: "\f0a2";
862
- }
863
- .fa-coffee:before {
864
- content: "\f0f4";
865
- }
866
- .fa-cutlery:before {
867
- content: "\f0f5";
868
- }
869
- .fa-file-text-o:before {
870
- content: "\f0f6";
871
- }
872
- .fa-building-o:before {
873
- content: "\f0f7";
874
- }
875
- .fa-hospital-o:before {
876
- content: "\f0f8";
877
- }
878
- .fa-ambulance:before {
879
- content: "\f0f9";
880
- }
881
- .fa-medkit:before {
882
- content: "\f0fa";
883
- }
884
- .fa-fighter-jet:before {
885
- content: "\f0fb";
886
- }
887
- .fa-beer:before {
888
- content: "\f0fc";
889
- }
890
- .fa-h-square:before {
891
- content: "\f0fd";
892
- }
893
- .fa-plus-square:before {
894
- content: "\f0fe";
895
- }
896
- .fa-angle-double-left:before {
897
- content: "\f100";
898
- }
899
- .fa-angle-double-right:before {
900
- content: "\f101";
901
- }
902
- .fa-angle-double-up:before {
903
- content: "\f102";
904
- }
905
- .fa-angle-double-down:before {
906
- content: "\f103";
907
- }
908
- .fa-angle-left:before {
909
- content: "\f104";
910
- }
911
- .fa-angle-right:before {
912
- content: "\f105";
913
- }
914
- .fa-angle-up:before {
915
- content: "\f106";
916
- }
917
- .fa-angle-down:before {
918
- content: "\f107";
919
- }
920
- .fa-desktop:before {
921
- content: "\f108";
922
- }
923
- .fa-laptop:before {
924
- content: "\f109";
925
- }
926
- .fa-tablet:before {
927
- content: "\f10a";
928
- }
929
- .fa-mobile-phone:before,
930
- .fa-mobile:before {
931
- content: "\f10b";
932
- }
933
- .fa-circle-o:before {
934
- content: "\f10c";
935
- }
936
- .fa-quote-left:before {
937
- content: "\f10d";
938
- }
939
- .fa-quote-right:before {
940
- content: "\f10e";
941
- }
942
- .fa-spinner:before {
943
- content: "\f110";
944
- }
945
- .fa-circle:before {
946
- content: "\f111";
947
- }
948
- .fa-mail-reply:before,
949
- .fa-reply:before {
950
- content: "\f112";
951
- }
952
- .fa-github-alt:before {
953
- content: "\f113";
954
- }
955
- .fa-folder-o:before {
956
- content: "\f114";
957
- }
958
- .fa-folder-open-o:before {
959
- content: "\f115";
960
- }
961
- .fa-smile-o:before {
962
- content: "\f118";
963
- }
964
- .fa-frown-o:before {
965
- content: "\f119";
966
- }
967
- .fa-meh-o:before {
968
- content: "\f11a";
969
- }
970
- .fa-gamepad:before {
971
- content: "\f11b";
972
- }
973
- .fa-keyboard-o:before {
974
- content: "\f11c";
975
- }
976
- .fa-flag-o:before {
977
- content: "\f11d";
978
- }
979
- .fa-flag-checkered:before {
980
- content: "\f11e";
981
- }
982
- .fa-terminal:before {
983
- content: "\f120";
984
- }
985
- .fa-code:before {
986
- content: "\f121";
987
- }
988
- .fa-mail-reply-all:before,
989
- .fa-reply-all:before {
990
- content: "\f122";
991
- }
992
- .fa-star-half-empty:before,
993
- .fa-star-half-full:before,
994
- .fa-star-half-o:before {
995
- content: "\f123";
996
- }
997
- .fa-location-arrow:before {
998
- content: "\f124";
999
- }
1000
- .fa-crop:before {
1001
- content: "\f125";
1002
- }
1003
- .fa-code-fork:before {
1004
- content: "\f126";
1005
- }
1006
- .fa-unlink:before,
1007
- .fa-chain-broken:before {
1008
- content: "\f127";
1009
- }
1010
- .fa-question:before {
1011
- content: "\f128";
1012
- }
1013
- .fa-info:before {
1014
- content: "\f129";
1015
- }
1016
- .fa-exclamation:before {
1017
- content: "\f12a";
1018
- }
1019
- .fa-superscript:before {
1020
- content: "\f12b";
1021
- }
1022
- .fa-subscript:before {
1023
- content: "\f12c";
1024
- }
1025
- .fa-eraser:before {
1026
- content: "\f12d";
1027
- }
1028
- .fa-puzzle-piece:before {
1029
- content: "\f12e";
1030
- }
1031
- .fa-microphone:before {
1032
- content: "\f130";
1033
- }
1034
- .fa-microphone-slash:before {
1035
- content: "\f131";
1036
- }
1037
- .fa-shield:before {
1038
- content: "\f132";
1039
- }
1040
- .fa-calendar-o:before {
1041
- content: "\f133";
1042
- }
1043
- .fa-fire-extinguisher:before {
1044
- content: "\f134";
1045
- }
1046
- .fa-rocket:before {
1047
- content: "\f135";
1048
- }
1049
- .fa-maxcdn:before {
1050
- content: "\f136";
1051
- }
1052
- .fa-chevron-circle-left:before {
1053
- content: "\f137";
1054
- }
1055
- .fa-chevron-circle-right:before {
1056
- content: "\f138";
1057
- }
1058
- .fa-chevron-circle-up:before {
1059
- content: "\f139";
1060
- }
1061
- .fa-chevron-circle-down:before {
1062
- content: "\f13a";
1063
- }
1064
- .fa-html5:before {
1065
- content: "\f13b";
1066
- }
1067
- .fa-css3:before {
1068
- content: "\f13c";
1069
- }
1070
- .fa-anchor:before {
1071
- content: "\f13d";
1072
- }
1073
- .fa-unlock-alt:before {
1074
- content: "\f13e";
1075
- }
1076
- .fa-bullseye:before {
1077
- content: "\f140";
1078
- }
1079
- .fa-ellipsis-h:before {
1080
- content: "\f141";
1081
- }
1082
- .fa-ellipsis-v:before {
1083
- content: "\f142";
1084
- }
1085
- .fa-rss-square:before {
1086
- content: "\f143";
1087
- }
1088
- .fa-play-circle:before {
1089
- content: "\f144";
1090
- }
1091
- .fa-ticket:before {
1092
- content: "\f145";
1093
- }
1094
- .fa-minus-square:before {
1095
- content: "\f146";
1096
- }
1097
- .fa-minus-square-o:before {
1098
- content: "\f147";
1099
- }
1100
- .fa-level-up:before {
1101
- content: "\f148";
1102
- }
1103
- .fa-level-down:before {
1104
- content: "\f149";
1105
- }
1106
- .fa-check-square:before {
1107
- content: "\f14a";
1108
- }
1109
- .fa-pencil-square:before {
1110
- content: "\f14b";
1111
- }
1112
- .fa-external-link-square:before {
1113
- content: "\f14c";
1114
- }
1115
- .fa-share-square:before {
1116
- content: "\f14d";
1117
- }
1118
- .fa-compass:before {
1119
- content: "\f14e";
1120
- }
1121
- .fa-toggle-down:before,
1122
- .fa-caret-square-o-down:before {
1123
- content: "\f150";
1124
- }
1125
- .fa-toggle-up:before,
1126
- .fa-caret-square-o-up:before {
1127
- content: "\f151";
1128
- }
1129
- .fa-toggle-right:before,
1130
- .fa-caret-square-o-right:before {
1131
- content: "\f152";
1132
- }
1133
- .fa-euro:before,
1134
- .fa-eur:before {
1135
- content: "\f153";
1136
- }
1137
- .fa-gbp:before {
1138
- content: "\f154";
1139
- }
1140
- .fa-dollar:before,
1141
- .fa-usd:before {
1142
- content: "\f155";
1143
- }
1144
- .fa-rupee:before,
1145
- .fa-inr:before {
1146
- content: "\f156";
1147
- }
1148
- .fa-cny:before,
1149
- .fa-rmb:before,
1150
- .fa-yen:before,
1151
- .fa-jpy:before {
1152
- content: "\f157";
1153
- }
1154
- .fa-ruble:before,
1155
- .fa-rouble:before,
1156
- .fa-rub:before {
1157
- content: "\f158";
1158
- }
1159
- .fa-won:before,
1160
- .fa-krw:before {
1161
- content: "\f159";
1162
- }
1163
- .fa-bitcoin:before,
1164
- .fa-btc:before {
1165
- content: "\f15a";
1166
- }
1167
- .fa-file:before {
1168
- content: "\f15b";
1169
- }
1170
- .fa-file-text:before {
1171
- content: "\f15c";
1172
- }
1173
- .fa-sort-alpha-asc:before {
1174
- content: "\f15d";
1175
- }
1176
- .fa-sort-alpha-desc:before {
1177
- content: "\f15e";
1178
- }
1179
- .fa-sort-amount-asc:before {
1180
- content: "\f160";
1181
- }
1182
- .fa-sort-amount-desc:before {
1183
- content: "\f161";
1184
- }
1185
- .fa-sort-numeric-asc:before {
1186
- content: "\f162";
1187
- }
1188
- .fa-sort-numeric-desc:before {
1189
- content: "\f163";
1190
- }
1191
- .fa-thumbs-up:before {
1192
- content: "\f164";
1193
- }
1194
- .fa-thumbs-down:before {
1195
- content: "\f165";
1196
- }
1197
- .fa-youtube-square:before {
1198
- content: "\f166";
1199
- }
1200
- .fa-youtube:before {
1201
- content: "\f167";
1202
- }
1203
- .fa-xing:before {
1204
- content: "\f168";
1205
- }
1206
- .fa-xing-square:before {
1207
- content: "\f169";
1208
- }
1209
- .fa-youtube-play:before {
1210
- content: "\f16a";
1211
- }
1212
- .fa-dropbox:before {
1213
- content: "\f16b";
1214
- }
1215
- .fa-stack-overflow:before {
1216
- content: "\f16c";
1217
- }
1218
- .fa-instagram:before {
1219
- content: "\f16d";
1220
- }
1221
- .fa-flickr:before {
1222
- content: "\f16e";
1223
- }
1224
- .fa-adn:before {
1225
- content: "\f170";
1226
- }
1227
- .fa-bitbucket:before {
1228
- content: "\f171";
1229
- }
1230
- .fa-bitbucket-square:before {
1231
- content: "\f172";
1232
- }
1233
- .fa-tumblr:before {
1234
- content: "\f173";
1235
- }
1236
- .fa-tumblr-square:before {
1237
- content: "\f174";
1238
- }
1239
- .fa-long-arrow-down:before {
1240
- content: "\f175";
1241
- }
1242
- .fa-long-arrow-up:before {
1243
- content: "\f176";
1244
- }
1245
- .fa-long-arrow-left:before {
1246
- content: "\f177";
1247
- }
1248
- .fa-long-arrow-right:before {
1249
- content: "\f178";
1250
- }
1251
- .fa-apple:before {
1252
- content: "\f179";
1253
- }
1254
- .fa-windows:before {
1255
- content: "\f17a";
1256
- }
1257
- .fa-android:before {
1258
- content: "\f17b";
1259
- }
1260
- .fa-linux:before {
1261
- content: "\f17c";
1262
- }
1263
- .fa-dribbble:before {
1264
- content: "\f17d";
1265
- }
1266
- .fa-skype:before {
1267
- content: "\f17e";
1268
- }
1269
- .fa-foursquare:before {
1270
- content: "\f180";
1271
- }
1272
- .fa-trello:before {
1273
- content: "\f181";
1274
- }
1275
- .fa-female:before {
1276
- content: "\f182";
1277
- }
1278
- .fa-male:before {
1279
- content: "\f183";
1280
- }
1281
- .fa-gittip:before,
1282
- .fa-gratipay:before {
1283
- content: "\f184";
1284
- }
1285
- .fa-sun-o:before {
1286
- content: "\f185";
1287
- }
1288
- .fa-moon-o:before {
1289
- content: "\f186";
1290
- }
1291
- .fa-archive:before {
1292
- content: "\f187";
1293
- }
1294
- .fa-bug:before {
1295
- content: "\f188";
1296
- }
1297
- .fa-vk:before {
1298
- content: "\f189";
1299
- }
1300
- .fa-weibo:before {
1301
- content: "\f18a";
1302
- }
1303
- .fa-renren:before {
1304
- content: "\f18b";
1305
- }
1306
- .fa-pagelines:before {
1307
- content: "\f18c";
1308
- }
1309
- .fa-stack-exchange:before {
1310
- content: "\f18d";
1311
- }
1312
- .fa-arrow-circle-o-right:before {
1313
- content: "\f18e";
1314
- }
1315
- .fa-arrow-circle-o-left:before {
1316
- content: "\f190";
1317
- }
1318
- .fa-toggle-left:before,
1319
- .fa-caret-square-o-left:before {
1320
- content: "\f191";
1321
- }
1322
- .fa-dot-circle-o:before {
1323
- content: "\f192";
1324
- }
1325
- .fa-wheelchair:before {
1326
- content: "\f193";
1327
- }
1328
- .fa-vimeo-square:before {
1329
- content: "\f194";
1330
- }
1331
- .fa-turkish-lira:before,
1332
- .fa-try:before {
1333
- content: "\f195";
1334
- }
1335
- .fa-plus-square-o:before {
1336
- content: "\f196";
1337
- }
1338
- .fa-space-shuttle:before {
1339
- content: "\f197";
1340
- }
1341
- .fa-slack:before {
1342
- content: "\f198";
1343
- }
1344
- .fa-envelope-square:before {
1345
- content: "\f199";
1346
- }
1347
- .fa-wordpress:before {
1348
- content: "\f19a";
1349
- }
1350
- .fa-openid:before {
1351
- content: "\f19b";
1352
- }
1353
- .fa-institution:before,
1354
- .fa-bank:before,
1355
- .fa-university:before {
1356
- content: "\f19c";
1357
- }
1358
- .fa-mortar-board:before,
1359
- .fa-graduation-cap:before {
1360
- content: "\f19d";
1361
- }
1362
- .fa-yahoo:before {
1363
- content: "\f19e";
1364
- }
1365
- .fa-google:before {
1366
- content: "\f1a0";
1367
- }
1368
- .fa-reddit:before {
1369
- content: "\f1a1";
1370
- }
1371
- .fa-reddit-square:before {
1372
- content: "\f1a2";
1373
- }
1374
- .fa-stumbleupon-circle:before {
1375
- content: "\f1a3";
1376
- }
1377
- .fa-stumbleupon:before {
1378
- content: "\f1a4";
1379
- }
1380
- .fa-delicious:before {
1381
- content: "\f1a5";
1382
- }
1383
- .fa-digg:before {
1384
- content: "\f1a6";
1385
- }
1386
- .fa-pied-piper-pp:before {
1387
- content: "\f1a7";
1388
- }
1389
- .fa-pied-piper-alt:before {
1390
- content: "\f1a8";
1391
- }
1392
- .fa-drupal:before {
1393
- content: "\f1a9";
1394
- }
1395
- .fa-joomla:before {
1396
- content: "\f1aa";
1397
- }
1398
- .fa-language:before {
1399
- content: "\f1ab";
1400
- }
1401
- .fa-fax:before {
1402
- content: "\f1ac";
1403
- }
1404
- .fa-building:before {
1405
- content: "\f1ad";
1406
- }
1407
- .fa-child:before {
1408
- content: "\f1ae";
1409
- }
1410
- .fa-paw:before {
1411
- content: "\f1b0";
1412
- }
1413
- .fa-spoon:before {
1414
- content: "\f1b1";
1415
- }
1416
- .fa-cube:before {
1417
- content: "\f1b2";
1418
- }
1419
- .fa-cubes:before {
1420
- content: "\f1b3";
1421
- }
1422
- .fa-behance:before {
1423
- content: "\f1b4";
1424
- }
1425
- .fa-behance-square:before {
1426
- content: "\f1b5";
1427
- }
1428
- .fa-steam:before {
1429
- content: "\f1b6";
1430
- }
1431
- .fa-steam-square:before {
1432
- content: "\f1b7";
1433
- }
1434
- .fa-recycle:before {
1435
- content: "\f1b8";
1436
- }
1437
- .fa-automobile:before,
1438
- .fa-car:before {
1439
- content: "\f1b9";
1440
- }
1441
- .fa-cab:before,
1442
- .fa-taxi:before {
1443
- content: "\f1ba";
1444
- }
1445
- .fa-tree:before {
1446
- content: "\f1bb";
1447
- }
1448
- .fa-spotify:before {
1449
- content: "\f1bc";
1450
- }
1451
- .fa-deviantart:before {
1452
- content: "\f1bd";
1453
- }
1454
- .fa-soundcloud:before {
1455
- content: "\f1be";
1456
- }
1457
- .fa-database:before {
1458
- content: "\f1c0";
1459
- }
1460
- .fa-file-pdf-o:before {
1461
- content: "\f1c1";
1462
- }
1463
- .fa-file-word-o:before {
1464
- content: "\f1c2";
1465
- }
1466
- .fa-file-excel-o:before {
1467
- content: "\f1c3";
1468
- }
1469
- .fa-file-powerpoint-o:before {
1470
- content: "\f1c4";
1471
- }
1472
- .fa-file-photo-o:before,
1473
- .fa-file-picture-o:before,
1474
- .fa-file-image-o:before {
1475
- content: "\f1c5";
1476
- }
1477
- .fa-file-zip-o:before,
1478
- .fa-file-archive-o:before {
1479
- content: "\f1c6";
1480
- }
1481
- .fa-file-sound-o:before,
1482
- .fa-file-audio-o:before {
1483
- content: "\f1c7";
1484
- }
1485
- .fa-file-movie-o:before,
1486
- .fa-file-video-o:before {
1487
- content: "\f1c8";
1488
- }
1489
- .fa-file-code-o:before {
1490
- content: "\f1c9";
1491
- }
1492
- .fa-vine:before {
1493
- content: "\f1ca";
1494
- }
1495
- .fa-codepen:before {
1496
- content: "\f1cb";
1497
- }
1498
- .fa-jsfiddle:before {
1499
- content: "\f1cc";
1500
- }
1501
- .fa-life-bouy:before,
1502
- .fa-life-buoy:before,
1503
- .fa-life-saver:before,
1504
- .fa-support:before,
1505
- .fa-life-ring:before {
1506
- content: "\f1cd";
1507
- }
1508
- .fa-circle-o-notch:before {
1509
- content: "\f1ce";
1510
- }
1511
- .fa-ra:before,
1512
- .fa-resistance:before,
1513
- .fa-rebel:before {
1514
- content: "\f1d0";
1515
- }
1516
- .fa-ge:before,
1517
- .fa-empire:before {
1518
- content: "\f1d1";
1519
- }
1520
- .fa-git-square:before {
1521
- content: "\f1d2";
1522
- }
1523
- .fa-git:before {
1524
- content: "\f1d3";
1525
- }
1526
- .fa-y-combinator-square:before,
1527
- .fa-yc-square:before,
1528
- .fa-hacker-news:before {
1529
- content: "\f1d4";
1530
- }
1531
- .fa-tencent-weibo:before {
1532
- content: "\f1d5";
1533
- }
1534
- .fa-qq:before {
1535
- content: "\f1d6";
1536
- }
1537
- .fa-wechat:before,
1538
- .fa-weixin:before {
1539
- content: "\f1d7";
1540
- }
1541
- .fa-send:before,
1542
- .fa-paper-plane:before {
1543
- content: "\f1d8";
1544
- }
1545
- .fa-send-o:before,
1546
- .fa-paper-plane-o:before {
1547
- content: "\f1d9";
1548
- }
1549
- .fa-history:before {
1550
- content: "\f1da";
1551
- }
1552
- .fa-circle-thin:before {
1553
- content: "\f1db";
1554
- }
1555
- .fa-header:before {
1556
- content: "\f1dc";
1557
- }
1558
- .fa-paragraph:before {
1559
- content: "\f1dd";
1560
- }
1561
- .fa-sliders:before {
1562
- content: "\f1de";
1563
- }
1564
- .fa-share-alt:before {
1565
- content: "\f1e0";
1566
- }
1567
- .fa-share-alt-square:before {
1568
- content: "\f1e1";
1569
- }
1570
- .fa-bomb:before {
1571
- content: "\f1e2";
1572
- }
1573
- .fa-soccer-ball-o:before,
1574
- .fa-futbol-o:before {
1575
- content: "\f1e3";
1576
- }
1577
- .fa-tty:before {
1578
- content: "\f1e4";
1579
- }
1580
- .fa-binoculars:before {
1581
- content: "\f1e5";
1582
- }
1583
- .fa-plug:before {
1584
- content: "\f1e6";
1585
- }
1586
- .fa-slideshare:before {
1587
- content: "\f1e7";
1588
- }
1589
- .fa-twitch:before {
1590
- content: "\f1e8";
1591
- }
1592
- .fa-yelp:before {
1593
- content: "\f1e9";
1594
- }
1595
- .fa-newspaper-o:before {
1596
- content: "\f1ea";
1597
- }
1598
- .fa-wifi:before {
1599
- content: "\f1eb";
1600
- }
1601
- .fa-calculator:before {
1602
- content: "\f1ec";
1603
- }
1604
- .fa-paypal:before {
1605
- content: "\f1ed";
1606
- }
1607
- .fa-google-wallet:before {
1608
- content: "\f1ee";
1609
- }
1610
- .fa-cc-visa:before {
1611
- content: "\f1f0";
1612
- }
1613
- .fa-cc-mastercard:before {
1614
- content: "\f1f1";
1615
- }
1616
- .fa-cc-discover:before {
1617
- content: "\f1f2";
1618
- }
1619
- .fa-cc-amex:before {
1620
- content: "\f1f3";
1621
- }
1622
- .fa-cc-paypal:before {
1623
- content: "\f1f4";
1624
- }
1625
- .fa-cc-stripe:before {
1626
- content: "\f1f5";
1627
- }
1628
- .fa-bell-slash:before {
1629
- content: "\f1f6";
1630
- }
1631
- .fa-bell-slash-o:before {
1632
- content: "\f1f7";
1633
- }
1634
- .fa-trash:before {
1635
- content: "\f1f8";
1636
- }
1637
- .fa-copyright:before {
1638
- content: "\f1f9";
1639
- }
1640
- .fa-at:before {
1641
- content: "\f1fa";
1642
- }
1643
- .fa-eyedropper:before {
1644
- content: "\f1fb";
1645
- }
1646
- .fa-paint-brush:before {
1647
- content: "\f1fc";
1648
- }
1649
- .fa-birthday-cake:before {
1650
- content: "\f1fd";
1651
- }
1652
- .fa-area-chart:before {
1653
- content: "\f1fe";
1654
- }
1655
- .fa-pie-chart:before {
1656
- content: "\f200";
1657
- }
1658
- .fa-line-chart:before {
1659
- content: "\f201";
1660
- }
1661
- .fa-lastfm:before {
1662
- content: "\f202";
1663
- }
1664
- .fa-lastfm-square:before {
1665
- content: "\f203";
1666
- }
1667
- .fa-toggle-off:before {
1668
- content: "\f204";
1669
- }
1670
- .fa-toggle-on:before {
1671
- content: "\f205";
1672
- }
1673
- .fa-bicycle:before {
1674
- content: "\f206";
1675
- }
1676
- .fa-bus:before {
1677
- content: "\f207";
1678
- }
1679
- .fa-ioxhost:before {
1680
- content: "\f208";
1681
- }
1682
- .fa-angellist:before {
1683
- content: "\f209";
1684
- }
1685
- .fa-cc:before {
1686
- content: "\f20a";
1687
- }
1688
- .fa-shekel:before,
1689
- .fa-sheqel:before,
1690
- .fa-ils:before {
1691
- content: "\f20b";
1692
- }
1693
- .fa-meanpath:before {
1694
- content: "\f20c";
1695
- }
1696
- .fa-buysellads:before {
1697
- content: "\f20d";
1698
- }
1699
- .fa-connectdevelop:before {
1700
- content: "\f20e";
1701
- }
1702
- .fa-dashcube:before {
1703
- content: "\f210";
1704
- }
1705
- .fa-forumbee:before {
1706
- content: "\f211";
1707
- }
1708
- .fa-leanpub:before {
1709
- content: "\f212";
1710
- }
1711
- .fa-sellsy:before {
1712
- content: "\f213";
1713
- }
1714
- .fa-shirtsinbulk:before {
1715
- content: "\f214";
1716
- }
1717
- .fa-simplybuilt:before {
1718
- content: "\f215";
1719
- }
1720
- .fa-skyatlas:before {
1721
- content: "\f216";
1722
- }
1723
- .fa-cart-plus:before {
1724
- content: "\f217";
1725
- }
1726
- .fa-cart-arrow-down:before {
1727
- content: "\f218";
1728
- }
1729
- .fa-diamond:before {
1730
- content: "\f219";
1731
- }
1732
- .fa-ship:before {
1733
- content: "\f21a";
1734
- }
1735
- .fa-user-secret:before {
1736
- content: "\f21b";
1737
- }
1738
- .fa-motorcycle:before {
1739
- content: "\f21c";
1740
- }
1741
- .fa-street-view:before {
1742
- content: "\f21d";
1743
- }
1744
- .fa-heartbeat:before {
1745
- content: "\f21e";
1746
- }
1747
- .fa-venus:before {
1748
- content: "\f221";
1749
- }
1750
- .fa-mars:before {
1751
- content: "\f222";
1752
- }
1753
- .fa-mercury:before {
1754
- content: "\f223";
1755
- }
1756
- .fa-intersex:before,
1757
- .fa-transgender:before {
1758
- content: "\f224";
1759
- }
1760
- .fa-transgender-alt:before {
1761
- content: "\f225";
1762
- }
1763
- .fa-venus-double:before {
1764
- content: "\f226";
1765
- }
1766
- .fa-mars-double:before {
1767
- content: "\f227";
1768
- }
1769
- .fa-venus-mars:before {
1770
- content: "\f228";
1771
- }
1772
- .fa-mars-stroke:before {
1773
- content: "\f229";
1774
- }
1775
- .fa-mars-stroke-v:before {
1776
- content: "\f22a";
1777
- }
1778
- .fa-mars-stroke-h:before {
1779
- content: "\f22b";
1780
- }
1781
- .fa-neuter:before {
1782
- content: "\f22c";
1783
- }
1784
- .fa-genderless:before {
1785
- content: "\f22d";
1786
- }
1787
- .fa-facebook-official:before {
1788
- content: "\f230";
1789
- }
1790
- .fa-pinterest-p:before {
1791
- content: "\f231";
1792
- }
1793
- .fa-whatsapp:before {
1794
- content: "\f232";
1795
- }
1796
- .fa-server:before {
1797
- content: "\f233";
1798
- }
1799
- .fa-user-plus:before {
1800
- content: "\f234";
1801
- }
1802
- .fa-user-times:before {
1803
- content: "\f235";
1804
- }
1805
- .fa-hotel:before,
1806
- .fa-bed:before {
1807
- content: "\f236";
1808
- }
1809
- .fa-viacoin:before {
1810
- content: "\f237";
1811
- }
1812
- .fa-train:before {
1813
- content: "\f238";
1814
- }
1815
- .fa-subway:before {
1816
- content: "\f239";
1817
- }
1818
- .fa-medium:before {
1819
- content: "\f23a";
1820
- }
1821
- .fa-yc:before,
1822
- .fa-y-combinator:before {
1823
- content: "\f23b";
1824
- }
1825
- .fa-optin-monster:before {
1826
- content: "\f23c";
1827
- }
1828
- .fa-opencart:before {
1829
- content: "\f23d";
1830
- }
1831
- .fa-expeditedssl:before {
1832
- content: "\f23e";
1833
- }
1834
- .fa-battery-4:before,
1835
- .fa-battery:before,
1836
- .fa-battery-full:before {
1837
- content: "\f240";
1838
- }
1839
- .fa-battery-3:before,
1840
- .fa-battery-three-quarters:before {
1841
- content: "\f241";
1842
- }
1843
- .fa-battery-2:before,
1844
- .fa-battery-half:before {
1845
- content: "\f242";
1846
- }
1847
- .fa-battery-1:before,
1848
- .fa-battery-quarter:before {
1849
- content: "\f243";
1850
- }
1851
- .fa-battery-0:before,
1852
- .fa-battery-empty:before {
1853
- content: "\f244";
1854
- }
1855
- .fa-mouse-pointer:before {
1856
- content: "\f245";
1857
- }
1858
- .fa-i-cursor:before {
1859
- content: "\f246";
1860
- }
1861
- .fa-object-group:before {
1862
- content: "\f247";
1863
- }
1864
- .fa-object-ungroup:before {
1865
- content: "\f248";
1866
- }
1867
- .fa-sticky-note:before {
1868
- content: "\f249";
1869
- }
1870
- .fa-sticky-note-o:before {
1871
- content: "\f24a";
1872
- }
1873
- .fa-cc-jcb:before {
1874
- content: "\f24b";
1875
- }
1876
- .fa-cc-diners-club:before {
1877
- content: "\f24c";
1878
- }
1879
- .fa-clone:before {
1880
- content: "\f24d";
1881
- }
1882
- .fa-balance-scale:before {
1883
- content: "\f24e";
1884
- }
1885
- .fa-hourglass-o:before {
1886
- content: "\f250";
1887
- }
1888
- .fa-hourglass-1:before,
1889
- .fa-hourglass-start:before {
1890
- content: "\f251";
1891
- }
1892
- .fa-hourglass-2:before,
1893
- .fa-hourglass-half:before {
1894
- content: "\f252";
1895
- }
1896
- .fa-hourglass-3:before,
1897
- .fa-hourglass-end:before {
1898
- content: "\f253";
1899
- }
1900
- .fa-hourglass:before {
1901
- content: "\f254";
1902
- }
1903
- .fa-hand-grab-o:before,
1904
- .fa-hand-rock-o:before {
1905
- content: "\f255";
1906
- }
1907
- .fa-hand-stop-o:before,
1908
- .fa-hand-paper-o:before {
1909
- content: "\f256";
1910
- }
1911
- .fa-hand-scissors-o:before {
1912
- content: "\f257";
1913
- }
1914
- .fa-hand-lizard-o:before {
1915
- content: "\f258";
1916
- }
1917
- .fa-hand-spock-o:before {
1918
- content: "\f259";
1919
- }
1920
- .fa-hand-pointer-o:before {
1921
- content: "\f25a";
1922
- }
1923
- .fa-hand-peace-o:before {
1924
- content: "\f25b";
1925
- }
1926
- .fa-trademark:before {
1927
- content: "\f25c";
1928
- }
1929
- .fa-registered:before {
1930
- content: "\f25d";
1931
- }
1932
- .fa-creative-commons:before {
1933
- content: "\f25e";
1934
- }
1935
- .fa-gg:before {
1936
- content: "\f260";
1937
- }
1938
- .fa-gg-circle:before {
1939
- content: "\f261";
1940
- }
1941
- .fa-tripadvisor:before {
1942
- content: "\f262";
1943
- }
1944
- .fa-odnoklassniki:before {
1945
- content: "\f263";
1946
- }
1947
- .fa-odnoklassniki-square:before {
1948
- content: "\f264";
1949
- }
1950
- .fa-get-pocket:before {
1951
- content: "\f265";
1952
- }
1953
- .fa-wikipedia-w:before {
1954
- content: "\f266";
1955
- }
1956
- .fa-safari:before {
1957
- content: "\f267";
1958
- }
1959
- .fa-chrome:before {
1960
- content: "\f268";
1961
- }
1962
- .fa-firefox:before {
1963
- content: "\f269";
1964
- }
1965
- .fa-opera:before {
1966
- content: "\f26a";
1967
- }
1968
- .fa-internet-explorer:before {
1969
- content: "\f26b";
1970
- }
1971
- .fa-tv:before,
1972
- .fa-television:before {
1973
- content: "\f26c";
1974
- }
1975
- .fa-contao:before {
1976
- content: "\f26d";
1977
- }
1978
- .fa-500px:before {
1979
- content: "\f26e";
1980
- }
1981
- .fa-amazon:before {
1982
- content: "\f270";
1983
- }
1984
- .fa-calendar-plus-o:before {
1985
- content: "\f271";
1986
- }
1987
- .fa-calendar-minus-o:before {
1988
- content: "\f272";
1989
- }
1990
- .fa-calendar-times-o:before {
1991
- content: "\f273";
1992
- }
1993
- .fa-calendar-check-o:before {
1994
- content: "\f274";
1995
- }
1996
- .fa-industry:before {
1997
- content: "\f275";
1998
- }
1999
- .fa-map-pin:before {
2000
- content: "\f276";
2001
- }
2002
- .fa-map-signs:before {
2003
- content: "\f277";
2004
- }
2005
- .fa-map-o:before {
2006
- content: "\f278";
2007
- }
2008
- .fa-map:before {
2009
- content: "\f279";
2010
- }
2011
- .fa-commenting:before {
2012
- content: "\f27a";
2013
- }
2014
- .fa-commenting-o:before {
2015
- content: "\f27b";
2016
- }
2017
- .fa-houzz:before {
2018
- content: "\f27c";
2019
- }
2020
- .fa-vimeo:before {
2021
- content: "\f27d";
2022
- }
2023
- .fa-black-tie:before {
2024
- content: "\f27e";
2025
- }
2026
- .fa-fonticons:before {
2027
- content: "\f280";
2028
- }
2029
- .fa-reddit-alien:before {
2030
- content: "\f281";
2031
- }
2032
- .fa-edge:before {
2033
- content: "\f282";
2034
- }
2035
- .fa-credit-card-alt:before {
2036
- content: "\f283";
2037
- }
2038
- .fa-codiepie:before {
2039
- content: "\f284";
2040
- }
2041
- .fa-modx:before {
2042
- content: "\f285";
2043
- }
2044
- .fa-fort-awesome:before {
2045
- content: "\f286";
2046
- }
2047
- .fa-usb:before {
2048
- content: "\f287";
2049
- }
2050
- .fa-product-hunt:before {
2051
- content: "\f288";
2052
- }
2053
- .fa-mixcloud:before {
2054
- content: "\f289";
2055
- }
2056
- .fa-scribd:before {
2057
- content: "\f28a";
2058
- }
2059
- .fa-pause-circle:before {
2060
- content: "\f28b";
2061
- }
2062
- .fa-pause-circle-o:before {
2063
- content: "\f28c";
2064
- }
2065
- .fa-stop-circle:before {
2066
- content: "\f28d";
2067
- }
2068
- .fa-stop-circle-o:before {
2069
- content: "\f28e";
2070
- }
2071
- .fa-shopping-bag:before {
2072
- content: "\f290";
2073
- }
2074
- .fa-shopping-basket:before {
2075
- content: "\f291";
2076
- }
2077
- .fa-hashtag:before {
2078
- content: "\f292";
2079
- }
2080
- .fa-bluetooth:before {
2081
- content: "\f293";
2082
- }
2083
- .fa-bluetooth-b:before {
2084
- content: "\f294";
2085
- }
2086
- .fa-percent:before {
2087
- content: "\f295";
2088
- }
2089
- .fa-gitlab:before {
2090
- content: "\f296";
2091
- }
2092
- .fa-wpbeginner:before {
2093
- content: "\f297";
2094
- }
2095
- .fa-wpforms:before {
2096
- content: "\f298";
2097
- }
2098
- .fa-envira:before {
2099
- content: "\f299";
2100
- }
2101
- .fa-universal-access:before {
2102
- content: "\f29a";
2103
- }
2104
- .fa-wheelchair-alt:before {
2105
- content: "\f29b";
2106
- }
2107
- .fa-question-circle-o:before {
2108
- content: "\f29c";
2109
- }
2110
- .fa-blind:before {
2111
- content: "\f29d";
2112
- }
2113
- .fa-audio-description:before {
2114
- content: "\f29e";
2115
- }
2116
- .fa-volume-control-phone:before {
2117
- content: "\f2a0";
2118
- }
2119
- .fa-braille:before {
2120
- content: "\f2a1";
2121
- }
2122
- .fa-assistive-listening-systems:before {
2123
- content: "\f2a2";
2124
- }
2125
- .fa-asl-interpreting:before,
2126
- .fa-american-sign-language-interpreting:before {
2127
- content: "\f2a3";
2128
- }
2129
- .fa-deafness:before,
2130
- .fa-hard-of-hearing:before,
2131
- .fa-deaf:before {
2132
- content: "\f2a4";
2133
- }
2134
- .fa-glide:before {
2135
- content: "\f2a5";
2136
- }
2137
- .fa-glide-g:before {
2138
- content: "\f2a6";
2139
- }
2140
- .fa-signing:before,
2141
- .fa-sign-language:before {
2142
- content: "\f2a7";
2143
- }
2144
- .fa-low-vision:before {
2145
- content: "\f2a8";
2146
- }
2147
- .fa-viadeo:before {
2148
- content: "\f2a9";
2149
- }
2150
- .fa-viadeo-square:before {
2151
- content: "\f2aa";
2152
- }
2153
- .fa-snapchat:before {
2154
- content: "\f2ab";
2155
- }
2156
- .fa-snapchat-ghost:before {
2157
- content: "\f2ac";
2158
- }
2159
- .fa-snapchat-square:before {
2160
- content: "\f2ad";
2161
- }
2162
- .fa-pied-piper:before {
2163
- content: "\f2ae";
2164
- }
2165
- .fa-first-order:before {
2166
- content: "\f2b0";
2167
- }
2168
- .fa-yoast:before {
2169
- content: "\f2b1";
2170
- }
2171
- .fa-themeisle:before {
2172
- content: "\f2b2";
2173
- }
2174
- .fa-google-plus-circle:before,
2175
- .fa-google-plus-official:before {
2176
- content: "\f2b3";
2177
- }
2178
- .fa-fa:before,
2179
- .fa-font-awesome:before {
2180
- content: "\f2b4";
2181
- }
2182
- .fa-handshake-o:before {
2183
- content: "\f2b5";
2184
- }
2185
- .fa-envelope-open:before {
2186
- content: "\f2b6";
2187
- }
2188
- .fa-envelope-open-o:before {
2189
- content: "\f2b7";
2190
- }
2191
- .fa-linode:before {
2192
- content: "\f2b8";
2193
- }
2194
- .fa-address-book:before {
2195
- content: "\f2b9";
2196
- }
2197
- .fa-address-book-o:before {
2198
- content: "\f2ba";
2199
- }
2200
- .fa-vcard:before,
2201
- .fa-address-card:before {
2202
- content: "\f2bb";
2203
- }
2204
- .fa-vcard-o:before,
2205
- .fa-address-card-o:before {
2206
- content: "\f2bc";
2207
- }
2208
- .fa-user-circle:before {
2209
- content: "\f2bd";
2210
- }
2211
- .fa-user-circle-o:before {
2212
- content: "\f2be";
2213
- }
2214
- .fa-user-o:before {
2215
- content: "\f2c0";
2216
- }
2217
- .fa-id-badge:before {
2218
- content: "\f2c1";
2219
- }
2220
- .fa-drivers-license:before,
2221
- .fa-id-card:before {
2222
- content: "\f2c2";
2223
- }
2224
- .fa-drivers-license-o:before,
2225
- .fa-id-card-o:before {
2226
- content: "\f2c3";
2227
- }
2228
- .fa-quora:before {
2229
- content: "\f2c4";
2230
- }
2231
- .fa-free-code-camp:before {
2232
- content: "\f2c5";
2233
- }
2234
- .fa-telegram:before {
2235
- content: "\f2c6";
2236
- }
2237
- .fa-thermometer-4:before,
2238
- .fa-thermometer:before,
2239
- .fa-thermometer-full:before {
2240
- content: "\f2c7";
2241
- }
2242
- .fa-thermometer-3:before,
2243
- .fa-thermometer-three-quarters:before {
2244
- content: "\f2c8";
2245
- }
2246
- .fa-thermometer-2:before,
2247
- .fa-thermometer-half:before {
2248
- content: "\f2c9";
2249
- }
2250
- .fa-thermometer-1:before,
2251
- .fa-thermometer-quarter:before {
2252
- content: "\f2ca";
2253
- }
2254
- .fa-thermometer-0:before,
2255
- .fa-thermometer-empty:before {
2256
- content: "\f2cb";
2257
- }
2258
- .fa-shower:before {
2259
- content: "\f2cc";
2260
- }
2261
- .fa-bathtub:before,
2262
- .fa-s15:before,
2263
- .fa-bath:before {
2264
- content: "\f2cd";
2265
- }
2266
- .fa-podcast:before {
2267
- content: "\f2ce";
2268
- }
2269
- .fa-window-maximize:before {
2270
- content: "\f2d0";
2271
- }
2272
- .fa-window-minimize:before {
2273
- content: "\f2d1";
2274
- }
2275
- .fa-window-restore:before {
2276
- content: "\f2d2";
2277
- }
2278
- .fa-times-rectangle:before,
2279
- .fa-window-close:before {
2280
- content: "\f2d3";
2281
- }
2282
- .fa-times-rectangle-o:before,
2283
- .fa-window-close-o:before {
2284
- content: "\f2d4";
2285
- }
2286
- .fa-bandcamp:before {
2287
- content: "\f2d5";
2288
- }
2289
- .fa-grav:before {
2290
- content: "\f2d6";
2291
- }
2292
- .fa-etsy:before {
2293
- content: "\f2d7";
2294
- }
2295
- .fa-imdb:before {
2296
- content: "\f2d8";
2297
- }
2298
- .fa-ravelry:before {
2299
- content: "\f2d9";
2300
- }
2301
- .fa-eercast:before {
2302
- content: "\f2da";
2303
- }
2304
- .fa-microchip:before {
2305
- content: "\f2db";
2306
- }
2307
- .fa-snowflake-o:before {
2308
- content: "\f2dc";
2309
- }
2310
- .fa-superpowers:before {
2311
- content: "\f2dd";
2312
- }
2313
- .fa-wpexplorer:before {
2314
- content: "\f2de";
2315
- }
2316
- .fa-meetup:before {
2317
- content: "\f2e0";
2318
- }
2319
- .sr-only {
2320
- position: absolute;
2321
- width: 1px;
2322
- height: 1px;
2323
- padding: 0;
2324
- margin: -1px;
2325
- overflow: hidden;
2326
- clip: rect(0, 0, 0, 0);
2327
- border: 0;
2328
- }
2329
- .sr-only-focusable:active,
2330
- .sr-only-focusable:focus {
2331
- position: static;
2332
- width: auto;
2333
- height: auto;
2334
- margin: 0;
2335
- overflow: visible;
2336
- clip: auto;
2337
- }
1
  /*!
2
  * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
3
  * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
4
+ */@font-face{font-family:FontAwesome;src:url(../fonts/fontawesome-webfont.eot?v=4.7.0);src:url(../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0) format('embedded-opentype'),url(../fonts/fontawesome-webfont.woff2?v=4.7.0) format('woff2'),url(../fonts/fontawesome-webfont.woff?v=4.7.0) format('woff'),url(../fonts/fontawesome-webfont.ttf?v=4.7.0) format('truetype'),url(../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular) format('svg');font-weight:400;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{-webkit-transform:scale(1,-1);-ms-transform:scale(1,-1);transform:scale(1,-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-close:before,.fa-remove:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-cog:before,.fa-gear:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-repeat:before,.fa-rotate-right:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-exclamation-triangle:before,.fa-warning:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-cogs:before,.fa-gears:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-floppy-o:before,.fa-save:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-sort:before,.fa-unsorted:before{content:"\f0dc"}.fa-sort-desc:before,.fa-sort-down:before{content:"\f0dd"}.fa-sort-asc:before,.fa-sort-up:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-gavel:before,.fa-legal:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-bolt:before,.fa-flash:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-clipboard:before,.fa-paste:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-chain-broken:before,.fa-unlink:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:"\f150"}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:"\f151"}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:"\f152"}.fa-eur:before,.fa-euro:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-inr:before,.fa-rupee:before{content:"\f156"}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:"\f157"}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:"\f158"}.fa-krw:before,.fa-won:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-try:before,.fa-turkish-lira:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-bank:before,.fa-institution:before,.fa-university:before{content:"\f19c"}.fa-graduation-cap:before,.fa-mortar-board:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:"\f1c5"}.fa-file-archive-o:before,.fa-file-zip-o:before{content:"\f1c6"}.fa-file-audio-o:before,.fa-file-sound-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before,.fa-resistance:before{content:"\f1d0"}.fa-empire:before,.fa-ge:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-paper-plane:before,.fa-send:before{content:"\f1d8"}.fa-paper-plane-o:before,.fa-send-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-bed:before,.fa-hotel:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-y-combinator:before,.fa-yc:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery-full:before,.fa-battery:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-television:before,.fa-tv:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before{content:"\f2a3"}.fa-deaf:before,.fa-deafness:before,.fa-hard-of-hearing:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-sign-language:before,.fa-signing:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-pied-piper:before{content:"\f2ae"}.fa-first-order:before{content:"\f2b0"}.fa-yoast:before{content:"\f2b1"}.fa-themeisle:before{content:"\f2b2"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:"\f2b3"}.fa-fa:before,.fa-font-awesome:before{content:"\f2b4"}.fa-handshake-o:before{content:"\f2b5"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-o:before{content:"\f2b7"}.fa-linode:before{content:"\f2b8"}.fa-address-book:before{content:"\f2b9"}.fa-address-book-o:before{content:"\f2ba"}.fa-address-card:before,.fa-vcard:before{content:"\f2bb"}.fa-address-card-o:before,.fa-vcard-o:before{content:"\f2bc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-circle-o:before{content:"\f2be"}.fa-user-o:before{content:"\f2c0"}.fa-id-badge:before{content:"\f2c1"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:"\f2c3"}.fa-quora:before{content:"\f2c4"}.fa-free-code-camp:before{content:"\f2c5"}.fa-telegram:before{content:"\f2c6"}.fa-thermometer-4:before,.fa-thermometer-full:before,.fa-thermometer:before{content:"\f2c7"}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-shower:before{content:"\f2cc"}.fa-bath:before,.fa-bathtub:before,.fa-s15:before{content:"\f2cd"}.fa-podcast:before{content:"\f2ce"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-times-rectangle:before,.fa-window-close:before{content:"\f2d3"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:"\f2d4"}.fa-bandcamp:before{content:"\f2d5"}.fa-grav:before{content:"\f2d6"}.fa-etsy:before{content:"\f2d7"}.fa-imdb:before{content:"\f2d8"}.fa-ravelry:before{content:"\f2d9"}.fa-eercast:before{content:"\f2da"}.fa-microchip:before{content:"\f2db"}.fa-snowflake-o:before{content:"\f2dc"}.fa-superpowers:before{content:"\f2dd"}.fa-wpexplorer:before{content:"\f2de"}.fa-meetup:before{content:"\f2e0"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/fontawesome-iconpicker.min.css ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Font Awesome Icon Picker
3
+ * https://itsjavi.com/fontawesome-iconpicker/
4
+ *
5
+ * Originally written by (c) 2016 Javi Aguilar
6
+ * Licensed under the MIT License
7
+ * https://github.com/itsjavi/fontawesome-iconpicker/blob/master/LICENSE
8
+ *
9
+ */.iconpicker-popover.popover{position:absolute;top:0;left:0;display:none;max-width:none;padding:1px;text-align:left;width:216px;background:#f7f7f7;z-index:100;border:1px solid #e7e7e7;border-radius:3px}.iconpicker-popover.popover.top,.iconpicker-popover.popover.topLeft,.iconpicker-popover.popover.topLeftCorner,.iconpicker-popover.popover.topRight,.iconpicker-popover.popover.topRightCorner{margin-top:-10px}.iconpicker-popover.popover.right,.iconpicker-popover.popover.rightBottom,.iconpicker-popover.popover.rightTop{margin-left:10px}.iconpicker-popover.popover.bottom,.iconpicker-popover.popover.bottomLeft,.iconpicker-popover.popover.bottomLeftCorner,.iconpicker-popover.popover.bottomRight,.iconpicker-popover.popover.bottomRightCorner{margin-top:10px}.iconpicker-popover.popover.left,.iconpicker-popover.popover.leftBottom,.iconpicker-popover.popover.leftTop{margin-left:-10px}.iconpicker-popover.popover.inline{margin:0 0 12px 0;position:relative;display:inline-block;opacity:1;top:auto;left:auto;bottom:auto;right:auto;max-width:100%;box-shadow:none;z-index:auto;vertical-align:top}.iconpicker-popover.popover.inline>.arrow{display:none}.dropdown-menu .iconpicker-popover.inline{margin:0;border:none}.dropdown-menu.iconpicker-container{padding:0}.iconpicker-popover.popover .popover-title{padding:12px;font-size:13px;line-height:15px;border-bottom:1px solid #ebebeb;background-color:#f7f7f7}.iconpicker-popover.popover .popover-title input[type=search].iconpicker-search{margin:0 0 2px 0}.iconpicker-popover.popover .popover-title-text~input[type=search].iconpicker-search{margin-top:12px}.iconpicker-popover.popover .popover-content{padding:0;text-align:center}.iconpicker-popover .popover-footer{float:none;clear:both;padding:12px;text-align:right;margin:0;border-top:1px solid #ebebeb;background-color:#f7f7f7}.iconpicker-popover .popover-footer:after,.iconpicker-popover .popover-footer:before{content:" ";display:table}.iconpicker-popover .popover-footer:after{clear:both}.iconpicker-popover .popover-footer .iconpicker-btn{margin-left:10px}.iconpicker-popover .popover-footer input[type=search].iconpicker-search{margin-bottom:12px}.iconpicker-popover.popover>.arrow,.iconpicker-popover.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.iconpicker-popover.popover>.arrow{border-width:11px}.iconpicker-popover.popover>.arrow:after{border-width:10px;content:""}.iconpicker-popover.popover.top>.arrow,.iconpicker-popover.popover.topLeft>.arrow,.iconpicker-popover.popover.topRight>.arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999;border-top-color:rgba(0,0,0,.25);bottom:-11px}.iconpicker-popover.popover.top>.arrow:after,.iconpicker-popover.popover.topLeft>.arrow:after,.iconpicker-popover.popover.topRight>.arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#fff}.iconpicker-popover.popover.topLeft>.arrow{left:8px;margin-left:0}.iconpicker-popover.popover.topRight>.arrow{left:auto;right:8px;margin-left:0}.iconpicker-popover.popover.right>.arrow,.iconpicker-popover.popover.rightBottom>.arrow,.iconpicker-popover.popover.rightTop>.arrow{top:50%;left:23px;margin-top:-11px;border-left-width:0;border-right-color:#999;border-right-color:rgba(0,0,0,.25)}.iconpicker-popover.popover.right>.arrow:after,.iconpicker-popover.popover.rightBottom>.arrow:after,.iconpicker-popover.popover.rightTop>.arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#fff}.iconpicker-popover.popover.rightTop>.arrow{top:auto;bottom:8px;margin-top:0}.iconpicker-popover.popover.rightBottom>.arrow{top:8px;margin-top:0}.iconpicker-popover.popover.bottom>.arrow,.iconpicker-popover.popover.bottomLeft>.arrow,.iconpicker-popover.popover.bottomRight>.arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25);top:-11px}.iconpicker-popover.popover.bottom>.arrow:after,.iconpicker-popover.popover.bottomLeft>.arrow:after,.iconpicker-popover.popover.bottomRight>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.iconpicker-popover.popover.bottomLeft>.arrow{left:8px;margin-left:0}.iconpicker-popover.popover.bottomRight>.arrow{left:auto;right:8px;margin-left:0}.iconpicker-popover.popover.left>.arrow,.iconpicker-popover.popover.leftBottom>.arrow,.iconpicker-popover.popover.leftTop>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.iconpicker-popover.popover.left>.arrow:after,.iconpicker-popover.popover.leftBottom>.arrow:after,.iconpicker-popover.popover.leftTop>.arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#fff;bottom:-10px}.iconpicker-popover.popover.leftBottom>.arrow{top:8px;margin-top:0}.iconpicker-popover.popover.leftTop>.arrow{top:auto;bottom:8px;margin-top:0}.iconpicker{position:relative;text-align:left;text-shadow:none;line-height:0;display:block;margin:0;overflow:hidden}.iconpicker *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;position:relative}.iconpicker:after,.iconpicker:before{content:" ";display:table}.iconpicker:after{clear:both}.iconpicker .iconpicker-items{position:relative;clear:both;float:none;padding:12px 0 0 12px;background:#fff;margin:0;overflow:hidden;overflow-y:auto;min-height:49px;max-height:246px}.iconpicker .iconpicker-items:after,.iconpicker .iconpicker-items:before{content:" ";display:table}.iconpicker .iconpicker-items:after{clear:both}.iconpicker .iconpicker-item{float:left;width:14px;height:14px;padding:12px;margin:0 12px 12px 0;text-align:center;cursor:pointer;border-radius:3px;font-size:14px;box-shadow:0 0 0 1px #ddd;color:inherit}.iconpicker .iconpicker-item:hover:not(.iconpicker-selected){background-color:#eee}.iconpicker .iconpicker-item.iconpicker-selected{box-shadow:none;color:#fff;background-color:#ed832f!important}.iconpicker-component{cursor:pointer}a.iconpicker-selected{background:#ed832f!important}
css/jquery-ui.min.css ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ /*! jQuery UI - v1.11.2 - 2014-12-09
2
+ * http://jqueryui.com
3
+ * Includes: core.css, draggable.css, resizable.css, selectable.css, sortable.css, accordion.css, autocomplete.css, button.css, datepicker.css, dialog.css, menu.css, progressbar.css, selectmenu.css, slider.css, spinner.css, tabs.css, tooltip.css, theme.css
4
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
5
+ * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:after,.ui-helper-clearfix:before{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-autohide .ui-resizable-handle,.ui-resizable-disabled .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable{-ms-touch-action:none;touch-action:none}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted #000}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0 0;padding:.5em .5em .5em .7em;min-height:0;font-size:100%}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:active,.ui-button:hover,.ui-button:link,.ui-button:visited{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-icons-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-icons-only .ui-button-icon-primary,.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary{left:.5em}.ui-button-icons-only .ui-button-icon-secondary,.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}button.ui-button::-moz-focus-inner,input.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-next,.ui-datepicker .ui-datepicker-prev{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-next-hover,.ui-datepicker .ui-datepicker-prev-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-next span,.ui-datepicker .ui-datepicker-prev span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:700;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td a,.ui-datepicker td span{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-dialog{overflow:hidden;position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:0 0;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{position:relative;margin:0;padding:3px 1em 3px .4em;cursor:pointer;min-height:0;list-style-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-active,.ui-menu .ui-state-focus{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url(data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==);height:100%;opacity:.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-selectmenu-menu{padding:0;margin:0;position:absolute;top:0;left:0;display:none}.ui-selectmenu-menu .ui-menu{overflow:auto;overflow-x:hidden;padding-bottom:1px}.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup{font-size:1em;font-weight:700;line-height:1.5;padding:2px .4em;margin:.5em 0 0 0;height:auto;border:0}.ui-selectmenu-open{display:block}.ui-selectmenu-button{display:inline-block;overflow:hidden;position:relative;text-decoration:none;cursor:pointer}.ui-selectmenu-button span.ui-icon{right:.5em;left:auto;margin-top:-8px;position:absolute;top:50%}.ui-selectmenu-button span.ui-selectmenu-text{text-align:left;padding:.4em 2.1em .4em 1em;display:block;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:0 0;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:none;border-bottom:none;border-right:none}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:0 0}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget button,.ui-widget input,.ui-widget select,.ui-widget textarea{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{color:#222;font-weight:700}.ui-widget-header a{color:#222}.ui-tabs-anchor:active{box-shadow:none!important}.ui-tabs-anchor:focus{-webkit-box-shadow:none!important;box-shadow:none!important}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{background:#e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;font-weight:400;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-focus,.ui-state-hover,.ui-widget-content .ui-state-focus,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-focus,.ui-widget-header .ui-state-hover{background:#dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;font-weight:400;color:#212121}.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited,.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:400;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:700}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:400}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}.ui-state-focus .ui-icon,.ui-state-hover .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-left,.ui-corner-tl,.ui-corner-top{border-top-left-radius:4px}.ui-corner-all,.ui-corner-right,.ui-corner-top,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bl,.ui-corner-bottom,.ui-corner-left{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-br,.ui-corner-right{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}.ui-tabs-panel a{color:#0073aa;text-decoration:underline}
css/node_history_styles.min.css ADDED
@@ -0,0 +1 @@
 
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
@@ -70,7 +70,7 @@
70
  height: 40px;
71
  width: 40px;
72
  left: 12px;
73
- position: absolute;
74
  }
75
 
76
  .chatArea .messages a{
@@ -1218,7 +1218,7 @@ span.wplc_system_notification {
1218
  /* Main containers of the other settings (Surveys, History ...) */
1219
  #wpbody-content #screen-meta + .wplc_wrap div,
1220
  #wpbody-content #screen-meta + .wplc_list_table {
1221
- display: block;
1222
  position: relative;
1223
  left: 0px;
1224
  top: 0px;
70
  height: 40px;
71
  width: 40px;
72
  left: 12px;
73
+ /*position: absolute;*/
74
  }
75
 
76
  .chatArea .messages a{
1218
  /* Main containers of the other settings (Surveys, History ...) */
1219
  #wpbody-content #screen-meta + .wplc_wrap div,
1220
  #wpbody-content #screen-meta + .wplc_list_table {
1221
+ /*display: block;*/
1222
  position: relative;
1223
  left: 0px;
1224
  top: 0px;
css/remote_dash_styles.min.css ADDED
@@ -0,0 +1 @@
 
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.min.css ADDED
@@ -0,0 +1 @@
 
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/switchery.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .switchery{background-color:#fff;border:1px solid #dfdfdf;border-radius:20px;cursor:pointer;display:inline-block;height:30px;position:relative;vertical-align:middle;width:50px;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;box-sizing:content-box;background-clip:content-box}.switchery>small{background:#fff;border-radius:100%;box-shadow:0 1px 3px rgba(0,0,0,.4);height:30px;position:absolute;top:0;width:30px}.switchery-small{border-radius:20px;height:20px;width:33px}.switchery-small>small{height:20px;width:20px}.switchery-large{border-radius:40px;height:40px;width:66px}.switchery-large>small{height:40px;width:40px}
css/themes/classic.css CHANGED
@@ -272,11 +272,7 @@
272
  padding-right: 45px;
273
  min-height: 220px;
274
  }
275
- /*
276
- .wplc_left #wplc_chatbox, .wplc_right #wplc_chatbox{
277
- height: 330px !important;
278
- width: 240px;
279
- }*/
280
  #wplc_user_message_div {
281
  border-top:1px solid #eee;
282
  background-color:#FFF;
272
  padding-right: 45px;
273
  min-height: 220px;
274
  }
275
+
 
 
 
 
276
  #wplc_user_message_div {
277
  border-top:1px solid #eee;
278
  background-color:#FFF;
css/themes/classic.min.css ADDED
@@ -0,0 +1 @@
 
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
@@ -211,7 +211,7 @@
211
  padding-bottom: 10px;
212
  padding: 16px;
213
  color: #fff;
214
- padding-top:5px;
215
  }
216
  #wp-live-chat-2-inner {
217
  padding: 20px 12px 26px;
@@ -341,96 +341,6 @@ z-index: 2147483000;
341
  overflow: hidden;
342
  height: 32px;
343
  }
344
- /*
345
- .wplc_close.wplc_left #wp-live-chat-1{
346
- -ms-transform: rotate(90deg);
347
- -moz-transform: rotate(90deg);
348
- -webkit-transform: rotate(90deg);
349
- transform: rotate(90deg);
350
- -ms-transform-origin: left top 0;
351
- -moz-transform-origin: left top 0;
352
- -webkit-transform-origin: left top 0;
353
- transform-origin: left top 0;
354
- float: left;
355
- width: 195px;
356
- position: absolute;
357
- top: 27px;
358
- padding-left: 0;
359
- left: 39px;
360
- }
361
- .wplc_left #wp-live-chat-header{
362
- border-radius: 62px 62px;
363
- }
364
-
365
- .wplc_close.wplc_left #wp-live-chat-header{
366
- position: absolute;
367
- top: 0;
368
- width: 62px;
369
- bottom: 0;
370
- right: 0;
371
- left: 15px;
372
- }
373
- .wplc_open.wplc_left #wp-live-chat-header{
374
- border-radius: 62px;
375
- }
376
-
377
- .wplc_close.wplc_left .wp-live-chat-wrapper, .wplc_close.wplc_right .wp-live-chat-wrapper{
378
- position: relative;
379
- height: 250px;
380
- }
381
- .wplc_left{
382
- border-radius: 0px 5px 5px 0 !important;
383
- }
384
- .wplc_close.wplc_left{
385
- padding-right: 45px;
386
- height: 120px;
387
- }
388
-
389
-
390
- .wplc_close.wplc_right #wp-live-chat-1{
391
- -ms-transform: rotate(-90deg);
392
- -moz-transform: rotate(-90deg);
393
- -webkit-transform: rotate(-90deg);
394
- transform: rotate(-90deg);
395
- -ms-transform-origin: 0 0 0;
396
- -moz-transform-origin: 0 0 0;
397
- -webkit-transform-origin: 0 0 0;
398
- transform-origin: 0 0 0;
399
- float: left;
400
- width: 180px;
401
- padding:0 !important;
402
- bottom: 0;
403
- position: absolute;
404
- left: 8px;
405
- }
406
-
407
- .wplc_close.wplc_right #wp-live-chat-header{
408
- position: absolute;
409
- top: 0;
410
- bottom: 0;
411
- left: 0;
412
- }
413
-
414
- .wplc_close.wplc_right{
415
- padding-left: 75px;
416
- height: 120px;
417
- border-radius: 5px 0px 0px 5px !important;
418
- }
419
- .wplc_right{
420
- border-radius: 5px 0px 0px 5px !important;
421
- }
422
- .wplc_close.wplc_left #wp-live-chat-image{
423
- top: 25px;
424
- left: 35px;
425
- }
426
- .wplc_close.wplc_right #wp-live-chat-image {
427
- bottom: 18px;
428
- left: initial;
429
- right: 38px;
430
- top: initial;
431
- }
432
- */
433
-
434
 
435
  .wplc-admin-message {
436
 
@@ -507,14 +417,8 @@ z-index: 2147483000;
507
  }
508
 
509
  #wplc_chatbox_header {
510
- /* position: absolute; */
511
- /* background-color: #FFF; */
512
- /* background: rgba(255,255,255,.98); */
513
  top: 0;
514
  right: 0;
515
- /* height: 60px; */
516
- /* width: 367px; */
517
- /* border-bottom: 1px solid #eee; */
518
  border-top-left-radius: 10px;
519
  border-top-right-radius: 10px;
520
  box-shadow: 0 5px 20px -2px rgba(0,0,0,.16) !important;
@@ -618,28 +522,6 @@ z-index: 2147483000;
618
  z-index: 9999999;
619
  height:auto;
620
  }
621
- /*
622
- #wplc_hovercard:before {
623
- content: "";
624
- position: absolute;
625
- bottom: -9px;
626
- left: 240px;
627
- border-width: 9px 9px 0;
628
- border-style: solid;
629
- border-color: #ccc transparent;
630
- display: block;
631
- width: 0;}
632
- #wplc_hovercard:after {
633
- content: "";
634
- position: absolute;
635
- bottom: -8px;
636
- left: 241px;
637
- border-width: 8px 8px 0;
638
- border-style: solid;
639
- border-color: #fafafb transparent;
640
- display: block;
641
- width: 0;
642
- }*/
643
 
644
  .wplc_button_standard {
645
  border: 1px solid #ED832F;
@@ -827,17 +709,7 @@ input#nifty_ratings_comment {
827
  position: relative;
828
  float: left;
829
  }
830
- /*
831
- #nifty_ratings_form:after {
832
- top: 28px;
833
- left: 128px;
834
- border-width: 6px 6px 0 6;
835
- border-color: transparent #666;
836
- content: "";
837
- position: absolute;
838
- border-style: solid;
839
- }
840
- */
841
  #nifty_ratings_comment {
842
  height: 25px !important;
843
  margin-left: 2px;
211
  padding-bottom: 10px;
212
  padding: 16px;
213
  color: #fff;
214
+ padding-top:10px;
215
  }
216
  #wp-live-chat-2-inner {
217
  padding: 20px 12px 26px;
341
  overflow: hidden;
342
  height: 32px;
343
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
344
 
345
  .wplc-admin-message {
346
 
417
  }
418
 
419
  #wplc_chatbox_header {
 
 
 
420
  top: 0;
421
  right: 0;
 
 
 
422
  border-top-left-radius: 10px;
423
  border-top-right-radius: 10px;
424
  box-shadow: 0 5px 20px -2px rgba(0,0,0,.16) !important;
522
  z-index: 9999999;
523
  height:auto;
524
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
525
 
526
  .wplc_button_standard {
527
  border: 1px solid #ED832F;
709
  position: relative;
710
  float: left;
711
  }
712
+
 
 
 
 
 
 
 
 
 
 
713
  #nifty_ratings_comment {
714
  height: 25px !important;
715
  margin-left: 2px;
css/themes/modern.min.css ADDED
@@ -0,0 +1 @@
 
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 ADDED
@@ -0,0 +1 @@
 
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 ADDED
@@ -0,0 +1 @@
 
1
+ #wplc_social_holder{left:-18px}
css/themes/position-left.min.css ADDED
@@ -0,0 +1 @@
 
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 ADDED
@@ -0,0 +1 @@
 
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.min.css ADDED
@@ -0,0 +1 @@
 
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.min.css ADDED
@@ -0,0 +1 @@
 
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 ADDED
@@ -0,0 +1 @@
 
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.min.css ADDED
@@ -0,0 +1 @@
 
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.min.css ADDED
@@ -0,0 +1 @@
 
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.min.css ADDED
@@ -0,0 +1 @@
 
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 ADDED
@@ -0,0 +1 @@
 
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.css ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wplc-voice-notes {
2
+ display: none;
3
+ width: 100%;
4
+ position: fixed;
5
+ right: 0;
6
+ bottom: -100px;
7
+ left: 0;
8
+ z-index: 10000;
9
+ transition: bottom .3s;
10
+ padding: 20px;
11
+ background: rgba(0,0,0,.8);
12
+ color: #ccc;
13
+ }
14
+
15
+ .wplc-voice-notes.is-active {
16
+ display: block;
17
+ bottom: 0;
18
+ }
19
+
20
+ .wplc-voice-notes__close {
21
+ float: right;
22
+ position: relative;
23
+ right: 70px;
24
+ bottom: 0;
25
+ font-size: 19px !important;
26
+ cursor: pointer;
27
+ }
28
+
29
+ .wplc-voice-notes{
30
+ display: none;
31
+ }
32
+
33
+ #nifty_wrapper .messages .wplc-admin-message .wplc-msg-content-audio,
34
+ #nifty_wrapper .messages .wplc-user-message .wplc-msg-content-audio {
35
+ height: 30px;
36
+ top: 4px;
37
+ padding: 0 10px 0 0;
38
+ background-color: #e0e0e0;
39
+ border-radius: 30px;
40
+ }
41
+
42
+ #nifty_wrapper .messages .wplc-admin-message .wplc-msg-content-audio:hover,
43
+ #nifty_wrapper .messages .wplc-user-message .wplc-msg-content-audio:hover {
44
+ cursor: pointer;
45
+ }
46
+
47
+ #nifty_wrapper .messages .wplc-user-message .wplc-msg-content-audio {
48
+ top: 12px;
49
+ }
50
+
51
+ #nifty_wrapper .messages .wplc-admin-message .wplc-msg-content-audio:after,
52
+ #nifty_wrapper .messages .wplc-user-message .wplc-msg-content-audio:before {
53
+ content: none;
54
+ }
55
+
56
+ .wplc-msg-content-audio-icon {
57
+ display: inline-block;
58
+ width: 30px;
59
+ height: 30px;
60
+ position: relative;
61
+ margin-right: 5px;
62
+ background-color: #0776b8;
63
+ border-radius: 30px;
64
+ font-family: FontAwesome;
65
+ }
66
+
67
+ .wplc-msg-content-audio-icon:after {
68
+ position: absolute;
69
+ top: 7px;
70
+ left: 11px;
71
+ content: '\f04b';
72
+ font-size: 13px;
73
+ }
74
+
75
+ .wplc-msg-content-audio .messageBody {
76
+ float: right;
77
+ vertical-align: middle;
78
+ }
79
+
80
+ #nifty_wrapper .wplc-msg-content-audio .messageBody a {
81
+ outline: 0;
82
+ color: #333 !important;
83
+ font-size: 15px;
84
+ line-height: 30px;
85
+ text-decoration: none !important;
86
+ }
87
+
88
+ #nifty_wrapper .wplc-msg-content-audio .messageBody a:active,
89
+ #nifty_wrapper .wplc-msg-content-audio .messageBody a:focus {
90
+ outline: 0;
91
+ box-shadow: none;
92
+ }
93
+
94
+ .nifty_voice_notes_icon_dashboard {
95
+ width: 25px;
96
+ height: 25px;
97
+ position: absolute;
98
+ top: 10px;
99
+ right: 60px;
100
+ background-color: #333333;
101
+ border-radius: 20px;
102
+ color: #fff;
103
+ cursor: pointer;
104
+ }
105
+
106
+ .nifty_voice_notes_icon_dashboard i {
107
+ position: relative;
108
+ left: 8px;
109
+ line-height: 25px;
110
+ }
111
+
112
+ .nifty_voice_notes_icon_dashboard_off {
113
+ left: 7px;
114
+ }
115
+
116
+ .nifty_voice_notes_icon_dashboard_on {
117
+ display: none;
118
+ }
119
+
120
+ .is-audio-active .nifty_voice_notes_icon_dashboard_on {
121
+ display: block;
122
+ }
123
+
124
+
125
+ .is-audio-active .nifty_voice_notes_icon_dashboard_off {
126
+ display: none;
127
+ }
128
+
129
+ .nifty_voice_notes_icon_dashboard:hover,
130
+ .nifty_voice_notes_icon_dashboard.is-audio-active {
131
+ background-color: #075077;
132
+ }
133
+
134
+ .nifty_voice_notes_icon_dashboard.is-audio-active:hover {
135
+ cursor: default;
136
+ }
137
+
138
+ .wplc-voice-note-toggle.recording{
139
+ color: #333;
140
+
141
+ animation-name: recording_fade;
142
+ animation-direction: alternate;
143
+ animation-duration: 1s;
144
+ animation-iteration-count: infinite;
145
+ }
146
+
147
+ .wplc-msg-content.wplc-msg-content-audio .messageBody {
148
+ width: 150px !important;
149
+ }
150
+
151
+ @keyframes recording_fade{
152
+ to{color: #333;}
153
+ from{color: #cc0e0e;}
154
+ }
155
+
css/voice_note_admin.min.css ADDED
@@ -0,0 +1 @@
 
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.css ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ #wplc_chatbox .wplc-user-message-audio {
3
+ height: 30px;
4
+ top: 4px;
5
+ padding: 0 10px 0 0 !important;
6
+ border-radius: 13px !important;
7
+ background-color: #e0e0e0 !important;
8
+ border: none !important;
9
+ }
10
+
11
+ #wplc_chatbox .wplc-admin-message.wplc-user-message-audio {
12
+ padding-right: 35px !important;
13
+ padding-left: 10px !important;
14
+ }
15
+
16
+ .wplc-user-message-audio:before {
17
+ content: none !important;
18
+ }
19
+
20
+ #wplc_chatbox .wplc-user-message-audio .messageBody a {
21
+ outline: 0;
22
+ color: #333 !important;
23
+ font-size: 15px;
24
+ line-height: 30px;
25
+ text-decoration: none !important;
26
+ }
27
+
28
+ #wplc_chatbox .wplc-user-message-audio .messageBody a:hover,
29
+ #wplc_chatbox .wplc-user-message-audio .messageBody a:focus,
30
+ #wplc_chatbox .wplc-user-message-audio .messageBody a:active {
31
+ outline: 0;
32
+ }
33
+
34
+ .wplc-msg-content-audio-icon {
35
+ display: inline-block;
36
+ width: 30px;
37
+ height: 30px;
38
+ position: relative;
39
+ margin-right: 5px;
40
+ background-color: #0776b8;
41
+ border-radius: 30px;
42
+ font-family: FontAwesome;
43
+ cursor: pointer;
44
+ }
45
+
46
+ .wplc-msg-content-audio-icon:after {
47
+ position: absolute;
48
+ top: 6px;
49
+ left: 11px;
50
+ content: '\f04b';
51
+ font-size: 13px;
52
+ }
53
+
54
+ .wplc-admin-message .wplc-msg-content-audio-icon {
55
+ position: absolute;
56
+ right: 0;
57
+ margin-right: 0;
58
+ margin-left: 5px;
59
+ }
60
+
61
+ .wplc-msg-content-audio .messageBody {
62
+ float: right;
63
+ vertical-align: middle;
64
+ }
65
+
66
+ .wplc-voice-note-toggle {
67
+ position: absolute;
68
+ z-index: 99;
69
+ width: 22px;
70
+ height: 22px;
71
+ border-radius: 30px;
72
+ font-size: 13px !important;
73
+ line-height: 23px !important;
74
+ text-align: center;
75
+ cursor: pointer;
76
+ margin-top: 20px;
77
+ margin-left: 5px;
78
+ }
79
+
80
+ #wp-live-chat.classic .wplc-voice-note-toggle {
81
+ margin-top: 45px;
82
+ }
83
+
84
+ .wplc-voice-note-toggle.recording{
85
+
86
+ animation-name: recording_fade;
87
+ animation-direction: alternate;
88
+ animation-duration: 1s;
89
+ animation-iteration-count: infinite;
90
+ }
91
+
92
+ .wplc-msg-content.wplc-msg-content-audio .messageBody {
93
+ width: 150px !important;
94
+ }
95
+
96
+
97
+ @keyframes recording_fade{
98
+ to{background: inherit;}
99
+ from{background: #cc0e0e;}
100
+ }
css/voice_notes_user.min.css ADDED
@@ -0,0 +1 @@
 
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.min.css ADDED
@@ -0,0 +1 @@
 
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.min.css ADDED
@@ -0,0 +1 @@
 
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 ADDED
@@ -0,0 +1 @@
 
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 ADDED
@@ -0,0 +1 @@
 
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 ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wplc_add_new_btn{
2
+ margin-left: 4px;
3
+ padding: 4px 8px;
4
+ position: relative;
5
+ top: -1px;
6
+ text-decoration: none;
7
+ border: none;
8
+ -webkit-border-radius: 2px;
9
+ border-radius: 2px;
10
+ background: #e0e0e0;
11
+ text-shadow: none;
12
+ font-weight: 600;
13
+ font-size: 13px;
14
+ }
15
+
16
+ .wplc_add_new_btn:hover{
17
+ color:white;
18
+ background: #0073aa;
19
+ }
20
+
21
+ .wplc_trigger_status{
22
+ width: 70px;
23
+ border-radius: 2px;
24
+ -webkit-border-radius: 2px;
25
+ -moz-border-radius: 2px;
26
+ -o-border-radius: 2px;
27
+ text-align: center;
28
+ }
29
+
30
+ .wplc_trigger_enabled{
31
+ background-color: #158500;
32
+ color: white;
33
+ }
34
+
35
+ .wplc_trigger_disabled{
36
+ background-color: lightgrey;
37
+ }
38
+
39
+ .wplc_trigger_status a {
40
+ color:inherit;
41
+ }
42
+ #reporting_tabs {
43
+ border: none !important;
44
+
45
+ box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
46
+ -webkit-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
47
+ -moz-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
48
+ -o-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
49
+ }
50
+
51
+ .wplc_roi_report_list {
52
+ display: inline-block;
53
+ width: 30%;
54
+ border-right: 1px solid #818181;
55
+ min-height: 745px;
56
+ max-height: 745px;
57
+ overflow-y: auto;
58
+ }
59
+
60
+ .wplc_roi_report_list_item {
61
+ height: 40px;
62
+ padding: 10px;
63
+ line-height: 40px;
64
+
65
+ transition:background 0.5s;
66
+ -webkit-transition:background 0.5s;
67
+ -moz-transition:background 0.5s;
68
+ -o-transition:background 0.5s;
69
+ }
70
+
71
+ .wplc_roi_report_list_item:hover {
72
+ height: 40px;
73
+ padding: 10px;
74
+ background:#f3f3f3;
75
+ line-height: 40px;
76
+ cursor: pointer;
77
+ }
78
+
79
+ .wplc_roi_report_content{
80
+ display: inline-block;
81
+ width: 65%;
82
+ vertical-align: top;
83
+ }
84
+
85
+ .wplc_roi_report_content {
86
+ padding: 10px;
87
+ }
css/wplc_styles_admin_pro.min.css ADDED
@@ -0,0 +1 @@
 
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 ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ #wplc_chatmsg {
2
+ width: 90% !important;
3
+ }
4
+
5
+ .modern .wdt-emoji-picker {
6
+ right: 84px !important;
7
+ }
8
+
css/wplc_styles_pro.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #wplc_chatmsg{width:90%!important}.modern .wdt-emoji-picker{right:84px!important}
css/wplcstyle.min.css ADDED
@@ -0,0 +1 @@
 
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}}
css/wplcstyle_old.css DELETED
@@ -1,352 +0,0 @@
1
- #wp-live-chat textarea {
2
- width: 100%;
3
- height: 100px;
4
- }
5
- #wp-live-chat input, #wp-live-chat textarea {
6
- border: 1px solid rgba(0, 0, 0, 0.1);
7
- border-radius: 2px;
8
- color: #2b2b2b;
9
- padding: 8px 10px 7px;
10
- -webkit-box-sizing: border-box;
11
- -moz-box-sizing: border-box;
12
- box-sizing: border-box;
13
- height: inherit;
14
- }
15
- #wplc_chatbox {
16
- padding: 5px;
17
- height: 200px;
18
- overflow-y: auto;
19
- overflow-x:hidden;
20
- -webkit-box-shadow: inset 0px 5px 5px -4px rgba(50, 50, 50, 0.5);
21
- -moz-box-shadow: inset 0px 5px 5px -4px rgba(50, 50, 50, 0.5);
22
- box-shadow: inset 0px 5px 5px -4px rgba(50, 50, 50, 0.5);
23
- }
24
-
25
-
26
- #wp-live-chat td {
27
- padding: 5px;
28
- padding-left: 10px;
29
- }
30
-
31
- #wp-live-chat table {
32
- border: 0 !important;
33
- }
34
-
35
- #wp-live-chat table td {
36
- border: 0 !important;
37
- }
38
-
39
- #wp-live-chat h4 {
40
- font-size: 20px;
41
- margin: 3px;
42
- }
43
-
44
- #wp-live-chat p {
45
- font-size: 14px;
46
- margin: 3px;
47
- }
48
-
49
- #wp-live-chat #wplc-sb {
50
- font-size: 14px;
51
- font-weight: 700;
52
- }
53
-
54
- #wp-live-chat-4 {
55
- }
56
- #wp-live-chat-3 {
57
- padding: 10px;
58
- text-align: center;
59
- }
60
-
61
- #wp-live-chat {
62
- position: fixed;
63
- z-index: 105;
64
- display: block;
65
- background: #fff;
66
- -webkit-box-shadow: 0px 0px 5px 0px rgba(50, 50, 50, 0.5);
67
- -moz-box-shadow: 0px 0px 5px 0px rgba(50, 50, 50, 0.5);
68
- box-shadow: 0px 0px 5px 0px rgba(50, 50, 50, 0.5);
69
- border-radius: 5px 5px 0 0 ;
70
- color:#999;
71
- max-width: 280px;
72
- max-height: 400px;
73
- z-index: 9999;
74
- }
75
-
76
- #wp-live-chat-1 {
77
- cursor: pointer;
78
- padding: 5px;
79
- padding-left: 20px;
80
- padding-right: 20px;
81
- font-size: 14px;
82
- color: #FFF;
83
- }
84
-
85
- #wp-live-chat-minimize {
86
- position: absolute;
87
- right: 23px;
88
- top: 4px;
89
- cursor: pointer;
90
- height: 14px;
91
- padding: 0 3px;
92
- border-radius: 2px;
93
- background-color: rgba(0, 0, 0, 0.4);
94
- font-size: 10px;
95
- -webkit-box-sizing: border-box;
96
- -moz-box-sizing: border-box;
97
- box-sizing: border-box;
98
- width: 14px;
99
- padding-top: 6px;
100
- }
101
-
102
- #wp-live-chat-close {
103
- position: absolute;
104
- right: 5px;
105
- top: 4px;
106
- cursor: pointer;
107
- border-radius: 2px;
108
- background-color: rgba(0, 0, 0, 0.4);
109
- font-size: 12px;
110
- vertical-align: middle;
111
- height: 14px;
112
- width: 14px;
113
- text-align: center;
114
- vertical-align: bottom;
115
- padding-top: 1px;
116
- -webkit-box-sizing: border-box;
117
- -moz-box-sizing: border-box;
118
- box-sizing: border-box;
119
- }
120
-
121
-
122
- #wp-live-chat-2-info {
123
- font-size: 13px;
124
- display: block;
125
- width: 212px;
126
- overflow: hidden;
127
- text-align: center;
128
- margin: 0 auto;
129
- }
130
-
131
- #wp-live-chat-2-img {
132
- padding-bottom: 5px;
133
- }
134
-
135
- #wplc_chatmsg {
136
- width: 100%;
137
- }
138
-
139
- .wplc_offline {
140
- font-size: 12px;
141
- font-weight: 700;
142
- }
143
-
144
- .wplc_logo_class {
145
- max-width: 250px;
146
- }
147
- #wp-live-chat-header{
148
- padding: 10px 0 0;
149
- border-radius: 5px 5px 0 0;
150
- position:relative;
151
- }
152
- #wp-live-chat-image{
153
- position: absolute;
154
- width: 40px;
155
- padding:4px;
156
- max-height: 40px;
157
- background: #fff;
158
- -webkit-border-radius: 3px;
159
- -moz-border-radius: 3px;
160
- border-radius: 3px;
161
- top: -35px;
162
- left: 20px;
163
- -webkit-box-shadow: 0px 0px 5px 0px rgba(100, 100, 100, 0.7);
164
- -moz-box-shadow: 0px 0px 5px 0px rgba(100, 100, 100, 0.7);
165
- box-shadow: 0px 0px 5px 0px rgba(100, 100, 100, 0.7);
166
- }
167
- #wp-live-chat-image img {
168
- -webkit-border-radius: 3px;
169
- -moz-border-radius: 3px;
170
- border-radius: 3px;
171
- }
172
- #wp-live-chat-2 {
173
- padding:5px;
174
- }
175
- #wp-live-chat-2 input{
176
- display:block;
177
- margin:5px 0;
178
- width:100%;
179
- -webkit-box-sizing: border-box;
180
- -moz-box-sizing: border-box;
181
- box-sizing: border-box;
182
- height: inherit;
183
- background-image: none;
184
- filter:none;
185
- text-shadow: none;
186
- }
187
- .wplc-clear-float-message{
188
- clear: both;
189
- }
190
-
191
-
192
- #wplc_message_div{
193
- text-align: center;
194
- }
195
- #wp-live-chat-inner-image-div{
196
- overflow: hidden;
197
- height: 32px;
198
- }
199
-
200
- .wplc_close.wplc_left #wp-live-chat-1{
201
- -ms-transform: rotate(90deg);
202
- -moz-transform: rotate(90deg);
203
- -webkit-transform: rotate(90deg);
204
- transform: rotate(90deg);
205
- -ms-transform-origin: left top 0;
206
- -moz-transform-origin: left top 0;
207
- -webkit-transform-origin: left top 0;
208
- transform-origin: left top 0;
209
- float: left;
210
- width: 195px;
211
- position: absolute;
212
- top: 27px;
213
- padding-left: 0;
214
- left: 39px;
215
- }
216
- .wplc_left #wp-live-chat-header{
217
- border-radius: 0px 5px 5px 0;
218
- }
219
- .wplc_close.wplc_left #wp-live-chat-header{
220
- position: absolute;
221
- top: 0;
222
- width: 45px;
223
- bottom: 0;
224
- right: 0;
225
- }
226
- .wplc_open.wplc_left #wp-live-chat-header{
227
- border-radius: 0px 5px 0px 0;
228
- }
229
-
230
- .wplc_close.wplc_left .wp-live-chat-wrapper, .wplc_close.wplc_right .wp-live-chat-wrapper{
231
- position: relative;
232
- height: 250px;
233
- }
234
- .wplc_left{
235
- border-radius: 0px 5px 5px 0 !important;
236
- }
237
- .wplc_close.wplc_left{
238
- padding-right: 45px;
239
- height: 220px;
240
- }
241
-
242
- .wplc_left #wplc_chatbox, .wplc_right #wplc_chatbox{
243
- height: 330px !important;
244
- width: 240px;
245
- }
246
-
247
- .wplc_close.wplc_right #wp-live-chat-1{
248
- -ms-transform: rotate(-90deg);
249
- -moz-transform: rotate(-90deg);
250
- -webkit-transform: rotate(-90deg);
251
- transform: rotate(-90deg);
252
- -ms-transform-origin: 0 0 0;
253
- -moz-transform-origin: 0 0 0;
254
- -webkit-transform-origin: 0 0 0;
255
- transform-origin: 0 0 0;
256
- float: left;
257
- width: 180px;
258
- padding:0 !important;
259
- bottom: 0;
260
- position: absolute;
261
- left: 8px;
262
- }
263
-
264
- .wplc_close.wplc_right #wp-live-chat-header{
265
- position: absolute;
266
- top: 0;
267
- width: 45px;
268
- bottom: 0;
269
- left: 0;
270
- border-radius: 5px 0px 0px 5px;
271
- }
272
-
273
- .wplc_close.wplc_right{
274
- padding-left: 45px;
275
- height: 220px;
276
- border-radius: 5px 0px 0px 5px !important;
277
- }
278
- .wplc_open.wplc_right #wp-live-chat-header{
279
- border-radius: 5px 0px 0px 0;
280
- }
281
- .wplc_right{
282
- border-radius: 5px 0px 0px 5px !important;
283
- }
284
- .wplc_close.wplc_left #wp-live-chat-image{
285
- top: 25px;
286
- left: 35px;
287
- }
288
- .wplc_close.wplc_right #wp-live-chat-image {
289
- bottom: 18px;
290
- left: initial;
291
- right: 38px;
292
- top: initial;
293
- }
294
-
295
-
296
-
297
-
298
- .wplc-admin-message {
299
-
300
- padding:10px;
301
- -webkit-border-radius: 2px;
302
- -moz-border-radius: 2px;
303
- border-radius: 2px;
304
- border: 1px solid #ccc;
305
- margin-top:2px;
306
- background-color:#EEE;
307
- display: inline-block;
308
- float: left;
309
- clear:both;
310
- margin-bottom: 3px;
311
-
312
-
313
- }
314
-
315
- .wplc-user-message {
316
-
317
- padding:10px;
318
- -webkit-border-radius: 2px;
319
- -moz-border-radius: 2px;
320
- border-radius: 2px;
321
- border: 1px solid #ffdb99;
322
- margin-top:2px;
323
- background-color:#fff6ef;
324
- color:#000;
325
- display: inline-block;
326
- float: right;
327
- clear:both;
328
- margin-bottom: 3px;
329
-
330
- }
331
-
332
- .chat_time {
333
- display:block;
334
- width:100%;
335
- text-align:center;
336
- font-size:0.8em;
337
- color:#ccc;
338
- clear:both;
339
-
340
- }
341
-
342
- .wplc-user-message hr, .wplc-admin-message hr{
343
- margin-bottom: 0px !important;
344
- }
345
-
346
- /* MOVE TO CHAT EXPERIENCE PLUGIN */
347
-
348
- #wplc_star_rating{
349
- text-align: center;
350
- padding: 10px;
351
- }
352
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
functions.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- $wplc_basic_plugin_url = WPLC_BASIC_PLUGIN_URL;
3
 
4
  function wplc_log_user_on_page($name,$email,$session, $is_mobile = false) {
5
  global $wpdb;
@@ -8,26 +8,6 @@ function wplc_log_user_on_page($name,$email,$session, $is_mobile = false) {
8
  $wplc_settings = get_option('WPLC_SETTINGS');
9
 
10
 
11
- /** DEPRECATED DUE TO GDPR */
12
- /*if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
13
-
14
- if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {
15
- $ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];
16
- } else {
17
- $ip_address = $_SERVER['REMOTE_ADDR'];
18
- }
19
-
20
- $user_data = array(
21
- 'ip' => $ip_address,
22
- 'user_agent' => $_SERVER['HTTP_USER_AGENT']
23
- );
24
- } else {
25
- $user_data = array(
26
- 'ip' => "",
27
- 'user_agent' => $_SERVER['HTTP_USER_AGENT']
28
- );
29
- }*/
30
-
31
  $user_data = array(
32
  'ip' => "",
33
  'user_agent' => $_SERVER['HTTP_USER_AGENT']
@@ -66,18 +46,6 @@ function wplc_log_user_on_page($name,$email,$session, $is_mobile = false) {
66
 
67
  $wplc_chat_session_data = apply_filters("wplc_log_user_on_page_insert_filter", $wplc_chat_session_data);
68
 
69
- /* Omitted from inser call as this defaults to string
70
- $wplc_chat_session_types = array(
71
- '%s',
72
- '%s',
73
- '%s',
74
- '%s',
75
- '%s',
76
- '%s',
77
- '%s',
78
- '%s',
79
- '%s'
80
- ); */
81
 
82
 
83
  $wpdb->insert($wplc_tblname_chats, $wplc_chat_session_data);
@@ -94,24 +62,6 @@ function wplc_update_user_on_page($cid, $status = 5,$session) {
94
  global $wplc_tblname_chats;
95
  $wplc_settings = get_option('WPLC_SETTINGS');
96
 
97
- /** DEPRECATED BY GDPR */
98
- /*if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
99
-
100
- if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {
101
- $ip_address = sanitize_text_field($_SERVER['HTTP_X_FORWARDED_FOR']);
102
- } else {
103
- $ip_address = sanitize_text_field($_SERVER['REMOTE_ADDR']);
104
- }
105
- $user_data = array(
106
- 'ip' => $ip_address,
107
- 'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
108
- );
109
- } else {
110
- $user_data = array(
111
- 'ip' => "",
112
- 'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
113
- );
114
- }*/
115
 
116
  $user_data = array(
117
  'ip' => "",
@@ -208,23 +158,16 @@ function wplc_record_chat_msg($from, $cid, $msg, $rest_check = false, $aid = fal
208
  $wplc_current_user = get_current_user_id();
209
 
210
  if( get_user_meta( $wplc_current_user, 'wplc_ma_agent', true ) ){
211
- /*
212
- -- modified in in 6.0.04 --
213
-
214
- if(current_user_can('wplc_ma_agent') || current_user_can('manage_options')){
215
- */ } else { return "security issue"; }
216
  }
217
 
218
  if ($from == "1") {
219
  $fromname = wplc_return_chat_name(sanitize_text_field($cid));
220
  if (empty($fromname)) { $fromname = 'Guest'; }
221
- //$fromemail = wplc_return_chat_email($cid);
222
  $orig = '2';
223
  }
224
  else {
225
  $fromname = apply_filters("wplc_filter_admin_name","Admin");
226
-
227
- //$fromemail = "SET email";
228
  $orig = '1';
229
  }
230
 
@@ -305,14 +248,6 @@ function wplc_record_chat_msg($from, $cid, $msg, $rest_check = false, $aid = fal
305
  function wplc_update_active_timestamp($cid) {
306
  global $wpdb;
307
  global $wplc_tblname_chats;
308
- // $results = $wpdb->get_results(
309
- // "
310
- // UPDATE $wplc_tblname_chats
311
- // SET `last_active_timestamp` = '".date("Y-m-d H:i:s")."'
312
- // WHERE `id` = '$cid'
313
- // LIMIT 1
314
- // "
315
- // );
316
  $wpdb->update(
317
  $wplc_tblname_chats,
318
  array(
@@ -323,7 +258,6 @@ function wplc_update_active_timestamp($cid) {
323
  array('%d')
324
  );
325
 
326
- //wplc_change_chat_status(sanitize_text_field($cid),3);
327
  return true;
328
 
329
  }
@@ -387,105 +321,6 @@ function wplc_return_chat_email($cid) {
387
  }
388
 
389
  }
390
- function wplc_list_chats() {
391
-
392
- global $wpdb;
393
- global $wplc_tblname_chats;
394
- $status = 3;
395
- $wplc_c = 0;
396
- $results = $wpdb->get_results(
397
- "
398
- SELECT *
399
- FROM $wplc_tblname_chats
400
- WHERE `status` = 3 OR `status` = 2 OR `status` = 10
401
- ORDER BY `timestamp` ASC
402
-
403
- "
404
- );
405
-
406
- $table = "<div class='wplc_chats_container'>";
407
-
408
- if (!$results) {
409
- $table.= "<p>".__("No chat sessions available at the moment","wplivechat")."</p>";
410
- } else {
411
- $table .= "<h2>".__('Active Chats', 'wplivechat')."</h2>";
412
-
413
- foreach ($results as $result) {
414
- unset($trstyle);
415
- unset($actions);
416
- $wplc_c++;
417
-
418
-
419
- global $wplc_basic_plugin_url;
420
- $user_data = maybe_unserialize($result->ip);
421
- $user_ip = $user_data['ip'];
422
- $browser = wplc_return_browser_string($user_data['user_agent']);
423
- $browser_image = wplc_return_browser_image($browser,"16");
424
-
425
- if($user_ip == ""){
426
- $user_ip = __('IP Address not recorded', 'wplivechat');
427
- } else {
428
- $user_ip = "<a href='http://www.ip-adress.com/ip_tracer/" . $user_ip . "' title='".__('Whois for' ,'wplivechat')." ".$user_ip."' target='_BLANK'>".$user_ip."</a>";
429
- }
430
-
431
- if ($result->status == 2) {
432
- $url = admin_url( 'admin.php?page=wplivechat-menu&action=ac&cid='.$result->id);
433
- $actions = "<a href=\"".$url."\" class=\"wplc_open_chat button button-primary\" window-title=\"WP_Live_Chat_".$result->id."\">".__("Accept Chat","wplivechat")."</a>";
434
- $trstyle = "style='background-color:#FFFBE4; height:30px;'";
435
- $icon = "<i class=\"fa fa-phone wplc_pending\" title='".__('Incoming Chat', 'wplivechat')."' alt='".__('Incoming Chat', 'wplivechat')."'></i><div class='wplc_icon_message'>".__('You have an incoming chat.', 'wplivechat')."</div>";
436
- }
437
- if ($result->status == 3) {
438
- $url = admin_url( 'admin.php?page=wplivechat-menu&action=ac&cid='.$result->id);
439
- $actions = "<a href=\"".$url."\" class=\"wplc_open_chat button button-primary\" window-title=\"WP_Live_Chat_".$result->id."\">".__("Open Chat Window","wplivechat")."</a>";
440
- $trstyle = "style='background-color:#F7FCFE; height:30px;'";
441
- $icon = "<i class=\"fa fa-check-circle wplc_active\" title='".__('Chat Active', 'wplivechat')."' alt='".__('Chat Active', 'wplivechat')."'></i><div class='wplc_icon_message'>".__('This chat is active', 'wplivechat')."</div>";
442
- }
443
-
444
-
445
- /* if ($wplc_c>1) { $actions = wplc_get_msg(); } */
446
-
447
- $trstyle = "";
448
-
449
- $table .= "
450
- <div class='wplc_single_chat' id='record_".$result->id."' $trstyle>
451
- <div class='wplc_chat_section section_1'>
452
- <div class='wplc_user_image' id='chat_image_".$result->id."'>
453
- <img src=\"//www.gravatar.com/avatar/".md5($result->email)."?s=60&d=mm\" />
454
- </div>
455
- <div class='wplc_user_meta_data'>
456
- <div class='wplc_user_name' id='chat_name_".$result->id."'>
457
- <h3>".$result->name.$icon."</h3>
458
- <a href='mailto:".$result->email."' target='_BLANK'>".$result->email."</a>
459
- </div>
460
- </div>
461
- </div>
462
- <div class='wplc_chat_section section_2'>
463
- <div class='admin_visitor_advanced_info'>
464
- <strong>" . __("Site Info", "wplivechat") . "</strong>
465
- <hr />
466
- <span class='part1'>" . __("Chat initiated on:", "wplivechat") . "</span> <span class='part2'> <a href='".esc_url($result->url)."' target='_BLANK'>" . esc_url($result->url) . "</a></span>
467
- </div>
468
-
469
- <div class='admin_visitor_advanced_info'>
470
- <strong>" . __("Advanced Info", "wplivechat") . "</strong>
471
- <hr />
472
- <span class='part1'>" . __("Browser:", "wplivechat") . "</span><span class='part2'> $browser <img src='" . $wplc_basic_plugin_url . "/images/$browser_image' alt='$browser' title='$browser' /><br />
473
- <span class='part1'>" . __("IP Address:", "wplivechat") . "</span><span class='part2'> ".$user_ip."
474
- </div>
475
- </div>
476
- <div class='wplc_chat_section section_3'>
477
- <div class='wplc_agent_actions'>
478
- $actions
479
- </div>
480
- </div>
481
- </div>
482
- ";
483
- }
484
- }
485
- $table .= "</div>";
486
-
487
- return $table;
488
- }
489
 
490
  function wplc_time_ago($time_ago)
491
  {
@@ -560,7 +395,7 @@ add_filter("wplc_filter_list_chats_actions","wplc_filter_control_list_chats_acti
560
  * @return void
561
  * @since 6.0.00
562
  * @version 6.0.04 Updated to ensure those with the correct access can access this function
563
- * @author Nick Duncan <nick@codecabin.co.za>
564
  */
565
  function wplc_filter_control_list_chats_actions($actions,$result,$post_data) {
566
  $aid = apply_filters("wplc_filter_aid_in_action","");
@@ -577,7 +412,7 @@ function wplc_filter_control_list_chats_actions($actions,$result,$post_data) {
577
  else if (intval($result->status) == 3 || intval($result->status) == 10) {
578
  $url_params = "&action=ac&cid=".$result->id.$aid;
579
  $url = admin_url( 'admin.php?page=wplivechat-menu'.$url_params);
580
- if ( ! function_exists("wplc_pro_version_control") || !isset( $result->agent_id ) || $wplc_current_user == $result->agent_id ) { //Added backwards compat checks
581
  $actions = "<a href=\"".$url."\" class=\"wplc_open_chat button button-primary\" window-title=\"WP_Live_Chat_".$result->id."\">".__("Open Chat","wplivechat")."</a>";
582
  } else {
583
  $actions = "<span class=\"wplc-chat-in-progress\">" . __( "In progress with another agent", "wplivechat" ) . "</span>";
@@ -599,7 +434,7 @@ function wplc_filter_control_list_chats_actions($actions,$result,$post_data) {
599
  return $actions;
600
  }
601
 
602
- function wplc_list_chats_new($post_data) {
603
 
604
  global $wpdb;
605
  global $wplc_tblname_chats;
@@ -638,10 +473,10 @@ function wplc_list_chats_new($post_data) {
638
 
639
 
640
 
641
- global $wplc_basic_plugin_url;
642
  $user_data = maybe_unserialize($result->ip);
643
  $user_ip = $user_data['ip'];
644
- $browser = wplc_return_browser_string($user_data['user_agent']);
645
  $browser_image = wplc_return_browser_image($browser,"16");
646
 
647
  if($user_ip == ""){
@@ -685,7 +520,7 @@ function wplc_list_chats_new($post_data) {
685
  $data_array[$result->id]['data']['browsing_nice_url'] = $path;
686
  }
687
 
688
- $data_array[$result->id]['data']['browser'] = "<img src='" . $wplc_basic_plugin_url . "/images/$browser_image' alt='$browser' title='$browser' /> ";
689
  $data_array[$result->id]['data']['ip'] = $user_ip;
690
  $data_array[$result->id]['other'] = $other_data;
691
  }
@@ -733,43 +568,7 @@ function wplc_return_user_chat_messages($cid,$wplc_settings = false,$cdata = fal
733
  $other_data['datetimeUTC'] = strtotime( get_gmt_from_date( $result->timestamp ) );
734
 
735
  //
736
- if($result->originates == 1){
737
- /* removed in 7.1.00
738
- $class = "wplc-admin-message wplc-color-bg-4 wplc-color-2 wplc-color-border-4";
739
- if(function_exists("wplc_pro_get_admin_picture")){
740
- $src = wplc_pro_get_admin_picture();
741
- if($src){
742
- $image = "<img src=".$src." width='20px' id='wp-live-chat-2-img'/>";
743
- } else {
744
- $image = "";
745
- }
746
- } else {
747
- $other = maybe_unserialize($cdata->other);
748
- if (isset($other['aid'])) {
749
-
750
-
751
- $user_info = get_userdata(intval($other['aid']));
752
-
753
- $image = "<img src='//www.gravatar.com/avatar/".md5($user_info->user_email)."?s=30' class='wplc-admin-message-avatar' />";
754
- } else {
755
-
756
-
757
- $image = "";
758
- if(1 == 1) {
759
-
760
- } else {
761
-
762
- $image = "";
763
- }
764
- }
765
-
766
- }
767
-
768
- $from = apply_filters("wplc_filter_admin_name",$from, $cid);
769
- */
770
-
771
- }
772
- else if (intval($result->originates) == 0) {
773
  /*
774
  system notifications
775
  from version 7
@@ -777,21 +576,6 @@ function wplc_return_user_chat_messages($cid,$wplc_settings = false,$cdata = fal
777
  $system_notification = true;
778
 
779
  }
780
- else {
781
-
782
- /*
783
- removed in 7.1.00
784
- $class = "wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1";
785
-
786
- if(isset($_COOKIE['wplc_email']) && $_COOKIE['wplc_email'] != ""){ $wplc_user_gravatar = md5(strtolower(trim(sanitize_text_field($_COOKIE['wplc_email'])))); } else { $wplc_user_gravatar = ""; }
787
-
788
- if($wplc_user_gravatar != ""){
789
- $image = "<img src='//www.gravatar.com/avatar/$wplc_user_gravatar?s=30' class='wplc-user-message-avatar' />";
790
- } else {
791
- $image = "";
792
- }
793
- */
794
- }
795
 
796
  if (!$system_notification) {
797
  /* this is a normal message */
@@ -815,13 +599,6 @@ function wplc_return_user_chat_messages($cid,$wplc_settings = false,$cdata = fal
815
  $msg_hist[$id]['originates'] = intval($result->originates);
816
  $msg_hist[$id]['other'] = $other_data;
817
 
818
- /*
819
- removed this in 7.1.00 as the JS now handles this
820
- if($display_name){
821
- $msg_hist[$id]['msg'] = "<span class='wplc-admin-message wplc-color-bg-4 wplc-color-2 wplc-color-border-4'>$image <strong>$from </strong> $msg</span><br /><div class='wplc-clear-float-message'></div>";
822
- } else {
823
- $msg_hist[$id]['msg'] = "<span class='wplc-admin-message wplc-color-bg-4 wplc-color-2 wplc-color-border-4'>$msg</span><div class='wplc-clear-float-message'></div>";
824
- }*/
825
  } else {
826
  /* add the system notification to the list */
827
  if ( isset( $msg_hist[$id] ) ) { $msg_hist[$id] = array(); }
@@ -884,27 +661,8 @@ function wplc_change_chat_status($id,$status,$aid = 0) {
884
 
885
  } else {
886
  /* first time answering the chat! */
887
-
888
-
889
- /* send welcome note */
890
- /*
891
- removed in version 7. added "chat notification events" instead, i.e. Agent has joined the chat.
892
- $wplc_settings = get_option("WPLC_SETTINGS");
893
- $wplc_welcome = __('Welcome. How may I help you?', 'wplivechat');
894
- if(isset($wplc_settings['wplc_using_localization_plugin']) && $wplc_settings['wplc_using_localization_plugin'] == 1){ $wplc_using_locale = true; } else { $wplc_using_locale = false; }
895
- if (!isset($wplc_settings['wplc_user_welcome_chat']) || $wplc_settings['wplc_user_welcome_chat'] == "") { $wplc_settings['wplc_user_welcome_chat'] = $wplc_welcome; }
896
- $text2 = ($wplc_using_locale ? $wplc_welcome : stripslashes($wplc_settings['wplc_user_welcome_chat']));
897
-
898
- $chat_id = sanitize_text_field($id);
899
- $chat_msg = sanitize_text_field($text2);
900
- $wplc_rec_msg = wplc_record_chat_msg("2",$chat_id,$chat_msg);
901
-
902
- */
903
-
904
-
905
  }
906
-
907
- $other['aid'] = $aid;
908
  }
909
  }
910
 
@@ -1106,30 +864,6 @@ function wplc_return_chat_messages($cid, $transcript = false, $html = true, $wpl
1106
 
1107
  }
1108
 
1109
- /**
1110
- * Mark a message as 'read'
1111
- *
1112
- * Sets the 'status' of the message to 1 in the message table
1113
- *
1114
- * @param [int] $mid Message ID - Unique
1115
- * @return bool
1116
- */
1117
- function wplc_mark_message_as_read( $mid ) {
1118
- global $wpdb;
1119
- global $wplc_tblname_msgs;
1120
-
1121
- $wpdb->update(
1122
- $wplc_tblname_msgs,
1123
- array(
1124
- 'status' => 1
1125
- ),
1126
- array('id' => $mid),
1127
- array('%d'),
1128
- array('%d')
1129
- );
1130
- return true;
1131
- }
1132
-
1133
 
1134
  /**
1135
  * Mark all messages sent by an AGENT as read (a user has read them)
@@ -1513,9 +1247,9 @@ function wplcmail($reply_to,$reply_to_name,$subject,$msg) {
1513
 
1514
  $upload_dir = wp_upload_dir();
1515
 
1516
- $wplc_pro_settings = get_option("WPLC_SETTINGS");
1517
- if(isset($wplc_pro_settings['wplc_pro_chat_email_address'])){
1518
- $email_address = $wplc_pro_settings['wplc_pro_chat_email_address'];
1519
  }else{
1520
  $email_address = get_option('admin_email');
1521
  }
@@ -1530,20 +1264,18 @@ function wplcmail($reply_to,$reply_to_name,$subject,$msg) {
1530
  /* Send offline message to each email address */
1531
  $overbody = apply_filters("wplc_filter_mail_body",$subject,$msg);
1532
  if (!wp_mail($email, $subject, $overbody, $headers)) {
1533
- $handle = fopen($upload_dir['basedir'].'/wp_livechat_error_log.txt', 'a');
1534
  $error = date("Y-m-d H:i:s") . " WP-Mail Failed to send \n";
1535
- @fwrite($handle, $error);
1536
  }
1537
  }
1538
  }
1539
- // $to = $wplc_pro_settings['wplc_pro_chat_email_address'];
1540
  return;
1541
  } else {
1542
 
1543
 
1544
 
1545
- //require 'phpmailer/PHPMailerAutoload.php';
1546
- $wplc_pro_settings = get_option("WPLC_PRO_SETTINGS");
1547
  $host = get_option('wplc_mail_host');
1548
  $port = get_option('wplc_mail_port');
1549
  $username = get_option("wplc_mail_username");
@@ -1561,10 +1293,6 @@ function wplcmail($reply_to,$reply_to_name,$subject,$msg) {
1561
  }
1562
 
1563
 
1564
-
1565
- //$mail = new PHPMailer();
1566
-
1567
-
1568
  $mail->isSMTP();
1569
  //Enable SMTP debugging
1570
  // 0 = off (for production use)
@@ -1617,9 +1345,8 @@ function wplcmail($reply_to,$reply_to_name,$subject,$msg) {
1617
 
1618
  //send the message, check for errors
1619
  if (!$mail->send()) {
1620
- $handle = fopen($upload_dir['basedir'].'/wp_livechat_error_log.txt', 'a');
1621
  $error = date("Y-m-d H:i:s")." ".$mail->ErrorInfo." \n";
1622
- @fwrite($handle, $error);
1623
  }
1624
  return;
1625
  }
@@ -1658,18 +1385,6 @@ function wplc_store_offline_message($name, $email, $message){
1658
 
1659
  $wplc_settings = get_option('WPLC_SETTINGS');
1660
 
1661
- /** DEPRECATED BY GDPR */
1662
- /**if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
1663
- if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {
1664
- $ip_address = sanitize_text_field($_SERVER['HTTP_X_FORWARDED_FOR']);
1665
- } else {
1666
- $ip_address = sanitize_text_field($_SERVER['REMOTE_ADDR']);
1667
- }
1668
- $offline_ip_address = $ip_address;
1669
- } else {
1670
- $offline_ip_address = "";
1671
- }*/
1672
-
1673
  $offline_ip_address = "";
1674
 
1675
 
@@ -1685,19 +1400,7 @@ function wplc_store_offline_message($name, $email, $message){
1685
  $rows_affected = $wpdb->insert( $wplc_tblname_offline_msgs, $ins_array );
1686
  return;
1687
  }
1688
- /**
1689
- * Send what we have found as a system notification
1690
- */
1691
- function wplc_send_welcome($cid,$wplc_settings) {
1692
 
1693
- if (!isset($wplc_settings['wplc_welcome_msg'])) { $wplc_settings['wplc_welcome_msg'] = __("Please standby for an agent. While you wait for the agent you may type your message.","wplivechat"); }
1694
- $mdata = array(
1695
- 'msg' => $wplc_settings['wplc_welcome_msg']
1696
- );
1697
- wplc_record_chat_notification('await_agent',$cid,$mdata);
1698
- return;
1699
-
1700
- }
1701
 
1702
 
1703
  function wplc_user_initiate_chat($name,$email,$cid = null,$session) {
@@ -1708,26 +1411,6 @@ function wplc_user_initiate_chat($name,$email,$cid = null,$session) {
1708
 
1709
  $wplc_settings = get_option('WPLC_SETTINGS');
1710
 
1711
- /** DEPRECATED BY GDPR */
1712
- /*if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
1713
- if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {
1714
- $ip_address = sanitize_text_field($_SERVER['HTTP_X_FORWARDED_FOR']);
1715
- } else {
1716
- $ip_address = sanitize_text_field($_SERVER['REMOTE_ADDR']);
1717
- }
1718
- $user_data = array(
1719
- 'ip' => $ip_address,
1720
- 'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
1721
- );
1722
- $wplc_ce_ip = $ip_address;
1723
- } else {
1724
- $user_data = array(
1725
- 'ip' => "",
1726
- 'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
1727
- );
1728
- $wplc_ce_ip = null;
1729
- }*/
1730
-
1731
  $user_data = array(
1732
  'ip' => "",
1733
  'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
@@ -1756,12 +1439,10 @@ function wplc_user_initiate_chat($name,$email,$cid = null,$session) {
1756
 
1757
  $other_data = apply_filters("wplc_start_chat_hook_other_data_hook", $other_data);
1758
  if (!isset($other_data['welcome'])) {
1759
- //wplc_send_welcome($cid,$wplc_settings);
1760
  $other_data['welcome'] = true;
1761
  }
1762
 
1763
  } else {
1764
- //wplc_send_welcome($cid,$wplc_settings);
1765
  $other_data = array();
1766
  $other_data['welcome'] = true;
1767
 
@@ -1839,13 +1520,6 @@ function wplc_user_initiate_chat($name,$email,$cid = null,$session) {
1839
  $lastid = $wpdb->insert_id;
1840
 
1841
 
1842
-
1843
-
1844
- /* Nick: moved from top of function to bottom of function to try speed up the process of accepting the chart - version 7 */
1845
- if (function_exists("wplc_list_chats_pro")) { /* check if functions-pro is around */
1846
- wplc_pro_notify_via_email();
1847
- }
1848
-
1849
  do_action("wplc_start_chat_hook_after_data_insert", $lastid);
1850
  return $lastid;
1851
  }
@@ -1853,10 +1527,6 @@ function wplc_user_initiate_chat($name,$email,$cid = null,$session) {
1853
  }
1854
 
1855
 
1856
-
1857
- function wplc_get_msg() {
1858
- return "<a href=\"javascript:void(0);\" class=\"wplc_second_chat_request button button-primary\" style='cursor:not-allowed' title=\"".__("Get Pro Add-on to accept more chats","wplivechat")."\" target=\"_BLANK\">".__("Accept Chat","wplivechat")."</a>";
1859
- }
1860
  function wplc_update_chat_statuses() {
1861
  global $wpdb;
1862
  global $wplc_tblname_chats;
@@ -1922,28 +1592,7 @@ function wplc_check_pending_chats(){
1922
  }
1923
  return false;
1924
  }
1925
- function wplc_get_active_and_pending_chats(){
1926
- global $wpdb;
1927
- global $wplc_tblname_chats;
1928
- $sql = "SELECT * FROM `$wplc_tblname_chats` WHERE `status` = 2 OR `status` = 3 ORDER BY `status`";
1929
- $results = $wpdb->get_results($sql);
1930
- if($results){
1931
- return $results;
1932
- } else {
1933
- return false;
1934
- }
1935
- }
1936
- function wplc_convert_array_to_string($array){
1937
- $string = "";
1938
- if($array){
1939
- foreach($array as $value){
1940
- $string.= $value->id." ;";
1941
- }
1942
- } else {
1943
- $string = false;
1944
- }
1945
- return $string;
1946
- }
1947
 
1948
  function wplc_return_browser_image($string,$size) {
1949
  switch($string) {
@@ -1994,84 +1643,6 @@ elseif(strpos($user_agent, 'Edge') !== FALSE)
1994
  return 'Other browser';
1995
  }
1996
 
1997
- function wplc_error_directory() {
1998
- $upload_dir = wp_upload_dir();
1999
-
2000
- if (is_multisite()) {
2001
- if (!file_exists($upload_dir['basedir'].'/wp-live-chat-support')) {
2002
- wp_mkdir_p($upload_dir['basedir'].'/wp-live-chat-support');
2003
- $content = "Error log created";
2004
- $fp = @fopen($upload_dir['basedir'].'/wp-live-chat-support/error_log.txt','w+');
2005
- @fwrite($fp,$content);
2006
- }
2007
- } else {
2008
- if (!file_exists($upload_dir['basedir'] .'/wp-live-chat-support')) {
2009
- wp_mkdir_p($upload_dir['basedir'] . '/wp-live-chat-support');
2010
- $content = "Error log created";
2011
- $fp = @fopen($upload_dir['basedir'] . '/wp-live-chat-support/error_log.txt','w+');
2012
- @fwrite($fp,$content);
2013
- }
2014
-
2015
- }
2016
- return true;
2017
-
2018
- }
2019
-
2020
- function wplc_error_log($error) {
2021
- return;
2022
- $upload_dir = wp_upload_dir();
2023
- $content = "\r\n[".date("Y-m-d")."] [".date("H:i:s")."]".$error;
2024
- $fp = @fopen($upload_dir['basedir'].'/wp-live-chat-support/error_log.txt','a+');
2025
- @fwrite($fp,$content);
2026
- @fclose($fp);
2027
-
2028
-
2029
- }
2030
- function Memory_Usage($decimals = 2) {
2031
- $result = 0;
2032
-
2033
- if (function_exists('memory_get_usage')) {
2034
- $result = memory_get_usage() / 1024;
2035
- }
2036
-
2037
- else {
2038
- if (function_exists('exec')) {
2039
- $output = array();
2040
-
2041
- if (substr(strtoupper(PHP_OS), 0, 3) == 'WIN') {
2042
- exec('tasklist /FI "PID eq ' . getmypid() . '" /FO LIST', $output);
2043
-
2044
- $result = preg_replace('/[\D]/', '', $output[5]);
2045
- }
2046
-
2047
- else {
2048
- exec('ps -eo%mem,rss,pid | grep ' . getmypid(), $output);
2049
-
2050
- $output = explode(' ', $output[0]);
2051
-
2052
- $result = $output[1];
2053
- }
2054
- }
2055
- }
2056
-
2057
- return number_format(intval($result) / 1024, $decimals, '.', '')." mb";
2058
- }
2059
- function wplc_get_memory_usage() {
2060
- $size = memory_get_usage(true);
2061
- $unit=array('b','kb','mb','gb','tb','pb');
2062
- return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];
2063
-
2064
- }
2065
- function wplc_record_mem() {
2066
- $upload_dir = wp_upload_dir();
2067
- $data = array(
2068
- 'date' => current_time('mysql'),
2069
- 'php_mem' => wplc_get_memory_usage()
2070
- );
2071
- $fp = @fopen($upload_dir['basedir'].'/wp-live-chat-support'."/mem_usag.csv","a+");
2072
- fputcsv($fp, $data);
2073
- fclose($fp);
2074
- }
2075
 
2076
  function wplc_admin_display_missed_chats() {
2077
 
@@ -2126,19 +1697,11 @@ function wplc_admin_display_missed_chats() {
2126
  $pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 1;
2127
  $limit = 20; // number of rows in page
2128
  $offset = ( $pagenum - 1 ) * $limit;
2129
- if (function_exists("wplc_register_pro_version")) {
2130
- $total = $wpdb->get_var( "SELECT COUNT(`id`) FROM $wplc_tblname_chats WHERE (`status` = 0 OR `agent_id` = 0)" );
2131
- } else {
2132
- $total = $wpdb->get_var( "SELECT COUNT(`id`) FROM $wplc_tblname_chats WHERE `status` = 0" );
2133
- }
2134
  $num_of_pages = ceil( $total / $limit );
2135
 
2136
- if (function_exists("wplc_register_pro_version")) {
2137
- $sql = "SELECT * FROM $wplc_tblname_chats WHERE (`status` = 0 OR `agent_id` = 0) ORDER BY `timestamp` DESC LIMIT $limit OFFSET $offset";
2138
- } else {
2139
- $sql = "SELECT * FROM $wplc_tblname_chats WHERE `status` = 0 ORDER BY `timestamp` DESC LIMIT $limit OFFSET $offset";
2140
- }
2141
-
2142
  $results = $wpdb->get_results($sql);
2143
 
2144
  if (!$results) {
@@ -2186,7 +1749,7 @@ function wplc_admin_display_missed_chats() {
2186
  * Compares the users IP address to the list in the banned IPs in the settings page
2187
  * @return BOOL
2188
  */
2189
- function wplc_is_user_banned_basic(){
2190
  $banned_ip = get_option('WPLC_BANNED_IP_ADDRESSES');
2191
  if($banned_ip){
2192
  $banned_ip = maybe_unserialize($banned_ip);
@@ -2220,26 +1783,22 @@ function wplc_is_user_banned_basic(){
2220
 
2221
 
2222
 
2223
- function wplc_return_animations_basic(){
2224
 
2225
  $wplc_settings = get_option("WPLC_SETTINGS");
2226
 
2227
  if ($wplc_settings["wplc_settings_align"] == 1) {
2228
  $original_pos = "bottom_left";
2229
- //$wplc_box_align = "left:100px; bottom:0px;";
2230
  $wplc_box_align = "bottom:0px;";
2231
  } else if ($wplc_settings["wplc_settings_align"] == 2) {
2232
  $original_pos = "bottom_right";
2233
- //$wplc_box_align = "right:100px; bottom:0px;";
2234
  $wplc_box_align = "bottom:0px;";
2235
  } else if ($wplc_settings["wplc_settings_align"] == 3) {
2236
  $original_pos = "left";
2237
- // $wplc_box_align = "left:0; bottom:100px;";
2238
  $wplc_box_align = " bottom:100px;";
2239
  $wplc_class = "wplc_left";
2240
  } else if ($wplc_settings["wplc_settings_align"] == 4) {
2241
  $original_pos = "right";
2242
- // $wplc_box_align = "right:0; bottom:100px;";
2243
  $wplc_box_align = "bottom:100px;";
2244
  $wplc_class = "wplc_right";
2245
  }
@@ -2396,24 +1955,6 @@ function wplc_return_chat_rel_by_id($cid) {
2396
 
2397
  }
2398
 
2399
- /*
2400
- * Returns total message count for a chat
2401
- */
2402
- function wplc_return_message_count_by_cid($cid) {
2403
- global $wpdb;
2404
- global $wplc_tblname_msgs;
2405
-
2406
- $sql = "SELECT `id` FROM $wplc_tblname_msgs WHERE `chat_sess_id` = '$cid'";
2407
- $results = $wpdb->get_results($sql);
2408
-
2409
- $message_count = 0;
2410
- foreach ($results as $result) {
2411
- $message_count ++;
2412
- }
2413
-
2414
- return $message_count;
2415
- }
2416
-
2417
  function wplc_all_avatars() {
2418
  $users = get_users(array(
2419
  'meta_key' => 'wplc_ma_agent',
@@ -2440,4 +1981,3590 @@ function wplc_get_avatar($id) {
2440
  } else {
2441
  return '//www.gravatar.com/avatar/' . md5( strtolower( trim( $user->data->user_email ) ) );
2442
  }
2443
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
+ $wplc_plugin_url = WPLC_PLUGIN_URL;
3
 
4
  function wplc_log_user_on_page($name,$email,$session, $is_mobile = false) {
5
  global $wpdb;
8
  $wplc_settings = get_option('WPLC_SETTINGS');
9
 
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  $user_data = array(
12
  'ip' => "",
13
  'user_agent' => $_SERVER['HTTP_USER_AGENT']
46
 
47
  $wplc_chat_session_data = apply_filters("wplc_log_user_on_page_insert_filter", $wplc_chat_session_data);
48
 
 
 
 
 
 
 
 
 
 
 
 
 
49
 
50
 
51
  $wpdb->insert($wplc_tblname_chats, $wplc_chat_session_data);
62
  global $wplc_tblname_chats;
63
  $wplc_settings = get_option('WPLC_SETTINGS');
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
  $user_data = array(
67
  'ip' => "",
158
  $wplc_current_user = get_current_user_id();
159
 
160
  if( get_user_meta( $wplc_current_user, 'wplc_ma_agent', true ) ){
161
+ } else { return "security issue"; }
 
 
 
 
162
  }
163
 
164
  if ($from == "1") {
165
  $fromname = wplc_return_chat_name(sanitize_text_field($cid));
166
  if (empty($fromname)) { $fromname = 'Guest'; }
 
167
  $orig = '2';
168
  }
169
  else {
170
  $fromname = apply_filters("wplc_filter_admin_name","Admin");
 
 
171
  $orig = '1';
172
  }
173
 
248
  function wplc_update_active_timestamp($cid) {
249
  global $wpdb;
250
  global $wplc_tblname_chats;
 
 
 
 
 
 
 
 
251
  $wpdb->update(
252
  $wplc_tblname_chats,
253
  array(
258
  array('%d')
259
  );
260
 
 
261
  return true;
262
 
263
  }
321
  }
322
 
323
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
324
 
325
  function wplc_time_ago($time_ago)
326
  {
395
  * @return void
396
  * @since 6.0.00
397
  * @version 6.0.04 Updated to ensure those with the correct access can access this function
398
+ * @author Nick Duncan <nick@wp-livechat.com>
399
  */
400
  function wplc_filter_control_list_chats_actions($actions,$result,$post_data) {
401
  $aid = apply_filters("wplc_filter_aid_in_action","");
412
  else if (intval($result->status) == 3 || intval($result->status) == 10) {
413
  $url_params = "&action=ac&cid=".$result->id.$aid;
414
  $url = admin_url( 'admin.php?page=wplivechat-menu'.$url_params);
415
+ if ( !isset( $result->agent_id ) || $wplc_current_user == $result->agent_id ) { //Added backwards compat checks
416
  $actions = "<a href=\"".$url."\" class=\"wplc_open_chat button button-primary\" window-title=\"WP_Live_Chat_".$result->id."\">".__("Open Chat","wplivechat")."</a>";
417
  } else {
418
  $actions = "<span class=\"wplc-chat-in-progress\">" . __( "In progress with another agent", "wplivechat" ) . "</span>";
434
  return $actions;
435
  }
436
 
437
+ function wplc_list_chats($post_data) {
438
 
439
  global $wpdb;
440
  global $wplc_tblname_chats;
473
 
474
 
475
 
476
+ global $wplc_plugin_url;
477
  $user_data = maybe_unserialize($result->ip);
478
  $user_ip = $user_data['ip'];
479
+ $browser = @wplc_return_browser_string($user_data['user_agent']);
480
  $browser_image = wplc_return_browser_image($browser,"16");
481
 
482
  if($user_ip == ""){
520
  $data_array[$result->id]['data']['browsing_nice_url'] = $path;
521
  }
522
 
523
+ $data_array[$result->id]['data']['browser'] = "<img src='" . $wplc_plugin_url . "/images/$browser_image' alt='$browser' title='$browser' /> ";
524
  $data_array[$result->id]['data']['ip'] = $user_ip;
525
  $data_array[$result->id]['other'] = $other_data;
526
  }
568
  $other_data['datetimeUTC'] = strtotime( get_gmt_from_date( $result->timestamp ) );
569
 
570
  //
571
+ if (intval($result->originates) == 0) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
572
  /*
573
  system notifications
574
  from version 7
576
  $system_notification = true;
577
 
578
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
579
 
580
  if (!$system_notification) {
581
  /* this is a normal message */
599
  $msg_hist[$id]['originates'] = intval($result->originates);
600
  $msg_hist[$id]['other'] = $other_data;
601
 
 
 
 
 
 
 
 
602
  } else {
603
  /* add the system notification to the list */
604
  if ( isset( $msg_hist[$id] ) ) { $msg_hist[$id] = array(); }
661
 
662
  } else {
663
  /* first time answering the chat! */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
664
  }
665
+ @$other['aid'] = $aid;
 
666
  }
667
  }
668
 
864
 
865
  }
866
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
867
 
868
  /**
869
  * Mark all messages sent by an AGENT as read (a user has read them)
1247
 
1248
  $upload_dir = wp_upload_dir();
1249
 
1250
+ $wplc_settings = get_option("WPLC_SETTINGS");
1251
+ if(isset($wplc_settings['wplc_pro_chat_email_address'])){
1252
+ $email_address = $wplc_settings['wplc_pro_chat_email_address'];
1253
  }else{
1254
  $email_address = get_option('admin_email');
1255
  }
1264
  /* Send offline message to each email address */
1265
  $overbody = apply_filters("wplc_filter_mail_body",$subject,$msg);
1266
  if (!wp_mail($email, $subject, $overbody, $headers)) {
 
1267
  $error = date("Y-m-d H:i:s") . " WP-Mail Failed to send \n";
1268
+ error_log($error);
1269
  }
1270
  }
1271
  }
1272
+
1273
  return;
1274
  } else {
1275
 
1276
 
1277
 
1278
+ $wplc_settings = get_option("WPLC_SETTINGS");
 
1279
  $host = get_option('wplc_mail_host');
1280
  $port = get_option('wplc_mail_port');
1281
  $username = get_option("wplc_mail_username");
1293
  }
1294
 
1295
 
 
 
 
 
1296
  $mail->isSMTP();
1297
  //Enable SMTP debugging
1298
  // 0 = off (for production use)
1345
 
1346
  //send the message, check for errors
1347
  if (!$mail->send()) {
 
1348
  $error = date("Y-m-d H:i:s")." ".$mail->ErrorInfo." \n";
1349
+ error_log($error);
1350
  }
1351
  return;
1352
  }
1385
 
1386
  $wplc_settings = get_option('WPLC_SETTINGS');
1387
 
 
 
 
 
 
 
 
 
 
 
 
 
1388
  $offline_ip_address = "";
1389
 
1390
 
1400
  $rows_affected = $wpdb->insert( $wplc_tblname_offline_msgs, $ins_array );
1401
  return;
1402
  }
 
 
 
 
1403
 
 
 
 
 
 
 
 
 
1404
 
1405
 
1406
  function wplc_user_initiate_chat($name,$email,$cid = null,$session) {
1411
 
1412
  $wplc_settings = get_option('WPLC_SETTINGS');
1413
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1414
  $user_data = array(
1415
  'ip' => "",
1416
  'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
1439
 
1440
  $other_data = apply_filters("wplc_start_chat_hook_other_data_hook", $other_data);
1441
  if (!isset($other_data['welcome'])) {
 
1442
  $other_data['welcome'] = true;
1443
  }
1444
 
1445
  } else {
 
1446
  $other_data = array();
1447
  $other_data['welcome'] = true;
1448
 
1520
  $lastid = $wpdb->insert_id;
1521
 
1522
 
 
 
 
 
 
 
 
1523
  do_action("wplc_start_chat_hook_after_data_insert", $lastid);
1524
  return $lastid;
1525
  }
1527
  }
1528
 
1529
 
 
 
 
 
1530
  function wplc_update_chat_statuses() {
1531
  global $wpdb;
1532
  global $wplc_tblname_chats;
1592
  }
1593
  return false;
1594
  }
1595
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1596
 
1597
  function wplc_return_browser_image($string,$size) {
1598
  switch($string) {
1643
  return 'Other browser';
1644
  }
1645
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1646
 
1647
  function wplc_admin_display_missed_chats() {
1648
 
1697
  $pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 1;
1698
  $limit = 20; // number of rows in page
1699
  $offset = ( $pagenum - 1 ) * $limit;
1700
+ $total = $wpdb->get_var( "SELECT COUNT(`id`) FROM $wplc_tblname_chats WHERE `status` = 0" );
 
 
 
 
1701
  $num_of_pages = ceil( $total / $limit );
1702
 
1703
+ $sql = "SELECT * FROM $wplc_tblname_chats WHERE `status` = 0 ORDER BY `timestamp` DESC LIMIT $limit OFFSET $offset";
1704
+
 
 
 
 
1705
  $results = $wpdb->get_results($sql);
1706
 
1707
  if (!$results) {
1749
  * Compares the users IP address to the list in the banned IPs in the settings page
1750
  * @return BOOL
1751
  */
1752
+ function wplc_is_user_banned(){
1753
  $banned_ip = get_option('WPLC_BANNED_IP_ADDRESSES');
1754
  if($banned_ip){
1755
  $banned_ip = maybe_unserialize($banned_ip);
1783
 
1784
 
1785
 
1786
+ function wplc_return_animations(){
1787
 
1788
  $wplc_settings = get_option("WPLC_SETTINGS");
1789
 
1790
  if ($wplc_settings["wplc_settings_align"] == 1) {
1791
  $original_pos = "bottom_left";
 
1792
  $wplc_box_align = "bottom:0px;";
1793
  } else if ($wplc_settings["wplc_settings_align"] == 2) {
1794
  $original_pos = "bottom_right";
 
1795
  $wplc_box_align = "bottom:0px;";
1796
  } else if ($wplc_settings["wplc_settings_align"] == 3) {
1797
  $original_pos = "left";
 
1798
  $wplc_box_align = " bottom:100px;";
1799
  $wplc_class = "wplc_left";
1800
  } else if ($wplc_settings["wplc_settings_align"] == 4) {
1801
  $original_pos = "right";
 
1802
  $wplc_box_align = "bottom:100px;";
1803
  $wplc_class = "wplc_right";
1804
  }
1955
 
1956
  }
1957
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1958
  function wplc_all_avatars() {
1959
  $users = get_users(array(
1960
  'meta_key' => 'wplc_ma_agent',
1981
  } else {
1982
  return '//www.gravatar.com/avatar/' . md5( strtolower( trim( $user->data->user_email ) ) );
1983
  }
1984
+ }
1985
+
1986
+ function wplc_get_admin_picture(){
1987
+ $pro_settings = get_option("WPLC_ACBC_SETTINGS");
1988
+ if($pro_settings['wplc_chat_pic']){
1989
+ return urldecode($pro_settings['wplc_chat_pic']);
1990
+ }
1991
+ }
1992
+
1993
+
1994
+ /**
1995
+ * Decides whether or not to show the chat box based on the include/exlcude pages in the settings page
1996
+ * @return [type] [description]
1997
+ */
1998
+ function wplc_display_chat_contents(){
1999
+
2000
+ if (in_array($GLOBALS['pagenow'], array('wp-login.php', 'wp-register.php'))) {
2001
+ return false;
2002
+ }
2003
+ $post_id = get_the_ID();
2004
+ if (!$post_id || $post_id === NULL) {
2005
+ $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'];
2006
+ $post_id = url_to_postid($url);
2007
+ }
2008
+ $show_chat_contents = 0;
2009
+ if (!$post_id) {
2010
+ return true;
2011
+ $show_chat_contents = 1;
2012
+ /* we cant get the page ID so just allow it - the JS should handle it from now */
2013
+ }
2014
+
2015
+ $wplc_settings = get_option("WPLC_SETTINGS");
2016
+
2017
+ if (isset($wplc_settings['wplc_include_on_pages'])) {
2018
+ $include_on_pages = $wplc_settings['wplc_include_on_pages'];
2019
+
2020
+ } else {
2021
+ $include_on_pages = "";
2022
+ }
2023
+ if (isset($wplc_settings['wplc_exclude_from_pages'])) {
2024
+ $exclude_from_pages = $wplc_settings['wplc_exclude_from_pages'];
2025
+ } else {
2026
+ $exclude_from_pages = "";
2027
+ }
2028
+
2029
+ if($include_on_pages == "" && $exclude_from_pages == ""){
2030
+
2031
+ $show_chat_contents = 1;
2032
+
2033
+ } else {
2034
+
2035
+ if($include_on_pages != ''){
2036
+
2037
+ $include_on_pages = explode(',', $include_on_pages);
2038
+ foreach($include_on_pages as $key => $val) {
2039
+ $include_on_pages[$key] = intval($val);
2040
+ }
2041
+ $include_array = array();
2042
+ foreach($include_on_pages as $page){
2043
+ $include_array [intval($page)] = intval($page);
2044
+ }
2045
+
2046
+ if (isset($include_array[$post_id]) && $include_array[$post_id] > 0) {
2047
+ $show_chat_contents = true;
2048
+ } else {
2049
+ /* Do not show here */
2050
+ }
2051
+
2052
+
2053
+ } else {
2054
+
2055
+ /* Exclude from the following pages */
2056
+ $exclude_from_pages = explode(',', $exclude_from_pages);
2057
+
2058
+ $exclude_array = array();
2059
+ foreach($exclude_from_pages as $page){
2060
+ $exclude_array [$page] = intval($page);
2061
+ }
2062
+
2063
+ $exclude_from_page = array_search($post_id, $exclude_array);
2064
+
2065
+ if($exclude_from_page === FALSE){
2066
+ /* Show here */
2067
+ $show_chat_contents = true;
2068
+ } else {
2069
+
2070
+ }
2071
+
2072
+ }
2073
+
2074
+
2075
+
2076
+ }
2077
+
2078
+ return $show_chat_contents;
2079
+ }
2080
+
2081
+
2082
+
2083
+ /*
2084
+ * Extra functionality from previously PRO plugin
2085
+ */
2086
+
2087
+
2088
+ add_action("admin_init","wplc_control_logged_in_mrg");
2089
+ function wplc_control_logged_in_mrg() {
2090
+ $userid = get_current_user_id();
2091
+ $checker = wplc_maa_check_if_user_is_agent($userid);
2092
+ if ($checker !== "not_user_agent" && $checker > 0) {
2093
+ update_user_meta($userid, "wplc_chat_agent_online", time());
2094
+ }
2095
+
2096
+ }
2097
+
2098
+ add_action("init","wplc_control_logged_out_mrg");
2099
+ function wplc_control_logged_out_mrg() {
2100
+ if(!isset($_GET['role'])){
2101
+ add_action('pre_get_users', 'wplc_advanced_access_manager_compatibility_mrg', 1000);
2102
+ $check = get_users(array(
2103
+ 'meta_key' => 'wplc_chat_agent_online',
2104
+ ));
2105
+
2106
+ if ($check) {
2107
+ foreach ($check as $wplcuser) {
2108
+ $check = get_user_meta($wplcuser->ID, "wplc_chat_agent_online");
2109
+ if (isset($check[0])) {
2110
+ $last_logged_in_time = $check[0];
2111
+ if ($last_logged_in_time > 0) {
2112
+ if ((time() - $last_logged_in_time) < 120) {
2113
+ /* do nothing, they are online */
2114
+ } else {
2115
+ /* this user has not sent a heartbeat in over 120 seconds */
2116
+ delete_user_meta($wplcuser->ID, "wplc_chat_agent_online");
2117
+ }
2118
+ }
2119
+ }
2120
+ }
2121
+ } else {
2122
+ return false;
2123
+ }
2124
+ } else {
2125
+ return false;
2126
+ }
2127
+ }
2128
+
2129
+ /**
2130
+ * Advanced Access Manager compatibility.
2131
+ */
2132
+ function wplc_advanced_access_manager_compatibility_mrg($query) {
2133
+ $query->query_vars['role__not_in'] = array();
2134
+ }
2135
+
2136
+ add_action("init","wplc_mrg_load_updates");
2137
+ function wplc_mrg_load_updates() {
2138
+ if (function_exists("wplc_version_control")) {
2139
+ if (!class_exists("wplc_update_control")) {
2140
+ if (file_exists(WPLC_PLUGIN_DIR."/includes/update_control.class.php")) { @require_once(WPLC_PLUGIN_DIR."/includes/update_control.class.php"); }
2141
+ }
2142
+ if (class_exists("wplc_update_control")) {
2143
+ $check_init = new wplc_update_control();
2144
+ $check_init->set_slug("wp-live-chat-support");
2145
+ $check_init->set_path(plugin_basename( __FILE__ ));
2146
+ $check_init->set_title(__("WP Live Chat Support","wplivechat"));
2147
+ $check_init->activate();
2148
+ }
2149
+ }
2150
+ }
2151
+
2152
+ add_action('init', 'wplc_mrg_version_control');
2153
+
2154
+
2155
+ function wplc_mrg_version_control() {
2156
+ global $wplc_version;
2157
+
2158
+ $current_version = get_option("wplc_current_version");
2159
+ if (!isset($current_version) || $current_version != $wplc_version) {
2160
+ wplc_mrg_update_db();
2161
+
2162
+ }
2163
+
2164
+ }
2165
+
2166
+
2167
+
2168
+ function wplc_mrg_update_db( $networkwide = false ) {
2169
+ global $wpdb;
2170
+ global $wplc_tblname_chats;
2171
+
2172
+ global $wplc_tblname_chat_ratings;
2173
+ global $wplc_tblname_chat_triggers;
2174
+
2175
+
2176
+ if ( function_exists( 'is_multisite' ) && is_multisite() ) {
2177
+ if ( $networkwide ) {
2178
+ $old_blog = $wpdb->blogid;
2179
+ $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
2180
+ foreach ( $blog_ids as $blog_id ) {
2181
+ switch_to_blog( $blog_id );
2182
+ $sql = " SHOW COLUMNS FROM {$wpdb->prefix}wplc_chat_sessions WHERE `Field` = 'agent_id'";
2183
+ $results = $wpdb->get_results($sql);
2184
+ if (!$results) {
2185
+ $sql = "ALTER TABLE {$wpdb->prefix}wplc_chat_sessions ADD `agent_id` INT(11) NOT NULL ;";
2186
+ $wpdb->query($sql);
2187
+ }
2188
+
2189
+ $department_field_sql = " SHOW COLUMNS FROM {$wpdb->prefix}wplc_chat_sessions WHERE `Field` = 'department_id'";
2190
+ $results = $wpdb->get_results($department_field_sql);
2191
+ if (!$results) {
2192
+ $department_field_sql = "ALTER TABLE {$wpdb->prefix}wplc_chat_sessions ADD `department_id` INT(11) NOT NULL ;";
2193
+ $wpdb->query($department_field_sql);
2194
+ }
2195
+ }
2196
+ switch_to_blog( $old_blog );
2197
+ }
2198
+ } else {
2199
+ $sql = " SHOW COLUMNS FROM $wplc_tblname_chats WHERE `Field` = 'agent_id'";
2200
+ $results = $wpdb->get_results($sql);
2201
+ if (!$results) {
2202
+ $sql = "ALTER TABLE `$wplc_tblname_chats` ADD `agent_id` INT(11) NOT NULL ;";
2203
+ $wpdb->query($sql);
2204
+ }
2205
+
2206
+ $department_field_sql = " SHOW COLUMNS FROM $wplc_tblname_chats WHERE `Field` = 'department_id'";
2207
+ $results = $wpdb->get_results($department_field_sql);
2208
+ if (!$results) {
2209
+ $department_field_sql = "ALTER TABLE `$wplc_tblname_chats` ADD `department_id` INT(11) NOT NULL ;";
2210
+ $wpdb->query($department_field_sql);
2211
+ }
2212
+ }
2213
+
2214
+ $sql2 = "
2215
+ CREATE TABLE " . $wplc_tblname_chat_ratings . " (
2216
+ id int(11) NOT NULL AUTO_INCREMENT,
2217
+ timestamp datetime NOT NULL,
2218
+ cid int(11) NOT NULL,
2219
+ aid int(11) NOT NULL,
2220
+ rating int(11) NOT NULL,
2221
+ comment varchar(700) NOT NULL,
2222
+ notified tinyint(1) NOT NULL,
2223
+ PRIMARY KEY (id)
2224
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
2225
+ ";
2226
+
2227
+ $sql3 = "
2228
+ CREATE TABLE " . $wplc_tblname_chat_triggers . " (
2229
+ id int(11) NOT NULL AUTO_INCREMENT,
2230
+ name varchar(700) NOT NULL,
2231
+ type int(11) NOT NULL,
2232
+ content longtext NOT NULL,
2233
+ show_content tinyint(1) NOT NULL,
2234
+ status tinyint(1) NOT NULL,
2235
+ PRIMARY KEY (id)
2236
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
2237
+ ";
2238
+
2239
+ require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
2240
+ dbDelta($sql2);
2241
+ dbDelta($sql3);
2242
+
2243
+ do_action("wplc_pro_update_db_hook");
2244
+
2245
+ $admins = get_role('administrator');
2246
+ $admins->add_cap('wplc_ma_agent');
2247
+ $uid = get_current_user_id();
2248
+ update_user_meta($uid, 'wplc_ma_agent', 1);
2249
+ update_user_meta($uid, "wplc_chat_agent_online", time());
2250
+ }
2251
+
2252
+
2253
+
2254
+
2255
+
2256
+ function wplc_mrg_create_macro_post_type() {
2257
+ $labels = array(
2258
+ 'name' => __('Quick Responses', 'wplivechat'),
2259
+ 'singular_name' => __('Quick Response', 'wplivechat'),
2260
+ 'add_new' => __('New Quick Response', 'wplivechat'),
2261
+ 'add_new_item' => __('Add New Quick Response', 'wplivechat'),
2262
+ 'edit_item' => __('Edit Quick Response', 'wplivechat'),
2263
+ 'new_item' => __('New Quick Response', 'wplivechat'),
2264
+ 'all_items' => __('Quick Responses', 'wplivechat'),
2265
+ 'view_item' => __('View Quick Responses', 'wplivechat'),
2266
+ 'search_items' => __('Search Quick Responses', 'wplivechat'),
2267
+ 'not_found' => __('No Quick Responses found', 'wplivechat'),
2268
+ 'not_found_in_trash' => __('No Quick Responses found in the Trash', 'wplivechat'),
2269
+ 'menu_name' => __('Quick Responses', 'wplivechat')
2270
+ );
2271
+ $args = array(
2272
+ 'labels' => $labels,
2273
+ 'description' => __('Quick Responses for WP Live Chat Support', 'wplivechat'),
2274
+ 'public' => false,
2275
+ 'menu_position' => 80,
2276
+ 'show_in_nav_menus' => true,
2277
+ 'show_in_menu' => 'wplivechat-menu',
2278
+ 'hierarchical' => false,
2279
+ 'rewrite' => array('slug' => 'wplc_quick_response'),
2280
+ 'publicly_queryable' => false,
2281
+ 'exclude_from_search' => true,
2282
+ 'show_ui' => true,
2283
+ 'capability_type' => 'post',
2284
+ 'supports' => array('title', 'editor', 'revisions', 'author'),
2285
+ 'has_archive' => true,
2286
+ 'capabilities' => array(
2287
+ 'edit_post' => 'edit_wplc_quick_response',
2288
+ 'edit_posts' => 'edit_wplc_quick_response',
2289
+ 'edit_others_posts' => 'edit_other_wplc_quick_response',
2290
+ 'publish_posts' => 'publish_wplc_quick_response',
2291
+ 'read_post' => 'read_wplc_quick_response',
2292
+ 'read_private_posts' => 'read_private_wplc_quick_response',
2293
+ 'delete_post' => 'delete_wplc_quick_response',
2294
+ 'delete_posts' => 'delete_wplc_quick_response'
2295
+ ),
2296
+ 'register_meta_box_cb' => 'wplc_add_quick_response_metaboxes_mrg'
2297
+ );
2298
+
2299
+ register_post_type('wplc_quick_response', $args);
2300
+ }
2301
+
2302
+ add_action( 'add_meta_boxes', 'wplc_add_quick_response_metaboxes_mrg' );
2303
+ function wplc_add_quick_response_metaboxes_mrg() {
2304
+ add_meta_box( 'wplc_quick_response_number', __( 'Sort Order', 'wplivechat' ), 'wplc_quick_response_number_cb_mrg', 'wplc_quick_response', 'side', 'default' );
2305
+ }
2306
+
2307
+ function wplc_quick_response_number_cb_mrg() {
2308
+ global $post;
2309
+
2310
+ echo '<input type="hidden" id="wplc_quick_response_number_noncename" name="wplc_quick_response_number_noncename" value="' . wp_create_nonce( plugin_basename( __FILE__ ) ) . '" />';
2311
+
2312
+ $wplc_quick_response_number = get_post_meta( $post->ID, 'wplc_quick_response_number', true );
2313
+ $wplc_quick_response_number = isset( $wplc_quick_response_number ) && '' !== $wplc_quick_response_number ? esc_attr( $wplc_quick_response_number ) : '1';
2314
+ echo '<input type="number" id="wplc_quick_response_number" name="wplc_quick_response_number" min="1" value="' . esc_attr( $wplc_quick_response_number ) . '" />';
2315
+ }
2316
+
2317
+ add_action( 'save_post', 'wplc_quick_response_number_save_mrg', 1, 2 );
2318
+ function wplc_quick_response_number_save_mrg( $post_id, $post ) {
2319
+ if ( ! isset( $_POST['wplc_quick_response_number_noncename'] ) || ! wp_verify_nonce( $_POST['wplc_quick_response_number_noncename'], plugin_basename( __FILE__ ) ) ) {
2320
+ return $post->ID;
2321
+ }
2322
+
2323
+ if ( ! current_user_can( 'edit_wplc_quick_response' ) ) {
2324
+ return $post->ID;
2325
+ }
2326
+
2327
+ if ( $post->post_type == 'revision' ) {
2328
+ return;
2329
+ }
2330
+
2331
+ update_post_meta( $post->ID, 'wplc_quick_response_number', esc_attr( $_POST['wplc_quick_response_number'] ) );
2332
+
2333
+ return $post->ID;
2334
+ }
2335
+
2336
+ add_filter( 'manage_edit-wplc_quick_response_columns', 'wplc_quick_response_number_column_mrg' );
2337
+ function wplc_quick_response_number_column_mrg( $columns ) {
2338
+ $columns = array(
2339
+ 'cb' => '<input type="number" />',
2340
+ 'title' => __( 'Title', 'wplivechat' ),
2341
+ 'number' => __( 'Order', 'wplivechat' ),
2342
+ 'author' => __( 'Author', 'wplivechat' ),
2343
+ 'date' => __( 'Date', 'wplivechat' ),
2344
+ );
2345
+
2346
+ return $columns;
2347
+ }
2348
+
2349
+ add_action( 'manage_wplc_quick_response_posts_custom_column', 'wplc_quick_response_manage_number_column_mrg', 10, 2 );
2350
+ function wplc_quick_response_manage_number_column_mrg( $column, $post_id ) {
2351
+ global $post;
2352
+
2353
+ switch ( $column ) {
2354
+ case 'number':
2355
+ $wplc_quick_response_number = get_post_meta( $post_id, 'wplc_quick_response_number', true );
2356
+ echo ( empty( $wplc_quick_response_number ) ) ? '1' : esc_attr( $wplc_quick_response_number );
2357
+ break;
2358
+ default:
2359
+ break;
2360
+ }
2361
+ }
2362
+
2363
+ function wplc_quick_response_add_agent_caps_mrg() {
2364
+ if ( 'not_user_agent' !== wplc_ic_check_if_user_is_agent() ) {
2365
+ $user_id = get_current_user_id();
2366
+ $user = new WP_User($user_id);
2367
+ $user->add_cap('edit_wplc_quick_response');
2368
+ $user->add_cap('edit_wplc_quick_response');
2369
+ $user->add_cap('edit_other_wplc_quick_response');
2370
+ $user->add_cap('publish_wplc_quick_response');
2371
+ $user->add_cap('read_wplc_quick_response');
2372
+ $user->add_cap('read_private_wplc_quick_response');
2373
+ $user->add_cap('delete_wplc_quick_response');
2374
+ }
2375
+ }
2376
+ add_action( 'admin_init', 'wplc_quick_response_add_agent_caps_mrg' );
2377
+
2378
+ add_action("wplc_hook_admin_below_chat_box","wplc_hook_control_admin_below_chat_box",1,1);
2379
+ function wplc_hook_control_admin_below_chat_box($result) {
2380
+ if ($result->status == 3) {
2381
+ $wplc_settings = get_option( 'WPLC_SETTINGS' );
2382
+ $wplc_quick_response_order_by = isset( $wplc_settings['wplc_quick_response_orderby'] ) ? esc_attr( $wplc_settings['wplc_quick_response_orderby'] ) : 'title';
2383
+ $wplc_quick_response_order = isset( $wplc_settings['wplc_quick_response_order'] ) ? esc_attr( $wplc_settings['wplc_quick_response_order'] ) : 'DESC';
2384
+ echo "<div class='admin_chat_quick_controls'>";
2385
+ echo " <p style=\"text-align:left; font-size:11px;\">Press ENTER to send your message</p>";
2386
+ echo wplc_return_macros_mrg( 0, $wplc_quick_response_order_by, $wplc_quick_response_order );
2387
+ echo " </div>";
2388
+ echo "</div>";
2389
+ }
2390
+
2391
+ }
2392
+
2393
+
2394
+
2395
+ function wplc_return_macros_mrg( $firsttd = 0, $orderby = 'post_title', $order = 'DESC' ) {
2396
+
2397
+ $args = array(
2398
+ 'posts_per_page' => -1,
2399
+ 'offset' => 0,
2400
+ 'category' => '',
2401
+ 'order' => $order,
2402
+ 'orderby' => $orderby,
2403
+ 'include' => '',
2404
+ 'exclude' => '',
2405
+ 'meta_key' => '',
2406
+ 'meta_value' => '',
2407
+ 'post_type' => 'wplc_quick_response',
2408
+ 'post_mime_type' => '',
2409
+ 'post_parent' => '',
2410
+ 'post_status' => 'publish',
2411
+ 'suppress_filters' => true);
2412
+
2413
+ if ( 'number' === $orderby ) {
2414
+ $args['orderby'] = 'wplc_quick_response_number';
2415
+ $args['meta_key'] = 'wplc_quick_response_number';
2416
+ }
2417
+
2418
+ $posts_array = get_posts($args);
2419
+
2420
+ $msg = "<table><tr>";
2421
+ if ($firsttd == 0) {
2422
+ $msg .= " <td>" . __("Assign Quick Response", "wplivechat") . "</td>";
2423
+ }
2424
+ $msg .= " <td>";
2425
+ if ($firsttd == 1) {
2426
+ $msg .= __("Assign Quick Response", "wplivechat");
2427
+ }
2428
+ $msg .= " <select name='wplc_macros_select' class='wplc_macros_select'>";
2429
+ $msg .= " <option value='0'>" . __("Select", "wplivechat") . "</option>";
2430
+
2431
+ foreach ($posts_array as $post) {
2432
+
2433
+ $msg .= " <option value='" . $post->ID . "'>" . $post->post_title . "</option>";
2434
+ }
2435
+ $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>";
2436
+ $msg .= " </td>";
2437
+ $msg .= "</tr></table>";
2438
+ return $msg;
2439
+ }
2440
+
2441
+
2442
+
2443
+
2444
+
2445
+
2446
+ if (!function_exists("wplc_acbc_filter_control_microicon")) {
2447
+ add_filter("wplc_filter_microicon","wplc_acbc_filter_control_microicon",10,1);
2448
+ function wplc_acbc_filter_control_microicon($ret_msg) {
2449
+ $wplc_acbc_data = get_option("WPLC_ACBC_SETTINGS");
2450
+
2451
+ if ($wplc_acbc_data['wplc_chat_pic']) {
2452
+ /* overwrite the $ret_msg variable */
2453
+ $ret_msg = "<div class='wplc_left_logo' style='background:url(".urldecode($wplc_acbc_data['wplc_chat_pic']).") no-repeat; background-size: cover;'></div>";
2454
+ }
2455
+ return $ret_msg;
2456
+
2457
+ }
2458
+ }
2459
+
2460
+ if (!function_exists("wplc_acbc_filter_control_chaticon")) {
2461
+ add_filter("wplc_filter_chaticon","wplc_acbc_filter_control_chaticon",10,1);
2462
+ function wplc_acbc_filter_control_chaticon($icon) {
2463
+ $wplc_acbc_data = get_option("WPLC_ACBC_SETTINGS");
2464
+
2465
+ if (isset($wplc_acbc_data['wplc_chat_icon'])) {
2466
+ $icon = urldecode($wplc_acbc_data['wplc_chat_icon']);
2467
+ }
2468
+ return $icon;
2469
+
2470
+ }
2471
+ }
2472
+ /**
2473
+ * Notify the admin that someone wants to chat
2474
+ * @param array $array CID, Name, Email
2475
+ * @return bool
2476
+ */
2477
+ function wplc_mrg_notify_via_email($data) {
2478
+
2479
+ $wplc_acbc_data = get_option("WPLC_ACBC_SETTINGS");
2480
+ if (isset($wplc_acbc_data['wplc_pro_chat_email_address'])) { $email_address = $wplc_acbc_data['wplc_pro_chat_email_address']; } else { $email_address = ""; }
2481
+ if (!$email_address || $email_address == "") { $email_address = get_option('admin_email'); }
2482
+ if (isset($wplc_acbc_data['wplc_pro_chat_notification']) && $wplc_acbc_data['wplc_pro_chat_notification'] == "yes") {
2483
+ $subject = sprintf( __( 'Incoming chat from %s (%s) on %s', 'wplivechat' ),
2484
+ $data['name'],
2485
+ $data['email'],
2486
+ get_option('blogname')
2487
+ );
2488
+
2489
+ $msg = sprintf( __( '%s (%s) wants to chat with you. <br /><br />Log in: %s', 'wplivechat' ),
2490
+ $data['name'],
2491
+ $data['email'],
2492
+ wp_login_url()
2493
+ );
2494
+
2495
+ wplcmail($email_address,"WP Live Chat Support", $subject, $msg);
2496
+ }
2497
+ return true;
2498
+ }
2499
+
2500
+
2501
+ if (!function_exists("wplc_acbc_admin_scripts")) {
2502
+ add_action('admin_print_scripts', 'wplc_acbc_admin_scripts');
2503
+ function wplc_acbc_admin_scripts() {
2504
+ global $wplc_acbc_version;
2505
+ if (isset($_GET['page']) && $_GET['page'] == 'wplivechat-menu-settings') {
2506
+
2507
+ wp_enqueue_media();
2508
+ wp_register_script('my-wplc-upload', plugins_url('js/media.js', __FILE__), array('jquery'), $wplc_acbc_version, true);
2509
+ wp_enqueue_script('my-wplc-upload');
2510
+ }
2511
+ }
2512
+ }
2513
+
2514
+
2515
+ if (!function_exists("wplc_acbc_hook_control_push_js_to_front")) {
2516
+ add_action("wplc_hook_push_js_to_front","wplc_acbc_hook_control_push_js_to_front");
2517
+ function wplc_acbc_hook_control_push_js_to_front() {
2518
+ $wplc_delay = get_option("WPLC_ACBC_SETTINGS");
2519
+ $wplc_settings = get_option("WPLC_SETTINGS");
2520
+ $del1 = isset( $wplc_delay['wplc_chat_delay'] ) ? $wplc_delay['wplc_chat_delay'] : 0;
2521
+ if (!isset($del1) || !$del1) { $del1 = 0; }
2522
+ $del2 = intval($del1 * 1000);
2523
+
2524
+ if (isset($wplc_settings['wplc_typing_enabled']) && $wplc_settings['wplc_typing_enabled'] == 1) { $typing_enabled = "1"; } else { $typing_enabled = "0"; }
2525
+
2526
+ global $wplc_version;
2527
+
2528
+
2529
+ if ($typing_enabled) {
2530
+ $wpc_misc_js_strings = array(
2531
+ 'typing_enabled' => $typing_enabled,
2532
+ 'typingimg' => plugins_url('/images/comment.svg', __FILE__)
2533
+ );
2534
+ } else {
2535
+ $wpc_misc_js_strings = array(
2536
+ 'typing_enabled' => $typing_enabled
2537
+ );
2538
+ }
2539
+ wp_localize_script('wplc-user-script', 'wplc_misc_strings', $wpc_misc_js_strings);
2540
+
2541
+
2542
+ if(isset($wplc_settings['wplc_use_node_server']) && $wplc_settings['wplc_use_node_server'] == 1){
2543
+
2544
+ wp_localize_script( 'wplc-user-script', 'wplc_integration_pro_active', "true");
2545
+ wp_register_script('wplc-user-pro-events-script', plugins_url('/js/wplc_u_node_pro_events.js', __FILE__),array('jquery', 'wplc-server-script'),$wplc_version);
2546
+ wp_register_script('bleeper-action-script', plugins_url('/js/bleeper_action_events.js', __FILE__),false,$wplc_version);
2547
+ wp_enqueue_script('bleeper-action-script');
2548
+ } else {
2549
+ /* not using the node server, load traditional event handler JS */
2550
+ wp_register_script('wplc-user-pro-events-script', plugins_url('/js/wplc_u_pro_events.js', __FILE__),array('jquery', 'wplc-server-script'),$wplc_version);
2551
+ }
2552
+
2553
+
2554
+ wp_localize_script('wplc-user-script', 'wplc_delay', "".apply_filters( 'wplc_filter_control_chat_delay', $del2 )."");
2555
+
2556
+ wp_register_script('wplc-user-pro-features', plugins_url('/js/wplc_pro_features.js', __FILE__), array('wplc-user-script'),false, false);
2557
+
2558
+ wp_enqueue_script( 'wplc-user-pro-features' );
2559
+ wp_enqueue_script( 'wplc-user-pro-events-script' );
2560
+
2561
+
2562
+ if(isset($wplc_settings["wplc_ux_editor"]) && $wplc_settings["wplc_ux_editor"] !== "0"){
2563
+ wp_register_script('wplc-user-pro-editor', plugins_url('/js/wplc_u_editor.js', __FILE__), array('wplc-user-script', 'jquery'),false, false);
2564
+ wp_enqueue_script('wplc-user-pro-editor');
2565
+ }
2566
+
2567
+ if(!empty($wplc_settings["wplc_pro_auto_first_response_chat_msg"])){
2568
+ 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"])."");
2569
+ }
2570
+
2571
+ if(isset($wplc_settings["wplc_ux_file_share"]) && $wplc_settings["wplc_ux_file_share"] !== "0"){
2572
+ wp_enqueue_style('wplc-user-pro-styles', plugins_url('/css/wplc_styles_pro.css', __FILE__));
2573
+ }
2574
+
2575
+
2576
+ $post_id = get_the_ID();
2577
+ if (!$post_id || $post_id === NULL) {
2578
+ $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'];
2579
+ $post_id = url_to_postid($url);
2580
+ }
2581
+ if(wplc_check_trigger_filters_mrg($post_id)){
2582
+ wplc_tirggers_enqueue_user_styles_scripts(wplc_check_trigger_filters_mrg($post_id));
2583
+ }
2584
+
2585
+ }
2586
+ }
2587
+
2588
+ /**
2589
+ * Let the basic know that we are using a premium add-on
2590
+ * @param int $count
2591
+ * @return int
2592
+ */
2593
+ if (!function_exists("wplc_acbc_filter_control_menu_api")) {
2594
+ add_filter("wplc_filter_menu_api","wplc_acbc_filter_control_menu_api",1,1);
2595
+ function wplc_acbc_filter_control_menu_api($count) {
2596
+ $count++;
2597
+ return $count;
2598
+ }
2599
+ }
2600
+
2601
+
2602
+ if (!function_exists("wplc_acbc_filter_control_live_chat_box_above_main_div")) {
2603
+ add_filter("wplc_filter_live_chat_box_above_main_div","wplc_acbc_filter_control_live_chat_box_above_main_div");
2604
+ function wplc_acbc_filter_control_live_chat_box_above_main_div($ret_msg) {
2605
+ $wplc_acbc_data = get_option("WPLC_ACBC_SETTINGS");
2606
+
2607
+ if (!empty($wplc_acbc_data['wplc_chat_logo'])) {
2608
+ $ret_msg .= "<div id=\"wplc_logo\">";
2609
+ $ret_msg .= " <img class=\"wplc_logo_class\" src=\"".urldecode(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')."\" />";
2610
+ $ret_msg .= "</div>";
2611
+ }
2612
+ return $ret_msg;
2613
+ }
2614
+ }
2615
+
2616
+ if (!function_exists("wplc_acbc_filter_control_chat_header_under")) {
2617
+ add_filter("wplc_filter_chat_header_under","wplc_acbc_filter_control_chat_header_under");
2618
+ function wplc_acbc_filter_control_chat_header_under($ret_msg) {
2619
+ $wplc_acbc_data = get_option("WPLC_ACBC_SETTINGS");
2620
+
2621
+ if ($wplc_acbc_data['wplc_chat_pic']) {
2622
+ $ret_msg .= "<div id=\"wp-live-chat-image\">";
2623
+ $ret_msg .= "<div id=\"wp-live-chat-inner-image-div\">";
2624
+ $ret_msg .= "<img src=\"".urldecode($wplc_acbc_data['wplc_chat_pic'])."\" width=\"40px\"/>";
2625
+ $ret_msg .= "</div>";
2626
+ $ret_msg .= "</div>";
2627
+
2628
+ }
2629
+ return $ret_msg;
2630
+ }
2631
+ }
2632
+
2633
+
2634
+
2635
+ /**
2636
+ * Check if this is the first time the user has run the plugin. If yes, set the default settings
2637
+ * @since 1.0.2
2638
+ * @return string
2639
+ * @author Nick Duncan <nick@wp-livechat.com>
2640
+ */
2641
+ if (!function_exists("wplc_acbc_filter_admin_name")) {
2642
+ add_filter("wplc_filter_admin_name","wplc_acbc_filter_admin_name");
2643
+ function wplc_acbc_filter_admin_name($fromname) {
2644
+ $wplc_acbc_data = get_option("WPLC_ACBC_SETTINGS");
2645
+
2646
+ if (!empty($wplc_acbc_data['wplc_chat_name'])) {
2647
+ $fromname = $wplc_acbc_data['wplc_chat_name'];
2648
+ }
2649
+
2650
+
2651
+ return $fromname;
2652
+ }
2653
+ }
2654
+
2655
+
2656
+
2657
+ add_filter( "wplc_admin_dashboard_layout_node_request_variable_filter", "wplc_admin_mrg_filter_control_dashboard_layout_node_request_variable_filter", 10, 1);
2658
+ function wplc_admin_mrg_filter_control_dashboard_layout_node_request_variable_filter( $form_data ) {
2659
+ $choose_array = get_option("WPLC_CHOOSE_ACCEPTING");
2660
+ $form_data['choose'] = $choose_array;
2661
+ return $form_data;
2662
+ }
2663
+
2664
+
2665
+
2666
+ /**
2667
+ * Display the switchery button at the top of the chat dashboard
2668
+ * @return void
2669
+ * @since 1.0.00
2670
+ * @author Nick Duncan <nick@wp-livechat.com>
2671
+ */
2672
+ if (!function_exists("wplc_choose_hook_control_chat_dashboard_above")) {
2673
+ add_action("wplc_hook_chat_dashboard_above","wplc_choose_hook_control_chat_dashboard_above");
2674
+ function wplc_choose_hook_control_chat_dashboard_above() {
2675
+ $wplc_current_user_id = get_current_user_id();
2676
+ $wplc_choose_data = get_option("WPLC_CHOOSE_SETTINGS");
2677
+
2678
+ $choose_array = get_option("WPLC_CHOOSE_ACCEPTING");
2679
+ $user_id = get_current_user_id();
2680
+ $user_id = get_current_user_id();//
2681
+ ?>
2682
+ <div style="padding: 10px 0; display: block; margin: 0 auto; text-align: center;">
2683
+ <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'; } ?> />
2684
+ <div id="wplc_agent_status_text" style="display: inline-block; padding-left: 10px;"></div>
2685
+ </div>
2686
+ <?php /* } */
2687
+ }
2688
+ }
2689
+
2690
+
2691
+
2692
+ /**
2693
+ * Latch onto the set transient filter and decide to show the agent online or not.
2694
+ * @param bool $set_transient Should we set the transient or not?
2695
+ * @return bool
2696
+ * @since 1.0.00
2697
+ * @author Nick Duncan <nick@wp-livechat.com>
2698
+ */
2699
+ if (!function_exists("wplc_choose_filter_control_set_set_transient")) {
2700
+ add_filter("wplc_filter_control_set_transient","wplc_choose_filter_control_set_set_transient",10,1);
2701
+ function wplc_choose_filter_control_set_set_transient($set_transient) {
2702
+
2703
+ $choose_array = get_option("WPLC_CHOOSE_ACCEPTING");
2704
+ $user_id = get_current_user_id();
2705
+
2706
+ if (isset($choose_array[$user_id]) && $choose_array[$user_id]) {
2707
+ return true;
2708
+ } else {
2709
+ return false;
2710
+ }
2711
+ }
2712
+ }
2713
+
2714
+
2715
+
2716
+ /**
2717
+ * Latch onto the loggedin filter and set to true if any agent has selected that they can take chats.
2718
+ * @param bool $logged_in Is the agent logged in and available?
2719
+ * @return bool
2720
+ * @since 1.0.01
2721
+ * @author Nick Duncan <nick@wp-livechat.com>
2722
+ */
2723
+ if (!function_exists("wplc_choose_final_loggedin_control")) {
2724
+ add_filter("wplc_final_loggedin_control","wplc_choose_final_loggedin_control",10,2);
2725
+ function wplc_choose_final_loggedin_control($logged_in,$logged_in_via_app) {
2726
+ $choose_array = get_option("WPLC_CHOOSE_ACCEPTING");
2727
+ /* get a list of online users */
2728
+
2729
+ /* get actuall logged in users and create an array to check with below */
2730
+ add_action('pre_get_users', 'wplc_advanced_access_manager_compatibility_mrg', 1000);
2731
+ $users = get_users(array(
2732
+ 'meta_key'=> 'wplc_chat_agent_online',
2733
+ ));
2734
+
2735
+ foreach ($users as $wplc_user) {
2736
+ $check = get_user_meta($wplc_user->ID,"wplc_chat_agent_online");
2737
+ $last_logged_in_time = $check[0];
2738
+ if ($last_logged_in_time > 0) {
2739
+ if ((time() - $last_logged_in_time) < 70) {
2740
+ $tmp_logged_in[$wplc_user->ID] = 1;
2741
+ }
2742
+ }
2743
+ }
2744
+ $counter = 0;
2745
+ $change_choose = false;
2746
+ foreach ($choose_array as $key => $val) {
2747
+ /* if there is an agent logged in, return true, if none, return false */
2748
+ if ($val == true) {
2749
+ /* make sure that they are still logged in - they could have just quit. Update option accordingly and continue with checks */
2750
+ if (!isset($tmp_logged_in[$key])) {
2751
+ /* user has said they want to accept chats but they are offline */
2752
+ $choose_array[$key] = false;
2753
+ $change_choose = true;
2754
+ } else {
2755
+ $counter++;
2756
+ }
2757
+ }
2758
+ }
2759
+ if ($change_choose) update_option("WPLC_CHOOSE_ACCEPTING",$choose_array);
2760
+ if ($logged_in_via_app) { return true; }
2761
+ if ($counter == 0) { return false; }
2762
+ if ($logged_in) { return true; }
2763
+ else { return false; }
2764
+
2765
+ }
2766
+ }
2767
+
2768
+
2769
+
2770
+
2771
+ /**
2772
+ * Latch onto the original callback for this plugin's ajax requests
2773
+ * @return void
2774
+ */
2775
+ if (!function_exists("wplc_choose_hook_control_action_callback")) {
2776
+ function wplc_choose_hook_control_action_callback() {
2777
+
2778
+
2779
+ if ($_POST['action'] == 'wplc_choose_accepting') {
2780
+
2781
+ $choose_array = get_option("WPLC_CHOOSE_ACCEPTING");
2782
+ $user_id = get_current_user_id();
2783
+ $choose_array[$user_id] = true;
2784
+ update_option("WPLC_CHOOSE_ACCEPTING",$choose_array);
2785
+
2786
+ /* mark agent as online */
2787
+ $user_id = get_current_user_id();
2788
+ do_action("wplc_hook_set_transient");
2789
+
2790
+ echo "done";
2791
+ }
2792
+
2793
+ if ($_POST['action'] == 'wplc_choose_not_accepting') {
2794
+ $choose_array = get_option("WPLC_CHOOSE_ACCEPTING");
2795
+
2796
+ $user_id = get_current_user_id();
2797
+ $choose_array[$user_id] = false;
2798
+ update_option("WPLC_CHOOSE_ACCEPTING",$choose_array);
2799
+
2800
+ $deleted = delete_user_meta($user_id, "wplc_chat_agent_online");
2801
+
2802
+ delete_transient('wplc_is_admin_logged_in');
2803
+ echo "done";
2804
+ }
2805
+
2806
+ if ($_POST['action'] == "wplc_typing") {
2807
+
2808
+ if (isset($_POST['cid']) && isset($_POST['user']) && isset($_POST['type'])) {
2809
+ echo wplc_typing_mrg($_POST['user'],sanitize_text_field($_POST['cid']),sanitize_text_field($_POST['type']));
2810
+ }
2811
+ }
2812
+
2813
+ if( $_POST['action'] == 'wplc_upload_file' ){
2814
+ $upload_dir = wp_upload_dir();
2815
+ $user_dirname = $upload_dir['basedir'];
2816
+
2817
+ if( !file_exists( $user_dirname."/wp_live_chat/" ) ){
2818
+ @mkdir($user_dirname.'/wp_live_chat/');
2819
+ }
2820
+
2821
+ if( !file_exists( $user_dirname."/wp_live_chat/" . $_POST['cid'] ) ){
2822
+ @mkdir($user_dirname.'/wp_live_chat/'.$_POST['cid']);
2823
+ }
2824
+
2825
+ if (isset($_FILES['file']) && isset($_POST['timestamp'])) {
2826
+
2827
+ $file_name = strtolower($_FILES['file']['name']);
2828
+ $file_name = basename($file_name); //This prevents traversal
2829
+
2830
+ if(!wplc_check_file_name_for_unsafe_extension($file_name)){
2831
+ if(wplc_check_file_name_for_safe_extension($file_name)){
2832
+ if( file_exists($user_dirname . "/wp_live_chat/" . $_POST['cid'] . "/" . $_FILES['file']['name'] ) ){
2833
+ $file_name = rand(0, 10) . "-" . $file_name;
2834
+ }
2835
+
2836
+ if(move_uploaded_file($_FILES['file']['tmp_name'], $user_dirname."/wp_live_chat/" . $_POST['cid'] . "/" . $file_name)){
2837
+
2838
+ //File has been uploaded, let's now go ahead and check the mime type
2839
+ if(wplc_check_file_mime_type($user_dirname. "/wp_live_chat/" . $_POST['cid'] . "/" . $file_name)){
2840
+
2841
+ $response = $upload_dir['baseurl']."/wp_live_chat/" . $_POST['cid'] . "/" . $file_name;
2842
+ echo $response;
2843
+ } else {
2844
+ //Failed, lets delete this file to be safe
2845
+ @unlink($user_dirname. "/wp_live_chat/" . $_POST['cid'] . "/" . $file_name);
2846
+ echo 'MIME Type not allowed';
2847
+ }
2848
+ } else {
2849
+ echo '1';
2850
+ }
2851
+
2852
+ } else {
2853
+ echo "Filetype not allowed";
2854
+ }
2855
+ } else {
2856
+ echo "Security Violation";
2857
+ }
2858
+ }
2859
+ wp_die();
2860
+ }
2861
+ }
2862
+ }
2863
+
2864
+
2865
+
2866
+
2867
+ function wplc_typing_mrg($user,$cid,$type) {
2868
+
2869
+ $cdata = wplc_get_chat_data($cid,__LINE__);
2870
+
2871
+ $other = maybe_unserialize($cdata->other);
2872
+
2873
+
2874
+ if (isset($other['typing'][$user]) && $other['typing'][$user] == $type) {
2875
+ /* same state, ignore */
2876
+ return "already";
2877
+ } else {
2878
+ global $wpdb;
2879
+ global $wplc_tblname_chats;
2880
+ $other['typing'][$user] = $type;
2881
+
2882
+ $wpdb->update(
2883
+ $wplc_tblname_chats,
2884
+ array(
2885
+ 'other' => maybe_serialize($other)
2886
+ ),
2887
+ array('id' => $cid),
2888
+ array(
2889
+ '%s'
2890
+ ),
2891
+ array('%d')
2892
+ );
2893
+
2894
+ $cdata = wplc_get_chat_data($cid,__LINE__);
2895
+
2896
+ $other = maybe_unserialize($cdata->other);
2897
+ return $cid;
2898
+ }
2899
+
2900
+
2901
+
2902
+
2903
+
2904
+ }
2905
+
2906
+
2907
+
2908
+ /**
2909
+ * Add switchery JS & CSS button to the chat dashboard
2910
+ * @since 1.0.00
2911
+ * @author Nick Duncan <nick@wp-livechat.com>
2912
+ * @return void
2913
+ */
2914
+ if (!function_exists("wplc_choose_admin_scripts")) {
2915
+ add_action('admin_print_scripts', 'wplc_choose_admin_scripts');
2916
+ function wplc_choose_admin_scripts() {
2917
+ global $wplc_version;
2918
+ wp_register_script('wplc_switchery', plugins_url('js/switchery.min.js', __FILE__), array('jquery'),$wplc_version);
2919
+ wp_enqueue_script('wplc_switchery');
2920
+ wp_register_style('wplc_switchery_css', plugins_url('css/switchery.min.css', __FILE__),false,$wplc_version);
2921
+ wp_enqueue_style('wplc_switchery_css');
2922
+ wp_register_script('wplc-choose-script', plugins_url('/js/wplc_choose.js', __FILE__),array('jquery'),$wplc_version);
2923
+ wp_enqueue_script('wplc-choose-script');
2924
+
2925
+ $wpc_admin_js_strings = array(
2926
+ 'accepting_status' => __('Status (Online)', 'wplivechat'),
2927
+ 'accepting_chats' => __('Online', 'wplivechat'),
2928
+ 'not_accepting_chats' => __('Offline', 'wplivechat'),
2929
+ 'not_accepting_status' => __('Status (Offline)', 'wplivechat')
2930
+ );
2931
+ wp_localize_script('wplc-choose-script', 'wplc_choose_admin_strings', $wpc_admin_js_strings);
2932
+
2933
+ $wplc_current_user_id = get_current_user_id();
2934
+ $choose_array = get_option("WPLC_CHOOSE_ACCEPTING");
2935
+ if (isset($choose_array[$wplc_current_user_id]) && $choose_array[$wplc_current_user_id]) {
2936
+ /* user is online */
2937
+ wp_localize_script('wplc-choose-script', 'wplc_choose_accept_chats', '1');
2938
+ wp_localize_script('wplc-choose-script', 'wplc_localized_offline_string', ' ');
2939
+ wp_localize_script('wplc-choose-script', 'wplc_localized_quote_string', ' ');
2940
+
2941
+ } else {
2942
+ wp_localize_script('wplc-choose-script', 'wplc_choose_accept_chats', '0');
2943
+ $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>";
2944
+ $quote_string = "<p><span class='offline-quote'>".wplc_random_quote_mrg()."</span></p>";
2945
+ wp_localize_script('wplc-choose-script', 'wplc_localized_offline_string', $offline_string);
2946
+ wp_localize_script('wplc-choose-script', 'wplc_localized_quote_string', $quote_string);
2947
+
2948
+ }
2949
+
2950
+
2951
+ global $wplc_version;
2952
+ wp_register_script('wplc-qr-script', plugins_url('/js/quick_responses.js', __FILE__),array('jquery'),$wplc_version);
2953
+ wp_enqueue_script('wplc-qr-script');
2954
+ wp_register_script('wplc-triggers', plugins_url('/js/triggers.js', __FILE__),array('jquery'),$wplc_version);
2955
+ wp_enqueue_script('wplc-triggers');
2956
+
2957
+ $wplc_settings = get_option("WPLC_SETTINGS");
2958
+ if(isset($wplc_settings["wplc_ux_editor"]) && $wplc_settings["wplc_ux_editor"] !== "0"){
2959
+
2960
+ wp_register_script('wplc-admin-editor', plugins_url('/js/wplc_admin_editor.js', __FILE__),array('jquery'),$wplc_version);
2961
+ wp_enqueue_script('wplc-admin-editor');
2962
+ }
2963
+
2964
+
2965
+
2966
+ }
2967
+ }
2968
+
2969
+
2970
+ /**
2971
+ * Remove default transient renewer if option is enabled
2972
+ * @since 1.0.00
2973
+ * @author Nick Duncan <nick@wp-livechat.com>
2974
+ * @return void
2975
+ */
2976
+ if (!function_exists("wplc_choose_hook_control_head")) {
2977
+ add_action("wplc_maa_hook_head","wplc_choose_hook_control_head",1);
2978
+ function wplc_choose_hook_control_head() {
2979
+ $wplc_choose_data = get_option("WPLC_CHOOSE_SETTINGS");
2980
+ if(isset($wplc_choose_data['wplc_auto_online'])) { } else {
2981
+ remove_action("wplc_maa_hook_head","wplc_maa_hook_control_head");
2982
+ }
2983
+
2984
+ }
2985
+ }
2986
+
2987
+
2988
+
2989
+
2990
+
2991
+
2992
+
2993
+ /**
2994
+ * Encrypt the message via the filter
2995
+ * @param string $msg The message
2996
+ * @return string
2997
+ * @since 1.0.00
2998
+ * @author Nick Duncan <nick@wp-livechat.com>
2999
+ */
3000
+ if (!function_exists("wplc_encrypt_filter_control_message_control")) {
3001
+ add_filter("wplc_filter_message_control","wplc_encrypt_filter_control_message_control",10,1);
3002
+ function wplc_encrypt_filter_control_message_control($msg) {
3003
+ $msg = wplc_encrypt_encrypt_msg($msg);
3004
+ return $msg;
3005
+ }
3006
+ }
3007
+
3008
+
3009
+
3010
+
3011
+ /**
3012
+ * Decrypt the message via the filter
3013
+ * @param string $msg The message
3014
+ * @return string
3015
+ * @since 1.0.00
3016
+ * @author Nick Duncan <nick@wp-livechat.com>
3017
+ */
3018
+ if (!function_exists("wplc_encrypt_filter_control_out_message_control")) {
3019
+ add_filter("wplc_filter_message_control_out","wplc_encrypt_filter_control_out_message_control",10,1);
3020
+ function wplc_encrypt_filter_control_out_message_control($msg) {
3021
+ $msg = wplc_encrypt_decrypt_msg($msg);
3022
+ return $msg;
3023
+ }
3024
+ }
3025
+
3026
+
3027
+ /**
3028
+ * Add to the tabs filter
3029
+ * @return void
3030
+ * @since 1.0.00
3031
+ * @author Nick Duncan <nick@wp-livechat.com>
3032
+ */
3033
+
3034
+ if (!function_exists("wplc_encrypt_filter_control_setting_tabs")) {
3035
+ add_filter("wplc_filter_setting_tabs","wplc_encrypt_filter_control_setting_tabs");
3036
+ function wplc_encrypt_filter_control_setting_tabs($tab_array) {
3037
+ $tab_array[9] = array(
3038
+ "href" => "#tabs-9",
3039
+ "icon" => 'fa fa-lock',
3040
+ "label" => __("Encryption","wplivechat")
3041
+ );
3042
+
3043
+ $tab_array['business-hours'] = array(
3044
+ 'href' => '#wplc-business-hours',
3045
+ 'icon' => 'fa fa-clock-o',
3046
+ 'label' => __("Business Hours", "wplivechat")
3047
+ );
3048
+
3049
+ return $tab_array;
3050
+ }
3051
+ }
3052
+
3053
+
3054
+ /**
3055
+ * Encrypt the message
3056
+ * @since 1.0.0
3057
+ * @return void
3058
+ * @author Jarryd Long <jarryd@wp-livechat.com>
3059
+ */
3060
+ if (!function_exists("wplc_encrypt_encrypt_msg")) {
3061
+ function wplc_encrypt_encrypt_msg($plaintext){
3062
+
3063
+ $wplc_encrypt_data = get_option("WPLC_ENCRYPT_SETTINGS");
3064
+ if(isset($wplc_encrypt_data['wplc_enable_encryption']) && intval($wplc_encrypt_data['wplc_enable_encryption']) == 1){
3065
+
3066
+ $encrypted_salt = get_option( "wp-live-chat-support-pro_key" );
3067
+ $api_key = get_option('wplc_api_key');
3068
+
3069
+ if( $api_key != '' ){
3070
+ /**
3071
+ * Use the current API key and don't change anything
3072
+ */
3073
+ $api_key = $api_key;
3074
+ } else {
3075
+ /**
3076
+ * It's empty so lets fix this
3077
+ */
3078
+ if( $encrypted_salt != '' ){
3079
+
3080
+ $api_key = $encrypted_salt;
3081
+
3082
+ } else {
3083
+
3084
+ $api_key = '';
3085
+
3086
+ }
3087
+ }
3088
+ if($api_key != ''){
3089
+ $api_key = substr($api_key, 0, 10);
3090
+
3091
+ $plaintext_utf8 = utf8_encode($plaintext);
3092
+ $inputData = cryptoHelpers::convertStringToByteArray($plaintext);
3093
+ $keyAsNumbers = cryptoHelpers::toNumbers(bin2hex($api_key));
3094
+ $keyLength = count($keyAsNumbers);
3095
+ $iv = cryptoHelpers::generateSharedKey(16);
3096
+
3097
+ $encrypted = AES::encrypt(
3098
+ $inputData,
3099
+ AES::modeOfOperation_CBC,
3100
+ $keyAsNumbers,
3101
+ $keyLength,
3102
+ $iv
3103
+ );
3104
+
3105
+ $retVal = $encrypted['originalsize'] . " "
3106
+ . cryptoHelpers::toHex($iv) . " "
3107
+ . cryptoHelpers::toHex($encrypted['cipher']);
3108
+
3109
+ $message = array(
3110
+ 'e' => 1,
3111
+ 'm' => $retVal
3112
+ );
3113
+ return maybe_serialize($message);
3114
+ } else {
3115
+ $message = array(
3116
+ 'e' => 0,
3117
+ 'm' => $plaintext
3118
+ );
3119
+ return maybe_serialize($message);
3120
+ }
3121
+ } else {
3122
+ $message = array(
3123
+ 'e' => 0,
3124
+ 'm' => $plaintext
3125
+ );
3126
+ return maybe_serialize($message);
3127
+ }
3128
+ }
3129
+ }
3130
+
3131
+
3132
+ /**
3133
+ * Decrypt the message
3134
+ * @since 1.0.0
3135
+ * @return void
3136
+ * @author Jarryd Long <jarryd@wp-livechat.com>
3137
+ */
3138
+ if (!function_exists("wplc_encrypt_decrypt_msg")) {
3139
+ function wplc_encrypt_decrypt_msg($input){
3140
+
3141
+ $messages = maybe_unserialize($input);
3142
+
3143
+
3144
+ if(is_array($messages)){
3145
+ if($messages['e'] == 1){
3146
+ /* This message was encrypted */
3147
+ $encrypted_salt = get_option( "wp-live-chat-support-pro_key" );
3148
+ $api_key = get_option('wplc_api_key');
3149
+
3150
+ if( $api_key != '' ){
3151
+ /**
3152
+ * Use the current API key and don't change anything
3153
+ */
3154
+ $api_key = $api_key;
3155
+ } else {
3156
+ /**
3157
+ * It's empty so lets fix this
3158
+ */
3159
+ if( $encrypted_salt != '' ){
3160
+
3161
+ $api_key = $encrypted_salt;
3162
+
3163
+ } else {
3164
+
3165
+ $api_key = '';
3166
+
3167
+ }
3168
+ }
3169
+
3170
+ $api_key = substr($api_key, 0, 10);
3171
+ $cipherSplit = explode( " ", $messages['m']);
3172
+ $originalSize = intval($cipherSplit[0]);
3173
+ $iv = cryptoHelpers::toNumbers($cipherSplit[1]);
3174
+ $cipherText = $cipherSplit[2];
3175
+
3176
+ $cipherIn = cryptoHelpers::toNumbers($cipherText);
3177
+ $keyAsNumbers = cryptoHelpers::toNumbers(bin2hex($api_key));
3178
+ $keyLength = count($keyAsNumbers);
3179
+
3180
+ $decrypted = AES::decrypt(
3181
+ $cipherIn,
3182
+ $originalSize,
3183
+ AES::modeOfOperation_CBC,
3184
+ $keyAsNumbers,
3185
+ $keyLength,
3186
+ $iv
3187
+ );
3188
+
3189
+ $hexDecrypted = cryptoHelpers::toHex($decrypted);
3190
+ $retVal = pack("H*" , $hexDecrypted);
3191
+
3192
+ return stripslashes($retVal);
3193
+ } else {
3194
+ return stripslashes($messages['m']);
3195
+ }
3196
+ } else{
3197
+ return stripslashes($input);
3198
+ }
3199
+ }
3200
+
3201
+ }
3202
+
3203
+
3204
+
3205
+ if (!function_exists("wplc_inex_filter_control_display_contents")) {
3206
+ add_filter("wplc_filter_display_contents","wplc_inex_filter_control_display_contents",1);
3207
+ function wplc_inex_filter_control_display_contents($display_contents) {
3208
+
3209
+ $wplc_inex_data = get_option("WPLC_INEX_SETTINGS");
3210
+
3211
+ $post_id = get_the_ID();
3212
+ if (!$post_id || $post_id === NULL) {
3213
+ $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'];
3214
+ $post_id = url_to_postid($url);
3215
+ }
3216
+
3217
+
3218
+ if (isset($wplc_inex_data['wplc_include_on_pages'])) { $include_on_pages = $wplc_inex_data['wplc_include_on_pages']; } else { $include_on_pages = ""; }
3219
+ if (isset($wplc_inex_data['wplc_exclude_from_pages'])) { $exclude_from_pages = $wplc_inex_data['wplc_exclude_from_pages']; } else { $exclude_from_pages = ""; }
3220
+
3221
+
3222
+ if($include_on_pages == "" && $exclude_from_pages == ""){
3223
+ $display_contents = 1;
3224
+
3225
+ } else {
3226
+
3227
+ if($include_on_pages != ''){
3228
+
3229
+ $include_on_pages = explode(',', $include_on_pages);
3230
+ foreach($include_on_pages as $key => $val) {
3231
+ $include_on_pages[$key] = intval($val);
3232
+ }
3233
+ $include_array = array();
3234
+ foreach($include_on_pages as $page){
3235
+ $include_array [intval($page)] = intval($page);
3236
+ }
3237
+
3238
+ if (isset($include_array[$post_id]) && $include_array[$post_id] > 0) {
3239
+ $display_contents = true;
3240
+ } else {
3241
+ /* Do not show here */
3242
+ $display_contents = false;
3243
+ }
3244
+
3245
+
3246
+ } else {
3247
+
3248
+ /* Exclude from the following pages */
3249
+ $exclude_from_pages = explode(',', $exclude_from_pages);
3250
+ $exclude_array = array();
3251
+ foreach($exclude_from_pages as $page){
3252
+ $exclude_array [$page] = intval($page);
3253
+ }
3254
+
3255
+ $exclude_from_page = array_search($post_id, $exclude_array);
3256
+ if($exclude_from_page === FALSE){
3257
+ /* Show here */
3258
+ $display_contents = true;
3259
+ } else {
3260
+ $display_contents = false;
3261
+ }
3262
+
3263
+ }
3264
+
3265
+ }
3266
+ if( isset( $wplc_inex_data['wplc_exclude_home'] ) && $wplc_inex_data['wplc_exclude_home'] == '1' ){
3267
+ if( is_home() || is_front_page() || $_SERVER['REQUEST_URI'] == '/' ){
3268
+
3269
+ $display_contents = false;
3270
+
3271
+ }
3272
+
3273
+ }
3274
+
3275
+ if( isset( $wplc_inex_data['wplc_exclude_archive'] ) && $wplc_inex_data['wplc_exclude_archive'] == '1' ){
3276
+
3277
+ if( is_archive() ){
3278
+
3279
+ $display_contents = false;
3280
+
3281
+ }
3282
+
3283
+ }
3284
+
3285
+ 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'] ) ) {
3286
+ $display_contents = false;
3287
+ }
3288
+
3289
+ return $display_contents;
3290
+
3291
+ }
3292
+ }
3293
+
3294
+
3295
+
3296
+
3297
+ add_action('wplc_hook_admin_chatbox_javascript','wplc_ic_admin_javascript');
3298
+ add_action('wplc_hook_admin_menu_layout_display' , 'wplc_hook_control_admin_menu_layout_display', 1, 3);
3299
+ add_action('wplc_hook_wplc_draw_chat_area', 'wplc_hook_control_wplc_draw_chat_area',1, 1);
3300
+ add_filter('wplc_filter_list_chats_actions', 'wplc_ic_initiate_chat_button', 14, 3);
3301
+ 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);
3302
+ add_filter("wplc_filter_run_override","wplc_ic_filter_control_run_override");
3303
+
3304
+ if (!function_exists("wplc_ic_filter_control_run_override")) {
3305
+ function wplc_ic_filter_control_run_override($ret) {
3306
+ $wplc_settings = get_option("WPLC_SETTINGS");
3307
+ if (isset($wplc_settings['wplc_disable_initiate_chat']) && $wplc_settings['wplc_disable_initiate_chat'] == 1 ) { return "0"; } else { return "1"; /* allow long poll */ }
3308
+ }
3309
+ }
3310
+
3311
+
3312
+ /**
3313
+ * Add an item to the data_array ajax variable
3314
+ *
3315
+ * @since 1.0.0
3316
+ * @param
3317
+ * @return void
3318
+ * @author Nick Duncan <nick@wp-livechat.com>
3319
+ *
3320
+ */
3321
+ if (!function_exists("wplc_ic_filter_control_admin_javascript")) {
3322
+ add_filter("wplc_filter_admin_javascript","wplc_ic_filter_control_admin_javascript");
3323
+ function wplc_ic_filter_control_admin_javascript($data_array) {
3324
+ $agent_id = wplc_ic_check_if_user_is_agent();
3325
+ if ($agent_id) {
3326
+ $data_array['agent_id'] = $agent_id;
3327
+ }
3328
+ return $data_array;
3329
+
3330
+ }
3331
+ }
3332
+
3333
+ /**
3334
+ * Check if the user is an agent
3335
+ *
3336
+ * @since 1.0.0
3337
+ * @param
3338
+ * @return string
3339
+ * @author Nick Duncan <nick@wp-livechat.com>
3340
+ *
3341
+ */
3342
+ if (!function_exists("wplc_ic_check_if_user_is_agent")) {
3343
+ function wplc_ic_check_if_user_is_agent(){
3344
+ $user_id = get_current_user_id();
3345
+ if (esc_attr(get_the_author_meta('wplc_ma_agent', $user_id ) ) == "1"){
3346
+ return $user_id;
3347
+ } else {
3348
+ return "not_user_agent";
3349
+ }
3350
+ }
3351
+ }
3352
+
3353
+
3354
+
3355
+
3356
+ /**
3357
+ * Initiate chat button
3358
+ * @param string $default The default text that gets passed through
3359
+ * @param int $id2 ID of the chat
3360
+ * @return string
3361
+ * @since 1.0.00
3362
+ * @author Nick Duncan <nick@wp-livechat.com>
3363
+ */
3364
+ if (!function_exists("wplc_ic_initiate_chat_button")) {
3365
+ function wplc_ic_initiate_chat_button($actions,$result,$post_data) {
3366
+
3367
+ if(intval($result->status) == 5 ){
3368
+ $aid = "";
3369
+ if ($post_data['wplc_extra_data']['agent_id']) {
3370
+ if(is_numeric($post_data['wplc_extra_data']['agent_id'])){
3371
+ $aid = "&aid=".$post_data['wplc_extra_data']['agent_id'];
3372
+ }
3373
+ }
3374
+
3375
+ $url = admin_url( 'admin.php?page=wplivechat-menu&action=rc&cid='.$result->id.$aid);
3376
+ $url_params = apply_filters("wplc_filter_list_chats_url_params","",$result,$post_data);
3377
+
3378
+ /* have we disabled this? */
3379
+ $wplc_settings = get_option("WPLC_SETTINGS");
3380
+ if (isset($wplc_settings['wplc_disable_initiate_chat']) && $wplc_settings['wplc_disable_initiate_chat'] === '1' ) {
3381
+ $actions = "";
3382
+ } else {
3383
+
3384
+ $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>";
3385
+ }
3386
+
3387
+ }
3388
+
3389
+
3390
+ return $actions;
3391
+
3392
+ }
3393
+ }
3394
+
3395
+ /**
3396
+ * Localize the action2 variable that is required
3397
+ * @return void
3398
+ * @since 1.0.00
3399
+ * @author Nick Duncan <nick@wp-livechat.com>
3400
+ */
3401
+ if (!function_exists("wplc_ic_admin_javascript")) {
3402
+ function wplc_ic_admin_javascript() {
3403
+
3404
+ $wplc_settings = get_option("WPLC_SETTINGS");
3405
+ if (isset($wplc_settings['wplc_typing_enabled']) && $wplc_settings['wplc_typing_enabled'] == 1) { $typing_enabled = "1"; } else { $typing_enabled = "0"; }
3406
+
3407
+
3408
+
3409
+ if ($typing_enabled) {
3410
+ $wpc_misc_js_strings = array(
3411
+ 'typing_enabled' => $typing_enabled,
3412
+ 'typingimg' => plugins_url('/images/comment.svg', __FILE__)
3413
+ );
3414
+ } else {
3415
+ $wpc_misc_js_strings = array(
3416
+ 'typing_enabled' => $typing_enabled
3417
+ );
3418
+ }
3419
+
3420
+
3421
+ wp_localize_script('wplc-admin-chat-js', 'wplc_misc_strings', $wpc_misc_js_strings);
3422
+
3423
+
3424
+
3425
+ if (isset($_GET['action']) && $_GET['action'] == 'rc') {
3426
+ wp_localize_script( 'wplc-admin-chat-js', 'wplc_action2', 'wplc_long_poll_check_user_opened_chat' );
3427
+ wp_localize_script( 'wplc-admin-chat-js', 'wplc_use_node_server', 'false' );
3428
+ } else {
3429
+ return;
3430
+ }
3431
+ }
3432
+ }
3433
+
3434
+ if (!function_exists("wplc_hook_control_intiate_check")) {
3435
+ add_action("wplc_hook_initiate_check","wplc_hook_control_intiate_check",10,3);
3436
+ function wplc_hook_control_intiate_check($action,$cid,$aid) {
3437
+
3438
+ wplc_change_chat_status($cid, 6); // 6 = request chat
3439
+
3440
+ wplc_draw_chat_area($cid);
3441
+
3442
+
3443
+ }
3444
+ }
3445
+
3446
+ /**
3447
+ * Decide what to show when an initialization is happening on the admin side
3448
+ * @param string $action The action GET param
3449
+ * @return void
3450
+ * @since 1.0.00
3451
+ * @author Nick Duncan <nick@wp-livechat.com>
3452
+ */
3453
+ if (!function_exists("wplc_hook_control_admin_menu_layout_display")) {
3454
+ function wplc_hook_control_admin_menu_layout_display($action, $cid,$aid) {
3455
+ if ($action == 'rc') {
3456
+ do_action("wplc_hook_initiate_check",$action,$cid,$aid);
3457
+ }
3458
+ }
3459
+ }
3460
+
3461
+ /**
3462
+ * Add the new status code to the JS array
3463
+ * @param array $array
3464
+ * @return array
3465
+ * @since 1.0.00
3466
+ * @author Nick Duncan <nick@wp-livechat.com>
3467
+ */
3468
+ if (!function_exists("wplc_filter_control_wplc_call_to_server_visitor_new_status_check")) {
3469
+ function wplc_filter_control_wplc_call_to_server_visitor_new_status_check($array) {
3470
+
3471
+ if (intval($array['status']) == 6) {
3472
+ $array['check'] = true;
3473
+ $array['status'] = 3;
3474
+ $array['wplc_name'] = "You";
3475
+ wplc_change_chat_status(sanitize_text_field($array['cid']),3);
3476
+ }
3477
+ return $array;
3478
+ }
3479
+ }
3480
+
3481
+ /**
3482
+ * Decide what to show when an initialization is happening on the admin side
3483
+ * @param array $array
3484
+ * @return array
3485
+ * @since 1.0.00
3486
+ * @author Nick Duncan <nick@wp-livechat.com>
3487
+ */
3488
+ if (!function_exists("wplc_hook_control_wplc_draw_chat_area")) {
3489
+ function wplc_hook_control_wplc_draw_chat_area($result) {
3490
+
3491
+ if(!empty($result->name)){
3492
+ wp_localize_script('wplc-admin-chat-js', 'wplc_chat_name', $result->name);
3493
+ } else {
3494
+ wp_localize_script('wplc-admin-chat-js', 'wplc_chat_name', __('Guest', 'wplivechat'));
3495
+ }
3496
+
3497
+
3498
+ if (intval($result->status) == 6) {
3499
+ echo "<strong>" . __("Attempting to open the chat window... Please be patient.", "wp-live-chat-support-initiate-chats") . "</strong>";
3500
+ $result->continue = false;
3501
+ return $result;
3502
+ }
3503
+ return $result;
3504
+
3505
+ }
3506
+ }
3507
+
3508
+
3509
+
3510
+
3511
+
3512
+
3513
+ /**
3514
+ * Checks if user is an agent while on the chat dashboard page
3515
+ * @return void
3516
+ * @since 1.0.00
3517
+ * @author Nick Duncan <nick@wp-livechat.com>
3518
+ */
3519
+ if (!function_exists("wplc_ma_hook_control_admin_meny_layout_display_top")) {
3520
+ function wplc_ma_hook_control_admin_meny_layout_display_top() {
3521
+ $wplc_current_user_id = get_current_user_id();
3522
+ $is_agent = get_user_meta($wplc_current_user_id, 'wplc_ma_agent', true);
3523
+ if(!$is_agent){
3524
+ $warning = "<p style='color: red;'><b>".__('You are not a chat agent. Please make yourself a chat agent before trying to chat to visitors', 'wp-live-chat-support-multiple-agents')."</b></p>";
3525
+ echo $warning;
3526
+ }
3527
+ return;
3528
+ }
3529
+ }
3530
+
3531
+
3532
+
3533
+
3534
+
3535
+ /**
3536
+ * Assign the chat to the agent
3537
+ *
3538
+ * @since 1.0.0
3539
+ * @param
3540
+ * @return void
3541
+ * @author Nick Duncan <nick@wp-livechat.com>
3542
+ *
3543
+ */
3544
+ if (!function_exists("wplc_maa_update_agent_id")) {
3545
+ function wplc_maa_update_agent_id($cid, $aid){
3546
+ global $wpdb;
3547
+ global $wplc_tblname_chats;
3548
+ $sql = "SELECT * FROM `$wplc_tblname_chats` WHERE `id` = '$cid'";
3549
+ $result = $wpdb->get_row($sql);
3550
+ if ($result) {
3551
+ if(intval($result->status) != 3){
3552
+ $update = "UPDATE `$wplc_tblname_chats` SET `agent_id` = '$aid' WHERE `id` = '$cid'";
3553
+ $wpdb->query($update);
3554
+ }
3555
+ } else {
3556
+ return false;
3557
+ }
3558
+ }
3559
+ }
3560
+
3561
+
3562
+
3563
+ /**
3564
+ * Check if the user is an agent
3565
+ *
3566
+ * @since 1.0.0
3567
+ * @param
3568
+ * @return string
3569
+ * @author Nick Duncan <nick@wp-livechat.com>
3570
+ *
3571
+ */
3572
+ if (!function_exists("wplc_maa_check_if_user_is_agent")) {
3573
+ function wplc_maa_check_if_user_is_agent(){
3574
+ $user_id = get_current_user_id();
3575
+ if (esc_attr(get_the_author_meta('wplc_ma_agent', $user_id ) ) == "1"){
3576
+ return $user_id;
3577
+ } else {
3578
+ return "not_user_agent";
3579
+ }
3580
+ }
3581
+ }
3582
+
3583
+
3584
+
3585
+ /**
3586
+ * Check if the chat has been answered by another chat agent
3587
+ * @since 1.0.0
3588
+ * @param int $cid Chat ID
3589
+ * @param int $aid Agent ID
3590
+ * @return bool
3591
+ * @author Nick Duncan <nick@wp-livechat.com>
3592
+ */
3593
+ if (!function_exists("wplc_maa_check_if_chat_answered_by_other_agent")) {
3594
+ function wplc_maa_check_if_chat_answered_by_other_agent($cid, $aid){
3595
+ do_action("wplc_hook_ma_check_if_answered_by_another_agent",$cid,$aid);
3596
+
3597
+ }
3598
+ }
3599
+
3600
+
3601
+ if (!function_exists("wplc_hook_control_ma_check_if_answered_by_another_agent")) {
3602
+ add_action("wplc_hook_ma_check_if_answered_by_another_agent","wplc_hook_control_ma_check_if_answered_by_another_agent",10,2);
3603
+ function wplc_hook_control_ma_check_if_answered_by_another_agent($cid,$aid) {
3604
+ global $wpdb;
3605
+ global $wplc_tblname_chats;
3606
+ $cid = intval($cid);
3607
+ $sql = "SELECT * FROM `$wplc_tblname_chats` WHERE `id` = '".$cid."'";
3608
+ $result = $wpdb->get_row($sql);
3609
+ if(intval($result->agent_id) == intval($aid)){
3610
+ return false;
3611
+ } else {
3612
+ return true;
3613
+ }
3614
+ }
3615
+ }
3616
+
3617
+
3618
+ /**
3619
+ * Hook for updating the agent id
3620
+ * @param int $cid Chat ID
3621
+ * @param int $aid Agent ID
3622
+ * @since 1.0.0
3623
+ * @author Nick Duncan <nick@wp-livechat.com>
3624
+ * @return void
3625
+ */
3626
+ if (!function_exists("wplc_ma_hook_control_update_agent_id")) {
3627
+ add_action("wplc_hook_update_agent_id","wplc_ma_hook_control_update_agent_id",10,2);
3628
+ function wplc_ma_hook_control_update_agent_id($cid,$aid) {
3629
+ wplc_maa_update_agent_id(sanitize_text_field($cid), sanitize_text_field($aid));
3630
+
3631
+ }
3632
+ }
3633
+
3634
+
3635
+
3636
+ /**
3637
+ * On first installation activation, set current admin as chat agent
3638
+ * @since 1.0.0
3639
+ * @param
3640
+ * @return void
3641
+ * @author Nick Duncan <nick@wp-livechat.com>
3642
+ */
3643
+ if (!function_exists("wplc_ma_first_time_install")) {
3644
+ function wplc_ma_first_time_install() {
3645
+ global $wpdb;
3646
+ global $wplc_tblname_chats;
3647
+
3648
+
3649
+ $sql = " SHOW COLUMNS FROM ".$wplc_tblname_chats." WHERE `Field` = 'agent_id'";
3650
+ $results = $wpdb->get_results($sql);
3651
+ if (!$results) {
3652
+ $sql = "ALTER TABLE `$wplc_tblname_chats` ADD `agent_id` INT(11) NOT NULL;";
3653
+ $wpdb->query($sql);
3654
+ }
3655
+
3656
+
3657
+
3658
+ $admins = get_role('administrator');
3659
+ $admins->add_cap('wplc_ma_agent');
3660
+ $uid = get_current_user_id();
3661
+ update_user_meta($uid, 'wplc_ma_agent', 1);
3662
+ update_user_meta($uid, "wplc_chat_agent_online", time());
3663
+ }
3664
+ }
3665
+
3666
+
3667
+
3668
+
3669
+ /**
3670
+ * Set the user as an agent
3671
+ * @since 1.0.0
3672
+ * @param
3673
+ * @return void
3674
+ * @author Nick Duncan <nick@wp-livechat.com>
3675
+ */
3676
+ if (!function_exists("wplc_maa_set_user_as_agent")) {
3677
+ function wplc_maa_set_user_as_agent( $user_id ) {
3678
+
3679
+ if ( !current_user_can( 'edit_user', $user_id ) ) { return false; }
3680
+
3681
+ if ( current_user_can( 'manage_options' ) ) {
3682
+
3683
+ if(isset($_POST['wplc_ma_agent'])){
3684
+ update_user_meta( $user_id, 'wplc_ma_agent', $_POST['wplc_ma_agent']);
3685
+ } else {
3686
+ delete_user_meta( $user_id, 'wplc_ma_agent');
3687
+ }
3688
+
3689
+ if ($_POST['wplc_ma_agent'] == '1') {
3690
+ $wplc_ma_user = new WP_User( $user_id );
3691
+ $wplc_ma_user->add_cap( 'wplc_ma_agent' );
3692
+ update_user_meta($user_id, "wplc_chat_agent_online", time());
3693
+ } else {
3694
+ $wplc_ma_user = new WP_User( $user_id );
3695
+ $wplc_ma_user->remove_cap( 'wplc_ma_agent' );
3696
+ delete_user_meta($user_id, "wplc_ma_agent");
3697
+ delete_user_meta($user_id, "wplc_chat_agent_online");
3698
+ }
3699
+ }
3700
+
3701
+ do_action("wplc_pro_set_user_hook", $user_id);
3702
+ }
3703
+ }
3704
+
3705
+
3706
+ /**
3707
+ * Add the custom fields to the user profile page
3708
+ *
3709
+ * @since 1.0.0
3710
+ * @param
3711
+ * @return void
3712
+ * @author Nick Duncan <nick@wp-livechat.com>
3713
+ *
3714
+ */
3715
+ if (!function_exists("wplc_maa_custom_user_profile_fields")) {
3716
+ function wplc_maa_custom_user_profile_fields($user) {
3717
+ $wplc_settings = get_option('WPLC_INEX_SETTINGS');
3718
+ if(isset($wplc_settings['wplc_make_agent']) && $wplc_settings['wplc_make_agent'] == 1){
3719
+ ?>
3720
+ <table class="form-table">
3721
+ <tr>
3722
+ <th>
3723
+ <label for="wplc_ma_agent"><?php _e('Chat Agent', 'wplivechat'); ?></label>
3724
+ </th>
3725
+ <td>
3726
+ <label for="wplc_ma_agent">
3727
+ <input name="wplc_ma_agent" type="checkbox" id="wplc_ma_agent" value="1" <?php if (esc_attr( get_the_author_meta( 'wplc_ma_agent', $user->ID ) ) == "1") { echo "checked=\"checked\""; } ?>>
3728
+ <?php _e("Make this user a chat agent","wplivechat"); ?></label>
3729
+ </td>
3730
+ </tr>
3731
+ </table>
3732
+ <?php
3733
+ } else {
3734
+ if(current_user_can('manage_options', array(null))){
3735
+ ?>
3736
+ <table class="form-table">
3737
+ <tr>
3738
+ <th>
3739
+ <label for="wplc_ma_agent"><?php _e('Chat Agent', 'wplivechat'); ?></label>
3740
+ </th>
3741
+ <td>
3742
+ <label for="wplc_ma_agent">
3743
+ <input name="wplc_ma_agent" type="checkbox" id="wplc_ma_agent" value="1" <?php if (esc_attr( get_the_author_meta( 'wplc_ma_agent', $user->ID ) ) == "1") { echo "checked=\"checked\""; } ?>>
3744
+ <?php _e("Make this user a chat agent","wplivechat"); ?></label>
3745
+ </td>
3746
+ </tr>
3747
+ </table>
3748
+ <?php
3749
+ } else {
3750
+ ?>
3751
+ <table class="form-table">
3752
+ <tr>
3753
+ <th>
3754
+ <label for="wplc_ma_agent"><?php _e('Chat Agent', 'wplivechat'); ?></label>
3755
+ </th>
3756
+ <td>
3757
+ <?php
3758
+ echo "<p>".__("Your user role does not allow you to make yourself a chat agent.","wplivechat")."</p>";
3759
+ echo "<p>".__("Please contact the administrator of this website to change this.", "wplivechat")."</p>";
3760
+ ?>
3761
+ </td>
3762
+ </tr>
3763
+ </table>
3764
+ <?php
3765
+ }
3766
+ }
3767
+
3768
+ do_action("wplc_pro_custom_user_profile_field_after_content_hook", $user);
3769
+
3770
+ }
3771
+ }
3772
+
3773
+
3774
+ if (!function_exists("wplc_ma_hook_control_accept_chat")) {
3775
+ add_action('wplc_hook_accept_chat','wplc_ma_hook_control_accept_chat',1,2);
3776
+ function wplc_ma_hook_control_accept_chat($get_data,$aid) {
3777
+ if (wplc_maa_check_if_chat_answered_by_other_agent(intval($get_data['cid']), intval($aid)) === true) {
3778
+ echo "<p>".__("This chat has already been answered by another agent.", "wplivechat")."</p>";
3779
+ exit();
3780
+ if (function_exists("wplc_hook_control_accept_chat")) {
3781
+ remove_action("wplc_hook_accept_chat","wplc_hook_control_accept_chat", 10, 2);
3782
+ }
3783
+ }
3784
+ }
3785
+ }
3786
+
3787
+
3788
+ function wplc_is_typing_mrg($user,$cid) {
3789
+ $cdata = wplc_get_chat_data($cid,__LINE__);
3790
+
3791
+ if (isset($cdata->other)) {
3792
+ $other = maybe_unserialize($cdata->other);
3793
+
3794
+ if (isset($other['typing'][$user]) && $other['typing'][$user] > 0) {
3795
+
3796
+ return true;
3797
+ } else {
3798
+
3799
+ return false;
3800
+ }
3801
+ } else {
3802
+ return false;
3803
+ }
3804
+
3805
+ }
3806
+
3807
+
3808
+ /**
3809
+ * Modify the loop iteration
3810
+ *
3811
+ * @since 1.0.0
3812
+ * @param
3813
+ * @return array
3814
+ * @author Nick Duncan <nick@wp-livechat.com>
3815
+ */
3816
+
3817
+ if (!function_exists("wplc_ma_filter_control_wplc_admin_long_poll_chat_iteration")) {
3818
+ add_filter("wplc_filter_admin_long_poll_chat_loop_iteration","wplc_ma_filter_control_wplc_admin_long_poll_chat_iteration", 11, 4);
3819
+ function wplc_ma_filter_control_wplc_admin_long_poll_chat_iteration($array,$post_data,$i,$cdata = false) {
3820
+
3821
+
3822
+ if (!$cdata) {
3823
+ $cdata = wplc_get_chat_data($post_data['cid'],__LINE__);
3824
+ }
3825
+
3826
+ /* check to see if the user is typing and notify the agent */
3827
+ $previous_is_typing = get_option("wplc_previous_is_typing");
3828
+
3829
+ /* run checks for old chats and remove them from this variable */
3830
+ if ($previous_is_typing) {
3831
+ foreach ($previous_is_typing as $cid => $val) {
3832
+ $cdata = wplc_get_chat_data($cid,__LINE__);
3833
+
3834
+ if ($cdata->status != "3") {
3835
+ unset($previous_is_typing[$cid]);
3836
+ update_option("wplc_previous_is_typing",$previous_is_typing);
3837
+
3838
+ }
3839
+
3840
+ }
3841
+ }
3842
+
3843
+
3844
+ if (!isset($previous_is_typing[$post_data['cid']])) { $previous_is_typing[$post_data['cid']] = false; }
3845
+
3846
+ if (!isset($previous_is_typing[$post_data['cid']]['user'])) { $previous_is_typing[$post_data['cid']]['user'] = false; }
3847
+ /* 0 = user, 1 = agent */
3848
+ $is_typing_check = wplc_is_typing_mrg('user',$post_data['cid'],$cdata);
3849
+
3850
+ if ($is_typing_check !== $previous_is_typing[$post_data['cid']]['user']) {
3851
+
3852
+
3853
+ $array['is_typing_check'] = $is_typing_check;
3854
+ $array['previous_is_typing'] = $previous_is_typing[$post_data['cid']]['user'];
3855
+
3856
+ if ($is_typing_check) { $checker = "1"; }
3857
+ else { $checker = "0"; }
3858
+
3859
+ $array['typing'] = $checker;
3860
+
3861
+ /* 0 = user, 1 = agent */
3862
+ $previous_is_typing[$post_data['cid']]['user'] = $is_typing_check;
3863
+ update_option("wplc_previous_is_typing",$previous_is_typing);
3864
+
3865
+ } else {
3866
+
3867
+ }
3868
+
3869
+
3870
+
3871
+
3872
+ if (isset($post_data['extra_data']['agent_id'])) {
3873
+ if (wplc_maa_check_if_chat_answered_by_other_agent(intval($post_data['cid']), intval($post_data['extra_data']['agent_id'])) === true) {
3874
+ /* chat already answered by another agent */
3875
+ $array['action'] = "wplc_ma_agant_already_answered";
3876
+ }
3877
+ }
3878
+
3879
+ //Update Chat Experience Rating*/
3880
+ $rating_checker = nifty_get_rating_data_mrg($post_data['cid']);
3881
+ if( isset( $array['chat_rating'] ) ){
3882
+ $previous_rating = $array['chat_rating'];
3883
+ } else {
3884
+ $previous_rating = "";
3885
+ }
3886
+
3887
+ if ($rating_checker != $previous_rating) {
3888
+ $array['chat_rating'] = $rating_checker;
3889
+ }
3890
+
3891
+ return $array;
3892
+
3893
+ }
3894
+ }
3895
+
3896
+
3897
+
3898
+
3899
+ /**
3900
+ * Modify the loop iteration
3901
+ *
3902
+ * @since 1.0.0
3903
+ * @param
3904
+ * @return array
3905
+ * @author Nick Duncan <nick@wp-livechat.com>
3906
+ */
3907
+
3908
+ if (!function_exists("wplc_ma_filter_control_wplc_user_long_poll_chat_iteration")) {
3909
+ add_filter("wplc_filter_user_long_poll_chat_loop_iteration","wplc_ma_filter_control_wplc_user_long_poll_chat_iteration", 11, 4);
3910
+ function wplc_ma_filter_control_wplc_user_long_poll_chat_iteration($array,$post_data,$i,$cdata = false) {
3911
+
3912
+ if (!$cdata) {
3913
+ $cdata = wplc_get_chat_data($post_data['cid'],__LINE__);
3914
+ }
3915
+
3916
+ $previous_is_typing = get_option("wplc_previous_is_typing");
3917
+
3918
+ /* check to see if the agent is typing and notify the user */
3919
+ if (!isset($previous_is_typing[$post_data['cid']])) { $previous_is_typing[$post_data['cid']] = false; }
3920
+
3921
+ if (!isset($previous_is_typing[$post_data['cid']]['admin'])) { $previous_is_typing[$post_data['cid']]['admin'] = false; }
3922
+ /* 0 = user, 1 = agent */
3923
+ $is_typing_check = wplc_is_typing_mrg('admin',$post_data['cid'],$cdata);
3924
+
3925
+
3926
+
3927
+ if ($is_typing_check !== $previous_is_typing[$post_data['cid']]['admin']) {
3928
+
3929
+ $array['is_typing_check'] = $is_typing_check;
3930
+ $array['previous_is_typing'] = $previous_is_typing[$post_data['cid']]['admin'];
3931
+
3932
+ if ($is_typing_check) { $checker = "1"; }
3933
+ else { $checker = "0"; }
3934
+
3935
+ $array['typing'] = $checker;
3936
+ $array['check'] = true; /* this forces the array to be returned in the loop */
3937
+ $array['status'] = $post_data['status']; /* this is required to carry through the loop */
3938
+
3939
+ /* 0 = user, 1 = agent */
3940
+ $previous_is_typing[$post_data['cid']]['admin'] = $is_typing_check;
3941
+ update_option("wplc_previous_is_typing",$previous_is_typing);
3942
+
3943
+ } else {
3944
+ $array['is_typing_check'] = $is_typing_check;
3945
+ $array['previous_is_typing'] = $previous_is_typing[$post_data['cid']]['admin'];
3946
+ }
3947
+
3948
+ return $array;
3949
+
3950
+ }
3951
+ }
3952
+
3953
+
3954
+
3955
+
3956
+ /**
3957
+ * Hook to accept chat
3958
+ *
3959
+ * @since 1.0.0
3960
+ * @param
3961
+ * @return void
3962
+ * @author Nick Duncan <nick@wp-livechat.com>
3963
+ *
3964
+ */
3965
+ if (!function_exists("wplc_ma_hook_control_accept_chat_url")) {
3966
+ add_action( 'wplc_hook_accept_chat_url' , 'wplc_ma_hook_control_accept_chat_url', 10, 2);
3967
+ function wplc_ma_hook_control_accept_chat_url($get_data, $chat_data = false) {
3968
+ if (!isset($get_data['agent_id'])) {
3969
+ /* something went wrong :/ */
3970
+ } else {
3971
+ wplc_maa_update_agent_id(sanitize_text_field($get_data['cid']), sanitize_text_field($get_data['agent_id']));
3972
+ }
3973
+
3974
+ }
3975
+ }
3976
+
3977
+
3978
+ if (!function_exists("wplc_filter_control_aid_in_action")) {
3979
+ add_filter("wplc_filter_aid_in_action","wplc_filter_control_aid_in_action");
3980
+ function wplc_filter_control_aid_in_action() {
3981
+ $aid = "";
3982
+ $agent_id = wplc_maa_check_if_user_is_agent();
3983
+ if(is_numeric($agent_id)){
3984
+ $aid = "&aid=".$agent_id;
3985
+ }
3986
+ return $aid;
3987
+ }
3988
+ }
3989
+
3990
+
3991
+ /**
3992
+ *
3993
+ *
3994
+ * @since 1.0.0
3995
+ * @param
3996
+ * @return void
3997
+ * @author Nick Duncan <nick@wp-livechat.com>
3998
+ *
3999
+ */
4000
+ if (!function_exists("wplc_ma_filter_control_admin_javascript")) {
4001
+ add_filter("wplc_filter_admin_javascript","wplc_ma_filter_control_admin_javascript");
4002
+ function wplc_ma_filter_control_admin_javascript($data_array) {
4003
+ $agent_id = wplc_maa_check_if_user_is_agent();
4004
+ if ($agent_id) {
4005
+ $data_array['agent_id'] = $agent_id;
4006
+ }
4007
+ return $data_array;
4008
+
4009
+ }
4010
+ }
4011
+
4012
+
4013
+
4014
+
4015
+
4016
+ /**
4017
+ * Control the content below the visitor count
4018
+ * @return void
4019
+ */
4020
+ if (!function_exists("wplc_ma_filter_control_chat_dashboard_visitors_online_bottom")) {
4021
+ add_action("wplc_filter_chat_dahsboard_visitors_online_bottom","wplc_ma_filter_control_chat_dashboard_visitors_online_bottom",11);
4022
+ function wplc_ma_filter_control_chat_dashboard_visitors_online_bottom($text) {
4023
+ $text = "<hr />";
4024
+ $text .= " <p class='wplc-agent-info2' id='wplc-agent-info'>";
4025
+ $text .= " <span class='wplc_agents_online'>".wplc_maa_total_agents_online()."</span>";
4026
+ $text .= " <a href='?page=wplivechat-menu-settings#tabs-5' target='_BLANK'>".__("Agent(s) online","wplivechat")."</a>";
4027
+ $text .= " </p>";
4028
+ return $text;
4029
+ }
4030
+ }
4031
+
4032
+ /**
4033
+ * Count how many agents are online
4034
+ * @return int number of agents
4035
+ */
4036
+ if (!function_exists("wplc_maa_total_agents_online")) {
4037
+
4038
+ function wplc_maa_total_agents_online(){
4039
+ $choose_array = get_option("WPLC_CHOOSE_ACCEPTING");
4040
+ $count_agents = 0;
4041
+ if($choose_array){
4042
+ foreach($choose_array as $ch){
4043
+ if($ch == true){
4044
+ $count_agents++;
4045
+ }
4046
+ }
4047
+ }
4048
+ return $count_agents;
4049
+ }
4050
+ }
4051
+
4052
+
4053
+ if (!function_exists("wplc_maa_online_agents")) {
4054
+
4055
+ add_action('admin_bar_menu', 'wplc_maa_online_agents', 100);
4056
+ function wplc_maa_online_agents(){
4057
+
4058
+ if( !current_user_can( 'wplc_ma_agent', array(null) ) ){
4059
+ return; //if user doesn't have permissions for chat agent, do not show admin bar.
4060
+ }
4061
+ ?>
4062
+ <style >
4063
+ .wplc_circle{
4064
+ width: 10px !important;
4065
+ height: 10px !important;
4066
+ display: inline-block !important;
4067
+ border-radius: 100% !important;
4068
+ margin-right: 5px !important;
4069
+ }
4070
+ .wplc_red_circle{
4071
+ background: red;
4072
+ }
4073
+ .wplc_green_circle{
4074
+ background:rgb(103, 213, 82);
4075
+ }
4076
+ </style>
4077
+ <?php
4078
+ if(wplc_maa_is_agent_online()){
4079
+ $online_now = wplc_maa_total_agents_online();
4080
+ $circle_class = "wplc_green_circle";
4081
+ if($online_now == 1){
4082
+ $chat_agents = __('Chat Agent Online', 'wplivechat');
4083
+ } else {
4084
+ $chat_agents = __('Chat Agents Online', 'wplivechat');
4085
+ }
4086
+ } else {
4087
+ $online_now = 0;
4088
+ $circle_class = "wplc_red_circle";
4089
+ $chat_agents = __('Chat Agents Online', 'wplivechat');
4090
+ }
4091
+
4092
+ global $wp_admin_bar;
4093
+ $wp_admin_bar->add_menu( array(
4094
+ 'id' => 'wplc_ma_online_agents',
4095
+ '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,
4096
+ 'href' => false
4097
+ ) );
4098
+ $choose_array = get_option("WPLC_CHOOSE_ACCEPTING");
4099
+ if($online_now > 0){
4100
+ $user_array = get_users(array(
4101
+ 'meta_key'=> 'wplc_chat_agent_online',
4102
+ ));
4103
+ foreach($user_array as $user){
4104
+ $online = get_user_meta($user->ID, 'wplc_chat_agent_online' );
4105
+
4106
+ foreach($choose_array as $key => $val ){
4107
+ if( $key == $user->ID && $val == true ){
4108
+ $wp_admin_bar->add_menu( array(
4109
+ 'id' => 'wplc_user_online_'.$user->ID,
4110
+ 'parent' => 'wplc_ma_online_agents',
4111
+ 'title' => $user->display_name,
4112
+ 'href' => false,
4113
+ ) );
4114
+
4115
+ }
4116
+ }
4117
+
4118
+ }
4119
+ }
4120
+ }
4121
+ }
4122
+
4123
+
4124
+
4125
+
4126
+
4127
+ /**
4128
+ * Logs the agent out
4129
+ * @return void
4130
+ * @since 1.0.00
4131
+ * @author Nick Duncan <nick@wp-livechat.com>
4132
+ */
4133
+
4134
+ if (!function_exists("wplc_maa_remove_agents_online")) {
4135
+ function wplc_maa_remove_agents_online($user_id){
4136
+ delete_user_meta($user_id, "wplc_chat_agent_online");
4137
+ }
4138
+ }
4139
+
4140
+
4141
+ /**
4142
+ * Transient renewer to refresh the agent's online status
4143
+ * @return void
4144
+ */
4145
+ if (!function_exists("wplc_maa_hook_control_head")) {
4146
+ add_action("admin_enqueue_scripts","wplc_maa_hook_control_head",10);
4147
+ function wplc_maa_hook_control_head() {
4148
+ if (isset($_GET['page']) && $_GET['page'] == "wplivechat-menu" && (!isset($_GET['action']))) {
4149
+ global $wplc_multiple_agents_version;
4150
+ @wp_register_script("wplc-ma-transient-js", plugins_url('js/wplc_ma_transient.js', __FILE__), true,$wplc_multiple_agents_version);
4151
+ @wp_enqueue_script('wplc-ma-transient-js');
4152
+ }
4153
+ }
4154
+ }
4155
+
4156
+
4157
+ /**
4158
+ * Check if an agent is logged into the wp-admin section
4159
+ * @param bool $logged_in
4160
+ * @return array
4161
+ * @since 1.0.00
4162
+ * @author Nick Duncan <nick@wp-livechat.com>
4163
+ */
4164
+ if (!function_exists("wplc_maa_filter_control_check_if_logged_in")) {
4165
+ add_filter("wplc_filter_is_admin_logged_in","wplc_maa_filter_control_check_if_logged_in",10,1);
4166
+ function wplc_maa_filter_control_check_if_logged_in($logged_in) {
4167
+ $logged_in['site'] = wplc_maa_is_agent_online();
4168
+ return $logged_in;
4169
+ }
4170
+ }
4171
+
4172
+
4173
+ /**
4174
+ * Logs the agent out
4175
+ * @return void
4176
+ * @since 1.0.00
4177
+ * @author Nick Duncan <nick@wp-livechat.com>
4178
+ */
4179
+ if (!function_exists("wplc_maa_agent_logout")) {
4180
+ add_action('wp_logout', 'wplc_maa_agent_logout');
4181
+ function wplc_maa_agent_logout(){
4182
+ $user_id = get_current_user_id();
4183
+ delete_user_meta($user_id, "wplc_chat_agent_online");
4184
+ }
4185
+ }
4186
+
4187
+ /**
4188
+ * Is the agent online?
4189
+ * @return bool
4190
+ * @since 1.0.00
4191
+ * @author Nick Duncan <nick@wp-livechat.com>
4192
+ */
4193
+
4194
+ if (!function_exists("wplc_maa_is_agent_online")) {
4195
+ function wplc_maa_is_agent_online(){
4196
+
4197
+ $wplc_online = 0;
4198
+ $choose_array = get_option("WPLC_CHOOSE_ACCEPTING");
4199
+
4200
+ if( $choose_array ){
4201
+ foreach($choose_array as $choose ){
4202
+ if($choose === TRUE){
4203
+ $wplc_online++;
4204
+ }
4205
+ }
4206
+ }
4207
+
4208
+ if($wplc_online > 0){
4209
+ return true;
4210
+ } else {
4211
+ return false;
4212
+ }
4213
+
4214
+ }
4215
+ }
4216
+
4217
+
4218
+
4219
+ /**
4220
+ * Add the JS file to the admin screen
4221
+ * @return void
4222
+ * @since 1.0.00
4223
+ * @author Nick Duncan <nick@wp-livechat.com>
4224
+ */
4225
+ if (!function_exists("wplc_control_admin_javascript")) {
4226
+ function wplc_control_admin_javascript() {
4227
+ global $wplc_multiple_agents_version;
4228
+ wp_register_script("wplc-ma-js", plugins_url('js/wplc_ma.js', __FILE__), false,$wplc_multiple_agents_version);
4229
+ wp_enqueue_script('wplc-ma-js');
4230
+
4231
+ $ajax_url = admin_url('admin-ajax.php');
4232
+ $wplc_ajax_url = apply_filters("wplc_filter_ajax_url",$ajax_url);
4233
+ wp_localize_script('wplc-ma-js', 'wplc_ajaxurl', $wplc_ajax_url);
4234
+
4235
+ $wpc_ma_js_strings = array(
4236
+ 'remove_agent' => __('Remove', 'wplivechat'),
4237
+ 'nonce' => wp_create_nonce("wplc"),
4238
+ 'user_id' => get_current_user_id(),
4239
+ 'typing_string' => __('Typing...', 'wplivechat')
4240
+ );
4241
+ wp_localize_script('wplc-ma-js', 'wplc_admin_strings', $wpc_ma_js_strings);
4242
+ wp_localize_script('wplc-ma-js', 'wplc_is_pro', '1');
4243
+
4244
+ }
4245
+ do_action("wplc_maa_hook_head");
4246
+ }
4247
+
4248
+ if (!function_exists("wplc_ma_hook_control_action_callback")) {
4249
+ add_action("wplc_hook_set_transient","wplc_ma_hook_control_set_transient",9);
4250
+ function wplc_ma_hook_control_set_transient() {
4251
+ $should_set_transient = apply_filters("wplc_filter_control_set_transient",true);
4252
+ if ($should_set_transient) {
4253
+ if (isset($_POST['user_id'])) { $user_id = $_POST['user_id']; } else { $user_id = get_current_user_id(); }
4254
+ wplc_maa_set_agents_online($user_id);
4255
+ }
4256
+ remove_action("wplc_hook_set_transient","wplc_hook_control_set_transient");
4257
+
4258
+ }
4259
+ }
4260
+
4261
+
4262
+ if (!function_exists("wplc_ma_hook_control_remove_transient")) {
4263
+ add_action("wplc_hook_remove_transient","wplc_ma_hook_control_remove_transient",9);
4264
+ function wplc_ma_hook_control_remove_transient() {
4265
+ wplc_maa_remove_agents_online($_POST['user_id']);
4266
+ remove_action("wplc_hook_remove_transient","wplc_hook_control_remove_transient");
4267
+ }
4268
+ }
4269
+
4270
+ /**
4271
+ * AJAX callback control
4272
+ * @return void
4273
+ * @since 1.0.00
4274
+ * @author Nick Duncan <nick@wp-livechat.com>
4275
+ */
4276
+ if (!function_exists("wplc_ma_hook_control_action_callback")) {
4277
+ add_action("wplc_hook_action_callback","wplc_ma_hook_control_action_callback");
4278
+ function wplc_ma_hook_control_action_callback() {
4279
+
4280
+ if ($_POST['action'] == "wplc_add_agent") {
4281
+ if (current_user_can("manage_options")) {
4282
+ $uid = sanitize_text_field(intval($_POST['uid']));
4283
+ if (isset($uid)) {
4284
+ update_user_meta($uid, 'wplc_ma_agent', true);
4285
+ echo "1";
4286
+ } else {
4287
+ echo "0";
4288
+ }
4289
+ }
4290
+ }
4291
+ if ($_POST['action'] == "wplc_remove_agent") {
4292
+ if (current_user_can("manage_options")) {
4293
+ $uid = sanitize_text_field(intval($_POST['uid']));
4294
+ if (isset($uid)) {
4295
+ delete_user_meta($uid, 'wplc_ma_agent');
4296
+ echo "1";
4297
+ } else {
4298
+ echo "0";
4299
+ }
4300
+ }
4301
+ }
4302
+
4303
+ if ($_POST['action'] == "wplc_macro") {
4304
+ if (isset($_POST['postid'])) {
4305
+ $post_id = $_POST['postid'];
4306
+ } else {
4307
+ return false;
4308
+ }
4309
+
4310
+ if ($post_id > 0) {
4311
+ $post_details = get_post($post_id);
4312
+ if ($post_details) {
4313
+ echo json_encode(nl2br($post_details->post_content));
4314
+ } else {
4315
+ echo json_encode("No post with that ID");
4316
+ die();
4317
+ }
4318
+ } else {
4319
+ echo json_encode("No macro with that ID");
4320
+ die();
4321
+ }
4322
+ }
4323
+
4324
+ if( $_POST['action'] == 'wplc_record_chat_rating' ){
4325
+ $rating_id = sanitize_text_field($_POST['cid']);
4326
+ $rating_score = sanitize_text_field($_POST['rating']);
4327
+ $rating_comment = sanitize_text_field($_POST['comment']);
4328
+
4329
+ if( ! filter_var($rating_id, FILTER_VALIDATE_INT) ) {
4330
+ /* We need to identify if this CID is a node CID, and if so, return the WP CID */
4331
+ $rating_id = wplc_return_chat_id_by_rel($rating_id);
4332
+ }
4333
+
4334
+
4335
+ $nifty_record_rating = nifty_record_rating_mrg($rating_id, $rating_score, $rating_comment);
4336
+ if ($nifty_record_rating) {
4337
+ echo 'rating added';
4338
+ wp_die();
4339
+ } else {
4340
+ echo "There was an error sending your chat message. Please contact support";
4341
+ wp_die();
4342
+ }
4343
+
4344
+ }
4345
+
4346
+ }
4347
+ }
4348
+
4349
+ /**
4350
+ * Mark the agent as "online"
4351
+ * @return void
4352
+ * @since 1.0.00
4353
+ * @author Nick Duncan <nick@wp-livechat.com>
4354
+ */
4355
+
4356
+ if (!function_exists("wplc_maa_set_agents_online")) {
4357
+ function wplc_maa_set_agents_online($user_id){
4358
+
4359
+ if (esc_attr( get_the_author_meta( 'wplc_ma_agent', $user_id ) ) == "1"){
4360
+
4361
+ update_user_meta($user_id, "wplc_chat_agent_online", time());
4362
+ }
4363
+ $users = get_users(array(
4364
+ 'meta_key'=> 'wplc_chat_agent_online',
4365
+ ));
4366
+ foreach($users as $user){
4367
+ $time = get_user_meta($user->ID, "wplc_chat_agent_online", true);
4368
+ $diff = time() - $time;
4369
+ if($diff > 125){
4370
+ delete_user_meta($user->ID, "wplc_chat_agent_online");
4371
+ }
4372
+ }
4373
+ }
4374
+ }
4375
+
4376
+
4377
+ /* WPLC Social Icons Filter*/
4378
+ add_filter("wplc_filter_chat_header_above","wplc_chat_social_div_mrg",5,2);
4379
+ add_filter("wplc_filter_chat_4th_layer_below_input","wplc_chat_social_div_mrg",5,2);
4380
+ function wplc_chat_social_div_mrg($msg, $wplc_setting){
4381
+ $acbc_settings = get_option("WPLC_ACBC_SETTINGS");
4382
+ $current_theme = isset($wplc_setting['wplc_newtheme']) ? $wplc_setting['wplc_newtheme'] : "";
4383
+
4384
+ $top_offset = "";
4385
+
4386
+ $wplc_settings = get_option("WPLC_SETTINGS");
4387
+ if($wplc_settings["wplc_ux_exp_rating"] === "0" && $current_theme === "theme-2"){
4388
+ $top_offset = "bottom:-4px !important;";
4389
+ }
4390
+
4391
+ $msg .= "<div id='wplc_social_holder' ".($current_theme === "theme-2" ? "class='wplc_modern'" : "" )." style='display:none; $top_offset' >";
4392
+ if(isset($acbc_settings['wplc_social_fb']) && $acbc_settings['wplc_social_fb'] != ""){
4393
+ $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>";
4394
+ }
4395
+ if(isset($acbc_settings['wplc_social_tw']) && $acbc_settings['wplc_social_tw'] != ""){
4396
+ $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>";
4397
+ }
4398
+ $msg .= "</div>";
4399
+ return $msg;
4400
+ }
4401
+
4402
+ /*Text Editor*/
4403
+ add_filter("wplc_filter_chat_text_editor","nifty_text_edit_div_mrg",1,1);
4404
+ function nifty_text_edit_div_mrg($msg){
4405
+ $wplc_settings = get_option("WPLC_SETTINGS");
4406
+ if($wplc_settings["wplc_ux_editor"] !== "0"){
4407
+ $msg .= "<div id='nifty_text_editor_holder'>";
4408
+ $msg .= "<i class='nifty_tedit_icon fa fa-bold' id='nifty_tedit_b'></i>";
4409
+ $msg .= "<i class='nifty_tedit_icon fa fa-italic' id='nifty_tedit_i'></i>";
4410
+ $msg .= "<i class='nifty_tedit_icon fa fa-underline' id='nifty_tedit_u'></i>";
4411
+ $msg .= "<i class='nifty_tedit_icon fa fa-strikethrough' id='nifty_tedit_strike'></i>";
4412
+ $msg .= "<i class='nifty_tedit_icon fa fa-square' id='nifty_tedit_mark'></i>";
4413
+ $msg .= "<i class='nifty_tedit_icon fa fa-subscript' id='nifty_tedit_sub'></i>";
4414
+ $msg .= "<i class='nifty_tedit_icon fa fa-superscript' id='nifty_tedit_sup'></i>";
4415
+ $msg .= "<i class='nifty_tedit_icon fa fa-link' id='nifty_tedit_link'></i>";
4416
+ $msg .= "</div>";
4417
+ }
4418
+ return $msg;
4419
+ }
4420
+
4421
+ /*Upload Div*/
4422
+ add_filter("wplc_filter_chat_upload","nifty_file_upload_div_mrg",1,1);
4423
+ function nifty_file_upload_div_mrg($msg){
4424
+ $wplc_settings = get_option("WPLC_SETTINGS");
4425
+ if($wplc_settings["wplc_ux_file_share"] !== "0"){
4426
+ $editor_enabled = $wplc_settings["wplc_ux_exp_rating"] == "0" ? "bottom: 35px !important;" : "";
4427
+ $msg .= "<div id='nifty_file_holder'>";
4428
+ $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>";
4429
+ $msg .= "<i class='nifty_attach_icon fa fa-circle-o-notch fa-spin' id='nifty_attach_uploading_icon' style='display:none; $editor_enabled' ></i>";
4430
+ $msg .= "<i class='nifty_attach_icon fa fa-check-circle' id='nifty_attach_success_icon' style='display:none; $editor_enabled' ></i>";
4431
+ $msg .= "<i class='nifty_attach_icon fa fa-minus-circle' id='nifty_attach_fail_icon' style='display:none; $editor_enabled'></i>";
4432
+ $msg .= "<input type='file' id='nifty_file_input' name='nifty_file_input' style='display:none'>";
4433
+ $msg .= "</div>";
4434
+ }
4435
+ return $msg;
4436
+ }
4437
+
4438
+ add_filter("wplc_filter_chat_header_above","nifty_chat_ratings_div_mrg",1,2);
4439
+ add_filter("wplc_filter_chat_4th_layer_below_input","nifty_chat_ratings_div_mrg",1,2);
4440
+ function nifty_chat_ratings_div_mrg($msg, $wplc_setting){
4441
+ $wplc_settings = get_option("WPLC_SETTINGS");
4442
+ if($wplc_settings["wplc_ux_exp_rating"] !== "0"){
4443
+ $msg .= "<div id='nifty_ratings_holder' style='display:none;'>";
4444
+ $msg .= "<i class='nifty_rating_icon fa fa-thumbs-o-up' id='nifty_rating_pos' ></i>";
4445
+ $msg .= "";
4446
+ $msg .= "<i class='nifty_rating_icon fa fa-thumbs-o-down' id='nifty_rating_neg' ></i>";
4447
+ $msg .= "<div id='nifty_ratings_form' style='display:none;' class='wplc-color-bg-1 wplc-color-1 wplc-color-border-1'>";
4448
+ $msg .= "<input type='text' id='nifty_ratings_comment' placeholder='Comments...'>";
4449
+ $msg .= "<button nifty-rating='' id='nifty_rating_button' class='wplc-color-bg-2 wplc-color-1'>Rate</button>";
4450
+ $msg .= "</div>";
4451
+ $msg .= "<i class='fa fa-spinner fa-spin' id='nifty_recording' style='display:none;'></i>";
4452
+ $msg .= "<div id='nifty_rating_thanks' style='display:none;'>";
4453
+ $msg .= "<p>Rating Recorded...</p>";
4454
+ $msg .= "</div>";
4455
+ $msg .= "</div>";
4456
+ }
4457
+ return $msg;
4458
+
4459
+ }
4460
+
4461
+ /*Handles adding a rating*/
4462
+ function nifty_record_rating_mrg($cid, $rating, $comment){
4463
+ global $wpdb;
4464
+ global $wplc_tblname_chat_ratings;
4465
+
4466
+ //Cleanup here
4467
+ $cid = intval($cid);
4468
+ $rating = intval($rating);
4469
+ $comment = esc_attr($comment);
4470
+
4471
+ if(nifty_chat_has_rating_mrg($cid)){ //Update
4472
+ $sql = "UPDATE $wplc_tblname_chat_ratings SET `aid` = '".wplc_get_chat_data($cid)->agent_id."', `rating` = '".$rating."', `comment` = '".$comment."', `timestamp` = '".date("Y-m-d H:i:s")."', `notified` = 0 WHERE `cid` = '$cid' LIMIT 1";
4473
+ $wpdb->query($sql);
4474
+ if ($wpdb->last_error) {
4475
+ return false;
4476
+ } else {
4477
+ return true;
4478
+ }
4479
+ }else{ //Insert
4480
+ $sql = "INSERT INTO $wplc_tblname_chat_ratings SET `cid` = '".$cid."', `aid` = '".wplc_get_chat_data($cid)->agent_id."', `rating` = '".$rating."', `comment` = '".$comment."', `timestamp` = '".date("Y-m-d H:i:s")."', `notified` = 0";
4481
+ $wpdb->query($sql);
4482
+ if ($wpdb->last_error) {
4483
+ return false;
4484
+ } else {
4485
+ return true;
4486
+ }
4487
+ }
4488
+ }
4489
+
4490
+ function nifty_chat_has_rating_mrg($cid){
4491
+ global $wpdb;
4492
+ global $wplc_tblname_chat_ratings;
4493
+ $sql ="SELECT `id` FROM $wplc_tblname_chat_ratings WHERE `cid` = '$cid'";
4494
+ $wpdb->query($sql);
4495
+ if($wpdb->num_rows){
4496
+ return true;
4497
+ } else {
4498
+ return false;
4499
+ }
4500
+ }
4501
+
4502
+ function nifty_get_rating_data_mrg($cid,$force = false){
4503
+ global $wpdb;
4504
+ global $wplc_tblname_chat_ratings;
4505
+ if ($force) {
4506
+ $results = $wpdb->get_results("SELECT * FROM $wplc_tblname_chat_ratings WHERE `cid` = '$cid' LIMIT 1");
4507
+ } else {
4508
+ $results = $wpdb->get_results("SELECT * FROM $wplc_tblname_chat_ratings WHERE `cid` = '$cid' AND `notified` = 0 LIMIT 1");
4509
+ }
4510
+ if ($wpdb->num_rows) {
4511
+
4512
+ foreach ($results as $result) {
4513
+ $id = $result->id;
4514
+ $wpdb->Query("UPDATE $wplc_tblname_chat_ratings SET `notified` = 1 WHERE `id` = ".$id." LIMIT 1");
4515
+ return array("rating" => $result->rating, "comment" => $result->comment);
4516
+ }
4517
+ }else{
4518
+ return false;
4519
+ }
4520
+ }
4521
+
4522
+ add_filter("wplc_filter_advanced_info","nifty_rating_advanced_info_control_mrg",1,4);
4523
+ function nifty_rating_advanced_info_control_mrg($msg, $cid, $name, $chat_data){
4524
+ $rating = apply_filters("wplc_rating_data_filter","",$cid,$name);
4525
+ if ($rating) {
4526
+
4527
+ $msg .= "<div class='admin_visitor_advanced_info admin_agent_rating'>
4528
+ <strong>" . __("Experience Rating", "wplivechat") . "</strong>
4529
+ <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>
4530
+ <hr />
4531
+ <div class='rating-comment'><div id='rating-comment-holder'>\"".(isset($rating['comment']) && $rating['comment'] != "undefined" ? $rating['comment'] : "No Comment...")."\"</div> - ".$name."</div>
4532
+ </div>";
4533
+ } else{
4534
+ //No Rating Provided
4535
+ $msg .= "<div class='admin_visitor_advanced_info admin_agent_rating'>
4536
+ <strong>" . __("Experience Rating", "wplivechat") . "</strong>
4537
+ <div class='rating'>No Rating</div>
4538
+ <hr />
4539
+ <div class='rating-comment'><div id='rating-comment-holder'>\"No Comment...\"</div> - ".$name."</div>
4540
+ </div>";
4541
+ }
4542
+ return $msg;
4543
+ }
4544
+
4545
+
4546
+ add_filter("wplc_rating_data_filter","wplc_filter_control_get_rating_data_mrg",10,3);
4547
+ function wplc_filter_control_get_rating_data_mrg($msg,$cid,$name) {
4548
+ return nifty_get_rating_data_mrg($cid, true);
4549
+ }
4550
+ /* Gets an agents percentage based on filter
4551
+ * Filters:
4552
+ * 0 - All
4553
+ * 1 - 7 Days
4554
+ * 2 - 14 Days
4555
+ * 3 - 30 Days
4556
+ * 4 - 60 Days
4557
+ * 5 - 90 Days
4558
+ */
4559
+ function nifty_get_rating_report_mrg($uid, $filter = 0){
4560
+ //Some snazzy code here
4561
+ global $wpdb;
4562
+ global $wplc_tblname_chat_ratings;
4563
+
4564
+ $sql = "SELECT * FROM $wplc_tblname_chat_ratings WHERE `aid` = '$uid'";
4565
+ if($filter == 1){
4566
+ $sql = "SELECT * FROM $wplc_tblname_chat_ratings WHERE `aid` = '$uid' AND `timestamp` > DATE_SUB(NOW(), INTERVAL 7 DAY)";
4567
+ }else if($filter == 2){
4568
+ $sql = "SELECT * FROM $wplc_tblname_chat_ratings WHERE `aid` = '$uid' AND `timestamp` > DATE_SUB(NOW(), INTERVAL 14 DAY)";
4569
+ }else if($filter == 3){
4570
+ $sql = "SELECT * FROM $wplc_tblname_chat_ratings WHERE `aid` = '$uid' AND `timestamp` > DATE_SUB(NOW(), INTERVAL 30 DAY)";
4571
+ }else if($filter == 4){
4572
+ $sql = "SELECT * FROM $wplc_tblname_chat_ratings WHERE `aid` = '$uid' AND `timestamp` > DATE_SUB(NOW(), INTERVAL 60 DAY)";
4573
+ }else if($filter == 5){
4574
+ $sql = "SELECT * FROM $wplc_tblname_chat_ratings WHERE `aid` = '$uid' AND `timestamp` > DATE_SUB(NOW(), INTERVAL 90 DAY)";
4575
+ }
4576
+
4577
+ $sql .= " ORDER BY `cid` DESC"; //Sort
4578
+
4579
+ $total = 0;
4580
+ $pos = 0;
4581
+ $neg = 0;
4582
+
4583
+ $data_array = array();
4584
+
4585
+ $results = $wpdb->get_results($sql);
4586
+ if($wpdb->num_rows){
4587
+ foreach ($results as $res) {
4588
+ $data_array[$uid][$res->cid] = array("rating" => $res->rating,
4589
+ "comment" => $res->comment,
4590
+ "time" => $res->timestamp);
4591
+ if($res->rating == "1"){
4592
+ $pos ++; //Count
4593
+ }else if($res->rating == "0"){
4594
+ $neg ++; //Count
4595
+ }
4596
+ $total ++;
4597
+ }
4598
+
4599
+ $total = $total > 0 ? $total : 1; //Cannot devide by 0
4600
+ $perc = intval(($pos * 100) / $total);
4601
+
4602
+ $data_array["percentage"] = $perc;
4603
+ $data_array["total_ratings"] = $total;
4604
+ $data_array["bad_count"] = $neg;
4605
+ $data_array["good_count"] = $pos;
4606
+
4607
+ return $data_array;
4608
+ } else {
4609
+ return false;
4610
+ }
4611
+
4612
+ }
4613
+
4614
+ add_filter('wplc_reporting_tabs', 'wplc_reporting_tabs_filter_experience_ratings_control_mrg', 10, 1);
4615
+ function wplc_reporting_tabs_filter_experience_ratings_control_mrg($tabs_array){
4616
+ $tabs_array['ux_ratings'] = __("User Experience Ratings", "wplivechat");
4617
+ return $tabs_array;
4618
+ }
4619
+
4620
+
4621
+ add_filter('wplc_reporting_tab_content', 'wplc_reporting_tab_content_filter_experience_ratings_control_mrg', 10, 1);
4622
+ function wplc_reporting_tab_content_filter_experience_ratings_control_mrg($tabs_array){
4623
+ $ratings = "<h3>".__("Agent Statistics", "wplivechat")."</h3>";
4624
+
4625
+ $user_array = get_users(array(
4626
+ 'meta_key' => 'wplc_ma_agent',
4627
+ ));
4628
+
4629
+ $ratings .= "<style>";
4630
+ $ratings .= ".wplc_agent_grav_report { display:inline-block; }";
4631
+ $ratings .= ".wplc_agent_card_details { display:inline-block; margin-left: 5px;}";
4632
+ $ratings .= ".wplc_agent_card { width:100%; }";
4633
+ $ratings .= ".wplc_agent_container {
4634
+ width: 30%;
4635
+ border: 1px solid lightgray;
4636
+ padding: 5px;
4637
+ border-radius: 2px;
4638
+ box-shadow: 1px 1px 2px 0px #999;
4639
+ -webkit-box-shadow: 1px 1px 2px 0px #999;
4640
+ -moz-box-shadow: 1px 1px 2px 0px #999;
4641
+ -o-box-shadow: 1px 1px 2px 0px #999;
4642
+ display: inline-block;
4643
+ margin-right: 5px;
4644
+ vertical-align: top;
4645
+
4646
+ }";
4647
+ $ratings .= ".wplc_agent_data {
4648
+ max-height: 200px;
4649
+ overflow-y: auto;
4650
+ padding: 5px;
4651
+ border: 1px lightgrey solid;
4652
+ }";
4653
+ $ratings .= "</style>";
4654
+
4655
+
4656
+
4657
+ if ($user_array) {
4658
+ foreach ($user_array as $user) {
4659
+ $ratings .= "<div class='wplc_agent_container'>";
4660
+
4661
+ $rating_stats = nifty_get_rating_report_mrg($user->ID);
4662
+
4663
+ $ratings .= "<div class='wplc_agent_card'>";
4664
+ $ratings .= "<img class='wplc_agent_grav_report' src=\"//www.gravatar.com/avatar/" . md5($user->user_email) . "?s=80&d=mm\" />";
4665
+ $ratings .= "<div class='wplc_agent_card_details'>";
4666
+ $ratings .= "<strong>" . $user->display_name . "</strong><br>";
4667
+ $ratings .= "<small>" . $user->user_email . "</small><br>";
4668
+ $ratings .= "<hr>";
4669
+ $ratings .= "<small><strong>".__("Satisfaction Rating", "wplivechat").":</strong> " . (is_bool($rating_stats) && $rating_stats == false ? "--" : $rating_stats['percentage'] ). "%</small><br>";
4670
+ $ratings .= "<small><strong>".__("Rating Count", "wplivechat").":</strong> " . (is_bool($rating_stats) && $rating_stats == false ? "0" : $rating_stats['total_ratings'])." (".__("Good","wplivechat").": ".(is_bool($rating_stats) && $rating_stats == false ? "0" : $rating_stats['good_count']). " || ".__("Bad","wplivechat").": ".(is_bool($rating_stats) && $rating_stats == false ? "0" : $rating_stats['bad_count']). ")</small>";
4671
+ $ratings .= "</div>";
4672
+ $ratings .= "</div>";
4673
+
4674
+ $ratings .= "<div class='wplc_agent_data'>";
4675
+
4676
+ if(is_bool($rating_stats) && $rating_stats == false){
4677
+ $ratings .= "<div style='width:90%;display: inline-block; min-height: 30px;'>";
4678
+ $ratings .= "<i>".__("No Ratings for this agent", "wplivechat")."</i>";
4679
+ $ratings .= "</div>";
4680
+ }else{
4681
+ $ratings_for_agent = $rating_stats[$user->ID];
4682
+ foreach ($ratings_for_agent as $cid => $rate) {
4683
+ $ratings .= "<div style='width:90%;display: inline-block; min-height: 30px;'>";
4684
+ $ratings .= $cid . " - <strong style='".(intval($rate['rating']) == 1 ? "color:#439134;": "color:#ac1d1d;")."'>".(intval($rate['rating']) == 1 ? __("Good", "wplivechat") : __("Bad", "wplivechat") )."</strong>";
4685
+ $ratings .= " - <i style='width:auto;'>\"" . $rate['comment'] . "\"</i>";
4686
+ $ratings .= "</div>";
4687
+ $ratings .= " <a style='float:right' class='button' href='?page=wplivechat-menu&action=history&cid=".$cid."' target='_blank'>" . __("View", "wplivechat") . "</a>";
4688
+
4689
+ }
4690
+ }
4691
+
4692
+ $ratings .= "</div>";
4693
+ $ratings .= "</div>";
4694
+ }
4695
+ }
4696
+
4697
+
4698
+ $tabs_array['ux_ratings'] = $ratings;
4699
+ return $tabs_array;
4700
+ }
4701
+
4702
+ add_action('admin_enqueue_scripts', 'wplc_reporting_scripts_mrg');
4703
+ function wplc_reporting_scripts_mrg(){
4704
+ if( isset( $_GET['page'] ) && $_GET['page'] == 'wplivechat-menu-reporting' ){
4705
+ $statistics = json_encode( return_statistics_mrg() );
4706
+ wp_register_script('wplc-google-charts', '//www.gstatic.com/charts/loader.js', array('jquery'));
4707
+ wp_enqueue_script('wplc-google-charts');
4708
+
4709
+ wp_register_style('wplc-ui-style-stats', '//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css');
4710
+ wp_enqueue_style('wplc-ui-style-stats');
4711
+ wp_register_script('wplc-statistics', plugins_url('/js/reporting.js', __FILE__), array('jquery', 'jquery-ui-core', 'jquery-ui-tabs'));
4712
+ if (empty($statistics)) { $statistics = ''; }
4713
+ wp_localize_script('wplc-statistics', 'wplc_reporting_statistics', $statistics);
4714
+ wp_enqueue_script('wplc-statistics');
4715
+ }
4716
+ }
4717
+ function wplc_reporting_page(){
4718
+ $stats = return_statistics_mrg();
4719
+ $tabs = "";
4720
+ $styling_reporting = ".ui-tabs-vertical { }
4721
+ .ui-tabs-vertical .ui-tabs-nav { padding: .2em .1em .2em .2em; float: left; max-width: 20%; min-width: 190px; }
4722
+ .ui-tabs-vertical .ui-tabs-nav li { clear: left; width: 100%;border:none; margin: 0 -1px .2em 0; }
4723
+ .ui-tabs-vertical .ui-tabs-nav li a { display:block; }
4724
+ .ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active { padding-bottom: 0; padding-right: .1em; border-right-width: 1px; }
4725
+ .ui-tabs-vertical .ui-tabs-panel { float: left; min-width: 67%; max-width: 67%;}
4726
+ textarea, input[type='text'], input[type='email'], input[type='password']{ width: 100% !important; }
4727
+ .ui-tabs-anchor { width: 80%; }
4728
+ .ui-widget-header { border: none; background: none; }
4729
+ .ui-tabs-anchor:focus { box-shadow: none !important; }";
4730
+
4731
+ $tabs .= "<style>" . $styling_reporting . "</style>";
4732
+
4733
+ $tabs .= "<div clas='wrap'><h2>".__('WP Live Chat Support Reporting', 'wp-livechat')."</h2><div id='reporting_tabs'>";
4734
+ $tabs .= "<ul>";
4735
+ $tab = array(
4736
+ 'overview' => __('Overview', 'wp-livechat'),
4737
+ 'popular_pages' => __('Popular Pages', 'wp-livechat')
4738
+ );
4739
+ $tab = apply_filters('wplc_reporting_tabs', $tab);
4740
+
4741
+ foreach( $tab as $key => $val ){
4742
+ $tabs .= "<li><a href='#$key'>$val</a></li>";
4743
+ }
4744
+ $tabs .= "</ul>";
4745
+
4746
+ if( isset( $stats['individual_urls_counted'] ) ){
4747
+ $popular_pages_list = "<ul>";
4748
+ $urls = $stats['individual_urls_counted'];
4749
+ foreach( $urls as $key => $val ){
4750
+ $popular_pages_list .= "<li>$key ($val)</li>";
4751
+ }
4752
+ $popular_pages_list .= "</ul>";
4753
+ }
4754
+ $overview = "";
4755
+ $overview .= "<div style='width: 33%; display: inline-block; vertical-align: top; text-align: center;'><h2>".__('Total Agents', 'wp-livechat')."</h2><p>".$stats['total_agents_counted']."</p><small>".__('Total number of agents that used the live chat', 'wp-livechat')."</small></div>";
4756
+ $overview .= "<div style='width: 33%; display: inline-block; vertical-align: top; text-align: center;'><h2>".__('Total Chats', 'wp-livechat')."</h2><p>".$stats['total_chats']."</p><small>".__('Total number of chats received', 'wp-livechat')."</small></div>";
4757
+ $overview .= "<div style='width: 33%; display: inline-block; vertical-align: top; text-align: center;'><h2>".__('Total URLs', 'wp-livechat')."</h2><p>".$stats['total_urls_counted']."</p><small>".__('Total number of URLs a chat was initiated on', 'wp-livechat')."</small></div>";
4758
+ $overview .= '<h2>'.__('Chats per day', 'wp-livechat').'</h2><div id="columnchart_material" style="width: 100%; height: 350px;"></div>';
4759
+ $popular_pages = "<h2>".__('Popular pages a chat was initiated on', 'wp-livechat')."</h2>";
4760
+ $popular_pages .= "<div style='width: 50%; display: inline-block; vertical-align: top;'><div id='popular_pages_graph' style='width: 100%; height: 300px;'></div></div>";
4761
+ $popular_pages .= "<div style='width: 50%; display: inline-block; vertical-align: top;'>$popular_pages_list</div>";
4762
+ $tab_content = array(
4763
+ 'overview' => $overview,
4764
+ 'popular_pages' => $popular_pages,
4765
+ );
4766
+ $tab_content = apply_filters('wplc_reporting_tab_content', $tab_content);
4767
+ foreach( $tab_content as $key => $val ){
4768
+ $tabs .= "<div id='$key'>$val</div>";
4769
+ }
4770
+ $tabs .= "</div></div>";
4771
+
4772
+ echo $tabs;
4773
+
4774
+ }
4775
+ function return_statistics_mrg(){
4776
+ global $wpdb;
4777
+ global $wplc_tblname_chats;
4778
+ $sql = "SELECT * FROM `$wplc_tblname_chats` WHERE `agent_id` <> 0 ORDER BY `timestamp` DESC LIMIT 90";
4779
+ $results = $wpdb->get_results( $sql );
4780
+ $popular_user_agent = array();
4781
+ $chats_on_days = array();
4782
+ $popular_url = array();
4783
+ $chat_durations = array();
4784
+ $popular_chat_agent = array();
4785
+ $agent_data = array();
4786
+ foreach( $results as $result ){
4787
+ $ip_data = maybe_unserialize( $result->ip );
4788
+ $popular_chat_agent[] = $result->agent_id;
4789
+ $popular_user_agent[] = isset($ip_data['user_agent']) ? $ip_data['user_agent'] : __("Unknown", "wplivechat");
4790
+ $chats_on_days[] = date('Y-m-d', strtotime( $result->timestamp ) );
4791
+ $popular_url[] = $result->url;
4792
+ }
4793
+ /* Agent Data */
4794
+
4795
+ $agent_totals = array_count_values($popular_chat_agent );
4796
+ arsort($agent_totals);
4797
+ $total_agent_count = count( $agent_totals );
4798
+ /* User Agent Data */
4799
+ $user_agent_totals = array_count_values( $popular_user_agent );
4800
+ arsort($user_agent_totals);
4801
+ $total_user_agent = count( $user_agent_totals );
4802
+ /* Daily Chat Totals */
4803
+ $daily_chat_totals = array_count_values( $chats_on_days );
4804
+ // arsort($daily_chat_totals);
4805
+ $total_chats = count( $daily_chat_totals );
4806
+ /* URL Data */
4807
+ $popular_urls = array_count_values( $popular_url );
4808
+ arsort($popular_urls);
4809
+ $total_urls = count( $popular_urls );
4810
+ if( $agent_totals ){
4811
+ foreach( $agent_totals as $key => $val ){
4812
+ $user = get_user_by( 'id', intval( $key ) );
4813
+ if( $user ){
4814
+ $display_name = $user->data->display_name;
4815
+ } else {
4816
+ $display_name = '';
4817
+ }
4818
+ $agent_data[intval($key)] = $display_name;
4819
+ }
4820
+ }
4821
+ return array(
4822
+ 'total_agents_counted' => $total_agent_count,
4823
+ 'individual_agents_count' => $agent_data,
4824
+ 'total_user_agents_counted' => $total_user_agent,
4825
+ 'individual_user_agent_count' => $user_agent_totals,
4826
+ 'daily_chat_totals' => $daily_chat_totals,
4827
+ 'total_chats' => $total_chats,
4828
+ 'total_urls_counted' => $total_urls,
4829
+ 'individual_urls_counted' => $popular_urls,
4830
+ 'other_data' => apply_filters('wplc_additional_statistic_data', '')
4831
+ );
4832
+ }
4833
+ function return_stats_strings_mrg(){
4834
+ return array(
4835
+ 'url' => __('URL', 'wp-livechat'),
4836
+ 'count' => __('Count', 'wp-livechat')
4837
+ );
4838
+ }
4839
+
4840
+ add_filter( 'wplc_filter_message_sound', 'wplc_mrg_filter_control_message_sound', 10, 1 );
4841
+ function wplc_mrg_filter_control_message_sound( $wplc_message_sound ) {
4842
+
4843
+ $wplc_settings = get_option( 'WPLC_SETTINGS' );
4844
+
4845
+ return ! empty( $wplc_settings['wplc_messagetone'] ) ? $wplc_settings['wplc_messagetone'] : $wplc_message_sound;
4846
+
4847
+ }
4848
+
4849
+ add_filter("wplc_filter_wav_file","wplc_filter_control_wav_file",10,1);
4850
+ function wplc_filter_control_wav_file($wplc_wav_file) {
4851
+ $wplc_settings = get_option("WPLC_SETTINGS");
4852
+ if (isset($wplc_settings['wplc_ringtone'])) { return $wplc_settings['wplc_ringtone']; }
4853
+ else { return $wplc_wav_file; }
4854
+
4855
+
4856
+ }
4857
+
4858
+ add_action("wplc_advanced_settings_settings","wplc_hook_control_advanced_settings_settings",10);
4859
+ function wplc_hook_control_advanced_settings_settings() {
4860
+ $wplc_settings = get_option("WPLC_SETTINGS");
4861
+ echo "<tr>";
4862
+ 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>";
4863
+ if (isset($wplc_settings['wplc_disable_initiate_chat']) && $wplc_settings['wplc_disable_initiate_chat'] == '1' ) { $is_checked = "checked"; } else { $is_checked = ""; }
4864
+
4865
+ echo " <td><input type='checkbox' name='wplc_disable_initiate_chat' value='1' ".$is_checked."/></td>";
4866
+ echo "</tr>";
4867
+ }
4868
+
4869
+
4870
+
4871
+
4872
+
4873
+
4874
+ function wplc_random_quote_mrg() {
4875
+ $rand = rand(0,7);
4876
+
4877
+ $array = array(
4878
+ 0 => "&ldquo;The true entrepreneur is a doer, not a dreamer.&rdquo; – Unknown",
4879
+ 1 => "&ldquo;Please think about your legacy, because you’re writing it every day.&rdquo; – Gary Vaynerchuck",
4880
+ 2 => "&ldquo;A man should never neglect his family for business.&rdquo; – Walt Disney",
4881
+ 3 => "&ldquo;Every accomplishment starts with a decision to try.&rdquo; – Unknown",
4882
+ 4 => "&ldquo;There’s no shortage of remarkable ideas, what’s missing is the will to execute them.&rdquo; – Seth Godin",
4883
+ 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",
4884
+ 6 => "&ldquo;One finds limits by pushing them.&rdquo; – Herbert Simon",
4885
+ 7 => "&ldquo;Wishes cost nothing unless you want them to come true&rdquo; - Steve Jobs",
4886
+ 8 => "&ldquo;Hire character. Train skill.&rdquo; – Peter Schutz",
4887
+ 9 => "&ldquo;A calm sea does not make a skilled sailor.&rdquo; – Unknown",
4888
+ 10 => "&ldquo;Leadership is doing what is right when no one is watching.&rdquo; – George Van Valkenburg",
4889
+ 11 => "&ldquo;Genius is one percent inspiration and ninety–nine percent perspiration.&rdquo; – Thomas A. Edison",
4890
+ 12 => "&ldquo;Are you a serial idea–starting person? The goal is to be an idea–shipping person.&rdquo; – Seth Godin",
4891
+ 13 => "&ldquo;To win without risk is to triumph without glory.&rdquo; – Pierre Corneille",
4892
+ 14 => "&ldquo;The golden rule for every business man is this: Put yourself in your customer’s place.&rdquo; – Orison Swett Marden"
4893
+
4894
+ );
4895
+ return $array[$rand];
4896
+ }
4897
+
4898
+ function wplc_enqueue_admin_styles_mrg(){
4899
+ wp_enqueue_style('wplc-admin-pro-styles', plugins_url('/css/wplc_styles_admin_pro.css', __FILE__));
4900
+ }
4901
+
4902
+ add_filter("wplc_filter_admin_from","wplc_filter_control_admin_from_mrg",10,3);
4903
+ function wplc_filter_control_admin_from_mrg($content, $cid, $chat_data = false) {
4904
+ $acbc_settings = get_option("WPLC_ACBC_SETTINGS");
4905
+
4906
+ if (!$chat_data) {
4907
+ $chat_data = wplc_get_chat_data($cid,__LINE__);
4908
+ }
4909
+ if (isset($chat_data->agent_id)) {
4910
+ if(isset($acbc_settings)){
4911
+ if(isset($acbc_settings['wplc_use_wp_name'])){
4912
+ if(intval($acbc_settings['wplc_use_wp_name']) == 1){
4913
+ $user_object = get_user_by("id", $chat_data->agent_id);
4914
+ if( is_object( $user_object ) ){
4915
+ $content = $user_object->data->display_name;
4916
+ }
4917
+ }
4918
+ }
4919
+ }
4920
+ }
4921
+ return $content;
4922
+ }
4923
+
4924
+ add_action("wplc_add_js_admin_chat_area", "wplc_add_js_admin_chat_area_control_mrg", 10, 2);
4925
+ function wplc_add_js_admin_chat_area_control_mrg($cid, $chat_data = false){
4926
+ $acbc_settings = get_option("WPLC_ACBC_SETTINGS");
4927
+ if (!$chat_data) { $chat_data = wplc_get_chat_data($cid,__LINE__); }
4928
+ if ($chat_data) {
4929
+ if(isset($acbc_settings)){
4930
+ if(isset($acbc_settings['wplc_use_wp_name']) && intval($acbc_settings['wplc_use_wp_name']) == 1){
4931
+
4932
+ $tuser = get_user_by('id', $chat_data->agent_id);
4933
+ if ($tuser) {
4934
+ $tname = $tuser->display_name;
4935
+ } else {
4936
+ $tname = stripslashes($acbc_settings['wplc_chat_name']);
4937
+ }
4938
+
4939
+ ?>
4940
+ <script>
4941
+ var wplc_name_override = "<?php echo $tname; ?>";
4942
+ </script>
4943
+ <?php
4944
+ } else if(isset($acbc_settings['wplc_chat_name'])){
4945
+ ?>
4946
+ <script>
4947
+ var wplc_name_override = "<?php echo stripslashes($acbc_settings['wplc_chat_name']) ?>";
4948
+ </script>
4949
+ <?php
4950
+ }
4951
+ }
4952
+ } else {
4953
+ exit("Error connecting to the cloud server. Please refresh this page");
4954
+ }
4955
+ }
4956
+
4957
+ register_activation_hook( __FILE__, 'wplc_auto_responder_activate_mrg' );
4958
+ function wplc_auto_responder_activate_mrg(){
4959
+
4960
+ $options = get_option( "WPLC_AUTO_RESPONDER_SETTINGS" );
4961
+
4962
+ if( !is_array( $options ) ){
4963
+
4964
+ $wplc_data['wplc_ar_from_name'] = get_bloginfo( 'name' );
4965
+ $wplc_data['wplc_ar_from_email'] = get_bloginfo( 'admin_email' );
4966
+ $wplc_data['wplc_ar_subject'] = __("Thank you for inquiry. We will get back to you shortly", "wplivechat" );
4967
+ $wplc_data['wplc_ar_body'] = "
4968
+ <p>Hi {wplc-user-name}</p>
4969
+ <p>Thank you for getting in touch with us.</p>
4970
+ <p>Your email has been received. We will get back to you shortly.</p>
4971
+ ";
4972
+
4973
+ update_option( "WPLC_AUTO_RESPONDER_SETTINGS", $wplc_data );
4974
+
4975
+ }
4976
+
4977
+ }
4978
+
4979
+ add_action("wplc_hook_offline_message", "wplc_offline_message_autoresponder_mrg");
4980
+ function wplc_offline_message_autoresponder_mrg( $data ){
4981
+
4982
+ $wplc_user_name = $data['name'];
4983
+ $wplc_user_email = $data['email'];
4984
+
4985
+ $wplc_settings = get_option("WPLC_AUTO_RESPONDER_SETTINGS");
4986
+
4987
+ 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; }
4988
+ if( isset( $wplc_settings['wplc_ar_from_name'] ) ) { $wplc_ar_from_name = $wplc_settings['wplc_ar_from_name']; } else { $wplc_ar_from_name = ""; }
4989
+ if( isset( $wplc_settings['wplc_ar_from_email'] ) ) { $wplc_ar_from_email = $wplc_settings['wplc_ar_from_email']; } else { $wplc_ar_from_email = ""; }
4990
+ if( isset( $wplc_settings['wplc_ar_subject'] ) ) { $wplc_ar_subject = $wplc_settings['wplc_ar_subject']; } else { $wplc_ar_subject = ""; }
4991
+ if( isset( $wplc_settings['wplc_ar_body'] ) ) { $wplc_ar_body = $wplc_settings['wplc_ar_body']; } else { $wplc_ar_body = ""; }
4992
+
4993
+ if( $wplc_ar_enable ){
4994
+
4995
+ preg_match_all('/{(.*?)}/', $wplc_ar_body, $matches);
4996
+
4997
+ if (isset($matches[1])) {
4998
+
4999
+ foreach ($matches[1] as $key => $match) {
5000
+
5001
+ if ($wplc_ar_body) {
5002
+
5003
+ if( $matches[1][$key] == 'wplc-user-name' ){
5004
+
5005
+ $wplc_ar_body = str_replace( $matches[0][$key],$wplc_user_name,$wplc_ar_body );
5006
+
5007
+ } else if ( $matches[1][$key] == 'wplc-email-address' ){
5008
+
5009
+ $wplc_ar_body = str_replace( $matches[0][$key],$wplc_user_email,$wplc_ar_body );
5010
+
5011
+ }
5012
+
5013
+ }
5014
+
5015
+ }
5016
+
5017
+ }
5018
+ /**
5019
+ * Using contents of wplcmail function as we need additional functionality for this
5020
+ */
5021
+ if(get_option("wplc_mail_type") == "wp_mail" || !get_option('wplc_mail_type')){
5022
+ $headers[] = 'Content-type: text/html';
5023
+ $headers[] = 'Reply-To: '.$wplc_ar_from_name.'<'.$wplc_ar_from_email.'>';
5024
+ $overbody = apply_filters("wplc_filter_mail_body",$wplc_ar_subject, htmlspecialchars_decode(stripslashes( $wplc_ar_body ) ) );
5025
+ if (!wp_mail($wplc_user_email, $wplc_ar_subject, $overbody, $headers)) {
5026
+ $error = date("Y-m-d H:i:s") . " WP-Mail Failed to send \n";
5027
+ error_log($error);
5028
+ }
5029
+ return;
5030
+ } else {
5031
+
5032
+ global $phpmailer;
5033
+
5034
+ // (Re)create it, if it's gone missing
5035
+ if ( ! ( $phpmailer instanceof PHPMailer ) ) {
5036
+ require_once ABSPATH . WPINC . '/class-phpmailer.php';
5037
+ require_once ABSPATH . WPINC . '/class-smtp.php';
5038
+ $mail = new PHPMailer( true );
5039
+ }
5040
+
5041
+
5042
+ $host = get_option('wplc_mail_host');
5043
+ $port = get_option('wplc_mail_port');
5044
+ $username = get_option("wplc_mail_username");
5045
+ $password = get_option("wplc_mail_password");
5046
+ if($host && $port && $username && $password){
5047
+
5048
+ $mail->isSMTP();
5049
+ //Enable SMTP debugging
5050
+ // 0 = off (for production use)
5051
+ // 1 = client messages
5052
+ // 2 = client and server messages
5053
+ $mail->SMTPDebug = 0;
5054
+ //Ask for HTML-friendly debug output
5055
+ $mail->Debugoutput = 'html';
5056
+ //Set the hostname of the mail server
5057
+ $mail->Host = $host;
5058
+ //Set the SMTP port number - likely to be 25, 26, 465 or 587
5059
+ $mail->Port = $port;
5060
+ //Set the encryption system to use - ssl (deprecated) or tls
5061
+ if($port == "587"){
5062
+ $mail->SMTPSecure = 'tls';
5063
+ } else if($port == "465"){
5064
+ $mail->SMTPSecure = 'ssl';
5065
+ }
5066
+ //Whether to use SMTP authentication
5067
+ $mail->SMTPAuth = true;
5068
+ //Username to use for SMTP authentication
5069
+ $mail->Username = $username;
5070
+ //Password to use for SMTP authentication
5071
+ $mail->Password = $password;
5072
+ //Set who the message is to be sent from
5073
+ $mail->setFrom($wplc_ar_from_email, $wplc_ar_from_name);
5074
+ //Set who the message is to be sent to
5075
+ $mail->addAddress($wplc_user_email);
5076
+ //Set the subject line
5077
+ $mail->Subject = $wplc_ar_subject;
5078
+ //HTML will render
5079
+ $mail->isHTML(true);
5080
+ //Read an HTML message body from an external file, convert referenced images to embedded,
5081
+ //convert HTML into a basic plain-text alternative body
5082
+ $body = apply_filters("wplc_filter_mail_body",$wplc_ar_subject, htmlspecialchars_decode(stripslashes( $wplc_ar_body ) ) );
5083
+ $mail->msgHTML($body);
5084
+ //Replace the plain text body with one created manually
5085
+ $mail->AltBody = $msg;
5086
+ //send the message, check for errors
5087
+ if (!$mail->send()) {
5088
+ $error = date("Y-m-d H:i:s")." ".$mail->ErrorInfo." \n";
5089
+ error_log($error);
5090
+ }
5091
+ return;
5092
+ }
5093
+ }
5094
+ }
5095
+
5096
+ }
5097
+
5098
+ add_action( 'wplc_hook_head', 'wplc_auto_responder_settings_mrg' );
5099
+
5100
+ function wplc_auto_responder_settings_mrg(){
5101
+
5102
+ if (isset($_POST['wplc_save_settings'])) {
5103
+ $wplc_data = array();
5104
+ if (isset($_POST['wplc_ar_enable'])) { $wplc_data['wplc_ar_enable'] = esc_attr($_POST['wplc_ar_enable']); }
5105
+ if (isset($_POST['wplc_ar_from_name'])) { $wplc_data['wplc_ar_from_name'] = esc_attr($_POST['wplc_ar_from_name']); }
5106
+ if (isset($_POST['wplc_ar_from_email'])) { $wplc_data['wplc_ar_from_email'] = esc_attr($_POST['wplc_ar_from_email']); }
5107
+ if (isset($_POST['wplc_ar_subject'])) { $wplc_data['wplc_ar_subject'] = esc_attr($_POST['wplc_ar_subject']); }
5108
+ if (isset($_POST['wplc_ar_body'])) { $wplc_data['wplc_ar_body'] = esc_attr($_POST['wplc_ar_body']); }
5109
+
5110
+ update_option( "WPLC_AUTO_RESPONDER_SETTINGS", $wplc_data );
5111
+
5112
+ }
5113
+
5114
+ }
5115
+
5116
+
5117
+
5118
+
5119
+
5120
+ function wplc_return_times_array_mrg(){
5121
+ $hours = array();
5122
+ for( $i = 0; $i <= 23; $i++){
5123
+ $hours[] = sprintf('%02d', $i );
5124
+ }
5125
+ $minutes = array();
5126
+ for( $i = 0; $i <= 59; $i++){
5127
+ $minutes[] = sprintf('%02d', $i );
5128
+ }
5129
+ $time = array(
5130
+ 'hours' => $hours,
5131
+ 'minutes' => $minutes
5132
+ );
5133
+ return $time;
5134
+ }
5135
+
5136
+ add_action( "wplc_hook_head", "wplc_business_hours_settings_save_mrg" );
5137
+
5138
+ function wplc_business_hours_settings_save_mrg(){
5139
+
5140
+ if( isset( $_POST['wplc_save_settings'] ) ){
5141
+
5142
+ if( isset( $_POST['wplc_bh_enable'] ) && $_POST['wplc_bh_enable'] == '1' ){ $wplc_bh_enabled = true; } else { $wplc_bh_enabled = false; }
5143
+ if( isset( $_POST['wplc_bh_interval'] ) ){ $wplc_bh_interval = sanitize_text_field( $_POST['wplc_bh_interval'] ); } else { $wplc_bh_interval = '0'; }
5144
+
5145
+ if( isset( $_POST['wplc_bh_hours_start'] ) ){ $wplc_bh_hours_start = sanitize_text_field( $_POST['wplc_bh_hours_start'] ); } else { $wplc_bh_hours_start = ''; }
5146
+ if( isset( $_POST['wplc_bh_minutes_start'] ) ){ $wplc_bh_minutes_start = sanitize_text_field( $_POST['wplc_bh_minutes_start'] ); } else { $wplc_bh_minutes_start = ''; }
5147
+
5148
+ if( isset( $_POST['wplc_bh_hours_end'] ) ){ $wplc_bh_hours_end = sanitize_text_field( $_POST['wplc_bh_hours_end'] ); } else { $wplc_bh_hours_end = ''; }
5149
+ if( isset( $_POST['wplc_bh_minutes_end'] ) ){ $wplc_bh_minutes_end = sanitize_text_field( $_POST['wplc_bh_minutes_end'] ); } else { $wplc_bh_minutes_end = ''; }
5150
+
5151
+
5152
+ $wplc_bh_settings = array(
5153
+ 'enabled' => $wplc_bh_enabled,
5154
+ 'interval' => $wplc_bh_interval,
5155
+ 'start' => array( 'h' => $wplc_bh_hours_start, 'm' => $wplc_bh_minutes_start ),
5156
+ 'end' => array( 'h' => $wplc_bh_hours_end, 'm' => $wplc_bh_minutes_end ),
5157
+ );
5158
+
5159
+ update_option( "wplc_bh_settings", $wplc_bh_settings );
5160
+
5161
+ }
5162
+
5163
+ }
5164
+
5165
+ function wplc_check_business_hours_mrg() {
5166
+ $business_hours_enabled = true;
5167
+ $wplc_bh_settings = get_option( "wplc_bh_settings" );
5168
+
5169
+ if( isset( $wplc_bh_settings['enabled'] ) && $wplc_bh_settings['enabled'] ){
5170
+ /**
5171
+ * Enabled, check if the current day fits in the interval
5172
+ */
5173
+ $chat_box_interval = false;
5174
+
5175
+ $current_day = current_time(date("N"));
5176
+ $current_day = intval( $current_day );
5177
+
5178
+ if( isset( $wplc_bh_settings['interval'] ) ){
5179
+
5180
+ if( $wplc_bh_settings['interval'] == '0' ){
5181
+ /**
5182
+ * Show everyday
5183
+ */
5184
+ $chat_box_interval = true;
5185
+ } else if ( $wplc_bh_settings['interval'] == '1' ){
5186
+ /**
5187
+ * Weekdays only
5188
+ */
5189
+ if( $current_day <= 5 ){
5190
+ $chat_box_interval = true;
5191
+ }
5192
+ } else if ( $wplc_bh_settings['interval'] == '2' ){
5193
+ /**
5194
+ * Weekends only
5195
+ */
5196
+ if( $current_day == 6 || $current_day == 7 ){
5197
+ $chat_box_interval = true;
5198
+ }
5199
+ }
5200
+
5201
+ }
5202
+
5203
+ if( $chat_box_interval ){
5204
+ /**
5205
+ * Lets check if it's the right time to show it now
5206
+ */
5207
+ if( isset( $wplc_bh_settings['start'] ) && isset( $wplc_bh_settings['end'] ) ){
5208
+ if( isset( $wplc_bh_settings['start']['h'] ) && isset( $wplc_bh_settings['start']['m'] ) ){
5209
+ $start_time = $wplc_bh_settings['start']['h'] . ":" . $wplc_bh_settings['start']['m'];
5210
+ } else {
5211
+ $start_time = "00:00";
5212
+ }
5213
+ if( isset( $wplc_bh_settings['end']['h'] ) && isset( $wplc_bh_settings['end']['m'] ) ){
5214
+ $end_time = $wplc_bh_settings['end']['h'] . ":" . $wplc_bh_settings['end']['m'];
5215
+ } else {
5216
+ $end_time = "00:00";
5217
+ }
5218
+ }
5219
+
5220
+ $current_date_day = date('Y-m-d', current_time('timestamp'));
5221
+
5222
+ $current_time = current_time('timestamp');
5223
+ $start_time = strtotime( $current_date_day.' '.$start_time );
5224
+ $end_time = strtotime( $current_date_day.' '.$end_time );
5225
+
5226
+ if( ( $current_time >= $start_time ) && ( $current_time <= $end_time ) ){
5227
+ $business_hours_enabled = true;
5228
+ } else {
5229
+ $business_hours_enabled = false;
5230
+ }
5231
+ } else {
5232
+ $business_hours_enabled = false;
5233
+ }
5234
+
5235
+ }
5236
+
5237
+ return $business_hours_enabled;
5238
+ }
5239
+
5240
+
5241
+ add_filter("wplc_loggedin_filter","wplc_hook_control_business_hours_mrg",99,1);
5242
+ function wplc_hook_control_business_hours_mrg($logged_in) {
5243
+
5244
+ $display_chat_box = wplc_check_business_hours_mrg();
5245
+
5246
+ if ( ! $display_chat_box ) {
5247
+
5248
+ return false;
5249
+ }
5250
+
5251
+
5252
+ return $logged_in;
5253
+
5254
+ }
5255
+
5256
+ if ( ! function_exists( "wplc_active_business_hours_chat_box_notice" ) ) {
5257
+ add_filter( "wplc_filter_active_chat_box_notice", "wplc_active_business_hours_chat_box_notice" );
5258
+ function wplc_active_business_hours_chat_box_notice( $notice ) {
5259
+ $wplc_settings = get_option( "WPLC_SETTINGS" );
5260
+ if ( $wplc_settings["wplc_settings_enabled"] == 1 ) {
5261
+ $is_chat_enabled = wplc_check_business_hours_mrg();
5262
+ if ( ! $is_chat_enabled ) {
5263
+ $notice = '<div class="wplc-chat-box-notification wplc-chat-box-notification--disabled">';
5264
+ $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>';
5265
+ $notice .= '</div>';
5266
+ }
5267
+ }
5268
+
5269
+ return $notice;
5270
+ }
5271
+ }
5272
+
5273
+
5274
+
5275
+ /**
5276
+ * Add to the array to determine which images need to be preloaded via JS on the front end.
5277
+ *
5278
+ * @param array $images Array of images to be preloaded
5279
+ * @return array
5280
+ */
5281
+ add_filter( "wplc_get_images_to_preload", "wplc_mrg_get_images_to_preload", 10, 2);
5282
+ function wplc_mrg_get_images_to_preload( $images, $wplc_acbc_data ) {
5283
+ if ( isset($wplc_acbc_data) && $wplc_acbc_data['wplc_chat_pic'] ) {
5284
+ array_push( $images, urldecode($wplc_acbc_data['wplc_chat_pic']) );
5285
+ }
5286
+ return $images;
5287
+ }
5288
+
5289
+
5290
+
5291
+ /**
5292
+ * Identify which name we need to use for this agent
5293
+ *
5294
+ * This can either be the agents display name in WordPress, or the name set in the settings section
5295
+ *
5296
+ * @param string $name Name
5297
+ * @param array $settings Array of ACBC settings
5298
+ * @return string
5299
+ */
5300
+ add_filter( "wplc_decide_agents_name", "wplc_filter_control_decide_agents_name_mrg", 10, 2 );
5301
+ function wplc_filter_control_decide_agents_name_mrg( $name, $settings ) {
5302
+ if( isset( $settings['wplc_use_wp_name'] ) && $settings['wplc_use_wp_name'] == '1' ){
5303
+ return $name;
5304
+
5305
+ } else {
5306
+ if (!empty($settings['wplc_chat_name'])) {
5307
+ $name = $settings['wplc_chat_name'];
5308
+ }
5309
+ }
5310
+ return $name;
5311
+ }
5312
+
5313
+ add_filter("wplc_pro_agent_list_before_button_filter", "wplc_mrg_agent_list_edit_profile_link_span", 10, 2);
5314
+ /**
5315
+ * Adds an edit profile link to the agent section
5316
+ *
5317
+ * @return string (html)
5318
+ */
5319
+ function wplc_mrg_agent_list_edit_profile_link_span($content, $user){
5320
+ $content .= "<small style='height:30px'><a href='".admin_url('user-edit.php?user_id=') . $user->ID . "#wplc-user-fields'>" . __("Edit Profile", "wplivechat") . "</a></small>";
5321
+ return $content;
5322
+ }
5323
+
5324
+ add_filter("wplc_filter_live_chat_box_above_main_div","wplc_mrg_drag_and_drop_div_frontend");
5325
+ /**
5326
+ * Adds drag and drop front end container
5327
+ *
5328
+ * @return string (html)
5329
+ */
5330
+ function wplc_mrg_drag_and_drop_div_frontend($ret_msg) {
5331
+ $ret_msg .= '<div id="chat_drag_zone" style="display:none;"><div id="chat_drag_zone_inner"><span>' . __("Drag Files Here", "wplivechat") . '</span></div></div>';
5332
+ return $ret_msg;
5333
+ }
5334
+
5335
+
5336
+
5337
+
5338
+ /*
5339
+ * Add voice notes scripts to admin side
5340
+ */
5341
+ if ( isset( $_GET['page'] ) && $_GET['page'] === 'wplivechat-menu' ) {
5342
+ add_action( 'wplc_admin_remoter_dashboard_scripts_localizer', 'wplc_voice_notes_admin_javascript' );
5343
+ add_action( 'wplc_hook_admin_javascript_chat', 'wplc_voice_notes_admin_javascript' );
5344
+ function wplc_voice_notes_admin_javascript() {
5345
+ $wplc_settings = get_option( "WPLC_SETTINGS" );
5346
+ if ( isset( $wplc_settings['wplc_enable_voice_notes_on_admin'] ) && ( $wplc_settings['wplc_enable_voice_notes_on_admin'] === '1' ) ) {
5347
+ wp_register_script( 'wplc-user-voice-notes-audio-recorder-wav', plugins_url( '/js/WebAudioRecorderWav.min.js', __FILE__ ), true );
5348
+ wp_register_script( 'wplc-user-voice-notes-audio-recorder', plugins_url( '/js/WebAudioRecorder.min.js', __FILE__ ), true );
5349
+ wp_register_script( 'wplc-user-voice-notes-audio-wave-surfer', plugins_url( '/js/wavesurfer.min.js', __FILE__ ), true );
5350
+ wp_register_script( 'wplc-user-voice-notes', plugins_url( '/js/wplc_voice_notes.js', __FILE__ ), array(
5351
+ 'wplc-user-voice-notes-audio-recorder-wav',
5352
+ 'wplc-user-voice-notes-audio-recorder',
5353
+ 'wplc-user-voice-notes-audio-wave-surfer'
5354
+ ), '', true );
5355
+ wp_localize_script( 'wplc-user-voice-notes', 'wplc_visitor_voice', array(
5356
+ 'plugin_url' => __( plugins_url( '/js/', __FILE__ ), 'wplivechat' ),
5357
+ 'str_delete' => __( 'Delete', 'wplivechat' ),
5358
+ 'str_save' => __( 'Send...', 'wplivechat' ),
5359
+ 'play_sound' => __( 'Play voice note', 'wplivechat' ),
5360
+ 'ajax_url' => admin_url( 'admin-ajax.php' )
5361
+ ) );
5362
+ wp_enqueue_script( 'wplc-user-voice-notes' );
5363
+
5364
+ wp_enqueue_style('wplc-admin-voice-note-styles', plugins_url( '/css/voice_note_admin.css', __FILE__ ));
5365
+ }
5366
+ }
5367
+ }
5368
+
5369
+
5370
+ /*
5371
+ * Add voice notes wrapper to admin remote dashboard
5372
+ */
5373
+ if ( ! function_exists( 'wplc_admin_remote_voice_notes' ) ) {
5374
+ add_action( 'wplc_admin_remote_dashboard_below', 'wplc_admin_remote_voice_notes' );
5375
+ function wplc_admin_remote_voice_notes() { ?>
5376
+ <div class="wplc-voice-notes" style='display: none'>
5377
+ <span class="wplc-voice-notes__close fa fa-close"></span>
5378
+ <div id="wplc-voice-notes__recording-list"></div>
5379
+ </div>
5380
+ <?php
5381
+ }
5382
+ }
5383
+
5384
+
5385
+ /*
5386
+ * Add voice notes scripts to front end
5387
+ */
5388
+ if ( ! function_exists( 'wplc_voice_notes_front_scripts' ) ) {
5389
+ add_action( 'wplc_hook_push_js_to_front', 'wplc_voice_notes_front_scripts' );
5390
+ function wplc_voice_notes_front_scripts() {
5391
+ $wplc_settings = get_option( "WPLC_SETTINGS" );
5392
+ if ( isset( $wplc_settings['wplc_enable_voice_notes_on_visitor'] ) && ( $wplc_settings['wplc_enable_voice_notes_on_visitor'] === '1' ) ) {
5393
+ wp_register_script( 'wplc-visitor-voice-notes-audio-recorder-wav', plugins_url( '/js/WebAudioRecorderWav.min.js', __FILE__ ), null, '', true );
5394
+ wp_register_script( 'wplc-visitor-voice-notes-audio-recorder', plugins_url( '/js/WebAudioRecorder.min.js', __FILE__ ), null, '', true );
5395
+ wp_register_script( 'wplc-user-voice-notes-audio-wave-surfer', plugins_url( '/js/wavesurfer.min.js', __FILE__ ), true );
5396
+ wp_register_script( 'wplc-visitor-voice-notes', plugins_url( '/js/wplc_visitor_voice_notes.js', __FILE__ ), array(
5397
+ 'wplc-visitor-voice-notes-audio-recorder-wav',
5398
+ 'wplc-visitor-voice-notes-audio-recorder',
5399
+ 'wplc-user-voice-notes-audio-wave-surfer'
5400
+ ), '', true );
5401
+ wp_localize_script( 'wplc-visitor-voice-notes', 'wplc_visitor_voice', array(
5402
+ 'plugin_url' => __( plugins_url( '/js/', __FILE__ ), 'wplivechat' ),
5403
+ 'str_delete' => __( 'Delete', 'wplivechat' ),
5404
+ 'str_save' => __( 'Save...', 'wplivechat' ),
5405
+ 'play_sound' => __( 'Play voice note', 'wplivechat' ),
5406
+ 'ajax_url' => admin_url( 'admin-ajax.php' )
5407
+ ) );
5408
+ wp_enqueue_script( 'wplc-visitor-voice-notes' );
5409
+
5410
+ wp_enqueue_style('wplc-visitor-voice-note-styles', plugins_url( '/css/voice_notes_user.css', __FILE__ ));
5411
+
5412
+ }
5413
+ }
5414
+ }
5415
+
5416
+
5417
+ /*
5418
+ * Save voice notes audio files via Ajax
5419
+ */
5420
+ if ( ! function_exists( 'wplc_save_voice_notes_ajax' ) ) {
5421
+ add_action( 'wp_ajax_nopriv_wplc_save_voice_notes', 'wplc_save_voice_notes_ajax' );
5422
+ add_action( 'wp_ajax_wplc_save_voice_notes', 'wplc_save_voice_notes_ajax' );
5423
+ function wplc_save_voice_notes_ajax() {
5424
+ if ( isset( $_FILES['file'] ) and ! $_FILES['file']['error'] ) {
5425
+ $upload_dir = wp_upload_dir();
5426
+ $base_dirname = $upload_dir['basedir'] . '/wp_live_chat/';
5427
+ $base_url = $upload_dir['baseurl'] . '/wp_live_chat/';
5428
+
5429
+ if ( ! file_exists( $base_dirname ) ) {
5430
+ @mkdir( $base_dirname );
5431
+ }
5432
+
5433
+ if ( file_exists( $base_dirname . $_FILES['file']['name'] ) ) {
5434
+ $fname = rand( 0, 200 ) . "-" . $_FILES['file']['name'];
5435
+ } else {
5436
+ $fname = $_FILES['file']['name'];
5437
+ }
5438
+
5439
+ $fname = str_replace(" ", "_", $fname);
5440
+ $fname = time() . $fname;
5441
+
5442
+ if ( move_uploaded_file( $_FILES['file']['tmp_name'], $base_dirname . $fname . '.wav' ) ) {
5443
+ echo $base_url . $fname . '.wav';
5444
+ } else {
5445
+ echo 0;
5446
+ }
5447
+
5448
+ }
5449
+ exit;
5450
+ }
5451
+ }
5452
+
5453
+ /**
5454
+ * Checks if the file contains an extension which is unsafe
5455
+ */
5456
+ function wplc_check_file_name_for_unsafe_extension($filename){
5457
+ $do_not_allowed_extensions = array(
5458
+ '.ph', '.asp', '.js',
5459
+ '.svg', '.html', '.css',
5460
+ '.txt', '.exe', '.batch',
5461
+ '.msi', '.rar', '.bin',
5462
+ '.dll', '.tor', '.ini',
5463
+ '.phtml', '.shtml', '.asa',
5464
+ '.cer', '.asax', '.swf',
5465
+ '.xap', '.sh', '.con',
5466
+ '.config', '.htaccess', '.htac',
5467
+ '.prn', '.aux', '.nul', '.com',
5468
+ '>', '*', '<', '::', '$',
5469
+ '..', '.lpt', '.tar', '.gz', '.bz',
5470
+ '%2F', '%5C'
5471
+ );
5472
+
5473
+ $filename = strtolower($filename);
5474
+
5475
+ foreach ($do_not_allowed_extensions as $key => $value) {
5476
+ if(strpos($filename, $value) !== FALSE){
5477
+ return true;
5478
+ }
5479
+ }
5480
+ return false; //Return false, meaning no violations were found
5481
+
5482
+ }
5483
+
5484
+ /**
5485
+ * Checks if the file contains an extension which is allowed safe
5486
+ */
5487
+ function wplc_check_file_name_for_safe_extension($filename){
5488
+ $allowed_extensions = array(
5489
+ '.jpg', '.jpeg', '.png',
5490
+ '.bmp', '.mp4', '.mp3',
5491
+ '.mpeg', '.mpeg4', '.gif',
5492
+ '.tiff', '.tif', '.zip',
5493
+ '.oog', '.webm', '.avi',
5494
+ '.wav', '.doc', '.pdf'
5495
+ );
5496
+
5497
+ $filename = strtolower($filename);
5498
+
5499
+ foreach ($allowed_extensions as $key => $value) {
5500
+ if(strpos($filename, $value) !== FALSE){
5501
+ return true;
5502
+ }
5503
+ }
5504
+ return false; //Always fail if no matches are found
5505
+ }
5506
+
5507
+
5508
+ /**
5509
+ * Check the mime type if possible on this server
5510
+ */
5511
+ function wplc_check_file_mime_type($filepath){
5512
+
5513
+ $mime = false;
5514
+ if(function_exists('mime_content_type')){
5515
+ $mime = mime_content_type($filepath);
5516
+ } else if(class_exists('finfo')){
5517
+ $result = new finfo();
5518
+ if (is_resource($result) === true) {
5519
+ $mime = $result->file($filepath, FILEINFO_MIME_TYPE);
5520
+ }
5521
+ }
5522
+
5523
+ if($mime !== false){
5524
+ //We have managed to pull the mime type
5525
+ $allowed_mime_types = array(
5526
+ 'audio/aac', 'video/x-msvideo',
5527
+ 'text/csv', 'application/msword',
5528
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
5529
+ 'image/gif', 'image/jpeg', 'application/json', 'video/mpeg',
5530
+ 'image/png', 'application/pdf', 'image/tiff',
5531
+ 'audio/wav', 'video/webm', 'application/zip'
5532
+ );
5533
+
5534
+
5535
+ if(in_array($mime, $allowed_mime_types)){
5536
+ return true;
5537
+ } else {
5538
+ return false;
5539
+ }
5540
+ } else {
5541
+ return false;
5542
+ }
5543
+ }
5544
+
5545
+ /**
5546
+ * Adds compatibility for start chat notifications back into the node system
5547
+ */
5548
+ function wplc_mrg_chat_notification_extender($data){
5549
+ $wplc_acbc_data = get_option("WPLC_ACBC_SETTINGS");
5550
+ if (isset($wplc_acbc_data['wplc_pro_chat_notification']) && $wplc_acbc_data['wplc_pro_chat_notification'] == "yes") {
5551
+ if (isset($wplc_acbc_data['wplc_pro_chat_email_address'])) { $email_address = $wplc_acbc_data['wplc_pro_chat_email_address']; } else { $email_address = ""; }
5552
+ if (!$email_address || $email_address == "") { $email_address = get_option('admin_email'); }
5553
+
5554
+ $subject = sprintf( __( 'Incoming chat from %s (%s) on %s', 'wplivechat' ),
5555
+ $data['name'],
5556
+ $data['email'],
5557
+ get_option('blogname')
5558
+ );
5559
+
5560
+ $msg = sprintf( __( '%s (%s) wants to chat with you. <br /><br />Log in: %s', 'wplivechat' ),
5561
+ $data['name'],
5562
+ $data['email'],
5563
+ get_option('home')."/wp-login.php"
5564
+ );
5565
+
5566
+ wplcmail($email_address,"WP Live Chat Support", $subject, $msg);
5567
+ }
5568
+
5569
+ }
5570
+ add_action('wplc_hook_initiate_chat', 'wplc_mrg_chat_notification_extender', 99, 1);
images/comment.gif ADDED
Binary file
images/comment.svg ADDED
@@ -0,0 +1 @@
 
1
+ <?xml version="1.0" encoding="utf-8"?><svg width='40px' height='40px' xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" class="uil-comment"><rect x="0" y="0" width="100" height="100" fill="none" class="bk"></rect><path d="M78,19H22c-6.6,0-12,5.4-12,12v31c0,6.6,5.4,12,12,12h37.2c0.4,3,1.8,5.6,3.7,7.6c2.4,2.5,5.1,4.1,9.1,4 c-1.4-2.1-2-7.2-2-10.3c0-0.4,0-0.8,0-1.3h8c6.6,0,12-5.4,12-12V31C90,24.4,84.6,19,78,19z" fill="#e0e0e0"></path><circle cx="30" cy="47" r="5" fill="#ffffff"><animate attributeName="opacity" from="0" to="1" values="0;1;1" keyTimes="0;0.2;1" dur="1.5s" repeatCount="indefinite"></animate></circle><circle cx="50" cy="47" r="5" fill="#ffffff"><animate attributeName="opacity" from="0" to="1" values="0;0;1;1" keyTimes="0;0.2;0.4;1" dur="1.5s" repeatCount="indefinite"></animate></circle><circle cx="70" cy="47" r="5" fill="#ffffff"><animate attributeName="opacity" from="0" to="1" values="0;0;1;1" keyTimes="0;0.4;0.6;1" dur="1.5s" repeatCount="indefinite"></animate></circle></svg>
images/default_icon_1.png ADDED
Binary file
images/default_icon_2.png ADDED
Binary file
images/default_icon_3.png ADDED
Binary file
images/logo-for-chat-box.jpg ADDED
Binary file
images/picture-for-chat-box.jpg ADDED
Binary file
images/social/facebook.png ADDED
Binary file
images/social/linkedin.png ADDED
Binary file
images/social/twitter.png ADDED
Binary file
images/social/website.png ADDED
Binary file
images/themes/sola-t-layout-1.png ADDED
Binary file
includes/aes_fast.php ADDED
@@ -0,0 +1,706 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * aes.php: implements AES - Advanced Encryption Standard
5
+ * from the SlowAES project, http://code.google.com/p/slowaes/
6
+ *
7
+ * Copyright (c) 2008 Josh Davis ( http://www.josh-davis.org ),
8
+ * Mark Percival ( http://mpercival.com ),
9
+ *
10
+ * Ported from C code written by Laurent Haan ( http://www.progressive-coding.com )
11
+ *
12
+ * Ported from JavaScript to PHP by ALeX Kazik
13
+ *
14
+ * Licensed under the Apache License, Version 2.0
15
+ * http://www.apache.org/licenses/
16
+ */
17
+
18
+ class AES {
19
+ /*
20
+ * START AES SECTION
21
+ */
22
+
23
+ const keySize_128 = 16;
24
+ const keySize_192 = 24;
25
+ const keySize_256 = 32;
26
+
27
+ // Rijndael S-box
28
+ private static $sbox = array(
29
+ 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
30
+ 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
31
+ 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,
32
+ 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75,
33
+ 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84,
34
+ 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,
35
+ 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8,
36
+ 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2,
37
+ 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73,
38
+ 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb,
39
+ 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79,
40
+ 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08,
41
+ 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a,
42
+ 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,
43
+ 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
44
+ 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16
45
+ );
46
+
47
+ // Rijndael Inverted S-box
48
+ private static $rsbox = array(
49
+ 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb
50
+ , 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb
51
+ , 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e
52
+ , 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25
53
+ , 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92
54
+ , 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84
55
+ , 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06
56
+ , 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b
57
+ , 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73
58
+ , 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e
59
+ , 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b
60
+ , 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4
61
+ , 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f
62
+ , 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef
63
+ , 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61
64
+ , 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d
65
+ );
66
+
67
+ /* rotate the word eight bits to the left */
68
+ private static function rotate($word){
69
+ $c = $word[0];
70
+ for ($i = 0; $i < 3; $i++)
71
+ $word[$i] = $word[$i+1];
72
+ $word[3] = $c;
73
+
74
+ return $word;
75
+ }
76
+
77
+ // Rijndael Rcon
78
+ private static $Rcon = array(
79
+ 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8,
80
+ 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3,
81
+ 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f,
82
+ 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d,
83
+ 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab,
84
+ 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d,
85
+ 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25,
86
+ 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01,
87
+ 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d,
88
+ 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa,
89
+ 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a,
90
+ 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02,
91
+ 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a,
92
+ 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef,
93
+ 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94,
94
+ 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04,
95
+ 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f,
96
+ 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5,
97
+ 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33,
98
+ 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb
99
+ );
100
+
101
+ private static $G2X = array(
102
+ 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 0x10, 0x12, 0x14, 0x16,
103
+ 0x18, 0x1a, 0x1c, 0x1e, 0x20, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2c, 0x2e,
104
+ 0x30, 0x32, 0x34, 0x36, 0x38, 0x3a, 0x3c, 0x3e, 0x40, 0x42, 0x44, 0x46,
105
+ 0x48, 0x4a, 0x4c, 0x4e, 0x50, 0x52, 0x54, 0x56, 0x58, 0x5a, 0x5c, 0x5e,
106
+ 0x60, 0x62, 0x64, 0x66, 0x68, 0x6a, 0x6c, 0x6e, 0x70, 0x72, 0x74, 0x76,
107
+ 0x78, 0x7a, 0x7c, 0x7e, 0x80, 0x82, 0x84, 0x86, 0x88, 0x8a, 0x8c, 0x8e,
108
+ 0x90, 0x92, 0x94, 0x96, 0x98, 0x9a, 0x9c, 0x9e, 0xa0, 0xa2, 0xa4, 0xa6,
109
+ 0xa8, 0xaa, 0xac, 0xae, 0xb0, 0xb2, 0xb4, 0xb6, 0xb8, 0xba, 0xbc, 0xbe,
110
+ 0xc0, 0xc2, 0xc4, 0xc6, 0xc8, 0xca, 0xcc, 0xce, 0xd0, 0xd2, 0xd4, 0xd6,
111
+ 0xd8, 0xda, 0xdc, 0xde, 0xe0, 0xe2, 0xe4, 0xe6, 0xe8, 0xea, 0xec, 0xee,
112
+ 0xf0, 0xf2, 0xf4, 0xf6, 0xf8, 0xfa, 0xfc, 0xfe, 0x1b, 0x19, 0x1f, 0x1d,
113
+ 0x13, 0x11, 0x17, 0x15, 0x0b, 0x09, 0x0f, 0x0d, 0x03, 0x01, 0x07, 0x05,
114
+ 0x3b, 0x39, 0x3f, 0x3d, 0x33, 0x31, 0x37, 0x35, 0x2b, 0x29, 0x2f, 0x2d,
115
+ 0x23, 0x21, 0x27, 0x25, 0x5b, 0x59, 0x5f, 0x5d, 0x53, 0x51, 0x57, 0x55,
116
+ 0x4b, 0x49, 0x4f, 0x4d, 0x43, 0x41, 0x47, 0x45, 0x7b, 0x79, 0x7f, 0x7d,
117
+ 0x73, 0x71, 0x77, 0x75, 0x6b, 0x69, 0x6f, 0x6d, 0x63, 0x61, 0x67, 0x65,
118
+ 0x9b, 0x99, 0x9f, 0x9d, 0x93, 0x91, 0x97, 0x95, 0x8b, 0x89, 0x8f, 0x8d,
119
+ 0x83, 0x81, 0x87, 0x85, 0xbb, 0xb9, 0xbf, 0xbd, 0xb3, 0xb1, 0xb7, 0xb5,
120
+ 0xab, 0xa9, 0xaf, 0xad, 0xa3, 0xa1, 0xa7, 0xa5, 0xdb, 0xd9, 0xdf, 0xdd,
121
+ 0xd3, 0xd1, 0xd7, 0xd5, 0xcb, 0xc9, 0xcf, 0xcd, 0xc3, 0xc1, 0xc7, 0xc5,
122
+ 0xfb, 0xf9, 0xff, 0xfd, 0xf3, 0xf1, 0xf7, 0xf5, 0xeb, 0xe9, 0xef, 0xed,
123
+ 0xe3, 0xe1, 0xe7, 0xe5
124
+ );
125
+
126
+ private static $G3X = array(
127
+ 0x00, 0x03, 0x06, 0x05, 0x0c, 0x0f, 0x0a, 0x09, 0x18, 0x1b, 0x1e, 0x1d,
128
+ 0x14, 0x17, 0x12, 0x11, 0x30, 0x33, 0x36, 0x35, 0x3c, 0x3f, 0x3a, 0x39,
129
+ 0x28, 0x2b, 0x2e, 0x2d, 0x24, 0x27, 0x22, 0x21, 0x60, 0x63, 0x66, 0x65,
130
+ 0x6c, 0x6f, 0x6a, 0x69, 0x78, 0x7b, 0x7e, 0x7d, 0x74, 0x77, 0x72, 0x71,
131
+ 0x50, 0x53, 0x56, 0x55, 0x5c, 0x5f, 0x5a, 0x59, 0x48, 0x4b, 0x4e, 0x4d,
132
+ 0x44, 0x47, 0x42, 0x41, 0xc0, 0xc3, 0xc6, 0xc5, 0xcc, 0xcf, 0xca, 0xc9,
133
+ 0xd8, 0xdb, 0xde, 0xdd, 0xd4, 0xd7, 0xd2, 0xd1, 0xf0, 0xf3, 0xf6, 0xf5,
134
+ 0xfc, 0xff, 0xfa, 0xf9, 0xe8, 0xeb, 0xee, 0xed, 0xe4, 0xe7, 0xe2, 0xe1,
135
+ 0xa0, 0xa3, 0xa6, 0xa5, 0xac, 0xaf, 0xaa, 0xa9, 0xb8, 0xbb, 0xbe, 0xbd,
136
+ 0xb4, 0xb7, 0xb2, 0xb1, 0x90, 0x93, 0x96, 0x95, 0x9c, 0x9f, 0x9a, 0x99,
137
+ 0x88, 0x8b, 0x8e, 0x8d, 0x84, 0x87, 0x82, 0x81, 0x9b, 0x98, 0x9d, 0x9e,
138
+ 0x97, 0x94, 0x91, 0x92, 0x83, 0x80, 0x85, 0x86, 0x8f, 0x8c, 0x89, 0x8a,
139
+ 0xab, 0xa8, 0xad, 0xae, 0xa7, 0xa4, 0xa1, 0xa2, 0xb3, 0xb0, 0xb5, 0xb6,
140
+ 0xbf, 0xbc, 0xb9, 0xba, 0xfb, 0xf8, 0xfd, 0xfe, 0xf7, 0xf4, 0xf1, 0xf2,
141
+ 0xe3, 0xe0, 0xe5, 0xe6, 0xef, 0xec, 0xe9, 0xea, 0xcb, 0xc8, 0xcd, 0xce,
142
+ 0xc7, 0xc4, 0xc1, 0xc2, 0xd3, 0xd0, 0xd5, 0xd6, 0xdf, 0xdc, 0xd9, 0xda,
143
+ 0x5b, 0x58, 0x5d, 0x5e, 0x57, 0x54, 0x51, 0x52, 0x43, 0x40, 0x45, 0x46,
144
+ 0x4f, 0x4c, 0x49, 0x4a, 0x6b, 0x68, 0x6d, 0x6e, 0x67, 0x64, 0x61, 0x62,
145
+ 0x73, 0x70, 0x75, 0x76, 0x7f, 0x7c, 0x79, 0x7a, 0x3b, 0x38, 0x3d, 0x3e,
146
+ 0x37, 0x34, 0x31, 0x32, 0x23, 0x20, 0x25, 0x26, 0x2f, 0x2c, 0x29, 0x2a,
147
+ 0x0b, 0x08, 0x0d, 0x0e, 0x07, 0x04, 0x01, 0x02, 0x13, 0x10, 0x15, 0x16,
148
+ 0x1f, 0x1c, 0x19, 0x1a
149
+ );
150
+
151
+ private static $G9X = array(
152
+ 0x00, 0x09, 0x12, 0x1b, 0x24, 0x2d, 0x36, 0x3f, 0x48, 0x41, 0x5a, 0x53,
153
+ 0x6c, 0x65, 0x7e, 0x77, 0x90, 0x99, 0x82, 0x8b, 0xb4, 0xbd, 0xa6, 0xaf,
154
+ 0xd8, 0xd1, 0xca, 0xc3, 0xfc, 0xf5, 0xee, 0xe7, 0x3b, 0x32, 0x29, 0x20,
155
+ 0x1f, 0x16, 0x0d, 0x04, 0x73, 0x7a, 0x61, 0x68, 0x57, 0x5e, 0x45, 0x4c,
156
+ 0xab, 0xa2, 0xb9, 0xb0, 0x8f, 0x86, 0x9d, 0x94, 0xe3, 0xea, 0xf1, 0xf8,
157
+ 0xc7, 0xce, 0xd5, 0xdc, 0x76, 0x7f, 0x64, 0x6d, 0x52, 0x5b, 0x40, 0x49,
158
+ 0x3e, 0x37, 0x2c, 0x25, 0x1a, 0x13, 0x08, 0x01, 0xe6, 0xef, 0xf4, 0xfd,
159
+ 0xc2, 0xcb, 0xd0, 0xd9, 0xae, 0xa7, 0xbc, 0xb5, 0x8a, 0x83, 0x98, 0x91,
160
+ 0x4d, 0x44, 0x5f, 0x56, 0x69, 0x60, 0x7b, 0x72, 0x05, 0x0c, 0x17, 0x1e,
161
+ 0x21, 0x28, 0x33, 0x3a, 0xdd, 0xd4, 0xcf, 0xc6, 0xf9, 0xf0, 0xeb, 0xe2,
162
+ 0x95, 0x9c, 0x87, 0x8e, 0xb1, 0xb8, 0xa3, 0xaa, 0xec, 0xe5, 0xfe, 0xf7,
163
+ 0xc8, 0xc1, 0xda, 0xd3, 0xa4, 0xad, 0xb6, 0xbf, 0x80, 0x89, 0x92, 0x9b,
164
+ 0x7c, 0x75, 0x6e, 0x67, 0x58, 0x51, 0x4a, 0x43, 0x34, 0x3d, 0x26, 0x2f,
165
+ 0x10, 0x19, 0x02, 0x0b, 0xd7, 0xde, 0xc5, 0xcc, 0xf3, 0xfa, 0xe1, 0xe8,
166
+ 0x9f, 0x96, 0x8d, 0x84, 0xbb, 0xb2, 0xa9, 0xa0, 0x47, 0x4e, 0x55, 0x5c,
167
+ 0x63, 0x6a, 0x71, 0x78, 0x0f, 0x06, 0x1d, 0x14, 0x2b, 0x22, 0x39, 0x30,
168
+ 0x9a, 0x93, 0x88, 0x81, 0xbe, 0xb7, 0xac, 0xa5, 0xd2, 0xdb, 0xc0, 0xc9,
169
+ 0xf6, 0xff, 0xe4, 0xed, 0x0a, 0x03, 0x18, 0x11, 0x2e, 0x27, 0x3c, 0x35,
170
+ 0x42, 0x4b, 0x50, 0x59, 0x66, 0x6f, 0x74, 0x7d, 0xa1, 0xa8, 0xb3, 0xba,
171
+ 0x85, 0x8c, 0x97, 0x9e, 0xe9, 0xe0, 0xfb, 0xf2, 0xcd, 0xc4, 0xdf, 0xd6,
172
+ 0x31, 0x38, 0x23, 0x2a, 0x15, 0x1c, 0x07, 0x0e, 0x79, 0x70, 0x6b, 0x62,
173
+ 0x5d, 0x54, 0x4f, 0x46
174
+ );
175
+
176
+ private static $GBX = array(
177
+ 0x00, 0x0b, 0x16, 0x1d, 0x2c, 0x27, 0x3a, 0x31, 0x58, 0x53, 0x4e, 0x45,
178
+ 0x74, 0x7f, 0x62, 0x69, 0xb0, 0xbb, 0xa6, 0xad, 0x9c, 0x97, 0x8a, 0x81,
179
+ 0xe8, 0xe3, 0xfe, 0xf5, 0xc4, 0xcf, 0xd2, 0xd9, 0x7b, 0x70, 0x6d, 0x66,
180
+ 0x57, 0x5c, 0x41, 0x4a, 0x23, 0x28, 0x35, 0x3e, 0x0f, 0x04, 0x19, 0x12,
181
+ 0xcb, 0xc0, 0xdd, 0xd6, 0xe7, 0xec, 0xf1, 0xfa, 0x93, 0x98, 0x85, 0x8e,
182
+ 0xbf, 0xb4, 0xa9, 0xa2, 0xf6, 0xfd, 0xe0, 0xeb, 0xda, 0xd1, 0xcc, 0xc7,
183
+ 0xae, 0xa5, 0xb8, 0xb3, 0x82, 0x89, 0x94, 0x9f, 0x46, 0x4d, 0x50, 0x5b,
184
+ 0x6a, 0x61, 0x7c, 0x77, 0x1e, 0x15, 0x08, 0x03, 0x32, 0x39, 0x24, 0x2f,
185
+ 0x8d, 0x86, 0x9b, 0x90, 0xa1, 0xaa, 0xb7, 0xbc, 0xd5, 0xde, 0xc3, 0xc8,
186
+ 0xf9, 0xf2, 0xef, 0xe4, 0x3d, 0x36, 0x2b, 0x20, 0x11, 0x1a, 0x07, 0x0c,
187
+ 0x65, 0x6e, 0x73, 0x78, 0x49, 0x42, 0x5f, 0x54, 0xf7, 0xfc, 0xe1, 0xea,
188
+ 0xdb, 0xd0, 0xcd, 0xc6, 0xaf, 0xa4, 0xb9, 0xb2, 0x83, 0x88, 0x95, 0x9e,
189
+ 0x47, 0x4c, 0x51, 0x5a, 0x6b, 0x60, 0x7d, 0x76, 0x1f, 0x14, 0x09, 0x02,
190
+ 0x33, 0x38, 0x25, 0x2e, 0x8c, 0x87, 0x9a, 0x91, 0xa0, 0xab, 0xb6, 0xbd,
191
+ 0xd4, 0xdf, 0xc2, 0xc9, 0xf8, 0xf3, 0xee, 0xe5, 0x3c, 0x37, 0x2a, 0x21,
192
+ 0x10, 0x1b, 0x06, 0x0d, 0x64, 0x6f, 0x72, 0x79, 0x48, 0x43, 0x5e, 0x55,
193
+ 0x01, 0x0a, 0x17, 0x1c, 0x2d, 0x26, 0x3b, 0x30, 0x59, 0x52, 0x4f, 0x44,
194
+ 0x75, 0x7e, 0x63, 0x68, 0xb1, 0xba, 0xa7, 0xac, 0x9d, 0x96, 0x8b, 0x80,
195
+ 0xe9, 0xe2, 0xff, 0xf4, 0xc5, 0xce, 0xd3, 0xd8, 0x7a, 0x71, 0x6c, 0x67,
196
+ 0x56, 0x5d, 0x40, 0x4b, 0x22, 0x29, 0x34, 0x3f, 0x0e, 0x05, 0x18, 0x13,
197
+ 0xca, 0xc1, 0xdc, 0xd7, 0xe6, 0xed, 0xf0, 0xfb, 0x92, 0x99, 0x84, 0x8f,
198
+ 0xbe, 0xb5, 0xa8, 0xa3
199
+ );
200
+
201
+ private static $GDX = array(
202
+ 0x00, 0x0d, 0x1a, 0x17, 0x34, 0x39, 0x2e, 0x23, 0x68, 0x65, 0x72, 0x7f,
203
+ 0x5c, 0x51, 0x46, 0x4b, 0xd0, 0xdd, 0xca, 0xc7, 0xe4, 0xe9, 0xfe, 0xf3,
204
+ 0xb8, 0xb5, 0xa2, 0xaf, 0x8c, 0x81, 0x96, 0x9b, 0xbb, 0xb6, 0xa1, 0xac,
205
+ 0x8f, 0x82, 0x95, 0x98, 0xd3, 0xde, 0xc9, 0xc4, 0xe7, 0xea, 0xfd, 0xf0,
206
+ 0x6b, 0x66, 0x71, 0x7c, 0x5f, 0x52, 0x45, 0x48, 0x03, 0x0e, 0x19, 0x14,
207
+ 0x37, 0x3a, 0x2d, 0x20, 0x6d, 0x60, 0x77, 0x7a, 0x59, 0x54, 0x43, 0x4e,
208
+ 0x05, 0x08, 0x1f, 0x12, 0x31, 0x3c, 0x2b, 0x26, 0xbd, 0xb0, 0xa7, 0xaa,
209
+ 0x89, 0x84, 0x93, 0x9e, 0xd5, 0xd8, 0xcf, 0xc2, 0xe1, 0xec, 0xfb, 0xf6,
210
+ 0xd6, 0xdb, 0xcc, 0xc1, 0xe2, 0xef, 0xf8, 0xf5, 0xbe, 0xb3, 0xa4, 0xa9,
211
+ 0x8a, 0x87, 0x90, 0x9d, 0x06, 0x0b, 0x1c, 0x11, 0x32, 0x3f, 0x28, 0x25,
212
+ 0x6e, 0x63, 0x74, 0x79, 0x5a, 0x57, 0x40, 0x4d, 0xda, 0xd7, 0xc0, 0xcd,
213
+ 0xee, 0xe3, 0xf4, 0xf9, 0xb2, 0xbf, 0xa8, 0xa5, 0x86, 0x8b, 0x9c, 0x91,
214
+ 0x0a, 0x07, 0x10, 0x1d, 0x3e, 0x33, 0x24, 0x29, 0x62, 0x6f, 0x78, 0x75,
215
+ 0x56, 0x5b, 0x4c, 0x41, 0x61, 0x6c, 0x7b, 0x76, 0x55, 0x58, 0x4f, 0x42,
216
+ 0x09, 0x04, 0x13, 0x1e, 0x3d, 0x30, 0x27, 0x2a, 0xb1, 0xbc, 0xab, 0xa6,
217
+ 0x85, 0x88, 0x9f, 0x92, 0xd9, 0xd4, 0xc3, 0xce, 0xed, 0xe0, 0xf7, 0xfa,
218
+ 0xb7, 0xba, 0xad, 0xa0, 0x83, 0x8e, 0x99, 0x94, 0xdf, 0xd2, 0xc5, 0xc8,
219
+ 0xeb, 0xe6, 0xf1, 0xfc, 0x67, 0x6a, 0x7d, 0x70, 0x53, 0x5e, 0x49, 0x44,
220
+ 0x0f, 0x02, 0x15, 0x18, 0x3b, 0x36, 0x21, 0x2c, 0x0c, 0x01, 0x16, 0x1b,
221
+ 0x38, 0x35, 0x22, 0x2f, 0x64, 0x69, 0x7e, 0x73, 0x50, 0x5d, 0x4a, 0x47,
222
+ 0xdc, 0xd1, 0xc6, 0xcb, 0xe8, 0xe5, 0xf2, 0xff, 0xb4, 0xb9, 0xae, 0xa3,
223
+ 0x80, 0x8d, 0x9a, 0x97
224
+ );
225
+
226
+ private static $GEX = array(
227
+ 0x00, 0x0e, 0x1c, 0x12, 0x38, 0x36, 0x24, 0x2a, 0x70, 0x7e, 0x6c, 0x62,
228
+ 0x48, 0x46, 0x54, 0x5a, 0xe0, 0xee, 0xfc, 0xf2, 0xd8, 0xd6, 0xc4, 0xca,
229
+ 0x90, 0x9e, 0x8c, 0x82, 0xa8, 0xa6, 0xb4, 0xba, 0xdb, 0xd5, 0xc7, 0xc9,
230
+ 0xe3, 0xed, 0xff, 0xf1, 0xab, 0xa5, 0xb7, 0xb9, 0x93, 0x9d, 0x8f, 0x81,
231
+ 0x3b, 0x35, 0x27, 0x29, 0x03, 0x0d, 0x1f, 0x11, 0x4b, 0x45, 0x57, 0x59,
232
+ 0x73, 0x7d, 0x6f, 0x61, 0xad, 0xa3, 0xb1, 0xbf, 0x95, 0x9b, 0x89, 0x87,
233
+ 0xdd, 0xd3, 0xc1, 0xcf, 0xe5, 0xeb, 0xf9, 0xf7, 0x4d, 0x43, 0x51, 0x5f,
234
+ 0x75, 0x7b, 0x69, 0x67, 0x3d, 0x33, 0x21, 0x2f, 0x05, 0x0b, 0x19, 0x17,
235
+ 0x76, 0x78, 0x6a, 0x64, 0x4e, 0x40, 0x52, 0x5c, 0x06, 0x08, 0x1a, 0x14,
236
+ 0x3e, 0x30, 0x22, 0x2c, 0x96, 0x98, 0x8a, 0x84, 0xae, 0xa0, 0xb2, 0xbc,
237
+ 0xe6, 0xe8, 0xfa, 0xf4, 0xde, 0xd0, 0xc2, 0xcc, 0x41, 0x4f, 0x5d, 0x53,
238
+ 0x79, 0x77, 0x65, 0x6b, 0x31, 0x3f, 0x2d, 0x23, 0x09, 0x07, 0x15, 0x1b,
239
+ 0xa1, 0xaf, 0xbd, 0xb3, 0x99, 0x97, 0x85, 0x8b, 0xd1, 0xdf, 0xcd, 0xc3,
240
+ 0xe9, 0xe7, 0xf5, 0xfb, 0x9a, 0x94, 0x86, 0x88, 0xa2, 0xac, 0xbe, 0xb0,
241
+ 0xea, 0xe4, 0xf6, 0xf8, 0xd2, 0xdc, 0xce, 0xc0, 0x7a, 0x74, 0x66, 0x68,
242
+ 0x42, 0x4c, 0x5e, 0x50, 0x0a, 0x04, 0x16, 0x18, 0x32, 0x3c, 0x2e, 0x20,
243
+ 0xec, 0xe2, 0xf0, 0xfe, 0xd4, 0xda, 0xc8, 0xc6, 0x9c, 0x92, 0x80, 0x8e,
244
+ 0xa4, 0xaa, 0xb8, 0xb6, 0x0c, 0x02, 0x10, 0x1e, 0x34, 0x3a, 0x28, 0x26,
245
+ 0x7c, 0x72, 0x60, 0x6e, 0x44, 0x4a, 0x58, 0x56, 0x37, 0x39, 0x2b, 0x25,
246
+ 0x0f, 0x01, 0x13, 0x1d, 0x47, 0x49, 0x5b, 0x55, 0x7f, 0x71, 0x63, 0x6d,
247
+ 0xd7, 0xd9, 0xcb, 0xc5, 0xef, 0xe1, 0xf3, 0xfd, 0xa7, 0xa9, 0xbb, 0xb5,
248
+ 0x9f, 0x91, 0x83, 0x8d
249
+ );
250
+
251
+ // Key Schedule Core
252
+ private static function core($word,$iteration){
253
+ /* rotate the 32-bit word 8 bits to the left */
254
+ $word = self::rotate($word);
255
+ /* apply S-Box substitution on all 4 parts of the 32-bit word */
256
+ for ($i = 0; $i < 4; ++$i)
257
+ $word[$i] = self::$sbox[$word[$i]];
258
+ /* XOR the output of the rcon operation with i to the first part (leftmost) only */
259
+ $word[0] = $word[0]^self::$Rcon[$iteration];
260
+ return $word;
261
+ }
262
+
263
+ /* Rijndael's key expansion
264
+ * expands an 128,192,256 key into an 176,208,240 bytes key
265
+ *
266
+ * expandedKey is a pointer to an char array of large enough size
267
+ * key is a pointer to a non-expanded key
268
+ */
269
+ private static function expandKey($key,$size)
270
+ {
271
+ $expandedKeySize = (16*(self::numberOfRounds($size)+1));
272
+
273
+ /* current expanded keySize, in bytes */
274
+ $currentSize = 0;
275
+ $rconIteration = 1;
276
+ $t = array(); // temporary 4-byte variable
277
+
278
+ $expandedKey = array();
279
+ for($i = 0;$i < $expandedKeySize;$i++)
280
+ $expandedKey[$i] = 0;
281
+
282
+ /* set the 16,24,32 bytes of the expanded key to the input key */
283
+ for ($j = 0; $j < $size; $j++)
284
+ $expandedKey[$j] = $key[$j];
285
+ $currentSize += $size;
286
+
287
+ while ($currentSize < $expandedKeySize)
288
+ {
289
+ /* assign the previous 4 bytes to the temporary value t */
290
+ for ($k = 0; $k < 4; $k++)
291
+ $t[$k] = $expandedKey[($currentSize - 4) + $k];
292
+
293
+ /* every 16,24,32 bytes we apply the core schedule to t
294
+ * and increment rconIteration afterwards
295
+ */
296
+ if($currentSize % $size == 0)
297
+ $t = self::core($t, $rconIteration++);
298
+
299
+ /* For 256-bit keys, we add an extra sbox to the calculation */
300
+ if($size == self::keySize_256 && (($currentSize % $size) == 16))
301
+ for($l = 0; $l < 4; $l++)
302
+ $t[$l] = self::$sbox[$t[$l]];
303
+
304
+ /* We XOR t with the four-byte block 16,24,32 bytes before the new expanded key.
305
+ * This becomes the next four bytes in the expanded key.
306
+ */
307
+ for($m = 0; $m < 4; $m++) {
308
+ $expandedKey[$currentSize] = $expandedKey[$currentSize - $size] ^ $t[$m];
309
+ $currentSize++;
310
+ }
311
+ }
312
+ return $expandedKey;
313
+ }
314
+
315
+ // Adds (XORs) the round key to the state
316
+ private static function addRoundKey($state,$roundKey){
317
+ for ($i = 0; $i < 16; $i++)
318
+ $state[$i] = $state[$i] ^ $roundKey[$i];
319
+ return $state;
320
+ }
321
+
322
+ // Creates a round key from the given expanded key and the
323
+ // position within the expanded key.
324
+ private static function createRoundKey($expandedKey,$roundKeyPointer){
325
+ $roundKey = array();
326
+ for ($i = 0; $i < 4; $i++)
327
+ for ($j = 0; $j < 4; $j++)
328
+ $roundKey[$j*4+$i] = $expandedKey[$roundKeyPointer + $i*4 + $j];
329
+ return $roundKey;
330
+ }
331
+
332
+ /* substitute all the values from the state with the value in the SBox
333
+ * using the state value as index for the SBox
334
+ */
335
+ private static function subBytes($state,$isInv){
336
+ for ($i = 0; $i < 16; $i++)
337
+ $state[$i] = $isInv?self::$rsbox[$state[$i]]:self::$sbox[$state[$i]];
338
+ return $state;
339
+ }
340
+
341
+ /* iterate over the 4 rows and call shiftRow() with that row */
342
+ private static function shiftRows($state,$isInv){
343
+ for ($i = 0; $i < 4; $i++)
344
+ $state = self::shiftRow($state,$i*4, $i,$isInv);
345
+ return $state;
346
+ }
347
+
348
+ /* each iteration shifts the row to the left by 1 */
349
+ private static function shiftRow($state,$statePointer,$nbr,$isInv){
350
+ for ($i = 0; $i < $nbr; $i++)
351
+ {
352
+ if($isInv)
353
+ {
354
+ $tmp = $state[$statePointer + 3];
355
+ for ($j = 3; $j > 0; $j--)
356
+ $state[$statePointer + $j] = $state[$statePointer + $j-1];
357
+ $state[$statePointer] = $tmp;
358
+ }
359
+ else
360
+ {
361
+ $tmp = $state[$statePointer];
362
+ for ($j = 0; $j < 3; $j++)
363
+ $state[$statePointer + $j] = $state[$statePointer + $j+1];
364
+ $state[$statePointer + 3] = $tmp;
365
+ }
366
+ }
367
+ return $state;
368
+ }
369
+
370
+ // galois multipication of the 4x4 matrix
371
+ private static function mixColumns($state,$isInv){
372
+ $t = array();
373
+
374
+ if (!$isInv) {
375
+ for ($c = 0; $c < 4; $c++) {
376
+ $t[ $c] = self::$G2X[$state[$c]] ^ self::$G3X[$state[4+$c]] ^ $state[8+$c] ^ $state[12+$c];
377
+ $t[ 4+$c] = $state[$c] ^ self::$G2X[$state[4+$c]] ^ self::$G3X[$state[8+$c]] ^ $state[12+$c];
378
+ $t[ 8+$c] = $state[$c] ^ $state[4+$c] ^ self::$G2X[$state[8+$c]] ^ self::$G3X[$state[12+$c]];
379
+ $t[12+$c] = self::$G3X[$state[$c]] ^ $state[4+$c] ^ $state[8+$c] ^ self::$G2X[$state[12+$c]];
380
+ }
381
+ }else {
382
+ for ($c = 0; $c < 16; $c+=4) {
383
+ $t[ $c] = self::$GEX[$state[$c]] ^ self::$GBX[$state[4+$c]] ^ self::$GDX[$state[8+$c]] ^ self::$G9X[$state[12+$c]];
384
+ $t[1+$c] = self::$G9X[$state[$c]] ^ self::$GEX[$state[4+$c]] ^ self::$GBX[$state[8+$c]] ^ self::$GDX[$state[12+$c]];
385
+ $t[2+$c] = self::$GDX[$state[$c]] ^ self::$G9X[$state[4+$c]] ^ self::$GEX[$state[8+$c]] ^ self::$GBX[$state[12+$c]];
386
+ $t[3+$c] = self::$GBX[$state[$c]] ^ self::$GDX[$state[4+$c]] ^ self::$G9X[$state[8+$c]] ^ self::$GEX[$state[12+$c]];
387
+ }
388
+ }
389
+
390
+ return $t;
391
+ }
392
+
393
+ // applies the 4 operations of the forward round in sequence
394
+ private static function round($state, $roundKey){
395
+ $state = self::subBytes($state,false);
396
+ $state = self::shiftRows($state,false);
397
+ $state = self::mixColumns($state,false);
398
+ $state = self::addRoundKey($state, $roundKey);
399
+ return $state;
400
+ }
401
+
402
+ // applies the 4 operations of the inverse round in sequence
403
+ private static function invRound($state,$roundKey){
404
+ $state = self::shiftRows($state,true);
405
+ $state = self::subBytes($state,true);
406
+ $state = self::addRoundKey($state, $roundKey);
407
+ $state = self::mixColumns($state,true);
408
+ return $state;
409
+ }
410
+
411
+ /*
412
+ * Perform the initial operations, the standard round, and the final operations
413
+ * of the forward aes, creating a round key for each round
414
+ */
415
+ private static function main($state,$expandedKey,$nbrRounds){
416
+ $state = self::addRoundKey($state, self::createRoundKey($expandedKey,0));
417
+ for ($i = 1; $i < $nbrRounds; $i++)
418
+ $state = self::round($state, self::createRoundKey($expandedKey,16*$i));
419
+ $state = self::subBytes($state,false);
420
+ $state = self::shiftRows($state,false);
421
+ $state = self::addRoundKey($state, self::createRoundKey($expandedKey,16*$nbrRounds));
422
+ return $state;
423
+ }
424
+
425
+ /*
426
+ * Perform the initial operations, the standard round, and the final operations
427
+ * of the inverse aes, creating a round key for each round
428
+ */
429
+ private static function invMain($state, $expandedKey, $nbrRounds){
430
+ $state = self::addRoundKey($state, self::createRoundKey($expandedKey,16*$nbrRounds));
431
+ for ($i = $nbrRounds-1; $i > 0; $i--)
432
+ $state = self::invRound($state, self::createRoundKey($expandedKey,16*$i));
433
+ $state = self::shiftRows($state,true);
434
+ $state = self::subBytes($state,true);
435
+ $state = self::addRoundKey($state, self::createRoundKey($expandedKey,0));
436
+ return $state;
437
+ }
438
+
439
+ private static function numberOfRounds($size){
440
+ $nbrRounds;
441
+ switch ($size) /* set the number of rounds */
442
+ {
443
+ case self::keySize_128:
444
+ $nbrRounds = 10;
445
+ break;
446
+ case self::keySize_192:
447
+ $nbrRounds = 12;
448
+ break;
449
+ case self::keySize_256:
450
+ $nbrRounds = 14;
451
+ break;
452
+ default:
453
+ return null;
454
+ break;
455
+ }
456
+ return $nbrRounds;
457
+ }
458
+
459
+ // encrypts a 128 bit input block against the given key of size specified
460
+ private static function encryptBlock($input,$key,$size){
461
+ $output = array();
462
+ $block = array(); /* the 128 bit block to encode */
463
+ $nbrRounds = self::numberOfRounds($size);
464
+ /* Set the block values, for the block:
465
+ * a0,0 a0,1 a0,2 a0,3
466
+ * a1,0 a1,1 a1,2 a1,3
467
+ * a2,0 a2,1 a2,2 a2,3
468
+ * a3,0 a3,1 a3,2 a3,3
469
+ * the mapping order is a0,0 a1,0 a2,0 a3,0 a0,1 a1,1 ... a2,3 a3,3
470
+ */
471
+ for ($i = 0; $i < 4; $i++) /* iterate over the columns */
472
+ for ($j = 0; $j < 4; $j++) /* iterate over the rows */
473
+ $block[($i+($j*4))] = $input[($i*4)+$j];
474
+
475
+ /* expand the key into an 176, 208, 240 bytes key */
476
+ $expandedKey = self::expandKey($key, $size); /* the expanded key */
477
+ /* encrypt the block using the expandedKey */
478
+ $block = self::main($block, $expandedKey, $nbrRounds);
479
+ for ($k = 0; $k < 4; $k++) /* unmap the block again into the output */
480
+ for ($l = 0; $l < 4; $l++) /* iterate over the rows */
481
+ $output[($k*4)+$l] = $block[($k+($l*4))];
482
+ return $output;
483
+ }
484
+
485
+ // decrypts a 128 bit input block against the given key of size specified
486
+ private static function decryptBlock($input, $key, $size){
487
+ $output = array();
488
+ $block = array(); /* the 128 bit block to decode */
489
+ $nbrRounds = self::numberOfRounds($size);
490
+ /* Set the block values, for the block:
491
+ * a0,0 a0,1 a0,2 a0,3
492
+ * a1,0 a1,1 a1,2 a1,3
493
+ * a2,0 a2,1 a2,2 a2,3
494
+ * a3,0 a3,1 a3,2 a3,3
495
+ * the mapping order is a0,0 a1,0 a2,0 a3,0 a0,1 a1,1 ... a2,3 a3,3
496
+ */
497
+ for ($i = 0; $i < 4; $i++) /* iterate over the columns */
498
+ for ($j = 0; $j < 4; $j++) /* iterate over the rows */
499
+ $block[($i+($j*4))] = $input[($i*4)+$j];
500
+ /* expand the key into an 176, 208, 240 bytes key */
501
+ $expandedKey = self::expandKey($key, $size);
502
+ /* decrypt the block using the expandedKey */
503
+ $block = self::invMain($block, $expandedKey, $nbrRounds);
504
+ for ($k = 0; $k < 4; $k++)/* unmap the block again into the output */
505
+ for ($l = 0; $l < 4; $l++)/* iterate over the rows */
506
+ $output[($k*4)+$l] = $block[($k+($l*4))];
507
+ return $output;
508
+ }
509
+ /*
510
+ * END AES SECTION
511
+ */
512
+
513
+ /*
514
+ * START MODE OF OPERATION SECTION
515
+ */
516
+ //structure of supported modes of operation
517
+ const modeOfOperation_OFB = 0;
518
+ const modeOfOperation_CFB = 1;
519
+ const modeOfOperation_CBC = 2;
520
+
521
+ // gets a properly padded block
522
+ private static function getPaddedBlock($bytesIn,$start,$end,$mode){
523
+ if($end - $start > 16)
524
+ $end = $start + 16;
525
+
526
+ $xarray = array_slice($bytesIn, $start, $end-$start);
527
+
528
+ $cpad = 16 - count($xarray);
529
+
530
+ while(count($xarray) < 16){
531
+ array_push($xarray, $cpad);
532
+ }
533
+
534
+ return $xarray;
535
+ }
536
+
537
+ /*
538
+ * Mode of Operation Encryption
539
+ * bytesIn - Input String as array of bytes
540
+ * mode - mode of type modeOfOperation
541
+ * key - a number array of length 'size'
542
+ * size - the bit length of the key
543
+ * iv - the 128 bit number array Initialization Vector
544
+ */
545
+ public static function encrypt($bytesIn, $mode, $key, $size, $iv){
546
+ if(count($key)%$size)
547
+ {
548
+ throw new Exception('Key length does not match specified size.');
549
+ }
550
+ if(count($iv)%16)
551
+ {
552
+ throw new Exception('iv length must be 128 bits.');
553
+ }
554
+ // the AES input/output
555
+ $byteArray = array();
556
+ $input = array();
557
+ $output = array();
558
+ $ciphertext = array();
559
+ $cipherOut = array();
560
+ // char firstRound
561
+ $firstRound = true;
562
+ if ($bytesIn !== null)
563
+ {
564
+ for ($j = 0;$j < ceil(count($bytesIn)/16); $j++)
565
+ {
566
+ $start = $j*16;
567
+ $end = $j*16+16;
568
+ if($j*16+16 > count($bytesIn))
569
+ $end = count($bytesIn);
570
+ $byteArray = self::getPaddedBlock($bytesIn,$start,$end,$mode);
571
+ if ($mode == self::modeOfOperation_CFB)
572
+ {
573
+ if ($firstRound)
574
+ {
575
+ $output = self::encryptBlock($iv, $key, $size);
576
+ $firstRound = false;
577
+ }
578
+ else
579
+ $output = self::encryptBlock($input, $key, $size);
580
+ for ($i = 0; $i < 16; $i++)
581
+ $ciphertext[$i] = $byteArray[$i] ^ $output[$i];
582
+ for($k = 0;$k < $end-$start;$k++)
583
+ array_push($cipherOut, $ciphertext[$k]);
584
+ $input = $ciphertext;
585
+ }
586
+ else if ($mode == self::modeOfOperation_OFB)
587
+ {
588
+ if ($firstRound)
589
+ {
590
+ $output = self::encryptBlock($iv, $key, $size);
591
+ $firstRound = false;
592
+ }
593
+ else
594
+ $output = self::encryptBlock($input, $key, $size);
595
+ for ($i = 0; $i < 16; $i++)
596
+ $ciphertext[$i] = $byteArray[$i] ^ $output[$i];
597
+ for($k = 0;$k < $end-$start;$k++)
598
+ array_push($cipherOut, $ciphertext[$k]);
599
+ $input = $output;
600
+ }
601
+ else if ($mode == self::modeOfOperation_CBC)
602
+ {
603
+ for ($i = 0; $i < 16; $i++)
604
+ $input[$i] = $byteArray[$i] ^ (($firstRound) ? $iv[$i] : $ciphertext[$i]);
605
+ $firstRound = false;
606
+ $ciphertext = self::encryptBlock($input, $key, $size);
607
+ // always 16 bytes because of the padding for CBC
608
+ for($k = 0;$k < 16;$k++)
609
+ array_push($cipherOut, $ciphertext[$k]);
610
+ }
611
+ }
612
+ }
613
+ return array('mode' => $mode, 'originalsize' => count($bytesIn), 'cipher' => $cipherOut);
614
+ }
615
+
616
+ /*
617
+ * Mode of Operation Decryption
618
+ * cipherIn - Encrypted String as array of bytes
619
+ * originalsize - The unencrypted string length - required for CBC
620
+ * mode - mode of type modeOfOperation
621
+ * key - a number array of length 'size'
622
+ * size - the bit length of the key
623
+ * iv - the 128 bit number array Initialization Vector
624
+ */
625
+ public static function decrypt($cipherIn,$originalsize,$mode,$key,$size,$iv)
626
+ {
627
+ if(count($key)%$size)
628
+ {
629
+ throw new Exception('Key length does not match specified size.');
630
+ return null;
631
+ }
632
+ if(count($iv)%16)
633
+ {
634
+ throw new Exception('iv length must be 128 bits.');
635
+ }
636
+ // the AES input/output
637
+ $ciphertext = array();
638
+ $input = array();
639
+ $output = array();
640
+ $byteArray = array();
641
+ $bytesOut = array();
642
+ // char firstRound
643
+ $firstRound = true;
644
+ if ($cipherIn !== null)
645
+ {
646
+ for ($j = 0;$j < ceil(count($cipherIn)/16); $j++)
647
+ {
648
+ $start = $j*16;
649
+ $end = $j*16+16;
650
+ if($j*16+16 > count($cipherIn))
651
+ $end = count($cipherIn);
652
+ $ciphertext = self::getPaddedBlock($cipherIn,$start,$end,$mode);
653
+ if ($mode == self::modeOfOperation_CFB)
654
+ {
655
+ if ($firstRound)
656
+ {
657
+ $output = self::encryptBlock($iv, $key, $size);
658
+ $firstRound = false;
659
+ }
660
+ else
661
+ $output = self::encryptBlock($input, $key, $size);
662
+ for ($i = 0; $i < 16; $i++)
663
+ $byteArray[$i] = $output[$i] ^ $ciphertext[$i];
664
+ for($k = 0;$k < $end-$start;$k++)
665
+ array_push($bytesOut, $byteArray[$k]);
666
+ $input = $ciphertext;
667
+ }
668
+ else if ($mode == self::modeOfOperation_OFB)
669
+ {
670
+ if ($firstRound)
671
+ {
672
+ $output = self::encryptBlock($iv, $key, $size);
673
+ $firstRound = false;
674
+ }
675
+ else
676
+ $output = self::encryptBlock($input, $key, $size);
677
+ for ($i = 0; $i < 16; $i++)
678
+ $byteArray[$i] = $output[$i] ^ $ciphertext[$i];
679
+ for($k = 0;$k < $end-$start;$k++)
680
+ array_push($bytesOut, $byteArray[$k]);
681
+ $input = $output;
682
+ }
683
+ else if($mode == self::modeOfOperation_CBC)
684
+ {
685
+ $output = self::decryptBlock($ciphertext, $key, $size);
686
+ for ($i = 0; $i < 16; $i++)
687
+ $byteArray[$i] = (($firstRound) ? $iv[$i] : $input[$i]) ^ $output[$i];
688
+ $firstRound = false;
689
+ if ($originalsize < $end)
690
+ for($k = 0;$k < $originalsize-$start;$k++)
691
+ array_push($bytesOut, $byteArray[$k]);
692
+ else
693
+ for($k = 0;$k < $end-$start;$k++)
694
+ array_push($bytesOut, $byteArray[$k]);
695
+ $input = $ciphertext;
696
+ }
697
+ }
698
+ }
699
+ return $bytesOut;
700
+ }
701
+ /*
702
+ * END MODE OF OPERATION SECTION
703
+ */
704
+ }
705
+
706
+ ?>
includes/blocks/wplc-chat-box/editor.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .wplc_block{position:relative;display:inline-block;background:#32373c;color:#eee;border-radius:3px;height:35px;padding-left:40px;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_block.disabled: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}
includes/blocks/wplc-chat-box/style.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #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}
includes/blocks/wplc-chat-box/wplc_gutenberg_template_styles.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #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}.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}
includes/blocks/wplc-inline-chat-box/editor.min.css ADDED
@@ -0,0 +1 @@
 
1
+ @keyframes wplc_fade_in{0%{opacity:0;padding-top:20px}100%{opacity:1}}#wplc-inline-chat-box .wplc_gutenberg_icon{animation:wplc_fade_in .3s;color:#ff4d4d;display:block;margin:30px auto;font-size:50px}.wplc_gutenberg_chat_box{border:1px solid #eee;height:500px;width:320px;border-radius:6px;position:relative;display:inline-block;margin-top:0}.wplc_gutenberg_button{width:60px;height:60px;background-size:cover;background-repeat:no-repeat;border-radius:50%;margin-bottom:10px;margin-right:10px;display:inline-block;cursor:pointer}.wplc_gutenberg_header{border-radius:6px 6px 0 0;height:80px;width:100%;background:#ddd}.wplc_gutenberg_text_box{position:absolute;bottom:0;left:0;width:100%;height:60px;background:#fff;border-bottom-right-radius:10px;border-bottom-left-radius:10px;box-shadow:0 0 40px 1px rgba(0,0,0,.07)}.wplc_gutenberg_avatar{display:inline-block;margin:10px;margin-left:35px}.wplc_gutenberg_avatar img{border-radius:50%}.wplc_gutenberg_name{display:inline-block;bottom:24px;font-weight:600;color:#fff;position:absolute}.wplc_gutenberg_header{position:relative;box-shadow:0 5px 20px -2px rgba(0,0,0,.16)}.wplc_gutenberg_chevron{position:absolute;right:10px;bottom:10px;font-size:24px;color:#fff;cursor:pointer}.wplc_gutenberg_overlay_image{width:100%;height:100%;position:absolute;top:0;left:0;border-radius:6px 6px 0 0;background-size:cover}.wplc_gutenberg_text_box{line-height:60px;padding-left:30px;color:#2b2b2b;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:400;font-size:12px}.wplc_gutenberg_body{width:100%;height:100%;background-size:cover;background-repeat:repeat;position:absolute;top:0;left:0;z-index:-1}.wplc_gutenberg_loader{border:7px solid #f3f3f3;border-top:7px solid #ed832f;border-radius:50%;width:50px;height:50px;animation:wplc_spin 2s linear infinite;display:block;margin:0 auto}@keyframes wplc_spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes wplc_fade_in{0%{opacity:0;padding-top:20px}100%{opacity:1}}.wplc_gutenberg_button,.wplc_gutenberg_chat_box,.wplc_gutenberg_preview{animation:wplc_fade_in .3s}.wplc_gutenberg_button{transition:all .4s ease-in-out;margin-bottom:0}.wplc_select_theme{margin-bottom:10px;width:150px;display:block}.wplc_center .wplc_gutenberg_chat_box{margin:0 auto;display:block}.wplc_center .wplc_gutenberg_button{margin:0 auto;display:block;margin-bottom:10px}.wplc_wide .wplc_gutenberg_chat_box{width:100%;margin-top:0}.wplc_wide .wplc_gutenberg_button{margin-bottom:0}
includes/blocks/wplc-inline-chat-box/style.min.css ADDED
File without changes
includes/credits.php DELETED
@@ -1,91 +0,0 @@
1
-
2
- <p class="about-description"><?php _e("WP Live Chat Support is supported by an international team of developers.","wp-google-maps"); ?></p>
3
- <h3 class="wp-people-group"><?php _e("Project Leaders","wplivechat"); ?></h3>
4
- <ul class="wp-people-group " id="wp-people-group-project-leaders">
5
-
6
- <li class="wp-person" id="wp-person-nickduncan">
7
- <a href="https://profiles.wordpress.org/nickduncan/" target="_BLANK" class="web"><img src="https://avatars3.githubusercontent.com/u/16645118?s=460&v=4" srcset="https://avatars3.githubusercontent.com/u/16645118?s=460&v=4" class="gravatar" alt="">
8
- Nick Duncan</a>
9
- <span class="title"><?php _e("Founder","wplivechat"); ?>, <?php _e("Developer","wplivechat"); ?>, <?php _e("Support","wplivechat"); ?></span>
10
- </li>
11
- <li class="wp-person" id="wp-person-dylanauty">
12
- <a href="https://profiles.wordpress.org/dylanauty/" target="_BLANK" class="web"><img src="https://avatars2.githubusercontent.com/u/16894783?s=460&v=4" srcset="https://avatars2.githubusercontent.com/u/16894783?s=460&v=4" class="gravatar" alt="">
13
- Dylan Auty</a>
14
- <span class="title"><?php _e("Project Manager","wplivechat"); ?>, <?php _e("Developer","wplivechat"); ?>, <?php _e("Support","wplivechat"); ?></span>
15
- </li>
16
- </ul>
17
- <h3 class="wp-people-group"><?php _e("Contributors","wplivechat"); ?></h3>
18
- <ul class="wp-people-group " id="wp-people-group-core-developers">
19
-
20
-
21
-
22
-
23
- <li class="wp-person" id="wp-person-jarek">
24
- <a href="https://github.com/JarekCodeCabin" target="_BLANK" class="web"><img src="https://avatars3.githubusercontent.com/u/25925938?s=460&v=4" srcset="https://avatars3.githubusercontent.com/u/25925938?s=460&v=4 2x" class="gravatar" alt="">
25
- Jarek Kacprzak</a>
26
- <span class="title"><?php _e("Developer","wplivechat"); ?>, <?php _e("Support","wplivechat"); ?>, <?php _e("Testing","wplivechat"); ?></span>
27
- </li>
28
-
29
- <li class="wp-person" id="wp-person-perry">
30
- <a href="https://github.com/PerryRylance" target="_BLANK" class="web"><img src="https://avatars2.githubusercontent.com/u/14136738?s=460&v=4" srcset="https://avatars2.githubusercontent.com/u/14136738?s=460&v=4 2x" class="gravatar" alt="">
31
- Perry Rylance</a>
32
- <span class="title"><?php _e("Developer","wplivechat"); ?>, <?php _e("Support","wplivechat"); ?>, <?php _e("Testing","wplivechat"); ?></span>
33
- </li>
34
-
35
- <li class="wp-person" id="wp-person-dylankotze">
36
- <a href="https://github.com/dylandrake616" target="_BLANK" class="web"><img src="https://avatars2.githubusercontent.com/u/25743655?s=460&v=4" srcset="https://avatars2.githubusercontent.com/u/25743655?s=460&v=4 2x" class="gravatar" alt="">
37
- Dylan Kotze</a>
38
- <span class="title"><?php _e("Developer","wplivechat"); ?>, <?php _e("Support","wplivechat"); ?>, <?php _e("Testing","wplivechat"); ?></span>
39
- </li>
40
-
41
-
42
- <li class="wp-person" id="wp-person-nathanmiller">
43
- <a href="https://profiles.wordpress.org/nathan-miller/" target="_BLANK" class="web"><img src="https://ca.slack-edge.com/T0CCUAUDD-U0CDJ724Q-g4e0ca967af9-1024" srcset="https://ca.slack-edge.com/T0CCUAUDD-U0CDJ724Q-g4e0ca967af9-1024" class="gravatar" alt="">
44
- Nathan Miller</a>
45
- <span class="title"><?php _e("Support","wplivechat"); ?></span>
46
- </li>
47
-
48
- <li class="wp-person" id="wp-person-tamduncan">
49
- <a href="https://twitter.com/thebossybabe" target="_BLANK" class="web"><img src="https://pbs.twimg.com/profile_images/378800000229252467/623181616d530dc6e8088939814b0f5d_400x400.jpeg" srcset="https://pbs.twimg.com/profile_images/378800000229252467/623181616d530dc6e8088939814b0f5d_400x400.jpeg" class="gravatar" alt="">
50
- Tam Duncan</a>
51
- <span class="title"><?php _e("Marketing","wplivechat"); ?></span>
52
- </li>
53
-
54
- <li class="wp-person" id="wp-person-trevoranderson">
55
- <a href="https://github.com/andtrev" target="_BLANK" class="web"><img src="https://avatars3.githubusercontent.com/u/13884866?s=460&v=4" srcset="https://avatars3.githubusercontent.com/u/13884866?s=460&v=4" class="gravatar" alt="">
56
- Trevor Anderson</a>
57
- <span class="title"><?php _e("Developer","wplivechat"); ?>, <?php _e("Support","wplivechat"); ?></span>
58
- </li>
59
-
60
- <li class="wp-person" id="wp-person-diegosilva">
61
- <a href="https://github.com/DiegoSilva776" target="_BLANK" class="web"><img src="https://avatars0.githubusercontent.com/u/14262235?s=460&v=4" srcset="https://avatars0.githubusercontent.com/u/14262235?s=460&v=4" class="gravatar" alt="">
62
- Diego Silva</a>
63
- <span class="title"><?php _e("Developer","wplivechat"); ?>, <?php _e("Support","wplivechat"); ?></span>
64
- </li>
65
-
66
- <li class="wp-person" id="wp-person-veroniquesmit">
67
- <a href="https://twitter.com/veroniqs19" target="_BLANK" class="web"><img src="https://avatars3.githubusercontent.com/u/22832458?s=460&v=4" srcset="https://avatars3.githubusercontent.com/u/22832458?s=460&v=4" class="gravatar" alt="">
68
- Veronique Smit</a>
69
- <span class="title"><?php _e("Marketing &amp; Support","wplivechat"); ?></span>
70
- </li>
71
-
72
- <li class="wp-person" id="wp-person-patdumond">
73
- <a href="https://twitter.com/pad2013" target="_BLANK" class="web"><img src="https://en.gravatar.com/avatar/c1aa6c52ca1f5948aba6c9f4aee18de1?s=60&amp;d=mm&amp;r=g" srcset="http://1.gravatar.com/avatar/c1aa6c52ca1f5948aba6c9f4aee18de1?s=120&amp;d=mm&amp;r=g 2x" class="gravatar" alt="">
74
- Patricia Dumond</a>
75
- <span class="title"><?php _e("Testing","wplivechat"); ?>, <?php _e("Documentation","wplivechat"); ?></span>
76
- </li>
77
-
78
- <li class="wp-person" id="wp-person-omaid">
79
- <a href="https://github.com/omaidf" target="_BLANK" class="web"><img src="https://avatars3.githubusercontent.com/u/11565994?s=460&v=4" srcset="https://avatars3.githubusercontent.com/u/11565994?s=460&v=4 2x" class="gravatar" alt="">
80
- Omaid Faizyar</a>
81
- <span class="title"><?php _e("InfoSec","wplivechat"); ?></span>
82
- </li>
83
- <li class="wp-person" id="wp-person-jafjuliana">
84
- <a href="https://github.com/jafjuliana" target="_BLANK" class="web"><img src="https://avatars1.githubusercontent.com/u/10279981?s=460&v=4" srcset="https://avatars1.githubusercontent.com/u/10279981?s=460&v=4 2x" class="gravatar" alt="">
85
- Juliana Assalti</a>
86
- <span class="title"><?php _e("CSS","wplivechat"); ?></span>
87
- </li>
88
-
89
- <p class="clear"><?php _e("Want to see your name on this page?","wplivechat"); ?> <a href="https://github.com/CodeCabin/wp-live-chat-support/" target="_BLANK" ><?php _e("Get involved on GitHub.","wplivechat"); ?></a></p>
90
-
91
- <a class="button-primary" style='padding:10px; height:inherit;' href="admin.php?page=wplivechat-menu&override=1"><?php echo __("OK! Let's start","wplivechat"); ?></a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/cryptoHelpers.php ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * cryptoHelpers.php: implements AES - Advanced Encryption Standard
5
+ * from the SlowAES project, http://code.google.com/p/slowaes/
6
+ *
7
+ * Copyright (c) 2008 Josh Davis ( http://www.josh-davis.org ),
8
+ * Mark Percival ( http://mpercival.com ),
9
+ * Johan Sundstrom ( http://ecmanaut.blogspot.com ),
10
+ * John Resig ( http://ejohn.org )
11
+ *
12
+ * Ported from JavaScript to PHP by ALeX Kazik
13
+ *
14
+ * Licensed under the Apache License, Version 2.0
15
+ * http://www.apache.org/licenses/
16
+ */
17
+
18
+ class cryptoHelpers {
19
+ /*
20
+ for utf8 en-/decoding see:
21
+ http://www.php.net/manual/en/function.utf8-encode.php
22
+ http://www.php.net/manual/en/function.iconv.php
23
+ http://www.php.net/manual/en/function.mb-convert-encoding.php
24
+ */
25
+
26
+ //convert a number array to a hex string
27
+ public static function toHex($args){
28
+ if(func_num_args() != 1 || !is_array($args)){
29
+ $args = func_get_args();
30
+ }
31
+ $ret = '';
32
+ for($i = 0; $i < count($args) ;$i++)
33
+ $ret .= sprintf('%02x', $args[$i]);
34
+ return $ret;
35
+ }
36
+
37
+ //convert a hex string to a number array
38
+ public static function toNumbers($s){
39
+ $ret = array();
40
+ for($i=0; $i<strlen($s); $i+=2){
41
+ $ret[] = hexdec(substr($s, $i, 2));
42
+ }
43
+ return $ret;
44
+ }
45
+
46
+ // get a random number in the range [min,max]
47
+ public static function getRandom($min,$max){
48
+ if($min === null)
49
+ $min = 0;
50
+ if($max === null)
51
+ $max = 1;
52
+ return mt_rand($min, $max);
53
+ }
54
+
55
+ public static function generateSharedKey($len){
56
+ if($len === null)
57
+ $len = 16;
58
+ $key = array();
59
+ for($i = 0; $i < $len; $i++)
60
+ $key[] = self::getRandom(0,255);
61
+ return $key;
62
+ }
63
+
64
+ public static function generatePrivateKey($s,$size){
65
+ if(function_exists('mhash') && defined('MHASH_SHA256')){
66
+ return convertStringToByteArray(substr(mhash(MHASH_SHA256, $s), 0, $size));
67
+ }else{
68
+ throw new Exception('cryptoHelpers::generatePrivateKey currently requires mhash');
69
+ }
70
+ }
71
+
72
+ public static function convertStringToByteArray($s){
73
+ $byteArray = array();
74
+ for($i = 0; $i < strlen($s); $i++){
75
+ $byteArray[] = ord($s[$i]);
76
+ }
77
+ return $byteArray;
78
+ }
79
+
80
+ public static function convertByteArrayToString($byteArray){
81
+ $s = '';
82
+ for($i = 0; $i < count($byteArray); $i++){
83
+ $s .= chr($byteArray[$i]);
84
+ }
85
+ return $s;
86
+ }
87
+
88
+ public static function base64_encode_line($b){
89
+ return base64_encode(self::convertByteArrayToString($b));
90
+ }
91
+
92
+ public static function base64_encode($b){
93
+ $b64 = self::base64_encode_line($b);
94
+ return chunk_split($b, 64, "\n");
95
+ }
96
+
97
+ public static function base64_decode($b){
98
+ return self::convertStringToByteArray(base64_decode($b));
99
+ }
100
+ };
includes/css/wplc_trigger_styles .min.css ADDED
@@ -0,0 +1 @@
 
1
+ #wplc_hovercard_content{height:auto!important;display:block!important}#wplc_hovercard{height:auto!important}@media screen and (min-height:800px){#wplc_hovercard_content{max-height:80vh;overflow-y:auto;overflow-x:hidden}}@media screen and (max-height:800px){#wplc_hovercard_content{max-height:60vh;overflow-y:auto;overflow-x:hidden}}@media screen and (max-height:400px){#wplc_hovercard_content{max-height:40vh;overflow-y:auto;overflow-x:hidden}}
includes/css/wplc_trigger_styles.css ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #wplc_hovercard_content{
2
+ height: auto !important;
3
+ display: block !important;
4
+ }
5
+ #wplc_hovercard{
6
+ height: auto !important;
7
+ }
8
+
9
+ @media screen and (min-height: 800px) {
10
+ #wplc_hovercard_content {
11
+ max-height: 80vh;
12
+ overflow-y: auto;
13
+ overflow-x: hidden;
14
+ }
15
+ }
16
+
17
+ @media screen and (max-height: 800px) {
18
+ #wplc_hovercard_content {
19
+ max-height: 60vh;
20
+ overflow-y: auto;
21
+ overflow-x: hidden;
22
+ }
23
+ }
24
+
25
+ @media screen and (max-height: 400px) {
26
+ #wplc_hovercard_content {
27
+ max-height: 40vh;
28
+ overflow-y: auto;
29
+ overflow-x: hidden;
30
+ }
31
+ }
includes/dashboard_page.php CHANGED
@@ -1,8 +1,5 @@
1
  <script>
2
  var nifty_api_key = '<?php echo get_option("wplc_node_server_secret_token"); ?>';
3
-
4
-
5
-
6
  </script>
7
 
8
  <?php
1
  <script>
2
  var nifty_api_key = '<?php echo get_option("wplc_node_server_secret_token"); ?>';
 
 
 
3
  </script>
4
 
5
  <?php
includes/deprecated.php DELETED
@@ -1,433 +0,0 @@
1
- <?php
2
- /* will soon become deprecated */
3
- function wplc_output_box_ajax() {
4
-
5
-
6
- if(function_exists('wplc_display_chat_contents')){
7
- $display_contents = wplc_display_chat_contents();
8
- } else {
9
- $display_contents = 1;
10
- }
11
-
12
- if(function_exists('wplc_is_user_banned')){
13
- $user_banned = wplc_is_user_banned();
14
- } else if (function_exists('wplc_is_user_banned')){
15
- $user_banned = wplc_is_user_banned_basic();
16
- } else {
17
- $user_banned = 0;
18
- }
19
- if($display_contents && $user_banned == 0){
20
-
21
-
22
- /* do not show if pro is outdated */
23
- global $wplc_pro_version;
24
- if (isset($wplc_pro_version)) {
25
- $float_version = floatval($wplc_pro_version);
26
- if ($float_version < 4 || $wplc_pro_version == "4.1.0" || $wplc_pro_version == "4.1.1") {
27
- return "";
28
- }
29
- }
30
-
31
- if (function_exists("wplc_register_pro_version")) {
32
- $wplc_settings = get_option("WPLC_SETTINGS");
33
- if (!class_exists('Mobile_Detect')) {
34
- require_once (plugin_dir_path(__FILE__) . 'Mobile_Detect.php');
35
- }
36
- $wplc_detect_device = new Mobile_Detect;
37
- $wplc_is_mobile = $wplc_detect_device->isMobile();
38
- if ($wplc_is_mobile && !isset($wplc_settings['wplc_enabled_on_mobile']) && $wplc_settings['wplc_enabled_on_mobile'] != 1) {
39
- return "";
40
- }
41
- if (function_exists('wplc_hide_chat_when_offline')) {
42
- $wplc_hide_chat = wplc_hide_chat_when_offline();
43
- if (!$wplc_hide_chat) {
44
- $draw_box = true;
45
- }
46
- } else {
47
- $draw_box = true;
48
- }
49
- } else {
50
- $draw_box = true;
51
- }
52
- }
53
-
54
-
55
-
56
- if ($draw_box) {
57
- $wplc_class = "";
58
- $ret_msg = "";
59
- $wplc_settings = get_option("WPLC_SETTINGS");
60
-
61
- if ($wplc_settings["wplc_settings_enabled"] == 2) {
62
- return;
63
- }
64
-
65
- if ($wplc_settings["wplc_settings_align"] == 1) {
66
- $original_pos = "bottom_left";
67
- //$wplc_box_align = "left:100px; bottom:0px;";
68
- $wplc_box_align = "bottom:0px;";
69
- } else if ($wplc_settings["wplc_settings_align"] == 2) {
70
- $original_pos = "bottom_right";
71
- //$wplc_box_align = "right:100px; bottom:0px;";
72
- $wplc_box_align = "bottom:0px;";
73
- } else if ($wplc_settings["wplc_settings_align"] == 3) {
74
- $original_pos = "left";
75
- // $wplc_box_align = "left:0; bottom:100px;";
76
- $wplc_box_align = " bottom:100px;";
77
- $wplc_class = "wplc_left";
78
- } else if ($wplc_settings["wplc_settings_align"] == 4) {
79
- $original_pos = "right";
80
- // $wplc_box_align = "right:0; bottom:100px;";
81
- $wplc_box_align = "bottom:100px;";
82
- $wplc_class = "wplc_right";
83
- }
84
-
85
- if (isset($wplc_settings["wplc_settings_fill"])) {
86
- $wplc_settings_fill = "#" . $wplc_settings["wplc_settings_fill"];
87
- } else {
88
- $wplc_settings_fill = "#ed832f";
89
- }
90
- if (isset($wplc_settings["wplc_settings_font"])) {
91
- $wplc_settings_font = "#" . $wplc_settings["wplc_settings_font"];
92
- } else {
93
- $wplc_settings_font = "#FFFFFF";
94
- }
95
-
96
- $wplc_is_admin_logged_in = get_transient("wplc_is_admin_logged_in");
97
- if (!function_exists("wplc_register_pro_version") && $wplc_is_admin_logged_in != 1) {
98
- $ret_msg = "";
99
- }
100
-
101
- if(function_exists('wplc_pro_activate')){
102
- if(function_exists('wplc_return_animations')){
103
-
104
- $animations = wplc_return_animations();
105
-
106
- isset($animations['animation']) ? $wplc_animation = $animations['animation'] : $wplc_animation = 'animation-4';
107
- isset($animations['starting_point']) ? $wplc_starting_point = $animations['starting_point'] : $wplc_starting_point = 'display: none;';
108
- isset($animations['box_align']) ? $wplc_box_align = $animations['box_align'] : $wplc_box_align = '';
109
-
110
- } else {
111
-
112
- }
113
- } else {
114
-
115
- $wplc_starting_point = '';
116
- $wplc_animation = '';
117
-
118
- if ($wplc_settings["wplc_settings_align"] == 1) {
119
- $original_pos = "bottom_left";
120
- $wplc_box_align = "left:100px; bottom:0px;";
121
- } else if ($wplc_settings["wplc_settings_align"] == 2) {
122
- $original_pos = "bottom_right";
123
- $wplc_box_align = "right:100px; bottom:0px;";
124
- } else if ($wplc_settings["wplc_settings_align"] == 3) {
125
- $original_pos = "left";
126
- $wplc_box_align = "left:0; bottom:100px;";
127
- $wplc_class = "wplc_left";
128
- } else if ($wplc_settings["wplc_settings_align"] == 4) {
129
- $original_pos = "right";
130
- $wplc_box_align = "right:0; bottom:100px;";
131
- $wplc_class = "wplc_right";
132
- }
133
-
134
- }
135
-
136
- if (isset($wplc_settings['wplc_auto_pop_up'])) { $wplc_auto_popup = $wplc_settings['wplc_auto_pop_up']; } else { $wplc_auto_popup = "" ;}
137
- $ret_msg .= "<div id=\"wp-live-chat\" wplc_animation=\"".$wplc_animation."\" style=\"".$wplc_starting_point." ".$wplc_box_align.";\" class=\"".$wplc_class." wplc_close\" original_pos=\"".$original_pos."\" wplc-auto-pop-up=\"". $wplc_auto_popup."\" > ";
138
-
139
- if (function_exists("wplc_pro_output_box_ajax")) {
140
- $ret_msg .= wplc_pro_output_box_ajax();
141
- } else {
142
-
143
- $ret_msg .= "<div class=\"wp-live-chat-wraper\">";
144
- $ret_msg .= "<div id=\"wp-live-chat-header\" style=\"background-color: ".$wplc_settings_fill." !important; color: ".$wplc_settings_font." !important; \">";
145
- $ret_msg .= "<i id=\"wp-live-chat-minimize\" class=\"fa fa-minus\" style=\"display:none;\" ></i>";
146
-
147
- $ret_msg .= "<i id=\"wp-live-chat-close\" class=\"fa fa-times\" style=\"display:none;\" ></i>";
148
-
149
- $ret_msg .= " <div id=\"wp-live-chat-1\" >";
150
- $ret_msg .= "<div style=\"display:block; \">";
151
- $ret_msg .= "<strong>".__("Questions?", "wplivechat")."</strong> ".__("Chat with us", "wplivechat");
152
- $ret_msg .= "</div>";
153
- $ret_msg .= "</div>";
154
- $ret_msg .= "</div>";
155
-
156
- $ret_msg .= "<div id=\"wp-live-chat-2\" style=\"display:none;\">";
157
- $ret_msg .= "<div id=\"wp-live-chat-2-info\">";
158
- $ret_msg .= "<strong>".__('Start Live Chat', 'wplivechat')."</strong>";
159
- $ret_msg .= "</div>";
160
-
161
- if (isset($wplc_settings['wplc_loggedin_user_info']) && $wplc_settings['wplc_loggedin_user_info'] == 1) {
162
- $wplc_use_loggedin_user_details = 1;
163
- } else {
164
- $wplc_use_loggedin_user_details = 0;
165
- }
166
-
167
- $wplc_loggedin_user_name = "";
168
- $wplc_loggedin_user_email = "";
169
-
170
- if ($wplc_use_loggedin_user_details == 1) {
171
- global $current_user;
172
-
173
- if ($current_user->data != null) {
174
- //Logged in. Get name and email
175
- $wplc_loggedin_user_name = $current_user->user_nicename;
176
- $wplc_loggedin_user_email = $current_user->user_email;
177
- }
178
- } else {
179
- $wplc_loggedin_user_name = '';
180
- $wplc_loggedin_user_email = '';
181
- }
182
-
183
- if (isset($wplc_settings['wplc_require_user_info']) && $wplc_settings['wplc_require_user_info'] == 1) {
184
- $wplc_ask_user_details = 1;
185
- } else {
186
- $wplc_ask_user_details = 0;
187
- }
188
-
189
- if ($wplc_ask_user_details == 1) {
190
- //Ask the user to enter name and email
191
-
192
- $ret_msg .= "<input type=\"text\" name=\"wplc_name\" id=\"wplc_name\" value='".$wplc_loggedin_user_name."' placeholder=\"".__("Name", "wplivechat")."\" />";
193
- $ret_msg .= "<input type=\"text\" name=\"wplc_email\" id=\"wplc_email\" wplc_hide=\"0\" value=\"".$wplc_loggedin_user_email."\" placeholder=\"".__("Email", "wplivechat")."\" />";
194
- } else {
195
- //Dont ask the user
196
- $ret_msg .= "<div style=\"padding: 7px; text-align: center;\">";
197
- if (isset($wplc_settings['wplc_user_alternative_text'])) {
198
- $ret_msg .= stripslashes($wplc_settings['wplc_user_alternative_text']);
199
- }
200
- $ret_msg .= '</div>';
201
-
202
- $wplc_random_user_number = rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9);
203
- //$wplc_loggedin_user_email = $wplc_random_user_number."@".$wplc_random_user_number.".com";
204
- if ($wplc_loggedin_user_name != '') { $wplc_lin = $wplc_loggedin_user_name; } else { $wplc_lin = 'user' . $wplc_random_user_number; }
205
- if ($wplc_loggedin_user_email != '' && $wplc_loggedin_user_email != null) { $wplc_lie = $wplc_loggedin_user_email; } else { $wplc_lie = $wplc_random_user_number . '@' . $wplc_random_user_number . '.com'; }
206
- $ret_msg .= "<input type=\"hidden\" name=\"wplc_name\" id=\"wplc_name\" value=\"".$wplc_lin."\" />";
207
- $ret_msg .= "<input type=\"hidden\" name=\"wplc_email\" id=\"wplc_email\" wplc_hide=\"1\" value=\"".$wplc_lie."\" />";
208
- }
209
-
210
- $ret_msg .= "<input id=\"wplc_start_chat_btn\" type=\"button\" value=\"".__("Start Chat", "wplivechat")."\" style=\"background-color: ".$wplc_settings_fill." !important; color: ".$wplc_settings_font." !important;\"/>";
211
- $ret_msg .= "</div>";
212
- $ret_msg .= "<div id=\"wp-live-chat-3\" style=\"display:none;\">";
213
- $ret_msg .= "<p>".__("Connecting you to a sales person. Please be patient.", "wplivechat")."</p>";
214
- $ret_msg .= "</div>";
215
- $ret_msg .= "<div id=\"wp-live-chat-react\" style=\"display:none;\">";
216
- $ret_msg .= "<p>".__("Reactivating your previous chat...", "wplivechat")."</p>";
217
- $ret_msg .= "</div>";
218
- $ret_msg .= "<div id=\"wp-live-chat-4\" style=\"display:none;\">";
219
- $ret_msg .= "<div id=\"wplc_sound_update\" style=\"height:0; width:0; display:none; border:0;\"></div>";
220
- $ret_msg .= "<div id=\"wplc_chatbox\"></div>";
221
- $ret_msg .= "<p style=\"text-align:center; font-size:11px;\">".__("Press ENTER to send your message", "wplivechat")."</p>";
222
- $ret_msg .= "<p>";
223
- $ret_msg .= "<input type=\"text\" name=\"wplc_chatmsg\" id=\"wplc_chatmsg\" value=\"\" />";
224
- $ret_msg .= "<input type=\"hidden\" name=\"wplc_cid\" id=\"wplc_cid\" value=\"\" />";
225
- $ret_msg .= "<input id=\"wplc_send_msg\" type=\"button\" value=\"".__("Send", "wplivechat")."\" style=\"display:none;\" />";
226
- $ret_msg .= "</p>";
227
- $ret_msg .= "</div>";
228
- $ret_msg .= "</div>";
229
- }
230
- $ret_msg .= "</div>";
231
- return json_encode($ret_msg);
232
- } else {
233
- return "";
234
- }
235
-
236
-
237
- }
238
-
239
-
240
-
241
- function wplc_draw_user_box() {
242
-
243
-
244
- if(function_exists('wplc_display_chat_contents')){
245
- if(wplc_display_chat_contents() >= 1){
246
- wplc_output_box();
247
- }
248
- } else {
249
- wplc_output_box();
250
- }
251
-
252
- }
253
-
254
-
255
- function wplc_output_box() {
256
- $wplc_class = "";
257
- $wplc_settings = get_option("WPLC_SETTINGS");
258
-
259
- if ($wplc_settings["wplc_settings_enabled"] == 2) {
260
- return;
261
- }
262
-
263
- if ($wplc_settings["wplc_settings_align"] == 1) {
264
- $original_pos = "bottom_left";
265
- //$wplc_box_align = "left:100px; bottom:0px;";
266
- $wplc_box_align = "bottom:0px;";
267
- } else if ($wplc_settings["wplc_settings_align"] == 2) {
268
- $original_pos = "bottom_right";
269
- //$wplc_box_align = "right:100px; bottom:0px;";
270
- $wplc_box_align = "bottom:0px;";
271
- } else if ($wplc_settings["wplc_settings_align"] == 3) {
272
- $original_pos = "left";
273
- // $wplc_box_align = "left:0; bottom:100px;";
274
- $wplc_box_align = " bottom:100px;";
275
- $wplc_class = "wplc_left";
276
- } else if ($wplc_settings["wplc_settings_align"] == 4) {
277
- $original_pos = "right";
278
- // $wplc_box_align = "right:0; bottom:100px;";
279
- $wplc_box_align = "bottom:100px;";
280
- $wplc_class = "wplc_right";
281
- }
282
-
283
- if ($wplc_settings["wplc_settings_fill"]) {
284
- $wplc_settings_fill = "#" . $wplc_settings["wplc_settings_fill"];
285
- } else {
286
- $wplc_settings_fill = "#ed832f";
287
- }
288
- if ($wplc_settings["wplc_settings_font"]) {
289
- $wplc_settings_font = "#" . $wplc_settings["wplc_settings_font"];
290
- } else {
291
- $wplc_settings_font = "#FFFFFF";
292
- }
293
-
294
- $wplc_is_admin_logged_in = get_transient("wplc_is_admin_logged_in");
295
- if (!function_exists("wplc_register_pro_version") && $wplc_is_admin_logged_in != 1) {
296
- return "";
297
- }
298
-
299
- if(function_exists('wplc_pro_activate')){
300
- if(function_exists('wplc_return_animations')){
301
-
302
- $animations = wplc_return_animations();
303
-
304
- isset($animations['animation']) ? $wplc_animation = $animations['animation'] : $wplc_animation = 'animation-4';
305
- isset($animations['starting_point']) ? $wplc_starting_point = $animations['starting_point'] : $wplc_starting_point = 'display: none;';
306
- isset($animations['box_align']) ? $wplc_box_align = $animations['box_align'] : $wplc_box_align = '';
307
-
308
- } else {
309
-
310
- }
311
- } else {
312
-
313
- $wplc_starting_point = '';
314
- $wplc_animation = '';
315
-
316
- if ($wplc_settings["wplc_settings_align"] == 1) {
317
- $original_pos = "bottom_left";
318
- $wplc_box_align = "left:100px; bottom:0px;";
319
- } else if ($wplc_settings["wplc_settings_align"] == 2) {
320
- $original_pos = "bottom_right";
321
- $wplc_box_align = "right:100px; bottom:0px;";
322
- } else if ($wplc_settings["wplc_settings_align"] == 3) {
323
- $original_pos = "left";
324
- $wplc_box_align = "left:0; bottom:100px;";
325
- $wplc_class = "wplc_left";
326
- } else if ($wplc_settings["wplc_settings_align"] == 4) {
327
- $original_pos = "right";
328
- $wplc_box_align = "right:0; bottom:100px;";
329
- $wplc_class = "wplc_right";
330
- }
331
-
332
- }
333
- /* here */
334
- ?>
335
- <div id="wp-live-chat" wplc_animation='<?php echo $wplc_animation; ?>' style="<?php echo $wplc_starting_point." ".$wplc_box_align; ?>; " class="<?php echo $wplc_class; ?> wplc_close" original_pos="<?php echo $original_pos; ?>" wplc-auto-pop-up="<?php if (isset($wplc_settings['wplc_auto_pop_up'])) { echo $wplc_settings['wplc_auto_pop_up']; } ?>" >
336
- <?php
337
- if (function_exists("wplc_register_pro_version")) {
338
- wplc_pro_output_box();
339
- } else {
340
- ?>
341
- <div class="wp-live-chat-wraper">
342
- <div id="wp-live-chat-header" style="background-color: <?php echo $wplc_settings_fill; ?> !important; color: <?php echo $wplc_settings_font; ?> !important; ">
343
- <i id="wp-live-chat-minimize" class="fa fa-minus" style="display:none;" ></i>
344
- <i id="wp-live-chat-close" class="fa fa-times" style="display:none;" ></i>
345
-
346
- <div id="wp-live-chat-1" >
347
- <div style="display:block; ">
348
- <strong><?php _e("Questions?", "wplivechat") ?></strong> <?php _e("Chat with us", "wplivechat") ?>
349
- </div>
350
- </div>
351
- </div>
352
-
353
- <div id="wp-live-chat-2" style="display:none;">
354
- <div id="wp-live-chat-2-info">
355
- <strong><?php _e('Start Live Chat', 'wplivechat'); ?></strong>
356
- </div>
357
- <?php
358
- $wplc_settings = get_option("WPLC_SETTINGS");
359
-
360
- if (isset($wplc_settings['wplc_loggedin_user_info']) && $wplc_settings['wplc_loggedin_user_info'] == 1) {
361
- $wplc_use_loggedin_user_details = 1;
362
- } else {
363
- $wplc_use_loggedin_user_details = 0;
364
- }
365
-
366
- $wplc_loggedin_user_name = "";
367
- $wplc_loggedin_user_email = "";
368
-
369
- if ($wplc_use_loggedin_user_details == 1) {
370
- global $current_user;
371
-
372
- if ($current_user->data != null) {
373
- //Logged in. Get name and email
374
- $wplc_loggedin_user_name = $current_user->user_nicename;
375
- $wplc_loggedin_user_email = $current_user->user_email;
376
- }
377
- } else {
378
- $wplc_loggedin_user_name = '';
379
- $wplc_loggedin_user_email = '';
380
- }
381
-
382
- if (isset($wplc_settings['wplc_require_user_info']) && $wplc_settings['wplc_require_user_info'] == 1) {
383
- $wplc_ask_user_details = 1;
384
- } else {
385
- $wplc_ask_user_details = 0;
386
- }
387
-
388
- if ($wplc_ask_user_details == 1) {
389
- //Ask the user to enter name and email
390
- ?>
391
- <input type="text" name="wplc_name" id="wplc_name" value="<?php echo $wplc_loggedin_user_name; ?>" placeholder="<?php _e("Name", "wplivechat"); ?>" />
392
- <input type="text" name="wplc_email" id="wplc_email" wplc_hide="0" value="<?php echo $wplc_loggedin_user_email; ?>" placeholder="<?php _e("Email", "wplivechat"); ?>" />
393
- <?php
394
- } else {
395
- //Dont ask the user
396
- echo '<div style="padding: 7px; text-align: center;">';
397
- if (isset($wplc_settings['wplc_user_alternative_text'])) {
398
- echo stripslashes($wplc_settings['wplc_user_alternative_text']);
399
- }
400
- echo '</div>';
401
-
402
- $wplc_random_user_number = rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9);
403
- //$wplc_loggedin_user_email = $wplc_random_user_number."@".$wplc_random_user_number.".com";
404
- ?>
405
- <input type="hidden" name="wplc_name" id="wplc_name" value="<?php if ($wplc_loggedin_user_name != '') { echo $wplc_loggedin_user_name; } else { echo 'user' . $wplc_random_user_number; } ?>" />
406
- <input type="hidden" name="wplc_email" id="wplc_email" wplc_hide="1" value="<?php if ($wplc_loggedin_user_email != '' && $wplc_loggedin_user_email != null) { echo $wplc_loggedin_user_email; } else { echo $wplc_random_user_number . '@' . $wplc_random_user_number . '.com'; } ?>" />
407
- <?php
408
- }
409
- ?>
410
- <input id="wplc_start_chat_btn" type="button" value="<?php _e("Start Chat", "wplivechat"); ?>" style="background-color: <?php echo $wplc_settings_fill; ?> !important; color: <?php echo $wplc_settings_font; ?> !important;"/>
411
- </div>
412
- <div id="wp-live-chat-3" style="display:none;">
413
- <p><?php _e("Connecting you to a sales person. Please be patient.", "wplivechat") ?></p>
414
- </div>
415
- <div id="wp-live-chat-react" style="display:none;">
416
- <p><?php _e("Reactivating your previous chat...", "wplivechat") ?></p>
417
- </div>
418
- <div id="wp-live-chat-4" style="display:none;">
419
- <div id="wplc_sound_update" style='height:0; width:0; display:none; border:0;'></div>
420
- <div id="wplc_chatbox"></div>
421
- <p style="text-align:center; font-size:11px;"><?php _e("Press ENTER to send your message", "wplivechat") ?></p>
422
- <p>
423
- <input type="text" name="wplc_chatmsg" id="wplc_chatmsg" value="" />
424
- <input type="hidden" name="wplc_cid" id="wplc_cid" value="" />
425
- <input id="wplc_send_msg" type="button" value="<?php _e("Send", "wplivechat"); ?>" style="display:none;" />
426
- </p>
427
- </div>
428
- </div>
429
- <?php } ?>
430
- </div>
431
- <?php
432
-
433
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/documentation_suggestions.php ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action("wplc_hook_message_sent","wplc_mrg_filter_control_message_control",10,1);
3
+ function wplc_mrg_filter_control_message_control($data) {
4
+
5
+ $string = wplc_tokenise_mrg($data['msg'],'string');
6
+ $string = wplc_remove_stop_words_mrg($string);
7
+ if (count(explode(' ',$string)) >= 3) {
8
+ /* only start searching if we have 3 or more words to look for */
9
+ if (function_exists("wplc_record_chat_notification")) {
10
+
11
+
12
+ $returned_data = wplc_documentation_find_mrg($string);
13
+ if ($returned_data) {
14
+ $formatted_msg = "<div class='wplc_doc_suggestion'><h3>Are you looking for help with:</h3>";
15
+ foreach ($returned_data as $dataset) {
16
+ $formatted_msg = $formatted_msg . "<a href='".$dataset['url']."' >".$dataset['title']. "[".$dataset['proximity']."%]</a><br /><small>".$dataset['excerpt']."</small>";
17
+ }
18
+ $formatted_msg = $formatted_msg."</div>";
19
+ $suggestion_data = array(
20
+ 'cid' => $cid,
21
+ 'msg' => $msg,
22
+ 'formatted_msg' => $formatted_msg
23
+ );
24
+ wplc_record_chat_notification('doc_suggestion',$data['cid'],$suggestion_data);
25
+ }
26
+ }
27
+ }
28
+ return;
29
+ }
30
+
31
+ function wplc_documentation_find_mrg($string) {
32
+ $my_query = new WP_Query( array( 's' => $string ) );
33
+ $returned_data = array();
34
+ $i = 0;
35
+ if ( $my_query->have_posts() ) {
36
+
37
+ while ( $my_query->have_posts() ) {
38
+ $my_query->the_post();
39
+ $i++;
40
+ $pid = get_the_ID();
41
+ $returned_data[$i]['title'] = get_the_title();
42
+ $returned_data[$i]['uri'] = get_the_permalink();
43
+
44
+ $description = wplc_remove_stop_words_mrg(wplc_tokenise_mrg(get_the_content(),'string'));
45
+ $lev = levenshtein($description, $string);
46
+
47
+ $returned_data[$i]['excerpt'] = get_the_excerpt();
48
+ $returned_data[$i]['levenshtein'] = $lev;
49
+ $returned_data[$i]['proximity'] = similar_text($description, $string);
50
+
51
+ }
52
+ }
53
+ return $returned_data;
54
+
55
+
56
+
57
+
58
+ }
59
+ function wplc_remove_stop_words_mrg($string) {
60
+ $tokenised_array = explode(" ",$string);
61
+
62
+ $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");
63
+ $new_array = array();
64
+ foreach ($stopwords as $word) {
65
+ foreach ($tokenised_array as $key => $val) {
66
+ if ($val == $word) {
67
+ unset($tokenised_array[$key]);
68
+ }
69
+ preg_match('/(\s+|^)@\S+/',$val,$match);
70
+ if (isset($match[0])) {
71
+ unset($tokenised_array[$key]);
72
+ }
73
+ }
74
+ }
75
+ $cnt = 0;
76
+ foreach ($tokenised_array as $key => $val) {
77
+ $new_array[$cnt] = $val;
78
+ $cnt++;
79
+ }
80
+
81
+ return implode(" ",$new_array);
82
+
83
+ }
84
+
85
+ function wplc_tokenise_mrg($string,$method = 'array') {
86
+ $text = strtolower($string);
87
+ $matches = strip_tags(html_entity_decode($text)); // strip the rest of the HTML code
88
+ $matches = str_replace(" "," ",$matches);
89
+ $matches = preg_replace("/http(s)*:\/\/.+/i"," ",$matches);
90
+ $matches = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $matches); // remove all non-utf8 characters
91
+ $matches = preg_replace('/[,.]/', ' ', $matches); // Replace commas, hyphens etc (count them as spaces)
92
+ $matches = preg_replace('/\<script.*?\<\/script\>/ism', '', $matches); //remove script tags
93
+ $matches = preg_replace('/\<style.*?\<\/style\>/ism', '', $matches); // remove style tags
94
+ $matches = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $matches); // remove square bracket tags
95
+ $matches = strip_tags(html_entity_decode($matches)); // strip the rest of the HTML code
96
+ $matches = preg_replace('/\s+/', ' ',$matches);
97
+ $matches = str_replace("?","",$matches);
98
+ $matches = str_replace("!","",$matches);
99
+ $matches = str_replace("@","",$matches);
100
+ $matches = str_replace("#","",$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
+ if ($method == 'array') {
109
+ $matches = explode(" ",$matches);
110
+ }
111
+
112
+
113
+ return $matches;
114
+
115
+ }
116
+
117
+
118
+
119
+ add_action("wplc_hook_chat_notification","wplc_mrg_filter_control_chat_notification_documentation_suggestion",10,3);
120
+ function wplc_mrg_filter_control_chat_notification_documentation_suggestion($type,$cid,$data) {
121
+
122
+ if ($type == "doc_suggestion") {
123
+
124
+ global $wpdb;
125
+ global $wplc_tblname_msgs;
126
+
127
+
128
+ $msg = $data['formatted_msg'];
129
+
130
+ $wpdb->insert(
131
+ $wplc_tblname_msgs,
132
+ array(
133
+ 'chat_sess_id' => $cid,
134
+ 'timestamp' => current_time('mysql'),
135
+ 'msgfrom' => __('System notification',"wplivechat"),
136
+ 'msg' => $msg,
137
+ 'status' => 0,
138
+ 'originates' => 0
139
+ ),
140
+ array(
141
+ '%s',
142
+ '%s',
143
+ '%s',
144
+ '%s',
145
+ '%d',
146
+ '%d'
147
+ )
148
+ );
149
+ }
150
+ return;
151
+ }
includes/js/wplc_admin_roi_reporting.js ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var date_data_array = new Array();
2
+ var agent_data_array = new Array();
3
+
4
+ var current_goal = null;
5
+
6
+ jQuery(function(){
7
+
8
+ jQuery('a[href=#rio_reports]').click(function(){
9
+ jQuery('#wplc_roi_report_list_item_0').trigger( "click" );
10
+ });
11
+
12
+ jQuery('#wplc_roi_report_date_selector').on('change', function(){
13
+ if(current_goal !== null){
14
+ var goal_id = current_goal;
15
+ var data = {
16
+ 'action': 'get_goal_data',
17
+ 'goal_id': goal_id,
18
+ 'term': jQuery(this).val()
19
+ }
20
+
21
+ wplc_roi_get_data(data);
22
+ }
23
+ });
24
+
25
+ jQuery('.wplc_roi_report_list_item').click(function(){
26
+ var goal_id = jQuery(this).attr('goal');
27
+ current_goal = goal_id;
28
+ var data = {
29
+ 'action': 'get_goal_data',
30
+ 'goal_id': goal_id,
31
+ 'term': jQuery('#wplc_roi_report_date_selector').val()
32
+ }
33
+
34
+ wplc_roi_get_data(data);
35
+ });
36
+
37
+ function wplc_roi_get_data(data){
38
+ jQuery.post( ajaxurl, data, function(response){
39
+ var json_data = JSON.parse(response);
40
+
41
+ jQuery('.wplc_roi_report_content_inner').html(json_data.html);
42
+
43
+ date_data_array = new Array();
44
+ if(typeof json_data.date_array !== "undefined"){
45
+ var counter = 0;
46
+ for(var key in json_data.date_array){
47
+ var pretty_date = json_data.date_array[key]['date'].substring(json_data.date_array[key]['date'].indexOf("-")+1);
48
+ pretty_date = pretty_date.replace("-", "/");
49
+
50
+ date_data_array[counter] = new Array();
51
+ date_data_array[counter].push(pretty_date);
52
+ date_data_array[counter].push(json_data.date_array[key]['value']);
53
+ counter ++;
54
+ }
55
+ if(counter > 0){
56
+ wplc_draw_roi_date_chart();
57
+ }
58
+ }
59
+
60
+ agent_data_array = new Array();
61
+ if(typeof json_data.agent_array !== "undefined"){
62
+ var counter = 0;
63
+ for(var key in json_data.agent_array){
64
+ agent_data_array[counter] = new Array();
65
+ agent_data_array[counter].push(json_data.agent_array[key]['name']);
66
+ agent_data_array[counter].push(json_data.agent_array[key]['value']);
67
+ counter ++;
68
+ }
69
+ if(counter > 0){
70
+ wplc_draw_roi_agent_chart();
71
+ }
72
+ }
73
+ });
74
+ }
75
+ });
76
+
77
+
78
+
79
+ function wplc_draw_roi_date_chart(){
80
+ var data = new google.visualization.DataTable();
81
+ data.addColumn('string', 'Content');
82
+ data.addColumn('number', 'Value');
83
+ data.addRows(date_data_array);
84
+
85
+ var options = {
86
+ vAxis: {minValue: 0},
87
+ animation:{
88
+ duration: 500,
89
+ startup: true
90
+ },
91
+ backgroundColor: 'transparent',
92
+ legend: 'none',
93
+ colors : ['#0073AA','#757575'],
94
+ hAxis:{
95
+ textStyle: {
96
+ fontSize: "9"
97
+ },
98
+ slantedText: false
99
+ },
100
+ vAxis:{
101
+ textStyle: {
102
+ fontSize: "12"
103
+ },
104
+ format: 'short'
105
+ },
106
+ chartArea:{
107
+ left: 50,
108
+ top:30,
109
+ right:20,
110
+ bottom:30
111
+ },
112
+ crosshair:{
113
+ trigger: 'both',
114
+ orientation: 'vertical',
115
+ opacity: 0.5,
116
+ color: "#0073AA"
117
+ },
118
+ focusTarget : 'category'
119
+ };
120
+
121
+ var chart = new google.visualization.AreaChart(document.getElementById('wplc_roi_grid_chart'));
122
+ chart.draw(data, options);
123
+
124
+ }
125
+
126
+
127
+ function wplc_draw_roi_agent_chart(){
128
+ var data = new google.visualization.DataTable();
129
+ data.addColumn('string', 'Content');
130
+ data.addColumn('number', 'Value');
131
+ data.addRows(agent_data_array);
132
+
133
+ var options = {
134
+ bar: {groupWidth: "10%"},
135
+ legend: "none",
136
+ colors : ['#0073AA','#757575'],
137
+ height:270,
138
+ chartArea:{
139
+ left: 50,
140
+ top:30,
141
+ right: 50,
142
+ bottom:30
143
+ },
144
+ animation:{
145
+ duration: 500,
146
+ startup: true
147
+ },
148
+ };
149
+
150
+ var chart = new google.visualization.ColumnChart(document.getElementById('wplc_roi_agent_chart'));
151
+ chart.draw(data, options);
152
+
153
+ }
includes/js/wplc_user_triggers.js ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(function(){
2
+ var wplc_trigger_done = false;
3
+ jQuery(window).load(function(){
4
+ if(typeof wplc_trigger_data !== 'undefined'){
5
+ //Vars are here - Trigger can be handled
6
+ if(typeof wplc_trigger_data["type"] !== 'undefined'){
7
+ var wplc_trigger_type = parseInt(wplc_trigger_data["type"]);
8
+ switch(wplc_trigger_type){
9
+ case 0:
10
+ //Don't do anything - this is handled by PHP
11
+ break;
12
+ case 1:
13
+ //Time Trigger
14
+ wplc_time_trigger();
15
+ break;
16
+ case 2:
17
+ //Scroll Trigger
18
+
19
+ jQuery(document).scroll(wplc_scroll_trigger);
20
+ break;
21
+ case 3:
22
+ //Page Leave Trigger
23
+ jQuery('body').on("mouseleave", wplc_page_leave_trigger);
24
+ }
25
+ }
26
+ }
27
+
28
+ function wplc_time_trigger(){
29
+ if(typeof wplc_trigger_data !== 'undefined'){
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();
39
+ jQuery("#wp-live-chat-header").addClass("active");
40
+ }, (wplc_trigger_seconds * 1000) + wplc_add_seconds);
41
+ }
42
+ }
43
+ }
44
+
45
+ function wplc_scroll_trigger(){
46
+ if(!wplc_trigger_done){
47
+ var domHeight = jQuery(document).height();
48
+ var diff = parseInt(domHeight * 0.3);
49
+ var actualHeight = domHeight - diff;
50
+ var pos = jQuery(document).scrollTop();
51
+
52
+ if(typeof wplc_trigger_data !== 'undefined'){
53
+ if(wplc_trigger_data["perc"] !== null && typeof wplc_trigger_data["perc"] !== 'undefined' && wplc_trigger_data["perc"] !== ""){
54
+ var tmpPerc = parseInt(wplc_trigger_data["perc"]) / 100;
55
+ var hitPos = parseInt(actualHeight * tmpPerc);
56
+ if(pos > hitPos){
57
+ jQuery("#wplc_hovercard").fadeIn();
58
+ jQuery("#wp-live-chat-header").addClass("active");
59
+ wplc_trigger_done = true;
60
+ }
61
+ }
62
+ }
63
+ }
64
+ }
65
+
66
+ function wplc_page_leave_trigger(){
67
+ if(!wplc_trigger_done){
68
+ jQuery("#wplc_hovercard").fadeIn('fast');
69
+ jQuery("#wp-live-chat-header").addClass("active");
70
+ wplc_trigger_done = true;
71
+ }
72
+ }
73
+
74
+ });
75
+ });
includes/settings_page.php CHANGED
@@ -3,7 +3,6 @@
3
  .ui-tabs-vertical .ui-tabs-nav {
4
  padding: .2em .1em .2em .2em;
5
  float: left;
6
- /* width: 10%; */
7
  max-width: 20%;
8
  min-width: 190px;
9
  }
@@ -11,7 +10,6 @@
11
  .ui-tabs-vertical .ui-tabs-nav li a { display:block; }
12
  .ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active { padding-bottom: 0; padding-right: .1em; border-right-width: 1px; }
13
  .ui-tabs-vertical .ui-tabs-panel {
14
- /* padding: 1em; */
15
  float: left;
16
  min-width: 67%;
17
  max-width: 67%;
@@ -52,7 +50,7 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
52
  };
53
 
54
  ?>
55
- <img src='<?php echo WPLC_BASIC_PLUGIN_URL.'images/ajax-loader.gif'; ?>' id='wplc_settings_page_loader' style='display: block; margin: 20px auto;' />
56
  <div class="wrap wplc_wrap" style='display: none;'>
57
 
58
  <style>
@@ -76,14 +74,23 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
76
  if (isset($wplc_settings["wplc_settings_color2"])) { $wplc_settings_color2 = $wplc_settings["wplc_settings_color2"]; } else { $wplc_settings_color2 = "FFFFFF"; }
77
  if (isset($wplc_settings["wplc_settings_color3"])) { $wplc_settings_color3 = $wplc_settings["wplc_settings_color3"]; } else { $wplc_settings_color3 = "EEEEEE"; }
78
  if (isset($wplc_settings["wplc_settings_color4"])) { $wplc_settings_color4 = $wplc_settings["wplc_settings_color4"]; } else { $wplc_settings_color4 = "666666"; }
79
- if (isset($wplc_settings["wplc_environment"])) { $wplc_environment[intval($wplc_settings["wplc_environment"])] = "SELECTED"; }
80
 
81
 
82
  if(get_option("WPLC_HIDE_CHAT") == true) { $wplc_hide_chat = "checked"; } else { $wplc_hide_chat = ""; };
83
-
 
 
 
 
 
 
 
 
 
 
84
  ?>
85
  <form action='' name='wplc_settings' method='POST' id='wplc_settings'>
86
-
87
  <div id="wplc_tabs">
88
  <ul>
89
  <?php
@@ -140,27 +147,8 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
140
  </select>
141
  </td>
142
  </tr>
143
- <?php /*
144
- <tr>
145
- <td width='200' valign='top'>
146
- <?php _e("Show the 'Powered by WP Live Chat Support' link", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e('Checking this will display a Powered by WP Live Chat Support link', 'wplivechat'); ?>"></i>
147
- </td>
148
- <td>
149
- <input type="checkbox" value="1" name="wplc_powered_by_link" <?php if (isset($wplc_settings['wplc_powered_by_link']) && $wplc_settings['wplc_powered_by_link'] == 1) { echo "checked"; } ?> />
150
- </td>
151
- </tr>
152
- */ ?>
153
 
154
- <!--
155
- <tr>
156
- <td width='400' valign='top'>
157
- <?php _e("Hide Chat", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Hides chat for 24hrs when user clicks X", "wplivechat") ?>"></i>
158
- </td>
159
- <td valign='top'>
160
- <input type="checkbox" name="wplc_hide_chat" value="true" <?php echo $wplc_hide_chat ?>/>
161
- </td>
162
- </tr>
163
- -->
164
  <tr>
165
  <td width='300' valign='top'>
166
  <?php _e("Required Chat Box Fields","wplivechat")?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Set default fields that will be displayed when users starting a chat", "wplivechat") ?>"></i>
@@ -216,14 +204,6 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
216
  <input type="checkbox" value="1" name="wplc_enabled_on_mobile" <?php if(isset($wplc_settings['wplc_enabled_on_mobile']) && $wplc_settings['wplc_enabled_on_mobile'] == 1 ) { echo "checked"; } ?> />
217
  </td>
218
  </tr>
219
- <!--<tr>
220
- <td width='350' valign='top'>
221
- <?php _e("Record a visitor's IP Address","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Disable this to enable anonymity for your visitors", "wplivechat") ?>"></i>
222
- </td>
223
- <td valign='top'>
224
- <input type="checkbox" value="1" name="wplc_record_ip_address" <?php if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1 ) { echo "checked"; } ?> />
225
- </td>
226
- </tr>-->
227
 
228
  <?php if( isset( $wplc_settings['wplc_use_node_server'] ) && intval( $wplc_settings['wplc_use_node_server'] ) == 1 ){ ?>
229
  <tr>
@@ -260,58 +240,150 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
260
  <input type="checkbox" value="1" name="wplc_enable_all_admin_pages" <?php if(isset($wplc_settings['wplc_enable_all_admin_pages']) && $wplc_settings['wplc_enable_all_admin_pages'] == 1 ) { echo "checked"; } ?> />
261
  </td>
262
  </tr>
263
-
264
- <?php if (!function_exists("wplc_pro_activate")) { ?>
265
-
266
- <tr>
267
- <td width='300' valign='top'>
268
- <?php _e("Include chat window on the following pages","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Show the chat window on the following pages. Leave blank to show on all. (Use comma-separated Page ID's)", "wplivechat") ?>"></i>
269
- </td>
270
- <td valign='top'>
271
- <input type="text" readonly="readonly" />
272
- <small>
273
- <i>
274
- <?php _e("available in the","wplivechat")?>
275
- <a href="http://www.wp-livechat.com/features/?utm_source=plugin&utm_medium=link&utm_campaign=include_pages" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
276
- <?php _e("only","wplivechat")?>
277
- </i>
278
- </small>
279
- </td>
280
- </tr>
281
- <tr>
282
- <td width='200' valign='top'>
283
- <?php _e("Exclude chat window on the following pages","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Do not show the chat window on the following pages. Leave blank to show on all. (Use comma-separated Page ID's)", "wplivechat") ?>"></i>
284
- </td>
285
- <td valign='top'>
286
- <input type="text" readonly="readonly"/>
287
- <small>
288
- <i>
289
- <?php _e("available in the","wplivechat")?>
290
- <a href="http://www.wp-livechat.com/features/?utm_source=plugin&utm_medium=link&utm_campaign=exclude_pages" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
291
- <?php _e("only","wplivechat")?>
292
- </i>
293
- </small>
294
- </td>
295
- </tr>
296
-
297
- <tr class="wplc-exclude-post-types__row">
298
- <td width='200' valign='top'>
299
- <?php _e("Exclude chat window on selected post types","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Do not show the chat window on the following post types pages.", "wplivechat") ?>"></i>
300
- </td>
301
- <td valign='top'>
302
- <input type="text" readonly="readonly"/>
303
- <small>
304
- <i>
305
- <?php _e("available in the","wplivechat")?>
306
- <a href="http://www.wp-livechat.com/features/?utm_source=plugin&utm_medium=link&utm_campaign=exclude_pages" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
307
- <?php _e("only","wplivechat")?>
308
- </i>
309
- </small>
310
- </td>
311
- </tr>
312
-
313
- <?php } ?>
314
  </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
  <?php do_action('wplc_hook_admin_settings_main_settings_after'); ?>
316
 
317
 
@@ -339,151 +411,11 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
339
  </td>
340
  </tr>
341
 
342
-
343
-
344
-
345
- <?php if (!function_exists("wplc_pro_activate")) { ?>
346
- <tr>
347
- <td width='300'>
348
- <?php _e("Display typing indicator","wplivechat") ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Display a typing animation as soon as someone starts typing.","wplivechat") ?>"></i>
349
- </td>
350
- <td>
351
- <input type="checkbox" name="" value="" disabled />
352
- <small>
353
- <i>
354
- <?php _e("available in the","wplivechat")?>
355
- <a href="http://www.wp-livechat.com/features/?utm_source=plugin&utm_medium=link&utm_campaign=typing" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
356
- <?php _e("only","wplivechat")?>
357
- </i>
358
- </small>
359
- </td>
360
- </tr>
361
- <tr>
362
- <tr>
363
-
364
- <td width='300' valign='top'>
365
- <?php _e("Name","wplivechat")?>:
366
- </td>
367
- <td>
368
- <input type='text' size='50' maxlength='50' disabled readonly value='admin' />
369
- <small>
370
- <i>
371
- <?php _e("available in the","wplivechat")?>
372
- <a href="http://www.wp-livechat.com/features/?utm_source=plugin&utm_medium=link&utm_campaign=name" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
373
- <?php _e("only","wplivechat")?>
374
- </i>
375
- </small>
376
- </td>
377
- </tr>
378
- <!--<tr>
379
- <td width='300'>
380
- <?php _e("Avatar","wplivechat") ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Choose which picture to use as your avatar.","wplivechat") ?>"></i>
381
- </td>
382
- <td>
383
- <select name="wplc_avatar_source">
384
- <option value="gravatar" <?php echo (isset($wplc_settings['wplc_avatar_source']) && $wplc_settings['wplc_avatar_source'] == 'gravatar') ? 'selected' : ''; ?>>Gravatar</option>
385
- <option value="wp_avatar" <?php echo (isset($wplc_settings['wplc_avatar_source']) && $wplc_settings['wplc_avatar_source'] == 'wp_avatar') ? 'selected' : ''; ?>>WP User Avatar</option>
386
- </select>
387
- </td>
388
- </tr>-->
389
- <!-- Chat Icon-->
390
- <tr>
391
- <td width='300' valign='top'>
392
- <?php _e("Icon","wplivechat")?>:
393
- </td>
394
- <td>
395
- <input id="wplc_pro_chat_button" type="button" value="<?php _e("Upload Image","wplivechat")?>" readonly disabled />
396
- <small>
397
- <i>
398
- <?php _e("available in the","wplivechat")?>
399
- <a href="http://www.wp-livechat.com/features/?utm_source=plugin&utm_medium=link&utm_campaign=pic" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
400
- <?php _e("only","wplivechat")?>
401
- </i>
402
- </small>
403
- </td>
404
- </tr>
405
- <!-- Chat Pic-->
406
- <tr>
407
- <td width='300' valign='top'>
408
- <?php _e("Picture","wplivechat")?>:
409
- </td>
410
- <td>
411
- <input id="wplc_pro_pic_button" type="button" value="<?php _e("Upload Image","wplivechat")?>" readonly disabled />
412
- <small>
413
- <i>
414
- <?php _e("available in the","wplivechat")?>
415
- <a href="http://www.wp-livechat.com/features/?utm_source=plugin&utm_medium=link&utm_campaign=pic" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
416
- <?php _e("only","wplivechat")?>
417
- </i>
418
- </small>
419
- </td>
420
- </tr>
421
- <!-- Chat Logo-->
422
- <tr>
423
- <td width='300' valign='top'>
424
- <?php _e("Logo","wplivechat")?>:
425
- </td>
426
- <td>
427
- <input id="wplc_pro_logo_button" type="button" value="<?php _e("Upload Image","wplivechat")?>" readonly disabled />
428
- <small>
429
- <i>
430
- <?php _e("available in the","wplivechat")?>
431
- <a href="http://www.wp-livechat.com/features/?utm_source=plugin&utm_medium=link&utm_campaign=pic" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
432
- <?php _e("only","wplivechat")?>
433
- </i>
434
- </small>
435
- </td>
436
- </tr>
437
- <!-- Chat Delay-->
438
- <tr>
439
- <td width='300' valign='top'>
440
- <?php _e("Chat delay (seconds)","wplivechat")?>:
441
- </td>
442
- <td>
443
- <input type='text' size='50' maxlength='50' disabled readonly value='10' />
444
- <small>
445
- <i>
446
- <?php _e("available in the","wplivechat")?>
447
- <a href="http://www.wp-livechat.com/features/?utm_source=plugin&utm_medium=link&utm_campaign=delay" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
448
- <?php _e("only","wplivechat")?>
449
- </i>
450
- </small>
451
- </td>
452
- </tr>
453
- <!-- Chat Notification if want to chat-->
454
- <tr>
455
- <td width='300' valign='top'>
456
- <?php _e("Chat notifications", "wplivechat") ?>:
457
- </td>
458
- <td>
459
- <input id='wplc_pro_chat_notification' name='wplc_pro_chat_notification' type='checkbox' value='yes' disabled="disabled" readonly/>
460
- <?php _e("Alert me via email as soon as someone wants to chat", "wplivechat") ?>
461
- <small>
462
- <i>
463
- <?php _e("available in the", "wplivechat") ?>
464
- <a href="http://www.wp-livechat.com/features/?utm_source=plugin&utm_medium=link&utm_campaign=alert" title="<?php _e("Pro Add-on", "wplivechat") ?>" target="_BLANK"><?php _e("Pro Add-on", "wplivechat") ?></a>
465
- <?php _e("only", "wplivechat") ?>
466
- </i>
467
- </small>
468
- </td>
469
- </tr>
470
- <?php } ?>
471
-
472
- <!-- <tr>
473
- <td>
474
- <?php //_e("Display name and avatar in chat", "wplivechat") ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php //_e("Display the agent and user name above each message in the chat window.", "wplivechat") ?>"></i>
475
- </td>
476
- <td>
477
- <input type="checkbox" name="wplc_display_name" value="1" <?php //if (isset($wplc_settings['wplc_display_name']) && $wplc_settings['wplc_display_name'] == 1) {
478
- //echo "checked";
479
- //} ?>/>
480
- </td>
481
- </tr> -->
482
  <tr>
483
  <td>
484
  <?php _e("Display details in chat message", "wplivechat") ?>
485
  </td>
486
- <td> <!-- $wplc_settings['wplc_display_name'] Remember for backwards compat -->
487
  <?php if (isset($wplc_settings['wplc_show_name']) && $wplc_settings['wplc_show_name'] == 1) { $checked = "checked"; } else { $checked = ''; } ?>
488
  <input type="checkbox" name="wplc_show_name" value="1" <?php echo $checked; ?>/> <label><?php _e("Show Name", "wplivechat"); ?></label><br/>
489
  <?php if (isset($wplc_settings['wplc_show_avatar']) && $wplc_settings['wplc_show_avatar'] == 1) { $checked = "checked"; } else { $checked = ''; } ?>
@@ -523,7 +455,7 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
523
  </td>
524
  </tr>
525
  <?php
526
- if(defined('WPLC_PRO_PLUGIN'))
527
  {
528
  ?>
529
  <tr>
@@ -543,45 +475,304 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
543
  <?php
544
  }
545
  ?>
546
- </table>
 
 
 
547
 
548
- <?php if(!function_exists("wplc_chat_social_div") && !function_exists("wplc_pro_activate")){ ?>
549
-
550
- <h3><?php _e("Social", 'wplivechat') ?></h3>
551
- <hr>
552
- <table class='wp-list-table wplc_list_table widefat fixed striped pages' >
553
- <tbody>
554
- <tr>
555
- <td width='300' valign='top'><?php _e("Facebook URL", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Link your Facebook page here. Leave blank to hide", "wplivechat") ?>"></i></td>
556
- <td>
557
- <input id='wplc_social_fb' name='wplc_social_fb' placeholder="<?php _e("Facebook URL...", "wplivechat") ?>" type='text' disabled/>
558
- <small>
559
- <i>
560
- <?php _e("available in the","wplivechat")?>
561
- <a href="http://www.wp-livechat.com/features/?utm_source=plugin&utm_medium=link&utm_campaign=social_media" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
562
- <?php _e("only","wplivechat")?>
563
- </i>
564
- </small>
565
- </td>
566
- </tr>
567
- <tr>
568
- <td width='300' valign='top'><?php _e("Twitter URL", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Link your Twitter page here. Leave blank to hide", "wplivechat") ?>"></i></td>
569
- <td>
570
- <input id='wplc_social_tw' name='wplc_social_tw' placeholder="<?php _e("Twitter URL...", "wplivechat") ?>" type='text' disabled/>
571
- <small>
572
- <i>
573
- <?php _e("available in the","wplivechat")?>
574
- <a href="http://www.wp-livechat.com/features/?utm_source=plugin&utm_medium=link&utm_campaign=social_media" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
575
- <?php _e("only","wplivechat")?>
576
- </i>
577
- </small>
578
- </td>
579
- </tr>
580
- </tbody>
581
- </table>
582
- <?php } ?>
583
 
584
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
585
 
586
  <?php do_action('wplc_hook_admin_settings_chat_box_settings_after'); ?>
587
 
@@ -716,7 +907,41 @@ if (isset($wplc_settings['wplc_hide_when_offline']) && $wplc_settings['wplc_hide
716
  </td>
717
  </tr>
718
  </table>
719
- <?php do_action('wplc_hook_admin_settings_offline_messages_settings_after'); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
720
  </div>
721
 
722
 
@@ -794,11 +1019,11 @@ if (isset($wplc_settings['wplc_hide_when_offline']) && $wplc_settings['wplc_hide
794
  <div class='wplc_theme_block'>
795
  <div class='wplc_theme_image' id=''>
796
  <div class='wplc_theme_single'>
797
- <img style='width:162px;' src='<?php echo WPLC_BASIC_PLUGIN_URL.'images/themes/newtheme-1.jpg'; ?>' title="<?php _e('Classic', 'wplivechat'); ?>" alt="<?php _e('Classic', 'wplivechat'); ?>" class='<?php if (isset($wplc_settings['wplc_newtheme']) && $wplc_settings['wplc_newtheme'] == 'theme-1') { echo 'wplc_theme_active'; } ?>' id='wplc_newtheme_1'/>
798
  <?php _e('Classic', 'wplivechat'); ?>
799
  </div>
800
  <div class='wplc_theme_single'>
801
- <img style='width:162px;' src='<?php echo WPLC_BASIC_PLUGIN_URL.'images/themes/newtheme-2.jpg'; ?>' title="<?php _e('Modern', 'wplivechat'); ?>" alt="<?php _e('Modern', 'wplivechat'); ?>" class='<?php if (isset($wplc_settings['wplc_newtheme']) && $wplc_settings['wplc_newtheme'] == 'theme-2') { echo 'wplc_theme_active'; } ?>' id='wplc_newtheme_2'/>
802
  <?php _e('Modern', 'wplivechat'); ?>
803
  </div>
804
 
@@ -966,14 +1191,6 @@ if (isset($wplc_settings['wplc_hide_when_offline']) && $wplc_settings['wplc_hide
966
 
967
  </td>
968
  </tr>
969
- <?php /* removed as this has been replaced with the "welcome_msg" below
970
- <tr class="wplc_localization_strings">
971
- <td width="200" valign="top"><?php _e("User chat welcome", "wplivechat") ?>:</td>
972
- <td>
973
- <input id="wplc_user_welcome_chat" name="wplc_user_welcome_chat" type="text" size="50" maxlength="150" class="regular-text" value="<?php echo stripslashes($wplc_settings['wplc_user_welcome_chat']) ?>" /> <br />
974
- </td>
975
- </tr>
976
- */ ?>
977
  <tr class="wplc_localization_strings">
978
  <td width="200" valign="top"><?php _e("Welcome message", "wplivechat") ?>:</td>
979
  <td>
@@ -993,14 +1210,6 @@ if (isset($wplc_settings['wplc_hide_when_offline']) && $wplc_settings['wplc_hide
993
  <input id="wplc_text_chat_ended" name="wplc_text_chat_ended" type="text" size="50" maxlength="150" class="regular-text" value="<?php echo ( empty( $wplc_settings['wplc_text_chat_ended'] ) ) ? stripslashes(__("The chat has been ended by the operator.", "wplivechat")) : stripslashes( $wplc_settings['wplc_text_chat_ended'] ) ?>" /> <br />
994
  </td>
995
  </tr>
996
- <!--
997
- <tr class="wplc_localization_strings">
998
- <td width="200" valign="top"><?php _e("Close Button Text", "wplivechat") ?>:</td>
999
- <td>
1000
- <input id="wplc_close_btn_text" name="wplc_close_btn_text" type="text" size="50" maxlength="150" class="regular-text" value="<?php echo stripslashes($wplc_settings['wplc_close_btn_text']) ?>" /><br />
1001
- </td>
1002
- </tr>
1003
- -->
1004
 
1005
  <tr>
1006
  <td><label for=""><?php _e('Choose an animation', 'wplivechat'); ?></label></td>
@@ -1046,14 +1255,87 @@ if (isset($wplc_settings['wplc_hide_when_offline']) && $wplc_settings['wplc_hide
1046
  } ?>/>
1047
  </td>
1048
  </tr>
 
 
 
 
 
 
 
1049
 
1050
- <?php do_action('wplc_hook_styling_setting_bottom'); ?>
1051
  </table>
1052
  </div>
1053
  <div id="tabs-5">
1054
 
1055
 
1056
- <?php do_action("wplc_hook_agents_settings"); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1057
 
1058
 
1059
  </div>
@@ -1079,7 +1361,115 @@ if (isset($wplc_settings['wplc_hide_when_offline']) && $wplc_settings['wplc_hide
1079
  </table>
1080
  </div>
1081
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1082
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1083
 
1084
  <?php do_action("wplc_hook_settings_page_more_tabs"); ?>
1085
 
3
  .ui-tabs-vertical .ui-tabs-nav {
4
  padding: .2em .1em .2em .2em;
5
  float: left;
 
6
  max-width: 20%;
7
  min-width: 190px;
8
  }
10
  .ui-tabs-vertical .ui-tabs-nav li a { display:block; }
11
  .ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active { padding-bottom: 0; padding-right: .1em; border-right-width: 1px; }
12
  .ui-tabs-vertical .ui-tabs-panel {
 
13
  float: left;
14
  min-width: 67%;
15
  max-width: 67%;
50
  };
51
 
52
  ?>
53
+ <img src='<?php echo WPLC_PLUGIN_URL.'images/ajax-loader.gif'; ?>' id='wplc_settings_page_loader' style='display: block; margin: 20px auto;' />
54
  <div class="wrap wplc_wrap" style='display: none;'>
55
 
56
  <style>
74
  if (isset($wplc_settings["wplc_settings_color2"])) { $wplc_settings_color2 = $wplc_settings["wplc_settings_color2"]; } else { $wplc_settings_color2 = "FFFFFF"; }
75
  if (isset($wplc_settings["wplc_settings_color3"])) { $wplc_settings_color3 = $wplc_settings["wplc_settings_color3"]; } else { $wplc_settings_color3 = "EEEEEE"; }
76
  if (isset($wplc_settings["wplc_settings_color4"])) { $wplc_settings_color4 = $wplc_settings["wplc_settings_color4"]; } else { $wplc_settings_color4 = "666666"; }
 
77
 
78
 
79
  if(get_option("WPLC_HIDE_CHAT") == true) { $wplc_hide_chat = "checked"; } else { $wplc_hide_chat = ""; };
80
+ $wplc_choose_data = get_option("WPLC_CHOOSE_SETTINGS");
81
+ $wplc_inex_data = get_option("WPLC_INEX_SETTINGS");
82
+ $wplc_auto_responder_settings = get_option( "WPLC_AUTO_RESPONDER_SETTINGS" );
83
+ $wplc_acbc_data = get_option("WPLC_ACBC_SETTINGS");
84
+ $wplc_bh_settings = get_option( "wplc_bh_settings" );
85
+ $wplc_encrypt_data = get_option("WPLC_ENCRYPT_SETTINGS");
86
+
87
+ $wplc_quick_response_order_by = isset( $wplc_settings['wplc_quick_response_orderby'] ) ? esc_attr( $wplc_settings['wplc_quick_response_orderby'] ) : 'title';
88
+ $wplc_quick_response_order = isset( $wplc_settings['wplc_quick_response_order'] ) ? esc_attr( $wplc_settings['wplc_quick_response_order'] ) : 'DESC';
89
+
90
+ $wplc_pro_auto_first_response_chat_msg = isset($wplc_settings['wplc_pro_auto_first_response_chat_msg']) ? $wplc_settings['wplc_pro_auto_first_response_chat_msg'] : '';
91
  ?>
92
  <form action='' name='wplc_settings' method='POST' id='wplc_settings'>
93
+ <?php wp_nonce_field( 'wplc_save_settings', 'wplc_save_settings_nonce' ); ?>
94
  <div id="wplc_tabs">
95
  <ul>
96
  <?php
147
  </select>
148
  </td>
149
  </tr>
 
 
 
 
 
 
 
 
 
 
150
 
151
+
 
 
 
 
 
 
 
 
 
152
  <tr>
153
  <td width='300' valign='top'>
154
  <?php _e("Required Chat Box Fields","wplivechat")?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Set default fields that will be displayed when users starting a chat", "wplivechat") ?>"></i>
204
  <input type="checkbox" value="1" name="wplc_enabled_on_mobile" <?php if(isset($wplc_settings['wplc_enabled_on_mobile']) && $wplc_settings['wplc_enabled_on_mobile'] == 1 ) { echo "checked"; } ?> />
205
  </td>
206
  </tr>
 
 
 
 
 
 
 
 
207
 
208
  <?php if( isset( $wplc_settings['wplc_use_node_server'] ) && intval( $wplc_settings['wplc_use_node_server'] ) == 1 ){ ?>
209
  <tr>
240
  <input type="checkbox" value="1" name="wplc_enable_all_admin_pages" <?php if(isset($wplc_settings['wplc_enable_all_admin_pages']) && $wplc_settings['wplc_enable_all_admin_pages'] == 1 ) { echo "checked"; } ?> />
241
  </td>
242
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  </table>
244
+
245
+ <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='700'>
246
+ <tr>
247
+ <td width='350' valign='top'>
248
+ <?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>
249
+ </td>
250
+ <td>
251
+ <input type="checkbox" value="1" name="wplc_auto_online" <?php if (isset($wplc_choose_data['wplc_auto_online']) && $wplc_choose_data['wplc_auto_online'] == 1) { echo "checked"; } ?> />
252
+ </td>
253
+ </tr>
254
+ </table>
255
+ <hr>
256
+
257
+ <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='700'>
258
+ <tr>
259
+ <td width='350' valign='top'>
260
+ <?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>
261
+ </td>
262
+ <td valign='top'>
263
+ <input type="checkbox" name="wplc_exclude_home" <?php if (isset($wplc_inex_data['wplc_exclude_home'])) { echo 'checked'; } ?> value='1' />
264
+ </td>
265
+ </tr>
266
+ <tr>
267
+ <td width='350' valign='top'>
268
+ <?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>
269
+ </td>
270
+ <td valign='top'>
271
+ <input type="checkbox" name="wplc_exclude_archive" <?php if (isset($wplc_inex_data['wplc_exclude_archive'])) { echo 'checked'; } ?> value='1' />
272
+ </td>
273
+ </tr>
274
+ <tr>
275
+ <td width='350' valign='top'>
276
+ <?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>
277
+ </td>
278
+ <td valign='top'>
279
+ <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']; } ?>" />
280
+ </td>
281
+ </tr>
282
+ <tr>
283
+ <td width='350' valign='top'>
284
+ <?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>
285
+ </td>
286
+ <td valign='top'>
287
+ <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']; } ?>" />
288
+ </td>
289
+ </tr>
290
+ <tr class="wplc-exclude-post-types__row">
291
+ <td width='200' valign='top'>
292
+ <?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>
293
+ </td>
294
+ <td valign='top'><?php
295
+ $wplc_inex_settings = get_option('WPLC_INEX_SETTINGS');
296
+ $wplc_posts_types = get_post_types(
297
+ array(
298
+ '_builtin' => false,
299
+ 'public' => true
300
+ ),
301
+ 'objects'
302
+ );
303
+ if ( ! empty( $wplc_posts_types ) ) {
304
+ foreach ( $wplc_posts_types as $posts_type ) { ?>
305
+ <div class="wplc-exclude-post-types__item">
306
+ <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' : ''; ?> />
307
+ <label for="wplc_exclude_post_types_<?php echo $posts_type->name; ?>"><?php _e( $posts_type->label, "wplivechat" ) ?></label>
308
+ </div>
309
+ <?php
310
+ }
311
+ } else {
312
+ _e( 'No post types found.', 'wplivechat' );
313
+ } ?>
314
+ </td>
315
+ </tr>
316
+ <tr>
317
+ <td width='300' valign='top'>
318
+ <?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>
319
+ </td>
320
+ <td>
321
+ <input type="checkbox" value="1" name="wplc_make_agent" <?php if (isset($wplc_inex_data['wplc_make_agent']) && $wplc_inex_data['wplc_make_agent'] == 1) { echo "checked"; } ?> />
322
+ </td>
323
+ </tr>
324
+
325
+ </table>
326
+ <hr>
327
+
328
+ <h4><?php _e( "Quick Response", "wplivechat" ); ?></h4>
329
+ <table class="wp-list-table wplc_list_table widefat fixed striped pages">
330
+ <tbody>
331
+ <tr>
332
+ <td width="350" valign="top">
333
+ <label for="wplc_quick_response_orderby"><?php _e( "Order by", "wplivechat" ); ?></label>
334
+ </td>
335
+ <td valign="top">
336
+ <select id='wplc_quick_response_orderby' name='wplc_quick_response_orderby'>
337
+ <option value="title" <?php selected( $wplc_quick_response_order_by, 'title' ) ?>><?php _e( "Title", "wplivechat" ); ?></option>
338
+ <option value="date" <?php selected( $wplc_quick_response_order_by, 'date' ) ?>><?php _e( "Date", "wplivechat" ); ?></option>
339
+ <option value="number" <?php selected( $wplc_quick_response_order_by, 'number' ) ?>><?php _e( "Number", "wplivechat" ); ?></option>
340
+ </select>
341
+ </td>
342
+ </tr>
343
+ <tr>
344
+ <td width="350" valign="top">
345
+ <label for="wplc_quick_response_order"><?php _e( "Order", "wplivechat" ); ?></label>
346
+ </td>
347
+ <td valign="top">
348
+ <select id='wplc_quick_response_order' name='wplc_quick_response_order'>
349
+ <option value="DESC" <?php selected( $wplc_quick_response_order, 'DESC' ) ?>><?php _e( "Descending", "wplivechat" ); ?></option>
350
+ <option value="ASC" <?php selected( $wplc_quick_response_order, 'ASC' ) ?>><?php _e( "Ascending", "wplivechat" ); ?></option>
351
+ </select>
352
+ </td>
353
+ </tr>
354
+ </tbody>
355
+ </table>
356
+ <br>
357
+
358
+ <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='700'>
359
+ <tr>
360
+ <td width='350' valign='top'>
361
+ <?php _e( "Enable Voice Notes on admin side", "wplivechat" ); ?>: <i
362
+ class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip"
363
+ 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>
364
+ </td>
365
+ <td valign='top'>
366
+ <input type="checkbox" value="1"
367
+ name="wplc_enable_voice_notes_on_admin" <?php if ( isset( $wplc_settings['wplc_enable_voice_notes_on_admin'] ) && $wplc_settings['wplc_enable_voice_notes_on_admin'] == 1 ) {
368
+ echo "checked";
369
+ } ?> />
370
+ </td>
371
+ </tr>
372
+ <tr>
373
+ <td width='350' valign='top'>
374
+ <?php _e( "Enable Voice Notes on visitor side", "wplivechat" ); ?>: <i
375
+ class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip"
376
+ 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>
377
+ </td>
378
+ <td valign='top'>
379
+ <input type="checkbox" value="1"
380
+ name="wplc_enable_voice_notes_on_visitor" <?php if ( isset( $wplc_settings['wplc_enable_voice_notes_on_visitor'] ) && $wplc_settings['wplc_enable_voice_notes_on_visitor'] == 1 ) {
381
+ echo "checked";
382
+ } ?> />
383
+ </td>
384
+ </tr>
385
+ </table>
386
+
387
  <?php do_action('wplc_hook_admin_settings_main_settings_after'); ?>
388
 
389
 
411
  </td>
412
  </tr>
413
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
414
  <tr>
415
  <td>
416
  <?php _e("Display details in chat message", "wplivechat") ?>
417
  </td>
418
+ <td>
419
  <?php if (isset($wplc_settings['wplc_show_name']) && $wplc_settings['wplc_show_name'] == 1) { $checked = "checked"; } else { $checked = ''; } ?>
420
  <input type="checkbox" name="wplc_show_name" value="1" <?php echo $checked; ?>/> <label><?php _e("Show Name", "wplivechat"); ?></label><br/>
421
  <?php if (isset($wplc_settings['wplc_show_avatar']) && $wplc_settings['wplc_show_avatar'] == 1) { $checked = "checked"; } else { $checked = ''; } ?>
455
  </td>
456
  </tr>
457
  <?php
458
+ if(defined('WPLC_PLUGIN'))
459
  {
460
  ?>
461
  <tr>
475
  <?php
476
  }
477
  ?>
478
+ </table>
479
+
480
+ <?php
481
+ if (isset($wplc_acbc_data['wplc_pro_chat_notification']) && $wplc_acbc_data['wplc_pro_chat_notification'] == "yes") { $wplc_pro_chat_notification = "CHECKED"; } else { }
482
 
483
+ echo "<table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='700'>";
484
+ echo " <tr>";
485
+ echo " <td width='300'>";
486
+ 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>";
487
+ echo " </td>";
488
+ echo " <td>";
489
+ echo " <input type=\"checkbox\" name=\"wplc_typing_enabled\" value=\"1\"";
490
+ if (isset($wplc_settings['wplc_typing_enabled']) && $wplc_settings['wplc_typing_enabled'] == 1) { echo "checked"; }
491
+ echo "/>";
492
+ echo " <small><em>".__("For non-cloud server users, please note that this will increase the amount of server resources required.", "wplivechat")." </em></small>";
493
+ echo " </td>";
494
+ echo "</tr>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
495
 
496
+
497
+ ?>
498
+
499
+ <tr>
500
+ <td width='420' valign='top'>
501
+ <?php _e("Name ", "wplivechat") ?>:
502
+ </td>
503
+ <td>
504
+ <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']) : ''; ?>' />
505
+ </td>
506
+ </tr>
507
+ <tr>
508
+ <td width='420' valign='top'>
509
+ - <?php _e("Use WordPress name instead", "wplivechat") ?>:
510
+ </td>
511
+ <td>
512
+ <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>
513
+ </td>
514
+ </tr>
515
+
516
+ <?php
517
+
518
+ if (isset($wplc_settings['wplc_ringtone'])) {
519
+ $wplc_ringtone_selected = str_replace("http:", "", $wplc_settings['wplc_ringtone'] );
520
+ } else {
521
+ $wplc_ringtone_selected = WPLC_PLUGIN_URL.'includes/sounds/general/ring.wav';
522
+ }
523
+
524
+
525
+ ?>
526
+
527
+
528
+ <tr>
529
+ <td width='420' valign='top'>
530
+ <?php _e("Incoming chat ring tone", "wplivechat") ?>:
531
+ </td>
532
+ <td>
533
+ <select name='wplc_ringtone' id='wplc_ringtone'>
534
+ <?php $wplc_ringtone = str_replace("http:", "", WPLC_PLUGIN_URL.'includes/sounds/general/ring.wav' ); ?>
535
+ <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>
536
+ <?php
537
+
538
+ /* Thank you to the following authors of the sound files used in WP Live Chat Support
539
+
540
+ (1) Mike Koenig Sound - Store door chime, Mario jump, ringing phone, Rooster, ship bell
541
+ (2) Freesfx.com
542
+ (3) Corsica - Elevator ding sound, Air plane ding
543
+ (4) Brian Rocca - Pin dropping
544
+ (5) Marianne Gagnon - Robot blip
545
+ (6) Caroline Ford - Drop metal thing
546
+ (7) bennstir - Doorbell
547
+
548
+ */
549
+ $path = WPLC_PLUGIN_DIR."/includes/sounds/";
550
+
551
+ $files = scandir($path);
552
+
553
+ foreach ($files as &$value) {
554
+
555
+ if ( is_dir( $path . $value ) ) {
556
+ continue;
557
+ }
558
+
559
+ $available_tones = plugin_dir_url( $path.$value ).$value;
560
+ $http_stripped_tone = str_replace( "http:", "", $available_tones );
561
+ $wplc_new_sanitized_tone = str_replace( "https:", "", $http_stripped_tone );
562
+
563
+ if ($value == "." || $value == "..") { } else {
564
+ $fname = $withoutExt = preg_replace('/\\.[^.\\s]{3,4}$/', '', $value);
565
+ $fname = str_replace("_"," ",$fname);
566
+ if ($wplc_ringtone_selected == $wplc_new_sanitized_tone) { $sel = "selected"; } else { $sel = ""; }
567
+ $new_ringtone = str_replace("http:", "", plugin_dir_url( $path.$value ).$value );
568
+ echo "<option value='".$new_ringtone."' $sel>".$fname."</option>";
569
+ }
570
+ }
571
+ ?>
572
+ </select>
573
+ <button type='button' id='wplc_sample_ring_tone'><i class='fa fa-play'></i></button>
574
+ </td>
575
+ </tr>
576
+
577
+ <?php
578
+
579
+ if (isset($wplc_settings['wplc_messagetone'])) {
580
+ $wplc_messagetone_selected = str_replace("http:", "", $wplc_settings['wplc_messagetone'] );
581
+ } else {
582
+ $wplc_messagetone_selected = WPLC_PLUGIN_URL.'includes/sounds/general/ring.wav';
583
+ }
584
+
585
+
586
+ ?>
587
+
588
+
589
+ <tr>
590
+ <td width='420' valign='top'>
591
+ <?php _e("Incoming message tone", "wplivechat") ?>:
592
+ </td>
593
+ <td>
594
+ <select name='wplc_messagetone' id='wplc_messagetone'>
595
+ <?php $wplc_messagetone = str_replace("http:", "", WPLC_PLUGIN_URL.'includes/sounds/general/ding.mp3' ); ?>
596
+ <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>
597
+ <?php
598
+ $path = WPLC_PLUGIN_DIR."/includes/sounds/message/";
599
+ $files = scandir($path);
600
+
601
+ foreach ($files as &$value) {
602
+
603
+ if ( is_dir( $path . $value ) ) {
604
+ continue;
605
+ }
606
+
607
+ $available_tones = plugin_dir_url( $path.$value ).$value;
608
+ $http_stripped_tone = str_replace( "http:", "", $available_tones );
609
+ $wplc_new_sanitized_tone = str_replace( "https:", "", $http_stripped_tone );
610
+
611
+ if ($value == "." || $value == "..") { } else {
612
+ $fname = $withoutExt = preg_replace('/\\.[^.\\s]{3,4}$/', '', $value);
613
+ $fname = str_replace("_"," ",$fname);
614
+ if ($wplc_messagetone_selected == $wplc_new_sanitized_tone) { $sel = "selected"; } else { $sel = ""; }
615
+ $new_messagetone = str_replace("http:", "", plugin_dir_url( $path.$value ).$value );
616
+ echo "<option value='".$new_messagetone."' $sel>".$fname."</option>";
617
+ }
618
+ }
619
+ ?>
620
+ </select>
621
+ <button type='button' id='wplc_sample_message_tone'><i class='fa fa-play'></i></button>
622
+ </td>
623
+ </tr>
624
+
625
+ <?php
626
+ $wplc_current_user = wp_get_current_user();
627
+ $wplc_current_picture = isset( $wplc_acbc_data['wplc_chat_pic'] ) ? urldecode($wplc_acbc_data['wplc_chat_pic']) : '';
628
+ $wplc_current_logo = isset( $wplc_acbc_data['wplc_chat_logo'] ) ? urldecode($wplc_acbc_data['wplc_chat_logo']) : '';
629
+ $wplc_current_icon = isset( $wplc_acbc_data['wplc_chat_icon'] ) ? urldecode($wplc_acbc_data['wplc_chat_icon']) : '';
630
+ ?>
631
+
632
+
633
+ <!-- Chat Icon-->
634
+ <tr class='wplc-icon-area'>
635
+ <td width='300' valign='top'>
636
+ <?php _e("Icon", "wplivechat") ?>:
637
+ </td>
638
+ <td>
639
+ <span id="wplc_icon_area">
640
+ <img src="<?php echo trim($wplc_current_icon); ?>" width="50px"/>
641
+ </span>
642
+ <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) ?>"/>
643
+ <br/>
644
+ <input id="wplc_btn_upload_icon" name="wplc_btn_upload_icon" type="button" value="<?php _e("Upload Icon", "wplivechat") ?>" />
645
+ <input id="wplc_btn_select_default_icon" name="wplc_btn_select_default_icon" type="button" value="<?php _e("Select Default Icon", "wplivechat") ?>" />
646
+ <br/>
647
+ <input id="wplc_btn_remove_icon" name="wplc_btn_remove_icon" type="button" value="<?php _e("Remove Icon", "wplivechat") ?>" />
648
+ <?php _e("Recomended Size 50px x 50px", "wplivechat") ?>
649
+
650
+ <div id="wplc_default_chat_icons" style="display: none">
651
+ <strong><?php _e("Select Default Icon", "wplivechat"); ?></strong>
652
+ <img class="wplc_default_chat_icon_selector" src="<?php echo WPLC_PLUGIN_URL . '/images/chaticon.png'; ?>">
653
+ <img class="wplc_default_chat_icon_selector" src="<?php echo WPLC_PLUGIN_URL . '/images/default_icon_1.png'; ?>">
654
+ <img class="wplc_default_chat_icon_selector" src="<?php echo WPLC_PLUGIN_URL . '/images/default_icon_2.png'; ?>">
655
+ <img class="wplc_default_chat_icon_selector" src="<?php echo WPLC_PLUGIN_URL . '/images/default_icon_3.png'; ?>">
656
+ </div>
657
+
658
+ <style type="text/css">
659
+ #wplc_default_chat_icons {
660
+ margin-top: 10px;
661
+ padding: 5px;
662
+ border: 1px solid #eee;
663
+ border-radius: 5px;
664
+ }
665
+ #wplc_default_chat_icons strong {
666
+ display: block;
667
+ margin-bottom: 5px;
668
+ }
669
+ .wplc_default_chat_icon_selector {
670
+ background-color: #ccc;
671
+ display: inline-block;
672
+ vertical-align: top;
673
+ margin-right: 5px;
674
+ max-width: 50px;
675
+ border-radius: 100px;
676
+ }
677
+ .wplc_default_chat_icon_selector:hover {
678
+ cursor: pointer;
679
+ background-color: #bbb;
680
+ }
681
+ </style>
682
+ </td>
683
+ </tr>
684
+
685
+ <tr class='wplc-pic-area'>
686
+ <td width='300' valign='top'>
687
+ <?php _e("Picture", "wplivechat") ?>:
688
+ </td>
689
+ <td>
690
+ <span id="wplc_pic_area">
691
+ <img src="<?php echo $wplc_current_picture ?>" width="60px"/>
692
+ </span>
693
+ <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) ?>"/>
694
+ <br/>
695
+ <input id="wplc_btn_upload_pic" name="wplc_btn_upload_pic" type="button" value="<?php _e("Upload Image", "wplivechat") ?>" />
696
+ <br/>
697
+ <input id="wplc_btn_remove_pic" name="wplc_btn_remove_pic" type="button" value="<?php _e("Remove Image", "wplivechat") ?>" />
698
+ <?php _e("Recomended Size 60px x 60px", "wplivechat") ?>
699
+ </td>
700
+ </tr>
701
+
702
+ <!-- Chat Logo-->
703
+ <tr class='wplc-logo-area'>
704
+ <td width='300' valign='top'>
705
+ <?php _e("Logo", "wplivechat") ?>:
706
+ </td>
707
+ <td>
708
+ <span id="wplc_logo_area">
709
+ <img src="<?php echo trim($wplc_current_logo); ?>" width="100px"/>
710
+ </span>
711
+ <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) ?>"/>
712
+ <br/>
713
+ <input id="wplc_btn_upload_logo" name="wplc_btn_upload_logo" type="button" value="<?php _e("Upload Logo", "wplivechat") ?>" />
714
+ <br/>
715
+ <input id="wplc_btn_remove_logo" name="wplc_btn_remove_logo" type="button" value="<?php _e("Remove Logo", "wplivechat") ?>" />
716
+ <?php _e("Recomended Size 250px x 40px", "wplivechat") ?>
717
+ </td>
718
+ </tr>
719
+
720
+ <tr>
721
+ <td width='300' valign='top'>
722
+ <?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>
723
+ </td>
724
+ <td>
725
+ <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']) : ''; ?>" />
726
+ </td>
727
+ </tr>
728
+ <!-- Chat Notification if want to chat -->
729
+ <tr>
730
+ <td width='300' valign='top'>
731
+ <?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>
732
+ </td>
733
+ <td>
734
+ <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; } ?>/>
735
+ </td>
736
+ </tr>
737
+
738
+ </table>
739
+
740
+ <h3><?php _e("User Experience", 'wplivechat') ?></h3>
741
+ <hr>
742
+ <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='100%'>
743
+ <tbody>
744
+ <tr>
745
+ <td width='300' valign='top'><?php _e("Enable Text Editor", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Adds advanced text editor features, such as links, text styling, and more!", "wplivechat") ?>"></i></td>
746
+ <td><input id='wplc_ux_editor' name='wplc_ux_editor' type='checkbox' <?php echo((isset($wplc_settings['wplc_ux_editor']) && $wplc_settings['wplc_ux_editor'] != "0") ? "checked" : "") ?> /> </td>
747
+ </tr>
748
+ <tr>
749
+ <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>
750
+ <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>
751
+ </tr>
752
+ <tr>
753
+ <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>
754
+ <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>
755
+ </tr>
756
+ </tbody>
757
+ </table>
758
+
759
+ <h3><?php _e("Social", 'wplivechat') ?></h3>
760
+ <hr>
761
+
762
+ <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='100%'>
763
+ <tbody>
764
+ <tr>
765
+ <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>
766
+ <td><input id='wplc_social_fb' 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']) : "") ?>" /> </td>
767
+ </tr>
768
+ <tr>
769
+ <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>
770
+ <td><input id='wplc_social_tw' 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']) : "") ?>" /> </td>
771
+
772
+ </tr>
773
+ </tbody>
774
+ </table>
775
+
776
 
777
  <?php do_action('wplc_hook_admin_settings_chat_box_settings_after'); ?>
778
 
907
  </td>
908
  </tr>
909
  </table>
910
+
911
+ <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages'>
912
+ <tr>
913
+ <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>
914
+ <td>
915
+ <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 />
916
+ </td>
917
+ </tr>
918
+ <tr>
919
+ <td width="300" valign="top"><?php _e("Auto Responder 'From' Name", "wplivechat") ?>: </td>
920
+ <td>
921
+ <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']); } ?>" />
922
+ </td>
923
+ </tr>
924
+ <tr>
925
+ <td width="300" valign="top"><?php _e("Auto Responder 'From' Email Address", "wplivechat") ?>: </td>
926
+ <td>
927
+ <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']; } ?>" />
928
+ </td>
929
+ </tr>
930
+ <tr>
931
+ <td width="300" valign="top"><?php _e("Auto Responder Subject Line", "wplivechat") ?>: </td>
932
+ <td>
933
+ <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']; } ?>" />
934
+ </td>
935
+ </tr>
936
+ <tr>
937
+ <td width="300" valign="top"><?php _e("Auto Responder Body", "wplivechat") ?>: <br/></td>
938
+ <td>
939
+ <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>
940
+ <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>
941
+ </td>
942
+ </tr>
943
+ </table>
944
+
945
  </div>
946
 
947
 
1019
  <div class='wplc_theme_block'>
1020
  <div class='wplc_theme_image' id=''>
1021
  <div class='wplc_theme_single'>
1022
+ <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'/>
1023
  <?php _e('Classic', 'wplivechat'); ?>
1024
  </div>
1025
  <div class='wplc_theme_single'>
1026
+ <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'/>
1027
  <?php _e('Modern', 'wplivechat'); ?>
1028
  </div>
1029
 
1191
 
1192
  </td>
1193
  </tr>
 
 
 
 
 
 
 
 
1194
  <tr class="wplc_localization_strings">
1195
  <td width="200" valign="top"><?php _e("Welcome message", "wplivechat") ?>:</td>
1196
  <td>
1210
  <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 />
1211
  </td>
1212
  </tr>
 
 
 
 
 
 
 
 
1213
 
1214
  <tr>
1215
  <td><label for=""><?php _e('Choose an animation', 'wplivechat'); ?></label></td>
1255
  } ?>/>
1256
  </td>
1257
  </tr>
1258
+ <tr>
1259
+ <td width='300' valign='top'><?php _e("Auto First Response Message","wplivechat")?>:</td>
1260
+ <td>
1261
+ <input type="text" name="wplc_pro_auto_first_response_chat_msg" value="<?php echo $wplc_pro_auto_first_response_chat_msg; ?>">
1262
+ <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>
1263
+ </td>
1264
+ </tr>
1265
 
 
1266
  </table>
1267
  </div>
1268
  <div id="tabs-5">
1269
 
1270
 
1271
+ <?php
1272
+
1273
+ $user_array = get_users(array(
1274
+ 'meta_key' => 'wplc_ma_agent',
1275
+ ));
1276
+
1277
+ echo "<h3>".__('Current Users that are Chat Agents', 'wplivechat')."</h3>";
1278
+
1279
+ $wplc_agents = "<div class='wplc_agent_container'><ul>";
1280
+
1281
+ if ($user_array) {
1282
+ foreach ($user_array as $user) {
1283
+
1284
+ $wplc_agents .= "<li id=\"wplc_agent_li_".$user->ID."\">";
1285
+ $wplc_agents .= "<p><img src=\"//www.gravatar.com/avatar/" . md5($user->user_email) . "?s=80&d=mm\" /></p>";
1286
+ $check = get_user_meta($user->ID,"wplc_chat_agent_online");
1287
+ if ($check) {
1288
+ $wplc_agents .= "<span class='wplc_status_box wplc_type_returning'>".__("Online","wplivechat")."</span>";
1289
+ }
1290
+ $wplc_agents .= "<h3>" . $user->display_name . "</h3>";
1291
+
1292
+ $wplc_agents .= "<small>" . $user->user_email . "</small>";
1293
+
1294
+ $wplc_agents .= apply_filters("wplc_pro_agent_list_before_button_filter", "", $user);
1295
+
1296
+ if (get_current_user_id() == $user->ID) {
1297
+ } else {
1298
+ $wplc_agents .= "<p><button class='button button-secondary wplc_remove_agent' id='wplc_remove_agent_".$user->ID."' uid='".$user->ID."'>".__("Remove","wplivechat")."</button></p>";
1299
+ }
1300
+ $wplc_agents .= "</li>";
1301
+ }
1302
+ }
1303
+ echo $wplc_agents;
1304
+ ?>
1305
+ <li style='width:150px;' id='wplc_add_new_agent_box'>
1306
+ <p><i class='fa fa-plus-circle fa-4x' style='color:#ccc;' ></i></p>
1307
+ <h3><?php _e("Add New Agent","wplivechat"); ?></h3>
1308
+ <select id='wplc_agent_select'>
1309
+ <option value=''><?php _e("Select","wplivechat"); ?></option>
1310
+ <?php
1311
+ $blogusers = get_users( array( 'role' => 'administrator', 'fields' => array( 'display_name','ID','user_email' ) ) );
1312
+ // Array of stdClass objects.
1313
+ foreach ( $blogusers as $user ) {
1314
+ $is_agent = get_user_meta(esc_html( $user->ID ), 'wplc_ma_agent', true);
1315
+ if(!$is_agent){ echo '<option id="wplc_selected_agent_'. esc_html( $user->ID ) .'" em="' . md5(esc_html( $user->user_email )) . '" uid="' . esc_html( $user->ID ) . '" em2="' . esc_html( $user->user_email ) . '" name="' . esc_html( $user->display_name ) . '" value="' . esc_html( $user->ID ) . '">' . esc_html( $user->display_name ) . ' ('.__('Administrator','wplivechat').')</option>'; }
1316
+ }
1317
+ $blogusers = get_users( array( 'role' => 'editor', 'fields' => array( 'display_name','ID','user_email' ) ) );
1318
+ // Array of stdClass objects.
1319
+ foreach ( $blogusers as $user ) {
1320
+ $is_agent = get_user_meta(esc_html( $user->ID ), 'wplc_ma_agent', true);
1321
+ if(!$is_agent){ echo '<option id="wplc_selected_agent_'. esc_html( $user->ID ) .'" em="' . md5(esc_html( $user->user_email )) . '" uid="' . esc_html( $user->ID ) . '" em2="' . esc_html( $user->user_email ) . '" name="' . esc_html( $user->display_name ) . '" value="' . esc_html( $user->ID ) . '">' . esc_html( $user->display_name ) . ' ('.__('Editor','wplivechat').')</option>'; }
1322
+ }
1323
+ $blogusers = get_users( array( 'role' => 'author', 'fields' => array( 'display_name','ID','user_email' ) ) );
1324
+ // Array of stdClass objects.
1325
+ foreach ( $blogusers as $user ) {
1326
+ $is_agent = get_user_meta(esc_html( $user->ID ), 'wplc_ma_agent', true);
1327
+ if(!$is_agent){ echo '<option id="wplc_selected_agent_'. esc_html( $user->ID ) .'" em="' . md5(esc_html( $user->user_email )) . '" uid="' . esc_html( $user->ID ) . '" em2="' . esc_html( $user->user_email ) . '" name="' . esc_html( $user->display_name ) . '" value="' . esc_html( $user->ID ) . '">' . esc_html( $user->display_name ) . ' ('.__('Author','wplivechat').')</option>'; }
1328
+ }
1329
+ ?>
1330
+ </select>
1331
+ <p><button class='button button-secondary' id='wplc_add_agent'><?php _e("Add Agent","wplivechat"); ?></button></p>
1332
+ </li>
1333
+ </ul>
1334
+ </div>
1335
+
1336
+ <hr/>
1337
+ <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>
1338
+ <p class="description"><?php _e("If there are no chat agents online, the chat will show as offline", "wplivechat"); ?></p>
1339
 
1340
 
1341
  </div>
1361
  </table>
1362
  </div>
1363
 
1364
+ <?php
1365
+
1366
+ $content = "";
1367
+
1368
+ $content .= "<div id='wplc-business-hours'>";
1369
+
1370
+ $content .= "<h2>".__("Business Hours", "wplivechat")."</h2>";
1371
+ $content .= "<table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' >";
1372
+
1373
+ $content .= "<tr>";
1374
+ $content .= "<td width='300'>".__("Enable Business Hours", "wplivechat")."</td>";
1375
+ if( isset( $wplc_bh_settings['enabled'] ) && $wplc_bh_settings['enabled'] === true ) { $checked = 'checked'; } else { $checked = ''; }
1376
+ $content .= "<td><input type='checkbox' name='wplc_bh_enable' id='wplc_bh_enable' value='1' $checked /></td>";
1377
+ $content .= "</tr>";
1378
+
1379
+ $content .= "<tr>";
1380
+ $content .= "<td width='300'>".__("Display Interval", "wplivechat")."</td>";
1381
+ $content .= "<td>";
1382
+ $content .= "<select name='wplc_bh_interval' id='wplc_bh_interval'>";
1383
+ $wplc_intervals = array(
1384
+ '0' => __("Daily", "wplivechat"),
1385
+ '1' => __("Week Days", "wplivechat"),
1386
+ '2' => __("Weekends", "wplivechat")
1387
+ );
1388
+ $wplc_intervals = apply_filters( "wplc_bg_intervals_array", $wplc_intervals );
1389
+ if( $wplc_intervals ){
1390
+
1391
+ foreach( $wplc_intervals as $key => $val ){
1392
+ if( isset( $wplc_bh_settings['interval'] ) && $wplc_bh_settings['interval'] == $key ){ $sel = 'selected'; } else { $sel = ''; }
1393
+ $content .= "<option value='$key' $sel>$val</option>";
1394
+ }
1395
+
1396
+ }
1397
+ $content .= "</select><br/>";
1398
+
1399
+ $wplc_times_array = wplc_return_times_array_mrg();
1400
+
1401
+ $content .= __(" Between ", "wplivechat")."<select name='wplc_bh_hours_start' id='wplc_bh_hours_start'>";
1402
+ if( $wplc_times_array ){
1403
+ $hours = $wplc_times_array['hours'];
1404
+ foreach( $hours as $hour ){
1405
+ if( (isset( $wplc_bh_settings['start'] ) ) && ( isset( $wplc_bh_settings['start']['h'] ) && $wplc_bh_settings['start']['h'] == $hour ) ){ $sel = 'selected'; } else { $sel = ''; }
1406
+ $content .= "<option value='$hour' $sel>$hour</option>";
1407
+ }
1408
+ }
1409
+ $content .= "</select>:";
1410
+ $content .= "<select name='wplc_bh_minutes_start' id='wplc_bh_minutes_start'>";
1411
+ if( $wplc_times_array ){
1412
+ $minutes = $wplc_times_array['minutes'];
1413
+ foreach( $minutes as $minute ){
1414
+ if( (isset( $wplc_bh_settings['start'] ) ) && ( isset( $wplc_bh_settings['start']['m'] ) && $wplc_bh_settings['start']['m'] == $minute ) ){ $sel = 'selected'; } else { $sel = ''; }
1415
+ $content .= "<option value='$minute' $sel>$minute</option>";
1416
+ }
1417
+ }
1418
+ $content .= "</select>".__(" and ", "wplivechat");
1419
+ $content .= "<select name='wplc_bh_hours_end' id='wplc_bh_hours_end'>";
1420
+ if( $wplc_times_array ){
1421
+ $hours = $wplc_times_array['hours'];
1422
+ foreach( $hours as $hour ){
1423
+ if( (isset( $wplc_bh_settings['end'] ) ) && ( isset( $wplc_bh_settings['end']['h'] ) && $wplc_bh_settings['end']['h'] == $hour ) ){ $sel = 'selected'; } else { $sel = ''; }
1424
+ $content .= "<option value='$hour' $sel>$hour</option>";
1425
+ }
1426
+ }
1427
+ $content .= "</select>";
1428
+ $content .= "<select name='wplc_bh_minutes_end' id='wplc_bh_minutes_end'>";
1429
+ if( $wplc_times_array ){
1430
+ $minutes = $wplc_times_array['minutes'];
1431
+ foreach( $minutes as $minute ){
1432
+ if( (isset( $wplc_bh_settings['end'] ) ) && ( isset( $wplc_bh_settings['end']['m'] ) && $wplc_bh_settings['end']['m'] == $minute ) ){ $sel = 'selected'; } else { $sel = ''; }
1433
+ $content .= "<option value='$minute' $sel>$minute</option>";
1434
+ }
1435
+ }
1436
+ $content .= "</select>";
1437
+ $content .= "</td>";
1438
+ $content .= "</tr>";
1439
+
1440
+ $content .= "<tr>";
1441
+ $content .= "<td width='300'>".__("Current Site Time", "wplivechat")."</td>";
1442
+ $content .= "<td>";
1443
+ $content .= $current_time = current_time('mysql');
1444
+ $content .= "</td>";
1445
+ $content .= "</tr>";
1446
+
1447
+ $content .= "</table>";
1448
+ $content .= "</div>";
1449
+
1450
+ echo $content;
1451
+ ?>
1452
 
1453
+ <div id="tabs-9">
1454
+ <h3><?php _e("Chat Encryption", "wplivechat") ?></h3>
1455
+ <table class='form-table wp-list-table wplc_list_table widefat fixed striped pages' width='700'>
1456
+ <tr>
1457
+ <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>
1458
+ <td>
1459
+ <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'; } ?>/>
1460
+ </td>
1461
+ </tr>
1462
+ <tr>
1463
+ <td width='300'></td>
1464
+ <td>
1465
+ <p class='notice notice-error'>
1466
+ <?php _e('Please note: Chat messages will only be encrypted and decrypted if you have inserted your WP Live Chat Support API Key on the <a href="admin.php?page=wplivechat-menu-api-keys-page">API Keys page</a>.', 'wplivechat'); ?>
1467
+ <?php _e('Once enabled, all messages sent will be encrypted. This cannot be undone.', 'wplivechat'); ?>
1468
+ </p>
1469
+ </td>
1470
+ </tr>
1471
+ </table>
1472
+ </div>
1473
 
1474
  <?php do_action("wplc_hook_settings_page_more_tabs"); ?>
1475
 
includes/shortcodes.php CHANGED
@@ -1,29 +1,29 @@
1
- <?php
2
-
3
- add_filter("init","wplc_test",10,4);
4
-
5
- function wplc_test() {
6
- add_shortcode('wplc_live_chat', 'wplc_live_chat_box_shortcode');
7
- }
8
-
9
- function wplc_live_chat_box_shortcode( $atts, $content = null ) {
10
- $wplc_settings = get_option("WPLC_SETTINGS");
11
- $logged_in = apply_filters("wplc_loggedin_filter",false);
12
- $wplc_using_locale = (isset($wplc_settings['wplc_using_localization_plugin']) && $wplc_settings['wplc_using_localization_plugin'] == 1) ? true : false;
13
-
14
- $wplc_chat_box_content = wplc_theme_control_function($wplc_settings, $logged_in, $wplc_using_locale, $_COOKIE['wplc_cid']);
15
-
16
- // get attributes
17
- $atts = shortcode_atts(
18
- array(
19
- 'style' => 'normal'
20
- ),
21
- $atts,
22
- 'wplc_live_chat'
23
- );
24
-
25
- $output = '<div class="wplc_live_chat_support_shortcode wplc_' . $atts['style'] . '">';
26
- $output .= $wplc_chat_box_content;
27
- $output .= '</div">';
28
- return $output;
29
  }
1
+ <?php
2
+
3
+ add_filter("init","wplc_add_shortcode",10,4);
4
+
5
+ function wplc_add_shortcode() {
6
+ add_shortcode('wplc_live_chat', 'wplc_live_chat_box_shortcode');
7
+ }
8
+
9
+ function wplc_live_chat_box_shortcode( $atts, $content = null ) {
10
+ $wplc_settings = get_option("WPLC_SETTINGS");
11
+ $logged_in = apply_filters("wplc_loggedin_filter",false);
12
+ $wplc_using_locale = (isset($wplc_settings['wplc_using_localization_plugin']) && $wplc_settings['wplc_using_localization_plugin'] == 1) ? true : false;
13
+
14
+ $wplc_chat_box_content = wplc_theme_control_function($wplc_settings, $logged_in, $wplc_using_locale, $_COOKIE['wplc_cid']);
15
+
16
+ // get attributes
17
+ $atts = shortcode_atts(
18
+ array(
19
+ 'style' => 'normal'
20
+ ),
21
+ $atts,
22
+ 'wplc_live_chat'
23
+ );
24
+
25
+ $output = '<div class="wplc_live_chat_support_shortcode wplc_' . $atts['style'] . '">';
26
+ $output .= $wplc_chat_box_content;
27
+ $output .= '</div">';
28
+ return $output;
29
  }
includes/sounds/Air_Plane_Ding.mp3 ADDED
Binary file
includes/sounds/Doorbell.mp3 ADDED
Binary file
includes/sounds/Drop_Metal_Thing.mp3 ADDED
Binary file
includes/sounds/Elevator_Ding.mp3 ADDED
Binary file
includes/sounds/Mario_Jumping.mp3 ADDED
Binary file
includes/sounds/Music_Box.mp3 ADDED
Binary file
includes/sounds/Pin_Dropping.mp3 ADDED
Binary file
includes/sounds/Ringing_Phone.mp3 ADDED
Binary file
includes/sounds/Robot_Blip.mp3 ADDED
Binary file
includes/sounds/Rooster.mp3 ADDED
Binary file
includes/sounds/Ship_Bell.mp3 ADDED
Binary file
includes/sounds/Store_Door_Chime.mp3 ADDED
Binary file
includes/sounds/Two_Tone_Doorbell.mp3 ADDED
Binary file
beep-2.mp3 → includes/sounds/general/beep-2.mp3 RENAMED
File without changes
ding.mp3 → includes/sounds/general/ding.mp3 RENAMED
File without changes
ring.wav → includes/sounds/general/ring.wav RENAMED
File without changes
includes/sounds/message/Open_Ended.mp3 ADDED
Binary file
includes/surveys.php CHANGED
@@ -199,19 +199,6 @@ function wplc_filter_control_live_chat_box_pre_layer1($content) {
199
  }
200
 
201
 
202
- function wplc_is_survey_enabled() {
203
- $wplc_survey_data = get_option("WPLC_SURVEY_SETTINGS");
204
- $cnt = 0;
205
- if (isset($wplc_survey_data['wplc_enable_surveys']) && $wplc_survey_data['wplc_enable_surveys'] == "1") { $cnt++; }
206
- if (isset($wplc_survey_data['survey']) && $wplc_survey_data['survey'] !== null) { $cnt++; }
207
- if (isset($wplc_survey_data['lead_form']) && $wplc_survey_data['lead_form'] !== null) { $cnt++; }
208
-
209
- $cnt = apply_filter('wplc_filter_list_chats_actions');
210
-
211
- if ($cnt >= 2) { return true; }
212
- else { return false; }
213
-
214
- }
215
 
216
  add_action('wp_enqueue_scripts', 'wplc_nimble_load_scripts' , 99 );
217
  function wplc_nimble_load_scripts() {
@@ -305,8 +292,8 @@ function wplc_filter_survey_control_live_chat_box_html_hovercard_chat_button($wp
305
  remove_filter("wplc_filter_live_chat_box_hover_html_start_chat_button","wplc_filter_control_live_chat_box_html_hovercard_chat_button");
306
  if ($logged_in) {
307
  $wplc_sst_1 = __('Or chat to an agent now', 'wplivechat');
308
- if (!isset($wplc_settings['wplc_pro_sst1_survey']) || $wplc_settings['wplc_pro_sst1_survey'] == "") { $wplc_settings['wplc_pro_sst1_survey'] = $wplc_sst_1; }
309
- $text = ($wplc_using_locale ? $wplc_sst_1 : stripslashes($wplc_settings['wplc_pro_sst1_survey']));
310
  return "<button id=\"speeching_button\" type=\"button\" class='wplc-color-bg-1 wplc-color-2'>$text</button>";
311
  } else {
312
  $wplc_sst_1 = __('Leave a message', 'wplivechat');
199
  }
200
 
201
 
 
 
 
 
 
 
 
 
 
 
 
 
 
202
 
203
  add_action('wp_enqueue_scripts', 'wplc_nimble_load_scripts' , 99 );
204
  function wplc_nimble_load_scripts() {
292
  remove_filter("wplc_filter_live_chat_box_hover_html_start_chat_button","wplc_filter_control_live_chat_box_html_hovercard_chat_button");
293
  if ($logged_in) {
294
  $wplc_sst_1 = __('Or chat to an agent now', 'wplivechat');
295
+ if (!isset($settings['wplc_pro_sst1_survey']) || $settings['wplc_pro_sst1_survey'] == "") { $settings['wplc_pro_sst1_survey'] = $wplc_sst_1; }
296
+ $text = ($wplc_using_locale ? $wplc_sst_1 : stripslashes($settings['wplc_pro_sst1_survey']));
297
  return "<button id=\"speeching_button\" type=\"button\" class='wplc-color-bg-1 wplc-color-2'>$text</button>";
298
  } else {
299
  $wplc_sst_1 = __('Leave a message', 'wplivechat');
includes/templates/documentation-suggestion-item.html ADDED
@@ -0,0 +1 @@
 
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 ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <div class='wplc-ds-wrapper'>
2
+ <p class='wplc-ds-p'>
3
+ <strong class='wplc-ds-strong'>{doc_suggestion_header}</strong>
4
+ </p>
5
+ <ul class='wplc-ds-ul'>
6
+ {doc_suggestion_list}
7
+ </ul>
8
+ </div>
includes/update_control.class.php CHANGED
@@ -49,100 +49,16 @@ final class wplc_update_control {
49
  public function activate() {
50
  $this->wplc_extension_string = $this->wplc_title;
51
  $this->wplc_api_url = WLPC_UPDATE_SERVER.'/auth_api/api-control/';
52
-
53
- add_filter('pre_set_site_transient_update_plugins', array( $this, 'wplc_check_for_plugin_update' ));
54
- add_filter('plugins_api', array( $this, 'wplc_plugin_api_call' ), 10, 3);
55
  add_filter("wplc_filter_api_page",array( $this, "wplc_filter_control_api_page" ),10,1);
56
  add_action("admin_init",array( $this, "wplc_save_api" ));
57
  add_action("after_plugin_row_{$this->wplc_path}", array( $this, "wplc_plugin_row" ), 10, 3 );
58
  }
59
 
60
- public function wplc_check_for_plugin_update($checked_data) {
61
- global $wp_version;
62
-
63
- //Comment out these two lines during testing.
64
- if (empty($checked_data->checked))
65
- return $checked_data;
66
-
67
- if ( empty( $checked_data->checked[$this->wplc_api_slug . '/' . $this->wplc_api_slug . '.php'] ) ) {
68
- $plugin_data = get_plugin_data( trailingslashit( dirname( dirname( dirname( __FILE__ ) ) ) ) . $this->wplc_api_slug . '/' . $this->wplc_api_slug . '.php' );
69
- if ( ! empty( $plugin_data['Version'] ) ) {
70
- $version = $plugin_data['Version'];
71
- } else {
72
- $version = '0.0';
73
- }
74
- } else {
75
- $version = $checked_data->checked[$this->wplc_api_slug . '/' . $this->wplc_api_slug . '.php'];
76
- }
77
-
78
- $args = array(
79
- 'slug' => $this->wplc_api_slug,
80
- 'version' => $version,
81
- );
82
-
83
- $request_string = array(
84
- 'body' => array(
85
- 'action' => 'basic_check',
86
- 'request' => serialize($args),
87
- 'api_key' => get_option($this->wplc_option),
88
- 'd' => get_option('siteurl'),
89
- 'ip' => $_SERVER['SERVER_ADDR']
90
- ),
91
- 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo('url')
92
- );
93
- // Start checking for an update
94
- $raw_response = wp_remote_post($this->wplc_api_url, $request_string);
95
-
96
- if (!is_wp_error($raw_response) && ($raw_response['response']['code'] == 200))
97
- $response = unserialize($raw_response['body']);
98
-
99
- if (is_object($response) && !empty($response)) // Feed the update data into WP updater
100
- $checked_data->response[$this->wplc_api_slug . '/' . $this->wplc_api_slug . '.php'] = $response;
101
-
102
- return $checked_data;
103
- }
104
-
105
- public function wplc_plugin_api_call($def, $action, $args) {
106
-
107
- global $wp_version;
108
-
109
- if (!isset($args->slug) || ($args->slug != $this->wplc_api_slug))
110
- return false;
111
-
112
- // Get the current version
113
- $plugin_info = get_site_transient('update_plugins');
114
- $current_version = $plugin_info->checked[$this->wplc_api_slug . '/' . $this->wplc_api_slug . '.php'];
115
- $args->version = $current_version;
116
-
117
- $request_string = array(
118
- 'body' => array(
119
- 'action' => $action,
120
- 'request' => serialize($args),
121
- 'api_key' => get_option($this->wplc_option),
122
- 'd' => get_option('siteurl'),
123
- 'ip' => $_SERVER['SERVER_ADDR']
124
- ),
125
- 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo('url')
126
- );
127
-
128
- $request = wp_remote_post($this->wplc_api_url, $request_string);
129
-
130
- if (is_wp_error($request)) {
131
- $res = new WP_Error('plugins_api_failed', __('An Unexpected HTTP Error occurred during the API request.</p> <p><a href="?" onclick="document.location.reload(); return false;">Try again</a>'), $request->get_error_message());
132
- } else {
133
- $res = unserialize($request['body']);
134
-
135
- if ($res === false)
136
- $res = new WP_Error('plugins_api_failed', __('An unknown error occurred'), $request['body']);
137
- }
138
-
139
- return $res;
140
- }
141
-
142
  public function wplc_filter_control_api_page($page_content) {
143
  if (get_option($this->wplc_option)) {
144
  $args = array(
145
- 'slug' => $this->wplc_api_slug,
146
  );
147
  $data_array = array(
148
  'method' => 'POST',
49
  public function activate() {
50
  $this->wplc_extension_string = $this->wplc_title;
51
  $this->wplc_api_url = WLPC_UPDATE_SERVER.'/auth_api/api-control/';
 
 
 
52
  add_filter("wplc_filter_api_page",array( $this, "wplc_filter_control_api_page" ),10,1);
53
  add_action("admin_init",array( $this, "wplc_save_api" ));
54
  add_action("after_plugin_row_{$this->wplc_path}", array( $this, "wplc_plugin_row" ), 10, 3 );
55
  }
56
 
57
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  public function wplc_filter_control_api_page($page_content) {
59
  if (get_option($this->wplc_option)) {
60
  $args = array(
61
+ 'slug' => 'wp-live-chat-support-pro',
62
  );
63
  $data_array = array(
64
  'method' => 'POST',
includes/welcome_page.php DELETED
@@ -1,155 +0,0 @@
1
- <?php //global $wpgmza_global_array; ?>
2
- <div class="wrap about-wrap">
3
- <p>&nbsp;</p>
4
- <h1 style='margin-right: 0;'><?php _e("Welcome to WP Live Chat Support v8","wplivechat"); ?> <div class="wplc-badge" style=' float: right; display: block; max-width: 20%; margin-left: 15%;'><img src='<?php echo WPLC_BASIC_PLUGIN_URL . "images/wplc-logo.png"; ?>' /></div></h1>
5
-
6
- <div class="about-text"><?php _e("WP Live Chat Support is the most cost effective, feature rich, amazingly supported and most positively reviewed live chat plugin on WordPress!","wplivechat"); ?></div>
7
-
8
- <a class="button-primary" style='padding:5px; padding-right:15px; padding-left:15px; height:inherit;' href="admin.php?page=wplivechat-menu&override=1"><?php echo __("Skip intro and start accepting chats","wplivechat"); ?></a>
9
- <p>&nbsp;</p>
10
-
11
- <?php
12
-
13
- if( !isset( $_GET['action'] ) ){
14
- $welcome_active = 'nav-tab-active';
15
- $credits_active = '';
16
- } else {
17
- if( $_GET['action'] == 'welcome' ){
18
- $welcome_active = 'nav-tab-active';
19
- $credits_active = '';
20
- } else if( $_GET['action'] == 'credits' ){
21
- $credits_active = 'nav-tab-active';
22
- $welcome_active = '';
23
- }
24
- }
25
-
26
- ?>
27
- <h2 class="nav-tab-wrapper wp-clearfix">
28
- <a href="admin.php?page=wplivechat-menu&action=welcome" class="nav-tab <?php echo $welcome_active; ?>"><?php _e("Welcome","wplivechat"); ?></a>
29
- <a href="admin.php?page=wplivechat-menu&action=credits" class="nav-tab <?php echo $credits_active; ?>"><?php _e("Credits","wplivechat"); ?></a>
30
-
31
- </h2>
32
- <?php if( !isset( $_GET['action'] ) || ( isset( $_GET['action'] ) && $_GET['action'] == 'welcome' ) ){ ?>
33
- <h2>What's new in Version 8?</h2>
34
- <center><img src='<?php echo WPLC_BASIC_PLUGIN_URL; ?>/images/performance.png' style='width:300px;' /></center>
35
- <div class="feature-section three-col">
36
- <div class="col">
37
- <div style='text-align: center;' ><i class="fa-4x fa fa-bolt" aria-hidden="true"></i><br/><h4><?php _e("Incredibly fast server","wplivechat"); ?></h4></div>
38
-
39
- <p style='text-align: center;'><?php _e("Use our server to handle the load and save 1000%+ on server resources!","wplivechat"); ?></p>
40
- </div>
41
- <div class="col">
42
- <div style='text-align: center;' ><i class="fa-4x fa fa-dashboard" aria-hidden="true"></i><br/><h4><?php _e("New Dashboard","wplivechat"); ?></h4></div>
43
- <p style='text-align: center;'><?php _e("Handle all your chats in one area, on any admin page.","wplivechat"); ?></p>
44
- </div>
45
- <div class="col">
46
- <div style='text-align: center;' ><i class="fa-4x fa fa-smile-o" aria-hidden="true"></i><br/><h4><?php _e("Emojis!","wplivechat"); ?></h4></div>
47
- <p style='text-align: center;'><?php _e("Add a touch of your own personality with emojis!","wplivechat"); ?></p>
48
- </div>
49
- </div>
50
-
51
- <h2>New Pro features</h2>
52
- <div class="feature-section three-col">
53
- <div class="col">
54
- <div style='text-align: center;' ><i class="fa-4x fa fa-commenting-o" aria-hidden="true"></i><br/><h4><?php _e("Typing Preview","wplivechat"); ?></h4></div>
55
-
56
- <p style='text-align: center;'><?php _e("See what your customers are typing before they even send it!","wplivechat"); ?></p>
57
- </div>
58
- <div class="col">
59
- <div style='text-align: center;' ><i class="fa-4x fa fa-users" aria-hidden="true"></i><br/><h4><?php _e("Multiple Agents Per Chat","wplivechat"); ?></h4></div>
60
-
61
- <p style='text-align: center;'><?php _e("More than one agent can join and be involved in a chat.","wplivechat"); ?></p>
62
- </div>
63
- <div class="col">
64
- <div style='text-align: center;' ><i class="fa-4x fa fa-random" aria-hidden="true"></i><br/><h4><?php _e("Agent to Agent Chat","wplivechat"); ?></h4></div>
65
-
66
- <p style='text-align: center;'><?php _e( "Chat directly to other agents on our new dashboard.","wplivechat"); ?></p>
67
- </div>
68
- </div>
69
- <div class="feature-section three-col">
70
- <div class="col">
71
- <div style='text-align: center;' ><i class="fa-4x fa fa-eraser" aria-hidden="true"></i><br/><h4><?php _e("Edit Messages","wplivechat"); ?></h4></div>
72
-
73
- <p style='text-align: center;'><?php _e("Simply press the UP arrow or use the EDIT link to edit a message that you have already sent.","wplivechat"); ?></p>
74
- </div>
75
- <div class="col">
76
- <div style='text-align: center;' ><i class="fa-4x fa fa-heartbeat" aria-hidden="true"></i><br/><h4><?php _e("Event Monitoring","wplivechat"); ?></h4></div>
77
-
78
- <p style='text-align: center;'><?php _e("Know exactly what the user is doing in real time.","wplivechat"); ?></p>
79
- </div>
80
- <div class="col">
81
- <div style='text-align: center;' ><i class="fa-4x fa fa-apple" aria-hidden="true"></i><br/><h4><?php _e("iOS app","wplivechat"); ?></h4></div>
82
-
83
- <p style='text-align: center;'><?php _e( "The new iOS app is finally here!","wplivechat"); ?></p>
84
- </div>
85
- </div>
86
-
87
- <hr />
88
-
89
- <div class="feature-section normal clear" >
90
- <div class="changelog ">
91
- <!--<h2 style="font-size: 25px; text-align: left;"><?php _e('How did you find us?', 'wplivechat'); ?></h2>
92
- <form method="post" name="wplc_find_us_form" style="font-size: 16px;">
93
- <div style="text-align: left; width:275px;">
94
- <input type="radio" name="wplc_find_us" id="wordpress" value='repository'>
95
- <label for="wordpress">
96
- <?php _e('WordPress.org plugin repository ', 'wplivechat'); ?>
97
- </label>
98
- <br/>
99
- <input type='text' placeholder="<?php _e('Search Term', 'wplivechat'); ?>" name='wplc_nl_search_term' style='margin-top:5px; margin-left: 23px; width: 100% '>
100
- <br/>
101
- <input type="radio" name="wplc_find_us" id="search_engine" value='search_engine'>
102
- <label for="search_engine">
103
- <?php _e('Google or other search Engine', 'wplivechat'); ?>
104
- </label>
105
- <br/>
106
- <input type="radio" name="wplc_find_us" id="friend" value='friend'>
107
-
108
- <label for='friend'>
109
- <?php _e('Friend recommendation', 'wplivechat'); ?>
110
- </label>
111
- <br/>
112
- <input type="radio" name="wplc_find_us" id='other' value='other'>
113
-
114
- <label for='other'>
115
- <?php _e('Other', 'wplivechat'); ?>
116
- </label>
117
- <br/>
118
-
119
- <textarea placeholder="<?php _e('Please Explain', 'wplivechat'); ?>" style='margin-top:5px; margin-left: 23px; width: 100%' name='wplc_nl_findus_other_url'></textarea>
120
- </div>
121
- <div>
122
-
123
- </div>
124
- <div>
125
-
126
- </div>
127
- <div style='margin-top: 20px;'>
128
- <button name='action' value='wplc_submit_find_us' class="button-primary" style=""><?php _e('Submit', 'wplivechat'); ?></button> <a href='<?php echo admin_url("/admin.php?page=wplivechat-menu&override=1"); ?>'class="button"><?php _e('Skip', 'wplivechat'); ?></a>
129
- </div>
130
- </form>
131
- <br/><br/>
132
-
133
- <hr /> -->
134
-
135
- <div class="feature-section three-col">
136
- <div class='col'>
137
- <h4><?php _e("New to WP Live Chat Support?","wplivechat"); ?></h4>
138
- <p><?php _e("You may want to","wp-google-maps"); ?> <a href='https://wp-livechat.com/documentation/' target='_blank' title='Documentation'><?php _e("review our documentation","wplivechat"); ?></a> <?php _e("before you get started. If you're a tech-savvy individual, you may skip this step.","wplivechat"); ?></p>
139
- </div>
140
- <div class='col'>
141
- <h4><?php _e("Help me!","wplivechat"); ?></h4>
142
- </div>
143
- </div>
144
-
145
- <a class="button-primary" style='padding:5px; padding-right:15px; padding-left:15px; height:inherit;' href="admin.php?page=wplivechat-menu&override=1"><?php echo __("OK! Let's start","wplivechat"); ?></a>
146
-
147
- </div>
148
- </div>
149
-
150
- </div>
151
- <?php } else {
152
- $path = plugin_dir_path(__FILE__).'credits.php';
153
- include $path;
154
- }
155
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/wplc_agent_data.php ADDED
@@ -0,0 +1,291 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ add_action( 'edit_user_profile', 'wplc_user_profile_fields_mrg' );
4
+ add_action( 'show_user_profile', 'wplc_user_profile_fields_mrg' );
5
+ function wplc_user_profile_fields_mrg( $user ){
6
+ $ret = "";
7
+ $ret .= "<a name='wplc-user-fields'></a><h2>".__( 'WP Live Chat Support - User Fields', 'wplivechat' )."</h2>";
8
+ $ret .= "<table class='form-table'>";
9
+ $ret .= "<tr>";
10
+ $ret .= "<th>";
11
+ $ret .= "<label for='wplc_user_tagline'>".__('User tagline', 'wplivechat')."</label>";
12
+ $ret .= "</th>";
13
+ $ret .= "<td>";
14
+ $ret .= "<label for='wplc_user_tagline'>";
15
+ if ( get_the_author_meta( 'wplc_user_tagline', $user->ID ) != "" ) { $predefined = get_the_author_meta( 'wplc_user_tagline', $user->ID ); } else { $predefined = ""; }
16
+ $ret .= "<textarea name='wplc_user_tagline' id='wplc_user_tagline' rows='6'>$predefined</textarea><br/>";
17
+ $ret .= "<small>".__( 'This will show up at the top of the chatbox - Leave blank to disable.', 'wplivechat' )."</small>";
18
+ $ret .= "</label>";
19
+ $ret .= "</td>";
20
+ $ret .= "</tr>";
21
+
22
+ $ret .= "<tr>";
23
+ $ret .= "<th>";
24
+ $ret .= "<label for='wplc_user_bio'>".__('User bio', 'wplivechat')."</label>";
25
+ $ret .= "</th>";
26
+ $ret .= "<td>";
27
+ $ret .= "<label for='wplc_user_bio'>";
28
+ if ( get_the_author_meta( 'wplc_user_bio', $user->ID ) != "" ) { $predefined = get_the_author_meta( 'wplc_user_bio', $user->ID ); } else { $predefined = ""; }
29
+ $ret .= "<textarea name='wplc_user_bio' id='wplc_user_bio' rows='6'>$predefined</textarea><br/>";
30
+ $ret .= "<small>".__( 'This will show up at the top of the chatbox - Leave blank to disable.', 'wplivechat' )."</small>";
31
+ $ret .= "</label>";
32
+ $ret .= "</td>";
33
+ $ret .= "</tr>";
34
+
35
+ $ret .= "<tr>";
36
+ $ret .= "<th>";
37
+ $ret .= "<label for='wplc_user_social_accounts'>".__('User social accounts', 'wplivechat')."</label>";
38
+ $ret .= "</th>";
39
+ $ret .= "<td>";
40
+ $ret .= "<label for='wplc_user_twitter'>";
41
+ if ( get_the_author_meta( 'wplc_user_twitter', $user->ID ) != "" ) { $predefined = get_the_author_meta( 'wplc_user_twitter', $user->ID ); } else { $predefined = ""; }
42
+ $ret .= "<input name='wplc_user_twitter' id='wplc_user_twitter' value='$predefined' /> <em>".__("Twitter URL","wplivechat")."</em><br/>";
43
+ $ret .= "</label>";
44
+ $ret .= "<label for='wplc_user_linkedin'>";
45
+ if ( get_the_author_meta( 'wplc_user_linkedin', $user->ID ) != "" ) { $predefined = get_the_author_meta( 'wplc_user_linkedin', $user->ID ); } else { $predefined = ""; }
46
+ $ret .= "<input name='wplc_user_linkedin' id='wplc_user_linkedin' value='$predefined' /> <em>".__("LinkedIn URL","wplivechat")."</em><br/>";
47
+ $ret .= "</label>";
48
+ $ret .= "<label for='wplc_user_facebook'>";
49
+ if ( get_the_author_meta( 'wplc_user_facebook', $user->ID ) != "" ) { $predefined = get_the_author_meta( 'wplc_user_facebook', $user->ID ); } else { $predefined = ""; }
50
+ $ret .= "<input name='wplc_user_facebook' id='wplc_user_facebook' value='$predefined' /> <em>".__("Facebook URL","wplivechat")."</em><br/>";
51
+ $ret .= "</label>";
52
+ $ret .= "<label for='wplc_user_website'>";
53
+ if ( get_the_author_meta( 'wplc_user_website', $user->ID ) != "" ) { $predefined = get_the_author_meta( 'wplc_user_website', $user->ID ); } else { $predefined = ""; }
54
+ $ret .= "<input name='wplc_user_website' id='wplc_user_website' value='$predefined' /> <em>".__("Website URL","wplivechat")."</em><br/>";
55
+ $ret .= "</label>";
56
+ $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>";
57
+ $ret .= "</label>";
58
+ $ret .= "</td>";
59
+ $ret .= "</tr>";
60
+
61
+ $ret .= "</table>";
62
+ echo $ret;
63
+ }
64
+ add_action('edit_user_profile_update', 'wplc_save_user_profile_data_mrg');
65
+ add_action('personal_options_update', 'wplc_save_user_profile_data_mrg');
66
+ function wplc_save_user_profile_data_mrg( $user_id ){
67
+ if (!current_user_can('edit_user', $user_id)) {
68
+ return false;
69
+ }
70
+ if( isset( $_POST['wplc_user_tagline'] ) ){
71
+ $predefined_response = wp_kses( nl2br( $_POST['wplc_user_tagline'] ), array( 'br' ) );
72
+ update_user_meta( $user_id, 'wplc_user_tagline', $predefined_response );
73
+ }
74
+ if( isset( $_POST['wplc_user_bio'] ) ){
75
+ $predefined_response = wp_kses( nl2br( $_POST['wplc_user_bio'] ), array( 'br' ) );
76
+ update_user_meta( $user_id, 'wplc_user_bio', $predefined_response );
77
+ }
78
+ if( isset( $_POST['wplc_user_twitter'] ) ){
79
+ $predefined_response = wp_kses( nl2br( $_POST['wplc_user_twitter'] ), array( 'br' ) );
80
+ update_user_meta( $user_id, 'wplc_user_twitter', $predefined_response );
81
+ }
82
+ if( isset( $_POST['wplc_user_linkedin'] ) ){
83
+ $predefined_response = wp_kses( nl2br( $_POST['wplc_user_linkedin'] ), array( 'br' ) );
84
+ update_user_meta( $user_id, 'wplc_user_linkedin', $predefined_response );
85
+ }
86
+ if( isset( $_POST['wplc_user_facebook'] ) ){
87
+ $predefined_response = wp_kses( nl2br( $_POST['wplc_user_facebook'] ), array( 'br' ) );
88
+ update_user_meta( $user_id, 'wplc_user_facebook', $predefined_response );
89
+ }
90
+ if( isset( $_POST['wplc_user_website'] ) ){
91
+ $predefined_response = wp_kses( nl2br( $_POST['wplc_user_website'] ), array( 'br' ) );
92
+ update_user_meta( $user_id, 'wplc_user_website', $predefined_response );
93
+ }
94
+
95
+ }
96
+
97
+
98
+
99
+ add_filter("wplc_filter_further_live_chat_box_above_main_div","wplc_mrg_filter_control_live_chat_box_above_main_div",10,5);
100
+ function wplc_mrg_filter_control_live_chat_box_above_main_div( $msg, $wplc_settings, $cid, $chat_data, $agent ) {
101
+ if (isset($wplc_settings['wplc_newtheme']) && $wplc_settings['wplc_newtheme'] == "theme-2") {
102
+
103
+ $agent_info = '';
104
+ $cbox_header_bg = '';
105
+ $agent_tagline = '';
106
+ $agent_bio = '';
107
+
108
+ $a_twitter = '';
109
+ $a_linkedin = '';
110
+ $a_facebook = '';
111
+ $a_website = '';
112
+ $social_links = '';
113
+ if ( $cid ) {
114
+
115
+
116
+ if ( isset( $chat_data->agent_id ) ) {
117
+ $agent_id = intval( $chat_data->agent_id );
118
+ } else {
119
+ $agent_id = get_current_user_id();
120
+ }
121
+
122
+ if ( $agent_id ) {
123
+
124
+
125
+ $tagline = get_user_meta( $agent_id, 'wplc_user_tagline', true );
126
+ if( $tagline !== "" ){
127
+ $agent_tagline = $tagline;
128
+ $agent_tagline = '<span class="wplc_agent_infosection wplc_agent_tagline wplc-color-2">'.$agent_tagline.'</span>';
129
+ }
130
+ $bio = get_user_meta( $agent_id, 'wplc_user_bio', true );
131
+ if( $bio !== "" ){
132
+ $agent_bio = $bio;
133
+ $agent_bio = '<span class="wplc_agent_infosection wplc_agent_bio wplc-color-2">'.$agent_bio.'</span>';
134
+ }
135
+
136
+ $a_twitter = get_user_meta( $agent_id, 'wplc_user_twitter', true );
137
+ $a_linkedin = get_user_meta( $agent_id, 'wplc_user_linkedin', true );
138
+ $a_facebook = get_user_meta( $agent_id, 'wplc_user_facebook', true );
139
+ $a_website = get_user_meta( $agent_id, 'wplc_user_website', true );
140
+
141
+
142
+
143
+ if ($a_twitter === '' && $a_linkedin === '' && $a_facebook === '' && $a_website === '') {
144
+ $social_links = '';
145
+ } else {
146
+ $social_links = '<span class="wplc_agent_infosection wplc_agent_social_links wplc-color-2">';
147
+ if ($a_twitter !== '') {
148
+ $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; ';
149
+ }
150
+ if ($a_linkedin !== '') {
151
+ $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; ';
152
+ }
153
+ if ($a_facebook !== '') {
154
+ $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; ';
155
+ }
156
+ if ($a_website !== '') {
157
+ $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; ';
158
+ }
159
+ $social_links .= '</span>';
160
+ }
161
+
162
+ $msg = $agent_tagline.''.$agent_bio.''.$social_links;
163
+
164
+ }
165
+ }
166
+
167
+
168
+
169
+ }
170
+ return $msg;
171
+ }
172
+
173
+ add_filter( "wplc_filter_agent_data_social_links", "wplc_mrg_filter_control_agent_data_social_links", 10, 7 );
174
+ function wplc_mrg_filter_control_agent_data_social_links( $social_links, $cid, $chat_data, $agent, $wplc_acbc_data, $user_info, $data ) {
175
+ if( !isset( $data ) ){ $data = false; }
176
+ if (!isset($data) || !isset($data['aid'])) {
177
+ $data = array();
178
+ if (isset($chat_data) && is_object($chat_data) && isset($chat_data->agent_id)) {
179
+ $data['aid'] = $chat_data->agent_id;
180
+ }
181
+ }
182
+
183
+
184
+ $a_twitter = get_user_meta( intval($data['aid']), 'wplc_user_twitter', true );
185
+ $a_linkedin = get_user_meta( intval($data['aid']), 'wplc_user_linkedin', true );
186
+ $a_facebook = get_user_meta( intval($data['aid']), 'wplc_user_facebook', true );
187
+ $a_website = get_user_meta( intval($data['aid']), 'wplc_user_website', true );
188
+
189
+ if ($a_twitter === '' && $a_linkedin === '' && $a_facebook === '' && $a_website === '') {
190
+ $social_links = '';
191
+ } else {
192
+ $social_links = '<span class="wplc_agent_infosection wplc_agent_social_links wplc-color-2">';
193
+ if ($a_twitter !== '') {
194
+ $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; ';
195
+ }
196
+ if ($a_linkedin !== '') {
197
+ $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; ';
198
+ }
199
+ if ($a_facebook !== '') {
200
+ $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; ';
201
+ }
202
+ if ($a_website !== '') {
203
+ $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; ';
204
+ }
205
+ $social_links .= '</span>';
206
+ }
207
+ return $social_links;
208
+ }
209
+
210
+ add_filter( "wplc_filter_agent_data_agent_bio", "wplc_mrg_filter_control_agent_data_agent_bio", 10, 7 );
211
+ function wplc_mrg_filter_control_agent_data_agent_bio( $agent_bio, $cid, $chat_data, $agent, $wplc_acbc_data, $user_info, $data ) {
212
+ if( !isset( $data ) ){ $data = false; }
213
+ $bio = get_user_meta( intval($chat_data->agent_id), 'wplc_user_bio', true );
214
+ if( $bio !== "" ){
215
+ $agent_bio = $bio;
216
+ $agent_bio = '<span class="wplc_agent_infosection wplc_agent_bio wplc-color-2">'.$agent_bio.'</span>';
217
+ }
218
+ return $agent_bio;
219
+ }
220
+
221
+ add_filter( "wplc_filter_agent_data_agent_tagline", "wplc_mrg_filter_control_agent_data_agent_tagline", 10, 7 );
222
+ function wplc_mrg_filter_control_agent_data_agent_tagline( $agent_tagline, $cid, $chat_data, $agent, $wplc_acbc_data, $user_info, $data ) {
223
+ if( !isset( $data ) ){ $data = false; }
224
+ $tagline = get_user_meta( intval($chat_data->agent_id), 'wplc_user_tagline', true );
225
+ if( $tagline !== "" ){
226
+ $agent_tagline = $tagline;
227
+ $agent_tagline = '<span class="wplc_agent_infosection wplc_agent_tagline wplc-color-2">'.$agent_tagline.'</span>';
228
+ }
229
+ return $agent_tagline;
230
+ }
231
+
232
+
233
+
234
+
235
+
236
+
237
+ add_filter( "wplc_filter_simple_agent_data_agent_bio", "wplc_mrg_filter_simple_control_agent_data_agent_bio", 10, 2 );
238
+ function wplc_mrg_filter_simple_control_agent_data_agent_bio( $agent_bio, $agent_id ) {
239
+ if( !isset( $data ) ){ $data = false; }
240
+ $bio = get_user_meta( intval($agent_id), 'wplc_user_bio', true );
241
+ if( $bio !== "" ){
242
+ $agent_bio = $bio;
243
+ $agent_bio = '<span class="wplc_agent_infosection wplc_agent_bio wplc-color-2">'.$agent_bio.'</span>';
244
+ }
245
+ return $agent_bio;
246
+ }
247
+
248
+ add_filter( "wplc_filter_simple_agent_data_agent_tagline", "wplc_mrg_filter_simple_control_agent_data_agent_tagline", 10, 2 );
249
+ function wplc_mrg_filter_simple_control_agent_data_agent_tagline( $agent_tagline, $agent_id ) {
250
+ if( !isset( $data ) ){ $data = false; }
251
+ $tagline = get_user_meta( intval($agent_id), 'wplc_user_tagline', true );
252
+ if( $tagline !== "" ){
253
+ $agent_tagline = $tagline;
254
+ $agent_tagline = '<span class="wplc_agent_infosection wplc_agent_tagline wplc-color-2">'.$agent_tagline.'</span>';
255
+ }
256
+ return $agent_tagline;
257
+ }
258
+
259
+
260
+
261
+
262
+ add_filter( "wplc_filter_simple_agent_data_social_links", "wplc_mrg_filter_simple_control_agent_data_social_links", 10, 2 );
263
+ function wplc_mrg_filter_simple_control_agent_data_social_links( $social_links, $agent_id ) {
264
+
265
+
266
+ $a_twitter = get_user_meta( intval($agent_id), 'wplc_user_twitter', true );
267
+ $a_linkedin = get_user_meta( intval($agent_id), 'wplc_user_linkedin', true );
268
+ $a_facebook = get_user_meta( intval($agent_id), 'wplc_user_facebook', true );
269
+ $a_website = get_user_meta( intval($agent_id), 'wplc_user_website', true );
270
+
271
+ if ($a_twitter === '' && $a_linkedin === '' && $a_facebook === '' && $a_website === '') {
272
+ $social_links = '';
273
+ } else {
274
+ $social_links = '<span class="wplc_agent_infosection wplc_agent_social_links wplc-color-2">';
275
+ if ($a_twitter !== '') {
276
+ $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; ';
277
+ }
278
+ if ($a_linkedin !== '') {
279
+ $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; ';
280
+ }
281
+ if ($a_facebook !== '') {
282
+ $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; ';
283
+ }
284
+ if ($a_website !== '') {
285
+ $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; ';
286
+ }
287
+ $social_links .= '</span>';
288
+ }
289
+ return $social_links;
290
+ }
291
+
includes/wplc_custom_fields.php ADDED
@@ -0,0 +1,515 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ add_action( "wplc_pro_update_db_hook", "wplc_custom_fields_tables_mrg" );
4
+ function wplc_custom_fields_tables_mrg(){
5
+ global $wpdb;
6
+ global $wplc_custom_fields;
7
+ $wplc_custom_fields = $wpdb->prefix."wplc_custom_fields";
8
+ $sql = "
9
+ CREATE TABLE " . $wplc_custom_fields . " (
10
+ id int(11) NOT NULL AUTO_INCREMENT,
11
+ field_name varchar(700) NOT NULL,
12
+ field_type int(11) NOT NULL,
13
+ field_content varchar(700) NOT NULL,
14
+ status tinyint(1) NOT NULL,
15
+ PRIMARY KEY (id)
16
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
17
+ ";
18
+
19
+ dbDelta($sql);
20
+ }
21
+
22
+ function wplc_custom_fields_page(){
23
+
24
+ wplc_enqueue_admin_styles_mrg();
25
+
26
+
27
+ if ( ( isset( $_GET['wplc_action'] ) && $_GET['wplc_action'] == 'delete_custom_field' ) && isset( $_GET['fid'] ) && ( isset( $_GET['confirmed'] ) && $_GET['confirmed'] == 'true' ) ) {
28
+
29
+ $custom_field_id = sanitize_text_field( $_GET['fid'] );
30
+
31
+ wplc_delete_custom_field_mrg( $custom_field_id );
32
+ }
33
+
34
+ if( isset( $_GET['wplc_action'] ) && $_GET['wplc_action'] == 'add_custom_field' ){
35
+
36
+ wplc_custom_fields_add_page_mrg();
37
+
38
+ } else if ( isset( $_GET['wplc_action'] ) && $_GET['wplc_action'] == 'edit_custom_field' ){
39
+
40
+ $custom_field_id = sanitize_text_field( $_GET['fid'] );
41
+
42
+ wplc_custom_fields_edit_page_mrg( $custom_field_id );
43
+
44
+ } else if ( isset( $_GET['wplc_action'] ) && $_GET['wplc_action'] == 'delete_custom_field' ){
45
+
46
+ $custom_field_id = sanitize_text_field( $_GET['fid'] );
47
+
48
+ wplc_custom_fields_delete_page_mrg( $custom_field_id );
49
+
50
+ } else {
51
+
52
+ wplc_custom_fields_display_page_mrg();
53
+
54
+ }
55
+
56
+ }
57
+
58
+ function wplc_custom_fields_display_page_mrg(){
59
+
60
+ $wplc_add_button = isset($_GET['wplc_action']) ? "" : "<a href='?page=wplivechat-menu-custom-fields&wplc_action=add_custom_field' class='wplc_add_new_btn'>". __("Add New", 'wp-livechat') ."</a>";
61
+
62
+ $content = "<div class='wrap wplc_wrap'>";
63
+
64
+ $content .= "<h2>".__('WP Live Chat Support Custom Fields', 'wp-livechat'). $wplc_add_button . "</h2>";
65
+
66
+ $results = wplc_get_all_custom_fields_mrg();
67
+
68
+ $content .= "<table class=\"wp-list-table wplc_list_table widefat fixed \" cellspacing=\"0\" style='width:98%'>";
69
+ $content .= "<thead>";
70
+ $content .= "<tr>";
71
+ $content .= "<th scope='col'><span>" . __("ID", "wplivechat") . "</span></th>";
72
+ $content .= "<th scope='col'><span>" . __("Name", "wplivechat") . "</span></th>";
73
+ $content .= "<th scope='col'>" . __("Type", "wplivechat") . "</th>";
74
+ $content .= "<th scope='col'>" . __("Content", "wplivechat") . "</th>";
75
+ $content .= "<th scope='col'>" . __("Status", "wplivechat") . "</th>";
76
+ $content .= "<th scope='col'><span>" . __("Action", "wplivechat") . "</span></th>";
77
+ $content .= "</tr>";
78
+ $content .= "</thead>";
79
+
80
+
81
+ if($results){
82
+
83
+ foreach ($results as $result) {
84
+
85
+ $content .= "<tr>";
86
+
87
+ $content .= "<td>".$result->id."</td>";
88
+ $content .= "<td>".$result->field_name."</td>";
89
+ $content .= "<td>".wplc_return_custom_field_type_mrg( $result->field_type )."</td>";
90
+ if( $result->field_type == 0 ){
91
+ $content .= "<td>".$result->field_content."</td>";
92
+ } else {
93
+
94
+ $current_content = $result->field_content;
95
+ $current_content = str_replace("\\r", "", $current_content);
96
+ $current_content = json_decode( stripslashes( $current_content ) );
97
+ $content .= "<td>";
98
+ foreach( $current_content as $val ){
99
+ $content .= "<span>".$val."</span><br/>";
100
+ }
101
+ $content .= "</td>";
102
+
103
+ }
104
+
105
+ if( $result->status ){
106
+ $status_string = __("Active", "wplivechat");
107
+ } else {
108
+ $status_string = __("Inactive", "wplivechat");
109
+ }
110
+
111
+ $content .= "<td>".$status_string."</td>";
112
+
113
+ $wplc_edit_button = "<a href='".admin_url("admin.php?page=wplivechat-menu-custom-fields&wplc_action=edit_custom_field&fid=".$result->id)."' class='button'>".__("Edit", "wplivechat")."</a>";
114
+ $wplc_delete_button = "<a href='".admin_url("admin.php?page=wplivechat-menu-custom-fields&wplc_action=delete_custom_field&fid=".$result->id)."' class='button'>".__("Delete", "wplivechat")."</a>";
115
+
116
+ $content .= "<td>$wplc_edit_button $wplc_delete_button</td>";
117
+
118
+ $content .= "</tr>";
119
+
120
+ }
121
+
122
+ } else {
123
+
124
+ $content .= "<tr><td colspan='7'>".__("Create your first custom field", "wplivechat")."</td></tr>";
125
+
126
+ }
127
+
128
+ $content .= "</table>";
129
+
130
+ $content .= "</div>";
131
+
132
+ echo $content;
133
+
134
+ }
135
+
136
+ function wplc_custom_fields_add_page_mrg(){
137
+
138
+ global $wpdb;
139
+
140
+ $content = "";
141
+ $content .= "<div class='wrap wplc_wrap'>";
142
+ $content .= " <h2>".__("Create a Custom Field", "wplivechat")."</h2>";
143
+ $content .= " <form method='POST'>";
144
+ $content .= " <table class='wp-list-table wplc_list_table widefat fixed wpgmza-listing'>";
145
+ $content .= " <tbody>";
146
+ $content .= " <tr>";
147
+ $content .= " <td>".__('Field Name', 'wplivechat')."</td>";
148
+ $content .= " <td><input type='text' name='wplc_field_name' id='wplc_field_name' style='width: 250px;'/></td>";
149
+ $content .= " </tr>";
150
+ $content .= " <tr>";
151
+ $content .= " <td>".__('Field Type', 'wplivechat')."</td>";
152
+ $content .= " <td>";
153
+ $content .= " <select name='wplc_field_type' id='wplc_field_type' style='width: 250px;'>";
154
+ $content .= " <option value='0'>".__("Text", "wplivechat")."</option>";
155
+ $content .= " <option value='1'>".__("Drop Down", "wplivechat")."</option>";
156
+ $content .= " </select>";
157
+ $content .= " </td>";
158
+ $content .= " </tr>";
159
+ $content .= " <tr id='wplc_field_value_row'>";
160
+ $content .= " <td>".__('Default Field Value', 'wplivechat')."</td>";
161
+ $content .= " <td><input type='text' name='wplc_field_value' id='wplc_field_value' style='width: 250px;'/></td>";
162
+ $content .= " </tr>";
163
+ $content .= " <tr id='wplc_field_value_dropdown_row' style='display: none;'>";
164
+ $content .= " <td>".__('Drop Down Contents', 'wplivechat')."</td>";
165
+ $content .= " <td><textarea name='wplc_drop_down_values' id='wplc_drop_down_values' rows='6' style='width: 250px;'></textarea><br/><small>".__("Enter each option on a new line", "wplivechat")."</small></td>";
166
+ $content .= " </tr>";
167
+ $content .= " <tr>";
168
+ $content .= " <td></td>";
169
+ $content .= " <td><input type='submit' class='button button-primary' name='wplc_create_custom_field' value='".__('Create Custom Field', 'wplivechat')."' /></td>";
170
+ $content .= " </tr>";
171
+ $content .= " </tbody>";
172
+ $content .= " </table>";
173
+ $content .= " </form>";
174
+ $content .= "</div>";
175
+ echo $content;
176
+ }
177
+
178
+ function wplc_custom_fields_edit_page_mrg( $id ){
179
+
180
+ global $wpdb;
181
+ $wplc_custom_fields_table = $wpdb->prefix."wplc_custom_fields";
182
+
183
+ $id = sanitize_text_field( $id );
184
+
185
+ $sql = "SELECT * FROM $wplc_custom_fields_table WHERE `id` = $id";
186
+
187
+ $result = $wpdb->get_row( $sql );
188
+
189
+ if($result){
190
+ $field_content = $result->field_content;
191
+
192
+ if( $result->field_type == 1) {
193
+ $field_content = str_replace("[", "", $field_content);
194
+ $field_content = str_replace("\\r", "\n", $field_content);
195
+ $field_content = str_replace("\\n", "\n", $field_content);
196
+ $field_content = str_replace("\"", "", $field_content);
197
+ $field_content = str_replace(",", "", $field_content);
198
+ $field_content = str_replace("]", "", $field_content);
199
+ }
200
+
201
+ $content = "";
202
+ $content .= "<div class='wrap wplc_wrap'>";
203
+ $content .= " <h2>".__("Edit a Custom Field", "wplivechat")."</h2>";
204
+ $content .= " <form method='POST'>";
205
+ $content .= " <table class='wp-list-table wplc_list_table widefat fixed wpgmza-listing'>";
206
+ $content .= " <tbody>";
207
+ $content .= " <tr>";
208
+ $content .= " <td>".__('Field Name', 'wplivechat')."</td>";
209
+ $content .= " <td><input type='text' name='wplc_field_name' id='wplc_field_name' style='width: 250px;' value='".$result->field_name."'/></td>";
210
+ $content .= " </tr>";
211
+ $content .= " <tr>";
212
+ $content .= " <td>".__('Default Field Value', 'wplivechat')."</td>";
213
+ $content .= " <td><input type='text' name='wplc_field_value' id='wplc_field_value' style='width: 250px;' value='".$field_content."'/></td>";
214
+ $content .= " </tr>";
215
+ $content .= " <tr>";
216
+ $content .= " <td>".__('Field Type', 'wplivechat')."</td>";
217
+ $content .= " <td>";
218
+ $content .= " <select name='wplc_field_type' id='wplc_field_type' style='width: 250px;'>";
219
+ if( $result->field_type == 0 ) { $sel = 'selected'; } else { $sel = ''; }
220
+ if( $result->field_type == 1 ) { $sel1 = 'selected'; } else { $sel1 = ''; }
221
+ $content .= " <option value='0' $sel>".__("Text", "wplivechat")."</option>";
222
+ $content .= " <option value='1' $sel1>".__("Drop Down", "wplivechat")."</option>";
223
+ $content .= " </select>";
224
+ $content .= " </td>";
225
+ $content .= " </tr>";
226
+ $content .= " <tr>";
227
+ $content .= " <td>".__('Drop Down Contents', 'wplivechat')."</td>";
228
+ $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>";
229
+ $content .= " </tr>";
230
+ $content .= " <tr>";
231
+ $content .= " <td></td>";
232
+ $content .= " <td><input type='submit' class='button button-primary' name='wplc_update_custom_field' value='".__('Update Custom Field', 'wplivechat')."' /></td>";
233
+ $content .= " </tr>";
234
+ $content .= " </tbody>";
235
+ $content .= " </table>";
236
+ $content .= " </form>";
237
+ $content .= "</div>";
238
+ } else {
239
+ $content = "";
240
+ $content .= "<div class='wrap wplc_wrap'>";
241
+ $content .= " <h2>".__("Custom Field Not Found", "wplivechat")."</h2>";
242
+ $content .= " <a href='". admin_url("admin.php?page=wplivechat-menu-custom-fields")."' class='button button-primary'>".__("Back", "wplivechat")."</a>";
243
+ $content .= "</div>";
244
+ }
245
+ echo $content;
246
+
247
+ }
248
+
249
+ function wplc_custom_fields_delete_page_mrg( $id ){
250
+
251
+ $content = "";
252
+
253
+ $content .= "<div class='error'>";
254
+ $content .= "<p>".__("Are you sure you want to delete this custom field?", "wplivechat")."</p>";
255
+ $content .= "<p><a href='".admin_url("admin.php?page=wplivechat-menu-custom-fields&wplc_action=delete_custom_field&fid=$id&confirmed=true")."'>".__("Yes", "wplivechat")."</a> | <a href='".admin_url("admin.php?page=wplivechat-menu-custom-fields")."'>".__("No", "wplivechat")."</a></p>";
256
+ $content .= "</div>";
257
+
258
+ echo $content;
259
+
260
+ }
261
+
262
+ function wplc_delete_custom_field_mrg( $id ){
263
+ global $wpdb;
264
+ $wplc_custom_fields_table = $wpdb->prefix."wplc_custom_fields";
265
+
266
+ $id = intval( $id );
267
+
268
+ $wpdb->delete( $wplc_custom_fields_table, array( 'id' => $id ), array( '%d' ) );
269
+
270
+ ?><script>window.location = "<?php echo admin_url( 'admin.php?page=wplivechat-menu-custom-fields' ); ?>" </script><?php
271
+ }
272
+
273
+ function wplc_get_all_custom_fields_mrg(){
274
+ global $wpdb;
275
+ $wplc_custom_fields = $wpdb->prefix."wplc_custom_fields";
276
+
277
+ $sql = "SELECT * FROM $wplc_custom_fields";
278
+
279
+ $results = $wpdb->get_results( $sql );
280
+
281
+ return $results;
282
+ }
283
+
284
+ function wplc_return_custom_field_type_mrg( $type ){
285
+
286
+ $type = intval( $type );
287
+
288
+ switch( $type ){
289
+ case 0:
290
+ $val = __("Text Field", "wplivechat");
291
+ break;
292
+ case 1:
293
+ $val = __("Dropdown", "wplivechat");
294
+ break;
295
+ default:
296
+ $val = __("Unknown", "wplivechat");
297
+ break;
298
+ }
299
+
300
+ return $val;
301
+
302
+ }
303
+
304
+ add_filter( "wplc_start_chat_user_form_after_filter", "wplc_display_custom_fields_in_chatbox_mrg", 11, 2 );
305
+
306
+ function wplc_display_custom_fields_in_chatbox_mrg( $string ){
307
+
308
+ $ret = "<p>";
309
+
310
+ $custom_fields = wplc_get_all_custom_fields_mrg();
311
+
312
+ if( $custom_fields ){
313
+
314
+ foreach( $custom_fields as $field ){
315
+
316
+ if( $field->field_type == 0 ){
317
+
318
+ $ret .= "<input type='text' name='wplc_custom_field[".$field->id."]' id='wplc_custom_field_".$field->id."' fname='".$field->field_name."' placeholder='".$field->field_name."' value='".$field->field_content."' />";
319
+
320
+ } else if( $field->field_type == 1 ){
321
+
322
+ $ret .= "<select name='wplc_custom_field[".$field->id."]' id='wplc_custom_field_".$field->id."' fname='".$field->field_name."'>";
323
+ $content = $field->field_content;
324
+ $content = str_replace("\\r", "", $content);
325
+ $options = json_decode( $content );
326
+
327
+ if( $options ){
328
+ foreach( $options as $key => $val ){
329
+ $ret .= " <option value='$val'>".trim( $val )."</option>";
330
+ }
331
+ }
332
+
333
+ $ret .= "</select>";
334
+
335
+ }
336
+
337
+ }
338
+
339
+ }
340
+ $ret .= "</p>";
341
+
342
+ return $string . $ret;
343
+ }
344
+
345
+ add_filter( "wplc_filter_advanced_info", "wplc_advanced_info_custom_fields_mrg", 10, 4 );
346
+
347
+ function wplc_advanced_info_custom_fields_mrg( $string, $cid, $name, $chat_data = false ){
348
+ $extra_data = "";
349
+ $content = "";
350
+ $atleast_one_field = false;
351
+ if (!$chat_data) { $chat_data = wplc_get_chat_data( $cid, __LINE__ ); }
352
+ if( $chat_data->other ){
353
+ $extra_data = maybe_unserialize( $chat_data->other );
354
+
355
+ if( $extra_data && isset( $extra_data['wplc_extra_data'] ) && isset( $extra_data['wplc_extra_data']['custom_fields'] ) ) {
356
+
357
+ $content .= "<br/><div class='admin_visitor_advanced_info admin_agent_rating'>";
358
+ $content .= "<strong>".__("Custom Field Data", "wplivechat")."</strong>";
359
+ $content .= "<hr>";
360
+ $the_extra_data = maybe_unserialize( $extra_data['wplc_extra_data']);
361
+ $the_extra_data = json_decode( stripslashes( $extra_data['wplc_extra_data']['custom_fields'] ) );
362
+
363
+ if( $the_extra_data ){
364
+ foreach( $the_extra_data as $data ){
365
+ $atleast_one_field = true;
366
+ $content .= "<span class='part1'>".$data->{0}.":</span> <span class='part2'>".$data->{1}."</span><br/>";
367
+ }
368
+ }
369
+
370
+ $content .= "</div>";
371
+
372
+ }
373
+ }
374
+
375
+ if($atleast_one_field){
376
+ return $string . $content;
377
+ }
378
+
379
+ return $string;
380
+
381
+ }
382
+
383
+ add_action( "admin_head", "wplc_custom_fields_admin_head_mrg" );
384
+
385
+ function wplc_custom_fields_admin_head_mrg(){
386
+
387
+ global $wpdb;
388
+ $custom_field_table = $wpdb->prefix."wplc_custom_fields";
389
+
390
+ if( ( isset( $_POST['wplc_create_custom_field'] ) || ( isset( $_POST['wplc_update_custom_field'] ) && isset( $_GET['fid'] ) ) ) ){
391
+
392
+ $field_name = sanitize_text_field( $_POST['wplc_field_name'] );
393
+
394
+ $field_type = sanitize_text_field( $_POST['wplc_field_type'] );
395
+
396
+ $field_id = intval( sanitize_text_field( isset($_GET['fid']) ? $_GET['fid'] : '' ) );
397
+
398
+ if( isset( $_POST['wplc_drop_down_values'] ) && $_POST['wplc_drop_down_values'] != "" && $field_type == 1){
399
+
400
+ $dropdown_contents = $_POST['wplc_drop_down_values'];
401
+
402
+ $field_value = explode( "\n", $dropdown_contents );
403
+
404
+ $field_value = json_encode( $field_value );
405
+
406
+ } else {
407
+
408
+ $field_value = sanitize_text_field( $_POST['wplc_field_value'] );
409
+
410
+ }
411
+
412
+ if ( isset( $_POST['wplc_create_custom_field'] ) ) {
413
+ $wpdb->insert(
414
+ $custom_field_table,
415
+ array(
416
+ 'field_name' => $field_name,
417
+ 'field_type' => $field_type,
418
+ 'field_content' => $field_value,
419
+ 'status' => 1
420
+ ),
421
+ array(
422
+ '%s',
423
+ '%s',
424
+ '%s',
425
+ '%d',
426
+ )
427
+ );
428
+ } else if ( isset( $_POST['wplc_update_custom_field'] ) ) {
429
+ $wpdb->update(
430
+ $custom_field_table,
431
+ array(
432
+ 'field_name' => $field_name,
433
+ 'field_type' => $field_type,
434
+ 'field_content' => $field_value,
435
+ 'status' => 1
436
+ ),
437
+ array( 'id' => $field_id ),
438
+ array(
439
+ '%s',
440
+ '%s',
441
+ '%s',
442
+ '%d',
443
+ ),
444
+ array( '%d' )
445
+ );
446
+ }
447
+
448
+ ?><script>window.location = "<?php echo admin_url( 'admin.php?page=wplivechat-menu-custom-fields' ); ?>" </script><?php
449
+
450
+ }
451
+
452
+ }
453
+
454
+
455
+ add_filter("wplc_start_chat_hook_other_data_hook", "wplc_custom_fields_start_chat_other_data_hook_mrg", 15, 1);
456
+
457
+ function wplc_custom_fields_start_chat_other_data_hook_mrg($other_data){
458
+ if(isset($_POST['wplc_extra_data']) && isset($_POST['wplc_extra_data']['custom_fields'])){
459
+ $other_data['wplc_extra_data']['custom_fields'] = $_POST['wplc_extra_data']['custom_fields'];
460
+ }
461
+ return $other_data;
462
+ }
463
+
464
+
465
+ add_action("wplc_api_route_hook", "wplc_custom_field_rest_end_points_mrg");
466
+ function wplc_custom_field_rest_end_points_mrg(){
467
+ register_rest_route('wp_live_chat_support/v1', '/get_custom_field_info', array(
468
+ 'methods' => 'GET, POST',
469
+ 'callback' => 'wplc_custom_field_rest_get_info_mrg'
470
+ ));
471
+ }
472
+
473
+ function wplc_custom_field_rest_get_info_mrg(WP_REST_Request $request){
474
+ $return_array = array();
475
+ if(isset($request)){
476
+ if(isset($request['security'])){
477
+ $check_token = get_option('wplc_api_secret_token');
478
+ if($check_token !== false && $request['server_token'] === $check_token){
479
+ if(isset($request['cid'])){
480
+ $cid = $request['cid'];
481
+ if( ! filter_var($cid, FILTER_VALIDATE_INT) ) {
482
+ $cid = wplc_return_chat_id_by_rel($cid);
483
+ }
484
+
485
+ $html = wplc_advanced_info_custom_fields_mrg("", $cid, "", false);
486
+
487
+ $return_array['response'] = "Success";
488
+ $return_array['code'] = "200";
489
+ $return_array['data'] = $html;
490
+
491
+ } else {
492
+ $return_array['response'] = "No 'cid' found";
493
+ $return_array['code'] = "401";
494
+ $return_array['requirements'] = array("security" => "YOUR_SECRET_TOKEN",
495
+ "cid" => "Chat ID");
496
+ }
497
+ } else {
498
+ $return_array['response'] = "Nonce is invalid";
499
+ $return_array['code'] = "401";
500
+ }
501
+ } else{
502
+ $return_array['response'] = "No 'security' found";
503
+ $return_array['code'] = "401";
504
+ $return_array['requirements'] = array("security" => "YOUR_SECRET_TOKEN",
505
+ "cid" => "Chat ID");
506
+ }
507
+ }else{
508
+ $return_array['response'] = "No request data found";
509
+ $return_array['code'] = "400";
510
+ $return_array['requirements'] = array("security" => "YOUR_SECRET_TOKEN",
511
+ "cid" => "Chat ID");
512
+ }
513
+
514
+ return $return_array;
515
+ }
includes/wplc_data_triggers.php ADDED
@@ -0,0 +1,785 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function wplc_triggers_page(){
4
+ wplc_enqueue_admin_styles_mrg();
5
+ $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>";
6
+
7
+ $content = "<div class='wrap wplc_wrap'>";
8
+ $content .= "<h2>".__('WP Live Chat Support Triggers', 'wp-livechat')." (beta) " . $wplc_add_trigger_btn . "</h2>";
9
+
10
+ echo $content;
11
+
12
+ global $wplc_version;
13
+ if (intval(str_replace(".","",$wplc_version)) < 6205) {
14
+ echo "<div class='update-nag' style='padding-top:0px;margin-top:5px;margin-bottom:10px;'>";
15
+ echo "<p>In order to use data triggers, please ensure you are using the latest basic version (version 6.2.05 or newer).</p>";
16
+ echo "<a title='Update Now' href='./update-core.php' class='button button-primary'>".__("Update now" ,"wplivechat")."</a>";
17
+ echo "</div>";
18
+ }
19
+
20
+ if(isset($_GET['wplc_action']) && ($_GET['wplc_action'] == "add_trigger" || $_GET['wplc_action'] == "edit_trigger")){
21
+ wplc_mrg_get_add_trigger_content();
22
+ } else if(isset($_GET['wplc_action']) && ($_GET['wplc_action'] == "delete_trigger")){
23
+ wplc_mrg_get_delete_trigger_content();
24
+ } else {
25
+ wplc_mrg_get_trigger_table();
26
+ }
27
+
28
+ $content = "</div>"; //Close Wrap
29
+
30
+
31
+ echo $content;
32
+ }
33
+
34
+ function wplc_mrg_get_add_trigger_content(){
35
+ wplc_mrg_trigger_admin_js();
36
+
37
+ $content = "";
38
+
39
+ //Content Vars
40
+ $trigger_name = "";
41
+ $trigger_type = 0;
42
+ $trigger_content;
43
+ $trigger_replace = "checked";
44
+ $trigger_enabled = "checked";
45
+
46
+ $wplc_submit_label = "Create Trigger"; //Default
47
+
48
+ //Header Handler
49
+ $header_array = wplc_mrg_trigger_admin_head();
50
+ if($header_array){
51
+ if(isset($header_array['trigger_name'])){ $trigger_name = $header_array['trigger_name']; }
52
+ if(isset($header_array['trigger_type'])){ $trigger_type = intval($header_array['trigger_type']); }
53
+ if(isset($header_array['trigger_content'])){ $trigger_content = maybe_unserialize($header_array['trigger_content']); }
54
+ if(isset($header_array['trigger_replace'])){ $trigger_replace = "checked"; } else { $trigger_replace = ""; }
55
+ if(isset($header_array['trigger_enabled'])){ $trigger_enabled = "checked"; } else { $trigger_enabled = ""; }
56
+ }
57
+
58
+ if(isset($_GET['wplc_action'])){
59
+ if($_GET['wplc_action'] == 'edit_trigger'){
60
+ $wplc_submit_label = "Edit Trigger";
61
+ }
62
+ }
63
+
64
+ $content .= "<form method='POST'>";
65
+ $content .= "<table class=\"wp-list-table wplc_list_table widefat fixed form-table\" cellspacing=\"0\" style='width:50%'>";
66
+
67
+ $content .= "<tr>";
68
+ $content .= "<td>".__("Trigger Name", "wplivechat").":</td>";
69
+ $content .= "<td><input type='text' name='wplc_trigger_name' value='$trigger_name'></td>";
70
+ $content .= "</tr>";
71
+
72
+ $content .= "<tr>";
73
+ $content .= "<td>".__("Trigger Type", "wplivechat").":</td>";
74
+ $content .= "<td>";
75
+
76
+ $content .= "<select name='wplc_trigger_type'>";
77
+ $content .= "<option value='0' ".($trigger_type == 0 ? "selected" : "").">".__("Page Trigger", "wplivechat")."</option>";
78
+ $content .= "<option value='1' ".($trigger_type == 1 ? "selected" : "").">".__("Time Trigger", "wplivechat")."</option>";
79
+ $content .= "<option value='2' ".($trigger_type == 2 ? "selected" : "").">".__("Scroll Trigger", "wplivechat")."</option>";
80
+ $content .= "<option value='3' ".($trigger_type == 3 ? "selected" : "").">".__("Page Leave Trigger", "wplivechat")."</option>";
81
+ $content .= "</select> <i class='fa fa-question-circle' title='".__("Note: When using page trigger with a the basic theme, no hovercard is shown by default. We suggest using the time trigger for this instead.", "wplivechat")."'></i>";
82
+
83
+ $content .= "</td>";
84
+ $content .= "</tr>";
85
+
86
+ $content .= "<tr id='wplc_trigger_page_row'>";
87
+ $content .= "<td>".__("Page ID", "wplivechat").":</td>";
88
+ $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>";
89
+ $content .= "</tr>";
90
+
91
+ $content .= "<tr id='wplc_trigger_secs_row'>";
92
+ $content .= "<td>".__("Show After", "wplivechat").":</td>";
93
+ $content .= "<td><input type='text' name='wplc_trigger_secs' value='".(isset($trigger_content["secs"]) && intval($trigger_content["secs"]) >= 0 ? intval($trigger_content["secs"]) : 0)."'> <i>".__("Seconds", "wplivechat")."</i></td>";
94
+ $content .= "</tr>";
95
+
96
+ $content .= "<tr id='wplc_trigger_scroll_row'>";
97
+ $content .= "<td>".__("Show After Scrolled", "wplivechat").":</td>";
98
+ $content .= "<td><input type='text' name='wplc_trigger_perc' value='".(isset($trigger_content["secs"]) && intval($trigger_content["perc"]) >= 0 ? intval($trigger_content["perc"]) : 0)."'> <i>".__("(%) Percent of page height", "wplivechat")."</i></td>";
99
+ $content .= "</tr>";
100
+
101
+ $content .= "<tr>";
102
+ $content .= "<td style='vertical-align: top !important;'>".__("Content Replacement", "wplivechat").":</td>";
103
+ $content .= "<td>";
104
+
105
+ echo $content; //To Support TinyMCE
106
+ wp_editor( (isset($trigger_content["html"]) ? wplc_shortcode_filter_mrg($trigger_content["html"], true) : ""),"wplc_trigger_content",array("teeny" => false, "media_buttons" => true, "textarea_name" => "wplc_trigger_content", "textarea_rows" => 5));
107
+
108
+
109
+ $content .= "</td>";
110
+ $content .= "</tr>";
111
+
112
+ $content = "<tr>";
113
+ $content .= "<td>".__("Replace Content", "wplivechat").":</td>";
114
+ $content .= "<td><input type='checkbox' name='wplc_trigger_replace_content' $trigger_replace></td>";
115
+ $content .= "</tr>";
116
+
117
+ $content .= "<tr>";
118
+ $content .= "<td>".__("Enable Trigger", "wplivechat").":</td>";
119
+ $content .= "<td><input type='checkbox' name='wplc_trigger_enable' $trigger_enabled></td>";
120
+ $content .= "</tr>";
121
+
122
+ $content .= "<tr>";
123
+ $content .= "<td></td>";
124
+ $content .= "<td><input class='button button-primary' type='submit' name='wplc_trigger_submit' value='".__($wplc_submit_label, "wplivechat")."'> <a href='".admin_url()."admin.php?page=wplivechat-menu-triggers"."' class='button'>".__("Close", "wplivechat")."</a></td>";
125
+ $content .= "</tr>";
126
+
127
+ $content .= "</table>";
128
+ $content .= "</form>";
129
+
130
+ if($header_array){
131
+ if(count($header_array["errors"]) >= 1){
132
+ $content .= "<div class='update-nag'>";
133
+ $content .= "<strong>".__("Please review your submission", "wplivechat").":</strong>";
134
+ $content .= "<ul style='list-style:initial;'>";
135
+ for($i = 0; $i < count($header_array["errors"]); $i++){
136
+ $content .= "<li style='margin-left: 25px;'>".__($header_array["errors"][$i], "wplivechat")."</li>";
137
+ }
138
+ $content .= "</ul>";
139
+ $content .= "</div>";
140
+ }
141
+
142
+ if(isset($header_array["success"])){
143
+ $content .= "<div class='update-nag' style='border-color:#67d552;'>";
144
+ $content .= "<strong>".__($header_array["success"], "wplivechat")."</strong>";
145
+ $content .= "</div>";
146
+ }
147
+ }
148
+
149
+ echo $content;
150
+ }
151
+
152
+ function wplc_mrg_trigger_admin_js(){
153
+ ?>
154
+ <script>
155
+ //Trigger Admin JS Here
156
+
157
+ jQuery(function(){
158
+ jQuery(function(){
159
+ UpdateInputs(jQuery("select[name=wplc_trigger_type]").val());
160
+
161
+ jQuery("select[name=wplc_trigger_type]").change(function(){
162
+ UpdateInputs(jQuery("select[name=wplc_trigger_type]").val());
163
+ });
164
+ });
165
+
166
+ function UpdateInputs(theVal){
167
+ switch(parseInt(theVal)){
168
+ case 0:
169
+ jQuery("#wplc_trigger_page_row").show();
170
+ jQuery("#wplc_trigger_secs_row").hide();
171
+ jQuery("#wplc_trigger_scroll_row").hide();
172
+ break;
173
+ case 1:
174
+ jQuery("#wplc_trigger_page_row").show();
175
+ jQuery("#wplc_trigger_secs_row").show();
176
+ jQuery("#wplc_trigger_scroll_row").hide();
177
+ break;
178
+ case 2:
179
+ jQuery("#wplc_trigger_page_row").show();
180
+ jQuery("#wplc_trigger_secs_row").hide();
181
+ jQuery("#wplc_trigger_scroll_row").show();
182
+ break;
183
+ case 3:
184
+ jQuery("#wplc_trigger_page_row").show();
185
+ jQuery("#wplc_trigger_secs_row").hide();
186
+ jQuery("#wplc_trigger_scroll_row").hide();
187
+ break;
188
+ }
189
+ }
190
+ });
191
+ </script>
192
+ <?php
193
+ }
194
+
195
+ function wplc_mrg_trigger_admin_head(){
196
+ if(isset($_GET['wplc_action'])){
197
+ $return_array = array();
198
+ $form_valid = true;
199
+ if(isset($_POST['wplc_trigger_submit'])){
200
+ $return_array["errors"] = array();
201
+
202
+ if(isset($_POST['wplc_trigger_name']) && $_POST['wplc_trigger_name'] !== ""){
203
+ $return_array["trigger_name"] = $_POST['wplc_trigger_name'];
204
+ } else {
205
+ $return_array["errors"][count($return_array["errors"]) >= 1 ? count($return_array["errors"]) : 0] = "Name cannot be empty";
206
+ $form_valid = false; //No Longer Valid
207
+ }
208
+
209
+ if(isset($_POST['wplc_trigger_type']) && $_POST['wplc_trigger_type'] !== ""){
210
+ $return_array["trigger_type"] = $_POST['wplc_trigger_type'];
211
+ }
212
+
213
+ $serialized_content = array();
214
+
215
+ //Validation added here for serialized array
216
+ if(isset($_POST['wplc_trigger_pages']) && $_POST['wplc_trigger_pages'] !== ""){
217
+ $serialized_content['pages'] = esc_attr($_POST['wplc_trigger_pages']);
218
+ } else {
219
+ $serialized_content['pages'] = "";
220
+ }
221
+
222
+ if(isset($_POST['wplc_trigger_secs']) && $_POST['wplc_trigger_secs'] !== ""){
223
+ $serialized_content['secs'] = intval($_POST['wplc_trigger_secs']);
224
+ }
225
+
226
+
227
+ if(isset($_POST['wplc_trigger_perc']) && $_POST['wplc_trigger_perc'] !== ""){
228
+ $serialized_content['perc'] = intval($_POST['wplc_trigger_perc']);
229
+ }
230
+
231
+ if(isset($_POST['wplc_trigger_content']) && $_POST['wplc_trigger_content'] !== ""){
232
+ $supporter_tags = wplc_trigger_get_allowed_tags_mrg();
233
+ $serialized_content['html'] = wp_kses(nl2br(wplc_shortcode_filter_mrg($_POST['wplc_trigger_content'])), $supporter_tags);
234
+ }
235
+
236
+ $return_array["trigger_content"] = serialize($serialized_content);
237
+
238
+ if(isset($_POST['wplc_trigger_replace_content'])){
239
+ if(isset($_POST['wplc_trigger_content']) && $_POST['wplc_trigger_content'] !== ""){ } else {
240
+ $return_array["errors"][count($return_array["errors"]) >= 1 ? count($return_array["errors"]) : 0] = "Content cannot be empty (When replace content is enabled)";
241
+ $form_valid = false; //No Longer Valid
242
+ }
243
+
244
+ $return_array["trigger_replace"] = 1;
245
+ }
246
+
247
+ if(isset($_POST['wplc_trigger_enable'])){
248
+ $return_array["trigger_enabled"] = 1;
249
+ }
250
+ }
251
+
252
+ if($_GET['wplc_action'] == "add_trigger"){
253
+ if($form_valid && isset($_POST['wplc_trigger_submit'])){
254
+ //All good continue
255
+ if(wplc_add_trigger_mrg($return_array)){
256
+ //Redirect here
257
+ echo "<script> window.location = '".admin_url()."admin.php?page=wplivechat-menu-triggers"."';</script>";
258
+ }
259
+ } else {
260
+ return $return_array; //Return Posted Data
261
+ }
262
+ } else if ($_GET['wplc_action'] == "edit_trigger"){
263
+ //Editing now
264
+ $edit_array = array();
265
+ $edit_array["errors"] = array();
266
+ if (isset($return_array["errors"])) { $edit_array["errors"] = $return_array["errors"]; }
267
+ //Submit data first
268
+ if($form_valid && isset($_POST['wplc_trigger_submit'])){
269
+ //All good continue
270
+ if(isset($_GET['trigger_id'])){
271
+ if(wplc_edit_trigger_mrg($return_array, intval($_GET['trigger_id']))){
272
+ //Show edit message
273
+ $edit_array['success'] = "<div>".__("Trigger has been edited.", "wplivechat")."</div>";
274
+ }
275
+ } else {
276
+ //No Trigger ID
277
+ $edit_array["errors"][count($edit_array["errors"]) >= 1 ? count($edit_array["errors"]) : 0] = "Trigger ID not found";
278
+ }
279
+ }
280
+
281
+ if(isset($_GET['trigger_id'])){
282
+ $trigger_data = wplc_get_trigger_mrg(intval($_GET['trigger_id']));
283
+ if($trigger_data){
284
+ if($trigger_data !== false && is_array($trigger_data)){
285
+ //Got the data
286
+ if(isset($trigger_data[0]->name) && $trigger_data[0]->name !== ""){ $edit_array["trigger_name"] = $trigger_data[0]->name; }
287
+ if(isset($trigger_data[0]->type) && $trigger_data[0]->type !== ""){ $edit_array["trigger_type"] = intval($trigger_data[0]->type); }
288
+ if(isset($trigger_data[0]->content) && $trigger_data[0]->content !== ""){ $edit_array['trigger_content'] = $trigger_data[0]->content ; }
289
+ if(isset($trigger_data[0]->show_content) && intval($trigger_data[0]->show_content) == 1){ $edit_array["trigger_replace"] = 1; }
290
+ if(isset($trigger_data[0]->status) && intval($trigger_data[0]->status) == 1){ $edit_array["trigger_enabled"] = 1; }
291
+ }
292
+
293
+ } else{
294
+ $edit_array["errors"][count($edit_array["errors"]) >= 1 ? count($edit_array["errors"]) : 0] = "Trigger ID not found";
295
+ }
296
+ }else{
297
+ $edit_array["errors"][count($edit_array["errors"]) >= 1 ? count($edit_array["errors"]) : 0] = "Trigger ID not set";
298
+ }
299
+ return $edit_array; //Return Server Data
300
+ }else if($_GET['wplc_action'] == "delete_trigger"){
301
+ $delete_array = array();
302
+ if(isset($_GET['trigger_id'])){
303
+ $trigger_data = wplc_get_trigger_mrg(intval($_GET['trigger_id']));
304
+ if($trigger_data){
305
+ $delete_array["name"] = $trigger_data[0]->name;
306
+ }
307
+
308
+ if(isset($_POST['delete_confirm'])){
309
+ //Delete now
310
+ if(wplc_delete_trigger_mrg(intval($_GET['trigger_id']))){
311
+ //Success
312
+ }
313
+ echo "<script> window.location = '".admin_url()."admin.php?page=wplivechat-menu-triggers"."';</script>";
314
+ }
315
+ }
316
+ return $delete_array;
317
+ }else {
318
+ return false;
319
+ }
320
+ }else{
321
+ return false;
322
+ }
323
+ }
324
+
325
+ function wplc_add_trigger_mrg($trigger_data){
326
+ global $wpdb;
327
+ global $wplc_tblname_chat_triggers;
328
+ if($trigger_data){
329
+ $trigger_name;
330
+ $trigger_type;
331
+ $trigger_content;
332
+ $trigger_replace;
333
+ $trigger_enabled;
334
+ //Validation - 1
335
+ if($trigger_data['trigger_name'] != ""){ $trigger_name = $trigger_data['trigger_name']; } else { return false; }
336
+ if($trigger_data['trigger_type'] != ""){ $trigger_type = intval($trigger_data['trigger_type']); } else { return false; }
337
+ if($trigger_data['trigger_content'] != ""){ $trigger_content = $trigger_data['trigger_content']; } else { return false; }
338
+ if($trigger_data['trigger_replace'] != ""){ $trigger_replace = 1; } else { $trigger_replace = 0; }
339
+ if($trigger_data['trigger_enabled'] != ""){ $trigger_enabled = 1; }else{ $trigger_enabled = 0; }
340
+
341
+ //Validation - 2
342
+ $trigger_name = esc_attr($trigger_name);
343
+
344
+ $sql = "INSERT INTO $wplc_tblname_chat_triggers SET `name` = '".$trigger_name."', `type` = '".$trigger_type."', `content` = '".$trigger_content."', `show_content` = '".$trigger_replace."', `status` = '".$trigger_enabled."' ";
345
+ $wpdb->query($sql);
346
+ if ($wpdb->last_error) {
347
+ return false;
348
+ } else {
349
+ return true;
350
+ }
351
+ }
352
+ }
353
+
354
+
355
+ function wplc_edit_trigger_mrg($trigger_data, $trigger_id){
356
+ global $wpdb;
357
+ global $wplc_tblname_chat_triggers;
358
+ if($trigger_data){
359
+ $trigger_name;
360
+ $trigger_type;
361
+ $trigger_content;
362
+ $trigger_replace;
363
+ $trigger_enabled;
364
+ //Validation - 1
365
+ if($trigger_data['trigger_name'] != ""){ $trigger_name = $trigger_data['trigger_name']; } else { return false; }
366
+ if($trigger_data['trigger_type'] != ""){ $trigger_type = intval($trigger_data['trigger_type']); } else { return false; }
367
+ if($trigger_data['trigger_content'] != ""){ $trigger_content = $trigger_data['trigger_content']; } else { return false; }
368
+ if(isset($trigger_data['trigger_replace']) && $trigger_data['trigger_replace'] != ""){ $trigger_replace = 1; } else { $trigger_replace = 0; }
369
+ if(isset($trigger_data['trigger_enabled']) && $trigger_data['trigger_enabled'] != ""){ $trigger_enabled = 1; }else{ $trigger_enabled = 0; }
370
+
371
+ //Validation - 2
372
+ $trigger_name = esc_attr($trigger_name);
373
+
374
+ $trigger_id = intval($trigger_id);
375
+ $sql = "UPDATE $wplc_tblname_chat_triggers SET `name` = '".$trigger_name."', `type` = '".$trigger_type."', `content` = '".$trigger_content."', `show_content` = '".$trigger_replace."', `status` = '".$trigger_enabled."' WHERE `id` = '".$trigger_id."' ";
376
+ $wpdb->query($sql);
377
+ if ($wpdb->last_error) {
378
+ return false;
379
+ } else {
380
+ return true;
381
+ }
382
+ }
383
+ }
384
+
385
+ function wplc_delete_trigger_mrg($trigger_id){
386
+ global $wpdb;
387
+ global $wplc_tblname_chat_triggers;
388
+ $trigger_id = intval($trigger_id);
389
+ $sql = "DELETE FROM $wplc_tblname_chat_triggers WHERE `id` = '".$trigger_id."' ";
390
+ $wpdb->query($sql);
391
+ if ($wpdb->last_error) {
392
+ return false;
393
+ } else {
394
+ return true;
395
+ }
396
+ }
397
+
398
+ function wplc_change_trigger_status_mrg($trigger_id, $trigger_status){
399
+ global $wpdb;
400
+ global $wplc_tblname_chat_triggers;
401
+ if(isset($trigger_id) && isset($trigger_status)){
402
+ $trigger_id = intval($trigger_id);
403
+ $trigger_status = intval($trigger_status);
404
+ $sql = "UPDATE $wplc_tblname_chat_triggers SET `status` = '".$trigger_status."' WHERE `id` = '".$trigger_id."' ";
405
+ $wpdb->query($sql);
406
+ if ($wpdb->last_error) {
407
+ return false;
408
+ } else {
409
+ return true;
410
+ }
411
+ }
412
+ }
413
+
414
+ function wplc_mrg_get_trigger_table(){
415
+ $content = "";
416
+
417
+ wplc_mrg_trigger_table_head();
418
+
419
+ //Now Get the Contents
420
+ $results = wplc_get_all_triggers_mrg();
421
+
422
+ $conflict_array = wplc_triggers_check_for_conflicts_mrg($results);
423
+
424
+ if(count($conflict_array) > 0){
425
+ $content .= "<div class='update-nag' style='margin-top:0px;margin-bottom:10px;padding-top:8px;padding-bottom:8px;font-size:12px;'>";
426
+ $content .= "<strong>".__("Conflict with page") . ":</strong>";
427
+ foreach ($conflict_array as $conflict) {
428
+ $content .= "<br>".__("Trigger ID: ", "wplivechat").$conflict;
429
+ $content .= "<br>".__("It is possible that this trigger may override another trigger, or be overridden by another trigger.", "wplivechat");
430
+ }
431
+ $content .= "</div>";
432
+ }
433
+
434
+ $conflictations = implode(",", $conflict_array);
435
+
436
+ $content .= "<table class=\"wp-list-table wplc_list_table widefat fixed \" cellspacing=\"0\" style='width:98%'>";
437
+ $content .= "<thead>";
438
+ $content .= "<tr>";
439
+ $content .= "<th scope='col'><span>" . __("ID", "wplivechat") . "</span></th>";
440
+ $content .= "<th scope='col'><span>" . __("Name", "wplivechat") . "</span></th>";
441
+ $content .= "<th scope='col'>" . __("Type", "wplivechat") . "</th>";
442
+ $content .= "<th scope='col'>" . __("Page", "wplivechat") . "</th>";
443
+ $content .= "<th scope='col'>" . __("Content", "wplivechat") . "</th>";
444
+ $content .= "<th scope='col'>" . __("Status", "wplivechat") . "</th>";
445
+ $content .= "<th scope='col'><span>" . __("Action", "wplivechat") . "</span></th>";
446
+ $content .= "</tr>";
447
+ $content .= "</thead>";
448
+
449
+
450
+ if($results){
451
+ foreach ($results as $result) {
452
+ $trigger_actions = "<a class='button' href='?page=wplivechat-menu-triggers&wplc_action=edit_trigger&trigger_id=".$result->id."'>".__("Edit", "wplivechat")."</a> ";
453
+ $trigger_actions .= "<a class='button' href='?page=wplivechat-menu-triggers&wplc_action=delete_trigger&trigger_id=".$result->id."'>".__("Delete", "wplivechat")."</a> ";
454
+
455
+ $trigger_content = maybe_unserialize($result->content);
456
+
457
+ $content .= "<tr>";
458
+ $content .= "<td style='".(!is_bool(strpos($conflictations, $result->id)) && strpos($conflictations, $result->id) >= 0 ? "border-left:4px solid #ffba00" : "")."'>".$result->id."</td>";
459
+ $content .= "<td>".$result->name."</td>";
460
+ $content .= "<td>".__(wplc_get_type_from_code_mrg($result->type), "wplivechat")."</td>";
461
+ $content .= "<td>".(strip_tags($trigger_content["pages"]) == "" ? __("All", "wplivechat") : strip_tags($trigger_content["pages"]))."</td>";
462
+ $content .= "<td>".trim(substr(strip_tags($trigger_content["html"]), 0, 120))."...</td>";
463
+ $content .= "<td>";
464
+ $content .= "<div class='wplc_trigger_status ".($result->status == 1 ? "wplc_trigger_enabled" : "wplc_trigger_disabled")."'>";
465
+ $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")."'>";
466
+ $content .= __(($result->status == 1 ? "Enabled" : "Disabled"), "wplivechat");
467
+ $content .= "</a>";
468
+ $content .= "</div>";
469
+ $content .= "</td>";
470
+ $content .= "<td>".$trigger_actions."</td>";
471
+ $content .= "</tr>";
472
+
473
+ }
474
+ } else {
475
+ $content .= "<tr><td>".__("No Triggers Found...", "wplivechat")."</td><td></td><td></td><td></td><td></td></tr>";
476
+ }
477
+
478
+ $content .= "</table>";
479
+ echo $content;
480
+ }
481
+
482
+ function wplc_mrg_trigger_table_head(){
483
+ if(isset($_GET['wplc_action']) && isset($_GET['trigger_id']) && isset($_GET['trigger_status'])){
484
+ if($_GET['wplc_action'] == 'trigger_status_change'){
485
+ $trigger_id = intval($_GET['trigger_id']);
486
+ if(isset($trigger_id)){
487
+ $trigger_status = intval($_GET['trigger_status']);
488
+ if($trigger_status > 1){ $trigger_status = 1; } else if($trigger_status < 0){ $trigger_status = 0; } //Check if status in range
489
+ //All good execute
490
+ if(wplc_change_trigger_status_mrg($trigger_id, $trigger_status)){
491
+
492
+ }
493
+ }
494
+ }
495
+ }
496
+ }
497
+
498
+ function wplc_get_all_triggers_mrg(){
499
+ global $wpdb;
500
+ global $wplc_tblname_chat_triggers;
501
+
502
+ $sql = "SELECT * FROM $wplc_tblname_chat_triggers";
503
+ $sql .= " ORDER BY `status` DESC"; //Sort
504
+
505
+ $results = $wpdb->get_results($sql);
506
+ if($wpdb->num_rows){
507
+ return $results;
508
+ } else {
509
+ return false;
510
+ }
511
+
512
+ }
513
+
514
+ function wplc_get_trigger_mrg($trigger_id){
515
+ global $wpdb;
516
+ global $wplc_tblname_chat_triggers;
517
+
518
+ $trigger_id = intval($trigger_id);
519
+
520
+ $sql = "SELECT * FROM $wplc_tblname_chat_triggers WHERE `id` = '$trigger_id'";
521
+
522
+ $results = $wpdb->get_results($sql);
523
+ if($wpdb->num_rows){
524
+ return $results;
525
+ } else {
526
+ return false;
527
+ }
528
+ }
529
+
530
+ function wplc_get_active_triggers_mrg(){
531
+ global $wpdb;
532
+ global $wplc_tblname_chat_triggers;
533
+
534
+ $sql = "SELECT * FROM $wplc_tblname_chat_triggers WHERE `status` = '1'";
535
+
536
+ $results = $wpdb->get_results($sql);
537
+ if($wpdb->num_rows){
538
+ return $results;
539
+ } else {
540
+ return false;
541
+ }
542
+
543
+ }
544
+
545
+ function wplc_get_type_from_code_mrg($code){
546
+ $type_string = "";
547
+ switch($code){
548
+ case 0:
549
+ $type_string = "Page Trigger";
550
+ break;
551
+ case 1:
552
+ $type_string = "Time Trigger";
553
+ break;
554
+ case 2:
555
+ $type_string = "Scroll Trigger";
556
+ break;
557
+ case 3:
558
+ $type_string = "Page Leave Trigger";
559
+ break;
560
+ }
561
+
562
+ return $type_string;
563
+ }
564
+
565
+ function wplc_mrg_get_delete_trigger_content(){
566
+ $header_array = wplc_mrg_trigger_admin_head();
567
+ $trigger_name = "";
568
+ if($header_array){
569
+ if(isset($header_array["name"])){ $trigger_name = $header_array["name"];}
570
+ }
571
+
572
+ $content = "";
573
+ if( (isset($_GET['wplc_action']) & isset($_GET['trigger_id']))&& ($_GET['wplc_action'] == "delete_trigger" && $_GET['trigger_id'] != "")){
574
+
575
+ $content .= "<form method='POST'>";
576
+ $content .= "<table class=\"wp-list-table wplc_list_table widefat fixed form-table\" cellspacing=\"0\" style='width:50%'>";
577
+ $content .= "<tr>";
578
+ $content .= "<td>";
579
+ $content .= __("Are you sure you would like to delete trigger") . ": <strong>" . $trigger_name . "</strong>";
580
+ $content .= "</td>";
581
+ $content .= "</tr>";
582
+ $content .= "<tr>";
583
+ $content .= "<td>";
584
+ $content .= "<input type='submit' class='button' name='delete_confirm' value='".__("Delete", "wplivechat")."'>";
585
+ $content .= " <a href='".admin_url()."admin.php?page=wplivechat-menu-triggers' class='button'>".__("Cancel", "wplivechat")."</a>";
586
+ $content .= "</td>";
587
+ $content .= "</tr>";
588
+ $content .= "</table>";
589
+ $content .= "</form>";
590
+ }
591
+
592
+ echo $content;
593
+ }
594
+
595
+ add_filter("wplc_filter_hovercard_content","wplc_filter_control_modern_theme_hovercard_content_triggers_mrg",10,1);
596
+ function wplc_filter_control_modern_theme_hovercard_content_triggers_mrg($msg) {
597
+ $unaltered_msg = $msg;
598
+ $post_id = url_to_postid($_SERVER['HTTP_REFERER']); //User Admin-Ajax Referrer
599
+ $matched_trigger = wplc_check_trigger_filters_mrg($post_id); //Find first matching trigger for page
600
+ if($matched_trigger != false){
601
+ $trigger_data = wplc_get_trigger_mrg($matched_trigger);
602
+ if($trigger_data !== false && is_array($trigger_data)){
603
+ $trigger_data = $trigger_data[0];
604
+ if(intval($trigger_data->show_content) == 1){
605
+ $unserialized_content = maybe_unserialize($trigger_data->content);
606
+ if($unserialized_content){
607
+ $msg = do_shortcode(wplc_shortcode_filter_mrg($unserialized_content['html'], true));
608
+ }
609
+ }
610
+ }
611
+ }else{
612
+ $msg = $unaltered_msg;
613
+ }
614
+ return $msg;
615
+ }
616
+
617
+ function wplc_check_trigger_filters_mrg($page){
618
+ $triggers = wplc_get_active_triggers_mrg();
619
+ $match_found = false; //Break control
620
+ if ( $triggers ) {
621
+ for($i = 0; ($i < count($triggers) && $match_found == false); $i++){
622
+ if (isset($triggers[$i])) {
623
+ $serialized_content = maybe_unserialize($triggers[$i]->content);
624
+ if($serialized_content){
625
+ if(isset($serialized_content['pages']) && $serialized_content['pages'] != ""){
626
+ $pages_array = explode(",", trim($serialized_content['pages'])); //Trim pages and explode
627
+ if(is_array($pages_array)){
628
+ foreach($pages_array as $trigger_page){
629
+ if($match_found == false){
630
+ //Only continue if match not found
631
+ if(intval($trigger_page) == intval($page)){
632
+ //They match
633
+ $match_found = $triggers[$i]->id;
634
+ }
635
+ }
636
+ }
637
+ }
638
+ } else {
639
+ //Assume all pages
640
+ $match_found = $triggers[$i]->id;
641
+ }
642
+ }
643
+ }
644
+ }
645
+ }
646
+ return $match_found;
647
+ }
648
+
649
+ function wplc_tirggers_enqueue_user_styles_scripts($trigger_id){
650
+ global $wplc_version;
651
+ wp_register_script("wplc_trigger_js", plugins_url('/js/wplc_user_triggers.js', __FILE__), array('jquery'), $wplc_version);
652
+ /*Localize vars here*/
653
+ $trigger_id = intval($trigger_id);
654
+
655
+ $trigger_data = wplc_get_trigger_mrg($trigger_id);
656
+ if($trigger_data !== false && is_array($trigger_data)){
657
+ $trigger_data = $trigger_data[0];
658
+ //Only Load styles if content is being overriden
659
+ if(intval($trigger_data->show_content) == 1){
660
+ wp_enqueue_style("wplc_trigger_styles", plugins_url('/css/wplc_trigger_styles.css', __FILE__), array(), $wplc_version);
661
+ }
662
+
663
+ if($trigger_data){
664
+ $unserialized_content = maybe_unserialize($trigger_data->content);
665
+
666
+ $localized_array = array();
667
+ $localized_array["type"] = $trigger_data->type;
668
+ if(isset($unserialized_content['secs'])){
669
+ $localized_array["secs"] = intval($unserialized_content['secs']);
670
+ }
671
+ if(isset($unserialized_content['perc'])){
672
+ $localized_array["perc"] = intval($unserialized_content['perc']);
673
+ }
674
+
675
+ wp_localize_script("wplc_trigger_js", "wplc_trigger_data",$localized_array);
676
+ }
677
+ wp_enqueue_script("wplc_trigger_js");
678
+ }
679
+ }
680
+
681
+ function wplc_trigger_get_allowed_tags_mrg(){
682
+ $tags = wp_kses_allowed_html("post");
683
+ $tags['iframe'] = array(
684
+ 'src' => true,
685
+ 'width' => true,
686
+ 'height' => true,
687
+ 'align' => true,
688
+ 'class' => true,
689
+ 'style' => true,
690
+ 'name' => true,
691
+ 'id' => true,
692
+ 'frameborder' => true,
693
+ 'seamless' => true,
694
+ 'srcdoc' => true,
695
+ 'sandbox' => true,
696
+ 'allowfullscreen' => true
697
+ );
698
+ $tags['input'] = array(
699
+ 'type' => true,
700
+ 'value' => true,
701
+ 'placeholder' => true,
702
+ 'class' => true,
703
+ 'style' => true,
704
+ 'name' => true,
705
+ 'id' => true,
706
+ 'checked' => true,
707
+ 'readonly' => true,
708
+ 'disabled' => true,
709
+ 'enabled' => true
710
+ );
711
+ $tags['select'] = array(
712
+ 'value' => true,
713
+ 'class' => true,
714
+ 'style' => true,
715
+ 'name' => true,
716
+ 'id' => true
717
+ );
718
+ $tags['option'] = array(
719
+ 'value' => true,
720
+ 'class' => true,
721
+ 'style' => true,
722
+ 'name' => true,
723
+ 'id' => true,
724
+ 'selected' => true
725
+ );
726
+ return $tags;
727
+ }
728
+
729
+
730
+ function wplc_shortcode_filter_mrg($content, $decode = false){
731
+ if($decode){
732
+ if(strpos($content, 'SYM34') != -1){
733
+ $content = str_replace("SYM34",'"',$content);
734
+ }
735
+
736
+ if(strpos($content, 'SYM35') != -1){
737
+ $content = str_replace("SYM35","'",$content);
738
+ }
739
+ }else{
740
+ if(strpos($content, '"') != -1){
741
+ $content = str_replace('\\"',"SYM34",$content);
742
+ }
743
+
744
+ if(strpos($content, "'") != -1){
745
+ $content = str_replace("\\'","SYM35",$content);
746
+ }
747
+ }
748
+ return $content;
749
+ }
750
+
751
+ function wplc_triggers_check_for_conflicts_mrg($triggers){
752
+ $all_page_array = array();
753
+ $tmp_page_array = array();
754
+ if(!is_bool($triggers)){
755
+ if(count($triggers) > 1){
756
+ foreach($triggers as $trigger){
757
+ if(isset($trigger->content)){
758
+ $unserialized_content = maybe_unserialize($trigger->content);
759
+ if(isset($unserialized_content['pages'])){
760
+ if($unserialized_content['pages'] != ""){
761
+ $pages_array = explode(",", trim($unserialized_content['pages'])); //Trim pages and explode
762
+ if(is_array($pages_array)){
763
+ foreach($pages_array as $page){
764
+ $imploded_pages = implode(",", $all_page_array);
765
+ $check = strpos($imploded_pages, $page);
766
+ if(is_bool($check) && $check == false){
767
+ $all_page_array[count($all_page_array)] = intval($page);
768
+ }else{
769
+ //Conflict
770
+ $tmp_page_array[count($tmp_page_array)] = intval($trigger->id);
771
+ }
772
+ }
773
+ }
774
+ } else{
775
+ //Assume All pages- Conflict
776
+ $tmp_page_array[count($tmp_page_array)] = intval($trigger->id);
777
+ }
778
+ }
779
+ }
780
+ }
781
+ }
782
+ }
783
+ return $tmp_page_array;
784
+
785
+ }
includes/wplc_departments.php ADDED
@@ -0,0 +1,791 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * Handles WPLC department functionality
5
+ */
6
+ global $wplc_tblname_chat_departments;
7
+ $wplc_tblname_chat_departments = $wpdb->prefix . "wplc_departments";
8
+
9
+ /**
10
+ * Updates/Creates the required tables in order to use roi in WPLC
11
+ *
12
+ * @return void
13
+ */
14
+ add_action("wplc_pro_update_db_hook", "wplc_mrg_update_db_department", 10);
15
+ function wplc_mrg_update_db_department(){
16
+ global $wpdb;
17
+ global $wplc_tblname_chat_departments;
18
+ global $wplc_tblname_chats;
19
+
20
+ $wplc_department_sql = "
21
+ CREATE TABLE " . $wplc_tblname_chat_departments . " (
22
+ id int(11) NOT NULL AUTO_INCREMENT,
23
+ name varchar(700) NOT NULL,
24
+ PRIMARY KEY (id)
25
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
26
+ ";
27
+
28
+ dbDelta($wplc_department_sql);
29
+
30
+
31
+
32
+ $department_field_sql = " SHOW COLUMNS FROM $wplc_tblname_chats WHERE `Field` = 'department_id'";
33
+ $results = $wpdb->get_results($department_field_sql);
34
+ if (!$results) {
35
+ $department_field_sql = "
36
+ ALTER TABLE `$wplc_tblname_chats` ADD `department_id` INT(11) NOT NULL ;
37
+ ";
38
+ $wpdb->query($department_field_sql);
39
+ }
40
+ }
41
+
42
+ add_filter("wplc_pro_agent_list_before_button_filter", "wplc_mrg_agent_list_department_span", 10, 2);
43
+ /**
44
+ * Adds current users assigned department to the agent information card
45
+ *
46
+ * @return string (html)
47
+ */
48
+ function wplc_mrg_agent_list_department_span($content, $user){
49
+ $user_department = get_user_meta($user->ID, "wplc_user_department", true);
50
+ if($user_department){
51
+ $selected_department = wplc_get_department_mrg(intval($user_department));
52
+ if($selected_department){
53
+ $content .= "<small style='height:30px'>" . $selected_department[0]->name . "</small>";
54
+ } else {
55
+ $content .= "<small style='height:30px'>" . __("No Department", "wplivechat") . "</small>";
56
+ }
57
+ } else {
58
+ //No department set
59
+ $content .= "<small style='height:30px'>" . __("No Department", "wplivechat") . "</small>";
60
+ }
61
+ return $content;
62
+ }
63
+
64
+ add_action("wplc_pro_custom_user_profile_field_after_content_hook", "wplc_mrg_department_user_profile_departments", 10, 1);
65
+ /**
66
+ * Outputs department options to the user profile area
67
+ *
68
+ * @return void
69
+ */
70
+ function wplc_mrg_department_user_profile_departments($user){
71
+ $user_is_agent = esc_attr(get_the_author_meta( 'wplc_ma_agent', $user->ID));
72
+ if($user_is_agent == "1"){
73
+ $selected_department = intval(get_user_meta($user->ID, "wplc_user_department", true));
74
+ if(current_user_can('manage_options', array(null))){
75
+ ?>
76
+ <table class="form-table">
77
+ <tr>
78
+ <th>
79
+ <label for="wplc_user_department"><?php _e('Chat Department', 'wplivechat'); ?></label>
80
+ </th>
81
+ <td>
82
+ <select id="wplc_user_department" name="wplc_user_department">
83
+ <option value="-1"><?php _e("No Department", "wplivechat"); ?></option>
84
+ <?php
85
+ $departments = wplc_get_all_deparments_mrg();
86
+ if($departments){
87
+ foreach($departments as $dep){
88
+ ?>
89
+ <option value="<?php echo $dep->id;?>" <?php echo ($selected_department === intval($dep->id) ? "SELECTED" : "" ); ?> ><?php echo $dep->name; ?></option>
90
+ <?php
91
+ }
92
+ }
93
+ ?>
94
+ </select>
95
+ </td>
96
+ </tr>
97
+ </table>
98
+ <?php
99
+ }
100
+ }
101
+ }
102
+
103
+ add_action("wplc_pro_set_user_hook", "wplc_mrg_department_save", 10, 1);
104
+ /**
105
+ * Handles the saving of user department data
106
+ *
107
+ */
108
+ function wplc_mrg_department_save($user_id){
109
+ if ( !current_user_can( 'edit_user', $user_id ) ) { return false; }
110
+
111
+ if(isset($_POST['wplc_user_department'])){
112
+ update_user_meta( $user_id, 'wplc_user_department', intval($_POST['wplc_user_department']));
113
+ }
114
+
115
+ }
116
+
117
+ /**
118
+ * Adds a menu item to WPLC for the roi Goal Area
119
+ *
120
+ * @return void
121
+ */
122
+ add_action("wplc_hook_menu_mid","wplc_mrg_department_menu",10,1);
123
+ function wplc_mrg_department_menu($cap){
124
+ add_submenu_page('wplivechat-menu', __('Departments', 'wplivechat'), __('Departments', 'edit_posts'), $cap[0], 'wplivechat-menu-departments', 'wplc_mrg_departments_page');
125
+ }
126
+
127
+ /**
128
+ * Outputs (echo) the departmens page
129
+ *
130
+ * @return void
131
+ */
132
+ function wplc_mrg_departments_page(){
133
+
134
+ wplc_enqueue_admin_styles_mrg();
135
+ $wplc_add_department_btn = isset($_GET['wplc_action']) ? "" : "<a href='?page=wplivechat-menu-departments&wplc_action=add_department' class='wplc_add_new_btn'>". __("Add New", 'wp-livechat') ."</a>";
136
+
137
+ $wplc_department_settings_btn = "<a href='?page=wplivechat-menu-settings#tabs-departments' class='wplc_add_new_btn'>". __("Department Settings", 'wp-livechat') ."</a>";
138
+
139
+ $content = "<div class='wrap wplc_wrap'>";
140
+ $content .= "<h2>".__('WP Live Chat Support Departments', 'wp-livechat')." (beta) " . $wplc_add_department_btn . " " . $wplc_department_settings_btn . "</h2>";
141
+
142
+ if(isset($_GET['wplc_action']) && ($_GET['wplc_action'] == "add_department" || $_GET['wplc_action'] == "edit_department")){
143
+ $content .= wplc_mrg_get_add_department_content();
144
+ } else if(isset($_GET['wplc_action']) && ($_GET['wplc_action'] == "delete_department")){
145
+ $content .= wplc_mrg_delete_department_content();
146
+ } else {
147
+ $content .= wplc_mrg_get_departments_table();
148
+ }
149
+
150
+ $content .= "</div>"; //Close Wrap
151
+
152
+ echo $content;
153
+ }
154
+
155
+
156
+ /**
157
+ * Returns the department table
158
+ *
159
+ * @return string (html)
160
+ */
161
+ function wplc_mrg_get_departments_table(){
162
+ $content = "";
163
+
164
+ $results = wplc_get_all_deparments_mrg();
165
+
166
+
167
+ $content .= "<table class=\"wp-list-table wplc_list_table widefat fixed \" cellspacing=\"0\" style='width:98%'>";
168
+ $content .= "<thead>";
169
+ $content .= "<tr>";
170
+ $content .= "<th scope='col'><span>" . __("ID", "wplivechat") . "</span></th>";
171
+ $content .= "<th scope='col'><span>" . __("Name", "wplivechat") . "</span></th>";
172
+ $content .= "<th scope='col'><span>" . __("Action", "wplivechat") . "</span></th>";
173
+ $content .= "</tr>";
174
+ $content .= "</thead>";
175
+
176
+
177
+ if($results){
178
+ foreach ($results as $result) {
179
+ $department_actions = "<a class='button' href='?page=wplivechat-menu-departments&wplc_action=edit_department&department_id=".$result->id."'>".__("Edit", "wp-livechat")."</a> ";
180
+ $department_actions .= "<a class='button' href='?page=wplivechat-menu-departments&wplc_action=delete_department&department_id=".$result->id."'>".__("Delete", "wp-livechat")."</a> ";
181
+
182
+ $content .= "<tr>";
183
+ $content .= "<td>".$result->id."</td>";
184
+ $content .= "<td>".$result->name."</td>";
185
+ $content .= "<td>".$department_actions."</td>";
186
+ $content .= "</tr>";
187
+
188
+ }
189
+ } else {
190
+ $content .= "<tr><td>".__("No Departments Found...", "wp-livechat")."</td><td></td><td></td></tr>";
191
+ }
192
+
193
+ $content .= "</table>";
194
+
195
+ return $content;
196
+ }
197
+
198
+ /**
199
+ * Return all departments from database
200
+ *
201
+ * @return object
202
+ */
203
+ function wplc_get_all_deparments_mrg(){
204
+ global $wpdb;
205
+ global $wplc_tblname_chat_departments;
206
+
207
+ $sql = "SELECT * FROM $wplc_tblname_chat_departments";
208
+
209
+ $results = $wpdb->get_results($sql);
210
+ if($wpdb->num_rows){
211
+ return $results;
212
+ } else {
213
+ return false;
214
+ }
215
+ }
216
+
217
+ /**
218
+ * Create the 'Add new' or 'Edit' Department page
219
+ *
220
+ * @return string (html)
221
+ */
222
+ function wplc_mrg_get_add_department_content(){
223
+ $content = "";
224
+
225
+ //Content Vars
226
+ $department_name = "";
227
+
228
+ $header_array = wplc_mrg_department_admin_head();
229
+
230
+ if($header_array){
231
+ if(isset($header_array['wplc_department_name'])){ $department_name = $header_array['wplc_department_name']; }
232
+ }
233
+
234
+ $wplc_submit_label = (isset($_GET['wplc_action']) && $_GET['wplc_action'] !== "edit_department" ? "Create Department" : "Edit Department"); //Default
235
+
236
+ $content .= "<form method='POST'>";
237
+ $content .= "<table class=\"wp-list-table wplc_list_table widefat fixed form-table\" cellspacing=\"0\" style='width:50%'>";
238
+
239
+ $content .= "<tr>";
240
+ $content .= "<td>".__("Department Name", "wp-livechat").":</td>";
241
+ $content .= "<td><input type='text' name='wplc_department_name' value='$department_name'></td>";
242
+ $content .= "</tr>";
243
+
244
+ $content .= "<tr>";
245
+ $content .= "<td></td>";
246
+ $content .= "<td><input class='button button-primary' type='submit' name='wplc_department_submit' value='".__($wplc_submit_label, "wp-livechat")."'> <a href='".admin_url()."admin.php?page=wplivechat-menu-departments"."' class='button'>".__("Cancel", "wp-livechat")."</a></td>";
247
+ $content .= "</tr>";
248
+
249
+ $content .= "</table>";
250
+ $content .= "</form>";
251
+
252
+ if($header_array){
253
+ if(count($header_array["errors"]) >= 1){
254
+ $content .= "<div class='update-nag'>";
255
+ $content .= "<strong>".__("Please review your submission", "wp-livechat").":</strong>";
256
+ $content .= "<ul style='list-style:initial;'>";
257
+ for($i = 0; $i < count($header_array["errors"]); $i++){
258
+ $content .= "<li style='margin-left: 25px;'>".__($header_array["errors"][$i], "wp-livechat")."</li>";
259
+ }
260
+ $content .= "</ul>";
261
+ $content .= "</div>";
262
+ }
263
+
264
+ if(isset($header_array["success"])){
265
+ $content .= "<div class='update-nag' style='border-color:#67d552;'>";
266
+ $content .= "<strong>".__($header_array["success"], "wp-livechat")."</strong>";
267
+ $content .= "</div>";
268
+ }
269
+ }
270
+
271
+
272
+ return $content;
273
+ }
274
+
275
+
276
+ /**
277
+ * Handles all the head stuff
278
+ * @return array
279
+ */
280
+ function wplc_mrg_department_admin_head(){
281
+ if(isset($_GET['wplc_action'])){
282
+ $return_array = array();
283
+ $form_valid = true;
284
+ if(isset($_POST['wplc_department_submit'])){
285
+ $return_array["errors"] = array();
286
+ if(isset($_POST['wplc_department_name']) && $_POST['wplc_department_name'] !== ""){
287
+ $return_array["wplc_department_name"] = $_POST['wplc_department_name'];
288
+ } else {
289
+ $return_array["errors"][count($return_array["errors"]) >= 1 ? count($return_array["errors"]) : 0] = "Name cannot be empty";
290
+ $form_valid = false; //No Longer Valid
291
+ }
292
+ }
293
+
294
+ if($_GET['wplc_action'] == "add_department"){
295
+ if($form_valid && isset($_POST['wplc_department_submit'])){
296
+ //All good continue
297
+ if(wplc_add_department_mrg($return_array)){
298
+ //Redirect here
299
+ echo "<script> window.location = '".admin_url()."admin.php?page=wplivechat-menu-departments"."';</script>";
300
+ }
301
+ } else {
302
+ return $return_array; //Return Posted Data
303
+ }
304
+ } else if ($_GET['wplc_action'] == "edit_department"){
305
+ //Editing now
306
+ $edit_array = array();
307
+ $edit_array["errors"] = array();
308
+ if (isset($return_array["errors"])) { $edit_array["errors"] = $return_array["errors"]; }
309
+
310
+ //Submit data first
311
+ if($form_valid && isset($_POST['wplc_department_submit'])){
312
+ //All good continue
313
+ if(isset($_GET['department_id'])){
314
+ if(wplc_edit_department_mrg($return_array, intval($_GET['department_id']))){
315
+ //Show edit message
316
+ $edit_array['success'] = "<div>".__("Department has been edited.", "wp-livechat")."</div>";
317
+ }
318
+ } else {
319
+ $edit_array["errors"][count($edit_array["errors"]) >= 1 ? count($edit_array["errors"]) : 0] = "Department ID not found";
320
+ }
321
+ }
322
+
323
+ $data = wplc_get_department_mrg(intval($_GET['department_id']));
324
+ if($data){
325
+ if($data !== false && is_array($data)){
326
+ //Got the data
327
+ if(isset($data[0]->name) && $data[0]->name !== ""){ $edit_array["wplc_department_name"] = $data[0]->name; }
328
+ }
329
+ } else{
330
+ $edit_array["errors"][count($edit_array["errors"]) >= 1 ? count($edit_array["errors"]) : 0] = "Department ID not found";
331
+ }
332
+
333
+ return $edit_array; //Return Server Data
334
+ }else if($_GET['wplc_action'] == "delete_department"){
335
+ $delete_array = array();
336
+ if(isset($_GET['department_id'])){
337
+ $data = wplc_get_department_mrg(intval($_GET['department_id']));
338
+ if($data){
339
+ $delete_array["name"] = $data[0]->name;
340
+ }
341
+
342
+ if(isset($_POST['delete_confirm'])){
343
+ //Delete now
344
+ if(wplc_delete_department_mrg(intval($_GET['department_id']))){
345
+ //Success
346
+ }
347
+ echo "<script> window.location = '".admin_url()."admin.php?page=wplivechat-menu-departments"."';</script>";
348
+ }
349
+ }
350
+ return $delete_array;
351
+ }else {
352
+ return false;
353
+ }
354
+ }else{
355
+ return false;
356
+ }
357
+ }
358
+
359
+ /**
360
+ * Adds a new Department
361
+ *
362
+ * @return boolean
363
+ */
364
+ function wplc_add_department_mrg($data){
365
+ global $wpdb;
366
+ global $wplc_tblname_chat_departments;
367
+ if($data){
368
+ $data_name;
369
+
370
+ //Validation - 1
371
+ if($data['wplc_department_name'] != ""){ $data_name = $data['wplc_department_name']; } else { return false; }
372
+
373
+ //Validation - 2
374
+ $data_name = esc_attr($data_name);
375
+
376
+ $sql = "INSERT INTO $wplc_tblname_chat_departments SET `name` = '".$data_name."' ";
377
+ $wpdb->query($sql);
378
+ if ($wpdb->last_error) {
379
+ return false;
380
+ } else {
381
+ return true;
382
+ }
383
+ }
384
+ }
385
+
386
+ /**
387
+ * Edit a Department
388
+ *
389
+ * @return boolean
390
+ */
391
+ function wplc_edit_department_mrg($data, $id){
392
+ global $wpdb;
393
+ global $wplc_tblname_chat_departments;
394
+ if($data){
395
+ $department_name;
396
+
397
+ //Validation - 1
398
+ if($data['wplc_department_name'] != ""){ $department_name = $data['wplc_department_name']; } else { return false; }
399
+
400
+ //Validation - 2
401
+ $department_name = esc_attr($department_name);
402
+
403
+ $id = intval($id);
404
+ $sql = "UPDATE $wplc_tblname_chat_departments SET `name` = '".$department_name."' WHERE `id` = '".$id."' ";
405
+ $wpdb->query($sql);
406
+ if ($wpdb->last_error) {
407
+ return false;
408
+ } else {
409
+ return true;
410
+ }
411
+ }
412
+ }
413
+
414
+ /**
415
+ * Retrieved one department
416
+ */
417
+ function wplc_get_department_mrg($id){
418
+ global $wpdb;
419
+ global $wplc_tblname_chat_departments;
420
+
421
+ $id = intval($id);
422
+
423
+ $sql = "SELECT * FROM $wplc_tblname_chat_departments WHERE `id` = '$id'";
424
+
425
+ $results = $wpdb->get_results($sql);
426
+ if($wpdb->num_rows){
427
+ return $results;
428
+ } else {
429
+ return false;
430
+ }
431
+ }
432
+
433
+ /**
434
+ * Returns confirmation form prior to deleting a department
435
+ *
436
+ * @return string (html)
437
+ */
438
+ function wplc_mrg_delete_department_content(){
439
+ $header_array = wplc_mrg_department_admin_head();
440
+ $department_name = "";
441
+ if($header_array){
442
+ if(isset($header_array["name"])){ $department_name = $header_array["name"];}
443
+ }
444
+
445
+ $content = "";
446
+ if( (isset($_GET['wplc_action']) & isset($_GET['department_id'])) && ($_GET['wplc_action'] == "delete_department" && $_GET['department_id'] != "")){
447
+
448
+ $content .= "<form method='POST'>";
449
+ $content .= "<table class=\"wp-list-table wplc_list_table widefat fixed form-table\" cellspacing=\"0\" style='width:50%'>";
450
+ $content .= "<tr>";
451
+ $content .= "<td>";
452
+ $content .= __("Are you sure you would like to delete department") . ": <strong>" . $department_name . "</strong>";
453
+ $content .= "</td>";
454
+ $content .= "</tr>";
455
+ $content .= "<tr>";
456
+ $content .= "<td>";
457
+ $content .= "<input type='submit' class='button' name='delete_confirm' value='".__("Delete", "wp-livechat")."'>";
458
+ $content .= " <a href='".admin_url()."admin.php?page=wplivechat-menu-departments' class='button'>".__("Cancel", "wp-livechat")."</a>";
459
+ $content .= "</td>";
460
+ $content .= "</tr>";
461
+ $content .= "</table>";
462
+ $content .= "</form>";
463
+ }
464
+
465
+ return $content;
466
+ }
467
+
468
+
469
+ /**
470
+ * Removes a Department
471
+ *
472
+ * @return boolean
473
+ */
474
+ function wplc_delete_department_mrg($id){
475
+ global $wpdb;
476
+ global $wplc_tblname_chat_departments;
477
+ $id = intval($id);
478
+ $sql = "DELETE FROM $wplc_tblname_chat_departments WHERE `id` = '".$id."' ";
479
+ $wpdb->query($sql);
480
+ if ($wpdb->last_error) {
481
+ return false;
482
+ } else {
483
+ return true;
484
+ }
485
+ }
486
+
487
+ add_filter("wplc_filter_setting_tabs","wplc_mrg_department_settings_tab_heading");
488
+ /**
489
+ * Creates settings area tab
490
+ *
491
+ * @return string (html)
492
+ */
493
+ function wplc_mrg_department_settings_tab_heading($tab_array) {
494
+ $tab_array['department'] = array(
495
+ "href" => "#tabs-departments",
496
+ "icon" => 'fa fa-university',
497
+ "label" => __("Departments","wplivechat")
498
+ );
499
+ return $tab_array;
500
+ }
501
+
502
+ add_action("wplc_hook_settings_page_more_tabs","wplc_mrg_department_settings_tab_content");
503
+ /**
504
+ * Creates settings area content
505
+ *
506
+ * @return string (html)
507
+ */
508
+ function wplc_mrg_department_settings_tab_content() {
509
+ $wplc_settings = get_option("WPLC_SETTINGS");
510
+ $selected_department = isset($wplc_settings['wplc_default_department']) ? $wplc_settings['wplc_default_department'] : -1;
511
+
512
+ $allow_department_selection = isset($wplc_settings['wplc_allow_department_selection']) ? intval($wplc_settings['wplc_allow_department_selection']) : 0;
513
+ ?>
514
+ <div id="tabs-departments">
515
+ <h3><?php _e("Departments", "wplivechat") ?></h3>
516
+ <table class="wp-list-table wplc_list_table widefat fixed striped pages">
517
+ <tbody>
518
+ <tr>
519
+ <td width='300'>
520
+ <?php _e("Default Department", "wplivechat") ?>
521
+ <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Default department a new chat is assigned to", "wplivechat"); ?>"></i>
522
+ </td>
523
+ <td>
524
+ <select id="wplc_default_department" name="wplc_default_department">
525
+ <option value="-1"><?php _e("No Department", "wplivechat"); ?></option>
526
+ <?php
527
+ $departments = wplc_get_all_deparments_mrg();
528
+ if($departments){
529
+ foreach($departments as $dep){
530
+ ?>
531
+ <option value="<?php echo $dep->id;?>" <?php echo ($selected_department === intval($dep->id) ? "SELECTED" : "" ); ?> ><?php echo $dep->name; ?></option>
532
+ <?php
533
+ }
534
+ }
535
+ ?>
536
+ </select> <a href="<?php echo admin_url('admin.php?page=wplivechat-menu-departments'); ?>" class="button button-secondary" title="<?php __('Create or Edit Departments') ?>"><i class="fa fa-pencil wplc_light_grey"></i></a>
537
+ </td>
538
+ </tr>
539
+
540
+ <tr>
541
+ <td width='300'>
542
+ <?php _e("User Department Selection", "wplivechat") ?>
543
+ <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>
544
+ </td>
545
+ <td>
546
+ <input type="checkbox" name="wplc_allow_department_selection" id="wplc_allow_department_selection" value="1" <?php echo($allow_department_selection == 1 ? "CHECKED" : "") ?> />
547
+ </td>
548
+ </tr>
549
+
550
+ <tr>
551
+ <td width='300'>
552
+ <?php _e("Note: Chats will be transferred in the event that agents are not available within the selected department", "wplivechat") ?>
553
+ </td>
554
+ <td>
555
+
556
+ </td>
557
+ </tr>
558
+
559
+ <?php do_action("wplc_pro_departments_settings_inside_table_hook"); ?>
560
+
561
+ </tbody>
562
+ </table>
563
+ <p><?php echo sprintf(__("Create departments <a href='%s'>here</a>."),admin_url('admin.php?page=wplivechat-menu-departments')); ?></p>
564
+ <br>
565
+
566
+ <?php do_action("wplc_pro_departments_settings_below_table_hook"); ?>
567
+
568
+ </div>
569
+
570
+ <?php
571
+
572
+ }
573
+
574
+ add_filter("wplc_pro_setting_save_filter", "wplc_mrg_department_settings_save", 10, 1);
575
+ /**
576
+ * Handles saving Department settings
577
+ *
578
+ * @param array $settings (Pro Settings)
579
+ * @return array (Pro Settings array)
580
+ */
581
+ function wplc_mrg_department_settings_save($settings){
582
+ if (isset($_POST['wplc_default_department'])) { $settings['wplc_default_department'] = intval($_POST['wplc_default_department']); } else { $settings['wplc_default_department'] = -1; }
583
+ 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; }
584
+
585
+ return $settings;
586
+ }
587
+
588
+ add_filter("wplc_alter_chat_list_sql_before_sorting", "wplc_mrg_add_department_sql", 10, 1);
589
+ /**
590
+ * Adds department SQL to the admin chat list loop
591
+ *
592
+ * @param string $content
593
+ * @return string
594
+ */
595
+ function wplc_mrg_add_department_sql($content){
596
+ $user_id = get_current_user_id();
597
+ $user_department = get_user_meta($user_id ,"wplc_user_department", true);
598
+ if($user_department && $user_department !== "" && $user_department !== "-1" && $user_department !== -1){
599
+ $content .= " AND (`department_id` = '" . intval($user_department) . "') ";
600
+ } else {
601
+ if(isset($_POST['wplc_department_view'])){
602
+ $content .= " AND (`department_id` = '" . intval($_POST['wplc_department_view']) . "') ";
603
+ }
604
+ }
605
+
606
+ return $content;
607
+ }
608
+
609
+ add_action("wplc_after_chat_visitor_count_hook", "wplc_user_department_label_mrg");
610
+ /**
611
+ * Outputs a span which shows the users department in the dashboard
612
+ *
613
+ * @return void
614
+ */
615
+ function wplc_user_department_label_mrg(){
616
+ $user_id = get_current_user_id();
617
+ $user_department = get_user_meta($user_id ,"wplc_user_department", true);
618
+ if($user_department && $user_department !== ""){
619
+ if($user_department !== "-1"){
620
+ $selected_department = wplc_get_department_mrg(intval($user_department));
621
+ if($selected_department){
622
+ 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>";
623
+ }
624
+ } else {
625
+ wplc_dashboard_department_selector_mrg();
626
+ }
627
+ } else {
628
+ wplc_dashboard_department_selector_mrg();
629
+ }
630
+ }
631
+
632
+ /**
633
+ * Outputs a selection box for selecting which department you would like to view
634
+ *
635
+ * @return void
636
+ */
637
+ function wplc_dashboard_department_selector_mrg(){
638
+ $content = "";
639
+ $departments = wplc_get_all_deparments_mrg();
640
+ $current_selection = isset($_GET['wplc_department_view']) ? $_GET['wplc_department_view'] : -1;
641
+ if($departments){
642
+ $content .= "<select style='max-width:60%; margin-left:auto; margin-right:auto;' class='wplc_dashboard_additional_label' id='wplc_dashboard_department_selector'>";
643
+ $content .= "<option value='0' >" . __("No Department", "wplivechat") . "</option>";
644
+ foreach($departments as $dep){
645
+ // $content .= "<option value='" . $dep->id ."' " . (intval($default_department) === intval($dep->id) ? "SELECTED" : ""). ">" . $dep->name . "</option>";
646
+ $content .= "<option value='" . $dep->id ."' ". (intval($current_selection) === intval($dep->id) ? "SELECTED" : ""). ">" . $dep->name . "</option>";
647
+
648
+ }
649
+ $content .= "</select>";
650
+ }
651
+
652
+ echo $content;
653
+ wplc_dashboard_department_selector_script_mrg();
654
+ }
655
+
656
+ /**
657
+ * Outputs javascript to handle changes from the selection
658
+ *
659
+ * @return void
660
+ */
661
+ function wplc_dashboard_department_selector_script_mrg(){
662
+ ?>
663
+ <script>
664
+ var wplc_selected_department_view = getQueryVariable("wplc_department_view");
665
+
666
+ jQuery(function(){
667
+ jQuery("body").on("change", "#wplc_dashboard_department_selector", function(){
668
+ var base_url = "<?php echo admin_url('admin.php?page=wplivechat-menu')?>";
669
+ window.location = base_url + (jQuery(this).val() !== "0" ? "&wplc_department_view=" + jQuery(this).val() : "");
670
+ });
671
+ });
672
+
673
+ function wplc_pro_admin_long_poll_data(data){
674
+ if(wplc_selected_department_view !== false){
675
+ data['wplc_department_view'] = wplc_selected_department_view;
676
+ }
677
+
678
+ return data;
679
+ }
680
+
681
+ function getQueryVariable(variable){
682
+ var query = window.location.search.substring(1);
683
+ var vars = query.split("&");
684
+ for (var i=0;i<vars.length;i++) {
685
+ var pair = vars[i].split("=");
686
+ if(pair[0] == variable){
687
+ return pair[1];
688
+ }
689
+ }
690
+ return false;
691
+ }
692
+ </script>
693
+ <?php
694
+ }
695
+
696
+
697
+ add_filter("wplc_log_user_on_page_insert_filter", "wplc_log_user_default_department_mrg", 10, 1);
698
+ /**
699
+ * Sets the default department when a new chat session is added
700
+ *
701
+ * @param array $insert_data Data from the LogUserOnPage function
702
+ * @return array
703
+ */
704
+ function wplc_log_user_default_department_mrg($insert_data){
705
+ $wplc_settings = get_option("WPLC_SETTINGS");
706
+ $selected_department = isset($wplc_settings['wplc_default_department']) ? $wplc_settings['wplc_default_department'] : -1;
707
+ if($selected_department && $selected_department !== -1){
708
+ //Set the default department
709
+ $insert_data["department_id"] = $selected_department;
710
+ }
711
+ return $insert_data;
712
+ }
713
+
714
+ add_filter("wplc_start_chat_user_form_after_filter", "wplc_allow_department_selection_user_form_mrg", 10, 1);
715
+ /**
716
+ * Adds a Department Selection Dropdown Box to the start chat form
717
+ *
718
+ * @param string $content
719
+ * @return string
720
+ */
721
+ function wplc_allow_department_selection_user_form_mrg($content){
722
+ $wplc_settings = get_option("WPLC_SETTINGS");
723
+ $allow_department_selection = isset($wplc_settings['wplc_allow_department_selection']) ? intval($wplc_settings['wplc_allow_department_selection']) : 0;
724
+ $default_department = isset($wplc_settings['wplc_default_department']) ? $wplc_settings['wplc_default_department'] : -1;
725
+
726
+ if($allow_department_selection && $allow_department_selection !== 0){
727
+ $departments = wplc_get_all_deparments_mrg();
728
+ if($departments){
729
+ $content .= "<select id='wplc_user_selected_department'>";
730
+ $content .= "<option value='0' >" . __("Select Department", "wplivechat") . "</option>";
731
+ foreach($departments as $dep){
732
+ $content .= "<option value='" . $dep->id ."' " . (intval($default_department) === intval($dep->id) ? "SELECTED" : ""). ">" . $dep->name . "</option>";
733
+ }
734
+ $content .= "</select>";
735
+ }
736
+ }
737
+ return $content;
738
+ }
739
+
740
+
741
+ add_action("wplc_start_chat_hook_after_data_insert", "wplc_mrg_department_user_selected_department", 10, 1);
742
+ /**
743
+ * Updates a chat record to the user selection
744
+ *
745
+ * @param int $cid Chat ID
746
+ * @return void
747
+ */
748
+ function wplc_mrg_department_user_selected_department($cid){
749
+ if(isset($_POST['wplc_user_selected_department'])){
750
+ wplc_mrg_department_update_department($cid, $_POST['wplc_user_selected_department']);
751
+ } else {
752
+ wplc_mrg_department_update_department($cid, null);
753
+ }
754
+ }
755
+
756
+ /**
757
+ * Updates a chat session with a new department id
758
+ *
759
+ * @param int $cid Chat ID
760
+ * @param int $department_id Department ID
761
+ * @return void
762
+ */
763
+ function wplc_mrg_department_update_department($cid, $department_id){
764
+ global $wpdb;
765
+ global $wplc_tblname_chats;
766
+ $cid = intval($cid);
767
+
768
+ if($department_id !== null){
769
+ $department_id = intval($department_id);
770
+ } else {
771
+ $chat_data = wplc_get_chat_data($cid,__LINE__);
772
+ if(isset($chat_data->department_id)){
773
+ $department_id = intval($chat_data->department_id);
774
+ }
775
+ }
776
+
777
+ $original_department = $department_id;
778
+ $department_id = apply_filters("wplc_pro_department_update_filter", $department_id, $cid); //Allows us to ensure this department is available
779
+
780
+ if($original_department !== $department_id){
781
+ if($cid && $department_id){
782
+ $wpdb->update(
783
+ $wplc_tblname_chats,
784
+ array('department_id' => $department_id),
785
+ array('id' => $cid),
786
+ array('%d'),
787
+ array('%d')
788
+ );
789
+ }
790
+ }
791
+ }
includes/wplc_roi.php ADDED
@@ -0,0 +1,813 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Handles WPLC roi functionality
4
+ */
5
+ global $wplc_tblname_chat_roi_goals;
6
+ global $wplc_tblname_chat_roi_conversions;
7
+
8
+ $wplc_tblname_chat_roi_goals = $wpdb->prefix . "wplc_roi_goals";
9
+ $wplc_tblname_chat_roi_conversions = $wpdb->prefix . "wplc_roi_conversions";
10
+
11
+
12
+ /*
13
+ * Hooks into 'wp_print_footer_scripts' to check if the a goal is present
14
+ */
15
+ add_action("wp_print_footer_scripts", "wplc_mrg_roi_goals_page_check", 10);
16
+ function wplc_mrg_roi_goals_page_check(){
17
+ $post_id = url_to_postid($_SERVER['REQUEST_URI']);
18
+ $goal_id = wplc_mrg_roi_check_page_id($post_id);
19
+ if($goal_id){
20
+ //This page matches a goal
21
+ if(isset($_COOKIE['wplc_had_chat']) && ( $_COOKIE['wplc_had_chat'] === 'true' || $_COOKIE['wplc_had_chat'] === true )){
22
+ if(isset($_COOKIE['wplc_cid'])){
23
+ //There is a CID - Try log the conversion
24
+ $cid = intval($_COOKIE['wplc_cid']);
25
+ $goal_id = intval($goal_id);
26
+ if(wplc_mrg_roi_conversion($cid, $goal_id)){
27
+ //Added
28
+ }
29
+ }
30
+ }
31
+ }
32
+ }
33
+
34
+ /*
35
+ * Updates/Creates the required tables in order to use roi in WPLC
36
+ */
37
+ add_action("wplc_pro_update_db_hook", "wplc_mrg_update_db_roi", 10);
38
+ function wplc_mrg_update_db_roi(){
39
+ global $wplc_tblname_chat_roi_goals;
40
+ global $wplc_tblname_chat_roi_conversions;
41
+
42
+ $wplc_roi_goal_sql = "
43
+ CREATE TABLE " . $wplc_tblname_chat_roi_goals . " (
44
+ id int(11) NOT NULL AUTO_INCREMENT,
45
+ name varchar(700) NOT NULL,
46
+ pages int(11) NOT NULL,
47
+ overview varchar(700) NULL,
48
+ amount float NOT NULL,
49
+ PRIMARY KEY (id)
50
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
51
+ ";
52
+
53
+ $wplc_roi_conversion_sql = "
54
+ CREATE TABLE " . $wplc_tblname_chat_roi_conversions . " (
55
+ id int(11) NOT NULL AUTO_INCREMENT,
56
+ goal_id int(11) NOT NULL,
57
+ chat_id int(11) NOT NULL,
58
+ timestamp datetime NOT NULL,
59
+ PRIMARY KEY (id)
60
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
61
+ ";
62
+
63
+ dbDelta($wplc_roi_goal_sql);
64
+ dbDelta($wplc_roi_conversion_sql);
65
+ }
66
+
67
+ /*
68
+ * Adds a menu item to WPLC for the roi Goal Area
69
+ */
70
+ add_action("wplc_hook_menu_mid","wplc_mrg_roi_menu",10,1);
71
+ function wplc_mrg_roi_menu($cap){
72
+ add_submenu_page('wplivechat-menu', __('ROI Goals', 'wplivechat'), __('ROI Goals', 'edit_posts'), $cap[0], 'wplivechat-menu-roi-goals', 'wplc_mrg_roi_goals_page');
73
+ }
74
+
75
+ /*
76
+ * Handles creation of the roi Goals Area
77
+ */
78
+ function wplc_mrg_roi_goals_page(){
79
+
80
+ wplc_enqueue_admin_styles_mrg();
81
+ wplc_mrg_roi_version_notice();
82
+
83
+ $wplc_add_goal_btn = isset($_GET['wplc_action']) ? "" : "<a href='?page=wplivechat-menu-roi-goals&wplc_action=add_goal' class='wplc_add_new_btn'>". __("Add New", 'wp-livechat') ."</a>";
84
+ $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>";
85
+
86
+ $content = "<div class='wrap wplc_wrap'>";
87
+ $content .= "<h2>".__('WP Live Chat Support ROI Goals', 'wp-livechat')." (beta) " . $wplc_add_goal_btn . " " . $wplc_view_reports_btn . "</h2>";
88
+
89
+ if(isset($_GET['wplc_action']) && ($_GET['wplc_action'] == "add_goal" || $_GET['wplc_action'] == "edit_goal")){
90
+ $content .= wplc_mrg_get_add_goal_content();
91
+ } else if(isset($_GET['wplc_action']) && ($_GET['wplc_action'] == "delete_goal")){
92
+ $content .= wplc_mrg_delete_goal_content();
93
+ } else {
94
+ $content .= wplc_mrg_get_roi_goals_table();
95
+ }
96
+
97
+ $content .= "</div>"; //Close Wrap
98
+
99
+
100
+ echo $content;
101
+ }
102
+
103
+ /*
104
+ * Version monitor
105
+ */
106
+ function wplc_mrg_roi_version_notice(){
107
+ global $wplc_version;
108
+ if (intval(str_replace(".","",$wplc_version)) < 6207) {
109
+ echo "<div class='update-nag' style='padding-top:0px;margin-top:5px;margin-bottom:10px;'>";
110
+ echo "<p>In order to use ROI Goals, please ensure you are using the latest basic version (version 6.2.06 or newer).</p>";
111
+ echo "<a title='Update Now' href='./update-core.php' class='button button-primary'>".__("Update now" ,"wp-livechat")."</a>";
112
+ echo "</div>";
113
+ }
114
+ }
115
+
116
+ /*
117
+ * Returns the roi Goals table
118
+ */
119
+ function wplc_mrg_get_roi_goals_table(){
120
+ $content = "";
121
+
122
+ $results = wplc_get_all_goals_mrg();
123
+
124
+
125
+ $content .= "<table class=\"wp-list-table wplc_list_table widefat fixed \" cellspacing=\"0\" style='width:98%'>";
126
+ $content .= "<thead>";
127
+ $content .= "<tr>";
128
+ $content .= "<th scope='col'><span>" . __("ID", "wplivechat") . "</span></th>";
129
+ $content .= "<th scope='col'><span>" . __("Name", "wplivechat") . "</span></th>";
130
+ $content .= "<th scope='col'>" . __("Overview", "wplivechat") . "</th>";
131
+ $content .= "<th scope='col'>" . __("Page", "wplivechat") . "</th>";
132
+ $content .= "<th scope='col'>" . __("Value", "wplivechat") . "</th>";
133
+ $content .= "<th scope='col'><span>" . __("Action", "wplivechat") . "</span></th>";
134
+ $content .= "</tr>";
135
+ $content .= "</thead>";
136
+
137
+
138
+ if($results){
139
+ foreach ($results as $result) {
140
+ $roi_goal_actions = "<a class='button' href='?page=wplivechat-menu-roi-goals&wplc_action=edit_goal&goal_id=".$result->id."'>".__("Edit", "wp-livechat")."</a> ";
141
+ $roi_goal_actions .= "<a class='button' href='?page=wplivechat-menu-roi-goals&wplc_action=delete_goal&goal_id=".$result->id."'>".__("Delete", "wp-livechat")."</a> ";
142
+
143
+ $content .= "<tr>";
144
+ $content .= "<td>".$result->id."</td>";
145
+ $content .= "<td>".$result->name."</td>";
146
+ $content .= "<td>".trim(substr(strip_tags($result->overview), 0, 120))."</td>";
147
+ $content .= "<td>".(strip_tags($result->pages) == "" ? __("None", "wp-livechat") : strip_tags($result->pages))."</td>";
148
+ $content .= "<td>".$result->amount."</td>";
149
+ $content .= "<td>".$roi_goal_actions."</td>";
150
+ $content .= "</tr>";
151
+
152
+ }
153
+ } else {
154
+ $content .= "<tr><td>".__("No ROI Goals Found...", "wp-livechat")."</td><td></td><td></td><td></td><td></td></tr>";
155
+ }
156
+
157
+ $content .= "</table>";
158
+
159
+ return $content;
160
+ }
161
+
162
+ /*
163
+ * Return all goals from database
164
+ */
165
+ function wplc_get_all_goals_mrg(){
166
+ global $wpdb;
167
+ global $wplc_tblname_chat_roi_goals;
168
+
169
+ $sql = "SELECT * FROM $wplc_tblname_chat_roi_goals";
170
+
171
+ $results = $wpdb->get_results($sql);
172
+ if($wpdb->num_rows){
173
+ return $results;
174
+ } else {
175
+ return false;
176
+ }
177
+ }
178
+
179
+ /*
180
+ * Create the 'Add new' or 'Edit' Goal page
181
+ */
182
+
183
+ function wplc_mrg_get_add_goal_content(){
184
+
185
+
186
+ $content = "";
187
+
188
+ //Content Vars
189
+ $goal_name = "";
190
+ $goal_overview = "";
191
+ $goal_page = "";
192
+ $goal_value = "";
193
+
194
+ $header_array = wplc_mrg_goal_admin_head();
195
+
196
+ if($header_array){
197
+ if(isset($header_array['wplc_goal_name'])){ $goal_name = $header_array['wplc_goal_name']; }
198
+ if(isset($header_array['wplc_goal_overview'])){ $goal_overview = $header_array['wplc_goal_overview']; }
199
+ if(isset($header_array['wplc_goal_page'])){ $goal_page = intval($header_array['wplc_goal_page']); }
200
+ if(isset($header_array['wplc_goal_value'])){ $goal_value = floatval($header_array['wplc_goal_value']); }
201
+ }
202
+
203
+
204
+ $pages_on_site = wplc_mrg_goal_dropdown_selector("wplc_goal_page", intval($goal_page));
205
+
206
+ $wplc_submit_label = (isset($_GET['wplc_action']) && $_GET['wplc_action'] !== "edit_goal" ? "Create Goal" : "Edit Goal"); //Default
207
+
208
+ $content .= "<form method='POST'>";
209
+ $content .= "<table class=\"wp-list-table wplc_list_table widefat fixed form-table\" cellspacing=\"0\" style='width:50%'>";
210
+
211
+ $content .= "<tr>";
212
+ $content .= "<td>".__("Goal Name", "wp-livechat").":</td>";
213
+ $content .= "<td><input type='text' name='wplc_goal_name' value='$goal_name'></td>";
214
+ $content .= "</tr>";
215
+
216
+ $content .= "<tr>";
217
+ $content .= "<td>".__("Goal Overview", "wp-livechat").":</td>";
218
+ $content .= "<td><input type='text' name='wplc_goal_overview' value='$goal_overview'></td>";
219
+ $content .= "</tr>";
220
+
221
+ $content .= "<tr>";
222
+ $content .= "<td>".__("Goal Page", "wp-livechat").":</td>";
223
+ $content .= "<td>";
224
+
225
+ $content .= $pages_on_site;
226
+
227
+ $content .= "</td>";
228
+ $content .= "</tr>";
229
+
230
+ $content .= "<tr>";
231
+ $content .= "<td>".__("Goal Value", "wp-livechat").":</td>";
232
+ $content .= "<td><input type='text' name='wplc_goal_value' value='$goal_value'></td>";
233
+ $content .= "</tr>";
234
+
235
+ $content .= "<tr>";
236
+ $content .= "<td></td>";
237
+ $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>";
238
+ $content .= "</tr>";
239
+
240
+ $content .= "</table>";
241
+ $content .= "</form>";
242
+
243
+ if($header_array){
244
+ if(count($header_array["errors"]) >= 1){
245
+ $content .= "<div class='update-nag'>";
246
+ $content .= "<strong>".__("Please review your submission", "wp-livechat").":</strong>";
247
+ $content .= "<ul style='list-style:initial;'>";
248
+ for($i = 0; $i < count($header_array["errors"]); $i++){
249
+ $content .= "<li style='margin-left: 25px;'>".__($header_array["errors"][$i], "wp-livechat")."</li>";
250
+ }
251
+ $content .= "</ul>";
252
+ $content .= "</div>";
253
+ }
254
+
255
+ if(isset($header_array["success"])){
256
+ $content .= "<div class='update-nag' style='border-color:#67d552;'>";
257
+ $content .= "<strong>".__($header_array["success"], "wp-livechat")."</strong>";
258
+ $content .= "</div>";
259
+ }
260
+ }
261
+
262
+
263
+ return $content;
264
+ }
265
+
266
+ /*
267
+ * Generates custom dropdown for Posts and Pages
268
+ */
269
+ function wplc_mrg_goal_dropdown_selector($name, $selected_value){
270
+ $r = array(
271
+ 'depth' => 0,
272
+ 'child_of' => 0,
273
+ 'selected' => $selected_value,
274
+ 'echo' => false,
275
+ 'name' => $name,
276
+ 'id' => '',
277
+ 'class' => '',
278
+ 'show_option_none' => '',
279
+ 'show_option_no_change' => '',
280
+ 'option_none_value' => '',
281
+ 'value_field' => 'ID',
282
+ );
283
+
284
+ $pages = get_pages($r);
285
+ $posts = get_posts(array('posts_per_page' => -1));
286
+
287
+ $posts_pages = array_merge($pages,$posts);
288
+
289
+
290
+ $output = '';
291
+ if ( empty( $r['id'] ) ) {
292
+ $r['id'] = $r['name'];
293
+ }
294
+
295
+ if ( ! empty( $posts_pages ) ) {
296
+ $class = '';
297
+ if ( ! empty( $r['class'] ) ) {
298
+ $class = " class='" . esc_attr( $r['class'] ) . "'";
299
+ }
300
+
301
+ $output = "<select name='" . esc_attr( $r['name'] ) . "'" . $class . " id='" . esc_attr( $r['id'] ) . "' value=".intval($selected_value).">\n";
302
+
303
+ foreach ($posts_pages as $key => $value) {
304
+ $output .= "\t<option value='".$value->ID."' ".(intval($value->ID) === intval($selected_value) ? "selected" : "").">" . $value->ID . " - " . $value->post_title . "</option>\n";
305
+ }
306
+
307
+ $output .= "</select>\n";
308
+ }
309
+
310
+ $html = $output;
311
+
312
+ if ( $r['echo'] ) {
313
+ echo $html;
314
+ }
315
+ return $html;
316
+ }
317
+
318
+
319
+ /*
320
+ * Handles all the head stuff
321
+ */
322
+ function wplc_mrg_goal_admin_head(){
323
+ if(isset($_GET['wplc_action'])){
324
+ $return_array = array();
325
+ $form_valid = true;
326
+ if(isset($_POST['wplc_goal_submit'])){
327
+ $return_array["errors"] = array();
328
+
329
+ if(isset($_POST['wplc_goal_name']) && $_POST['wplc_goal_name'] !== ""){
330
+ $return_array["wplc_goal_name"] = $_POST['wplc_goal_name'];
331
+ } else {
332
+ $return_array["errors"][count($return_array["errors"]) >= 1 ? count($return_array["errors"]) : 0] = "Name cannot be empty";
333
+ $form_valid = false; //No Longer Valid
334
+ }
335
+
336
+ if(isset($_POST['wplc_goal_overview'])){
337
+ $return_array["wplc_goal_overview"] = $_POST['wplc_goal_overview'];
338
+ } else {
339
+ $return_array["wplc_goal_overview"] = "";
340
+ }
341
+
342
+ if(isset($_POST['wplc_goal_page'])){
343
+ $return_array["wplc_goal_page"] = $_POST['wplc_goal_page'];
344
+ } else {
345
+ $return_array["wplc_goal_page"] = "";
346
+ }
347
+
348
+ if(isset($_POST['wplc_goal_value'])){
349
+ $return_array["wplc_goal_value"] = $_POST['wplc_goal_value'];
350
+ } else {
351
+ $return_array["wplc_goal_value"] = "";
352
+ }
353
+ }
354
+
355
+ if($_GET['wplc_action'] == "add_goal"){
356
+ if($form_valid && isset($_POST['wplc_goal_submit'])){
357
+ //All good continue
358
+ if(wplc_add_goal_mrg($return_array)){
359
+ //Redirect here
360
+ echo "<script> window.location = '".admin_url()."admin.php?page=wplivechat-menu-roi-goals"."';</script>";
361
+ }
362
+ } else {
363
+ return $return_array; //Return Posted Data
364
+ }
365
+ } else if ($_GET['wplc_action'] == "edit_goal"){
366
+ //Editing now
367
+ $edit_array = array();
368
+ $edit_array["errors"] = array();
369
+ if (isset($return_array["errors"])) { $edit_array["errors"] = $return_array["errors"]; }
370
+
371
+ //Submit data first
372
+ if($form_valid && isset($_POST['wplc_goal_submit'])){
373
+ //All good continue
374
+ if(isset($_GET['goal_id'])){
375
+ if(wplc_edit_goal_mrg($return_array, intval($_GET['goal_id']))){
376
+ //Show edit message
377
+ $edit_array['success'] = "<div>".__("Goal has been edited.", "wp-livechat")."</div>";
378
+ }
379
+ } else {
380
+ $edit_array["errors"][count($edit_array["errors"]) >= 1 ? count($edit_array["errors"]) : 0] = "Goal ID not found";
381
+ }
382
+ }
383
+
384
+ $goal_data = wplc_get_goal_mrg(intval($_GET['goal_id']));
385
+ if($goal_data){
386
+ if($goal_data !== false && is_array($goal_data)){
387
+ //Got the data
388
+ if(isset($goal_data[0]->name) && $goal_data[0]->name !== ""){ $edit_array["wplc_goal_name"] = $goal_data[0]->name; }
389
+ if(isset($goal_data[0]->overview) && $goal_data[0]->overview !== ""){ $edit_array["wplc_goal_overview"] = $goal_data[0]->overview; }
390
+ if(isset($goal_data[0]->pages) && $goal_data[0]->pages !== ""){ $edit_array['wplc_goal_page'] = $goal_data[0]->pages ; }
391
+ if(isset($goal_data[0]->amount)){ $edit_array["wplc_goal_value"] = $goal_data[0]->amount; }
392
+ }
393
+ } else{
394
+ $edit_array["errors"][count($edit_array["errors"]) >= 1 ? count($edit_array["errors"]) : 0] = "Goal ID not found";
395
+ }
396
+
397
+ return $edit_array; //Return Server Data
398
+ }else if($_GET['wplc_action'] == "delete_goal"){
399
+ $delete_array = array();
400
+ if(isset($_GET['goal_id'])){
401
+ $goal_data = wplc_get_goal_mrg(intval($_GET['goal_id']));
402
+ if($goal_data){
403
+ $delete_array["name"] = $goal_data[0]->name;
404
+ }
405
+
406
+ if(isset($_POST['delete_confirm'])){
407
+ //Delete now
408
+ if(wplc_delete_goal_mrg(intval($_GET['goal_id']))){
409
+ //Success
410
+ }
411
+ echo "<script> window.location = '".admin_url()."admin.php?page=wplivechat-menu-roi-goals"."';</script>";
412
+ }
413
+ }
414
+ return $delete_array;
415
+ }else {
416
+ return false;
417
+ }
418
+ }else{
419
+ return false;
420
+ }
421
+ }
422
+
423
+ /*
424
+ * Adds a new Goal
425
+ */
426
+ function wplc_add_goal_mrg($goal_data){
427
+ global $wpdb;
428
+ global $wplc_tblname_chat_roi_goals;
429
+ if($goal_data){
430
+ $goal_name;
431
+ $goal_overview;
432
+ $goal_page;
433
+ $goal_value;
434
+
435
+ //Validation - 1
436
+ if($goal_data['wplc_goal_name'] != ""){ $goal_name = $goal_data['wplc_goal_name']; } else { return false; }
437
+ if($goal_data['wplc_goal_overview'] != ""){ $goal_overview = $goal_data['wplc_goal_overview']; } else { $goal_overview = ""; }
438
+ if($goal_data['wplc_goal_page'] != ""){ $goal_page = intval($goal_data['wplc_goal_page']); } else { return false; }
439
+ if($goal_data['wplc_goal_value'] != ""){ $goal_value = $goal_data['wplc_goal_value']; } else { return false; }
440
+
441
+ //Validation - 2
442
+ $goal_name = esc_attr($goal_name);
443
+ $goal_overview = esc_attr($goal_overview);
444
+
445
+ $sql = "INSERT INTO $wplc_tblname_chat_roi_goals SET `name` = '".$goal_name."', `pages` = '".$goal_page."', `overview` = '".$goal_overview."', `amount` = '".$goal_value."' ";
446
+ $wpdb->query($sql);
447
+ if ($wpdb->last_error) {
448
+ return false;
449
+ } else {
450
+ return true;
451
+ }
452
+ }
453
+ }
454
+
455
+ /*
456
+ * Edit a Goal
457
+ */
458
+ function wplc_edit_goal_mrg($goal_data, $goal_id){
459
+ global $wpdb;
460
+ global $wplc_tblname_chat_roi_goals;
461
+ if($goal_data){
462
+ $goal_name;
463
+ $goal_overview;
464
+ $goal_page;
465
+ $goal_value;
466
+
467
+ //Validation - 1
468
+ if($goal_data['wplc_goal_name'] != ""){ $goal_name = $goal_data['wplc_goal_name']; } else { return false; }
469
+ if($goal_data['wplc_goal_overview'] != ""){ $goal_overview = $goal_data['wplc_goal_overview']; } else { $goal_overview = ""; }
470
+ if($goal_data['wplc_goal_page'] != ""){ $goal_page = intval($goal_data['wplc_goal_page']); } else { return false; }
471
+ if($goal_data['wplc_goal_value'] != ""){ $goal_value = floatval($goal_data['wplc_goal_value']); } else { return false; }
472
+
473
+ //Validation - 2
474
+ $goal_name = esc_attr($goal_name);
475
+ $goal_overview = esc_attr($goal_overview);
476
+
477
+ $goal_id = intval($goal_id);
478
+ $sql = "UPDATE $wplc_tblname_chat_roi_goals SET `name` = '".$goal_name."', `pages` = '".$goal_page."', `overview` = '".$goal_overview."', `amount` = '".$goal_value."' WHERE `id` = '".$goal_id."' ";
479
+ $wpdb->query($sql);
480
+ if ($wpdb->last_error) {
481
+ return false;
482
+ } else {
483
+ return true;
484
+ }
485
+ }
486
+ }
487
+
488
+ /*
489
+ * Removes a Goal
490
+ */
491
+ function wplc_delete_goal_mrg($goal_id){
492
+ global $wpdb;
493
+ global $wplc_tblname_chat_roi_goals;
494
+ $goal_id = intval($goal_id);
495
+ $sql = "DELETE FROM $wplc_tblname_chat_roi_goals WHERE `id` = '".$goal_id."' ";
496
+ $wpdb->query($sql);
497
+ if ($wpdb->last_error) {
498
+ return false;
499
+ } else {
500
+ return true;
501
+ }
502
+ }
503
+
504
+ /*
505
+ * Retrieved one goal
506
+ */
507
+ function wplc_get_goal_mrg($goal_id){
508
+ global $wpdb;
509
+ global $wplc_tblname_chat_roi_goals;
510
+
511
+ $goal_id = intval($goal_id);
512
+
513
+ $sql = "SELECT * FROM $wplc_tblname_chat_roi_goals WHERE `id` = '$goal_id'";
514
+
515
+ $results = $wpdb->get_results($sql);
516
+ if($wpdb->num_rows){
517
+ return $results;
518
+ } else {
519
+ return false;
520
+ }
521
+ }
522
+
523
+ /*
524
+ * Handles confirmation prior to deleteing a goal
525
+ */
526
+ function wplc_mrg_delete_goal_content(){
527
+ $header_array = wplc_mrg_goal_admin_head();
528
+ $goal_name = "";
529
+ if($header_array){
530
+ if(isset($header_array["wplc_goal_name"])){ $goal_name = $header_array["wplc_goal_name"];}
531
+ }
532
+
533
+ $content = "";
534
+ if( (isset($_GET['wplc_action']) & isset($_GET['goal_id']))&& ($_GET['wplc_action'] == "delete_goal" && $_GET['goal_id'] != "")){
535
+
536
+ $content .= "<form method='POST'>";
537
+ $content .= "<table class=\"wp-list-table wplc_list_table widefat fixed form-table\" cellspacing=\"0\" style='width:50%'>";
538
+ $content .= "<tr>";
539
+ $content .= "<td>";
540
+ $content .= __("Are you sure you would like to delete goal") . ": <strong>" . $goal_name . "</strong>";
541
+ $content .= "</td>";
542
+ $content .= "</tr>";
543
+ $content .= "<tr>";
544
+ $content .= "<td>";
545
+ $content .= "<input type='submit' class='button' name='delete_confirm' value='".__("Delete", "wp-livechat")."'>";
546
+ $content .= " <a href='".admin_url()."admin.php?page=wplivechat-menu-roi-goals' class='button'>".__("Cancel", "wp-livechat")."</a>";
547
+ $content .= "</td>";
548
+ $content .= "</tr>";
549
+ $content .= "</table>";
550
+ $content .= "</form>";
551
+ }
552
+
553
+ return $content;
554
+ }
555
+
556
+ /*
557
+ * Checks to see if a page id matches on of our ROI Goals
558
+ */
559
+ function wplc_mrg_roi_check_page_id($pid){
560
+ $pid = intval($pid);
561
+ $goals = wplc_get_all_goals_mrg();
562
+ $matched = false;
563
+ if($goals){
564
+ foreach ($goals as $goal) {
565
+ if(intval($goal->pages) == $pid){
566
+ return $goal->id;
567
+ }
568
+ }
569
+ }
570
+
571
+ return $matched;
572
+ }
573
+
574
+ /*
575
+ * Handles adding a conversion to the table
576
+ */
577
+ function wplc_mrg_roi_conversion($cid, $goal_id){
578
+ global $wpdb;
579
+ global $wplc_tblname_chat_roi_conversions;
580
+
581
+ if(isset($cid) && isset($goal_id)){
582
+ if(wplc_mrg_roi_safe_to_add($cid)){
583
+ //We can add it now
584
+ $cid = intval($cid);
585
+ $goal_id = intval($goal_id);
586
+
587
+ $sql = "INSERT INTO $wplc_tblname_chat_roi_conversions SET `goal_id` = '".$goal_id."', `chat_id` = '".$cid."', `timestamp` = '".date("Y-m-d H:i:s")."' ";
588
+ $wpdb->query($sql);
589
+ if ($wpdb->last_error) {
590
+ return false;
591
+ } else {
592
+ return true;
593
+ }
594
+ }
595
+ }
596
+ }
597
+
598
+ /*
599
+ * Checks if a conversion of this chat has been made before
600
+ */
601
+ function wplc_mrg_roi_safe_to_add($cid){
602
+ global $wpdb;
603
+ global $wplc_tblname_chat_roi_conversions;
604
+
605
+ $cid = intval($cid);
606
+
607
+ $sql = "SELECT * FROM $wplc_tblname_chat_roi_conversions WHERE `chat_id` = '$cid'";
608
+
609
+ $results = $wpdb->get_results($sql);
610
+ if($wpdb->num_rows){
611
+ return false; //Already converted - dont add or update
612
+ } else {
613
+ return true;
614
+ }
615
+ }
616
+
617
+ /*
618
+ * Adds Reporting Tab for ROI
619
+ */
620
+ add_filter('wplc_reporting_tabs', 'wplc_reporting_tabs_roi_reporting_tab_mrg', 10, 1);
621
+ function wplc_reporting_tabs_roi_reporting_tab_mrg($tabs_array){
622
+ $tabs_array['rio_reports'] = __("ROI Reporting", "wp-livechat");
623
+ return $tabs_array;
624
+ }
625
+
626
+ /*
627
+ * Adds Reporting Content for ROI
628
+ */
629
+ add_filter('wplc_reporting_tab_content', 'wplc_reporting_tabs_roi_reporting_content_mrg', 10, 1);
630
+ function wplc_reporting_tabs_roi_reporting_content_mrg($tabs_array){
631
+ wplc_enqueue_admin_styles_mrg();
632
+
633
+ wp_register_script('wplc_roi_reporting_js', plugins_url('js/wplc_admin_roi_reporting.js', __FILE__), array('jquery'));
634
+ wp_enqueue_script('wplc_roi_reporting_js');
635
+
636
+ $content = "<h3>".__("Goal Statistics", "wp-livechat")."</h3>";
637
+
638
+ $content .= "<div class='wplc_roi_report_list'>";
639
+
640
+ $goals = wplc_get_all_goals_mrg();
641
+ if($goals){
642
+ $count = 0;
643
+ foreach ($goals as $goal) {
644
+ $content .= "<div class='wplc_roi_report_list_item' id='wplc_roi_report_list_item_".$count."' goal='".$goal->id."'>".$goal->name."</div>";
645
+ $count ++;
646
+ }
647
+ } else{
648
+ $content .= __("No Goals Found", "wplivechat");
649
+ $content .= " <small><a href='?page=wplivechat-menu-roi-goals'>Add Goal</a></small>";
650
+ }
651
+
652
+ $content .= "</div>";
653
+
654
+ $content .= "<div class='wplc_roi_report_content'>";
655
+
656
+ $content .= "<select name='wplc_roi_report_date_selector' id='wplc_roi_report_date_selector'>";
657
+ $content .= "<option value='0'>". __("All", "wplivechat") ."</option>";
658
+ $content .= "<option value='1'>". __("Last 30 Days", "wplivechat") ."</option>";
659
+ $content .= "<option value='2'>". __("Last 15 Days", "wplivechat") ."</option>";
660
+ $content .= "<option value='3'>". __("Last 7 Days", "wplivechat") ."</option>";
661
+ $content .= "<option value='4'>". __("Last 24 Hours", "wplivechat") ."</option>";
662
+ $content .= "</select>";
663
+
664
+ $content .= "<div class='wplc_roi_report_content_inner'>";
665
+
666
+ $content .= "</div>";
667
+ $content .= "</div>";
668
+
669
+
670
+ $tabs_array['rio_reports'] = $content;
671
+ return $tabs_array;
672
+ }
673
+
674
+ /*
675
+ * Handles Ajax data request
676
+ */
677
+ add_action('wp_ajax_get_goal_data', 'wplc_reporting_roi_ajax_mrg');
678
+ function wplc_reporting_roi_ajax_mrg(){
679
+ if($_POST['action'] == "get_goal_data") {
680
+ if(isset($_POST['goal_id']) && isset($_POST['term'])){
681
+ $goal_id = intval($_POST['goal_id']);
682
+ $term = intval($_POST['term']);
683
+
684
+ $stats_content = wplc_get_goal_stats_mrg($goal_id, $term);
685
+
686
+ echo json_encode($stats_content);
687
+
688
+ die();
689
+ }
690
+ }
691
+ }
692
+
693
+ /*
694
+ * Creates a stats html page for ajax call
695
+ */
696
+ function wplc_get_goal_stats_mrg($goal_id, $term){
697
+ $goal_id = intval($goal_id);
698
+ $goal_info = wplc_get_goal_mrg($goal_id);
699
+
700
+ $content = "";
701
+ if($goal_info){
702
+ $content .= "<h3>" . $goal_info[0]->name . "</h3>";
703
+
704
+ $content .= "<hr>";
705
+
706
+ $conversion_info = wplc_get_conversions_for_goal_mrg($goal_id, $term);
707
+ if($conversion_info){
708
+ $count_total = count($conversion_info);
709
+ $amount_total = $count_total * floatval($goal_info[0]->amount);
710
+
711
+ $content .= "<div style='width:100%'>";
712
+ $content .= "<div style='width: 33%; display: inline-block; vertical-align: top; text-align: center;'>";
713
+ $content .= "<strong>" . __("Value Per Conversion", "wplivechat") . "</strong>";
714
+ $content .= "<p>" . $goal_info[0]->amount . "</p>";
715
+ $content .= "</div>";
716
+
717
+
718
+ $content .= "<div style='width: 33%; display: inline-block; vertical-align: top; text-align: center;'>";
719
+ $content .= "<strong>" . __("Total Value", "wplivechat") . "</strong>";
720
+ $content .= "<p>" . $amount_total . "</p>";
721
+ $content .= "</div>";
722
+
723
+ $content .= "<div style='width: 33%; display: inline-block; vertical-align: top; text-align: center;'>";
724
+ $content .= "<strong>" . __("Total Conversions", "wplivechat") . "</strong>";
725
+ $content .= "<p>" . $count_total . "</p>";
726
+ $content .= "</div>";
727
+ $content .= "</div><br><br>";
728
+
729
+ $agent_count_array = array();
730
+ $date_array = array();
731
+
732
+ foreach ($conversion_info as $conversion) {
733
+ $chat_data = wplc_get_chat_data($conversion->chat_id);
734
+ if(!array_key_exists($chat_data->agent_id, $agent_count_array)){
735
+ $user = get_user_by('ID', $chat_data->agent_id)->display_name;
736
+
737
+ $agent_count_array[$chat_data->agent_id] = array();
738
+ $agent_count_array[$chat_data->agent_id]['count'] = 0;
739
+ $agent_count_array[$chat_data->agent_id]['name'] = $user;
740
+ }
741
+
742
+ $agent_count_array[$chat_data->agent_id]['count'] += 1;
743
+ $agent_count_array[$chat_data->agent_id]['value'] = $agent_count_array[$chat_data->agent_id]['count'] * floatval($goal_info[0]->amount);
744
+
745
+ $day = substr($conversion->timestamp, 0, strpos($conversion->timestamp, " "));
746
+ if(!array_key_exists($day, $date_array)){
747
+ $date_array[$day] = array();
748
+ $date_array[$day]['count'] = 0;
749
+ $date_array[$day]['date'] = $day;
750
+ }
751
+
752
+ $date_array[$day]['count'] += 1;
753
+ $date_array[$day]['value'] = $date_array[$day]['count'] * floatval($goal_info[0]->amount);
754
+ }
755
+
756
+ $content .= "<strong>" . __("Value By Date", "wplivechat") . ":</strong><hr>";
757
+ $content .= "<div class='wplc_roi_grid' id='wplc_roi_grid_chart'> </div><br><br>";
758
+
759
+ $content .= "<strong>" . __("Value By Agent", "wplivechat") . ":</strong><hr>";
760
+ $content .= "<div class='wplc_roi_grid' id='wplc_roi_agent_chart'> </div>";
761
+
762
+
763
+ $return_array = array('html' => $content, 'date_array' => $date_array, 'agent_array' => $agent_count_array);
764
+ } else {
765
+ $content .= "<p>" . __("No data available yet...", 'wplivechat') . "</p>";
766
+
767
+ $return_array = array('html' => $content, 'date_array' => array(), 'agent_array' => array());
768
+ }
769
+ }
770
+
771
+
772
+ return $return_array;
773
+ }
774
+
775
+ /*
776
+ * Returns conversions
777
+ */
778
+ function wplc_get_conversions_for_goal_mrg($goal_id, $term){
779
+ global $wpdb;
780
+ global $wplc_tblname_chat_roi_conversions;
781
+
782
+ $goal_id = intval($goal_id);
783
+ $term = intval($term);
784
+
785
+ $sql_date = "";
786
+
787
+ switch($term){
788
+ case 0:
789
+ $sql_date = "";
790
+ break;
791
+ case 1:
792
+ $sql_date = "AND `timestamp` > DATE_SUB(NOW(), INTERVAL 30 DAY)";
793
+ break;
794
+ case 2:
795
+ $sql_date = "AND `timestamp` > DATE_SUB(NOW(), INTERVAL 15 DAY)";
796
+ break;
797
+ case 3:
798
+ $sql_date = "AND `timestamp` > DATE_SUB(NOW(), INTERVAL 7 DAY)";
799
+ break;
800
+ case 4:
801
+ $sql_date = "AND `timestamp` > DATE_SUB(NOW(), INTERVAL 1 DAY)";
802
+ break;
803
+ }
804
+
805
+ $sql = "SELECT * FROM $wplc_tblname_chat_roi_conversions WHERE `goal_id` = '$goal_id' " . $sql_date;
806
+
807
+ $results = $wpdb->get_results($sql);
808
+ if($wpdb->num_rows){
809
+ return $results;
810
+ } else {
811
+ return false;
812
+ }
813
+ }
includes/wplc_transfer_chats.php ADDED
@@ -0,0 +1,815 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Handles the transferring of a chat
4
+ */
5
+
6
+ add_filter("wplc_admin_chat_area_before_end_chat_button", "wplc_mrg_admin_transfer_tools", 15, 1);
7
+ /**
8
+ * Outputs (echo) the 'Transfer' button
9
+ *
10
+ * @return void
11
+ */
12
+ function wplc_mrg_admin_transfer_tools($chat_data){
13
+ echo wplc_create_modal_trigger_button_open("transfer", __("Transfer", "wplivechat"));
14
+ }
15
+
16
+
17
+ add_filter("wplc_hook_admin_below_chat_box", "wplc_mrg_admin_transfer_tools_modals", 15, 1);
18
+ /**
19
+ * Outputs (echo) the 'Transfer' modal
20
+ *
21
+ * @return void
22
+ */
23
+ function wplc_mrg_admin_transfer_tools_modals($chat_data){
24
+ if(function_exists('wplc_create_modal_window')){
25
+ echo wplc_create_modal_window("transfer", __("Transfer Chat", "wplivechat"), wplc_mrg_admin_transfer_tools_modal_content($chat_data));
26
+
27
+ wplc_mrg_admin_transfer_tools_css();
28
+ wplc_mrg_admin_transfer_tools_js();
29
+ }
30
+ }
31
+
32
+ /**
33
+ * Returns content for the transfer Modal
34
+ *
35
+ * @return string (html)
36
+ */
37
+ function wplc_mrg_admin_transfer_tools_modal_content($chat_data){
38
+ $content = "<div id='wplc_transfer_modal_step_one_container'>";
39
+ $content .= "<span>" . __("Would you like to transfer this chat to", "wplivechat") . "</span><br><br>";
40
+ $content .= "<a href='javascript:void(0);' class='button' id='wplc_pro_tranfer_to_agent_btn'>" . __("Agent", "wplivechat") . "</a> ";
41
+ $content .= "<a href='javascript:void(0);' class='button button-primary' id='wplc_pro_tranfer_to_department_btn'>" . __("Department", "wplivechat") . "</a> ";
42
+ $content .= "</div>";
43
+
44
+ $content .= "<div id='wplc_transfer_modal_step_two_container'>";
45
+ $content .= "<div id='wplc_transfer_modal_step_two_agent'>";
46
+ $content .= "<span>" . __("Please select an agent to transfer to", "wplivechat") . "</span><br><br>";
47
+ $content .= wplc_mrg_admin_transfer_agent_selection() . "<br><br>";
48
+
49
+ $content .= "<span id='wplc_transfer_to_agent_check'></span>";
50
+
51
+ $content .= "</div>";
52
+ $content .= "<div id='wplc_transfer_modal_step_two_department'>";
53
+ $content .= "<span>" . __("Please select a department to transfer to", "wplivechat") . "</span><br><br>";
54
+ $content .= wplc_mrg_admin_transfer_department_selection() . "<br><br>";
55
+
56
+ $content .= "<span id='wplc_transfer_to_department_check'></span>";
57
+
58
+ $content .= "</div>";
59
+ $content .= "</div>";
60
+
61
+ return $content;
62
+ }
63
+
64
+ /**
65
+ * Returns dropdown (html) of all online agent
66
+ *
67
+ * @return string (html)
68
+ */
69
+ function wplc_mrg_admin_transfer_agent_selection(){
70
+ $content = "<select id='wplc_transfer_modal_agent_selection'>";
71
+ $content .= "<option value=''>" . __("No Agent", "wplivechat") . "</option>";
72
+ $my_id = get_current_user_id();
73
+ $user_array = get_users(array(
74
+ 'meta_key'=> 'wplc_chat_agent_online',
75
+ ));
76
+ foreach($user_array as $user){
77
+ $content .= "<option value='" . $user->ID . "'>" . $user->display_name . ($user->ID == $my_id ? "(" . __("You", "wplivechat") . ")" : "") . "</option>";
78
+ }
79
+
80
+ $content .= "<select>";
81
+ return $content;
82
+ }
83
+
84
+ /**
85
+ * Returns dropdown (html) of all departments agent
86
+ *
87
+ * @return string (html)
88
+ */
89
+ function wplc_mrg_admin_transfer_department_selection(){
90
+ if(function_exists("wplc_get_all_deparments_mrg")){
91
+ $content = "<select id='wplc_transfer_modal_department_selection'>";
92
+ $content .= "<option value='-1'>" . __("No Department", "wplivechat") . "</option>";
93
+ $departments = wplc_get_all_deparments_mrg();
94
+ if($departments){
95
+ foreach($departments as $dep){
96
+ $content .= "<option value=" . $dep->id . ">" . $dep->name . "</option>";
97
+ }
98
+ }
99
+ $content .= "<select>";
100
+ } else {
101
+ $content = "Version error";
102
+ }
103
+ return $content;
104
+ }
105
+
106
+
107
+ /**
108
+ * Outputs inline JavaScript for Transfer Modal
109
+ *
110
+ * @return void
111
+ */
112
+ function wplc_mrg_admin_transfer_tools_js(){
113
+ ?>
114
+ <script>
115
+ var wplc_to_agent = null;
116
+ var wplc_online_check_complete = false;
117
+
118
+ var wplc_transfer_checking_agent_string = "<?php _e('Checking if agent is online', 'wplivechat'); ?>";
119
+ var wplc_transfer_error_agent_string = "<?php _e('Agent is not online, transfer cannot be made', 'wplivechat'); ?>";
120
+
121
+ var wplc_transfer_checking_department_string = "<?php _e('Checking if agents in department are online', 'wplivechat'); ?>";
122
+ var wplc_transfer_error_department_string = "<?php _e('No agent within the department are available to accept the transfer, transfer cannot be made', 'wplivechat'); ?>";
123
+
124
+ var wplc_transfer_success_string = "<?php _e('Agent(s) available, safe to transfer', 'wplivechat'); ?>";
125
+
126
+ var wplc_transfer_complete_string = "<?php _e('Transfer Complete. Closing Window...', 'wplivechat'); ?>";
127
+ var wplc_transfer_fail_string = "<?php _e('Transfer Failed. Please try again later...', 'wplivechat'); ?>";
128
+
129
+ jQuery(function(){
130
+ if(typeof wplc_modal_initialize !== "undefined" && typeof wplc_modal_initialize === "function"){
131
+ wplc_modal_initialize(wplc_modal_transfer_open_modal, wplc_modal_transfer_confirm, wplc_modal_transfer_cancel, false);
132
+ }
133
+
134
+ jQuery("body").on("click", "#wplc_pro_tranfer_to_agent_btn", function(){
135
+ jQuery("#wplc_transfer_modal_step_one_container").hide();
136
+ jQuery("#wplc_transfer_modal_step_two_container").show();
137
+ jQuery("#wplc_transfer_modal_step_two_agent").show();
138
+ jQuery("#wplc_modal_inner_actions_transfer").show();
139
+ wplc_to_agent = true;
140
+ });
141
+
142
+ jQuery("body").on("click", "#wplc_pro_tranfer_to_department_btn", function(){
143
+ jQuery("#wplc_transfer_modal_step_one_container").hide();
144
+ jQuery("#wplc_transfer_modal_step_two_container").show();
145
+ jQuery("#wplc_modal_inner_actions_transfer").show();
146
+ jQuery("#wplc_transfer_modal_step_two_department").show();
147
+ wplc_to_agent = false;
148
+ });
149
+
150
+ jQuery("body").on("change", "#wplc_transfer_modal_agent_selection", function(){
151
+ wplc_online_check_complete = false;
152
+ jQuery("#wplc_modal_confirm_transfer").removeClass("button-primary");
153
+ jQuery("#wplc_modal_confirm_transfer").addClass("button-disabled");
154
+ jQuery("#wplc_transfer_to_agent_check").text(wplc_transfer_checking_agent_string);
155
+ wplc_modal_transfer_check_online_agent(function(){
156
+ wplc_online_check_complete = true;
157
+ jQuery("#wplc_modal_confirm_transfer").removeClass("button-disabled");
158
+ jQuery("#wplc_modal_confirm_transfer").addClass("button-primary");
159
+ jQuery("#wplc_transfer_to_agent_check").text(wplc_transfer_success_string);
160
+ }, function(){
161
+ jQuery("#wplc_transfer_to_agent_check").text(wplc_transfer_error_agent_string);
162
+ });
163
+
164
+ });
165
+
166
+ jQuery("body").on("change", "#wplc_transfer_modal_department_selection", function(){
167
+ wplc_online_check_complete = false;
168
+ jQuery("#wplc_modal_confirm_transfer").removeClass("button-primary");
169
+ jQuery("#wplc_modal_confirm_transfer").addClass("button-disabled");
170
+ jQuery("#wplc_transfer_to_department_check").text(wplc_transfer_checking_department_string);
171
+ wplc_modal_transfer_check_online_department(function(){
172
+ wplc_online_check_complete = true;
173
+ jQuery("#wplc_modal_confirm_transfer").removeClass("button-disabled");
174
+ jQuery("#wplc_modal_confirm_transfer").addClass("button-primary");
175
+ jQuery("#wplc_transfer_to_department_check").text(wplc_transfer_success_string);
176
+ }, function(){
177
+ jQuery("#wplc_transfer_to_department_check").text(wplc_transfer_error_department_string);
178
+ });
179
+ });
180
+ });
181
+
182
+ function wplc_modal_transfer_open_modal(){
183
+ jQuery("#wplc_transfer_modal_step_one_container").show();
184
+ jQuery("#wplc_transfer_modal_step_two_container").hide();
185
+ jQuery("#wplc_modal_inner_actions_transfer").hide();
186
+ jQuery("#wplc_transfer_modal_step_two_agent").hide();
187
+ jQuery("#wplc_transfer_modal_step_two_department").hide();
188
+ jQuery("#wplc_modal_confirm_transfer").removeClass("button-primary");
189
+ jQuery("#wplc_modal_confirm_transfer").addClass("button-disabled");
190
+
191
+ jQuery("#wplc_transfer_to_agent_check").text("");
192
+ jQuery("#wplc_transfer_to_department_check").text("");
193
+
194
+ wplc_to_agent = null;
195
+ wplc_online_check_complete = false;
196
+ }
197
+
198
+ function wplc_modal_transfer_check_online_agent(check_success_callback, check_fail_callback){
199
+ var aid = jQuery("#wplc_transfer_modal_agent_selection").val();
200
+
201
+ var data ={
202
+ action : "wplc_admin_transfer_check_agent_online",
203
+ agent_id : parseInt(aid)
204
+ };
205
+
206
+ wplc_modal_transfer_ajax(data, function(return_data){
207
+ if(return_data == "true"){
208
+ if(typeof check_success_callback === "function"){
209
+ check_success_callback();
210
+ }
211
+ } else {
212
+ if(typeof check_fail_callback === "function"){
213
+ check_fail_callback();
214
+ }
215
+ }
216
+ }, function(){
217
+ if(typeof check_fail_callback === "function"){
218
+ check_fail_callback();
219
+ }
220
+ });
221
+
222
+
223
+ }
224
+
225
+ function wplc_modal_transfer_check_online_department(check_success_callback, check_fail_callback){
226
+ var depid = jQuery("#wplc_transfer_modal_department_selection").val();
227
+
228
+ var data ={
229
+ action : "wplc_admin_transfer_check_department_online",
230
+ dep_id : parseInt(depid)
231
+ };
232
+
233
+ wplc_modal_transfer_ajax(data, function(return_data){
234
+ if(return_data == "true"){
235
+ if(typeof check_success_callback === "function"){
236
+ check_success_callback();
237
+ }
238
+ } else {
239
+ if(typeof check_fail_callback === "function"){
240
+ check_fail_callback();
241
+ }
242
+ }
243
+ }, function(){
244
+ if(typeof check_fail_callback === "function"){
245
+ check_fail_callback();
246
+ }
247
+ });
248
+ }
249
+
250
+ function wplc_modal_transfer_ajax(req_data, on_succcess, on_error){
251
+ jQuery.ajax({
252
+ url : "<?php echo admin_url('admin-ajax.php'); ?>",
253
+ type : 'POST',
254
+ data : req_data,
255
+ success : function(return_data) {
256
+ if(typeof on_succcess === "function"){
257
+ on_succcess(return_data);
258
+ }
259
+ },
260
+ error : function (){
261
+ if(typeof on_error === "function"){
262
+ on_error();
263
+ }
264
+ }
265
+ });
266
+ }
267
+
268
+ function wplc_modal_transfer_confirm(){
269
+ if(wplc_online_check_complete){
270
+ if(wplc_to_agent !== null){
271
+ if(wplc_to_agent == true){
272
+ //Send to agent
273
+ var aid = jQuery("#wplc_transfer_modal_agent_selection").val();
274
+ var data ={
275
+ action : "wplc_admin_transfer_to_agent",
276
+ cid : parseInt("<?php echo $_GET['cid']; ?>"),
277
+ agent_id : parseInt(aid)
278
+ };
279
+
280
+ wplc_modal_transfer_ajax(data, function(return_data){
281
+ if(return_data == "true"){
282
+ jQuery("#wplc_transfer_to_agent_check").text(wplc_transfer_complete_string);
283
+
284
+ setTimeout(function(){
285
+ window.close();
286
+ }, 300);
287
+ } else {
288
+ jQuery("#wplc_transfer_to_agent_check").text(wplc_transfer_fail_string);
289
+ }
290
+ }, function(){
291
+ jQuery("#wplc_transfer_to_agent_check").text(wplc_transfer_fail_string);
292
+ });
293
+ } else {
294
+ //Send to department
295
+ var depid = jQuery("#wplc_transfer_modal_department_selection").val();
296
+ var data ={
297
+ action : "wplc_admin_transfer_to_department",
298
+ cid : parseInt("<?php echo $_GET['cid']; ?>"),
299
+ dep_id : parseInt(depid)
300
+ };
301
+
302
+ wplc_modal_transfer_ajax(data, function(return_data){
303
+ if(return_data == "true"){
304
+ jQuery("#wplc_transfer_to_department_check").text(wplc_transfer_complete_string);
305
+
306
+ setTimeout(function(){
307
+ window.close();
308
+ }, 300);
309
+ } else {
310
+ jQuery("#wplc_transfer_to_department_check").text(wplc_transfer_fail_string);
311
+ }
312
+ }, function(){
313
+ jQuery("#wplc_transfer_to_department_check").text(wplc_transfer_fail_string);
314
+ });
315
+ }
316
+
317
+ } else {
318
+ /* console.log("No Mode Selected"); */
319
+ }
320
+ }
321
+ }
322
+
323
+ function wplc_modal_transfer_cancel(){
324
+ wplc_to_agent = null;
325
+ wplc_online_check_complete = false;
326
+ }
327
+ </script>
328
+ <?php
329
+ }
330
+
331
+ /**
332
+ * Outputs inline css for Transfer Modal
333
+ *
334
+ * @return void
335
+ */
336
+ function wplc_mrg_admin_transfer_tools_css(){
337
+ ?>
338
+ <style>
339
+ #wplc_transfer_modal_step_one_container, #wplc_transfer_modal_step_two_container{
340
+ text-align: center;
341
+ }
342
+ </style>
343
+ <?php
344
+ }
345
+
346
+ add_filter("wplc_accept_chat_button_filter", "wplc_mrg_admin_accept_chat_button_text", 10, 2);
347
+ /**
348
+ * Changes 'Accept Chat' to 'Accept Transfer'
349
+ *
350
+ * @return string
351
+ */
352
+ function wplc_mrg_admin_accept_chat_button_text($content, $cid){
353
+ $chat_data = wplc_get_chat_data($cid, __LINE__);
354
+ $max_wait_time = 60; //60 Seconds
355
+ if (isset($chat_data->other)) {
356
+ $other_data = maybe_unserialize( $chat_data->other );
357
+ if( (isset($other_data['transfer']) && $other_data['transfer'] == true)){
358
+ if(isset($chat_data->agent_id) && intval($chat_data->agent_id) !== 0){
359
+ //For a specific agent
360
+ if(isset($other_data['agent_transfer_time'])){
361
+ //Check the time difference
362
+ $seconds = time() - $other_data['agent_transfer_time'];
363
+ if(intval($seconds) > $max_wait_time){
364
+ do_action("wplc_pro_admin_transfer_agent_exceeded_accept_time", $cid, $chat_data->agent_id);
365
+ }
366
+ }
367
+
368
+ $agent_info = get_userdata(intval($chat_data->agent_id));
369
+
370
+ return __("Transfer for", "wplivechat") . " " . $agent_info->display_name;
371
+ } else {
372
+ //Department
373
+ return __("Accept Transfer", "wplivechat");
374
+ }
375
+ } else if ( (isset($other_data['unanswered']) && $other_data['unanswered'] == true) ){
376
+ // Initial chat request -> Should still check timer
377
+ if(isset($other_data['agent_transfer_time'])){
378
+ //Check the time difference
379
+ $seconds = time() - $other_data['agent_transfer_time'];
380
+ if(intval($seconds) > $max_wait_time){
381
+ do_action("wplc_pro_admin_transfer_agent_exceeded_accept_time", $cid, -1); //Transfer to the next agent
382
+ }
383
+ }
384
+ return $content;
385
+ }
386
+ }
387
+
388
+ return $content;
389
+ }
390
+
391
+ add_filter("wplc_start_chat_hook_other_data_hook", "wplc_mrg_admin_transfer_add_initial_transfer_time", 10, 1);
392
+ /**
393
+ * Adds an initial 'agent transfer time' value to the other data of the chat - On Chat Request
394
+ *
395
+ * @return array
396
+ */
397
+ function wplc_mrg_admin_transfer_add_initial_transfer_time($other_data){
398
+ $other_data['agent_transfer_time'] = time();
399
+ return $other_data;
400
+ }
401
+
402
+ add_action("wplc_pro_admin_transfer_agent_exceeded_accept_time", "wplc_mrg_admin_transfer_to_next_available_agent", 10, 2);
403
+ /**
404
+ * Transfers chat to the next available agetn
405
+ *
406
+ * @return void
407
+ */
408
+ function wplc_mrg_admin_transfer_to_next_available_agent($chat_id, $current_agent){
409
+ $chat_id = intval($chat_id);
410
+ $current_agent = intval($current_agent);
411
+
412
+ //Find all online agents
413
+ $user_array = get_users(array(
414
+ 'meta_key'=> 'wplc_chat_agent_online',
415
+ ));
416
+ $identified_candidate = false;
417
+
418
+ foreach ($user_array as $user) {
419
+ if($identified_candidate === false){
420
+ if($current_agent !== $user->ID){
421
+ $identified_candidate = $user->ID;
422
+ }
423
+ }
424
+ }
425
+
426
+ if($identified_candidate !== false){
427
+ wplc_mrg_admin_transfer_to_agent($chat_id, $identified_candidate, true);
428
+ }
429
+
430
+ }
431
+
432
+
433
+ add_action("wplc_hook_chat_notification","wplc_filter_control_chat_notification_department_transfer_mrg",10,3);
434
+ /**
435
+ * Handles 'Transfer' system notification
436
+ *
437
+ * @return string
438
+ */
439
+ function wplc_filter_control_chat_notification_department_transfer_mrg($type,$cid,$data) {
440
+ if ($type == "transfer") {
441
+ global $wpdb;
442
+ global $wplc_tblname_msgs;
443
+
444
+
445
+ $user_info = get_userdata(intval($data['aid']));
446
+ if( $user_info ){
447
+ $agent = $user_info->display_name;
448
+ } else {
449
+ $agent = "";
450
+ }
451
+
452
+ if(isset($data["auto_transfer"]) && $data["auto_transfer"] == true){
453
+
454
+ if(intval($data['aid']) === 0){
455
+ //Came from a department originally
456
+ $msg = __("Department took too long to respond, we are transferring this chat to the next available agent.","wplivechat");
457
+ } else {
458
+ $msg = $agent . " " . __("took too long to respond, we are transferring this chat to the next available agent.","wplivechat");
459
+ }
460
+ } else {
461
+ $msg = $agent . " ". __("has transferred the chat.","wplivechat");
462
+ }
463
+
464
+ $wpdb->insert(
465
+ $wplc_tblname_msgs,
466
+ array(
467
+ 'chat_sess_id' => $cid,
468
+ 'timestamp' => current_time('mysql'),
469
+ 'msgfrom' => __('System notification',"wplivechat"),
470
+ 'msg' => $msg,
471
+ 'status' => 0,
472
+ 'originates' => 0
473
+ ),
474
+ array(
475
+ '%s',
476
+ '%s',
477
+ '%s',
478
+ '%s',
479
+ '%d',
480
+ '%d'
481
+ )
482
+ );
483
+
484
+ $msg = "<strong>" . __("User received this message", "wplivechat") . ":</strong> " . $msg;
485
+ $wpdb->insert(
486
+ $wplc_tblname_msgs,
487
+ array(
488
+ 'chat_sess_id' => $cid,
489
+ 'timestamp' => current_time('mysql'),
490
+ 'msgfrom' => __('System notification',"wplivechat"),
491
+ 'msg' => $msg,
492
+ 'status' => 0,
493
+ 'originates' => 3
494
+ ),
495
+ array(
496
+ '%s',
497
+ '%s',
498
+ '%s',
499
+ '%s',
500
+ '%d',
501
+ '%d'
502
+ )
503
+ );
504
+ }
505
+ return;
506
+ }
507
+
508
+ add_action("wplc_hook_chat_notification","wplc_filter_control_chat_notification_auto_department_transfer_mrg",10,3);
509
+ /**
510
+ * Handles 'Transfer' system notification
511
+ *
512
+ * @return string
513
+ */
514
+ function wplc_filter_control_chat_notification_auto_department_transfer_mrg($type,$cid,$data) {
515
+ if ($type == "system_dep_transfer") {
516
+ global $wpdb;
517
+ global $wplc_tblname_msgs;
518
+
519
+ $from_department = null;
520
+ $to_department = null;
521
+
522
+ if(isset($data['to_dep_id']) && isset($data['from_dep_id'])){
523
+ if(function_exists("wplc_get_department_mrg")){
524
+ $from_department = wplc_get_department_mrg(intval($data['from_dep_id']));
525
+ $to_department = wplc_get_department_mrg(intval($data['to_dep_id']));
526
+ }
527
+ }
528
+
529
+
530
+ $msg = __("No agents available in","wplivechat") . " ";
531
+ if($from_department === null){
532
+ $msg .= __("selected department", "wplivechat");
533
+ } else {
534
+ $msg .= $from_department[0]->name;
535
+ }
536
+ $msg .= ", " . __("automatically transferring you to", "wplivechat") . " ";
537
+ if($to_department === null){
538
+ $msg .= __("the next available department", "wplivechat");
539
+ } else {
540
+ $msg .= $to_department[0]->name;
541
+ }
542
+ $msg .= ".";
543
+
544
+ $wpdb->insert(
545
+ $wplc_tblname_msgs,
546
+ array(
547
+ 'chat_sess_id' => $cid,
548
+ 'timestamp' => current_time('mysql'),
549
+ 'msgfrom' => __('System notification',"wplivechat"),
550
+ 'msg' => $msg,
551
+ 'status' => 0,
552
+ 'originates' => 0
553
+ ),
554
+ array(
555
+ '%s',
556
+ '%s',
557
+ '%s',
558
+ '%s',
559
+ '%d',
560
+ '%d'
561
+ )
562
+ );
563
+
564
+ $msg = __("User has been transfered from ","wplivechat") . " ";
565
+ if($from_department === null){
566
+ $msg .= __("department", "wplivechat");
567
+ } else {
568
+ $msg .= $from_department[0]->name;
569
+ }
570
+
571
+ if($to_department !== null){
572
+ $msg .= __(" to ", "wplivechat") . " " . $to_department[0]->name;
573
+ }
574
+ $msg .= " " . __("as there were no agents online") . ".";
575
+
576
+ $wpdb->insert(
577
+ $wplc_tblname_msgs,
578
+ array(
579
+ 'chat_sess_id' => $cid,
580
+ 'timestamp' => current_time('mysql'),
581
+ 'msgfrom' => __('System notification',"wplivechat"),
582
+ 'msg' => $msg,
583
+ 'status' => 0,
584
+ 'originates' => 3
585
+ ),
586
+ array(
587
+ '%s',
588
+ '%s',
589
+ '%s',
590
+ '%s',
591
+ '%d',
592
+ '%d'
593
+ )
594
+ );
595
+ }
596
+ return;
597
+ }
598
+
599
+ add_action("wplc_hook_change_status_on_answer","wplc_mrg_clear_transfer_request_if_set",10,2);
600
+ /**
601
+ * Unsets the transfer request once it is answered
602
+ *
603
+ * @return int (response code)
604
+ */
605
+ function wplc_mrg_clear_transfer_request_if_set($get_data, $chat_data = false) {
606
+ global $wpdb;
607
+ global $wplc_tblname_chats;
608
+
609
+ $chat_id = intval($get_data['cid']);
610
+ if (!$chat_data) { $chat_data = wplc_get_chat_data($chat_id, __LINE__); }
611
+
612
+ if (isset($chat_data->other)) {
613
+ $other_data = maybe_unserialize( $chat_data->other );
614
+ if(isset( $other_data['transfer'] ) && $other_data['transfer'] == true){
615
+ unset($other_data['transfer']);
616
+ unset($other_data['unanswered']);
617
+ unset($other_data['agent_transfer_time']);
618
+
619
+ $new_chat_data = array('other' => maybe_serialize($other_data));
620
+
621
+ $wpdb->update( $wplc_tblname_chats, $new_chat_data, array('id' => $chat_id), array('%s'), array('%d'));
622
+ }
623
+ }
624
+ }
625
+
626
+ add_filter("wplc_pro_department_update_filter", "wplc_mrg_admin_transfer_department_online_check", 10, 2);
627
+ /**
628
+ * Unsets the transfer request once it is answered
629
+ *
630
+ * @return int (response code)
631
+ */
632
+ function wplc_mrg_admin_transfer_department_online_check($department_id, $cid) {
633
+ $search_department = intval($department_id);
634
+ $user_array = get_users(array(
635
+ 'meta_key'=> 'wplc_chat_agent_online',
636
+ ));
637
+
638
+ $fallback_department = null; //First agent who is online will be responsible for fallback
639
+
640
+ $check = false;
641
+ foreach($user_array as $user){
642
+ $this_user_department = get_user_meta($user->ID, "wplc_user_department", true);
643
+ if(intval($this_user_department == -1) || $this_user_department === ""){
644
+ $check = true;
645
+ } else if(intval($this_user_department) === $search_department){
646
+ $check = true;
647
+ }
648
+
649
+ if($fallback_department === null){
650
+ $fallback_department = $this_user_department;
651
+ }
652
+ }
653
+
654
+ if($check){
655
+ return $department_id; //Someone is online in this department, or a global department
656
+ } else {
657
+ if($fallback_department !== null){
658
+ wplc_record_chat_notification("system_dep_transfer",$cid, array("from_dep_id" => $department_id, "to_dep_id" => $fallback_department));
659
+ return $fallback_department;
660
+ } else {
661
+ //Joh.... This is broken
662
+ return $department_id; //Just return the department ID passed in originally, hope for the best
663
+ }
664
+ }
665
+ }
666
+
667
+ /**
668
+ * Transfers a chat to a new agent
669
+ *
670
+ * @param int $chat_id Chat ID
671
+ * @param int $agent_id Agent ID
672
+ * @return boolean
673
+ */
674
+ function wplc_mrg_admin_transfer_to_agent($chat_id, $agent_id, $auto_transfer){
675
+ global $wpdb;
676
+ global $wplc_tblname_chats;
677
+
678
+ $chat_data = wplc_get_chat_data($chat_id, __LINE__);
679
+ if (isset($chat_data->other)) {
680
+ $other_data = maybe_unserialize( $chat_data->other );
681
+ $other_data['unanswered'] = true;
682
+ $other_data['transfer'] = true;
683
+ $other_data['agent_transfer_time'] = time();
684
+
685
+ $user_department = get_user_meta($agent_id, "wplc_user_department", true);
686
+ if(!$user_department || $user_department === ""){
687
+ $user_department = 0;
688
+ }
689
+
690
+ $new_chat_data = array('status' => 2, 'agent_id' => $agent_id, 'department_id' => $user_department,'other' => maybe_serialize($other_data));
691
+
692
+ if($wpdb->update( $wplc_tblname_chats, $new_chat_data, array('id' => $chat_id), array('%d', '%d', '%d','%s'), array('%d'))){
693
+ if(function_exists("wplc_record_chat_notification")){
694
+ wplc_record_chat_notification("transfer", $chat_id, array("aid" => $chat_data->agent_id, "auto_transfer" => $auto_transfer));
695
+ }
696
+ return true;
697
+ } else {
698
+ return false;
699
+ }
700
+ }
701
+ return false;
702
+ }
703
+
704
+ /**
705
+ * Transfers a chat to a new department
706
+ *
707
+ * @param int $chat_id Chat ID
708
+ * @param int $dep_id Department ID
709
+ * @return boolean
710
+ */
711
+ function wplc_mrg_admin_transfer_to_department($chat_id, $dep_id){
712
+ global $wpdb;
713
+ global $wplc_tblname_chats;
714
+
715
+ $chat_data = wplc_get_chat_data($chat_id, __LINE__);
716
+ if (isset($chat_data->other)) {
717
+ $other_data = maybe_unserialize( $chat_data->other );
718
+ $other_data['unanswered'] = true;
719
+ $other_data['transfer'] = true;
720
+
721
+ $new_chat_data = array('status' => 2, 'agent_id' => 0, 'department_id' => $dep_id,'other' => maybe_serialize($other_data));
722
+
723
+ if($wpdb->update( $wplc_tblname_chats, $new_chat_data, array('id' => $chat_id), array('%d', '%d', '%d','%s'), array('%d'))){
724
+ if(function_exists("wplc_record_chat_notification")){
725
+ wplc_record_chat_notification("transfer", $chat_id, array("aid" => $chat_data->agent_id));
726
+ }
727
+ return true;
728
+ } else {
729
+ return false;
730
+ }
731
+ }
732
+
733
+ return false;
734
+ }
735
+
736
+ add_action('wp_ajax_wplc_admin_transfer_check_agent_online', 'wplc_mrg_admin_transfer_ajax');
737
+ add_action('wp_ajax_wplc_admin_transfer_check_department_online', 'wplc_mrg_admin_transfer_ajax');
738
+ add_action('wp_ajax_wplc_admin_transfer_to_agent', 'wplc_mrg_admin_transfer_ajax');
739
+ add_action('wp_ajax_wplc_admin_transfer_to_department', 'wplc_mrg_admin_transfer_ajax');
740
+ /**
741
+ * Handles the ajax calls for transfers
742
+ *
743
+ * @return string (response status)
744
+ */
745
+ function wplc_mrg_admin_transfer_ajax(){
746
+ if(isset($_POST['action'])){
747
+ if ($_POST['action'] == "wplc_admin_transfer_check_agent_online") {
748
+ if(isset($_POST['agent_id'])){
749
+ $user_id = intval($_POST['agent_id']);
750
+ $check = get_user_meta($user_id, "wplc_chat_agent_online", true);
751
+ if($check && $check !== ""){
752
+ echo "true";
753
+ exit();
754
+ } else {
755
+ echo "false"; //Agent no longer online
756
+ exit();
757
+ }
758
+ }
759
+ }
760
+
761
+ if ($_POST['action'] == "wplc_admin_transfer_check_department_online") {
762
+ if(isset($_POST['dep_id'])){
763
+ $search_department = intval($_POST['dep_id']);
764
+ $user_array = get_users(array(
765
+ 'meta_key'=> 'wplc_chat_agent_online',
766
+ ));
767
+
768
+ $check = false;
769
+
770
+ foreach($user_array as $user){
771
+ $this_user_department = get_user_meta($user->ID, "wplc_user_department", true);
772
+ if(intval($this_user_department) === $search_department){
773
+ $check = true;
774
+ }
775
+ }
776
+
777
+ if($check){
778
+ echo "true";
779
+ exit();
780
+ } else {
781
+ echo "false"; //Agent no longer online
782
+ exit();
783
+ }
784
+ }
785
+ }
786
+
787
+ if ($_POST['action'] == "wplc_admin_transfer_to_agent") {
788
+ if(isset($_POST['cid']) && isset($_POST['agent_id'])){
789
+ $chat_id = intval($_POST['cid']);
790
+ $agent_id = intval($_POST['agent_id']);
791
+ if(wplc_mrg_admin_transfer_to_agent($chat_id, $agent_id, false)){
792
+ echo "true";
793
+ exit();
794
+ } else {
795
+ echo "false";
796
+ exit();
797
+ }
798
+ }
799
+ }
800
+
801
+ if ($_POST['action'] == "wplc_admin_transfer_to_department") {
802
+ if(isset($_POST['cid']) && isset($_POST['dep_id'])){
803
+ $chat_id = intval($_POST['cid']);
804
+ $dep_id = intval($_POST['dep_id']);
805
+ if(wplc_mrg_admin_transfer_to_department($chat_id, $dep_id)){
806
+ echo "true";
807
+ exit();
808
+ } else {
809
+ echo "false";
810
+ exit();
811
+ }
812
+ }
813
+ }
814
+ }
815
+ }
js/WebAudioRecorder.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(n){var e=function(){var i=arguments[0],t=[].slice.call(arguments,1);for(var n=0;n<t.length;++n){var r=t[n];for(key in r){var o=r[key];i[key]=typeof o==="object"?e(typeof i[key]==="object"?i[key]:{},o):o}}return i};var o={wav:"WebAudioRecorderWav.min.js",ogg:"WebAudioRecorderOgg.min.js",mp3:"WebAudioRecorderMp3.min.js"};var t={workerDir:"/",numChannels:2,encoding:"wav",options:{timeLimit:300,encodeAfterRecord:false,progressInterval:1e3,bufferSize:undefined,wav:{mimeType:"audio/wav"},ogg:{mimeType:"audio/ogg",quality:.5},mp3:{mimeType:"audio/mpeg",bitRate:160}}};var i=function(i,n){e(this,t,n||{});this.context=i.context;if(this.context.createScriptProcessor==null)this.context.createScriptProcessor=this.context.createJavaScriptNode;this.input=this.context.createGain();i.connect(this.input);this.buffer=[];this.initWorker()};e(i.prototype,{isRecording:function(){return this.processor!=null},setEncoding:function(e){if(this.isRecording())this.error("setEncoding: cannot set encoding during recording");else if(this.encoding!==e){this.encoding=e;this.initWorker()}},setOptions:function(i){if(this.isRecording())this.error("setOptions: cannot set options during recording");else{e(this.options,i);this.worker.postMessage({command:"options",options:this.options})}},startRecording:function(){if(this.isRecording())this.error("startRecording: previous recording is running");else{var i=this.numChannels,e=this.buffer,n=this.worker;this.processor=this.context.createScriptProcessor(this.options.bufferSize,this.numChannels,this.numChannels);this.input.connect(this.processor);this.processor.connect(this.context.destination);this.processor.onaudioprocess=function(t){for(var o=0;o<i;++o)e[o]=t.inputBuffer.getChannelData(o);n.postMessage({command:"record",buffer:e})};this.worker.postMessage({command:"start",bufferSize:this.processor.bufferSize});this.startTime=Date.now()}},recordingTime:function(){return this.isRecording()?(Date.now()-this.startTime)*.001:null},cancelRecording:function(){if(this.isRecording()){this.input.disconnect();this.processor.disconnect();delete this.processor;this.worker.postMessage({command:"cancel"})}else this.error("cancelRecording: no recording is running")},finishRecording:function(){if(this.isRecording()){this.input.disconnect();this.processor.disconnect();delete this.processor;this.worker.postMessage({command:"finish"})}else this.error("finishRecording: no recording is running")},cancelEncoding:function(){if(this.options.encodeAfterRecord)if(this.isRecording())this.error("cancelEncoding: recording is not finished");else{this.onEncodingCanceled(this);this.initWorker()}else this.error("cancelEncoding: invalid method call")},initWorker:function(){if(this.worker!=null)this.worker.terminate();this.onEncoderLoading(this,this.encoding);this.worker=new Worker(this.workerDir+o[this.encoding]);var e=this;this.worker.onmessage=function(n){var i=n.data;switch(i.command){case"loaded":e.onEncoderLoaded(e,e.encoding);break;case"timeout":e.onTimeout(e);break;case"progress":e.onEncodingProgress(e,i.progress);break;case"complete":e.onComplete(e,i.blob);break;case"error":e.error(i.message)}};this.worker.postMessage({command:"init",config:{sampleRate:this.context.sampleRate,numChannels:this.numChannels},options:this.options})},error:function(e){this.onError(this,"WebAudioRecorder.min.js:"+e)},onEncoderLoading:function(e,i){},onEncoderLoaded:function(e,i){},onTimeout:function(e){e.finishRecording()},onEncodingProgress:function(e,i){},onEncodingCanceled:function(e){},onComplete:function(e,i){e.onError(e,"WebAudioRecorder.min.js: You must override .onComplete event")},onError:function(i,e){console.log(e)}});n.WebAudioRecorder=i})(window);
js/WebAudioRecorderWav.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(t){var s=Math.min,r=Math.max;var n=function(t,s,n){var r=n.length;for(var e=0;e<r;++e)t.setUint8(s+e,n.charCodeAt(e))};var e=function(e,n){this.sampleRate=e;this.numChannels=n;this.numSamples=0;this.dataViews=[]};e.prototype.encode=function(o){var e=o[0].length,i=this.numChannels,f=new DataView(new ArrayBuffer(e*i*2)),u=0;for(var n=0;n<e;++n)for(var t=0;t<i;++t){var a=o[t][n]*32767;f.setInt16(u,a<0?r(a,-32768):s(a,32767),true);u+=2}this.dataViews.push(f);this.numSamples+=e};e.prototype.finish=function(r){var t=this.numChannels*this.numSamples*2,e=new DataView(new ArrayBuffer(44));n(e,0,"RIFF");e.setUint32(4,36+t,true);n(e,8,"WAVE");n(e,12,"fmt ");e.setUint32(16,16,true);e.setUint16(20,1,true);e.setUint16(22,this.numChannels,true);e.setUint32(24,this.sampleRate,true);e.setUint32(28,this.sampleRate*4,true);e.setUint16(32,this.numChannels*2,true);e.setUint16(34,16,true);n(e,36,"data");e.setUint32(40,t,true);this.dataViews.unshift(e);var s=new Blob(this.dataViews,{type:"audio/wav"});this.cleanup();return s};e.prototype.cancel=e.prototype.cleanup=function(){delete this.dataViews};t.WavAudioEncoder=e})(self);var sampleRate=44100,numChannels=2,options=undefined,maxBuffers=undefined,encoder=undefined,recBuffers=undefined,bufferCount=0;function error(e){self.postMessage({command:"error",message:"wav: "+e})}function init(e){sampleRate=e.config.sampleRate;numChannels=e.config.numChannels;options=e.options}function setOptions(e){if(encoder||recBuffers)error("cannot set options during recording");else options=e}function start(e){maxBuffers=Math.ceil(options.timeLimit*sampleRate/e);if(options.encodeAfterRecord)recBuffers=[];else encoder=new WavAudioEncoder(sampleRate,numChannels)}function record(e){if(bufferCount++<maxBuffers)if(encoder)encoder.encode(e);else recBuffers.push(e);else self.postMessage({command:"timeout"})}function postProgress(e){self.postMessage({command:"progress",progress:e})}function finish(){if(recBuffers){postProgress(0);encoder=new WavAudioEncoder(sampleRate,numChannels);var e=Date.now()+options.progressInterval;while(recBuffers.length>0){encoder.encode(recBuffers.shift());var n=Date.now();if(n>e){postProgress((bufferCount-recBuffers.length)/bufferCount);e=n+options.progressInterval}}postProgress(1)}self.postMessage({command:"complete",blob:encoder.finish(options.wav.mimeType)});cleanup()}function cleanup(){encoder=recBuffers=undefined;bufferCount=0}self.onmessage=function(n){var e=n.data;switch(e.command){case"init":init(e);break;case"options":setOptions(e.options);break;case"start":start(e.bufferSize);break;case"record":record(e.buffer);break;case"finish":finish();break;case"cancel":cleanup()}};
js/agent_status.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1 @@
 
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 ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(function($){
2
+ var tgm_media_frame_default;
3
+ var tgm_media_frame_picture;
4
+ var tgm_media_frame_logo;
5
+
6
+ $(document.body).on('click.tgmOpenMediaManager', '#wplc_btn_upload_pic', function(e){
7
+ e.preventDefault();
8
+
9
+ if ( tgm_media_frame_picture ) {
10
+ tgm_media_frame_picture.open();
11
+ return;
12
+ }
13
+
14
+ tgm_media_frame_picture = wp.media.frames.tgm_media_frame = wp.media({
15
+ className: 'media-frame tgm-media-frame',
16
+ frame: 'select',
17
+ multiple: false,
18
+ title: 'Upload your profile pic',
19
+ library: {
20
+ type: 'image'
21
+ },
22
+ button: {
23
+ text: 'Use as Profile Pic'
24
+ }
25
+ });
26
+
27
+ tgm_media_frame_picture.on('select', function(){
28
+ var media_attachment = tgm_media_frame_picture.state().get('selection').first().toJSON();
29
+ jQuery('#wplc_upload_pic').val(btoa(media_attachment.url));
30
+ jQuery("#wplc_pic_area").html("<img src=\""+media_attachment.url+"\" width='100px'/>");
31
+ });
32
+ tgm_media_frame_picture.open();
33
+ });
34
+
35
+ $(document.body).on('click.tgmOpenMediaManager', '#wplc_btn_upload_logo', function(e){
36
+ e.preventDefault();
37
+
38
+ if ( tgm_media_frame_logo ) {
39
+ tgm_media_frame_logo.open();
40
+ return;
41
+ }
42
+
43
+ tgm_media_frame_logo = wp.media.frames.tgm_media_frame = wp.media({
44
+ className: 'media-frame tgm-media-frame',
45
+ frame: 'select',
46
+ multiple: false,
47
+ title: 'Upload your Logo',
48
+ library: {
49
+ type: 'image'
50
+ },
51
+ button: {
52
+ text: 'Use as Logo'
53
+ }
54
+ });
55
+
56
+ tgm_media_frame_logo.on('select', function(){
57
+ var media_attachment = tgm_media_frame_logo.state().get('selection').first().toJSON();
58
+ jQuery('#wplc_upload_logo').val(btoa(media_attachment.url));
59
+ jQuery("#wplc_logo_area").html("<img src=\""+media_attachment.url+"\" width='100px'/>");
60
+ });
61
+ tgm_media_frame_logo.open();
62
+ });
63
+
64
+ $(document.body).on('click.tgmOpenMediaManager', '#wplc_btn_upload_icon', function(e){
65
+ e.preventDefault();
66
+
67
+ if ( tgm_media_frame_default ) {
68
+ tgm_media_frame_default.open();
69
+ return;
70
+ }
71
+
72
+ tgm_media_frame_default = wp.media.frames.tgm_media_frame = wp.media({
73
+ className: 'media-frame tgm-media-frame',
74
+ frame: 'select',
75
+ multiple: false,
76
+ title: 'Upload your chat icon',
77
+ library: {
78
+ type: 'image'
79
+ },
80
+ button: {
81
+ text: 'Use as Chat Icon'
82
+ }
83
+ });
84
+
85
+ tgm_media_frame_default.on('select', function(){
86
+ var media_attachment = tgm_media_frame_default.state().get('selection').first().toJSON();
87
+ jQuery('#wplc_upload_icon').val(btoa(media_attachment.url));
88
+ jQuery("#wplc_icon_area").html("<img src=\""+media_attachment.url+"\" width='100px'/>");
89
+ });
90
+ tgm_media_frame_default.open();
91
+ });
92
+
93
+ $("#wplc_btn_remove_pic").click(function() {
94
+ $("#wplc_pic_area").empty();
95
+ $("#wplc_upload_pic").val("");
96
+ });
97
+ $("#wplc_btn_remove_logo").click(function() {
98
+ $("#wplc_logo_area").empty();
99
+ $("#wplc_upload_logo").val("");
100
+ });
101
+ $("#wplc_btn_remove_icon").click(function() {
102
+ $("#wplc_icon_area").empty();
103
+ $("#wplc_upload_icon").val("");
104
+ });
105
+
106
+
107
+ $("#wplc_btn_select_default_icon").click(function() {
108
+ $("#wplc_default_chat_icons").slideToggle();
109
+ });
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
+
119
+ });
js/quick_responses.js ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(function() {
2
+ jQuery(".wplc_macros_select").change(function () {
3
+
4
+ var wplc_id = this.value;
5
+ if (parseInt(wplc_id) === 0) {
6
+ return;
7
+ }
8
+ var data = {
9
+ action: 'wplc_macro',
10
+ dataType: "json",
11
+ postid: wplc_id,
12
+ security: wplc_ajax_nonce
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
+
20
+ });
21
+
22
+
23
+ });
js/reporting.js ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(function() {
2
+ jQuery( "#reporting_tabs" ).tabs().addClass( "ui-tabs-vertical ui-helper-clearfix" );
3
+ jQuery( "#reporting_tabs li" ).removeClass( "ui-corner-top" ).addClass( "ui-corner-left" );
4
+ });
5
+
6
+ if( typeof wplc_reporting_statistics !== 'undefined' ){
7
+
8
+ var data = JSON.parse( wplc_reporting_statistics );
9
+
10
+
11
+ var urls = [];
12
+
13
+ var temp = ['URL', 'Count'];
14
+
15
+ urls.push(temp);
16
+
17
+ jQuery.each(data.individual_urls_counted, function(key, val){
18
+ var temp = [ key, val ];
19
+ urls.push(temp);
20
+ });
21
+
22
+ var chat_totals = [];
23
+
24
+ var temp2 = ['Date', 'Count'];
25
+
26
+ chat_totals.push(temp2);
27
+
28
+ jQuery.each(data.daily_chat_totals, function(key, val){
29
+ var temp2 = [ key, val ];
30
+ chat_totals.push(temp2);
31
+ });
32
+
33
+
34
+ }
35
+
36
+ google.charts.load('current', {'packages':['corechart', 'bar']});
37
+
38
+ google.charts.setOnLoadCallback(drawChart);
39
+ function drawChart() {
40
+
41
+ var data = google.visualization.arrayToDataTable(urls);
42
+
43
+ var options = {
44
+ legend: 'none',
45
+
46
+ };
47
+
48
+ var chart = new google.visualization.PieChart(document.getElementById('popular_pages_graph'));
49
+
50
+ jQuery("body").on("click", "#reporting_tabs li", function(){
51
+ chart.draw(data, options);
52
+ });
53
+
54
+ }
55
+
56
+ google.charts.setOnLoadCallback(drawChart2);
57
+
58
+ function drawChart2() {
59
+ var data = google.visualization.arrayToDataTable(chat_totals);
60
+
61
+ var options = {
62
+ legend: { position: 'none' },
63
+ };
64
+
65
+ var chart = new google.charts.Bar(document.getElementById('columnchart_material'));
66
+
67
+ chart.draw(data, options);
68
+
69
+ jQuery("body").on("click", "#reporting_tabs li", function(){
70
+ chart.draw(data, options);
71
+ });
72
+ }
73
+
js/switchery.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(){function require(name){var module=require.modules[name];if(!module)throw new Error('failed to require "'+name+'"');if(!("exports"in module)&&typeof module.definition==="function"){module.client=module.component=true;module.definition.call(this,module.exports={},module);delete module.definition}return module.exports}require.loader="component";require.helper={};require.helper.semVerSort=function(a,b){var aArray=a.version.split(".");var bArray=b.version.split(".");for(var i=0;i<aArray.length;++i){var aInt=parseInt(aArray[i],10);var bInt=parseInt(bArray[i],10);if(aInt===bInt){var aLex=aArray[i].substr((""+aInt).length);var bLex=bArray[i].substr((""+bInt).length);if(aLex===""&&bLex!=="")return 1;if(aLex!==""&&bLex==="")return-1;if(aLex!==""&&bLex!=="")return aLex>bLex?1:-1;continue}else if(aInt>bInt){return 1}else{return-1}}return 0};require.latest=function(name,returnPath){function showError(name){throw new Error('failed to find latest module of "'+name+'"')}var versionRegexp=/(.*)~(.*)@v?(\d+\.\d+\.\d+[^\/]*)$/;var remoteRegexp=/(.*)~(.*)/;if(!remoteRegexp.test(name))showError(name);var moduleNames=Object.keys(require.modules);var semVerCandidates=[];var otherCandidates=[];for(var i=0;i<moduleNames.length;i++){var moduleName=moduleNames[i];if(new RegExp(name+"@").test(moduleName)){var version=moduleName.substr(name.length+1);var semVerMatch=versionRegexp.exec(moduleName);if(semVerMatch!=null){semVerCandidates.push({version:version,name:moduleName})}else{otherCandidates.push({version:version,name:moduleName})}}}if(semVerCandidates.concat(otherCandidates).length===0){showError(name)}if(semVerCandidates.length>0){var module=semVerCandidates.sort(require.helper.semVerSort).pop().name;if(returnPath===true){return module}return require(module)}var module=otherCandidates.pop().name;if(returnPath===true){return module}return require(module)};require.modules={};require.register=function(name,definition){require.modules[name]={definition:definition}};require.define=function(name,exports){require.modules[name]={exports:exports}};require.register("abpetkov~transitionize@0.0.3",function(exports,module){module.exports=Transitionize;function Transitionize(element,props){if(!(this instanceof Transitionize))return new Transitionize(element,props);this.element=element;this.props=props||{};this.init()}Transitionize.prototype.isSafari=function(){return/Safari/.test(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor)};Transitionize.prototype.init=function(){var transitions=[];for(var key in this.props){transitions.push(key+" "+this.props[key])}this.element.style.transition=transitions.join(", ");if(this.isSafari())this.element.style.webkitTransition=transitions.join(", ")}});require.register("ftlabs~fastclick@v0.6.11",function(exports,module){function FastClick(layer){"use strict";var oldOnClick,self=this;this.trackingClick=false;this.trackingClickStart=0;this.targetElement=null;this.touchStartX=0;this.touchStartY=0;this.lastTouchIdentifier=0;this.touchBoundary=10;this.layer=layer;if(!layer||!layer.nodeType){throw new TypeError("Layer must be a document node")}this.onClick=function(){return FastClick.prototype.onClick.apply(self,arguments)};this.onMouse=function(){return FastClick.prototype.onMouse.apply(self,arguments)};this.onTouchStart=function(){return FastClick.prototype.onTouchStart.apply(self,arguments)};this.onTouchMove=function(){return FastClick.prototype.onTouchMove.apply(self,arguments)};this.onTouchEnd=function(){return FastClick.prototype.onTouchEnd.apply(self,arguments)};this.onTouchCancel=function(){return FastClick.prototype.onTouchCancel.apply(self,arguments)};if(FastClick.notNeeded(layer)){return}if(this.deviceIsAndroid){layer.addEventListener("mouseover",this.onMouse,true);layer.addEventListener("mousedown",this.onMouse,true);layer.addEventListener("mouseup",this.onMouse,true)}layer.addEventListener("click",this.onClick,true);layer.addEventListener("touchstart",this.onTouchStart,false);layer.addEventListener("touchmove",this.onTouchMove,false);layer.addEventListener("touchend",this.onTouchEnd,false);layer.addEventListener("touchcancel",this.onTouchCancel,false);if(!Event.prototype.stopImmediatePropagation){layer.removeEventListener=function(type,callback,capture){var rmv=Node.prototype.removeEventListener;if(type==="click"){rmv.call(layer,type,callback.hijacked||callback,capture)}else{rmv.call(layer,type,callback,capture)}};layer.addEventListener=function(type,callback,capture){var adv=Node.prototype.addEventListener;if(type==="click"){adv.call(layer,type,callback.hijacked||(callback.hijacked=function(event){if(!event.propagationStopped){callback(event)}}),capture)}else{adv.call(layer,type,callback,capture)}}}if(typeof layer.onclick==="function"){oldOnClick=layer.onclick;layer.addEventListener("click",function(event){oldOnClick(event)},false);layer.onclick=null}}FastClick.prototype.deviceIsAndroid=navigator.userAgent.indexOf("Android")>0;FastClick.prototype.deviceIsIOS=/iP(ad|hone|od)/.test(navigator.userAgent);FastClick.prototype.deviceIsIOS4=FastClick.prototype.deviceIsIOS&&/OS 4_\d(_\d)?/.test(navigator.userAgent);FastClick.prototype.deviceIsIOSWithBadTarget=FastClick.prototype.deviceIsIOS&&/OS ([6-9]|\d{2})_\d/.test(navigator.userAgent);FastClick.prototype.needsClick=function(target){"use strict";switch(target.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(target.disabled){return true}break;case"input":if(this.deviceIsIOS&&target.type==="file"||target.disabled){return true}break;case"label":case"video":return true}return/\bneedsclick\b/.test(target.className)};FastClick.prototype.needsFocus=function(target){"use strict";switch(target.nodeName.toLowerCase()){case"textarea":return true;case"select":return!this.deviceIsAndroid;case"input":switch(target.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return false}return!target.disabled&&!target.readOnly;default:return/\bneedsfocus\b/.test(target.className)}};FastClick.prototype.sendClick=function(targetElement,event){"use strict";var clickEvent,touch;if(document.activeElement&&document.activeElement!==targetElement){document.activeElement.blur()}touch=event.changedTouches[0];clickEvent=document.createEvent("MouseEvents");clickEvent.initMouseEvent(this.determineEventType(targetElement),true,true,window,1,touch.screenX,touch.screenY,touch.clientX,touch.clientY,false,false,false,false,0,null);clickEvent.forwardedTouchEvent=true;targetElement.dispatchEvent(clickEvent)};FastClick.prototype.determineEventType=function(targetElement){"use strict";if(this.deviceIsAndroid&&targetElement.tagName.toLowerCase()==="select"){return"mousedown"}return"click"};FastClick.prototype.focus=function(targetElement){"use strict";var length;if(this.deviceIsIOS&&targetElement.setSelectionRange&&targetElement.type.indexOf("date")!==0&&targetElement.type!=="time"){length=targetElement.value.length;targetElement.setSelectionRange(length,length)}else{targetElement.focus()}};FastClick.prototype.updateScrollParent=function(targetElement){"use strict";var scrollParent,parentElement;scrollParent=targetElement.fastClickScrollParent;if(!scrollParent||!scrollParent.contains(targetElement)){parentElement=targetElement;do{if(parentElement.scrollHeight>parentElement.offsetHeight){scrollParent=parentElement;targetElement.fastClickScrollParent=parentElement;break}parentElement=parentElement.parentElement}while(parentElement)}if(scrollParent){scrollParent.fastClickLastScrollTop=scrollParent.scrollTop}};FastClick.prototype.getTargetElementFromEventTarget=function(eventTarget){"use strict";if(eventTarget.nodeType===Node.TEXT_NODE){return eventTarget.parentNode}return eventTarget};FastClick.prototype.onTouchStart=function(event){"use strict";var targetElement,touch,selection;if(event.targetTouches.length>1){return true}targetElement=this.getTargetElementFromEventTarget(event.target);touch=event.targetTouches[0];if(this.deviceIsIOS){selection=window.getSelection();if(selection.rangeCount&&!selection.isCollapsed){return true}if(!this.deviceIsIOS4){if(touch.identifier===this.lastTouchIdentifier){event.preventDefault();return false}this.lastTouchIdentifier=touch.identifier;this.updateScrollParent(targetElement)}}this.trackingClick=true;this.trackingClickStart=event.timeStamp;this.targetElement=targetElement;this.touchStartX=touch.pageX;this.touchStartY=touch.pageY;if(event.timeStamp-this.lastClickTime<200){event.preventDefault()}return true};FastClick.prototype.touchHasMoved=function(event){"use strict";var touch=event.changedTouches[0],boundary=this.touchBoundary;if(Math.abs(touch.pageX-this.touchStartX)>boundary||Math.abs(touch.pageY-this.touchStartY)>boundary){return true}return false};FastClick.prototype.onTouchMove=function(event){"use strict";if(!this.trackingClick){return true}if(this.targetElement!==this.getTargetElementFromEventTarget(event.target)||this.touchHasMoved(event)){this.trackingClick=false;this.targetElement=null}return true};FastClick.prototype.findControl=function(labelElement){"use strict";if(labelElement.control!==undefined){return labelElement.control}if(labelElement.htmlFor){return document.getElementById(labelElement.htmlFor)}return labelElement.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")};FastClick.prototype.onTouchEnd=function(event){"use strict";var forElement,trackingClickStart,targetTagName,scrollParent,touch,targetElement=this.targetElement;if(!this.trackingClick){return true}if(event.timeStamp-this.lastClickTime<200){this.cancelNextClick=true;return true}this.cancelNextClick=false;this.lastClickTime=event.timeStamp;trackingClickStart=this.trackingClickStart;this.trackingClick=false;this.trackingClickStart=0;if(this.deviceIsIOSWithBadTarget){touch=event.changedTouches[0];targetElement=document.elementFromPoint(touch.pageX-window.pageXOffset,touch.pageY-window.pageYOffset)||targetElement;targetElement.fastClickScrollParent=this.targetElement.fastClickScrollParent}targetTagName=targetElement.tagName.toLowerCase();if(targetTagName==="label"){forElement=this.findControl(targetElement);if(forElement){this.focus(targetElement);if(this.deviceIsAndroid){return false}targetElement=forElement}}else if(this.needsFocus(targetElement)){if(event.timeStamp-trackingClickStart>100||this.deviceIsIOS&&window.top!==window&&targetTagName==="input"){this.targetElement=null;return false}this.focus(targetElement);if(!this.deviceIsIOS4||targetTagName!=="select"){this.targetElement=null;event.preventDefault()}return false}if(this.deviceIsIOS&&!this.deviceIsIOS4){scrollParent=targetElement.fastClickScrollParent;if(scrollParent&&scrollParent.fastClickLastScrollTop!==scrollParent.scrollTop){return true}}if(!this.needsClick(targetElement)){event.preventDefault();this.sendClick(targetElement,event)}return false};FastClick.prototype.onTouchCancel=function(){"use strict";this.trackingClick=false;this.targetElement=null};FastClick.prototype.onMouse=function(event){"use strict";if(!this.targetElement){return true}if(event.forwardedTouchEvent){return true}if(!event.cancelable){return true}if(!this.needsClick(this.targetElement)||this.cancelNextClick){if(event.stopImmediatePropagation){event.stopImmediatePropagation()}else{event.propagationStopped=true}event.stopPropagation();event.preventDefault();return false}return true};FastClick.prototype.onClick=function(event){"use strict";var permitted;if(this.trackingClick){this.targetElement=null;this.trackingClick=false;return true}if(event.target.type==="submit"&&event.detail===0){return true}permitted=this.onMouse(event);if(!permitted){this.targetElement=null}return permitted};FastClick.prototype.destroy=function(){"use strict";var layer=this.layer;if(this.deviceIsAndroid){layer.removeEventListener("mouseover",this.onMouse,true);layer.removeEventListener("mousedown",this.onMouse,true);layer.removeEventListener("mouseup",this.onMouse,true)}layer.removeEventListener("click",this.onClick,true);layer.removeEventListener("touchstart",this.onTouchStart,false);layer.removeEventListener("touchmove",this.onTouchMove,false);layer.removeEventListener("touchend",this.onTouchEnd,false);layer.removeEventListener("touchcancel",this.onTouchCancel,false)};FastClick.notNeeded=function(layer){"use strict";var metaViewport;var chromeVersion;if(typeof window.ontouchstart==="undefined"){return true}chromeVersion=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1];if(chromeVersion){if(FastClick.prototype.deviceIsAndroid){metaViewport=document.querySelector("meta[name=viewport]");if(metaViewport){if(metaViewport.content.indexOf("user-scalable=no")!==-1){return true}if(chromeVersion>31&&window.innerWidth<=window.screen.width){return true}}}else{return true}}if(layer.style.msTouchAction==="none"){return true}return false};FastClick.attach=function(layer){"use strict";return new FastClick(layer)};if(typeof define!=="undefined"&&define.amd){define(function(){"use strict";return FastClick})}else if(typeof module!=="undefined"&&module.exports){module.exports=FastClick.attach;module.exports.FastClick=FastClick}else{window.FastClick=FastClick}});require.register("component~indexof@0.0.3",function(exports,module){module.exports=function(arr,obj){if(arr.indexOf)return arr.indexOf(obj);for(var i=0;i<arr.length;++i){if(arr[i]===obj)return i}return-1}});require.register("component~classes@1.2.1",function(exports,module){var index=require("component~indexof@0.0.3");var re=/\s+/;var toString=Object.prototype.toString;module.exports=function(el){return new ClassList(el)};function ClassList(el){if(!el)throw new Error("A DOM element reference is required");this.el=el;this.list=el.classList}ClassList.prototype.add=function(name){if(this.list){this.list.add(name);return this}var arr=this.array();var i=index(arr,name);if(!~i)arr.push(name);this.el.className=arr.join(" ");return this};ClassList.prototype.remove=function(name){if("[object RegExp]"==toString.call(name)){return this.removeMatching(name)}if(this.list){this.list.remove(name);return this}var arr=this.array();var i=index(arr,name);if(~i)arr.splice(i,1);this.el.className=arr.join(" ");return this};ClassList.prototype.removeMatching=function(re){var arr=this.array();for(var i=0;i<arr.length;i++){if(re.test(arr[i])){this.remove(arr[i])}}return this};ClassList.prototype.toggle=function(name,force){if(this.list){if("undefined"!==typeof force){if(force!==this.list.toggle(name,force)){this.list.toggle(name)}}else{this.list.toggle(name)}return this}if("undefined"!==typeof force){if(!force){this.remove(name)}else{this.add(name)}}else{if(this.has(name)){this.remove(name)}else{this.add(name)}}return this};ClassList.prototype.array=function(){var str=this.el.className.replace(/^\s+|\s+$/g,"");var arr=str.split(re);if(""===arr[0])arr.shift();return arr};ClassList.prototype.has=ClassList.prototype.contains=function(name){return this.list?this.list.contains(name):!!~index(this.array(),name)}});require.register("switchery",function(exports,module){var transitionize=require("abpetkov~transitionize@0.0.3"),fastclick=require("ftlabs~fastclick@v0.6.11"),classes=require("component~classes@1.2.1");module.exports=Switchery;var defaults={color:"#64bd63",secondaryColor:"#dfdfdf",jackColor:"#fff",className:"switchery",disabled:false,disabledOpacity:.5,speed:"0.4s",size:"default"};function Switchery(element,options){if(!(this instanceof Switchery))return new Switchery(element,options);this.element=element;this.options=options||{};for(var i in defaults){if(this.options[i]==null){this.options[i]=defaults[i]}}if(this.element!=null&&this.element.type=="checkbox")this.init()}Switchery.prototype.hide=function(){this.element.style.display="none"};Switchery.prototype.show=function(){var switcher=this.create();this.insertAfter(this.element,switcher)};Switchery.prototype.create=function(){this.switcher=document.createElement("span");this.jack=document.createElement("small");this.switcher.appendChild(this.jack);this.switcher.className=this.options.className;return this.switcher};Switchery.prototype.insertAfter=function(reference,target){reference.parentNode.insertBefore(target,reference.nextSibling)};Switchery.prototype.isChecked=function(){return this.element.checked};Switchery.prototype.isDisabled=function(){return this.options.disabled||this.element.disabled||this.element.readOnly};Switchery.prototype.setPosition=function(clicked){var checked=this.isChecked(),switcher=this.switcher,jack=this.jack;if(clicked&&checked)checked=false;else if(clicked&&!checked)checked=true;if(checked===true){this.element.checked=true;if(window.getComputedStyle)jack.style.left=parseInt(window.getComputedStyle(switcher).width)-parseInt(window.getComputedStyle(jack).width)+"px";else jack.style.left=parseInt(switcher.currentStyle["width"])-parseInt(jack.currentStyle["width"])+"px";if(this.options.color)this.colorize();this.setSpeed()}else{jack.style.left=0;this.element.checked=false;this.switcher.style.boxShadow="inset 0 0 0 0 "+this.options.secondaryColor;this.switcher.style.borderColor=this.options.secondaryColor;this.switcher.style.backgroundColor=this.options.secondaryColor!==defaults.secondaryColor?this.options.secondaryColor:"#fff";this.jack.style.backgroundColor=this.options.jackColor;this.setSpeed()}};Switchery.prototype.setSpeed=function(){var switcherProp={},jackProp={left:this.options.speed.replace(/[a-z]/,"")/2+"s"};if(this.isChecked()){switcherProp={border:this.options.speed,"box-shadow":this.options.speed,"background-color":this.options.speed.replace(/[a-z]/,"")*3+"s"}}else{switcherProp={border:this.options.speed,"box-shadow":this.options.speed}}transitionize(this.switcher,switcherProp);transitionize(this.jack,jackProp)};Switchery.prototype.setSize=function(){var small="switchery-small",normal="switchery-default",large="switchery-large";switch(this.options.size){case"small":classes(this.switcher).add(small);break;case"large":classes(this.switcher).add(large);break;default:classes(this.switcher).add(normal);break}};Switchery.prototype.colorize=function(){var switcherHeight=this.switcher.offsetHeight/2;this.switcher.style.backgroundColor=this.options.color;this.switcher.style.borderColor=this.options.color;this.switcher.style.boxShadow="inset 0 0 0 "+switcherHeight+"px "+this.options.color;this.jack.style.backgroundColor=this.options.jackColor};Switchery.prototype.handleOnchange=function(state){if(document.dispatchEvent){var event=document.createEvent("HTMLEvents");event.initEvent("change",true,true);this.element.dispatchEvent(event)}else{this.element.fireEvent("onchange")}};Switchery.prototype.handleChange=function(){var self=this,el=this.element;if(el.addEventListener){el.addEventListener("change",function(){self.setPosition()})}else{el.attachEvent("onchange",function(){self.setPosition()})}};Switchery.prototype.handleClick=function(){var self=this,switcher=this.switcher,parent=self.element.parentNode.tagName.toLowerCase(),labelParent=parent==="label"?false:true;if(this.isDisabled()===false){fastclick(switcher);if(switcher.addEventListener){switcher.addEventListener("click",function(e){self.setPosition(labelParent);self.handleOnchange(self.element.checked)})}else{switcher.attachEvent("onclick",function(){self.setPosition(labelParent);self.handleOnchange(self.element.checked)})}}else{this.element.disabled=true;this.switcher.style.opacity=this.options.disabledOpacity}};Switchery.prototype.markAsSwitched=function(){this.element.setAttribute("data-switchery",true)};Switchery.prototype.markedAsSwitched=function(){return this.element.getAttribute("data-switchery")};Switchery.prototype.init=function(){this.hide();this.show();this.setSize();this.setPosition();this.markAsSwitched();this.handleChange();this.handleClick()}});if(typeof exports=="object"){module.exports=require("switchery")}else if(typeof define=="function"&&define.amd){define("Switchery",[],function(){return require("switchery")})}else{(this||window)["Switchery"]=require("switchery")}})();
js/themes/classic.js CHANGED
@@ -22,7 +22,6 @@ jQuery(document).on("wplc_minimize_chat", function( e ) {
22
  }
23
  jQuery('#wp-live-chat').addClass("wplc_close");
24
  jQuery('#wp-live-chat').removeClass("wplc_open");
25
- //jQuery("#wp-live-chat").css(jQuery("#wp-live-chat").attr("original_pos"), "100px");
26
  jQuery("#wp-live-chat").css("top", "");
27
  jQuery("#wp-live-chat-1").show();
28
  jQuery("#wp-live-chat-1").css('cursor', 'pointer');
@@ -40,8 +39,6 @@ jQuery(document).on("click", "#wp-live-chat", function( e ){
40
 
41
  jQuery(document).on("wplc_start_chat", function( e ) {
42
  jQuery("#wp-live-chat-2-inner").hide("slow");
43
- /* changed in version 7 as we now allow users to start typing immediately */
44
- /* jQuery("#wp-live-chat-3").show(); */
45
  jQuery.event.trigger({type: "wplc_open_chat_1"});
46
  jQuery.event.trigger({type: "wplc_open_chat_2", wplc_online: wplc_online});
47
  });
@@ -106,15 +103,11 @@ jQuery(document).on( "wplc_open_chat_2", function( e ) {
106
 
107
  jQuery("#wp-live-chat-3").hide();
108
  jQuery("#wp-live-chat-close").hide();
109
- //jQuery("#wp-live-chat-minimize").css("right","23px");
110
  Cookies.set('wplc_minimize', "", { expires: 1, path: '/' });
111
  });
112
 
113
  jQuery(function() {
114
  //opens chat when clicked on top bar
115
- jQuery("body").on("click", "#wp-live-chat-1", function() {
116
- //jQuery.event.trigger({type: "wplc_open_chat"});
117
- });
118
  jQuery("body").on("click", ".wplc_retry_chat", function() {
119
  Cookies.set('wplc_chat_status', 5);
120
  jQuery("#wplc_chatbox").html("");
@@ -143,7 +136,6 @@ jQuery(function() {
143
  });
144
 
145
  jQuery("body").on("click", "#wp-live-chat-header", function(){
146
- //if (!wplc_is_chat_open) {
147
 
148
  if (jQuery(this).hasClass('active')) {
149
  jQuery(this).removeClass('active');
@@ -152,7 +144,7 @@ jQuery(function() {
152
  Cookies.set('wplc_minimize', "yes", { expires: 1, path: '/' });
153
 
154
  } else {
155
- //jQuery(this).addClass('active');
156
  jQuery.event.trigger({type: "wplc_open_chat"});
157
  jQuery("#wp-live-chat-minimize").show();
158
 
@@ -162,7 +154,6 @@ jQuery(function() {
162
 
163
 
164
 
165
- //}
166
  });
167
 
168
  });
22
  }
23
  jQuery('#wp-live-chat').addClass("wplc_close");
24
  jQuery('#wp-live-chat').removeClass("wplc_open");
 
25
  jQuery("#wp-live-chat").css("top", "");
26
  jQuery("#wp-live-chat-1").show();
27
  jQuery("#wp-live-chat-1").css('cursor', 'pointer');
39
 
40
  jQuery(document).on("wplc_start_chat", function( e ) {
41
  jQuery("#wp-live-chat-2-inner").hide("slow");
 
 
42
  jQuery.event.trigger({type: "wplc_open_chat_1"});
43
  jQuery.event.trigger({type: "wplc_open_chat_2", wplc_online: wplc_online});
44
  });
103
 
104
  jQuery("#wp-live-chat-3").hide();
105
  jQuery("#wp-live-chat-close").hide();
 
106
  Cookies.set('wplc_minimize', "", { expires: 1, path: '/' });
107
  });
108
 
109
  jQuery(function() {
110
  //opens chat when clicked on top bar
 
 
 
111
  jQuery("body").on("click", ".wplc_retry_chat", function() {
112
  Cookies.set('wplc_chat_status', 5);
113
  jQuery("#wplc_chatbox").html("");
136
  });
137
 
138
  jQuery("body").on("click", "#wp-live-chat-header", function(){
 
139
 
140
  if (jQuery(this).hasClass('active')) {
141
  jQuery(this).removeClass('active');
144
  Cookies.set('wplc_minimize', "yes", { expires: 1, path: '/' });
145
 
146
  } else {
147
+
148
  jQuery.event.trigger({type: "wplc_open_chat"});
149
  jQuery("#wp-live-chat-minimize").show();
150
 
154
 
155
 
156
 
 
157
  });
158
 
159
  });
js/themes/classic.min.js ADDED
@@ -0,0 +1 @@
 
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
@@ -31,14 +31,10 @@ jQuery(document).on("wplc_minimize_chat", function( e ) {
31
  jQuery("#wp-live-chat").css("left", "20px");
32
  jQuery("#wp-live-chat").css("bottom", "100px");
33
  } else if(jQuery("#wp-live-chat").attr("original_pos") === "right"){
34
- //jQuery("#wp-live-chat").css("left", "");
35
- //jQuery("#wp-live-chat").css("right", "0");
36
- //jQuery("#wp-live-chat").css("bottom", "100px");
37
- //jQuery("#wp-live-chat").css("width", "");
38
  }
39
  jQuery('#wp-live-chat').addClass("wplc_close");
40
  jQuery('#wp-live-chat').removeClass("wplc_open");
41
- //jQuery("#wp-live-chat").css(jQuery("#wp-live-chat").attr("original_pos"), "100px");
42
  jQuery("#wp-live-chat").css("top", "");
43
  jQuery("#wp-live-chat").css("height", "");
44
  jQuery("#wp-live-chat-1").show();
@@ -58,8 +54,6 @@ jQuery(document).on("wplc_minimize_chat", function( e ) {
58
 
59
  jQuery(document).on("wplc_start_chat", function( e ) {
60
  jQuery("#wp-live-chat-2-inner").hide("slow");
61
- /* changed in version 7 as we now allow users to start typing immediately */
62
- /* jQuery("#wp-live-chat-3").show(); */
63
  jQuery.event.trigger({type: "wplc_open_chat_1"});
64
  jQuery.event.trigger({type: "wplc_open_chat_2", wplc_online: wplc_online});
65
 
@@ -69,9 +63,7 @@ jQuery(document).on( "wplc_open_chat_1", function( e ) {
69
  jQuery('#wp-live-chat').removeClass("wplc_close");
70
  jQuery('#wp-live-chat').addClass("wplc_open");
71
  jQuery("#wp-live-chat-react").hide();
72
-
73
- //jQuery("#wp-live-chat-header").hide();
74
-
75
  Cookies.set('wplc_hide', "", { expires: 1, path: '/' });
76
  jQuery("#wp-live-chat-minimize").show();
77
 
@@ -343,7 +335,6 @@ jQuery(function() {
343
 
344
 
345
  jQuery("body").on("click", "#wp-live-chat-header", function(){
346
- //if (!wplc_is_chat_open) {
347
 
348
  if (jQuery(this).hasClass('active')) {
349
  jQuery("#wplc_hovercard").fadeOut("fast");
@@ -366,15 +357,12 @@ jQuery(function() {
366
  jQuery("#speeching_button").click();
367
  }
368
 
369
- //Cookies.set('wplc_minimize', "", { expires: 1, path: '/' });
370
 
371
  }
372
 
373
  jQuery('#wplc_gdpr_end_chat_notice_container').hide();
374
 
375
 
376
-
377
- //}
378
  });
379
  jQuery("body").on("click", "#wplc_hovercard_min", function() {
380
  jQuery("#wplc_hovercard").fadeOut('fast');
@@ -391,12 +379,7 @@ jQuery(function() {
391
  jQuery("#wp-live-chat-header").removeClass('active');
392
  });
393
 
394
-
395
-
396
-
397
-
398
-
399
-
400
 
401
 
402
  });
@@ -459,8 +442,7 @@ function wplc_animate_agent_header_down() {
459
  jQuery("#wplc_chatbox_header").css("max-height", "50px");
460
  jQuery("#wplc_chatbox_header").css("height", "auto");
461
 
462
- //jQuery("#wplc_chatbox").css("top", jQuery("#wplc_chatbox_header").height()+18+"px");
463
-
464
 
465
  }
466
  }
31
  jQuery("#wp-live-chat").css("left", "20px");
32
  jQuery("#wp-live-chat").css("bottom", "100px");
33
  } else if(jQuery("#wp-live-chat").attr("original_pos") === "right"){
34
+
 
 
 
35
  }
36
  jQuery('#wp-live-chat').addClass("wplc_close");
37
  jQuery('#wp-live-chat').removeClass("wplc_open");
 
38
  jQuery("#wp-live-chat").css("top", "");
39
  jQuery("#wp-live-chat").css("height", "");
40
  jQuery("#wp-live-chat-1").show();
54
 
55
  jQuery(document).on("wplc_start_chat", function( e ) {
56
  jQuery("#wp-live-chat-2-inner").hide("slow");
 
 
57
  jQuery.event.trigger({type: "wplc_open_chat_1"});
58
  jQuery.event.trigger({type: "wplc_open_chat_2", wplc_online: wplc_online});
59
 
63
  jQuery('#wp-live-chat').removeClass("wplc_close");
64
  jQuery('#wp-live-chat').addClass("wplc_open");
65
  jQuery("#wp-live-chat-react").hide();
66
+
 
 
67
  Cookies.set('wplc_hide', "", { expires: 1, path: '/' });
68
  jQuery("#wp-live-chat-minimize").show();
69
 
335
 
336
 
337
  jQuery("body").on("click", "#wp-live-chat-header", function(){
 
338
 
339
  if (jQuery(this).hasClass('active')) {
340
  jQuery("#wplc_hovercard").fadeOut("fast");
357
  jQuery("#speeching_button").click();
358
  }
359
 
 
360
 
361
  }
362
 
363
  jQuery('#wplc_gdpr_end_chat_notice_container').hide();
364
 
365
 
 
 
366
  });
367
  jQuery("body").on("click", "#wplc_hovercard_min", function() {
368
  jQuery("#wplc_hovercard").fadeOut('fast');
379
  jQuery("#wp-live-chat-header").removeClass('active');
380
  });
381
 
382
+
 
 
 
 
 
383
 
384
 
385
  });
442
  jQuery("#wplc_chatbox_header").css("max-height", "50px");
443
  jQuery("#wplc_chatbox_header").css("height", "auto");
444
 
445
+
 
446
 
447
  }
448
  }
js/themes/modern.min.js ADDED
@@ -0,0 +1 @@
 
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 ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var wplc_rating = 0;
2
+ var wplc_comment;
3
+
4
+ jQuery(function() {
5
+
6
+ jQuery(document).on( "wplc_admin_chat_loop", function( e ) {
7
+ if(typeof wplc_node_sockets_ready === "undefined" || wplc_node_sockets_ready === false){
8
+ if (e.response['typing'] === "1") {
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+"' />");
16
+ jQuery("#wplc_user_typing").fadeIn("fast");
17
+ var height = jQuery('#admin_chat_box_area_' + cid)[0].scrollHeight;
18
+ jQuery('#admin_chat_box_area_' + cid).scrollTop(height);
19
+ }
20
+ }
21
+ } else if (e.response['typing'] === "0") {
22
+ if (jQuery("#wplc_user_typing").length>0) {
23
+ jQuery("#wplc_user_typing").fadeOut("slow").remove();
24
+ }
25
+ }
26
+ }
27
+
28
+ if (typeof e.response['chat_rating'] !== 'undefined' && typeof e.response['chat_rating']['rating'] !== 'undefined' && e.response['chat_rating']['rating'] !== false) {
29
+ if(parseInt(e.response['chat_rating']['rating']) !== wplc_rating || e.response['chat_rating']['comment'] !== wplc_comment){ //Has changed from default
30
+ wplc_rating = parseInt(e.response['chat_rating']['rating']);
31
+ wplc_comment = e.response['chat_rating']['comment'];
32
+
33
+ jQuery(".rating").removeClass("rating-good");
34
+ jQuery(".rating").removeClass("rating-bad");
35
+ jQuery(".rating").addClass(wplc_rating == 1 ? "rating-good" : (wplc_rating == 0 ? "rating-bad" : "" ));
36
+ jQuery(".rating").text(wplc_rating == 1 ? "Satisfied" : (wplc_rating == 0 ? "Unsatisfied" : "No Rating" ));
37
+ jQuery("#rating-comment-holder").text(wplc_comment !== "" && typeof wplc_comment !== "undefined" ? "\"" + wplc_comment + "\"" : "\"No Comment...\"");
38
+ }
39
+ }
40
+ });
41
+
42
+ });
js/upload.js ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(function() {
2
+
3
+ var clicked_on_imgbtn = false;
4
+ var clicked_on_logobtn = false;
5
+
6
+
7
+ jQuery('#wplc_btn_upload_pic').click(function() {
8
+
9
+ formfield = jQuery('#wplc_upload_pic').attr('name');
10
+ clicked_on_imgbtn = true;
11
+ tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true');
12
+ return false;
13
+ });
14
+ jQuery('#wplc_btn_upload_logo').click(function() {
15
+
16
+ formfield = jQuery('#wplc_upload_logo').attr('name');
17
+ clicked_on_logobtn = true;
18
+ tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true');
19
+ return false;
20
+ });
21
+ jQuery('#wplc_btn_upload_icon').click(function() {
22
+
23
+ formfield = jQuery('#wplc_upload_icon').attr('name');
24
+ clicked_on_logobtn = true;
25
+ tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true');
26
+ return false;
27
+ });
28
+
29
+ window.send_to_editor = function(html) {
30
+ imgurl = jQuery('img',html).attr('src');
31
+ if (clicked_on_imgbtn) { jQuery('#wplc_upload_pic').val(imgurl); jQuery("#wplc_pic_area").html("<img src=\""+imgurl+"\" />"); }
32
+ if (clicked_on_logobtn) { jQuery('#wplc_upload_logo').val(imgurl); jQuery("#wplc_logo_area").html("<img src=\""+imgurl+"\" />"); }
33
+
34
+ tb_remove();
35
+ }
36
+
37
+ });
js/wavesurfer.min.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ /*!
2
+ * wavesurfer.js 2.0.6 (Fri Jun 15 2018 10:57:58 GMT+0200 (CEST))
3
+ * https://github.com/katspaugh/wavesurfer.js
4
+ * @license BSD-3-Clause
5
+ */
6
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("WaveSurfer",[],t):"object"==typeof exports?exports.WaveSurfer=t():e.WaveSurfer=t()}(window,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=17)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(16);Object.defineProperty(t,"ajax",{enumerable:!0,get:function(){return p(n).default}});var i=r(15);Object.defineProperty(t,"getId",{enumerable:!0,get:function(){return p(i).default}});var a=r(14);Object.defineProperty(t,"max",{enumerable:!0,get:function(){return p(a).default}});var s=r(13);Object.defineProperty(t,"min",{enumerable:!0,get:function(){return p(s).default}});var o=r(3);Object.defineProperty(t,"Observer",{enumerable:!0,get:function(){return p(o).default}});var u=r(12);Object.defineProperty(t,"extend",{enumerable:!0,get:function(){return p(u).default}});var l=r(11);Object.defineProperty(t,"style",{enumerable:!0,get:function(){return p(l).default}});var c=r(2);Object.defineProperty(t,"requestAnimationFrame",{enumerable:!0,get:function(){return p(c).default}});var h=r(10);Object.defineProperty(t,"frame",{enumerable:!0,get:function(){return p(h).default}});var f=r(9);Object.defineProperty(t,"debounce",{enumerable:!0,get:function(){return p(f).default}});var d=r(8);function p(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"preventClick",{enumerable:!0,get:function(){return p(d).default}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s="playing",o="paused",u="finished",l=function(e){function t(e){var r,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return i.audioContext=null,i.offlineAudioContext=null,i.stateBehaviors=(a(r={},s,{init:function(){this.addOnAudioProcess()},getPlayedPercents:function(){var e=this.getDuration();return this.getCurrentTime()/e||0},getCurrentTime:function(){return this.startPosition+this.getPlayedTime()}}),a(r,o,{init:function(){this.removeOnAudioProcess()},getPlayedPercents:function(){var e=this.getDuration();return this.getCurrentTime()/e||0},getCurrentTime:function(){return this.startPosition}}),a(r,u,{init:function(){this.removeOnAudioProcess(),this.fireEvent("finish")},getPlayedPercents:function(){return 1},getCurrentTime:function(){return this.getDuration()}}),r),i.params=e,i.ac=e.audioContext||i.getAudioContext(),i.lastPlay=i.ac.currentTime,i.startPosition=0,i.scheduledPause=null,i.states=(a(n={},s,Object.create(i.stateBehaviors[s])),a(n,o,Object.create(i.stateBehaviors[o])),a(n,u,Object.create(i.stateBehaviors[u])),n),i.analyser=null,i.buffer=null,i.filters=[],i.gainNode=null,i.mergedPeaks=null,i.offlineAc=null,i.peaks=null,i.playbackRate=1,i.analyser=null,i.scriptNode=null,i.source=null,i.splitPeaks=[],i.state=null,i.explicitDuration=null,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.Observer),n(t,[{key:"supportsWebAudio",value:function(){return!(!window.AudioContext&&!window.webkitAudioContext)}},{key:"getAudioContext",value:function(){return window.WaveSurferAudioContext||(window.WaveSurferAudioContext=new(window.AudioContext||window.webkitAudioContext)),window.WaveSurferAudioContext}},{key:"getOfflineAudioContext",value:function(e){return window.WaveSurferOfflineAudioContext||(window.WaveSurferOfflineAudioContext=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,2,e)),window.WaveSurferOfflineAudioContext}}]),n(t,[{key:"init",value:function(){this.createVolumeNode(),this.createScriptNode(),this.createAnalyserNode(),this.setState(o),this.setPlaybackRate(this.params.audioRate),this.setLength(0)}},{key:"disconnectFilters",value:function(){this.filters&&(this.filters.forEach(function(e){e&&e.disconnect()}),this.filters=null,this.analyser.connect(this.gainNode))}},{key:"setState",value:function(e){this.state!==this.states[e]&&(this.state=this.states[e],this.state.init.call(this))}},{key:"setFilter",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];this.setFilters(t)}},{key:"setFilters",value:function(e){this.disconnectFilters(),e&&e.length&&(this.filters=e,this.analyser.disconnect(),e.reduce(function(e,t){return e.connect(t),t},this.analyser).connect(this.gainNode))}},{key:"createScriptNode",value:function(){this.params.audioScriptProcessor?this.scriptNode=this.params.audioScriptProcessor:this.ac.createScriptProcessor?this.scriptNode=this.ac.createScriptProcessor(t.scriptBufferSize):this.scriptNode=this.ac.createJavaScriptNode(t.scriptBufferSize),this.scriptNode.connect(this.ac.destination)}},{key:"addOnAudioProcess",value:function(){var e=this;this.scriptNode.onaudioprocess=function(){var t=e.getCurrentTime();t>=e.getDuration()?(e.setState(u),e.fireEvent("pause")):t>=e.scheduledPause?e.pause():e.state===e.states[s]&&e.fireEvent("audioprocess",t)}}},{key:"removeOnAudioProcess",value:function(){this.scriptNode.onaudioprocess=null}},{key:"createAnalyserNode",value:function(){this.analyser=this.ac.createAnalyser(),this.analyser.connect(this.gainNode)}},{key:"createVolumeNode",value:function(){this.ac.createGain?this.gainNode=this.ac.createGain():this.gainNode=this.ac.createGainNode(),this.gainNode.connect(this.ac.destination)}},{key:"setSinkId",value:function(e){if(e){var t=new window.Audio;if(!t.setSinkId)return Promise.reject(new Error("setSinkId is not supported in your browser"));t.autoplay=!0;var r=this.ac.createMediaStreamDestination();return this.gainNode.disconnect(),this.gainNode.connect(r),t.src=URL.createObjectURL(r.stream),t.setSinkId(e)}return Promise.reject(new Error("Invalid deviceId: "+e))}},{key:"setVolume",value:function(e){this.gainNode.gain.setValueAtTime(e,this.ac.currentTime)}},{key:"getVolume",value:function(){return this.gainNode.gain.value}},{key:"decodeArrayBuffer",value:function(e,t,r){this.offlineAc||(this.offlineAc=this.getOfflineAudioContext(this.ac?this.ac.sampleRate:44100)),this.offlineAc.decodeAudioData(e,function(e){return t(e)},r)}},{key:"setPeaks",value:function(e,t){this.explicitDuration=t,this.peaks=e}},{key:"setLength",value:function(e){if(!this.mergedPeaks||e!=2*this.mergedPeaks.length-1+2){this.splitPeaks=[],this.mergedPeaks=[];var t=this.buffer?this.buffer.numberOfChannels:1,r=void 0;for(r=0;r<t;r++)this.splitPeaks[r]=[],this.splitPeaks[r][2*(e-1)]=0,this.splitPeaks[r][2*(e-1)+1]=0;this.mergedPeaks[2*(e-1)]=0,this.mergedPeaks[2*(e-1)+1]=0}}},{key:"getPeaks",value:function(e,t,r){if(this.peaks)return this.peaks;if(t=t||0,r=r||e-1,this.setLength(e),!this.buffer.length){var n=this.createBuffer(1,4096,this.sampleRate);this.buffer=n.buffer}var i=this.buffer.length/e,a=~~(i/10)||1,s=this.buffer.numberOfChannels,o=void 0;for(o=0;o<s;o++){var u=this.splitPeaks[o],l=this.buffer.getChannelData(o),c=void 0;for(c=t;c<=r;c++){var h=~~(c*i),f=~~(h+i),d=0,p=0,v=void 0;for(v=h;v<f;v+=a){var y=l[v];y>p&&(p=y),y<d&&(d=y)}u[2*c]=p,u[2*c+1]=d,(0==o||p>this.mergedPeaks[2*c])&&(this.mergedPeaks[2*c]=p),(0==o||d<this.mergedPeaks[2*c+1])&&(this.mergedPeaks[2*c+1]=d)}}return this.params.splitChannels?this.splitPeaks:this.mergedPeaks}},{key:"getPlayedPercents",value:function(){return this.state.getPlayedPercents.call(this)}},{key:"disconnectSource",value:function(){this.source&&this.source.disconnect()}},{key:"destroy",value:function(){this.isPaused()||this.pause(),this.unAll(),this.buffer=null,this.disconnectFilters(),this.disconnectSource(),this.gainNode.disconnect(),this.scriptNode.disconnect(),this.analyser.disconnect(),this.params.closeAudioContext&&("function"==typeof this.ac.close&&"closed"!=this.ac.state&&this.ac.close(),this.ac=null,this.params.audioContext?this.params.audioContext=null:window.WaveSurferAudioContext=null,window.WaveSurferOfflineAudioContext=null)}},{key:"load",value:function(e){this.startPosition=0,this.lastPlay=this.ac.currentTime,this.buffer=e,this.createSource()}},{key:"createSource",value:function(){this.disconnectSource(),this.source=this.ac.createBufferSource(),this.source.start=this.source.start||this.source.noteGrainOn,this.source.stop=this.source.stop||this.source.noteOff,this.source.playbackRate.setValueAtTime(this.playbackRate,this.ac.currentTime),this.source.buffer=this.buffer,this.source.connect(this.analyser)}},{key:"isPaused",value:function(){return this.state!==this.states[s]}},{key:"getDuration",value:function(){return this.buffer?this.buffer.duration:this.explicitDuration?this.explicitDuration:0}},{key:"seekTo",value:function(e,t){if(this.buffer)return this.scheduledPause=null,null==e&&(e=this.getCurrentTime())>=this.getDuration()&&(e=0),null==t&&(t=this.getDuration()),this.startPosition=e,this.lastPlay=this.ac.currentTime,this.state===this.states[u]&&this.setState(o),{start:e,end:t}}},{key:"getPlayedTime",value:function(){return(this.ac.currentTime-this.lastPlay)*this.playbackRate}},{key:"play",value:function(e,t){if(this.buffer){this.createSource();var r=this.seekTo(e,t);e=r.start,t=r.end,this.scheduledPause=t,this.source.start(0,e,t-e),"suspended"==this.ac.state&&this.ac.resume&&this.ac.resume(),this.setState(s),this.fireEvent("play")}}},{key:"pause",value:function(){this.scheduledPause=null,this.startPosition+=this.getPlayedTime(),this.source&&this.source.stop(0),this.setState(o),this.fireEvent("pause")}},{key:"getCurrentTime",value:function(){return this.state.getCurrentTime.call(this)}},{key:"getPlaybackRate",value:function(){return this.playbackRate}},{key:"setPlaybackRate",value:function(e){e=e||1,this.isPaused()?this.playbackRate=e:(this.pause(),this.playbackRate=e,this.play())}}]),t}();l.scriptBufferSize=256,t.default=l,e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e,t){return setTimeout(e,1e3/60)}).bind(window),e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.handlers=null}return n(e,[{key:"on",value:function(e,t){var r=this;this.handlers||(this.handlers={});var n=this.handlers[e];return n||(n=this.handlers[e]=[]),n.push(t),{name:e,callback:t,un:function(e,t){return r.un(e,t)}}}},{key:"un",value:function(e,t){if(this.handlers){var r=this.handlers[e],n=void 0;if(r)if(t)for(n=r.length-1;n>=0;n--)r[n]==t&&r.splice(n,1);else r.length=0}}},{key:"unAll",value:function(){this.handlers=null}},{key:"once",value:function(e,t){var r=this;return this.on(e,function n(){for(var i=arguments.length,a=Array(i),s=0;s<i;s++)a[s]=arguments[s];t.apply(r,a),setTimeout(function(){r.un(e,n)},0)})}},{key:"fireEvent",value:function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if(this.handlers){var i=this.handlers[e];i&&i.forEach(function(e){e.apply(void 0,r)})}}}]),e}();t.default=i,e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.clearPeakCache()}return n(e,[{key:"clearPeakCache",value:function(){this.peakCacheRanges=[],this.peakCacheLength=-1}},{key:"addRangeToPeakCache",value:function(e,t,r){e!=this.peakCacheLength&&(this.clearPeakCache(),this.peakCacheLength=e);for(var n=[],i=0;i<this.peakCacheRanges.length&&this.peakCacheRanges[i]<t;)i++;for(i%2==0&&n.push(t);i<this.peakCacheRanges.length&&this.peakCacheRanges[i]<=r;)n.push(this.peakCacheRanges[i]),i++;i%2==0&&n.push(r),n=n.filter(function(e,t,r){return 0==t?e!=r[t+1]:t==r.length-1?e!=r[t-1]:e!=r[t-1]&&e!=r[t+1]}),this.peakCacheRanges=this.peakCacheRanges.concat(n),this.peakCacheRanges=this.peakCacheRanges.sort(function(e,t){return e-t}).filter(function(e,t,r){return 0==t?e!=r[t+1]:t==r.length-1?e!=r[t-1]:e!=r[t-1]&&e!=r[t+1]});var a=[];for(i=0;i<n.length;i+=2)a.push([n[i],n[i+1]]);return a}},{key:"getCacheRanges",value:function(){var e=[],t=void 0;for(t=0;t<this.peakCacheRanges.length;t+=2)e.push([this.peakCacheRanges[t],this.peakCacheRanges[t+1]]);return e}}]),e}();t.default=i,e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=r(1),s=(n=a)&&n.__esModule?n:{default:n};!function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);t.default=e}(r(0));var o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.params=e,r.media={currentTime:0,duration:0,paused:!0,playbackRate:1,play:function(){},pause:function(){},volume:0},r.mediaType=e.mediaType.toLowerCase(),r.elementPosition=e.elementPosition,r.peaks=null,r.playbackRate=1,r.volume=1,r.buffer=null,r.onPlayEnd=null,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,s.default),i(t,[{key:"init",value:function(){this.setPlaybackRate(this.params.audioRate),this.createTimer()}},{key:"createTimer",value:function(){var e=this;this.on("play",function t(){e.isPaused()||(e.fireEvent("audioprocess",e.getCurrentTime()),(window.requestAnimationFrame||window.webkitRequestAnimationFrame)(t))}),this.on("pause",function(){e.fireEvent("audioprocess",e.getCurrentTime())})}},{key:"load",value:function(e,t,r,n){var i=document.createElement(this.mediaType);i.controls=this.params.mediaControls,i.autoplay=this.params.autoplay||!1,i.preload=null==n?"auto":n,i.src=e,i.style.width="100%";var a=t.querySelector(this.mediaType);a&&t.removeChild(a),t.appendChild(i),this._load(i,r)}},{key:"loadElt",value:function(e,t){e.controls=this.params.mediaControls,e.autoplay=this.params.autoplay||!1,this._load(e,t)}},{key:"_load",value:function(e,t){var r=this;"function"==typeof e.load&&e.load(),e.addEventListener("error",function(){r.fireEvent("error","Error loading media element")}),e.addEventListener("canplay",function(){r.fireEvent("canplay")}),e.addEventListener("ended",function(){r.fireEvent("finish")}),e.addEventListener("play",function(){r.fireEvent("play")}),e.addEventListener("pause",function(){r.fireEvent("pause")}),this.media=e,this.peaks=t,this.onPlayEnd=null,this.buffer=null,this.setPlaybackRate(this.playbackRate),this.setVolume(this.volume)}},{key:"isPaused",value:function(){return!this.media||this.media.paused}},{key:"getDuration",value:function(){if(this.explicitDuration)return this.explicitDuration;var e=(this.buffer||this.media).duration;return e>=1/0&&(e=this.media.seekable.end(0)),e}},{key:"getCurrentTime",value:function(){return this.media&&this.media.currentTime}},{key:"getPlayedPercents",value:function(){return this.getCurrentTime()/this.getDuration()||0}},{key:"getPlaybackRate",value:function(){return this.playbackRate||this.media.playbackRate}},{key:"setPlaybackRate",value:function(e){this.playbackRate=e||1,this.media.playbackRate=this.playbackRate}},{key:"seekTo",value:function(e){null!=e&&(this.media.currentTime=e),this.clearPlayEnd()}},{key:"play",value:function(e,t){this.seekTo(e);var r=this.media.play();return t&&this.setPlayEnd(t),r}},{key:"pause",value:function(){var e=void 0;return this.media&&(e=this.media.pause()),this.clearPlayEnd(),e}},{key:"setPlayEnd",value:function(e){var t=this;this._onPlayEnd=function(r){r>=e&&(t.pause(),t.seekTo(e))},this.on("audioprocess",this._onPlayEnd)}},{key:"clearPlayEnd",value:function(){this._onPlayEnd&&(this.un("audioprocess",this._onPlayEnd),this._onPlayEnd=null)}},{key:"getPeaks",value:function(e,r,n){return this.buffer?function e(t,r,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,r);if(void 0===i){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,r,n)}if("value"in i)return i.value;var s=i.get;return void 0!==s?s.call(n):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"getPeaks",this).call(this,e,r,n):this.peaks||[]}},{key:"setSinkId",value:function(e){return e?this.media.setSinkId?this.media.setSinkId(e):Promise.reject(new Error("setSinkId is not supported in your browser")):Promise.reject(new Error("Invalid deviceId: "+e))}},{key:"getVolume",value:function(){return this.volume||this.media.volume}},{key:"setVolume",value:function(e){this.volume=e,this.media.volume=this.volume}},{key:"destroy",value:function(){this.pause(),this.unAll(),this.params.removeMediaElementOnDestroy&&this.media&&this.media.parentNode&&this.media.parentNode.removeChild(this.media),this.media=null}}]),t}();t.default=o,e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var a=function(e){function t(e,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.container=e,n.params=r,n.width=0,n.height=r.height*n.params.pixelRatio,n.lastPos=0,n.wrapper=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.Observer),n(t,[{key:"style",value:function(e,t){return i.style(e,t)}},{key:"createWrapper",value:function(){this.wrapper=this.container.appendChild(document.createElement("wave")),this.style(this.wrapper,{display:"block",position:"relative",userSelect:"none",webkitUserSelect:"none",height:this.params.height+"px"}),(this.params.fillParent||this.params.scrollParent)&&this.style(this.wrapper,{width:"100%",overflowX:this.params.hideScrollbar?"hidden":"auto",overflowY:"hidden"}),this.setupWrapperEvents()}},{key:"handleEvent",value:function(e,t){!t&&e.preventDefault();var r=e.targetTouches?e.targetTouches[0].clientX:e.clientX,n=this.wrapper.getBoundingClientRect(),i=this.width,a=this.getWidth(),s=void 0;return!this.params.fillParent&&i<a?(s=(r-n.left)*(this.params.pixelRatio/i)||0)>1&&(s=1):s=(r-n.left+this.wrapper.scrollLeft)/this.wrapper.scrollWidth||0,s}},{key:"setupWrapperEvents",value:function(){var e=this;this.wrapper.addEventListener("click",function(t){var r=e.wrapper.offsetHeight-e.wrapper.clientHeight;if(0!=r){var n=e.wrapper.getBoundingClientRect();if(t.clientY>=n.bottom-r)return}e.params.interact&&e.fireEvent("click",t,e.handleEvent(t))}),this.wrapper.addEventListener("scroll",function(t){return e.fireEvent("scroll",t)})}},{key:"drawPeaks",value:function(e,t,r,n){this.setWidth(t)||this.clearWave(),this.params.barWidth?this.drawBars(e,0,r,n):this.drawWave(e,0,r,n)}},{key:"resetScroll",value:function(){null!==this.wrapper&&(this.wrapper.scrollLeft=0)}},{key:"recenter",value:function(e){var t=this.wrapper.scrollWidth*e;this.recenterOnPosition(t,!0)}},{key:"recenterOnPosition",value:function(e,t){var r=this.wrapper.scrollLeft,n=~~(this.wrapper.clientWidth/2),i=this.wrapper.scrollWidth-this.wrapper.clientWidth,a=e-n,s=a-r;if(0!=i){if(!t&&-n<=s&&s<n){a=r+(s=Math.max(-5,Math.min(5,s)))}(a=Math.max(0,Math.min(i,a)))!=r&&(this.wrapper.scrollLeft=a)}}},{key:"getScrollX",value:function(){var e=this.params.pixelRatio,t=Math.round(this.wrapper.scrollLeft*e);if(this.params.scrollParent){var r=~~(this.wrapper.scrollWidth*e-this.getWidth());t=Math.min(r,Math.max(0,t))}return t}},{key:"getWidth",value:function(){return Math.round(this.container.clientWidth*this.params.pixelRatio)}},{key:"setWidth",value:function(e){return this.width!=e&&(this.width=e,this.params.fillParent||this.params.scrollParent?this.style(this.wrapper,{width:""}):this.style(this.wrapper,{width:~~(this.width/this.params.pixelRatio)+"px"}),this.updateSize(),!0)}},{key:"setHeight",value:function(e){return e!=this.height&&(this.height=e,this.style(this.wrapper,{height:~~(this.height/this.params.pixelRatio)+"px"}),this.updateSize(),!0)}},{key:"progress",value:function(e){var t=1/this.params.pixelRatio,r=Math.round(e*this.width)*t;if(r<this.lastPos||r-this.lastPos>=t){if(this.lastPos=r,this.params.scrollParent&&this.params.autoCenter){var n=~~(this.wrapper.scrollWidth*e);this.recenterOnPosition(n)}this.updateProgress(r)}}},{key:"destroy",value:function(){this.unAll(),this.wrapper&&(this.wrapper.parentNode==this.container&&this.container.removeChild(this.wrapper),this.wrapper=null)}},{key:"updateCursor",value:function(){}},{key:"updateSize",value:function(){}},{key:"drawBars",value:function(e,t,r,n){}},{key:"drawWave",value:function(e,t,r,n){}},{key:"clearWave",value:function(){}},{key:"updateProgress",value:function(e){}}]),t}();t.default=a,e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=r(6),s=(n=a)&&n.__esModule?n:{default:n},o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var u=function(e){function t(e,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return n.maxCanvasWidth=r.maxCanvasWidth,n.maxCanvasElementWidth=Math.round(r.maxCanvasWidth/r.pixelRatio),n.hasProgressCanvas=r.waveColor!=r.progressColor,n.halfPixel=.5/r.pixelRatio,n.canvases=[],n.progressWave=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,s.default),i(t,[{key:"init",value:function(){this.createWrapper(),this.createElements()}},{key:"createElements",value:function(){this.progressWave=this.wrapper.appendChild(this.style(document.createElement("wave"),{position:"absolute",zIndex:3,left:0,top:0,bottom:0,overflow:"hidden",width:"0",display:"none",boxSizing:"border-box",borderRightStyle:"solid",pointerEvents:"none"})),this.addCanvas(),this.updateCursor()}},{key:"updateCursor",value:function(){this.style(this.progressWave,{borderRightWidth:this.params.cursorWidth+"px",borderRightColor:this.params.cursorColor})}},{key:"updateSize",value:function(){for(var e=this,t=Math.round(this.width/this.params.pixelRatio),r=Math.ceil(t/this.maxCanvasElementWidth);this.canvases.length<r;)this.addCanvas();for(;this.canvases.length>r;)this.removeCanvas();this.canvases.forEach(function(t,r){var n=e.maxCanvasWidth+2*Math.ceil(e.params.pixelRatio/2);r==e.canvases.length-1&&(n=e.width-e.maxCanvasWidth*(e.canvases.length-1)),e.updateDimensions(t,n,e.height),e.clearWaveForEntry(t)})}},{key:"addCanvas",value:function(){var e={},t=this.maxCanvasElementWidth*this.canvases.length;e.wave=this.wrapper.appendChild(this.style(document.createElement("canvas"),{position:"absolute",zIndex:2,left:t+"px",top:0,bottom:0,height:"100%",pointerEvents:"none"})),e.waveCtx=e.wave.getContext("2d"),this.hasProgressCanvas&&(e.progress=this.progressWave.appendChild(this.style(document.createElement("canvas"),{position:"absolute",left:t+"px",top:0,bottom:0,height:"100%"})),e.progressCtx=e.progress.getContext("2d")),this.canvases.push(e)}},{key:"removeCanvas",value:function(){var e=this.canvases.pop();e.wave.parentElement.removeChild(e.wave),this.hasProgressCanvas&&e.progress.parentElement.removeChild(e.progress)}},{key:"updateDimensions",value:function(e,t,r){var n=Math.round(t/this.params.pixelRatio),i=Math.round(this.width/this.params.pixelRatio);e.start=e.waveCtx.canvas.offsetLeft/i||0,e.end=e.start+n/i,e.waveCtx.canvas.width=t,e.waveCtx.canvas.height=r,this.style(e.waveCtx.canvas,{width:n+"px"}),this.style(this.progressWave,{display:"block"}),this.hasProgressCanvas&&(e.progressCtx.canvas.width=t,e.progressCtx.canvas.height=r,this.style(e.progressCtx.canvas,{width:n+"px"}))}},{key:"clearWave",value:function(){var e=this;this.canvases.forEach(function(t){return e.clearWaveForEntry(t)})}},{key:"clearWaveForEntry",value:function(e){e.waveCtx.clearRect(0,0,e.waveCtx.canvas.width,e.waveCtx.canvas.height),this.hasProgressCanvas&&e.progressCtx.clearRect(0,0,e.progressCtx.canvas.width,e.progressCtx.canvas.height)}},{key:"drawBars",value:function(e,t,r,n){var i=this;return this.prepareDraw(e,t,r,n,function(e){var t=e.absmax,a=e.hasMinVals,s=(e.height,e.offsetY),o=e.halfH,u=e.peaks;if(void 0!==r){var l=a?2:1,c=u.length/l,h=i.params.barWidth*i.params.pixelRatio,f=h+(null===i.params.barGap?Math.max(i.params.pixelRatio,~~(h/2)):Math.max(i.params.pixelRatio,i.params.barGap*i.params.pixelRatio)),d=c/i.width,p=n,v=void 0;for(v=r;v<p;v+=f){var y=u[Math.floor(v*d*l)]||0,m=Math.round(y/t*o);i.fillRect(v+i.halfPixel,o-m+s,h+i.halfPixel,2*m)}}})}},{key:"drawWave",value:function(e,t,r,n){var i=this;return this.prepareDraw(e,t,r,n,function(e){var t=e.absmax,a=e.hasMinVals,s=(e.height,e.offsetY),o=e.halfH,u=e.peaks;if(!a){var l=[],c=u.length,h=void 0;for(h=0;h<c;h++)l[2*h]=u[h],l[2*h+1]=-u[h];u=l}void 0!==r&&i.drawLine(u,t,o,s,r,n),i.fillRect(0,o+s-i.halfPixel,i.width,i.halfPixel)})}},{key:"drawLine",value:function(e,t,r,n,i,a){var s=this;this.canvases.forEach(function(o){s.setFillStyles(o),s.drawLineToContext(o,o.waveCtx,e,t,r,n,i,a),s.drawLineToContext(o,o.progressCtx,e,t,r,n,i,a)})}},{key:"drawLineToContext",value:function(e,t,r,n,i,a,s,o){if(t){var u=r.length/2,l=this.params.fillParent&&this.width!=u?this.width/u:1,c=Math.round(u*e.start),h=Math.round(u*e.end)+1;if(!(c>o||h<s)){var f=Math.min(c,s),d=Math.max(h,o),p=void 0,v=void 0;for(t.beginPath(),t.moveTo((f-c)*l+this.halfPixel,i+a),p=f;p<d;p++){var y=r[2*p]||0,m=Math.round(y/n*i);t.lineTo((p-c)*l+this.halfPixel,i-m+a)}for(v=d-1;v>=f;v--){var k=r[2*v+1]||0,g=Math.round(k/n*i);t.lineTo((v-c)*l+this.halfPixel,i-g+a)}t.closePath(),t.fill()}}}},{key:"fillRect",value:function(e,t,r,n){var i=Math.floor(e/this.maxCanvasWidth),a=Math.min(Math.ceil((e+r)/this.maxCanvasWidth)+1,this.canvases.length),s=void 0;for(s=i;s<a;s++){var o=this.canvases[s],u=s*this.maxCanvasWidth,l={x1:Math.max(e,s*this.maxCanvasWidth),y1:t,x2:Math.min(e+r,s*this.maxCanvasWidth+o.waveCtx.canvas.width),y2:t+n};l.x1<l.x2&&(this.setFillStyles(o),this.fillRectToContext(o.waveCtx,l.x1-u,l.y1,l.x2-l.x1,l.y2-l.y1),this.fillRectToContext(o.progressCtx,l.x1-u,l.y1,l.x2-l.x1,l.y2-l.y1))}}},{key:"prepareDraw",value:function(e,t,r,n,i){var a=this;return o.frame(function(){if(e[0]instanceof Array){var s=e;if(a.params.splitChannels)return a.setHeight(s.length*a.params.height*a.params.pixelRatio),s.forEach(function(e,t){return a.prepareDraw(e,t,r,n,i)});e=s[0]}var u=1/a.params.barHeight;if(a.params.normalize){var l=o.max(e),c=o.min(e);u=-c>l?-c:l}var h=[].some.call(e,function(e){return e<0}),f=a.params.height*a.params.pixelRatio;return i({absmax:u,hasMinVals:h,height:f,offsetY:f*t||0,halfH:f/2,peaks:e})})()}},{key:"fillRectToContext",value:function(e,t,r,n,i){e&&e.fillRect(t,r,n,i)}},{key:"setFillStyles",value:function(e){e.waveCtx.fillStyle=this.params.waveColor,this.hasProgressCanvas&&(e.progressCtx.fillStyle=this.params.progressColor)}},{key:"getImage",value:function(e,t){var r=this.canvases.map(function(r){return r.wave.toDataURL(e,t)});return r.length>1?r:r[0]}},{key:"updateProgress",value:function(e){this.style(this.progressWave,{width:e+"px"})}}]),t}();t.default=u,e.exports=t.default},function(e,t,r){"use strict";function n(e){e.stopPropagation(),document.body.removeEventListener("click",n,!0)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){document.body.addEventListener("click",n,!0)},e.exports=t.default},function(e,t){e.exports=function(e,t,r){var n,i,a,s,o;function u(){var l=Date.now()-s;l<t&&l>=0?n=setTimeout(u,t-l):(n=null,r||(o=e.apply(a,i),a=i=null))}null==t&&(t=100);var l=function(){a=this,i=arguments,s=Date.now();var l=r&&!n;return n||(n=setTimeout(u,t)),l&&(o=e.apply(a,i),a=i=null),o};return l.clear=function(){n&&(clearTimeout(n),n=null)},l.flush=function(){n&&(o=e.apply(a,i),a=i=null,clearTimeout(n),n=null)},l}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return(0,a.default)(function(){return e.apply(void 0,r)})}};var n,i=r(2),a=(n=i)&&n.__esModule?n:{default:n};e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return Object.keys(t).forEach(function(r){e.style[r]!==t[r]&&(e.style[r]=t[r])}),e},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return r.forEach(function(t){Object.keys(t).forEach(function(r){e[r]=t[r]})}),e},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=Number(1/0);return Object.keys(e).forEach(function(r){e[r]<t&&(t=e[r])}),t},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=-1/0;return Object.keys(e).forEach(function(r){e[r]>t&&(t=e[r])}),t},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return"wavesurfer_"+Math.random().toString(32).substring(2)},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=new a.default,r=new XMLHttpRequest,n=!1;r.open(e.method||"GET",e.url,!0),r.responseType=e.responseType||"json",e.xhr&&(e.xhr.requestHeaders&&e.xhr.requestHeaders.forEach(function(e){r.setRequestHeader(e.key,e.value)}),e.xhr.withCredentials&&(r.withCredentials=!0));return r.addEventListener("progress",function(e){t.fireEvent("progress",e),e.lengthComputable&&e.loaded==e.total&&(n=!0)}),r.addEventListener("load",function(e){n||t.fireEvent("progress",e),t.fireEvent("load",e),200==r.status||206==r.status?t.fireEvent("success",r.response,e):t.fireEvent("error",e)}),r.addEventListener("error",function(e){return t.fireEvent("error",e)}),r.send(),t.xhr=r,t};var n,i=r(3),a=(n=i)&&n.__esModule?n:{default:n};e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),a=l(r(7)),s=l(r(1)),o=l(r(5)),u=l(r(4));function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}!function(){function e(t,r){h(this,e)}n(e,[{key:"create",value:function(e){}}]),n(e,[{key:"init",value:function(){}},{key:"destroy",value:function(){}}])}();var f=function(e){function t(e){h(this,t);var r=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(r.defaultParams={audioContext:null,audioRate:1,autoCenter:!0,backend:"WebAudio",barHeight:1,barGap:null,container:null,cursorColor:"#333",cursorWidth:1,dragSelection:!0,fillParent:!0,forceDecode:!1,height:128,hideScrollbar:!1,interact:!0,loopSelection:!0,maxCanvasWidth:4e3,mediaContainer:null,mediaControls:!1,mediaType:"audio",minPxPerSec:20,normalize:!1,partialRender:!1,pixelRatio:window.devicePixelRatio||screen.deviceXDPI/screen.logicalXDPI,plugins:[],progressColor:"#555",removeMediaElementOnDestroy:!0,renderer:a.default,responsive:!1,scrollParent:!1,skipLength:2,splitChannels:!1,waveColor:"#999",xhr:{}},r.backends={MediaElement:o.default,WebAudio:s.default},r.util=i,r.params=i.extend({},r.defaultParams,e),r.container="string"==typeof e.container?document.querySelector(r.params.container):r.params.container,!r.container)throw new Error("Container element not found");if(null==r.params.mediaContainer?r.mediaContainer=r.container:"string"==typeof r.params.mediaContainer?r.mediaContainer=document.querySelector(r.params.mediaContainer):r.mediaContainer=r.params.mediaContainer,!r.mediaContainer)throw new Error("Media Container element not found");if(r.params.maxCanvasWidth<=1)throw new Error("maxCanvasWidth must be greater than 1");if(r.params.maxCanvasWidth%2==1)throw new Error("maxCanvasWidth must be an even number");if(r.savedVolume=0,r.isMuted=!1,r.tmpEvents=[],r.currentAjax=null,r.arraybuffer=null,r.drawer=null,r.backend=null,r.peakCache=null,"function"!=typeof r.params.renderer)throw new Error("Renderer parameter is invalid");r.Drawer=r.params.renderer,r.Backend=r.backends[r.params.backend],r.initialisedPluginList={},r.isDestroyed=!1,r.isReady=!1;var n=0;return r._onResize=i.debounce(function(){n==r.drawer.wrapper.clientWidth||r.params.scrollParent||(n=r.drawer.wrapper.clientWidth,r.drawer.fireEvent("redraw"))},"number"==typeof r.params.responsive?r.params.responsive:100),c(r,r)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.Observer),n(t,null,[{key:"create",value:function(e){return new t(e).init()}}]),n(t,[{key:"init",value:function(){return this.registerPlugins(this.params.plugins),this.createDrawer(),this.createBackend(),this.createPeakCache(),this}},{key:"registerPlugins",value:function(e){var t=this;return e.forEach(function(e){return t.addPlugin(e)}),e.forEach(function(e){e.deferInit||t.initPlugin(e.name)}),this.fireEvent("plugins-registered",e),this}},{key:"addPlugin",value:function(e){var t=this;if(!e.name)throw new Error("Plugin does not have a name!");if(!e.instance)throw new Error("Plugin "+e.name+" does not have an instance property!");e.staticProps&&Object.keys(e.staticProps).forEach(function(r){t[r]=e.staticProps[r]});var r=e.instance;return Object.getOwnPropertyNames(i.Observer.prototype).forEach(function(e){r.prototype[e]=i.Observer.prototype[e]}),this[e.name]=new r(e.params||{},this),this.fireEvent("plugin-added",e.name),this}},{key:"initPlugin",value:function(e){if(!this[e])throw new Error("Plugin "+e+" has not been added yet!");return this.initialisedPluginList[e]&&this.destroyPlugin(e),this[e].init(),this.initialisedPluginList[e]=!0,this.fireEvent("plugin-initialised",e),this}},{key:"destroyPlugin",value:function(e){if(!this[e])throw new Error("Plugin "+e+" has not been added yet and cannot be destroyed!");if(!this.initialisedPluginList[e])throw new Error("Plugin "+e+" is not active and cannot be destroyed!");if("function"!=typeof this[e].destroy)throw new Error("Plugin "+e+" does not have a destroy function!");return this[e].destroy(),delete this.initialisedPluginList[e],this.fireEvent("plugin-destroyed",e),this}},{key:"destroyAllPlugins",value:function(){var e=this;Object.keys(this.initialisedPluginList).forEach(function(t){return e.destroyPlugin(t)})}},{key:"createDrawer",value:function(){var e=this;this.drawer=new this.Drawer(this.container,this.params),this.drawer.init(),this.fireEvent("drawer-created",this.drawer),!1!==this.params.responsive&&(window.addEventListener("resize",this._onResize,!0),window.addEventListener("orientationchange",this._onResize,!0)),this.drawer.on("redraw",function(){e.drawBuffer(),e.drawer.progress(e.backend.getPlayedPercents())}),this.drawer.on("click",function(t,r){setTimeout(function(){return e.seekTo(r)},0)}),this.drawer.on("scroll",function(t){e.params.partialRender&&e.drawBuffer(),e.fireEvent("scroll",t)})}},{key:"createBackend",value:function(){var e=this;this.backend&&this.backend.destroy(),"AudioElement"==this.params.backend&&(this.params.backend="MediaElement"),"WebAudio"!=this.params.backend||this.Backend.prototype.supportsWebAudio.call(null)||(this.params.backend="MediaElement"),this.backend=new this.Backend(this.params),this.backend.init(),this.fireEvent("backend-created",this.backend),this.backend.on("finish",function(){return e.fireEvent("finish")}),this.backend.on("play",function(){return e.fireEvent("play")}),this.backend.on("pause",function(){return e.fireEvent("pause")}),this.backend.on("audioprocess",function(t){e.drawer.progress(e.backend.getPlayedPercents()),e.fireEvent("audioprocess",t)})}},{key:"createPeakCache",value:function(){this.params.partialRender&&(this.peakCache=new u.default)}},{key:"getDuration",value:function(){return this.backend.getDuration()}},{key:"getCurrentTime",value:function(){return this.backend.getCurrentTime()}},{key:"setCurrentTime",value:function(e){e>=this.getDuration()?this.seekTo(1):this.seekTo(e/this.getDuration())}},{key:"play",value:function(e,t){var r=this;return this.fireEvent("interaction",function(){return r.play(e,t)}),this.backend.play(e,t)}},{key:"pause",value:function(){if(!this.backend.isPaused())return this.backend.pause()}},{key:"playPause",value:function(){return this.backend.isPaused()?this.play():this.pause()}},{key:"isPlaying",value:function(){return!this.backend.isPaused()}},{key:"skipBackward",value:function(e){this.skip(-e||-this.params.skipLength)}},{key:"skipForward",value:function(e){this.skip(e||this.params.skipLength)}},{key:"skip",value:function(e){var t=this.getDuration()||1,r=this.getCurrentTime()||0;r=Math.max(0,Math.min(t,r+(e||0))),this.seekAndCenter(r/t)}},{key:"seekAndCenter",value:function(e){this.seekTo(e),this.drawer.recenter(e)}},{key:"seekTo",value:function(e){var t=this;if("number"!=typeof e||!isFinite(e)||e<0||e>1)return console.error("Error calling wavesurfer.seekTo, parameter must be a number between 0 and 1!");this.fireEvent("interaction",function(){return t.seekTo(e)});var r=this.backend.isPaused();r||this.backend.pause();var n=this.params.scrollParent;this.params.scrollParent=!1,this.backend.seekTo(e*this.getDuration()),this.drawer.progress(e),r||this.backend.play(),this.params.scrollParent=n,this.fireEvent("seek",e)}},{key:"stop",value:function(){this.pause(),this.seekTo(0),this.drawer.progress(0)}},{key:"setSinkId",value:function(e){return this.backend.setSinkId(e)}},{key:"setVolume",value:function(e){this.backend.setVolume(e),this.fireEvent("volume",e)}},{key:"getVolume",value:function(){return this.backend.getVolume()}},{key:"setPlaybackRate",value:function(e){this.backend.setPlaybackRate(e)}},{key:"getPlaybackRate",value:function(){return this.backend.getPlaybackRate()}},{key:"toggleMute",value:function(){this.setMute(!this.isMuted)}},{key:"setMute",value:function(e){e!==this.isMuted?(e?(this.savedVolume=this.backend.getVolume(),this.backend.setVolume(0),this.isMuted=!0,this.fireEvent("volume",0)):(this.backend.setVolume(this.savedVolume),this.isMuted=!1,this.fireEvent("volume",this.savedVolume)),this.fireEvent("mute",this.isMuted)):this.fireEvent("mute",this.isMuted)}},{key:"getMute",value:function(){return this.isMuted}},{key:"isReady",value:function(){return this.isReady}},{key:"getFilters",value:function(){return this.backend.filters||[]}},{key:"toggleScroll",value:function(){this.params.scrollParent=!this.params.scrollParent,this.drawBuffer()}},{key:"toggleInteraction",value:function(){this.params.interact=!this.params.interact}},{key:"getWaveColor",value:function(){return this.params.waveColor}},{key:"setWaveColor",value:function(e){this.params.waveColor=e,this.drawBuffer()}},{key:"getProgressColor",value:function(){return this.params.progressColor}},{key:"setProgressColor",value:function(e){this.params.progressColor=e,this.drawBuffer()}},{key:"getCursorColor",value:function(){return this.params.cursorColor}},{key:"setCursorColor",value:function(e){this.params.cursorColor=e,this.drawer.updateCursor()}},{key:"getHeight",value:function(){return this.params.height}},{key:"setHeight",value:function(e){this.params.height=e,this.drawer.setHeight(e*this.params.pixelRatio),this.drawBuffer()}},{key:"drawBuffer",value:function(){var e=Math.round(this.getDuration()*this.params.minPxPerSec*this.params.pixelRatio),t=this.drawer.getWidth(),r=e,n=this.drawer.getScrollX(),i=Math.max(n+t,r);this.params.fillParent&&(!this.params.scrollParent||e<t)&&(n=0,i=r=t);var a=void 0;if(this.params.partialRender){var s=this.peakCache.addRangeToPeakCache(r,n,i),o=void 0;for(o=0;o<s.length;o++)a=this.backend.getPeaks(r,s[o][0],s[o][1]),this.drawer.drawPeaks(a,r,s[o][0],s[o][1])}else a=this.backend.getPeaks(r,n,i),this.drawer.drawPeaks(a,r,n,i);this.fireEvent("redraw",a,r)}},{key:"zoom",value:function(e){e?(this.params.minPxPerSec=e,this.params.scrollParent=!0):(this.params.minPxPerSec=this.defaultParams.minPxPerSec,this.params.scrollParent=!1),this.drawBuffer(),this.drawer.progress(this.backend.getPlayedPercents()),this.drawer.recenter(this.getCurrentTime()/this.getDuration()),this.fireEvent("zoom",e)}},{key:"loadArrayBuffer",value:function(e){var t=this;this.decodeArrayBuffer(e,function(e){t.isDestroyed||t.loadDecodedBuffer(e)})}},{key:"loadDecodedBuffer",value:function(e){this.backend.load(e),this.drawBuffer(),this.fireEvent("ready"),this.isReady=!0}},{key:"loadBlob",value:function(e){var t=this,r=new FileReader;r.addEventListener("progress",function(e){return t.onProgress(e)}),r.addEventListener("load",function(e){return t.loadArrayBuffer(e.target.result)}),r.addEventListener("error",function(){return t.fireEvent("error","Error reading file")}),r.readAsArrayBuffer(e),this.empty()}},{key:"load",value:function(e,t,r,n){if(this.empty(),r){var i={"Preload is not 'auto', 'none' or 'metadata'":-1===["auto","metadata","none"].indexOf(r),"Peaks are not provided":!t,"Backend is not of type MediaElement":"MediaElement"!==this.params.backend,"Url is not of type string":"string"!=typeof e},a=Object.keys(i).filter(function(e){return i[e]});a.length&&(console.warn("Preload parameter of wavesurfer.load will be ignored because:\n\t- "+a.join("\n\t- ")),r=null)}switch(this.params.backend){case"WebAudio":return this.loadBuffer(e,t,n);case"MediaElement":return this.loadMediaElement(e,t,r,n)}}},{key:"loadBuffer",value:function(e,t,r){var n=this,i=function(t){return t&&n.tmpEvents.push(n.once("ready",t)),n.getArrayBuffer(e,function(e){return n.loadArrayBuffer(e)})};if(!t)return i();this.backend.setPeaks(t,r),this.drawBuffer(),this.tmpEvents.push(this.once("interaction",i))}},{key:"loadMediaElement",value:function(e,t,r,n){var i=this,a=e;if("string"==typeof e)this.backend.load(a,this.mediaContainer,t,r);else{var s=e;this.backend.loadElt(s,t),a=s.src}this.tmpEvents.push(this.backend.once("canplay",function(){i.drawBuffer(),i.fireEvent("ready"),i.isReady=!0}),this.backend.once("error",function(e){return i.fireEvent("error",e)})),t&&this.backend.setPeaks(t,n),t&&!this.params.forceDecode||!this.backend.supportsWebAudio()||this.getArrayBuffer(a,function(e){i.decodeArrayBuffer(e,function(e){i.backend.buffer=e,i.backend.setPeaks(null),i.drawBuffer(),i.fireEvent("waveform-ready")})})}},{key:"decodeArrayBuffer",value:function(e,t){var r=this;this.arraybuffer=e,this.backend.decodeArrayBuffer(e,function(n){r.isDestroyed||r.arraybuffer!=e||(t(n),r.arraybuffer=null)},function(){return r.fireEvent("error","Error decoding audiobuffer")})}},{key:"getArrayBuffer",value:function(e,t){var r=this,n=i.ajax({url:e,responseType:"arraybuffer",xhr:this.params.xhr});return this.currentAjax=n,this.tmpEvents.push(n.on("progress",function(e){r.onProgress(e)}),n.on("success",function(e,n){t(e),r.currentAjax=null}),n.on("error",function(e){r.fireEvent("error","XHR error: "+e.target.statusText),r.currentAjax=null})),n}},{key:"onProgress",value:function(e){var t=void 0;t=e.lengthComputable?e.loaded/e.total:e.loaded/(e.loaded+1e6),this.fireEvent("loading",Math.round(100*t),e.target)}},{key:"exportPCM",value:function(e,t,r,n){e=e||1024,n=n||0,t=t||1e4,r=r||!1;var i=this.backend.getPeaks(e,n),a=[].map.call(i,function(e){return Math.round(e*t)/t}),s=JSON.stringify(a);return r||window.open("data:application/json;charset=utf-8,"+encodeURIComponent(s)),s}},{key:"exportImage",value:function(e,t){return e||(e="image/png"),t||(t=1),this.drawer.getImage(e,t)}},{key:"cancelAjax",value:function(){this.currentAjax&&(this.currentAjax.xhr.abort(),this.currentAjax=null)}},{key:"clearTmpEvents",value:function(){this.tmpEvents.forEach(function(e){return e.un()})}},{key:"empty",value:function(){this.backend.isPaused()||(this.stop(),this.backend.disconnectSource()),this.cancelAjax(),this.clearTmpEvents(),this.drawer.progress(0),this.drawer.setWidth(0),this.drawer.drawPeaks({length:this.drawer.getWidth()},0)}},{key:"destroy",value:function(){this.destroyAllPlugins(),this.fireEvent("destroy"),this.cancelAjax(),this.clearTmpEvents(),this.unAll(),!1!==this.params.responsive&&(window.removeEventListener("resize",this._onResize,!0),window.removeEventListener("orientationchange",this._onResize,!0)),this.backend.destroy(),this.drawer.destroy(),this.isDestroyed=!0,this.arraybuffer=null}}]),t}();f.util=i,t.default=f,e.exports=t.default}])});
7
+ //# sourceMappingURL=wavesurfer.min.js.map
js/wplc_admin_editor.js ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(function(){
2
+ /*Text editor Support*/
3
+ jQuery("#nifty_tedit_b").click(function(evt){
4
+ evt.stopImmediatePropagation();
5
+ niftyTextEdit("b");
6
+ });
7
+ jQuery("#nifty_tedit_i").click(function(evt){
8
+ evt.stopImmediatePropagation();
9
+ niftyTextEdit("i");
10
+ });
11
+ jQuery("#nifty_tedit_u").click(function(evt){
12
+ evt.stopImmediatePropagation();
13
+ niftyTextEdit("u");
14
+ });
15
+ jQuery("#nifty_tedit_strike").click(function(evt){
16
+ evt.stopImmediatePropagation();
17
+ niftyTextEdit("strike");
18
+ });
19
+ jQuery("#nifty_tedit_mark").click(function(evt){
20
+ evt.stopImmediatePropagation();
21
+ niftyTextEdit("mark");
22
+ });
23
+ jQuery("#nifty_tedit_sub").click(function(evt){
24
+ evt.stopImmediatePropagation();
25
+ niftyTextEdit("sub");
26
+ });
27
+ jQuery("#nifty_tedit_sup").click(function(evt){
28
+ evt.stopImmediatePropagation();
29
+ niftyTextEdit("sup");
30
+ });
31
+ jQuery("#nifty_tedit_link").click(function(evt){
32
+ evt.stopImmediatePropagation();
33
+ niftyTextEdit("link");
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;
114
+ var checkSelection = true;
115
+ function getText(elem) {
116
+ if(checkSelection){
117
+ if(elem !== null && (elem.selectionStart !== null && typeof elem.selectionStart !== 'undefined')){
118
+ if(selectedIndexStart !== elem.selectionStart){
119
+ selectedIndexStart = elem.selectionStart;
120
+ }
121
+ }
122
+
123
+ if(elem !== null && ( typeof elem.selectionEnd !== 'undefined' && elem.selectionEnd !== null)){
124
+ if(selectedIndexEnd !== elem.selectionEnd){
125
+ selectedIndexEnd = elem.selectionEnd;
126
+ }
127
+ }
128
+ //console.log(selectedIndexStart + " - " + selectedIndexEnd);
129
+ //console.log(" - "+ elem.value.substr(selectedIndexStart, selectedIndexEnd));
130
+ }
131
+
132
+ }
133
+
134
+ setInterval(function() {
135
+ getText(document.getElementById("wplc_admin_chatmsg"));
136
+ }, 1000);
137
+
138
+ function niftyTextEdit(insertContent){
139
+ checkSelection = false;
140
+ /*Text editor Code here*/
141
+
142
+ jQuery("#wplc_admin_chatmsg").focus();
143
+
144
+ var current = jQuery("#wplc_admin_chatmsg").val();
145
+
146
+ var pre = current.substr(0, (selectedIndexStart > 0) ? selectedIndexStart : 0);
147
+ var selection = current.substr(selectedIndexStart, selectedIndexEnd - selectedIndexStart);
148
+ var post = current.substr(((selectedIndexEnd < current.length) ? selectedIndexEnd : current.length ), current.length);
149
+
150
+ current = pre + insertContent + ":" + selection + ":" + insertContent + post;
151
+ jQuery("#wplc_admin_chatmsg").val(current);
152
+
153
+ checkSelection = true;
154
+ }
js/wplc_admin_pro.js ADDED
@@ -0,0 +1,350 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ jQuery(function() {
3
+
4
+
5
+
6
+
7
+
8
+ if(jQuery("input[type=radio][name='wplc_mail_type']:checked").val() === "php_mailer"){
9
+ jQuery("#wplc_smtp_details").show();
10
+ } else {
11
+ jQuery("#wplc_smtp_details").hide();
12
+ }
13
+
14
+ jQuery('.wplc_mail_type_radio').click(
15
+ function(e){
16
+ if (jQuery(this).is(':checked') && jQuery(this).val() === "php_mailer"){
17
+ jQuery("#wplc_smtp_details").show();
18
+ } else {
19
+ jQuery("#wplc_smtp_details").hide();
20
+ }
21
+ });
22
+
23
+ jQuery("#wplc_localization_warning").hide()
24
+ if(jQuery("#wplc_using_localization_plugin").is(":checked")){
25
+ jQuery(".wplc_localization_strings").hide();
26
+ jQuery("#wplc_localization_warning").show()
27
+ }
28
+ jQuery('#wplc_using_localization_plugin').click(
29
+ function(e){
30
+ if (jQuery(this).is(':checked')){
31
+ jQuery(".wplc_localization_strings").hide();
32
+ jQuery("#wplc_localization_warning").show();
33
+ } else {
34
+ jQuery(".wplc_localization_strings").show();
35
+ jQuery("#wplc_localization_warning").hide();
36
+ }
37
+ });
38
+
39
+ if(typeof tooltip != 'undefined'){
40
+ if(typeof jQuery(".wplc_settings_tooltip") != 'undefined'){
41
+ jQuery(function () {
42
+ jQuery(".wplc_settings_tooltip").tooltip({
43
+ position: {my: "left+15 center", at: "right center"}
44
+ });
45
+ });
46
+ }
47
+ }
48
+
49
+ if(typeof jQuery("#wplc_visitor_accordion") != 'undefined'){
50
+ jQuery("#wplc_visitor_accordion").accordion({heightStyle: "content"});
51
+ }
52
+
53
+ jQuery(".wplc_hide_input").hide();
54
+
55
+ jQuery("#wplc_animation_1").click(function() {
56
+ jQuery("#wplc_rb_animation_1").attr('checked', true);
57
+ jQuery("#wplc_rb_animation_2").attr('checked', false);
58
+ jQuery("#wplc_rb_animation_3").attr('checked', false);
59
+ jQuery("#wplc_rb_animation_4").attr('checked', false);
60
+ jQuery("#wplc_animation_1").addClass("wplc_animation_active");
61
+ jQuery("#wplc_animation_2").removeClass("wplc_animation_active");
62
+ jQuery("#wplc_animation_3").removeClass("wplc_animation_active");
63
+ jQuery("#wplc_animation_4").removeClass("wplc_animation_active");
64
+ });
65
+
66
+ jQuery("#wplc_animation_2").click(function() {
67
+ jQuery("#wplc_rb_animation_1").attr('checked', false);
68
+ jQuery("#wplc_rb_animation_2").attr('checked', true);
69
+ jQuery("#wplc_rb_animation_3").attr('checked', false);
70
+ jQuery("#wplc_rb_animation_4").attr('checked', false);
71
+ jQuery("#wplc_animation_1").removeClass("wplc_animation_active");
72
+ jQuery("#wplc_animation_2").addClass("wplc_animation_active");
73
+ jQuery("#wplc_animation_3").removeClass("wplc_animation_active");
74
+ jQuery("#wplc_animation_4").removeClass("wplc_animation_active");
75
+ });
76
+
77
+ jQuery("#wplc_animation_3").click(function() {
78
+ jQuery("#wplc_rb_animation_1").attr('checked', false);
79
+ jQuery("#wplc_rb_animation_2").attr('checked', false);
80
+ jQuery("#wplc_rb_animation_3").attr('checked', true);
81
+ jQuery("#wplc_rb_animation_4").attr('checked', false);
82
+ jQuery("#wplc_animation_1").removeClass("wplc_animation_active");
83
+ jQuery("#wplc_animation_2").removeClass("wplc_animation_active");
84
+ jQuery("#wplc_animation_3").addClass("wplc_animation_active");
85
+ jQuery("#wplc_animation_4").removeClass("wplc_animation_active");
86
+ });
87
+
88
+ jQuery("#wplc_animation_4").click(function() {
89
+ jQuery("#wplc_rb_animation_1").attr('checked', false);
90
+ jQuery("#wplc_rb_animation_2").attr('checked', false);
91
+ jQuery("#wplc_rb_animation_3").attr('checked', false);
92
+ jQuery("#wplc_rb_animation_4").attr('checked', true);
93
+ jQuery("#wplc_animation_1").removeClass("wplc_animation_active");
94
+ jQuery("#wplc_animation_2").removeClass("wplc_animation_active");
95
+ jQuery("#wplc_animation_3").removeClass("wplc_animation_active");
96
+ jQuery("#wplc_animation_4").addClass("wplc_animation_active");
97
+ });
98
+
99
+
100
+ /* Themes */
101
+
102
+ jQuery("#wplc_theme_1").click(function() {
103
+ jQuery("#wplc_rb_theme_1").attr('checked', true);
104
+ jQuery("#wplc_rb_theme_2").attr('checked', false);
105
+ jQuery("#wplc_rb_theme_3").attr('checked', false);
106
+ jQuery("#wplc_rb_theme_4").attr('checked', false);
107
+ jQuery("#wplc_rb_theme_5").attr('checked', false);
108
+ jQuery("#wplc_rb_theme_6").attr('checked', false);
109
+ jQuery("#wplc_theme_1").addClass("wplc_theme_active");
110
+ jQuery("#wplc_theme_2").removeClass("wplc_theme_active");
111
+ jQuery("#wplc_theme_3").removeClass("wplc_theme_active");
112
+ jQuery("#wplc_theme_4").removeClass("wplc_theme_active");
113
+ jQuery("#wplc_theme_5").removeClass("wplc_theme_active");
114
+ jQuery("#wplc_theme_6").removeClass("wplc_theme_active");
115
+ });
116
+
117
+ jQuery("#wplc_theme_2").click(function() {
118
+ jQuery("#wplc_rb_theme_1").attr('checked', false);
119
+ jQuery("#wplc_rb_theme_2").attr('checked', true);
120
+ jQuery("#wplc_rb_theme_3").attr('checked', false);
121
+ jQuery("#wplc_rb_theme_4").attr('checked', false);
122
+ jQuery("#wplc_rb_theme_5").attr('checked', false);
123
+ jQuery("#wplc_rb_theme_6").attr('checked', false);
124
+ jQuery("#wplc_theme_1").removeClass("wplc_theme_active");
125
+ jQuery("#wplc_theme_2").addClass("wplc_theme_active");
126
+ jQuery("#wplc_theme_3").removeClass("wplc_theme_active");
127
+ jQuery("#wplc_theme_4").removeClass("wplc_theme_active");
128
+ jQuery("#wplc_theme_5").removeClass("wplc_theme_active");
129
+ jQuery("#wplc_theme_6").removeClass("wplc_theme_active");
130
+ });
131
+
132
+ jQuery("#wplc_theme_3").click(function() {
133
+ jQuery("#wplc_rb_theme_1").attr('checked', false);
134
+ jQuery("#wplc_rb_theme_2").attr('checked', false);
135
+ jQuery("#wplc_rb_theme_3").attr('checked', true);
136
+ jQuery("#wplc_rb_theme_4").attr('checked', false);
137
+ jQuery("#wplc_rb_theme_5").attr('checked', false);
138
+ jQuery("#wplc_rb_theme_6").attr('checked', false);
139
+ jQuery("#wplc_theme_1").removeClass("wplc_theme_active");
140
+ jQuery("#wplc_theme_2").removeClass("wplc_theme_active");
141
+ jQuery("#wplc_theme_3").addClass("wplc_theme_active");
142
+ jQuery("#wplc_theme_4").removeClass("wplc_theme_active");
143
+ jQuery("#wplc_theme_5").removeClass("wplc_theme_active");
144
+ jQuery("#wplc_theme_6").removeClass("wplc_theme_active");
145
+ });
146
+
147
+ jQuery("#wplc_theme_4").click(function() {
148
+ jQuery("#wplc_rb_theme_1").attr('checked', false);
149
+ jQuery("#wplc_rb_theme_2").attr('checked', false);
150
+ jQuery("#wplc_rb_theme_3").attr('checked', false);
151
+ jQuery("#wplc_rb_theme_4").attr('checked', true);
152
+ jQuery("#wplc_rb_theme_5").attr('checked', false);
153
+ jQuery("#wplc_rb_theme_6").attr('checked', false);
154
+ jQuery("#wplc_theme_1").removeClass("wplc_theme_active");
155
+ jQuery("#wplc_theme_2").removeClass("wplc_theme_active");
156
+ jQuery("#wplc_theme_3").removeClass("wplc_theme_active");
157
+ jQuery("#wplc_theme_4").addClass("wplc_theme_active");
158
+ jQuery("#wplc_theme_5").removeClass("wplc_theme_active");
159
+ jQuery("#wplc_theme_6").removeClass("wplc_theme_active");
160
+ });
161
+
162
+ jQuery("#wplc_theme_5").click(function() {
163
+ jQuery("#wplc_rb_theme_1").attr('checked', false);
164
+ jQuery("#wplc_rb_theme_2").attr('checked', false);
165
+ jQuery("#wplc_rb_theme_3").attr('checked', false);
166
+ jQuery("#wplc_rb_theme_4").attr('checked', false);
167
+ jQuery("#wplc_rb_theme_5").attr('checked', true);
168
+ jQuery("#wplc_rb_theme_6").attr('checked', false);
169
+ jQuery("#wplc_theme_1").removeClass("wplc_theme_active");
170
+ jQuery("#wplc_theme_2").removeClass("wplc_theme_active");
171
+ jQuery("#wplc_theme_3").removeClass("wplc_theme_active");
172
+ jQuery("#wplc_theme_4").removeClass("wplc_theme_active");
173
+ jQuery("#wplc_theme_5").addClass("wplc_theme_active");
174
+ jQuery("#wplc_theme_6").removeClass("wplc_theme_active");
175
+ });
176
+
177
+ jQuery("#wplc_theme_6").click(function() {
178
+ jQuery("#wplc_rb_theme_1").attr('checked', false);
179
+ jQuery("#wplc_rb_theme_2").attr('checked', false);
180
+ jQuery("#wplc_rb_theme_3").attr('checked', false);
181
+ jQuery("#wplc_rb_theme_4").attr('checked', false);
182
+ jQuery("#wplc_rb_theme_5").attr('checked', false);
183
+ jQuery("#wplc_rb_theme_6").attr('checked', true);
184
+ jQuery("#wplc_theme_1").removeClass("wplc_theme_active");
185
+ jQuery("#wplc_theme_2").removeClass("wplc_theme_active");
186
+ jQuery("#wplc_theme_3").removeClass("wplc_theme_active");
187
+ jQuery("#wplc_theme_4").removeClass("wplc_theme_active");
188
+ jQuery("#wplc_theme_5").removeClass("wplc_theme_active");
189
+ jQuery("#wplc_theme_6").addClass("wplc_theme_active");
190
+ });
191
+ var wplc_agent_status = jQuery("#wplc_agent_status").attr('checked');
192
+
193
+ if(wplc_agent_status === 'checked'){
194
+ jQuery("#wplc_agent_status_text").html(wplc_admin_strings.accepting_chats);
195
+ } else {
196
+ jQuery("#wplc_agent_status_text").html(wplc_admin_strings.not_accepting_chats);
197
+ }
198
+
199
+
200
+ jQuery(".wplc_history_rating").each(function() {
201
+ var wplc_score = jQuery(this).attr('rating');
202
+ if(wplc_score === '0'){
203
+ jQuery(this).html(wplc_ce_rating_message);
204
+ } else {
205
+ jQuery(this).raty({
206
+ path: wplc_ce_url,
207
+ score: wplc_score,
208
+ readOnly: true
209
+ });
210
+ }
211
+ });
212
+
213
+ /* Make sure switchery has been loaded on this page */
214
+ if(typeof Switchery !== 'undefined'){
215
+ var wplc_switchery_element = document.querySelector('.wplc_switchery');
216
+ /* Make sure that the switch is being displayed */
217
+ if(wplc_switchery_element !== null){
218
+
219
+ var wplc_switchery_init = new Switchery(wplc_switchery_element, { color: '#00B344', secondaryColor: '#D91600': size: 'small' });
220
+
221
+ var changeCheckbox = document.querySelector('#wplc_agent_status');
222
+
223
+ changeCheckbox.onchange = function () {
224
+
225
+ var wplc_accepting_chats = jQuery(this).attr('checked');
226
+
227
+ if(wplc_accepting_chats === 'checked'){
228
+ jQuery("#wplc_agent_status_text").html(wplc_admin_strings.accepting_chats);
229
+ var wplc_ma_set_transient = null;
230
+
231
+ wplc_ma_set_transient = setInterval(function (){wplc_ma_update_agent_transient();}, 60000);
232
+
233
+ function wplc_ma_update_agent_transient() {
234
+ var data = {
235
+ action: 'wplc_ma_set_transient',
236
+ security: wplc_admin_strings.nonce,
237
+ user_id: wplc_admin_strings.user_id
238
+ };
239
+ jQuery.post(ajaxurl, data, function(response) {
240
+ location.reload(true);
241
+ });
242
+ }
243
+
244
+ wplc_ma_update_agent_transient();
245
+
246
+ } else {
247
+ jQuery("#wplc_agent_status_text").html(wplc_admin_strings.not_accepting_chats);
248
+
249
+ var wplc_ma_remove_transient = null;
250
+
251
+ wplc_ma_remove_transient = setInterval(function (){wplc_ma_remove_agent_transient();}, 60000);
252
+
253
+
254
+ function wplc_ma_remove_agent_transient() {
255
+ var data = {
256
+ action: 'wplc_ma_remove_transient',
257
+ security: wplc_admin_strings.nonce,
258
+ user_id: wplc_admin_strings.user_id
259
+ };
260
+ jQuery.post(ajaxurl, data, function(response) {
261
+ location.reload(true);
262
+ });
263
+ }
264
+
265
+ wplc_ma_remove_agent_transient();
266
+
267
+ }
268
+ };
269
+ }
270
+ }
271
+
272
+ jQuery("body").on("click", "#wplc_add_agent", function(e) {
273
+
274
+ var uid = parseInt(jQuery("#wplc_agent_select").val());
275
+ var em = jQuery("#wplc_selected_agent_"+uid).attr('em');
276
+ var em2 = jQuery("#wplc_selected_agent_"+uid).attr('em2');
277
+ var name = jQuery("#wplc_selected_agent_"+uid).attr('name');
278
+
279
+ if (uid) {
280
+ var data = {
281
+ action: 'wplc_add_agent',
282
+ security: wplc_admin_strings.nonce,
283
+ uid: uid
284
+ };
285
+ jQuery.post(ajaxurl, data, function(response) {
286
+ if (response === "1") {
287
+ /* success */
288
+ var wplchtml = "<li id=\"wplc_agent_li_"+uid+"\"><p><img src=\"//www.gravatar.com/avatar/"+em+"?s=80&d=mm\"></p><h3>"+name+"</h3><small>"+em2+"</small><p><button class='button button-secondary' id='wplc_remove_agent' uid='"+uid+"'>"+wplc_admin_strings.remove_agent+"</button></p></li>"
289
+ jQuery(wplchtml).insertBefore("#wplc_add_new_agent_box").hide().fadeIn(2000);
290
+ jQuery("#wplc_selected_agent_"+uid).remove();
291
+ } else {
292
+ /* failure */
293
+ }
294
+ });
295
+ }
296
+ e.preventDefault();
297
+
298
+
299
+ });
300
+
301
+ jQuery("body").on("click", ".wplc_remove_agent", function(e) {
302
+
303
+ var uid = parseInt(jQuery(this).attr('uid'));
304
+
305
+ if (uid) {
306
+ var data = {
307
+ action: 'wplc_remove_agent',
308
+ security: wplc_admin_strings.nonce,
309
+ uid: uid
310
+ };
311
+ jQuery.post(ajaxurl, data, function(response) {
312
+ if (response === "1") {
313
+ /* success */
314
+
315
+ jQuery("#wplc_agent_li_"+uid).fadeOut(500);
316
+ } else {
317
+ /* failure */
318
+ }
319
+ });
320
+ }
321
+ e.preventDefault();
322
+
323
+
324
+ });
325
+
326
+ jQuery("body").on("click", "#wplc_use_external_server", function(){
327
+ if(jQuery("#wplc_use_external_server").is(":checked")){
328
+ var data = {
329
+ action: 'wplc_use_external_server',
330
+ security: wplc_admin_strings.nonce,
331
+ api_key: jQuery("#wplc_api_key").val(),
332
+ status: '1'
333
+ };
334
+ jQuery.post(ajaxurl, data, function(response) {
335
+ jQuery("#external_server_message").html("<p class='description'>You are now using WP Live Chat Support\'s chat server to host your chats</p>");
336
+ });
337
+ } else {
338
+ var data = {
339
+ action: 'wplc_use_external_server',
340
+ security: wplc_admin_strings.nonce,
341
+ api_key: jQuery("#wplc_api_key").val(),
342
+ status: '0'
343
+ };
344
+ jQuery.post(ajaxurl, data, function(response) {
345
+ jQuery("#external_server_message").html("<p class='description'>You are now using your own website as a chat server to host your chats</p>");
346
+ });
347
+ }
348
+ });
349
+
350
+ });
js/wplc_admin_pro_events.js ADDED
@@ -0,0 +1,319 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var init_chat_success_timeout = {};
2
+
3
+ //jQuery(function(){
4
+ jQuery(document).on("bleeper_dom_ready", function(e) {
5
+
6
+
7
+ /**
8
+ * Get unread message counts for agent to agent chats
9
+ */
10
+ wplc_get_unread_agent_message_counts();
11
+
12
+
13
+ /**
14
+ * Build the list of agents
15
+ */
16
+ for (l in wplc_agent_data) {
17
+ if (parseInt(l) === parseInt(agent_id)) {
18
+ wplc_c = 'online';
19
+ t_ag_cid = nifty_api_key+''+parseInt(agent_id)+''+parseInt(agent_id);
20
+ t_ag_cid = md5(t_ag_cid);
21
+
22
+ } else {
23
+ wplc_c = 'offline';
24
+ t_ag_cid = nifty_api_key+''+Math.min(parseInt(agent_id), parseInt(l))+''+Math.max(parseInt(agent_id), parseInt(l));
25
+ t_ag_cid = md5(t_ag_cid);
26
+
27
+ }
28
+ jQuery('<li/>', {
29
+ 'class': 'online_agent online_agent_'+l,
30
+ 'id': t_ag_cid,
31
+ 'aid': l,
32
+ html: '<span class="online_offline '+wplc_c+'"></span> <span class="ag_t_span_'+l+'">'+wplc_agent_data[l].name+'</span> <br/>'
33
+ }).appendTo(".online_agent_list");
34
+
35
+ //socket.emit('chat accepted',{chatid: t_ag_cid,agent_id:l,agent_name:wplc_agent_data[l].name});
36
+
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 = {
44
+ security: wplc_nonce,
45
+ cid: new_chat_id
46
+ };
47
+ if(new_chat_id !== false){
48
+ setTimeout(function(){
49
+ wplc_rest_api('get_custom_field_info', data, 12000, function(content_returned) {
50
+ if(typeof content_returned !== "undefined"){
51
+ if(typeof content_returned['code'] !== "undefined" && content_returned['code'] === "200"){
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
+ }
61
+ }
62
+ }
63
+ });
64
+ },1000);
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,
72
+ rel: e.ndata.chatid,
73
+ security: wplc_nonce,
74
+ };
75
+ wplc_rest_api('initiate_chat', data, 12000, function (results) {});
76
+
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
+
122
+ //nc_clear_action_col_visitor_row(tmp_chatid);
123
+
124
+ if(tmp_chatid !== false){
125
+ jQuery('<div/>', {
126
+ 'class': 'vcol visActionCol',
127
+ html: "<a href='javascript:void(0);' class='init_chat init_chat_"+tmp_chatid+" btn btn-info pull-right' cid='"+ tmp_chatid +"'>Initiate Chat</a>"
128
+ }).appendTo('#vis'+ tmp_chatid);
129
+ }
130
+ });
131
+
132
+ jQuery("body").on("change","#wplc_field_type", function() {
133
+
134
+ var selection = jQuery(this).val();
135
+
136
+ if( selection == '1' ){
137
+ jQuery("#wplc_field_value_dropdown_row").show();
138
+ jQuery("#wplc_field_value_row").hide();
139
+ } else {
140
+ jQuery("#wplc_field_value_dropdown_row").hide();
141
+ jQuery("#wplc_field_value_row").show();
142
+ }
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/>', {
150
+ 'class': '',
151
+ html: "<a href='javascript:void(0);' class='init_chat btn btn-info pull-right' cid='"+ e.cid +"'>Initiate Chat</a>"
152
+ }).appendTo('#vis'+e.cid + ' .visActionCol');
153
+ }
154
+ });
155
+
156
+ /**
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
164
+ var items = (e.event.clipboardData || e.event.originalEvent.clipboardData).items;
165
+ // find pasted image among pasted items
166
+ var blob = null;
167
+ for (var i = 0; i < items.length; i++) {
168
+ if (items[i].type.indexOf("image") === 0) {
169
+ blob = items[i].getAsFile();
170
+ }
171
+ }
172
+ // load image if there is a pasted image
173
+ if (blob !== null) {
174
+ var reader = new FileReader();
175
+ reader.onload = function(event) {
176
+ document.getElementById("inputMessage").value = "####"+event.target.result+"####";
177
+ jQuery("#wplc_send_msg").click();
178
+
179
+ };
180
+ reader.readAsDataURL(blob);
181
+ }
182
+ });
183
+
184
+
185
+ /**
186
+ * Default typing preview functionality
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
+
228
+ /**
229
+ * Default typing display functionality
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
+
249
+ /**
250
+ * Clearing of the typing message
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;
265
+ var current_cid = e.ndata.chatid;
266
+ var current_msg_id = e.ndata.msgID;
267
+
268
+ var data = {
269
+ chat_id: current_cid,
270
+ message: current_msg,
271
+ msg_id: current_msg_id
272
+
273
+ };
274
+ wplc_rest_api('edit_message', data, 12000, null);
275
+ }
276
+ }
277
+ });
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
+
289
+ });
290
+
291
+
292
+ var wplc_get_unread_agent_message_counts = function() {
293
+ var data = {
294
+ agent_id: agent_id,
295
+ security: wplc_nonce,
296
+ };
297
+ wplc_rest_api('get_agent_unread_message_counts', data, 12000, function (results) {
298
+ if (typeof results === "object" && results.response === "Unread count agents") {
299
+ for (k in results.data) {
300
+ if (parseInt(results.data[k]) > 0) {
301
+ jQuery('<p/>', {
302
+ 'class': 'unread_count',
303
+ html: ""+results.data[k]+""
304
+ }).appendTo('.online_agent_'+ k);
305
+ jQuery(".online_agent_"+k).addClass('newmessage');
306
+
307
+ /**
308
+ * Add the qty to the unread_count variable
309
+ */
310
+ var tcid = jQuery('.online_agent_'+ k).attr('id');
311
+ unread_count[tcid] = parseInt( results.data[k] );
312
+ }
313
+
314
+
315
+ }
316
+ }
317
+ });
318
+
319
+ }
js/wplc_admin_pro_features.js ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var wplc_is_typing = false;
2
+ var wplc_searchTimeout;
3
+
4
+
5
+ jQuery(function () {
6
+
7
+
8
+
9
+ jQuery("body").on("keydown","#wplc_admin_chatmsg", function(e) {
10
+ if(typeof wplc_node_sockets_ready === "undefined" || wplc_node_sockets_ready === false){
11
+ if (e.which <= 90 && e.which >= 48) {
12
+ if (wplc_is_typing) {
13
+ wplc_renew_typing();
14
+ return; /* user already typing */
15
+ }
16
+ wplc_is_typing = true;
17
+
18
+ wplc_searchTimeout = setTimeout(wplc_clear_typing, 3000);
19
+ wplc_usertyping('admin',Math.floor(Date.now() / 1000),cid);
20
+ }
21
+ }
22
+ });
23
+
24
+ jQuery("body").on("click", "#wplc_admin_send_msg", function() {
25
+ if (wplc_is_typing) { wplc_clear_typing(); }
26
+ });
27
+
28
+ function wplc_renew_typing() {
29
+ clearTimeout(wplc_searchTimeout);
30
+ wplc_searchTimeout = setTimeout(wplc_clear_typing, 3000);
31
+ }
32
+ function wplc_clear_typing() {
33
+ wplc_is_typing = false;
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 = {
40
+ action: 'wplc_typing',
41
+ security: wplc_ajax_nonce,
42
+ user: wplc_typing_user,
43
+ type: wplc_typing_type,
44
+ cid: wplc_typing_cid,
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? */
57
+ }
58
+ }
59
+
60
+ });
js/wplc_bleeper_admin_events.js ADDED
@@ -0,0 +1,229 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Custom data trigger
3
+ *
4
+ * If custom data is sent through the socket, this is where you would want to handle it
5
+ *
6
+ * @return void
7
+ */
8
+ jQuery(document).on("bleeper_custom_data_received", function(e) {
9
+ if (typeof e.ndata !== "undefined") {
10
+
11
+ if (e.ndata.action === "send_user_canvas") {
12
+ if (active_chatid === e.ndata.chatid) {
13
+ the_message = wplc_generate_system_notification_object("<img style='max-width:400px;' src='"+e.ndata.ndata+"' />", {}, 0);
14
+ wplc_push_message_to_chatbox(the_message,'a', function() {
15
+ wplc_scroll_to_bottom();
16
+ });
17
+ }
18
+ }
19
+ if (e.ndata.action === "input_field_change") {
20
+ if (typeof e.ndata.ndata.fields !== "undefined") { var fields = e.ndata.ndata.fields; } else { var fields = false; }
21
+ if( fields ){
22
+ bleeper_save_event(e.ndata.chatid, 'fa-edit', "User has selected a form input field. ", e.ndata);
23
+
24
+ }
25
+
26
+ }
27
+ if (e.ndata.action === "send_link_click") {
28
+ if (typeof e.ndata.ndata.link_click !== "undefined") { var link_click = e.ndata.ndata.link_click; } else { var link_click = false; }
29
+ if( link_click ){
30
+ bleeper_save_event(e.ndata.chatid, 'fa-link', "User has clicked a link ("+e.ndata.ndata.text+"). ", e.ndata);
31
+
32
+ }
33
+
34
+ }
35
+
36
+ if(e.ndata.action === "wplc_minimized") {
37
+ bleeper_save_event(e.ndata.chatid, "fa-caret-square-o-down", "User minimized the chat box", e.ndata);
38
+ the_message = wplc_generate_system_notification_object("User minimized the chat box", {}, 0);
39
+ bleeper_add_message_to_sessionStorage(e.ndata.chatid, the_message);
40
+ }
41
+
42
+ if(e.ndata.action === "wplc_maximized") {
43
+ bleeper_save_event(e.ndata.chatid, "fa-caret-square-o-up ", "User maximized the chat box", e.ndata);
44
+ the_message = wplc_generate_system_notification_object("User maximized the chat box", {}, 0);
45
+ bleeper_add_message_to_sessionStorage(e.ndata.chatid, the_message);
46
+ }
47
+
48
+
49
+ if (e.ndata.action === "send_user_click_data") {
50
+ if (typeof e.ndata.ndata.elem_class !== "undefined") { var elem_class = "."+e.ndata.ndata.elem_class; } else { var elem_class = ''; }
51
+ if (typeof e.ndata.ndata.elem_id !== "undefined") { var elem_id = " #"+e.ndata.ndata.elem_id; } else { var elem_id = ''; }
52
+ var elem_msg = '';
53
+ if (elem_class === "" && elem_id === "") {
54
+ elem_msg = "(no class or ID).";
55
+ } else {
56
+ elem_msg = "("+elem_class+""+elem_id+").";
57
+ }
58
+
59
+ bleeper_save_event(e.ndata.chatid, 'fa-mouse-pointer', "User clicked on an element "+elem_msg, e.ndata);
60
+
61
+ //if (active_chatid === e.ndata.chatid) {
62
+ //the_message = wplc_generate_system_notification_object("User clicked on an element (Class: "+elem_class+", ID: "+elem_id+")", {}, 0);
63
+ //wplc_push_message_to_chatbox(the_message,'a', function() {
64
+ //wplc_scroll_to_bottom();
65
+ //});
66
+ //}
67
+
68
+ }
69
+
70
+ if (e.ndata.action === "send_user_mouse_idling") {
71
+ if (typeof e.ndata.ndata.idle !== "undefined") { var idling = e.ndata.ndata.idle; } else { var idling = false; }
72
+ if( idling ){
73
+ bleeper_save_event(e.ndata.chatid, 'fa-minus', "User is now idling. ", e.ndata);
74
+
75
+ /*if (active_chatid === e.ndata.chatid) {
76
+ the_message = wplc_generate_system_notification_object("User is now idling", {}, 0);
77
+ wplc_push_message_to_chatbox(the_message,'a', function() {
78
+ wplc_scroll_to_bottom();
79
+ });
80
+ }*/
81
+ }
82
+
83
+ }
84
+
85
+ if (e.ndata.action === "send_user_right_clicked") {
86
+ if (typeof e.ndata.ndata.right_clicked !== "undefined") { var right_clicked = e.ndata.ndata.right_clicked; } else { var right_clicked = false; }
87
+ if( right_clicked ){
88
+ bleeper_save_event(e.ndata.chatid, 'fa-list', "User has right clicked on the page. ", e.ndata);
89
+ /*if (active_chatid === e.ndata.chatid) {
90
+ the_message = wplc_generate_system_notification_object("User has right clicked on the page", {}, 0);
91
+ wplc_push_message_to_chatbox(the_message,'a', function() {
92
+ wplc_scroll_to_bottom();
93
+ });
94
+ }*/
95
+ }
96
+
97
+ }
98
+
99
+ if (e.ndata.action === "send_user_ctrl_f") {
100
+ if (typeof e.ndata.ndata.ctrl_f !== "undefined") { var ctrl_f = e.ndata.ndata.ctrl_f; } else { var ctrl_f = false; }
101
+ if( ctrl_f ){
102
+ bleeper_save_event(e.ndata.chatid, 'fa-search', "User has pressed CTRL + F", e.ndata);
103
+ /*
104
+ if (active_chatid === e.ndata.chatid) {
105
+ the_message = wplc_generate_system_notification_object("User has pressed CTRL + F", {}, 0);
106
+ wplc_push_message_to_chatbox(the_message,'a', function() {
107
+ wplc_scroll_to_bottom();
108
+ });
109
+ }*/
110
+ }
111
+
112
+ }
113
+
114
+ if (e.ndata.action === "send_user_ctrl_p") {
115
+ if (typeof e.ndata.ndata.ctrl_p !== "undefined") { var ctrl_p = e.ndata.ndata.ctrl_p; } else { var ctrl_p = false; }
116
+ if( ctrl_p ){
117
+ bleeper_save_event(e.ndata.chatid, 'fa-print', "User has pressed CTRL + P", e.ndata);
118
+ /*if (active_chatid === e.ndata.chatid) {
119
+ the_message = wplc_generate_system_notification_object("User has pressed CTRL + P", {}, 0);
120
+ wplc_push_message_to_chatbox(the_message,'a', function() {
121
+ wplc_scroll_to_bottom();
122
+ });
123
+ }*/
124
+ }
125
+
126
+ }
127
+
128
+ if (e.ndata.action === "send_user_ctrl_c") {
129
+ if (typeof e.ndata.ndata.ctrl_c !== "undefined") { var ctrl_c = e.ndata.ndata.ctrl_c; } else { var ctrl_c = false; }
130
+ if( ctrl_c ){
131
+ bleeper_save_event(e.ndata.chatid, 'fa-copy', "User has pressed CTRL + C", e.ndata);
132
+ /*if (active_chatid === e.ndata.chatid) {
133
+ the_message = wplc_generate_system_notification_object("User has pressed CTRL + C", {}, 0);
134
+ wplc_push_message_to_chatbox(the_message,'a', function() {
135
+ wplc_scroll_to_bottom();
136
+ });
137
+ }*/
138
+ }
139
+
140
+ }
141
+
142
+ if (e.ndata.action === "send_user_ctrl_v") {
143
+ if (typeof e.ndata.ndata.ctrl_v !== "undefined") { var ctrl_v = e.ndata.ndata.ctrl_v; } else { var ctrl_v = false; }
144
+ if( ctrl_v ){
145
+ bleeper_save_event(e.ndata.chatid, 'fa-paste', "User has pressed CTRL + V", e.ndata);
146
+ /*
147
+ if (active_chatid === e.ndata.chatid) {
148
+ the_message = wplc_generate_system_notification_object("User has pressed CTRL + V", {}, 0);
149
+ wplc_push_message_to_chatbox(the_message,'a', function() {
150
+ wplc_scroll_to_bottom();
151
+ });
152
+ }*/
153
+ }
154
+
155
+ }
156
+
157
+ if (e.ndata.action === "send_user_console_opened") {
158
+ if (typeof e.ndata.ndata.console_log_opened !== "undefined") { var console_log_opened = e.ndata.ndata.console_log_opened; } else { var console_log_opened = false; }
159
+ if( console_log_opened ){
160
+ bleeper_save_event(e.ndata.chatid, 'fa-bug', "User has opened the window inspector", e.ndata);
161
+ /*
162
+ if (active_chatid === e.ndata.chatid) {
163
+ the_message = wplc_generate_system_notification_object("User has opened the window inspector", {}, 0);
164
+ wplc_push_message_to_chatbox(the_message,'a', function() {
165
+ wplc_scroll_to_bottom();
166
+ });
167
+ }*/
168
+ }
169
+
170
+ }
171
+
172
+ if (e.ndata.action === "send_user_section_selected") {
173
+ if (typeof e.ndata.ndata.html_element !== "undefined") { var html_element = e.ndata.ndata.html_element; } else { var html_element = false; }
174
+ if( html_element ){
175
+ bleeper_save_event(e.ndata.chatid, 'fa-text-width', "User has selected the following element: "+html_element, e.ndata);
176
+
177
+ /*
178
+ if (active_chatid === e.ndata.chatid) {
179
+ the_message = wplc_generate_system_notification_object("User has selected the following element: "+html_element, {}, 0);
180
+ wplc_push_message_to_chatbox(the_message,'a', function() {
181
+ wplc_scroll_to_bottom();
182
+ });
183
+ }*/
184
+ }
185
+
186
+ }
187
+
188
+ if (e.ndata.action === "user_scrolling") {
189
+ if (typeof e.ndata.ndata.scrolling !== "undefined") { var scrolling = e.ndata.ndata.scrolling; } else { var scrolling = false; }
190
+ if( scrolling ){
191
+ bleeper_save_event(e.ndata.chatid, 'fa-arrows-v', "User has scrolled on the page", e.ndata);
192
+
193
+ /*
194
+ if (active_chatid === e.ndata.chatid) {
195
+ the_message = wplc_generate_system_notification_object("User has scrolled on the page", {}, 0);
196
+ wplc_push_message_to_chatbox(the_message,'a', function() {
197
+ wplc_scroll_to_bottom();
198
+ });
199
+ }*/
200
+ }
201
+
202
+ }
203
+
204
+ if(e.ndata.action === "wplc_send_live_rating") {
205
+ if(typeof e.ndata.rating_data !== "undefined"){
206
+ //Rating data received
207
+ if(typeof e.ndata.rating_data.score !== "undefined"){
208
+ var rating_score = parseInt(e.ndata.rating_data.score);
209
+ var rating_comment = typeof e.ndata.rating_data.comment !== "undefined" ? e.ndata.rating_data.comment : "No Comment...";
210
+
211
+ var rating_icon = rating_score === 0 ? "fa-thumbs-o-down" : "fa-thumbs-o-up";
212
+ bleeper_save_event(e.ndata.chatid, rating_icon, "User left a rating: " + rating_comment, e.ndata);
213
+
214
+ the_message = wplc_generate_system_notification_object("User left a " + (rating_score === 0 ? "negative" : "positive") + " rating: " + rating_comment, {}, 0);
215
+
216
+ bleeper_add_message_to_sessionStorage(e.ndata.chatid, the_message);
217
+
218
+ if (e.ndata.chatid === active_chatid) {
219
+ wplc_push_message_to_chatbox(the_message,'a', function() {
220
+ jQuery.event.trigger({type: "bleeper_scroll_bottom"});
221
+ });
222
+ }
223
+ }
224
+ }
225
+ }
226
+
227
+
228
+ }
229
+ });
js/wplc_choose.js ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var wplc_online_agent_count = 0;
2
+
3
+ jQuery(function() {
4
+ wplc_choose_delegate();
5
+ });
6
+
7
+ jQuery(document).on("bleeper_dom_ready", function(e) {
8
+ wplc_choose_delegate();
9
+
10
+ /**
11
+ * New agent connected
12
+ */
13
+ jQuery(document).on("bleeper_agent_connected", function(e) {
14
+ wplc_ma_update_admin_bar(1, "event one"); //Add one agent
15
+ });
16
+
17
+ /**
18
+ * New agent disconnected
19
+ */
20
+ jQuery(document).on("bleeper_agent_disconnected", function(e) {
21
+ wplc_ma_update_admin_bar(-1, "event off"); //remove one agent
22
+ });
23
+ });
24
+
25
+ function wplc_choose_delegate(){
26
+ if (typeof wplc_choose_accept_chats !== "undefined" && wplc_choose_accept_chats === "0") {
27
+ jQuery("#wplc_agent_status").prop("checked", false);
28
+ } else {
29
+ jQuery("#wplc_agent_status").prop("checked", true);
30
+ wplc_online_agent_count = wplc_ma_parse_active_count_from_container();
31
+ }
32
+
33
+
34
+ var wplc_agent_status = jQuery("#wplc_agent_status").attr('checked');
35
+
36
+ if(wplc_agent_status === 'checked'){
37
+ jQuery("#wplc_agent_status_text").html(wplc_choose_admin_strings.accepting_chats);
38
+ } else {
39
+ jQuery("#wplc_agent_status_text").html(wplc_choose_admin_strings.not_accepting_chats);
40
+ }
41
+
42
+ //Transient
43
+ function wplc_ma_update_agent_transient(data) {
44
+ jQuery.post(ajaxurl, data, function(response) {
45
+ if(response){
46
+ //window.location.reload();
47
+ jQuery.event.trigger({type: "wplc_switchery_changed",response:response, ndata:data});
48
+ if(typeof bleeper_remote_enabled === "undefined"){
49
+ //Somethings wrong here. The user either isn't using node, or he has an old version of the basic
50
+ window.location.reload();
51
+ }
52
+ }
53
+ });
54
+ }
55
+
56
+ /* Make sure switchery has been loaded on this page */
57
+ if(typeof Switchery !== 'undefined'){
58
+ var wplc_switchery_element = document.querySelector('.wplc_switchery');
59
+ /* Make sure that the switch is being displayed */
60
+ if(wplc_switchery_element !== null){
61
+
62
+ var wplc_switchery_init = new Switchery(wplc_switchery_element, { color: '#6da164', secondaryColor: '#c95042', size: 'small' });
63
+
64
+ var changeCheckbox = document.querySelector('#wplc_agent_status');
65
+
66
+ changeCheckbox.onchange = function () {
67
+
68
+ var wplc_accepting_chats = jQuery(this).attr('checked');
69
+
70
+ if(wplc_accepting_chats === 'checked'){
71
+ connection_lost_type = '';
72
+ jQuery("#wplc_agent_status_text").html(wplc_choose_admin_strings.accepting_status);
73
+ var data = {
74
+ action: 'wplc_choose_accepting',
75
+ security: wplc_admin_strings.nonce,
76
+ user_id: wplc_admin_strings.user_id
77
+ };
78
+ wplc_ma_update_agent_transient(data);
79
+
80
+ wplc_ma_update_admin_bar(1, "click on"); //Add one agent
81
+
82
+ } else {
83
+ jQuery("#wplc_agent_status_text").html(wplc_choose_admin_strings.not_accepting_status);
84
+ connection_lost_type = 'offline_status';
85
+ var data = {
86
+ action: 'wplc_choose_not_accepting',
87
+ security: wplc_admin_strings.nonce,
88
+ user_id: wplc_admin_strings.user_id
89
+ };
90
+ wplc_ma_update_agent_transient(data);
91
+
92
+ wplc_ma_update_admin_bar(-1, "click off"); //remove one agent
93
+
94
+ }
95
+ };
96
+ }
97
+ }
98
+ }
99
+
100
+ //Parse the current value
101
+ function wplc_ma_update_admin_bar(amount, where){
102
+ wplc_online_agent_count = wplc_ma_parse_active_count_from_container();
103
+ console.log(wplc_online_agent_count);
104
+ console.log(where);
105
+ wplc_online_agent_count += amount; //we can add a negative value to remove
106
+
107
+ if(wplc_online_agent_count < 0){
108
+ wplc_online_agent_count = 0; //Force to lowest possible
109
+ }
110
+
111
+ if(wplc_online_agent_count > 0){
112
+ //Online
113
+ jQuery("#wplc_ma_online_agents_circle").removeClass("wplc_red_circle");
114
+ if(!jQuery("#wplc_ma_online_agents_circle").hasClass("wplc_green_circle")){
115
+ jQuery("#wplc_ma_online_agents_circle").addClass("wplc_green_circle");
116
+ }
117
+ } else {
118
+ //Offline
119
+ jQuery("#wplc_ma_online_agents_circle").removeClass("wplc_green_circle");
120
+ if(!jQuery("#wplc_ma_online_agents_circle").hasClass("wplc_red_circle")){
121
+ jQuery("#wplc_ma_online_agents_circle").addClass("wplc_red_circle");
122
+ }
123
+ }
124
+
125
+ jQuery("#wplc_ma_online_agents_count").text(wplc_online_agent_count);
126
+ }
127
+
128
+ //Get the value currently stored in the admin bar
129
+ function wplc_ma_parse_active_count_from_container(){
130
+ return parseInt(jQuery("#wplc_ma_online_agents_count").text());
131
+ }
js/wplc_config.js ADDED
@@ -0,0 +1 @@
 
1
+ var wplc_api_server = 'https://update.wp-livechat.com';
js/wplc_config.js.php DELETED
@@ -1,5 +0,0 @@
1
- <?php
2
- include('../config.php');
3
- header('Content-Type: text/javascript');
4
- ?>
5
- var wplc_api_server = '<?php echo WLPC_UPDATE_SERVER; ?>';
 
 
 
 
 
js/wplc_initiate.js ADDED
File without changes
js/wplc_ma.js ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(function() {
2
+
3
+ jQuery("body").on("click","#wplc_sample_ring_tone",function(e) {
4
+ var v = jQuery("#wplc_ringtone").val();
5
+ if (typeof v !== "undefined") {
6
+ new Audio(v).play()
7
+ }
8
+ e.preventDefault();
9
+ });
10
+ jQuery("body").on("click","#wplc_sample_message_tone",function(e) {
11
+ var v = jQuery("#wplc_messagetone").val();
12
+ if (typeof v !== "undefined") {
13
+ new Audio(v).play()
14
+ }
15
+ e.preventDefault();
16
+ });
17
+ jQuery("body").on("click", "#wplc_add_agent", function(e) {
18
+ e.preventDefault();
19
+
20
+ var uid = parseInt(jQuery("#wplc_agent_select").val());
21
+ var em = jQuery("#wplc_selected_agent_"+uid).attr('em');
22
+ var em2 = jQuery("#wplc_selected_agent_"+uid).attr('em2');
23
+ var name = jQuery("#wplc_selected_agent_"+uid).attr('name');
24
+
25
+ if (uid) {
26
+ var data = {
27
+ action: 'wplc_add_agent',
28
+ security: wplc_admin_strings.nonce,
29
+ uid: uid
30
+ };
31
+ jQuery.post(ajaxurl, data, function(response) {
32
+ if (response === "1") {
33
+ /* success */
34
+ var wplchtml = "<li id=\"wplc_agent_li_"+uid+"\"><p><img src=\"//www.gravatar.com/avatar/"+em+"?s=80&d=mm\"></p><h3>"+name+"</h3><small>"+em2+"</small><p><button class='button button-secondary' id='wplc_remove_agent' uid='"+uid+"'>"+wplc_admin_strings.remove_agent+"</button></p></li>"
35
+ jQuery(wplchtml).insertBefore("#wplc_add_new_agent_box").hide().fadeIn(2000);
36
+ jQuery("#wplc_selected_agent_"+uid).remove();
37
+ } else {
38
+ /* failure */
39
+ }
40
+ });
41
+ }
42
+
43
+
44
+
45
+ });
46
+
47
+ jQuery("body").on("click", ".wplc_remove_agent", function(e) {
48
+
49
+ var uid = parseInt(jQuery(this).attr('uid'));
50
+
51
+ if (uid) {
52
+ var data = {
53
+ action: 'wplc_remove_agent',
54
+ security: wplc_admin_strings.nonce,
55
+ uid: uid
56
+ };
57
+ jQuery.post(ajaxurl, data, function(response) {
58
+ if (response === "1") {
59
+ /* success */
60
+
61
+ jQuery("#wplc_agent_li_"+uid).fadeOut(500);
62
+ } else {
63
+ /* failure */
64
+ }
65
+ });
66
+ }
67
+ e.preventDefault();
68
+
69
+
70
+ });
71
+
72
+ });
js/wplc_ma_transient.js ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(function() {
2
+ /* Going online functionality used to be here */
3
+ var wplc_ma_set_transient = null;
4
+
5
+ wplc_ma_set_transient = setInterval(function (){wplc_ma_update_agent_transient();}, 60000);
6
+ wplc_ma_update_agent_transient();
7
+
8
+ function wplc_ma_update_agent_transient() {
9
+ var data = {
10
+ action: 'wplc_admin_set_transient',
11
+ security: wplc_admin_strings.nonce,
12
+ user_id: wplc_admin_strings.user_id
13
+ };
14
+ jQuery.post(ajaxurl, data, function(response) {
15
+ });
16
+ }
17
+ });
js/wplc_pro_features.js ADDED
@@ -0,0 +1,241 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var wplc_searchTimeout;
2
+ var wplc_is_typing = false;
3
+ var wplc_has_sent_auto_first_response = false;
4
+
5
+
6
+ jQuery(document).on("wplc_animation_done", function(e) {
7
+
8
+
9
+ jQuery('.nifty_rating_icon').click(function(evt){
10
+ jQuery('.nifty_rating_icon').removeClass('wplc-color-1');
11
+ jQuery(this).addClass('wplc-color-1');
12
+ });
13
+ jQuery("#nifty_rating_pos").click(function(evt){
14
+ jQuery("#nifty_rating_thanks").hide();
15
+ jQuery("#nifty_ratings_form").fadeIn();
16
+ jQuery("#nifty_rating_button").attr("nifty-rating", "1");
17
+
18
+ evt.stopImmediatePropagation();
19
+ });
20
+ jQuery("#nifty_rating_neg").click(function(evt){
21
+ jQuery("#nifty_rating_thanks").hide();
22
+ jQuery("#nifty_ratings_form").fadeIn();
23
+ jQuery("#nifty_rating_button").attr("nifty-rating", "0");
24
+
25
+ evt.stopImmediatePropagation();
26
+ });
27
+ jQuery("#nifty_rating_button").click(function(evt){
28
+ var nifty_rating = jQuery(this).attr("nifty-rating");
29
+ var nifty_comment = jQuery("#nifty_ratings_comment").val() !== "" ? jQuery("#nifty_ratings_comment").val() : "No Comment...";
30
+ jQuery("#nifty_ratings_form").hide();
31
+ jQuery("#nifty_recording").fadeIn();
32
+
33
+ var formData = new FormData();
34
+
35
+ formData.append('action', 'wplc_record_chat_rating');
36
+ formData.append('cid', Cookies.get('wplc_cid'));
37
+ formData.append('rating', nifty_rating);
38
+ formData.append('comment', nifty_comment);
39
+ formData.append('security', wplc_nonce );
40
+ formData.append('update_chat_rating', "1" );
41
+ formData.append('wplc_extra_data[domain]', wplc_extra_data['domain'] );
42
+ formData.append('wplc_extra_data[api_key]', wplc_extra_data['api_key'] );
43
+
44
+ jQuery.ajax({
45
+ url : wplc_ajaxurl,
46
+ type : 'POST',
47
+ data : formData,
48
+ cache: false,
49
+ processData: false,
50
+ contentType: false,
51
+ success : function(data) {
52
+ wplc_pro_rating_show_thanks_message();
53
+ },
54
+ error : function (){
55
+ wplc_pro_rating_show_thanks_message();
56
+ }
57
+ });
58
+
59
+ jQuery.event.trigger({type: 'wplc_send_live_rating', rating: {score: nifty_rating, comment: nifty_comment} });
60
+
61
+ evt.stopImmediatePropagation();
62
+ });
63
+
64
+ function wplc_pro_rating_show_thanks_message(){
65
+ jQuery("#nifty_recording").fadeOut();
66
+ jQuery("#nifty_rating_thanks").fadeIn();
67
+
68
+ setTimeout(function(){
69
+ jQuery("#nifty_rating_thanks").fadeOut();
70
+ }, 2000);
71
+ }
72
+ });
73
+
74
+ jQuery(function() {
75
+
76
+
77
+ jQuery(document).on("wplc_start_chat", function( e ) {
78
+ var data = {
79
+ action: 'wplc_start_chat_hook',
80
+ security: wplc_nonce,
81
+ cid: Cookies.get('wplc_cid'),
82
+ wplc_extra_data:{
83
+ name: jQuery("#wplc_name").val(),
84
+ email: jQuery("#wplc_email").val(),
85
+ }
86
+ };
87
+
88
+ if (typeof wplc_restapi_enabled !== "undefined" && wplc_restapi_enabled === '1') {
89
+ data.security = (typeof wplc_restapi_token !== "undefined" ? wplc_restapi_token : false);
90
+ jQuery.post(wplc_restapi_endpoint+"/new-chat/", data, function(response) {});
91
+ }
92
+
93
+
94
+ });
95
+
96
+ jQuery("body").on("change", "#wplc_user_selected_department", function(){
97
+ if(wplc_extra_data !== "undefined"){
98
+ wplc_extra_data['wplc_user_selected_department'] = jQuery(this).val();
99
+ }
100
+ });
101
+
102
+
103
+
104
+
105
+
106
+ });
107
+
108
+ jQuery(document).on("bleeper_send_message", function(e) {
109
+ if(typeof wplc_pro_auto_resp_chat_msg !== 'undefined' && wplc_pro_auto_resp_chat_msg !== ""){
110
+ if(wplc_has_sent_auto_first_response == false){
111
+ if(jQuery('.wplc-admin-message').length <= 0){
112
+ var first_response_html = "<span class='wplc-admin-message wplc-color-bg-4 wplc-color-2 wplc-color-border-4' mid='" + Date.now() + "'>";
113
+ first_response_html += "<div class='wplc-msg-content' mid='" + Date.now() + "'>";
114
+ first_response_html += "<span class='messageBody' data-message='" + wplc_pro_auto_resp_chat_msg + "'>" + wplc_pro_auto_resp_chat_msg + "</span>";
115
+ first_response_html += "</div></span>";
116
+
117
+ setTimeout(function(){
118
+ jQuery('#wplc_chatbox').append(first_response_html);
119
+ }, 1000);
120
+ }
121
+ wplc_has_sent_auto_first_response = true;
122
+ }
123
+ }
124
+ });
125
+
126
+ function wplc_start_chat_pro_data(data){
127
+ if(typeof wplc_extra_data !== "undefined" && typeof wplc_extra_data['wplc_user_selected_department'] !== "undefined"){
128
+ data['wplc_user_selected_department'] = wplc_extra_data['wplc_user_selected_department'];
129
+ }
130
+
131
+ return data;
132
+ }
133
+
134
+ /* Handles Uploading and sharing a file within chat*/
135
+ function wplcShareFile(fileToUpload, failedID, successID, uploadingID, originalID){
136
+ var formData = new FormData();
137
+
138
+ formData.append('action', 'wplc_upload_file');
139
+ formData.append('cid', Cookies.get('wplc_cid'));
140
+ formData.append('file', fileToUpload);
141
+ formData.append('timestamp', Date.now());
142
+ formData.append('security', wplc_nonce );
143
+
144
+ /*Handle jQuery Elements*/
145
+ jQuery(uploadingID).show();
146
+ jQuery(originalID).hide();
147
+ jQuery(successID).hide();
148
+ jQuery(failedID).hide();
149
+
150
+ if(fileToUpload.name.indexOf(".php") === -1 && fileToUpload.name.indexOf(".html") === -1 && fileToUpload.name.indexOf(".js") === -1 && fileToUpload.name.indexOf(".asp") === -1 && fileToUpload.name.indexOf(".svg") === -1){
151
+ //Files allowed - continue
152
+ if(fileToUpload.size < 4000000){ //Max size of 4MB
153
+ jQuery.ajax({
154
+ url : wplc_ajaxurl_site,
155
+ type : 'POST',
156
+ data : formData,
157
+ cache: false,
158
+ processData: false,
159
+ contentType: false,
160
+ success : function(data) {
161
+ if(parseInt(data) !== 0){
162
+ jQuery(uploadingID).hide();
163
+ jQuery(successID).show();
164
+ setTimeout(function(){
165
+ jQuery(successID).hide();
166
+ jQuery(originalID).show();
167
+ }, 2000);
168
+
169
+ //All good post the link to file
170
+ var tag = (data.indexOf(".png") !== -1 || data.indexOf(".PNG") !== -1 ||data.indexOf(".jpg") !== -1 || data.indexOf(".JPG") !== -1 || data.indexOf(".jpeg") !== -1 || data.indexOf(".gif") !== -1 || data.indexOf(".bmp")!== -1 ) ? "img" : "link";
171
+
172
+ if(tag !== "img"){
173
+ tag = (data.indexOf(".mp4") !== -1 || data.indexOf(".mpeg4") !== -1 || data.indexOf(".webm") !== -1 || data.indexOf(".oog") !== -1 ) ? "video" : "link"; //video now
174
+ }
175
+ jQuery("#wplc_chatmsg").val(tag + ":" + data + ":" + tag); //Add to input field
176
+ jQuery("#wplc_send_msg").trigger("click"); //Send message
177
+ }
178
+ else{
179
+ jQuery(uploadingID).hide();
180
+ jQuery(failedID).show();
181
+ setTimeout(function(){
182
+ jQuery(failedID).hide();
183
+ jQuery(originalID).show();
184
+ }, 2000);
185
+
186
+ }
187
+ },
188
+ error : function (){
189
+ jQuery(uploadingID).hide();
190
+ jQuery(failedID).show();
191
+ setTimeout(function(){
192
+ jQuery(failedID).hide();
193
+ jQuery(originalID).show();
194
+ }, 2000);
195
+ }
196
+ });
197
+ }else{
198
+ alert("File limit is 4mb");
199
+ jQuery(uploadingID).hide();
200
+ jQuery(failedID).show();
201
+ setTimeout(function(){
202
+ jQuery(failedID).hide();
203
+ jQuery(originalID).show();
204
+ }, 2000);
205
+ }
206
+ } else{
207
+ alert("File type not supported");
208
+ jQuery(uploadingID).hide();
209
+ jQuery(failedID).show();
210
+ setTimeout(function(){
211
+ jQuery(failedID).hide();
212
+ jQuery(originalID).show();
213
+ }, 2000);
214
+ }
215
+ }
216
+
217
+ function wplc_start_chat_pro_custom_fields_filter( wplc_extra_data_tmp, rest_action_data, callback ) {
218
+
219
+ var custom_field_array = {};
220
+
221
+ var cnt = 0;
222
+ jQuery('*[name^="wplc_custom_field"]').each(function(key, val) {
223
+
224
+ var field_name = jQuery(this).attr( "fname" );
225
+ custom_field_array[cnt] = {};
226
+ custom_field_array[cnt][0] = field_name;
227
+ custom_field_array[cnt][1] = jQuery(this).val();
228
+ cnt++;
229
+ });
230
+
231
+ var custom_data = custom_field_array;
232
+ wplc_extra_data_tmp['custom_fields'] = JSON.stringify(custom_data);
233
+
234
+ if(typeof callback === "function"){
235
+ rest_action_data.wplc_extra_data = wplc_extra_data_tmp;
236
+ callback(wplc_extra_data_tmp, rest_action_data);
237
+ }
238
+
239
+ return wplc_extra_data_tmp;
240
+
241
+ }
js/wplc_pro_features.min.js ADDED
@@ -0,0 +1 @@
 
1
+ var wplc_searchTimeout,wplc_is_typing=!1,wplc_has_sent_auto_first_response=!1;function wplc_start_chat_pro_data(e){return"undefined"!=typeof wplc_extra_data&&void 0!==wplc_extra_data.wplc_user_selected_department&&(e.wplc_user_selected_department=wplc_extra_data.wplc_user_selected_department),e}function wplcShareFile(e,t,n,a,i){var r=new FormData;r.append("action","wplc_upload_file"),r.append("cid",Cookies.get("wplc_cid")),r.append("file",e),r.append("timestamp",Date.now()),r.append("security",wplc_nonce),jQuery(a).show(),jQuery(i).hide(),jQuery(n).hide(),jQuery(t).hide(),-1===e.name.indexOf(".php")&&-1===e.name.indexOf(".html")&&-1===e.name.indexOf(".js")&&-1===e.name.indexOf(".asp")&&-1===e.name.indexOf(".svg")?e.size<4e6?jQuery.ajax({url:wplc_ajaxurl_site,type:"POST",data:r,cache:!1,processData:!1,contentType:!1,success:function(e){if(0!==parseInt(e)){jQuery(a).hide(),jQuery(n).show(),setTimeout(function(){jQuery(n).hide(),jQuery(i).show()},2e3);var r=-1!==e.indexOf(".png")||-1!==e.indexOf(".PNG")||-1!==e.indexOf(".jpg")||-1!==e.indexOf(".JPG")||-1!==e.indexOf(".jpeg")||-1!==e.indexOf(".gif")||-1!==e.indexOf(".bmp")?"img":"link";"img"!==r&&(r=-1!==e.indexOf(".mp4")||-1!==e.indexOf(".mpeg4")||-1!==e.indexOf(".webm")||-1!==e.indexOf(".oog")?"video":"link"),jQuery("#wplc_chatmsg").val(r+":"+e+":"+r),jQuery("#wplc_send_msg").trigger("click")}else jQuery(a).hide(),jQuery(t).show(),setTimeout(function(){jQuery(t).hide(),jQuery(i).show()},2e3)},error:function(){jQuery(a).hide(),jQuery(t).show(),setTimeout(function(){jQuery(t).hide(),jQuery(i).show()},2e3)}}):(alert("File limit is 4mb"),jQuery(a).hide(),jQuery(t).show(),setTimeout(function(){jQuery(t).hide(),jQuery(i).show()},2e3)):(alert("File type not supported"),jQuery(a).hide(),jQuery(t).show(),setTimeout(function(){jQuery(t).hide(),jQuery(i).show()},2e3))}function wplc_start_chat_pro_custom_fields_filter(e,t,n){var a={},i=0;jQuery('*[name^="wplc_custom_field"]').each(function(e,t){var n=jQuery(this).attr("fname");a[i]={},a[i][0]=n,a[i][1]=jQuery(this).val(),i++});var r=a;return e.custom_fields=JSON.stringify(r),"function"==typeof n&&(t.wplc_extra_data=e,n(e,t)),e}jQuery(document).on("wplc_animation_done",function(e){function t(){jQuery("#nifty_recording").fadeOut(),jQuery("#nifty_rating_thanks").fadeIn(),setTimeout(function(){jQuery("#nifty_rating_thanks").fadeOut()},2e3)}jQuery(".nifty_rating_icon").click(function(e){jQuery(".nifty_rating_icon").removeClass("wplc-color-1"),jQuery(this).addClass("wplc-color-1")}),jQuery("#nifty_rating_pos").click(function(e){jQuery("#nifty_rating_thanks").hide(),jQuery("#nifty_ratings_form").fadeIn(),jQuery("#nifty_rating_button").attr("nifty-rating","1"),e.stopImmediatePropagation()}),jQuery("#nifty_rating_neg").click(function(e){jQuery("#nifty_rating_thanks").hide(),jQuery("#nifty_ratings_form").fadeIn(),jQuery("#nifty_rating_button").attr("nifty-rating","0"),e.stopImmediatePropagation()}),jQuery("#nifty_rating_button").click(function(e){var n=jQuery(this).attr("nifty-rating"),a=""!==jQuery("#nifty_ratings_comment").val()?jQuery("#nifty_ratings_comment").val():"No Comment...";jQuery("#nifty_ratings_form").hide(),jQuery("#nifty_recording").fadeIn();var i=new FormData;i.append("action","wplc_record_chat_rating"),i.append("cid",Cookies.get("wplc_cid")),i.append("rating",n),i.append("comment",a),i.append("security",wplc_nonce),i.append("update_chat_rating","1"),i.append("wplc_extra_data[domain]",wplc_extra_data.domain),i.append("wplc_extra_data[api_key]",wplc_extra_data.api_key),jQuery.ajax({url:wplc_ajaxurl,type:"POST",data:i,cache:!1,processData:!1,contentType:!1,success:function(e){t()},error:function(){t()}}),jQuery.event.trigger({type:"wplc_send_live_rating",rating:{score:n,comment:a}}),e.stopImmediatePropagation()})}),jQuery(function(){jQuery(document).on("wplc_start_chat",function(e){var t={action:"wplc_start_chat_hook",security:wplc_nonce,cid:Cookies.get("wplc_cid"),wplc_extra_data:{name:jQuery("#wplc_name").val(),email:jQuery("#wplc_email").val()}};"undefined"!=typeof wplc_restapi_enabled&&"1"===wplc_restapi_enabled&&(t.security="undefined"!=typeof wplc_restapi_token&&wplc_restapi_token,jQuery.post(wplc_restapi_endpoint+"/new-chat/",t,function(e){}))}),jQuery("body").on("change","#wplc_user_selected_department",function(){"undefined"!==wplc_extra_data&&(wplc_extra_data.wplc_user_selected_department=jQuery(this).val())})}),jQuery(document).on("bleeper_send_message",function(e){if("undefined"!=typeof wplc_pro_auto_resp_chat_msg&&""!==wplc_pro_auto_resp_chat_msg&&0==wplc_has_sent_auto_first_response){if(jQuery(".wplc-admin-message").length<=0){var t="<span class='wplc-admin-message wplc-color-bg-4 wplc-color-2 wplc-color-border-4' mid='"+Date.now()+"'>";t+="<div class='wplc-msg-content' mid='"+Date.now()+"'>",t+="<span class='messageBody' data-message='"+wplc_pro_auto_resp_chat_msg+"'>"+wplc_pro_auto_resp_chat_msg+"</span>",t+="</div></span>",setTimeout(function(){jQuery("#wplc_chatbox").append(t)},1e3)}wplc_has_sent_auto_first_response=!0}});
js/wplc_server.min.js ADDED
@@ -0,0 +1 @@
 
1
+ var wplc_xhr,gifExtensionPattern=new RegExp(/\.(gif)\b/),wplc_server_method=null,wplc_supress_server_logs=!0,wplc_node_socket=null,wplc_node_send_queue=new Array,wplc_node_message_receiver=null,wplc_node_message_restart_handler=null,wplc_node_client_event_logger=null,wplc_node_sockets_ready=!1,wplc_transport_prepared=!1,wplc_node_async_array=new Array,wplc_node_async_send_rate=1,wplc_node_async_cookie_check_complete=!1,wplc_node_port_open=!0,wplc_node_is_client_typing=!1,wplc_node_is_pair_typing_indicator_visible=!1,wplc_node_pair_name="",wplc_node_switch_ajax_complete=!1,wplc_node_retry_count=0,wplc_msg_history=new Array;function WPLCServer(){var e=this;wplc_server_method=WPLCServer.Ajax,e.send=wplc_server_method.send,e.isInSocketMode=wplc_server_method.isInSocketMode,e.isPreparingSocketMode=wplc_server_method.isPreparingSocketMode,e.transportPrepared=wplc_server_method.transportPrepared,e.asyncStorage=wplc_server_method.asyncStorage,e.forceClosePort=wplc_server_method.forceClosePort,e.sendMessage=wplc_server_method.sendMessage,e.prepareTransport=function(t,a,_,r){wplc_server_log("-------------------"),wplc_server_log("Preparing Transport"),"undefined"!=typeof wplc_use_node_server&&"true"===wplc_use_node_server&&window.WebSocket?(wplc_server_method=WPLCServer.Socket,wplc_server_log("Socket Mode")):(wplc_server_method=WPLCServer.Ajax,wplc_server_log("Ajax Mode")),wplc_server_method.init(function(){e.send=wplc_server_method.send,e.isInSocketMode=wplc_server_method.isInSocketMode,e.isPreparingSocketMode=wplc_server_method.isPreparingSocketMode,e.transportPrepared=wplc_server_method.transportPrepared,e.asyncStorage=wplc_server_method.asyncStorage,e.forceClosePort=wplc_server_method.forceClosePort,e.sendMessage=wplc_server_method.sendMessage,"function"==typeof t&&t()},a,function(){if(wplc_server_method=WPLCServer.Ajax,wplc_server_log("Ajax Mode - Fail Over"),e.send=wplc_server_method.send,e.isInSocketMode=wplc_server_method.isInSocketMode,e.isPreparingSocketMode=function(){return!1},e.transportPrepared=wplc_server_method.transportPrepared,e.asyncStorage=wplc_server_method.asyncStorage,e.forceClosePort=wplc_server_method.forceClosePort,e.sendMessage=wplc_server_method.sendMessage,"undefined"!=typeof wplc_ajaxurl&&"undefined"!=typeof wplc_nonce&&"undefined"!=typeof wplc_cid){var a={action:"wplc_node_switch_to_ajax",security:wplc_nonce,cid:wplc_cid};jQuery.ajax({url:wplc_ajaxurl,data:a,type:"POST",timeout:12e4,success:function(e){wplc_server_log("Ajax Mode Enabled")},error:function(e,t){wplc_server_log("Chat Fail Over Could Not Be Setup")},complete:function(e){"function"==typeof t&&t()}})}},_,r),wplc_server_log("Transport Prepared"),wplc_server_log("-------------------"),wplc_transport_prepared=!0},e.browserIsSocketReady=function(){return"undefined"!=typeof wplc_use_node_server&&"true"===wplc_use_node_server&&!!window.WebSocket}}function wplc_server_log(e){!0!==wplc_supress_server_logs&&window.console&&console.log("WPLC SERVER: "+e)}function wplc_server_error(e){window.console&&console.error("WPLC SERVER ERROR: "+e)}function wplc_socket_send(e,t,a,_){if(wplc_node_port_open){wplc_socket_add_to_queue(e,t,a,_);var r=wplc_socket_get_next_in_queue();!1!==r&&(null!=wplc_node_socket&&wplc_node_socket.readyState!==WebSocket.CONNECTING&&wplc_node_socket.readyState!==WebSocket.CLOSING&&wplc_node_socket.readyState!==WebSocket.CLOSED?(r.data.is_typing=void 0!==wplc_node_is_client_typing&&wplc_node_is_client_typing,wplc_node_socket.send(JSON.stringify(r.data)),"function"==typeof r.success&&r.success()):setTimeout(function(){wplc_socket_send(e,t,a,_)},500))}}function wplc_sanitize_attributes(e){var t="onload,onclick,alert,onerror,dalert".split(",");for(i=0;i<t.length;i++)e=e.replace(t[i],"");return e}function wplc_socket_add_to_queue(e,t,a,_){void 0===e.server_token&&("undefined"!=typeof bleeper_api_key?e.server_token=bleeper_api_key:wplc_server_error("No Server Token Present, Something will go wrong"));var r={data:e,success:t,fail:a,complete:_};if(wplc_node_send_queue.length>0){var n=wplc_node_send_queue[wplc_node_send_queue.length-1];JSON.stringify(n.data)!==JSON.stringify(e)&&wplc_node_send_queue.push(r)}else wplc_node_send_queue.push(r)}function wplc_socket_get_next_in_queue(){return wplc_node_send_queue.length>0&&wplc_node_send_queue.shift()}function wplc_rest_api(e,t,a,_){void 0!==wplc_xhr&&void 0!==wplc_xhr.abort()&&wplc_xhr.abort(),null==_&&(_=function(){});var r=e;if("undefined"!=typeof wplc_restapi_enabled&&1===parseInt(wplc_restapi_enabled)&&"undefined"!=typeof wplc_restapi_endpoint){var n=Date.now();wplc_send_url=wplc_restapi_endpoint+"/"+e+"?nocache="+n;var o=t;t.action,t.cid,t.security,t.msg,wplc_restapi_token,document.wplc_extra_data;o.server_token=wplc_restapi_token,o.token=wplc_restapi_token,void 0===o.wplc_extra_data&&(o.wplc_extra_data=document.wplc_extra_data),o._wpnonce=wplc_restapi_nonce,wplc_xhr=jQuery.ajax({url:wplc_send_url,data:o,type:"POST",timeout:a,success:function(e){wplc_server_log("REST SEND = SUCCESS"),_(e)},error:function(e,t){wplc_server_log("REST SEND = FAIL"),_()},complete:function(e){_(e)}})}else wplc_server_log("NO REST API :("),_()}function wplc_socket_async_storage_handler(e,t,a){"undefined"!=typeof wplc_restapi_enabled&&1===parseInt(wplc_restapi_enabled)&&"undefined"!=typeof wplc_restapi_endpoint&&(e=wplc_restapi_endpoint+"/async_storage");var _={action:"wplc_node_async_storage_ajax",relay_action:t.action,chat_id:t.cid,security:t.security,messages:JSON.stringify(wplc_node_async_array),wplc_extra_data:document.wplc_extra_data};"undefined"!=typeof bleeper_api_key&&(_.server_token=bleeper_api_key),jQuery.ajax({url:e,data:_,type:"POST",timeout:a,success:function(e){wplc_server_log("ASYNC STORAGE = SUCCESS")},error:function(e,t){wplc_server_log("ASYNC STORAGE = FAIL")},complete:function(e){}})}function wplc_json_validator(e){try{JSON.parse(e)}catch(e){return!1}return!0}function wplc_node_parse_async_from_object(e,t){for(var a in e)e.hasOwnProperty(a)&&wplc_node_async_array.push(e[a]);"function"==typeof t&&t()}function wplc_node_global_message_receiver(e){e&&"object"!=typeof e&&(e=JSON.parse(e)),void 0!==e.pair_name&&e.pair_name!==wplc_node_pair_name&&(wplc_node_pair_name=e.pair_name),void 0!==e.pair_typing&&(!0===e.pair_typing||"true"===e.pair_typing?(!1===wplc_node_is_pair_typing_indicator_visible&&(jQuery("#wplc_user_typing").length>0||(jQuery(".typing_indicator").html("<span id='wplc_user_typing'>"+wplc_node_pair_name+" "+wplc_localized_string_is_typing_single+"</span>"),jQuery(".typing_indicator").addClass("typing_indicator_active"))),wplc_node_is_pair_typing_indicator_visible=!0):(!0===wplc_node_is_pair_typing_indicator_visible&&jQuery("#wplc_user_typing").length>0&&(jQuery("#wplc_user_typing").fadeOut("slow").remove(),jQuery(".typing_indicator").removeClass("typing_indicator_active")),wplc_node_is_pair_typing_indicator_visible=!1))}function wplc_add_date_and_time(e,t){if(1===parseInt(t)||2===parseInt(t)){var a="";if(void 0!==e.other&&void 0!==e.other.datetime&&!1!==e.other||void 0!==e.timestamp&&("object"!=typeof e.other&&(e.other={}),e.other.datetime=e.timestamp),void 0===e.other||void 0===e.other.datetime)return"";if("undefined"!=typeof wplc_show_chat_detail){var _=e.other.hasOwnProperty("datetimeUTC")?e.other.datetimeUTC:e.other.datetime,r=new Date(1e3*parseInt(_));if(void 0!==wplc_show_chat_detail.date&&"1"===wplc_show_chat_detail.date){var n="undefined"!=typeof wplc_datetime_format&&wplc_datetime_format.hasOwnProperty("date_format")?wplc_datetime_format.date_format:"n/d",o=r.getMonth(),c=r.getDate(),i=["January","February","March","April","May","June","July","August","September","October","November","December"],s=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=r.getDay(),p=r.getFullYear();a+=n.replace(/S/g,"%S%").replace(/D/g,"%D%").replace(/l/g,"%l%").replace(/F/g,"%F%").replace(/M/g,"%M%").replace(/j/g,c).replace(/d/g,c<10?"0"+c:c).replace(/w/g,l).replace(/n/g,o+1).replace(/m/g,o+1<10?"0"+(o+1):o+1).replace(/Y/g,p).replace(/y/g,p.toString().substr(2,2)).replace(/%S%/g,1===c?"st":2===c?"nd":3===c?"rd":"th").replace(/%D%/g,s[l].substr(0,3)).replace(/%l%/g,s[l]).replace(/%F%/g,i[o]).replace(/%M%/g,i[o].substr(0,3))+" "}if(void 0!==wplc_show_chat_detail.time&&"1"===wplc_show_chat_detail.time){var d="undefined"!=typeof wplc_datetime_format&&wplc_datetime_format.hasOwnProperty("time_format")?wplc_datetime_format.time_format:"H:i",w=r.getHours()>12?r.getHours()-12:r.getHours()<1?12:r.getHours(),m=r.getHours(),u=m>11?"pm":"am",g=r.getMinutes();a+=d.replace(/g/g,w).replace(/h/g,w<10?"0"+w:w).replace(/G/g,m).replace(/H/g,m<10?"0"+m:m).replace(/i/g,g<10?"0"+g:g).replace(/a/g,u.toLowerCase()).replace(/A/g,u.toUpperCase())}""!==a&&(1===parseInt(t)?aoru_class="wplc-msg-float-left":aoru_class="wplc-msg-float-right",a='<span class="timedate '+aoru_class+'">'+a+"</span>")}return a}return""}function wplc_get_chat_person_name_msg_field(e){try{return'<span class="wplc-chat-person-name">'+e+": </span>"}catch(e){}}function getCleanedGif(e){if(void 0!==e){var t=e.split(" ");if(void 0!==t)for(var a=0;a<t.length;a++){var _=t[a];if(void 0!==_&&gifExtensionPattern.test(_)){var r=_.replace("href=","");return r=r.replace(/\"/g,"")}}}return""}function wplc_push_message_to_chatbox(e,t,a){var _=!0;if(void 0!==e.mid&&"u"===t&&(0===parseInt(e.mid)||null===e.mid?_=!0:void 0!==wplc_msg_history[e.mid]?_=!1:wplc_msg_history[e.mid]=!0),_&&void 0!==e.originates&&null!==e.originates&&"null"!==e.originates){var r,n="",o="",c="",i="",s="",l=new RegExp(/blob.wav/),p=!1;if(1===parseInt(e.originates)?(r=void 0!==e.other&&void 0!==e.other.aid?e.other.aid.toString():void 0!==e.other&&void 0!==e.other.agent_id&&e.other.agent_id.toString(),n="wplc-admin-message wplc-color-bg-4 wplc-color-2 wplc-color-border-4",(p=l.test(e.msg))&&(n+=" wplc-user-message-audio"),"u"===t?!1!==r&&"undefined"!=typeof wplc_agent_data&&void 0!==wplc_agent_data[r]?"undefined"!=typeof wplc_show_chat_detail&&(void 0!==wplc_show_chat_detail.avatar&&"1"===wplc_show_chat_detail.avatar&&(o=void 0!==wplc_agent_data[r].md5?"<img src='"+wplc_user_avatars[r]+"?s=80&d=mm' class='wplc-admin-message-avatar' />":""),void 0!==wplc_show_chat_detail.name&&"1"===wplc_show_chat_detail.name&&(c=void 0!==wplc_agent_data[r].name?wplc_get_chat_person_name_msg_field(wplc_agent_data[r].name):"")):"undefined"!=typeof wplc_show_chat_detail&&(void 0!==wplc_show_chat_detail.avatar&&"1"===wplc_show_chat_detail.avatar&&(o=void 0!==wplc_current_agent.email?"<img src='"+wplc_user_avatars[r]+"?s=80&d=mm' class='wplc-admin-message-avatar' />":""),void 0!==wplc_show_chat_detail.name&&"1"===wplc_show_chat_detail.name&&(c=void 0!==wplc_current_agent.name?wplc_get_chat_person_name_msg_field(wplc_current_agent.name):"")):("undefined"!=typeof agent_id&&void 0!==r&&parseInt(agent_id)===parseInt(r)&&(s="<span class='bleeper-edit-message' style='display:none;'>Edit</span>"),!1!==r&&"undefined"!=typeof wplc_agent_data&&void 0!==wplc_agent_data[r]?"undefined"!=typeof wplc_show_chat_detail&&(void 0!==wplc_show_chat_detail.avatar&&"1"===wplc_show_chat_detail.avatar&&(o=void 0!==wplc_agent_data[r].md5?"<img src='//www.gravatar.com/avatar/"+wplc_agent_data[r].md5+"?s=80&d=mm' class='wplc-admin-message-avatar' />":""),void 0!==wplc_show_chat_detail.name&&"1"===wplc_show_chat_detail.name&&(c=void 0!==wplc_agent_data[r].name?wplc_get_chat_person_name_msg_field(wplc_agent_data[r].name):"")):(void 0!==wplc_show_chat_detail.avatar&&"1"===wplc_show_chat_detail.avatar&&(o="undefined"!=typeof wplc_admin_agent_email?"<img src='//www.gravatar.com/avatar/"+wplc_admin_agent_email+"?s=80&d=mm' class='wplc-admin-message-avatar' />":""),void 0!==wplc_show_chat_detail.name&&"1"===wplc_show_chat_detail.name&&(c="undefined"!=typeof wplc_admin_agent_name?wplc_get_chat_person_name_msg_field(wplc_admin_agent_name):""))),i=e.msg.wplcStripSlashes(),wplc_new_message_sound=!0):0===parseInt(e.originates)||3===parseInt(e.originates)?(n="wplc_system_notification wplc-color-4",i=e.msg,void 0!==e.other.ntype&&"joined"===e.other.ntype&&jQuery.event.trigger({type:"wplc_agent_joined",ndata:e})):(n="wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1",(p=l.test(e.msg))&&(n+=" wplc-user-message-audio"),"u"===t?(s="<span class='bleeper-edit-message' style='display:none;'>Edit</span>",o="<img src='//www.gravatar.com/avatar/"+(o=""!==jQuery(wplc_email).val()?md5(jQuery(wplc_email).val()):"undefined"!=typeof visitor_list&&void 0!==visitor_list[active_chatid]&&void 0!==visitor_list[active_chatid].email?md5(visitor_list[active_chatid].email):"undefined"!=typeof wplc_cookie_email&&""!==wplc_cookie_email?md5(wplc_cookie_email):"x")+"?s=80&d=mm' class='wplc-user-message-avatar' />",c=void 0===Cookies.get("wplc_name")?wplc_get_chat_person_name_msg_field("Guest"):wplc_get_chat_person_name_msg_field(Cookies.get("wplc_name"))):(o="<img src='//www.gravatar.com/avatar/"+(o="undefined"!=typeof wplc_chat_email?wplc_chat_email:"undefined"!=typeof visitor_list&&void 0!==visitor_list[active_chatid]&&void 0!==visitor_list[active_chatid].email?md5(visitor_list[active_chatid].email):"undefined"!=typeof wplc_cookie_email&&""!==wplc_cookie_email?md5(wplc_cookie_email):"x")+"?s=80&d=mm' class='wplc-user-message-avatar' />","undefined"!=typeof wplc_chat_name&&(c=wplc_get_chat_person_name_msg_field(wplc_chat_name))),i=e.msg.wplcStripSlashes()),void 0!==e.other&&void 0!==e.other.from_an_agent&&(!0!==e.other.from_an_agent&&"true"!==e.other.from_an_agent||(s="")),n+=" message_"+e.mid,""!==i){i=wplc_sanitize_attributes(i),p=l.test(i);var d="<span class='"+n+"' mid='"+e.mid+"'>";"undefined"!=typeof wplc_show_chat_detail?(void 0!==wplc_show_chat_detail.avatar&&"1"===wplc_show_chat_detail.avatar&&(d+=o),d+=p?"<div class='wplc-msg-content wplc-msg-content-audio' mid='"+e.mid+"'>":"<div class='wplc-msg-content' mid='"+e.mid+"'>",p?d+="<span class='wplc-msg-content-audio-icon'></span>":void 0!==wplc_show_chat_detail.name&&"1"===wplc_show_chat_detail.name&&(d+=c)):d+="<div class='wplc-msg-content'>";var w=i;p?i="<a href='"+i+"' target='_blank'>"+("undefined"!=typeof wplc_visitor_voice&&void 0!==wplc_visitor_voice.play_sound?wplc_visitor_voice.play_sound:"Open Voice Note")+"</a>":"undefined"!=typeof wplcFormatParser&&(void 0!==e.other&&void 0!==e.other.ignore_style_tags&&!0===e.other.ignore_style_tags||(i=wplcFormatParser(i)));var m=document.createElement("DIV");m.innerHTML=w,w=m.textContent||m.innerText||"",gifExtensionPattern.test(i)?(cleanedGif=getCleanedGif(i),d+="<span class='messageBody' data-message='"+cleanedGif+"'><img src='"+cleanedGif+"' class='gif-img'/></span>"+s):d+=p?"<span class='messageBody'>"+i+"</span>":"<span class='messageBody' data-message='"+w+"'>"+i+"</span>"+s,d+="</div>",d+="</span>",d+=wplc_add_date_and_time(e,e.originates),"u"===t?wplc_chat_box_elemn="#wplc_chatbox":"undefined"!=typeof bleeper_remote_enabled?wplc_chat_box_elemn="#messages":wplc_chat_box_elemn="#admin_chat_box_area_"+wplc_cid,jQuery(wplc_chat_box_elemn).append(d)}}a()}WPLCServer.Socket={},WPLCServer.Ajax={init:function(e,t,a,_,r){wplc_server_log("Ajax Init"),"function"==typeof e&&e()},send:function(e,t,a,_,r,n,o){jQuery.ajax({url:e,data:t,type:a,timeout:_,success:function(e){"function"==typeof r&&(void 0!==t.action&&"wplc_start_chat"!==t.action?r(e):"undefined"!=typeof wplc_use_node_server&&"true"===wplc_use_node_server&&window.WebSocket&&r(e))},error:function(e,t){"function"==typeof n&&n(e,t)},complete:function(e){"function"==typeof o&&o(e,t)}})},isInSocketMode:function(){return wplc_node_sockets_ready},isPreparingSocketMode:function(){var e=!1;return"undefined"!=typeof wplc_use_node_server&&"true"===wplc_use_node_server&&window.WebSocket&&(e=!0),e},transportPrepared:function(){return wplc_transport_prepared},asyncStorage:function(e,t,a){},forceClosePort:function(){},sendMessage:function(e,t,a,_,r,n,o){WPLCServer.Ajax.send(e,t,a,_,r,n,o)}},String.prototype.wpl