Version Description
- Massive improvements to the performance of the plugin
- New, modern dashboard
- The dashboard can now be added to all admin pages
- Dynamic visitor filtering
- Improved REST API Security
- OS identification
- Better Browser identification
- Mobile/desktop identification
- Country identification (API)
- Inline link handling
- Security patches
- Gutenberg support
- Full WPML Support
- Showcase user's timezone
- Emoticons added to the chatbox
- New API endpoints
- Refactor JS code backend and frontend to make use of events
- Store messages using sessionStorage to avoid unnecessary DB calls
- Better polling system for visitor tracking
- Better history UI
- Support for the new iOS app
- Support for the new Android App
- Support for the new Desktop App
Download this release
Release Info
Developer | WP-LiveChat |
Plugin | WP Live Chat Support |
Version | 8.0.01 |
Comparing to | |
See all releases |
Code changes from version 7.1.08 to 8.0.01
- ajax_new.php +0 -0
- beep-2.mp3 +0 -0
- css/ace.css +445 -0
- css/admin-chat-box-style.css +13 -0
- css/admin-chat-style.css +432 -0
- css/admin_styles.css +306 -0
- css/chat-style.css +258 -357
- css/font-awesome.min.css +2335 -2
- css/fontawesome-iconpicker.css +335 -0
- css/images/ui-bg_flat_10_000000_40x100.png +0 -0
- css/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- css/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- css/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- css/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- css/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- css/images/ui-icons_ffffff_256x240.png +0 -0
- css/jquery-ui.css +0 -0
- css/node_history_styles.css +75 -0
- css/remote_dash_styles.css +1221 -0
- css/support-css.css +7 -0
- css/themes/classic.css +115 -1
- css/themes/modern.css +127 -8
- css/themes/position-bottom-left.css +0 -0
- css/themes/position-bottom-right.css +0 -0
- css/themes/position-left.css +0 -0
- css/themes/position-right.css +0 -0
- css/themes/theme-1.css +0 -0
- css/themes/theme-2.css +0 -0
- css/themes/theme-3.css +0 -0
- css/themes/theme-4.css +0 -0
- css/themes/theme-5.css +0 -0
- css/themes/theme-default.css +0 -0
- css/toastr.css +0 -0
- css/wplc-survey-style-before.css +0 -0
- css/wplc-survey-style.css +3 -8
- css/wplc_gutenberg_template_styles.css +217 -0
- css/wplcstyle.css +81 -0
- css/wplcstyle_old.css +0 -0
- ding.mp3 +0 -0
- fonts/fontawesome-webfont.woff2 +0 -0
- functions.php +557 -360
- images/48px.png +0 -0
- images/48px_n.png +0 -0
- images/add-on0.jpg +0 -0
- images/add-on1.jpg +0 -0
- images/add-on2.jpg +0 -0
- images/add-on3.jpg +0 -0
- images/add-on4.jpg +0 -0
- images/ajax-loader.gif +0 -0
- images/bg/cloudy.jpg +0 -0
- images/bg/geometry.jpg +0 -0
- images/bg/social.jpg +0 -0
- images/bg/tech.jpg +0 -0
- images/chaticon.png +0 -0
- images/chrome_16x16.png +0 -0
- images/chrome_32x32.png +0 -0
- images/codecabin.png +0 -0
- images/firefox_16x16.png +0 -0
- images/firefox_32x32.png +0 -0
- images/flash.ico +0 -0
- images/iconCloseRetina.png +0 -0
- images/iconRetina.png +0 -0
- images/iconmicro.png +0 -0
- images/internet-explorer_16x16.png +0 -0
- images/internet-explorer_32x32.png +0 -0
- images/loader2.gif +0 -0
- images/opera_16x16.png +0 -0
- images/opera_32x32.png +0 -0
- images/performance.png +0 -0
- images/plugin1.jpg +0 -0
- images/plugin2.jpg +0 -0
- images/reporting_sample.jpg +0 -0
- images/safari_16x16.png +0 -0
- images/safari_32x32.png +0 -0
- images/support.png +0 -0
- images/themes/newtheme-1.jpg +0 -0
- images/themes/newtheme-2.jpg +0 -0
- images/themes/theme-1.png +0 -0
- images/themes/theme-2.png +0 -0
- images/themes/theme-3.png +0 -0
- images/themes/theme-4.png +0 -0
- images/themes/theme-5.png +0 -0
- images/themes/theme-6.png +0 -0
- images/trigger_sample.jpg +0 -0
- images/trigger_sample_front.jpg +0 -0
- images/ui-bg_flat_10_000000_40x100.png +0 -0
- images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- images/ui-icons_ffffff_256x240.png +0 -0
- images/web_16x16.png +0 -0
- images/web_32x32.png +0 -0
- images/wplc-logo.png +0 -0
- images/wplc_notification_icon.png +0 -0
- includes/Mobile_Detect.php +0 -0
- includes/blocks/wplc-chat-box/block.js +130 -0
- includes/blocks/wplc-chat-box/editor.css +90 -0
- includes/blocks/wplc-chat-box/index.php +241 -0
- includes/blocks/wplc-chat-box/style.css +149 -0
- includes/blocks/wplc-chat-box/wplc_gutenberg_template_styles.css +366 -0
- includes/credits.php +58 -29
- includes/deprecated.php +0 -0
- includes/feedback-page.php +0 -0
- includes/modal_control.php +2 -1
- includes/notification_control.php +0 -0
- includes/settings_page.php +25 -4
- includes/surveys.php +71 -16
- includes/update_control.class.php +2 -0
- includes/welcome_page.php +32 -13
- js/ace.js +134 -0
- js/arrow.gif +0 -0
- js/cross.gif +0 -0
- js/fontawesome-iconpicker.js +1025 -0
- js/hs.png +0 -0
- js/hv.png +0 -0
- js/jquery-cookie.js +0 -0
- js/jscolor.js +0 -0
- js/md5.js +0 -0
- js/themes/classic.js +42 -21
- js/themes/modern.js +234 -48
- js/toastr.js +0 -0
- js/wplc-admin-modal.js +25 -1
- js/wplc-admin-pointers.js +133 -4
- js/wplc_admin_dynamic_translations.js +9 -0
- js/wplc_admin_popup.js +15 -0
- js/wplc_error_handling.js +0 -0
- js/wplc_gutenberg.js +201 -0
- js/wplc_heartbeat.js +25 -0
- js/wplc_lead_forms.js +7 -0
- js/wplc_node_offline_mode_controller.js +16 -0
- js/wplc_plugin_row.js +0 -0
- js/wplc_server.js +341 -102
- js/wplc_surveys.js +6 -1
- js/wplc_tabs.js +51 -4
- js/wplc_u.js +586 -1027
- js/wplc_u.min.js +0 -0
- js/wplc_u_admin.js +10 -4
- js/wplc_u_admin_chat.js +60 -69
- js/wplc_u_admin_chatbox_ui_events.js +197 -0
- js/wplc_u_admin_events.js +849 -0
- js/wplc_u_events.js +540 -0
- js/wplc_u_node_events.js +410 -0
- languages/wplivechat-cs_CZ.mo +0 -0
- languages/wplivechat-cs_CZ.po +0 -0
- languages/wplivechat-da_DA.mo +0 -0
- languages/wplivechat-da_DA.po +0 -0
- languages/wplivechat-da_DK.mo +0 -0
- languages/wplivechat-da_DK.po +0 -0
- languages/wplivechat-de_CH.po +0 -0
- languages/wplivechat-de_DE.mo +0 -0
- languages/wplivechat-de_DE.po +0 -0
- languages/wplivechat-el.mo +0 -0
- languages/wplivechat-el.po +0 -0
- languages/wplivechat-en_EN.mo +0 -0
- languages/wplivechat-en_EN.po +0 -0
- languages/wplivechat-es_ES.mo +0 -0
- languages/wplivechat-es_ES.po +0 -0
- languages/wplivechat-et_EE.mo +0 -0
- languages/wplivechat-et_EE.po +0 -0
- languages/wplivechat-fa_IR.mo +0 -0
- languages/wplivechat-fa_IR.po +0 -0
- languages/wplivechat-fi.mo +0 -0
- languages/wplivechat-fi.po +0 -0
- languages/wplivechat-fi_FI.mo +0 -0
- languages/wplivechat-fi_FI.po +0 -0
- languages/wplivechat-fr_FR.mo +0 -0
- languages/wplivechat-fr_FR.po +0 -0
- languages/wplivechat-he_IL.mo +0 -0
- languages/wplivechat-he_IL.po +0 -0
- languages/wplivechat-hr.mo +0 -0
- languages/wplivechat-hr.po +0 -0
- languages/wplivechat-hu-HU.mo +0 -0
- languages/wplivechat-hu-HU.po +0 -0
- languages/wplivechat-hu.mo +0 -0
- languages/wplivechat-hu.po +0 -0
- languages/wplivechat-hu_HU.mo +0 -0
- languages/wplivechat-hu_HU.po +0 -0
- languages/wplivechat-in_ID.mo +0 -0
- languages/wplivechat-in_ID.po +0 -0
- languages/wplivechat-it_IT.mo +0 -0
- languages/wplivechat-it_IT.po +0 -0
- languages/wplivechat-ja.po +0 -0
- languages/wplivechat-ko_KR.mo +0 -0
- languages/wplivechat-ko_KR.po +0 -0
- languages/wplivechat-mn_MN.mo +0 -0
- languages/wplivechat-mn_MN.po +0 -0
- languages/wplivechat-nb_NO.mo +0 -0
- languages/wplivechat-nb_NO.po +0 -0
- languages/wplivechat-nl_NL.mo +0 -0
- languages/wplivechat-nl_NL.po +0 -0
- languages/wplivechat-pl_PL.mo +0 -0
- languages/wplivechat-pl_PL.po +0 -0
- languages/wplivechat-pt_BR.mo +0 -0
- languages/wplivechat-pt_BR.po +0 -0
- languages/wplivechat-pt_PT.mo +0 -0
- languages/wplivechat-pt_PT.po +0 -0
- languages/wplivechat-ro_RO.mo +0 -0
- languages/wplivechat-ro_RO.po +0 -0
- languages/wplivechat-ru_RU.mo +0 -0
- languages/wplivechat-ru_RU.po +0 -0
- languages/wplivechat-sk_SK.mo +0 -0
- languages/wplivechat-sk_SK.po +0 -0
- languages/wplivechat-sq.mo +0 -0
- languages/wplivechat-sq.po +0 -0
- languages/wplivechat-sv_SE.mo +0 -0
- languages/wplivechat-sv_SE.po +0 -0
- languages/wplivechat-tr-TR.mo +0 -0
- languages/wplivechat-tr-TR.po +0 -0
- languages/wplivechat-zh_CN.mo +0 -0
- languages/wplivechat-zh_CN.po +0 -0
- languages/wplivechat-zh_TW.mo +0 -0
- languages/wplivechat-zh_TW.po +0 -0
- lib/codecabin/plugin-deactivation-survey/README.md +26 -0
- lib/codecabin/plugin-deactivation-survey/deactivate-feedback-form.css +30 -0
- lib/codecabin/plugin-deactivation-survey/deactivate-feedback-form.js +120 -0
- lib/codecabin/plugin-deactivation-survey/deactivate-feedback-form.php +78 -0
- lib/codecabin/plugin-deactivation-survey/remodal-default-theme.css +323 -0
- lib/codecabin/plugin-deactivation-survey/remodal.css +93 -0
- lib/codecabin/plugin-deactivation-survey/remodal.min.js +10 -0
- modules/api/wplc-api-functions.php +360 -76
- modules/api/wplc-api-routes.php +59 -37
- modules/api/wplc-api.php +1 -1
- modules/beta_features.php +101 -56
- modules/documentation_suggestions.php +0 -0
- modules/google_analytics.php +1 -1
- modules/module_subscribe.php +0 -0
- modules/node_server.php +928 -287
- modules/node_server_deprecated.php +370 -0
- modules/offline_messages_custom_fields.php +0 -0
- modules/webhooks_manager.php +490 -0
- readme.txt +29 -0
- ring.wav +0 -0
- wp-live-chat-support.php +1198 -768
ajax_new.php
CHANGED
File without changes
|
beep-2.mp3
CHANGED
File without changes
|
css/ace.css
ADDED
@@ -0,0 +1,445 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.ace_editor {
|
2 |
+
position: relative;
|
3 |
+
overflow: hidden;
|
4 |
+
font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
|
5 |
+
direction: ltr;
|
6 |
+
text-align: left;
|
7 |
+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
8 |
+
}
|
9 |
+
|
10 |
+
.ace_scroller {
|
11 |
+
position: absolute;
|
12 |
+
overflow: hidden;
|
13 |
+
top: 0;
|
14 |
+
bottom: 0;
|
15 |
+
background-color: inherit;
|
16 |
+
-ms-user-select: none;
|
17 |
+
-moz-user-select: none;
|
18 |
+
-webkit-user-select: none;
|
19 |
+
user-select: none;
|
20 |
+
cursor: text;
|
21 |
+
}
|
22 |
+
|
23 |
+
.ace_content {
|
24 |
+
position: absolute;
|
25 |
+
box-sizing: border-box;
|
26 |
+
min-width: 100%;
|
27 |
+
}
|
28 |
+
|
29 |
+
.ace_dragging .ace_scroller:before{
|
30 |
+
position: absolute;
|
31 |
+
top: 0;
|
32 |
+
left: 0;
|
33 |
+
right: 0;
|
34 |
+
bottom: 0;
|
35 |
+
content: '';
|
36 |
+
background: rgba(250, 250, 250, 0.01);
|
37 |
+
z-index: 1000;
|
38 |
+
}
|
39 |
+
.ace_dragging.ace_dark .ace_scroller:before{
|
40 |
+
background: rgba(0, 0, 0, 0.01);
|
41 |
+
}
|
42 |
+
|
43 |
+
.ace_selecting, .ace_selecting * {
|
44 |
+
cursor: text !important;
|
45 |
+
}
|
46 |
+
|
47 |
+
.ace_gutter {
|
48 |
+
position: absolute;
|
49 |
+
overflow : hidden;
|
50 |
+
width: auto;
|
51 |
+
top: 0;
|
52 |
+
bottom: 0;
|
53 |
+
left: 0;
|
54 |
+
cursor: default;
|
55 |
+
z-index: 4;
|
56 |
+
-ms-user-select: none;
|
57 |
+
-moz-user-select: none;
|
58 |
+
-webkit-user-select: none;
|
59 |
+
user-select: none;
|
60 |
+
}
|
61 |
+
|
62 |
+
.ace_gutter-active-line {
|
63 |
+
position: absolute;
|
64 |
+
left: 0;
|
65 |
+
right: 0;
|
66 |
+
}
|
67 |
+
|
68 |
+
.ace_scroller.ace_scroll-left {
|
69 |
+
box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;
|
70 |
+
}
|
71 |
+
|
72 |
+
.ace_gutter-cell {
|
73 |
+
padding-left: 19px;
|
74 |
+
padding-right: 6px;
|
75 |
+
background-repeat: no-repeat;
|
76 |
+
}
|
77 |
+
|
78 |
+
.ace_gutter-cell.ace_error {
|
79 |
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");
|
80 |
+
background-repeat: no-repeat;
|
81 |
+
background-position: 2px center;
|
82 |
+
}
|
83 |
+
|
84 |
+
.ace_gutter-cell.ace_warning {
|
85 |
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");
|
86 |
+
background-position: 2px center;
|
87 |
+
}
|
88 |
+
|
89 |
+
.ace_gutter-cell.ace_info {
|
90 |
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");
|
91 |
+
background-position: 2px center;
|
92 |
+
}
|
93 |
+
.ace_dark .ace_gutter-cell.ace_info {
|
94 |
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");
|
95 |
+
}
|
96 |
+
|
97 |
+
.ace_scrollbar {
|
98 |
+
position: absolute;
|
99 |
+
right: 0;
|
100 |
+
bottom: 0;
|
101 |
+
z-index: 6;
|
102 |
+
}
|
103 |
+
|
104 |
+
.ace_scrollbar-inner {
|
105 |
+
position: absolute;
|
106 |
+
cursor: text;
|
107 |
+
left: 0;
|
108 |
+
top: 0;
|
109 |
+
}
|
110 |
+
|
111 |
+
.ace_scrollbar-v{
|
112 |
+
overflow-x: hidden;
|
113 |
+
overflow-y: scroll;
|
114 |
+
top: 0;
|
115 |
+
}
|
116 |
+
|
117 |
+
.ace_scrollbar-h {
|
118 |
+
overflow-x: scroll;
|
119 |
+
overflow-y: hidden;
|
120 |
+
left: 0;
|
121 |
+
}
|
122 |
+
|
123 |
+
.ace_print-margin {
|
124 |
+
position: absolute;
|
125 |
+
height: 100%;
|
126 |
+
}
|
127 |
+
|
128 |
+
.ace_text-input {
|
129 |
+
position: absolute;
|
130 |
+
z-index: 0;
|
131 |
+
width: 0.5em;
|
132 |
+
height: 1em;
|
133 |
+
opacity: 0;
|
134 |
+
background: transparent;
|
135 |
+
-moz-appearance: none;
|
136 |
+
appearance: none;
|
137 |
+
border: none;
|
138 |
+
resize: none;
|
139 |
+
outline: none;
|
140 |
+
overflow: hidden;
|
141 |
+
font: inherit;
|
142 |
+
padding: 0 1px;
|
143 |
+
margin: 0 -1px;
|
144 |
+
text-indent: -1em;
|
145 |
+
-ms-user-select: text;
|
146 |
+
-moz-user-select: text;
|
147 |
+
-webkit-user-select: text;
|
148 |
+
user-select: text;
|
149 |
+
/*with `pre-line` chrome inserts instead of space*/
|
150 |
+
white-space: pre!important;
|
151 |
+
}
|
152 |
+
|
153 |
+
.ace_text-input.ace_composition {
|
154 |
+
background: inherit;
|
155 |
+
color: inherit;
|
156 |
+
z-index: 1000;
|
157 |
+
opacity: 1;
|
158 |
+
text-indent: 0;
|
159 |
+
}
|
160 |
+
|
161 |
+
.ace_layer {
|
162 |
+
z-index: 1;
|
163 |
+
position: absolute;
|
164 |
+
overflow: hidden;
|
165 |
+
/* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/
|
166 |
+
word-wrap: normal;
|
167 |
+
white-space: pre;
|
168 |
+
height: 100%;
|
169 |
+
width: 100%;
|
170 |
+
box-sizing: border-box;
|
171 |
+
/* setting pointer-events: auto; on node under the mouse, which changes
|
172 |
+
during scroll, will break mouse wheel scrolling in Safari */
|
173 |
+
pointer-events: none;
|
174 |
+
}
|
175 |
+
|
176 |
+
.ace_gutter-layer {
|
177 |
+
position: relative;
|
178 |
+
width: auto;
|
179 |
+
text-align: right;
|
180 |
+
pointer-events: auto;
|
181 |
+
}
|
182 |
+
|
183 |
+
.ace_text-layer {
|
184 |
+
font: inherit !important;
|
185 |
+
}
|
186 |
+
|
187 |
+
.ace_cjk {
|
188 |
+
display: inline-block;
|
189 |
+
text-align: center;
|
190 |
+
}
|
191 |
+
|
192 |
+
.ace_cursor-layer {
|
193 |
+
z-index: 4;
|
194 |
+
}
|
195 |
+
|
196 |
+
.ace_cursor {
|
197 |
+
z-index: 4;
|
198 |
+
position: absolute;
|
199 |
+
box-sizing: border-box;
|
200 |
+
border-left: 2px solid;
|
201 |
+
/* workaround for smooth cursor repaintng whole screen in chrome */
|
202 |
+
transform: translatez(0);
|
203 |
+
}
|
204 |
+
|
205 |
+
.ace_multiselect .ace_cursor {
|
206 |
+
border-left-width: 1px;
|
207 |
+
}
|
208 |
+
|
209 |
+
.ace_slim-cursors .ace_cursor {
|
210 |
+
border-left-width: 1px;
|
211 |
+
}
|
212 |
+
|
213 |
+
.ace_overwrite-cursors .ace_cursor {
|
214 |
+
border-left-width: 0;
|
215 |
+
border-bottom: 1px solid;
|
216 |
+
}
|
217 |
+
|
218 |
+
.ace_hidden-cursors .ace_cursor {
|
219 |
+
opacity: 0.2;
|
220 |
+
}
|
221 |
+
|
222 |
+
.ace_smooth-blinking .ace_cursor {
|
223 |
+
transition: opacity 0.18s;
|
224 |
+
}
|
225 |
+
|
226 |
+
.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {
|
227 |
+
position: absolute;
|
228 |
+
z-index: 3;
|
229 |
+
}
|
230 |
+
|
231 |
+
.ace_marker-layer .ace_selection {
|
232 |
+
position: absolute;
|
233 |
+
z-index: 5;
|
234 |
+
}
|
235 |
+
|
236 |
+
.ace_marker-layer .ace_bracket {
|
237 |
+
position: absolute;
|
238 |
+
z-index: 6;
|
239 |
+
}
|
240 |
+
|
241 |
+
.ace_marker-layer .ace_active-line {
|
242 |
+
position: absolute;
|
243 |
+
z-index: 2;
|
244 |
+
}
|
245 |
+
|
246 |
+
.ace_marker-layer .ace_selected-word {
|
247 |
+
position: absolute;
|
248 |
+
z-index: 4;
|
249 |
+
box-sizing: border-box;
|
250 |
+
}
|
251 |
+
|
252 |
+
.ace_line .ace_fold {
|
253 |
+
box-sizing: border-box;
|
254 |
+
|
255 |
+
display: inline-block;
|
256 |
+
height: 11px;
|
257 |
+
margin-top: -2px;
|
258 |
+
vertical-align: middle;
|
259 |
+
|
260 |
+
background-image:
|
261 |
+
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
|
262 |
+
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");
|
263 |
+
background-repeat: no-repeat, repeat-x;
|
264 |
+
background-position: center center, top left;
|
265 |
+
color: transparent;
|
266 |
+
|
267 |
+
border: 1px solid black;
|
268 |
+
border-radius: 2px;
|
269 |
+
|
270 |
+
cursor: pointer;
|
271 |
+
pointer-events: auto;
|
272 |
+
}
|
273 |
+
|
274 |
+
.ace_dark .ace_fold {
|
275 |
+
}
|
276 |
+
|
277 |
+
.ace_fold:hover{
|
278 |
+
background-image:
|
279 |
+
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
|
280 |
+
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");
|
281 |
+
}
|
282 |
+
|
283 |
+
.ace_tooltip {
|
284 |
+
background-color: #FFF;
|
285 |
+
background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));
|
286 |
+
border: 1px solid gray;
|
287 |
+
border-radius: 1px;
|
288 |
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
|
289 |
+
color: black;
|
290 |
+
max-width: 100%;
|
291 |
+
padding: 3px 4px;
|
292 |
+
position: fixed;
|
293 |
+
z-index: 999999;
|
294 |
+
box-sizing: border-box;
|
295 |
+
cursor: default;
|
296 |
+
white-space: pre;
|
297 |
+
word-wrap: break-word;
|
298 |
+
line-height: normal;
|
299 |
+
font-style: normal;
|
300 |
+
font-weight: normal;
|
301 |
+
letter-spacing: normal;
|
302 |
+
pointer-events: none;
|
303 |
+
}
|
304 |
+
|
305 |
+
.ace_folding-enabled > .ace_gutter-cell {
|
306 |
+
padding-right: 13px;
|
307 |
+
}
|
308 |
+
|
309 |
+
.ace_fold-widget {
|
310 |
+
box-sizing: border-box;
|
311 |
+
|
312 |
+
margin: 0 -12px 0 1px;
|
313 |
+
display: none;
|
314 |
+
width: 11px;
|
315 |
+
vertical-align: top;
|
316 |
+
|
317 |
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");
|
318 |
+
background-repeat: no-repeat;
|
319 |
+
background-position: center;
|
320 |
+
|
321 |
+
border-radius: 3px;
|
322 |
+
|
323 |
+
border: 1px solid transparent;
|
324 |
+
cursor: pointer;
|
325 |
+
}
|
326 |
+
|
327 |
+
.ace_folding-enabled .ace_fold-widget {
|
328 |
+
display: inline-block;
|
329 |
+
}
|
330 |
+
|
331 |
+
.ace_fold-widget.ace_end {
|
332 |
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");
|
333 |
+
}
|
334 |
+
|
335 |
+
.ace_fold-widget.ace_closed {
|
336 |
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");
|
337 |
+
}
|
338 |
+
|
339 |
+
.ace_fold-widget:hover {
|
340 |
+
border: 1px solid rgba(0, 0, 0, 0.3);
|
341 |
+
background-color: rgba(255, 255, 255, 0.2);
|
342 |
+
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
|
343 |
+
}
|
344 |
+
|
345 |
+
.ace_fold-widget:active {
|
346 |
+
border: 1px solid rgba(0, 0, 0, 0.4);
|
347 |
+
background-color: rgba(0, 0, 0, 0.05);
|
348 |
+
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
|
349 |
+
}
|
350 |
+
/**
|
351 |
+
* Dark version for fold widgets
|
352 |
+
*/
|
353 |
+
.ace_dark .ace_fold-widget {
|
354 |
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");
|
355 |
+
}
|
356 |
+
.ace_dark .ace_fold-widget.ace_end {
|
357 |
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");
|
358 |
+
}
|
359 |
+
.ace_dark .ace_fold-widget.ace_closed {
|
360 |
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");
|
361 |
+
}
|
362 |
+
.ace_dark .ace_fold-widget:hover {
|
363 |
+
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
|
364 |
+
background-color: rgba(255, 255, 255, 0.1);
|
365 |
+
}
|
366 |
+
.ace_dark .ace_fold-widget:active {
|
367 |
+
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
|
368 |
+
}
|
369 |
+
|
370 |
+
.ace_fold-widget.ace_invalid {
|
371 |
+
background-color: #FFB4B4;
|
372 |
+
border-color: #DE5555;
|
373 |
+
}
|
374 |
+
|
375 |
+
.ace_fade-fold-widgets .ace_fold-widget {
|
376 |
+
transition: opacity 0.4s ease 0.05s;
|
377 |
+
opacity: 0;
|
378 |
+
}
|
379 |
+
|
380 |
+
.ace_fade-fold-widgets:hover .ace_fold-widget {
|
381 |
+
transition: opacity 0.05s ease 0.05s;
|
382 |
+
opacity:1;
|
383 |
+
}
|
384 |
+
|
385 |
+
.ace_underline {
|
386 |
+
text-decoration: underline;
|
387 |
+
}
|
388 |
+
|
389 |
+
.ace_bold {
|
390 |
+
font-weight: bold;
|
391 |
+
}
|
392 |
+
|
393 |
+
.ace_nobold .ace_bold {
|
394 |
+
font-weight: normal;
|
395 |
+
}
|
396 |
+
|
397 |
+
.ace_italic {
|
398 |
+
font-style: italic;
|
399 |
+
}
|
400 |
+
|
401 |
+
|
402 |
+
.ace_error-marker {
|
403 |
+
background-color: rgba(255, 0, 0,0.2);
|
404 |
+
position: absolute;
|
405 |
+
z-index: 9;
|
406 |
+
}
|
407 |
+
|
408 |
+
.ace_highlight-marker {
|
409 |
+
background-color: rgba(255, 255, 0,0.2);
|
410 |
+
position: absolute;
|
411 |
+
z-index: 8;
|
412 |
+
}
|
413 |
+
|
414 |
+
/*
|
415 |
+
styles = []
|
416 |
+
for (var i = 1; i < 16; i++) {
|
417 |
+
styles.push(".ace_br" + i + "{" + (
|
418 |
+
["top-left", "top-right", "bottom-right", "bottom-left"]
|
419 |
+
).map(function(x, j) {
|
420 |
+
return i & (1<<j) ? "border-" + x + "-radius: 3px;" : ""
|
421 |
+
}).filter(Boolean).join(" ") + "}")
|
422 |
+
}
|
423 |
+
styles.join("\n")
|
424 |
+
*/
|
425 |
+
.ace_br1 {border-top-left-radius : 3px;}
|
426 |
+
.ace_br2 {border-top-right-radius : 3px;}
|
427 |
+
.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}
|
428 |
+
.ace_br4 {border-bottom-right-radius: 3px;}
|
429 |
+
.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}
|
430 |
+
.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}
|
431 |
+
.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}
|
432 |
+
.ace_br8 {border-bottom-left-radius : 3px;}
|
433 |
+
.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}
|
434 |
+
.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}
|
435 |
+
.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}
|
436 |
+
.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
|
437 |
+
.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
|
438 |
+
.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
|
439 |
+
.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}
|
440 |
+
|
441 |
+
.ace_text-input-ios {
|
442 |
+
position: absolute !important;
|
443 |
+
top: -100000px !important;
|
444 |
+
left: -100000px !important;
|
445 |
+
}
|
css/admin-chat-box-style.css
CHANGED
@@ -25,3 +25,16 @@
|
|
25 |
}
|
26 |
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
}
|
26 |
|
27 |
|
28 |
+
.typing_indicator {
|
29 |
+
background: inherit !important;
|
30 |
+
}
|
31 |
+
|
32 |
+
.wplc-admin-message-avatar, .wplc-user-message-avatar{
|
33 |
+
max-width:29px;
|
34 |
+
max-height:29px;
|
35 |
+
}
|
36 |
+
|
37 |
+
.admin_chat_box_inner_bottom .typing_indicator {
|
38 |
+
background-color: transparent !important;
|
39 |
+
color: #333 !important;
|
40 |
+
}
|
css/admin-chat-style.css
ADDED
@@ -0,0 +1,432 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Chat page, header section, user info
|
3 |
+
*/
|
4 |
+
#nifty_wrapper .user_header_wrapper_info {
|
5 |
+
display: block;
|
6 |
+
position: relative;
|
7 |
+
top: -8px;
|
8 |
+
float: left;
|
9 |
+
width: 60% !important;
|
10 |
+
height: calc(100% + 1px);
|
11 |
+
padding: 8px;
|
12 |
+
overflow-x: hidden;
|
13 |
+
overflow-y: auto;
|
14 |
+
font-size: 0.9em;
|
15 |
+
line-height: 1em;
|
16 |
+
background-color: #fefefe;
|
17 |
+
border-radius: 3px;
|
18 |
+
}
|
19 |
+
|
20 |
+
#nifty_wrapper .user_header_wrapper_info h3 {
|
21 |
+
font-size: 1.5em;
|
22 |
+
margin-top:0px;
|
23 |
+
margin-bottom:8px;
|
24 |
+
}
|
25 |
+
#nifty_wrapper .user_header_wrapper_info h4 {
|
26 |
+
font-size: 1.3em;
|
27 |
+
margin-bottom:8px;
|
28 |
+
}
|
29 |
+
#nifty_wrapper .user_header_wrapper_info p {
|
30 |
+
font-size: 1em;
|
31 |
+
margin-bottom:0px;
|
32 |
+
}
|
33 |
+
|
34 |
+
/* Join chat button */
|
35 |
+
#nifty_wrapper .bleeper_join_chat_div button {
|
36 |
+
position: relative;
|
37 |
+
left: 33.3%;
|
38 |
+
top: 15px;
|
39 |
+
width: 33.3%;
|
40 |
+
background-color: #ed832f;
|
41 |
+
border: 1px solid #e2731b;
|
42 |
+
color: #fafafa;
|
43 |
+
font-weight: 600;
|
44 |
+
font-size: 1.2em;
|
45 |
+
}
|
46 |
+
|
47 |
+
@media(max-width:767px) {
|
48 |
+
|
49 |
+
/* Chat page, header section, user info */
|
50 |
+
#nifty_wrapper .user_header_wrapper_info h3,
|
51 |
+
#nifty_wrapper .user_header_wrapper_info h4,
|
52 |
+
#nifty_wrapper .user_header_wrapper_info p {
|
53 |
+
line-height:1;
|
54 |
+
}
|
55 |
+
#nifty_wrapper .user_header_wrapper_info h3 {
|
56 |
+
font-size: 1em;
|
57 |
+
}
|
58 |
+
#nifty_wrapper .user_header_wrapper_info h4 {
|
59 |
+
font-size: 0.9em;
|
60 |
+
}
|
61 |
+
#nifty_wrapper .user_header_wrapper_info p {
|
62 |
+
font-size: 0.9em;
|
63 |
+
}
|
64 |
+
|
65 |
+
#nifty_wrapper .user_header_wrapper_info h3 a,
|
66 |
+
#nifty_wrapper .user_header_wrapper_info h4 a,
|
67 |
+
#nifty_wrapper .user_header_wrapper_info p a {
|
68 |
+
display: block;
|
69 |
+
margin-top: 0px;
|
70 |
+
word-wrap: break-word;
|
71 |
+
line-height: 1em;
|
72 |
+
}
|
73 |
+
|
74 |
+
#nifty_wrapper .user_header_wrapper_info .chatInfoArea-Email:before {
|
75 |
+
display: inline-block;
|
76 |
+
position: relative;
|
77 |
+
left: 0px;
|
78 |
+
top: 0px;
|
79 |
+
margin-right:5px;
|
80 |
+
content:"email: ";
|
81 |
+
}
|
82 |
+
|
83 |
+
/* Chat page, header section, buttons */
|
84 |
+
#nifty_wrapper .eventbox {
|
85 |
+
position: absolute;
|
86 |
+
right: -3px;
|
87 |
+
top: 80px;
|
88 |
+
}
|
89 |
+
|
90 |
+
#nifty_wrapper span.minChat {
|
91 |
+
margin-top: -5px;
|
92 |
+
}
|
93 |
+
|
94 |
+
}
|
95 |
+
|
96 |
+
@media(max-width:500px) {
|
97 |
+
/* Chat page, header section, user image */
|
98 |
+
#nifty_wrapper .user_header_wrapper_img {
|
99 |
+
display:none;
|
100 |
+
}
|
101 |
+
#nifty_wrapper .user_header_wrapper_info {
|
102 |
+
width: 56% !important;
|
103 |
+
border: 1px solid #f1f1f1;
|
104 |
+
background-color: #fcfcfc;
|
105 |
+
}
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Admin chat page
|
110 |
+
*/
|
111 |
+
#nifty_wrapper span.minChat {
|
112 |
+
margin-top: 0px;
|
113 |
+
}
|
114 |
+
#nifty_wrapper .chatArea .messages {
|
115 |
+
background-size: cover;
|
116 |
+
border: 1px solid #e6e6e6;
|
117 |
+
}
|
118 |
+
#nifty_wrapper .timedate {
|
119 |
+
display:none;
|
120 |
+
}
|
121 |
+
|
122 |
+
/* System notification messages */
|
123 |
+
#nifty_wrapper .messages .wplc_system_notification {
|
124 |
+
display: block;
|
125 |
+
position: relative;
|
126 |
+
top: 0px;
|
127 |
+
width: 100%;
|
128 |
+
}
|
129 |
+
#nifty_wrapper .messages .wplc_system_notification .messageBody {
|
130 |
+
display: block;
|
131 |
+
position: relative;
|
132 |
+
left: 0px;
|
133 |
+
top: 7px;
|
134 |
+
width: 100%;
|
135 |
+
margin-top: 10px;
|
136 |
+
margin-bottom: 10px;
|
137 |
+
padding: 10px;
|
138 |
+
background-color: #fafafa;
|
139 |
+
border: 1px solid #e6e6e6;
|
140 |
+
border-radius: 5px;
|
141 |
+
color: #555555;
|
142 |
+
line-height:1.2em;
|
143 |
+
}
|
144 |
+
#nifty_wrapper .messages .wplc_system_notification .messageBody .wplc_system_notification {
|
145 |
+
display: inline-block;
|
146 |
+
position: relative;
|
147 |
+
left: 0px;
|
148 |
+
top: 0px;
|
149 |
+
width: auto;
|
150 |
+
height:auto;
|
151 |
+
margin-top: 0px;
|
152 |
+
margin-bottom: 0px;
|
153 |
+
background-color: transparent;
|
154 |
+
border: none;
|
155 |
+
border-radius: 0px;
|
156 |
+
}
|
157 |
+
#nifty_wrapper .messages .wplc_system_notification .messageBody .chat_time {
|
158 |
+
display: block;
|
159 |
+
position: relative;
|
160 |
+
left: 0px;
|
161 |
+
top: 0px;
|
162 |
+
width: 100%;
|
163 |
+
margin-bottom: 5px;
|
164 |
+
font-size: 0.9em;
|
165 |
+
font-weight: 600;
|
166 |
+
color: #555555;
|
167 |
+
}
|
168 |
+
|
169 |
+
/* Admin and user messages */
|
170 |
+
#nifty_wrapper ul.messages {
|
171 |
+
padding-bottom: 35px;
|
172 |
+
}
|
173 |
+
#nifty_wrapper .messages .wplc-admin-message,
|
174 |
+
#nifty_wrapper .messages .wplc-user-message {
|
175 |
+
display: block;
|
176 |
+
position: relative;
|
177 |
+
width: 100%;
|
178 |
+
height: auto;
|
179 |
+
clear: both;
|
180 |
+
}
|
181 |
+
#nifty_wrapper .messages .wplc-admin-message::before,
|
182 |
+
#nifty_wrapper .messages .wplc-user-message::before {
|
183 |
+
display: none;
|
184 |
+
}
|
185 |
+
#nifty_wrapper .messages .wplc-user-message .wplc-msg-content,
|
186 |
+
#nifty_wrapper .messages .wplc-admin-message .wplc-msg-content {
|
187 |
+
margin-top: 2px;
|
188 |
+
margin-bottom: 2px;
|
189 |
+
padding: 10px;
|
190 |
+
}
|
191 |
+
|
192 |
+
#nifty_wrapper .messages .wplc-user-message .wplc-msg-content:before,
|
193 |
+
#nifty_wrapper .messages .wplc-admin-message .wplc-msg-content:after {
|
194 |
+
display: block;
|
195 |
+
position: absolute;
|
196 |
+
width: 0;
|
197 |
+
border-style: solid;
|
198 |
+
content: "";
|
199 |
+
}
|
200 |
+
#nifty_wrapper .messages .wplc-user-message .wplc-msg-content .wplc-chat-person-name,
|
201 |
+
#nifty_wrapper .messages .wplc-user-message .wplc-msg-content .wplc-admin-message .messageBody,
|
202 |
+
#nifty_wrapper .messages .wplc-user-message .wplc-msg-content .wplc-user-message .messageBody {
|
203 |
+
display: inline-block;
|
204 |
+
position: relative;
|
205 |
+
left: 0px;
|
206 |
+
top: 0px;
|
207 |
+
}
|
208 |
+
#nifty_wrapper .messages .wplc-admin-message .wplc-admin-message-avatar,
|
209 |
+
#nifty_wrapper .messages .wplc-user-message .wplc-user-message-avatar {
|
210 |
+
border-radius: 50%;
|
211 |
+
}
|
212 |
+
#nifty_wrapper .messages .wplc-user-message .wplc-msg-content .wplc-chat-person-name {
|
213 |
+
margin-right:10px;
|
214 |
+
}
|
215 |
+
#nifty_wrapper .chatArea span.messageBody {
|
216 |
+
display:inline-block!important;
|
217 |
+
position:relative;
|
218 |
+
top:0px;
|
219 |
+
width:auto;
|
220 |
+
max-width: 100%;
|
221 |
+
height:auto;
|
222 |
+
font-size:1.2em;
|
223 |
+
}
|
224 |
+
span.bleeper-edit-message {
|
225 |
+
display: inline-block;
|
226 |
+
position: relative;
|
227 |
+
left: 0px;
|
228 |
+
width: auto;
|
229 |
+
height: auto;
|
230 |
+
margin-left: 20px;
|
231 |
+
margin-right: 0px;
|
232 |
+
margin-top: 0px;
|
233 |
+
font-size: 1.1em;
|
234 |
+
color: #ffffff;
|
235 |
+
font-weight: 500;
|
236 |
+
text-decoration: underline;
|
237 |
+
font-style: italic;
|
238 |
+
}
|
239 |
+
|
240 |
+
/* Admin messages */
|
241 |
+
#nifty_wrapper .messages .wplc-admin-message {
|
242 |
+
padding-right: 12px;
|
243 |
+
}
|
244 |
+
#nifty_wrapper .messages .wplc-admin-message .wplc-msg-content {
|
245 |
+
display: inline-block;
|
246 |
+
position: relative;
|
247 |
+
float: right;
|
248 |
+
max-width: calc(100% - 190px);
|
249 |
+
background-color:#ED832F;
|
250 |
+
color:#ffffff;
|
251 |
+
border-radius: 6px;
|
252 |
+
}
|
253 |
+
#nifty_wrapper .messages .wplc-admin-message .wplc-msg-content:after {
|
254 |
+
top: 11px;
|
255 |
+
right: -7px;
|
256 |
+
border-width: 6px 0px 6px 7px;
|
257 |
+
border-color: transparent #EB832C;
|
258 |
+
}
|
259 |
+
#nifty_wrapper .messages .wplc-admin-message .wplc-admin-message-avatar {
|
260 |
+
display: block;
|
261 |
+
position: relative;
|
262 |
+
float: right;
|
263 |
+
}
|
264 |
+
|
265 |
+
/* User messages */
|
266 |
+
#nifty_wrapper .messages .wplc-user-message {
|
267 |
+
padding-left:0px!important;
|
268 |
+
}
|
269 |
+
#nifty_wrapper .messages .wplc-user-message .wplc-msg-content {
|
270 |
+
display: inline-block;
|
271 |
+
position: relative;
|
272 |
+
top: 0px;
|
273 |
+
left: 0px;
|
274 |
+
width: auto;
|
275 |
+
max-width: calc(100% - 250px);
|
276 |
+
background-color: rgba(90, 90, 90, 0.94);
|
277 |
+
color: #ffffff;
|
278 |
+
border-radius: 3px;
|
279 |
+
}
|
280 |
+
#nifty_wrapper .messages .wplc-user-message .wplc-msg-content:before {
|
281 |
+
top: 15px;
|
282 |
+
left: -7px;
|
283 |
+
border-width: 6px 7px 6px 0px;
|
284 |
+
border-color: transparent #646464;
|
285 |
+
}
|
286 |
+
#nifty_wrapper .messages .wplc-user-message .wplc-user-message-avatar {
|
287 |
+
display: inline-block;
|
288 |
+
position: relative;
|
289 |
+
left: 0px;
|
290 |
+
top: 0px;
|
291 |
+
margin-right: 10px;
|
292 |
+
}
|
293 |
+
|
294 |
+
/* User and admin timestamp popup */
|
295 |
+
#nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp,
|
296 |
+
#nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp {
|
297 |
+
display: block;
|
298 |
+
position: absolute;
|
299 |
+
z-index: 1;
|
300 |
+
width: auto;
|
301 |
+
height: auto;
|
302 |
+
padding-top: 6px;
|
303 |
+
padding-bottom: 6px;
|
304 |
+
padding-left: 10px;
|
305 |
+
padding-right: 10px;
|
306 |
+
background-color: rgba(39, 36, 36, 0.94);
|
307 |
+
border-radius:5px;
|
308 |
+
color: #fafafa;
|
309 |
+
font-size: 0.8em !important;
|
310 |
+
}
|
311 |
+
#nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp:before,
|
312 |
+
#nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp:before {
|
313 |
+
display: block;
|
314 |
+
position: absolute;
|
315 |
+
top: 9px;
|
316 |
+
width: 0;
|
317 |
+
border-color: transparent #272424;
|
318 |
+
border-style: solid;
|
319 |
+
content: "";
|
320 |
+
}
|
321 |
+
#nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp:before {
|
322 |
+
left: -7px;
|
323 |
+
border-width: 6px 7px 6px 0px;
|
324 |
+
}
|
325 |
+
#nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp:before {
|
326 |
+
right: -7px;
|
327 |
+
border-width: 6px 0px 6px 7px;
|
328 |
+
}
|
329 |
+
|
330 |
+
/* Admin timestamp popup */
|
331 |
+
#nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp.only-hours,
|
332 |
+
#nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp {
|
333 |
+
float: left;
|
334 |
+
top: 0px;
|
335 |
+
}
|
336 |
+
#nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp {
|
337 |
+
left: -200px;
|
338 |
+
}
|
339 |
+
#nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp.only-hours {
|
340 |
+
left: -80px;
|
341 |
+
}
|
342 |
+
|
343 |
+
/* User timestamp popup */
|
344 |
+
#nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp {
|
345 |
+
float:right;
|
346 |
+
top:0px;
|
347 |
+
}
|
348 |
+
#nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp {
|
349 |
+
right:-200px;
|
350 |
+
}
|
351 |
+
#nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp.only-hours {
|
352 |
+
right:-80px;
|
353 |
+
}
|
354 |
+
|
355 |
+
@media(max-width:767px) {
|
356 |
+
#nifty_wrapper .messages .wplc-admin-message .wplc-msg-content {
|
357 |
+
max-width: calc(100% - 100px);
|
358 |
+
}
|
359 |
+
#nifty_wrapper .messages .wplc-user-message .wplc-msg-content {
|
360 |
+
max-width: calc(100% - 135px);
|
361 |
+
}
|
362 |
+
|
363 |
+
#nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp {
|
364 |
+
left: -100px;
|
365 |
+
}
|
366 |
+
|
367 |
+
#nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp,
|
368 |
+
#nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp {
|
369 |
+
max-width: 130px;
|
370 |
+
}
|
371 |
+
|
372 |
+
#nifty_wrapper .messages .wplc-admin-message .wplc-chatbox-msg-timestamp {
|
373 |
+
left: -100px;
|
374 |
+
}
|
375 |
+
#nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp {
|
376 |
+
right: -100px;
|
377 |
+
}
|
378 |
+
|
379 |
+
#nifty_wrapper .messages .wplc-user-message .wplc-chatbox-msg-timestamp.only-hours {
|
380 |
+
right:-80px;
|
381 |
+
}
|
382 |
+
|
383 |
+
}
|
384 |
+
|
385 |
+
/* Quick messages button */
|
386 |
+
#nifty_wrapper #quick_response_drawer_handle {
|
387 |
+
z-index: 1;
|
388 |
+
}
|
389 |
+
|
390 |
+
/* Events box */
|
391 |
+
#nifty_wrapper .eventbox-wrapper {
|
392 |
+
overflow-y: auto;
|
393 |
+
height: calc(100% - 61px);
|
394 |
+
width: 356px;
|
395 |
+
border-bottom-right-radius: 5px;
|
396 |
+
border-bottom-left-radius: 5px;
|
397 |
+
}
|
398 |
+
|
399 |
+
/* Emoji's box */
|
400 |
+
.wdt-emoji-popup {
|
401 |
+
|
402 |
+
z-index: 5;
|
403 |
+
height: 300px;
|
404 |
+
margin-top:45px;
|
405 |
+
}
|
406 |
+
.wdt-emoji-popup .wdt-credit {
|
407 |
+
display: block;
|
408 |
+
position: relative;
|
409 |
+
left: 0px;
|
410 |
+
top: 0px;
|
411 |
+
padding-right: 15px;
|
412 |
+
color: #dcdcdc;
|
413 |
+
text-align: right;
|
414 |
+
}
|
415 |
+
|
416 |
+
/* Quick Response */
|
417 |
+
#quick_response_drawer_container {
|
418 |
+
display: block;
|
419 |
+
position: absolute;
|
420 |
+
float: right;
|
421 |
+
left: auto !important;
|
422 |
+
right: 23px;
|
423 |
+
bottom: 0px;
|
424 |
+
top: 48vh !important;
|
425 |
+
width: 57%;
|
426 |
+
max-height: 180px;
|
427 |
+
padding: 10px;
|
428 |
+
background: #fff;
|
429 |
+
overflow-y: auto;
|
430 |
+
border-radius: 2px;
|
431 |
+
box-shadow: 0px 0px 10px 1px rgba(0,0,0,0.1);
|
432 |
+
}
|
css/admin_styles.css
ADDED
@@ -0,0 +1,306 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
/**
|
3 |
+
* Settings
|
4 |
+
*/
|
5 |
+
|
6 |
+
#wplc_settings .tooltip {
|
7 |
+
background-color: #333;
|
8 |
+
color: #eee;
|
9 |
+
padding: 15px;
|
10 |
+
border-radius: 15px;
|
11 |
+
opacity: 0.8;
|
12 |
+
}
|
13 |
+
|
14 |
+
#wplc_settings .form-table td {
|
15 |
+
font-size: 13px !important;
|
16 |
+
line-height: 1.5em !important;
|
17 |
+
}
|
18 |
+
|
19 |
+
|
20 |
+
.wplc-extension-label-box {
|
21 |
+
display:block;
|
22 |
+
overflow:auto;
|
23 |
+
clear:both;
|
24 |
+
}
|
25 |
+
.wplc-extension-label {
|
26 |
+
display:block;
|
27 |
+
float:left;
|
28 |
+
padding:5px;
|
29 |
+
margin-right:5px;
|
30 |
+
font-size:0.8em;
|
31 |
+
background-color:#bbb;
|
32 |
+
color:#FFF;
|
33 |
+
webkit-border-radius: 5px;
|
34 |
+
-moz-border-radius: 5px;
|
35 |
+
border-radius: 5px;
|
36 |
+
}
|
37 |
+
|
38 |
+
|
39 |
+
#wplc_tabs {
|
40 |
+
box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
|
41 |
+
-webkit-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
|
42 |
+
-moz-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
|
43 |
+
-o-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
+
.wplc-extension {
|
48 |
+
|
49 |
+
float: left;
|
50 |
+
margin: 0 1% 1% 0;
|
51 |
+
background: #fff;
|
52 |
+
border: 1px solid #ccc;
|
53 |
+
width: 320px;
|
54 |
+
padding: 14px;
|
55 |
+
height: 370px;
|
56 |
+
position: relative;
|
57 |
+
|
58 |
+
}
|
59 |
+
.wplc-extension h3 {
|
60 |
+
margin: 0 0 8px;
|
61 |
+
font-size: 13px;
|
62 |
+
|
63 |
+
}
|
64 |
+
|
65 |
+
.wplc-extension .button-secondary {
|
66 |
+
position: absolute;
|
67 |
+
bottom: 14px;
|
68 |
+
left: 14px;
|
69 |
+
}
|
70 |
+
.wplc-plugin {
|
71 |
+
height: 250px;
|
72 |
+
}
|
73 |
+
|
74 |
+
|
75 |
+
.wplc_header_vh {
|
76 |
+
font: bold 14px/26px Arial;
|
77 |
+
padding: 0 0 0 0px;
|
78 |
+
color: #C2BBBE;
|
79 |
+
display: block;
|
80 |
+
text-transform: uppercase;
|
81 |
+
display:block;
|
82 |
+
}
|
83 |
+
.wplc_headerspan_v { min-width:120px; width:20%; display:block; }
|
84 |
+
.wplc_headerspan_nr { min-width:60px; width:10%; display:block; }
|
85 |
+
.wplc_headerspan_dev { min-width:60px; width:10%; display:block; }
|
86 |
+
.wplc_headerspan_d { min-width:200px; width:30%; display:block; }
|
87 |
+
.wplc_headerspan_d a { font-style: italic; }
|
88 |
+
.wplc_headerspan_t { min-width:60px; width:9%; display:block; }
|
89 |
+
.wplc_headerspan_s { min-width:80px; width:12%; display:block; }
|
90 |
+
.wplc_headerspan_a { min-width:100px; width:15%; display:block; }
|
91 |
+
.wplc_chat_ul_header {
|
92 |
+
clear: both;
|
93 |
+
overflow:auto;
|
94 |
+
display:block;
|
95 |
+
padding:10px;
|
96 |
+
}
|
97 |
+
|
98 |
+
|
99 |
+
.relevant_extension p {
|
100 |
+
margin-top:2px;
|
101 |
+
}
|
102 |
+
.relevant_extension h3 {
|
103 |
+
margin-bottom:2px;
|
104 |
+
}
|
105 |
+
.relevant_extension {
|
106 |
+
width: 49% !important;
|
107 |
+
height: 125px !important;
|
108 |
+
opacity:0.5;
|
109 |
+
}
|
110 |
+
.relevant_extension:hover {
|
111 |
+
opacity:1.0;
|
112 |
+
}
|
113 |
+
|
114 |
+
|
115 |
+
.relevant_extension .button-secondary {
|
116 |
+
right:10px !important;
|
117 |
+
left: initial !important;
|
118 |
+
|
119 |
+
}
|
120 |
+
|
121 |
+
|
122 |
+
.relevant_extension img {
|
123 |
+
margin-right:10px;
|
124 |
+
}
|
125 |
+
|
126 |
+
|
127 |
+
|
128 |
+
@media (min-width:320px) {
|
129 |
+
/* smartphones, portrait iPhone, portrait 480x320 phones (Android) */
|
130 |
+
.relevant_extension {
|
131 |
+
width: 85% !important;
|
132 |
+
height: 145px !important;
|
133 |
+
opacity:0.5;
|
134 |
+
}
|
135 |
+
.relevant_extension img {
|
136 |
+
width:105px;
|
137 |
+
}
|
138 |
+
.wplc-extension .wp-post-image {
|
139 |
+
height: auto;
|
140 |
+
}
|
141 |
+
}
|
142 |
+
@media (min-width:480px) {
|
143 |
+
/* smartphones, Android phones, landscape iPhone */
|
144 |
+
.relevant_extension {
|
145 |
+
width: 94% !important;
|
146 |
+
height: 125px !important;
|
147 |
+
opacity:0.5;
|
148 |
+
}
|
149 |
+
.relevant_extension img {
|
150 |
+
width:105px;
|
151 |
+
}
|
152 |
+
.wplc-extension .wp-post-image {
|
153 |
+
height: auto;
|
154 |
+
}
|
155 |
+
}
|
156 |
+
@media (min-width:600px) {
|
157 |
+
/* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */
|
158 |
+
.relevant_extension {
|
159 |
+
width: 94% !important;
|
160 |
+
height: 125px !important;
|
161 |
+
opacity:0.5;
|
162 |
+
}
|
163 |
+
.relevant_extension img {
|
164 |
+
width:105px;
|
165 |
+
}
|
166 |
+
.wplc-extension .wp-post-image {
|
167 |
+
height: auto;
|
168 |
+
}
|
169 |
+
}
|
170 |
+
@media (min-width:801px) {
|
171 |
+
/* tablet, landscape iPad, lo-res laptops ands desktops */
|
172 |
+
.relevant_extension {
|
173 |
+
width: 43% !important;
|
174 |
+
height: 145px !important;
|
175 |
+
opacity:0.5;
|
176 |
+
}
|
177 |
+
.relevant_extension img {
|
178 |
+
width:95px;
|
179 |
+
}
|
180 |
+
.wplc-extension .wp-post-image {
|
181 |
+
height: auto;
|
182 |
+
}
|
183 |
+
}
|
184 |
+
@media (min-width:1025px) {
|
185 |
+
/* big landscape tablets, laptops, and desktops */
|
186 |
+
.relevant_extension {
|
187 |
+
width: 44% !important;
|
188 |
+
height: 125px !important;
|
189 |
+
opacity:0.5;
|
190 |
+
}
|
191 |
+
.relevant_extension img {
|
192 |
+
width:125px;
|
193 |
+
}
|
194 |
+
.wplc-extension .wp-post-image {
|
195 |
+
height: auto;
|
196 |
+
}
|
197 |
+
}
|
198 |
+
@media (min-width:1281px) {
|
199 |
+
/* hi-res laptops and desktops */
|
200 |
+
.relevant_extension {
|
201 |
+
width: 32% !important;
|
202 |
+
height: 125px !important;
|
203 |
+
opacity:0.5;
|
204 |
+
}
|
205 |
+
.relevant_extension img {
|
206 |
+
width:110px;
|
207 |
+
}
|
208 |
+
.wplc-extension .wp-post-image {
|
209 |
+
height: auto;
|
210 |
+
}
|
211 |
+
}
|
212 |
+
|
213 |
+
|
214 |
+
.wplc-palette-selection {
|
215 |
+
border: 1px solid #CCC;
|
216 |
+
border-radius: 5px;
|
217 |
+
padding: 5px;
|
218 |
+
margin: 5px;
|
219 |
+
height:100%;
|
220 |
+
|
221 |
+
}
|
222 |
+
|
223 |
+
.wplc_palette_single {
|
224 |
+
margin: 5px;
|
225 |
+
margin-top: 15px;
|
226 |
+
width: 162px;
|
227 |
+
height: 122px;
|
228 |
+
text-align: center;
|
229 |
+
display: inline-block;
|
230 |
+
vertical-align: top;
|
231 |
+
cursor: pointer;
|
232 |
+
|
233 |
+
}
|
234 |
+
.wplc-palette-top { display:block; width:100%; height:25%; }
|
235 |
+
|
236 |
+
|
237 |
+
|
238 |
+
#wplc_tabs .ui-tabs-anchor {
|
239 |
+
width: 100%;
|
240 |
+
}
|
241 |
+
|
242 |
+
|
243 |
+
|
244 |
+
/* Gutenberg styles */
|
245 |
+
#tabs-gutenberg input[type='button'] {
|
246 |
+
cursor: pointer;
|
247 |
+
}
|
248 |
+
|
249 |
+
#wplc_custom_js_editor, #wplc_custom_css_editor, #wplc_custom_html_editor {
|
250 |
+
width: 560px;
|
251 |
+
height: 285px;
|
252 |
+
margin: 10px 0 10px 0;
|
253 |
+
}
|
254 |
+
|
255 |
+
#wplc_gutenberg_icon {
|
256 |
+
cursor: pointer;
|
257 |
+
}
|
258 |
+
|
259 |
+
.wplc_code {
|
260 |
+
cursor: pointer;
|
261 |
+
transition: all .2s ease-in-out;
|
262 |
+
border-radius: 3px;
|
263 |
+
color: #696969;
|
264 |
+
}
|
265 |
+
|
266 |
+
.wplc_code:hover {
|
267 |
+
background: #d7d7d7;
|
268 |
+
}
|
269 |
+
|
270 |
+
.wplc_code:focus, .wplc_code:active {
|
271 |
+
background: #018add;
|
272 |
+
color: #fff;
|
273 |
+
}
|
274 |
+
|
275 |
+
|
276 |
+
.wplc_agent_container ul {
|
277 |
+
display:block;
|
278 |
+
overflow:auto;
|
279 |
+
}
|
280 |
+
.wplc_agent_container li{
|
281 |
+
display: block;
|
282 |
+
float: left;
|
283 |
+
text-align: center;
|
284 |
+
border: 1px solid #CCC;
|
285 |
+
width:150px;
|
286 |
+
height:310px;
|
287 |
+
padding: 10px;
|
288 |
+
border-radius: 5px;
|
289 |
+
margin: 10px;
|
290 |
+
box-shadow: 2px 2px 2px #CCC;
|
291 |
+
overflow: auto;
|
292 |
+
|
293 |
+
}
|
294 |
+
.wplc_agent_container img{
|
295 |
+
border-radius: 100px;
|
296 |
+
}
|
297 |
+
.wplc_agent_container h3 {
|
298 |
+
font: bold 12px/16px Arial;
|
299 |
+
padding: 0 0 0 0px;
|
300 |
+
color: #C2BBBE;
|
301 |
+
display: block;
|
302 |
+
height:40px;
|
303 |
+
text-transform: uppercase;
|
304 |
+
}
|
305 |
+
.wplc_agent_container small { word-wrap: break-word; display:block; height:50px; }
|
306 |
+
.wplc_agent_container select { width: 120px; }
|
css/chat-style.css
CHANGED
@@ -11,18 +11,8 @@
|
|
11 |
background-color:#fff;
|
12 |
width:85%;
|
13 |
min-width:675px;
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
}
|
18 |
-
.wplc-extension-label-box {
|
19 |
-
display:block;
|
20 |
-
overflow:auto;
|
21 |
-
clear:both;
|
22 |
-
}
|
23 |
-
.wplc-extension-label {
|
24 |
-
display:block; float:left; padding:5px; margin-right:5px; font-size:0.8em; background-color:#bbb; color:#FFF; webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; }
|
25 |
}
|
|
|
26 |
.wplc-sub-item-email-string {
|
27 |
white-space: nowrap;
|
28 |
display:inline-block;
|
@@ -58,8 +48,6 @@
|
|
58 |
overflow:scroll;
|
59 |
overflow-x: hidden;
|
60 |
background-color:#FFF;
|
61 |
-
|
62 |
-
|
63 |
}
|
64 |
|
65 |
.admin_chat_box_inner_bottom {
|
@@ -68,14 +56,10 @@
|
|
68 |
border-top:1px solid #ccc;
|
69 |
display:block;
|
70 |
overflow:auto;
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
}
|
75 |
.admin_chat_quick_controls {
|
76 |
clear:left;
|
77 |
padding-left:10px;
|
78 |
-
|
79 |
}
|
80 |
|
81 |
.admin_visitor_info {
|
@@ -83,9 +67,8 @@
|
|
83 |
width: 47%;
|
84 |
padding-left:15px;
|
85 |
min-width:250px;
|
86 |
-
|
87 |
-
|
88 |
}
|
|
|
89 |
#wplc_admin_chatmsg {
|
90 |
width:95%;
|
91 |
margin:0 auto;
|
@@ -105,9 +88,11 @@
|
|
105 |
border-radius: 5px;
|
106 |
}
|
107 |
|
108 |
-
|
|
|
|
|
|
|
109 |
.wplc-admin-message {
|
110 |
-
|
111 |
padding:10px;
|
112 |
-webkit-border-radius: 2px;
|
113 |
-moz-border-radius: 2px;
|
@@ -121,12 +106,9 @@
|
|
121 |
margin-bottom: 3px;
|
122 |
word-wrap: break-word;
|
123 |
max-width:96%;
|
124 |
-
|
125 |
-
|
126 |
}
|
127 |
|
128 |
.wplc-user-message {
|
129 |
-
|
130 |
padding:10px;
|
131 |
-webkit-border-radius: 2px;
|
132 |
-moz-border-radius: 2px;
|
@@ -144,7 +126,6 @@
|
|
144 |
position: relative;
|
145 |
right: 35px;
|
146 |
max-width: 71%;
|
147 |
-
|
148 |
}
|
149 |
|
150 |
.wplc-admin-message {
|
@@ -168,12 +149,10 @@
|
|
168 |
}
|
169 |
|
170 |
.wplc-admin-message img{
|
171 |
-
|
172 |
border-radius: 25px;
|
173 |
position: absolute;
|
174 |
left: -37px;
|
175 |
top: 3px;
|
176 |
-
|
177 |
}
|
178 |
|
179 |
.wplc-user-message:before {
|
@@ -205,17 +184,17 @@
|
|
205 |
}
|
206 |
|
207 |
.wplc-user-message img.wplc-user-message-avatar {
|
208 |
-
|
209 |
border-radius: 25px;
|
210 |
position: absolute;
|
211 |
right: -37px;
|
212 |
top: 3px;
|
213 |
-
|
214 |
}
|
215 |
|
216 |
.wplc-user-message hr, .wplc-admin-message hr{
|
217 |
margin-bottom: 0px !important;
|
218 |
}
|
|
|
|
|
219 |
.chat_time {
|
220 |
display:block;
|
221 |
width:100%;
|
@@ -227,32 +206,7 @@
|
|
227 |
}
|
228 |
|
229 |
.admin_visitor_advanced_info { clear:left; }
|
230 |
-
.wplc-extension {
|
231 |
-
|
232 |
-
float: left;
|
233 |
-
margin: 0 1% 1% 0;
|
234 |
-
background: #fff;
|
235 |
-
border: 1px solid #ccc;
|
236 |
-
width: 320px;
|
237 |
-
padding: 14px;
|
238 |
-
height: 370px;
|
239 |
-
position: relative;
|
240 |
-
|
241 |
-
}
|
242 |
-
.wplc-extension h3 {
|
243 |
-
margin: 0 0 8px;
|
244 |
-
font-size: 13px;
|
245 |
-
|
246 |
-
}
|
247 |
|
248 |
-
.wplc-extension .button-secondary {
|
249 |
-
position: absolute;
|
250 |
-
bottom: 14px;
|
251 |
-
left: 14px;
|
252 |
-
}
|
253 |
-
.wplc-plugin {
|
254 |
-
height: 250px;
|
255 |
-
}
|
256 |
|
257 |
/*.admin_visitor_advanced_info {
|
258 |
clear:both;
|
@@ -484,333 +438,134 @@
|
|
484 |
padding: 0 5px;
|
485 |
}
|
486 |
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
}
|
495 |
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
padding:10px;
|
531 |
-
}
|
532 |
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
544 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
545 |
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
display:block;
|
562 |
-
}
|
563 |
-
.wplc_headerspan_v { min-width:120px; width:20%; display:block; }
|
564 |
-
.wplc_headerspan_nr { min-width:60px; width:10%; display:block; }
|
565 |
-
.wplc_headerspan_dev { min-width:60px; width:10%; display:block; }
|
566 |
-
.wplc_headerspan_d { min-width:200px; width:30%; display:block; }
|
567 |
-
.wplc_headerspan_d a { font-style: italic; }
|
568 |
-
.wplc_headerspan_t { min-width:60px; width:9%; display:block; }
|
569 |
-
.wplc_headerspan_s { min-width:80px; width:12%; display:block; }
|
570 |
-
.wplc_headerspan_a { min-width:100px; width:15%; display:block; }
|
571 |
-
.wplc_chat_ul_header {
|
572 |
-
clear: both;
|
573 |
-
overflow:auto;
|
574 |
-
display:block;
|
575 |
-
padding:10px;
|
576 |
-
|
577 |
-
}
|
578 |
-
#wplc_chat_ul {
|
579 |
-
clear: both;
|
580 |
-
overflow:auto;
|
581 |
-
display:block;
|
582 |
-
|
583 |
-
}
|
584 |
-
.wplc_p_cul { padding:10px; clear:both; display:block; overflow: auto; }
|
585 |
-
.wplc_p_cul:hover { background-color:#eee; border-radius:5px; }
|
586 |
-
|
587 |
-
.wplc_status_box {
|
588 |
-
padding: 3px;
|
589 |
-
border-radius: 5px;
|
590 |
-
color:white;
|
591 |
-
font-size:11px;
|
592 |
-
|
593 |
-
}
|
594 |
-
.wplc-agent-info {
|
595 |
-
font: bold 12px/24px Arial;
|
596 |
-
color: #C2BBBE;
|
597 |
-
text-transform: uppercase;
|
598 |
-
display: block;
|
599 |
-
}
|
600 |
-
.wplc_agents_online { color: #ec822c; }
|
601 |
-
.wplc_type_new { background-color: #E1734A; }
|
602 |
-
.wplc_type_returning { background-color: #ec822c; }
|
603 |
-
|
604 |
-
.wplc_status_1 { background-color: #CCCCCC; }
|
605 |
-
.wplc_status_4 { background-color: #CCCCCC; }
|
606 |
-
.wplc_status_8 { background-color: #CCCCCC; }
|
607 |
-
|
608 |
-
.wplc_status_5 { background-color: #B3D24B; }
|
609 |
|
610 |
-
|
611 |
-
|
|
|
612 |
|
|
|
613 |
|
614 |
-
|
615 |
-
|
616 |
-
.wplc_status_9 { background-color: #BFBCBB; }
|
617 |
|
|
|
|
|
|
|
618 |
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
|
630 |
.wplc_add_on_button_chat {
|
631 |
float:left; margin-right: 10px;
|
632 |
}
|
633 |
|
634 |
.wplc_no_visitors {
|
635 |
-
|
636 |
width: 100%;
|
637 |
text-align: center;
|
638 |
font-style: italic;
|
639 |
}
|
640 |
|
641 |
|
642 |
-
.wplc_agent_container ul {
|
643 |
-
display:block;
|
644 |
-
overflow:auto;
|
645 |
-
}
|
646 |
-
.wplc_agent_container li{
|
647 |
-
display: block;
|
648 |
-
float: left;
|
649 |
-
text-align: center;
|
650 |
-
border: 1px solid #CCC;
|
651 |
-
width:150px;
|
652 |
-
height:310px;
|
653 |
-
padding: 10px;
|
654 |
-
border-radius: 5px;
|
655 |
-
margin: 10px;
|
656 |
-
box-shadow: 2px 2px 2px #CCC;
|
657 |
-
overflow: auto;
|
658 |
-
|
659 |
-
}
|
660 |
-
.wplc_agent_container img{
|
661 |
-
border-radius: 100px;
|
662 |
-
}
|
663 |
-
.wplc_agent_container h3 {
|
664 |
-
font: bold 12px/16px Arial;
|
665 |
-
padding: 0 0 0 0px;
|
666 |
-
color: #C2BBBE;
|
667 |
-
display: block;
|
668 |
-
height:40px;
|
669 |
-
text-transform: uppercase;
|
670 |
-
}
|
671 |
-
.wplc_agent_container small { word-wrap: break-word; display:block; height:50px; }
|
672 |
-
.wplc_agent_container select { width: 120px; }
|
673 |
-
|
674 |
|
675 |
|
676 |
#wplc_star_rating{
|
677 |
text-align: center;
|
678 |
padding: 10px;
|
679 |
}
|
680 |
-
.relevant_extension p {
|
681 |
-
margin-top:2px;
|
682 |
-
}
|
683 |
-
.relevant_extension h3 {
|
684 |
-
margin-bottom:2px;
|
685 |
-
}
|
686 |
-
.relevant_extension {
|
687 |
-
width: 49% !important;
|
688 |
-
height: 125px !important;
|
689 |
-
opacity:0.5;
|
690 |
-
}
|
691 |
-
.relevant_extension:hover {
|
692 |
-
opacity:1.0;
|
693 |
-
}
|
694 |
-
|
695 |
-
|
696 |
-
.relevant_extension .button-secondary {
|
697 |
-
right:10px !important;
|
698 |
-
left: initial !important;
|
699 |
-
|
700 |
-
}
|
701 |
-
|
702 |
-
|
703 |
-
.relevant_extension img {
|
704 |
-
margin-right:10px;
|
705 |
-
}
|
706 |
-
|
707 |
-
@media (min-width:320px) {
|
708 |
-
/* smartphones, portrait iPhone, portrait 480x320 phones (Android) */
|
709 |
-
.relevant_extension {
|
710 |
-
width: 85% !important;
|
711 |
-
height: 145px !important;
|
712 |
-
opacity:0.5;
|
713 |
-
}
|
714 |
-
.relevant_extension img {
|
715 |
-
width:105px;
|
716 |
-
}
|
717 |
-
.wplc-extension .wp-post-image {
|
718 |
-
height: auto;
|
719 |
-
}
|
720 |
-
}
|
721 |
-
@media (min-width:480px) {
|
722 |
-
/* smartphones, Android phones, landscape iPhone */
|
723 |
-
.relevant_extension {
|
724 |
-
width: 94% !important;
|
725 |
-
height: 125px !important;
|
726 |
-
opacity:0.5;
|
727 |
-
}
|
728 |
-
.relevant_extension img {
|
729 |
-
width:105px;
|
730 |
-
}
|
731 |
-
.wplc-extension .wp-post-image {
|
732 |
-
height: auto;
|
733 |
-
}
|
734 |
-
}
|
735 |
-
@media (min-width:600px) {
|
736 |
-
/* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */
|
737 |
-
.relevant_extension {
|
738 |
-
width: 94% !important;
|
739 |
-
height: 125px !important;
|
740 |
-
opacity:0.5;
|
741 |
-
}
|
742 |
-
.relevant_extension img {
|
743 |
-
width:105px;
|
744 |
-
}
|
745 |
-
.wplc-extension .wp-post-image {
|
746 |
-
height: auto;
|
747 |
-
}
|
748 |
-
}
|
749 |
-
@media (min-width:801px) {
|
750 |
-
/* tablet, landscape iPad, lo-res laptops ands desktops */
|
751 |
-
.relevant_extension {
|
752 |
-
width: 43% !important;
|
753 |
-
height: 145px !important;
|
754 |
-
opacity:0.5;
|
755 |
-
}
|
756 |
-
.relevant_extension img {
|
757 |
-
width:95px;
|
758 |
-
}
|
759 |
-
.wplc-extension .wp-post-image {
|
760 |
-
height: auto;
|
761 |
-
}
|
762 |
-
}
|
763 |
-
@media (min-width:1025px) {
|
764 |
-
/* big landscape tablets, laptops, and desktops */
|
765 |
-
.relevant_extension {
|
766 |
-
width: 44% !important;
|
767 |
-
height: 125px !important;
|
768 |
-
opacity:0.5;
|
769 |
-
}
|
770 |
-
.relevant_extension img {
|
771 |
-
width:125px;
|
772 |
-
}
|
773 |
-
.wplc-extension .wp-post-image {
|
774 |
-
height: auto;
|
775 |
-
}
|
776 |
-
}
|
777 |
-
@media (min-width:1281px) {
|
778 |
-
/* hi-res laptops and desktops */
|
779 |
-
.relevant_extension {
|
780 |
-
width: 32% !important;
|
781 |
-
height: 125px !important;
|
782 |
-
opacity:0.5;
|
783 |
-
}
|
784 |
-
.relevant_extension img {
|
785 |
-
width:110px;
|
786 |
-
}
|
787 |
-
.wplc-extension .wp-post-image {
|
788 |
-
height: auto;
|
789 |
-
}
|
790 |
-
}
|
791 |
-
|
792 |
-
|
793 |
-
.wplc-palette-selection {
|
794 |
-
border: 1px solid #CCC;
|
795 |
-
border-radius: 5px;
|
796 |
-
padding: 5px;
|
797 |
-
margin: 5px;
|
798 |
-
height:100%;
|
799 |
-
|
800 |
-
}
|
801 |
-
|
802 |
-
.wplc_palette_single {
|
803 |
-
margin: 5px;
|
804 |
-
margin-top: 15px;
|
805 |
-
width: 162px;
|
806 |
-
height: 122px;
|
807 |
-
text-align: center;
|
808 |
-
display: inline-block;
|
809 |
-
vertical-align: top;
|
810 |
-
cursor: pointer;
|
811 |
-
|
812 |
-
}
|
813 |
-
.wplc-palette-top { display:block; width:100%; height:25%; }
|
814 |
|
815 |
#nifty_file_holder {
|
816 |
float: right;
|
@@ -965,10 +720,6 @@ span.wplc_system_notification {
|
|
965 |
}
|
966 |
}
|
967 |
|
968 |
-
#wplc_tabs .ui-tabs-anchor {
|
969 |
-
width: 100%;
|
970 |
-
}
|
971 |
-
|
972 |
.wplc-chat-in-progress {
|
973 |
display: inline-block;
|
974 |
width: 100px;
|
@@ -1004,20 +755,170 @@ span.wplc_system_notification {
|
|
1004 |
font-weight: bold;
|
1005 |
}
|
1006 |
|
1007 |
-
|
1008 |
.admin_chat_box_inner span.timedate {
|
1009 |
clear: both;
|
1010 |
position: relative;
|
1011 |
font-size: 0.8em;
|
1012 |
font-style:italic
|
1013 |
}
|
|
|
1014 |
.wplc-msg-float-left {
|
1015 |
left: 32px;
|
1016 |
float:left;
|
1017 |
}
|
|
|
1018 |
.wplc-msg-float-right {
|
1019 |
right: 32px;
|
1020 |
float:right;
|
1021 |
}
|
1022 |
|
1023 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
background-color:#fff;
|
12 |
width:85%;
|
13 |
min-width:675px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
}
|
15 |
+
|
16 |
.wplc-sub-item-email-string {
|
17 |
white-space: nowrap;
|
18 |
display:inline-block;
|
48 |
overflow:scroll;
|
49 |
overflow-x: hidden;
|
50 |
background-color:#FFF;
|
|
|
|
|
51 |
}
|
52 |
|
53 |
.admin_chat_box_inner_bottom {
|
56 |
border-top:1px solid #ccc;
|
57 |
display:block;
|
58 |
overflow:auto;
|
|
|
|
|
|
|
59 |
}
|
60 |
.admin_chat_quick_controls {
|
61 |
clear:left;
|
62 |
padding-left:10px;
|
|
|
63 |
}
|
64 |
|
65 |
.admin_visitor_info {
|
67 |
width: 47%;
|
68 |
padding-left:15px;
|
69 |
min-width:250px;
|
|
|
|
|
70 |
}
|
71 |
+
|
72 |
#wplc_admin_chatmsg {
|
73 |
width:95%;
|
74 |
margin:0 auto;
|
88 |
border-radius: 5px;
|
89 |
}
|
90 |
|
91 |
+
.admin_chat_box .admin_chat_box_inner {
|
92 |
+
background: url('../images/bg/cloudy.jpg') repeat;
|
93 |
+
background-size: cover;
|
94 |
+
}
|
95 |
.wplc-admin-message {
|
|
|
96 |
padding:10px;
|
97 |
-webkit-border-radius: 2px;
|
98 |
-moz-border-radius: 2px;
|
106 |
margin-bottom: 3px;
|
107 |
word-wrap: break-word;
|
108 |
max-width:96%;
|
|
|
|
|
109 |
}
|
110 |
|
111 |
.wplc-user-message {
|
|
|
112 |
padding:10px;
|
113 |
-webkit-border-radius: 2px;
|
114 |
-moz-border-radius: 2px;
|
126 |
position: relative;
|
127 |
right: 35px;
|
128 |
max-width: 71%;
|
|
|
129 |
}
|
130 |
|
131 |
.wplc-admin-message {
|
149 |
}
|
150 |
|
151 |
.wplc-admin-message img{
|
|
|
152 |
border-radius: 25px;
|
153 |
position: absolute;
|
154 |
left: -37px;
|
155 |
top: 3px;
|
|
|
156 |
}
|
157 |
|
158 |
.wplc-user-message:before {
|
184 |
}
|
185 |
|
186 |
.wplc-user-message img.wplc-user-message-avatar {
|
|
|
187 |
border-radius: 25px;
|
188 |
position: absolute;
|
189 |
right: -37px;
|
190 |
top: 3px;
|
|
|
191 |
}
|
192 |
|
193 |
.wplc-user-message hr, .wplc-admin-message hr{
|
194 |
margin-bottom: 0px !important;
|
195 |
}
|
196 |
+
/* ./Messages */
|
197 |
+
|
198 |
.chat_time {
|
199 |
display:block;
|
200 |
width:100%;
|
206 |
}
|
207 |
|
208 |
.admin_visitor_advanced_info { clear:left; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
|
211 |
/*.admin_visitor_advanced_info {
|
212 |
clear:both;
|
438 |
padding: 0 5px;
|
439 |
}
|
440 |
|
441 |
+
.toplevel_page_wplivechat-menu .wp-pointer-content h3 {
|
442 |
+
background-color: #ec822c;
|
443 |
+
border: 1px solid #ec822c;
|
444 |
+
}
|
445 |
+
.toplevel_page_wplivechat-menu .wp-pointer-content h3:before {
|
446 |
+
color: #ec822c;
|
447 |
+
}
|
|
|
448 |
|
449 |
+
#wplc_admin_chat_holder {
|
450 |
+
width:990px;
|
451 |
+
margin:0 auto;
|
452 |
+
display:block;
|
453 |
+
overflow:auto;
|
454 |
+
clear:both;
|
455 |
+
}
|
456 |
+
|
457 |
+
#wplc_admin_chat_area_new {
|
458 |
+
width: 750px;
|
459 |
+
font-size: 13px;
|
460 |
+
float:left;
|
461 |
+
display:block;
|
462 |
+
background-color:#FFF;
|
463 |
+
border-radius:25px;
|
464 |
+
}
|
465 |
+
#wplc_admin_chat_info_new {
|
466 |
+
float:left;
|
467 |
+
width:240px;
|
468 |
+
display:block;
|
469 |
+
margin-bottom:20px;
|
470 |
+
}
|
471 |
+
.wplc_chat_vis_count_box {
|
472 |
+
width:57%;
|
473 |
+
min-width:198px;
|
474 |
+
background-color:#FFF;
|
475 |
+
min-height:150px;
|
476 |
+
border-radius:25px;
|
477 |
+
margin-left:auto;
|
478 |
+
margin-right:auto;
|
479 |
+
display:block;
|
480 |
+
text-align:center;
|
481 |
+
padding:10px;
|
482 |
+
}
|
|
|
|
|
483 |
|
484 |
+
.wplc_vis_online {
|
485 |
+
font-size: 60px;
|
486 |
+
line-height:70px;
|
487 |
+
color: #ec822c;
|
488 |
+
text-align: center;
|
489 |
+
padding-top: 36px;
|
490 |
+
font-family: Arial;
|
491 |
+
display: block;
|
492 |
+
font-weight:bold;
|
493 |
+
}
|
494 |
|
495 |
+
#wplc_admin_chat_area_new li {
|
496 |
+
float: left;
|
497 |
+
background: none;
|
498 |
+
padding: 0 2px 0 0;
|
499 |
+
list-style:none;
|
500 |
+
margin:0;
|
501 |
+
}
|
502 |
|
503 |
+
#wplc_chat_ul {
|
504 |
+
clear: both;
|
505 |
+
overflow:auto;
|
506 |
+
display:block;
|
507 |
+
}
|
508 |
+
.wplc_p_cul { padding:10px; clear:both; display:block; overflow: auto; }
|
509 |
+
.wplc_p_cul:hover { background-color:#eee; border-radius:5px; }
|
510 |
|
511 |
+
.wplc_status_box {
|
512 |
+
padding: 3px;
|
513 |
+
border-radius: 5px;
|
514 |
+
color:white;
|
515 |
+
font-size:11px;
|
516 |
+
}
|
517 |
+
.wplc-agent-info {
|
518 |
+
font: bold 12px/24px Arial;
|
519 |
+
color: #C2BBBE;
|
520 |
+
text-transform: uppercase;
|
521 |
+
display: block;
|
522 |
+
}
|
523 |
+
.wplc_agents_online { color: #ec822c; }
|
524 |
+
.wplc_type_new { background-color: #E1734A; }
|
525 |
+
.wplc_type_returning { background-color: #ec822c; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
526 |
|
527 |
+
.wplc_status_1 { background-color: #CCCCCC; }
|
528 |
+
.wplc_status_4 { background-color: #CCCCCC; }
|
529 |
+
.wplc_status_8 { background-color: #CCCCCC; }
|
530 |
|
531 |
+
.wplc_status_5 { background-color: #B3D24B; }
|
532 |
|
533 |
+
.wplc_status_2 { background-color: #3278CD; }
|
534 |
+
.wplc_status_3 { background-color: #3278CD; }
|
|
|
535 |
|
536 |
+
.wplc_status_6 { background-color: red; }
|
537 |
+
.wplc_status_7 { background-color: #BFBCBB; }
|
538 |
+
.wplc_status_9 { background-color: #BFBCBB; }
|
539 |
|
540 |
+
.browser-tag { font-size:10px; }
|
541 |
+
.browser-tag img{ top:3px; position:relative }
|
542 |
+
.wplc-sub-item-header { color:#C7C3C3; font-style: italic; }
|
543 |
|
544 |
+
@media (min-width:320px) { #wplc_admin_chat_holder { width:100%; } #wplc_admin_chat_area_new { width:90%; float:none; display:block; margin: 0 auto; } #wplc_admin_chat_info_new { width:240px; float:none; display:block; margin: 20px auto; } .wplc_headerspan_t { display:none; } .wplc_headerspan_nr { display:none; } .wplc_chat_ul_header { display:none; } .wplc_p_cul { border-bottom:1px solid #ccc; } #wplc_admin_chat_area_new li { float:none; } .wplc_headerspan_a,.wplc_headerspan_d,.wplc_headerspan_v,.wplc_headerspan_s { margin:5px auto; text-align:center; } .wplc_chat_vis_count_box { min-width:180px; } }
|
545 |
+
@media (min-width:481px) { #wplc_admin_chat_holder { width:100%; } #wplc_admin_chat_area_new { width:90%; float:none; display:block; margin: 0 auto; } #wplc_admin_chat_info_new { width:240px; float:none; display:block; margin: 20px auto; } .wplc_headerspan_t { display:none; } .wplc_headerspan_nr { display:none; } .wplc_chat_ul_header { display:none; } .wplc_p_cul { border-bottom:1px solid #ccc; } #wplc_admin_chat_area_new li { float:none; } .wplc_headerspan_a,.wplc_headerspan_d,.wplc_headerspan_v,.wplc_headerspan_s { margin:5px auto; text-align:center; } .wplc_chat_vis_count_box { min-width:180px; } .wplc-sub-item-email-string { white-space: nowrap; width: 100%; /* IE6 needs any width */ overflow: hidden; /* "overflow" value must be different from visible"*/ -o-text-overflow: ellipsis; /* Opera < 11*/ text-overflow: ellipsis; /* IE, Safari (WebKit), Opera >= 11, FF > 6 */ } }
|
546 |
+
@media (min-width:641px) { #wplc_admin_chat_holder { width:650px; } #wplc_admin_chat_area_new { width:640px; float:none; display:block; margin: 0 auto; } #wplc_admin_chat_info_new { width:240px; float:none; display:block; margin: 20px auto; } .wplc_headerspan_t { display:block; } .wplc_headerspan_nr { display:none; } .wplc_chat_ul_header { display:block; } .wplc_p_cul { border-bottom:none; } #wplc_admin_chat_area_new li { float:left; } .wplc_headerspan_a,.wplc_headerspan_d,.wplc_headerspan_v,.wplc_headerspan_s { margin:0; text-align:left; } .wplc_chat_vis_count_box { min-width:180px; } }
|
547 |
+
@media (min-width:961px) { #wplc_admin_chat_holder { width:850px; } #wplc_admin_chat_area_new { width:700px; float:none; display:block; margin: 0 auto; } #wplc_admin_chat_info_new { width:240px; float:none; display:block; margin: 20px auto; } .wplc_headerspan_t { display:none; } .wplc_headerspan_nr { display:block; } .wplc_chat_ul_header { display:block; } .wplc_p_cul { border-bottom:none; } #wplc_admin_chat_area_new li { float:left; } .wplc_headerspan_a,.wplc_headerspan_d,.wplc_headerspan_v,.wplc_headerspan_s { margin:0; text-align:left; } .wplc_chat_vis_count_box { min-width:110px; } }
|
548 |
+
@media (min-width:1025px) { #wplc_admin_chat_holder { width:990px; } #wplc_admin_chat_area_new { width:700px; float:left; display:block; margin: 0; } #wplc_admin_chat_info_new { width:140px; float:left; display:block; margin: 0; } .wplc_headerspan_t { display:none; } .wplc_headerspan_nr { display:block; } .wplc_chat_ul_header { display:block; } .wplc_p_cul { border-bottom:none; } #wplc_admin_chat_area_new li { float:left; } .wplc_headerspan_a,.wplc_headerspan_d,.wplc_headerspan_v,.wplc_headerspan_s { margin:0; text-align:left; } .wplc_chat_vis_count_box { min-width:110px; } }
|
549 |
+
@media (min-width:1281px) { #wplc_admin_chat_holder { width:990px; } #wplc_admin_chat_area_new { width:750px; float:left; display:block; margin: 0; } #wplc_admin_chat_info_new { width:240px; float:left; display:block; margin: 0; } .wplc_headerspan_t { display:block; } .wplc_headerspan_nr { display:block; } .wplc_chat_ul_header { display:block; } .wplc_p_cul { border-bottom:none; } #wplc_admin_chat_area_new li { float:left; } .wplc_headerspan_a,.wplc_headerspan_d,.wplc_headerspan_v,.wplc_headerspan_s { margin:0; text-align:left; } .wplc_chat_vis_count_box { min-width:198px; } }
|
550 |
|
551 |
.wplc_add_on_button_chat {
|
552 |
float:left; margin-right: 10px;
|
553 |
}
|
554 |
|
555 |
.wplc_no_visitors {
|
556 |
+
display: block;
|
557 |
width: 100%;
|
558 |
text-align: center;
|
559 |
font-style: italic;
|
560 |
}
|
561 |
|
562 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
563 |
|
564 |
|
565 |
#wplc_star_rating{
|
566 |
text-align: center;
|
567 |
padding: 10px;
|
568 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
569 |
|
570 |
#nifty_file_holder {
|
571 |
float: right;
|
720 |
}
|
721 |
}
|
722 |
|
|
|
|
|
|
|
|
|
723 |
.wplc-chat-in-progress {
|
724 |
display: inline-block;
|
725 |
width: 100px;
|
755 |
font-weight: bold;
|
756 |
}
|
757 |
|
|
|
758 |
.admin_chat_box_inner span.timedate {
|
759 |
clear: both;
|
760 |
position: relative;
|
761 |
font-size: 0.8em;
|
762 |
font-style:italic
|
763 |
}
|
764 |
+
|
765 |
.wplc-msg-float-left {
|
766 |
left: 32px;
|
767 |
float:left;
|
768 |
}
|
769 |
+
|
770 |
.wplc-msg-float-right {
|
771 |
right: 32px;
|
772 |
float:right;
|
773 |
}
|
774 |
|
775 |
|
776 |
+
#wplc-chat-box {
|
777 |
+
width: fit-content;
|
778 |
+
position: relative;
|
779 |
+
cursor: pointer;
|
780 |
+
}
|
781 |
+
|
782 |
+
.wplc_block {
|
783 |
+
position: relative;
|
784 |
+
display:inline-block;
|
785 |
+
background: #32373c;
|
786 |
+
color: #eee;
|
787 |
+
border-radius: 3px;
|
788 |
+
height: 35px;
|
789 |
+
padding-left: 45px;
|
790 |
+
margin: 5px 0 5px 0;
|
791 |
+
transition: all .2s ease-in-out;
|
792 |
+
cursor: pointer;
|
793 |
+
border-bottom: 0px solid #111;
|
794 |
+
font-size: 17px;
|
795 |
+
line-height: 35px;
|
796 |
+
}
|
797 |
+
|
798 |
+
|
799 |
+
.wplc_block:hover {
|
800 |
+
transform: translateY(-2px);
|
801 |
+
}
|
802 |
+
|
803 |
+
.wplc_block:after {
|
804 |
+
content: "";
|
805 |
+
position: absolute;
|
806 |
+
display: block;
|
807 |
+
height: 0px;
|
808 |
+
bottom: 0;
|
809 |
+
left: 0;
|
810 |
+
width: 100%;
|
811 |
+
background-color: #000;
|
812 |
+
opacity: 0;
|
813 |
+
transition: all .2s ease-in-out;
|
814 |
+
}
|
815 |
+
|
816 |
+
.wplc_block:hover:after {
|
817 |
+
height: 3px;
|
818 |
+
opacity: .2;
|
819 |
+
}
|
820 |
+
|
821 |
+
#wplc-chat-box.disabled:first-child:after {
|
822 |
+
content: "Disabled";
|
823 |
+
color:#fff;
|
824 |
+
font-size: 17px;
|
825 |
+
text-transform: uppercase;
|
826 |
+
text-align: center;
|
827 |
+
display: block;
|
828 |
+
position: absolute;
|
829 |
+
height: 100%;
|
830 |
+
width: 100%;
|
831 |
+
bottom: 0;
|
832 |
+
left: 0;
|
833 |
+
background: #ED832F;
|
834 |
+
opacity: .9;
|
835 |
+
}
|
836 |
+
|
837 |
+
.wplc_block_logo {
|
838 |
+
width: 35px;
|
839 |
+
height: 35px;
|
840 |
+
position: absolute;
|
841 |
+
left: 0;
|
842 |
+
background: #e7e7e7;
|
843 |
+
display: inline-block;
|
844 |
+
margin:0;
|
845 |
+
background-size: cover;
|
846 |
+
background-position: center;
|
847 |
+
background-color:#ED832F !important;
|
848 |
+
transition: all .2s ease-in-out;
|
849 |
+
box-sizing: border-box;
|
850 |
+
box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
|
851 |
+
-webkit-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
|
852 |
+
-moz-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
|
853 |
+
}
|
854 |
+
|
855 |
+
.wplc_block_text {
|
856 |
+
display: inline-block;
|
857 |
+
height: 100%;
|
858 |
+
margin-right: 7px;
|
859 |
+
}
|
860 |
+
|
861 |
+
.wplc_block_icon {
|
862 |
+
height: 100%;
|
863 |
+
width: 35px;
|
864 |
+
background: transparent;
|
865 |
+
display: inline-block;
|
866 |
+
}
|
867 |
+
|
868 |
+
.wplc_block_icon.disabled {
|
869 |
+
display: none;
|
870 |
+
}
|
871 |
+
|
872 |
+
/* Block size styles: small */
|
873 |
+
.wplc_block.sm {
|
874 |
+
height: 25px;
|
875 |
+
line-height: 25px;
|
876 |
+
padding-left: 30px;
|
877 |
+
font-size: 12px;
|
878 |
+
}
|
879 |
+
|
880 |
+
.wplc_block.sm:hover:after {
|
881 |
+
height: 2px;
|
882 |
+
opacity: .2;
|
883 |
+
}
|
884 |
+
|
885 |
+
.wplc_block.sm .wplc_block_logo {
|
886 |
+
height: 25px;
|
887 |
+
width: 25px;
|
888 |
+
}
|
889 |
+
|
890 |
+
.wplc_block.sm .wplc_block_text {
|
891 |
+
margin-right: 7px;
|
892 |
+
}
|
893 |
+
|
894 |
+
.wplc_block.sm .wplc_block_icon {
|
895 |
+
margin-right: 7px;
|
896 |
+
width: 13px;
|
897 |
+
}
|
898 |
+
|
899 |
+
/* Block size styles: large */
|
900 |
+
.wplc_block.lg {
|
901 |
+
height: 80px;
|
902 |
+
line-height: 80px;
|
903 |
+
padding-left: 100px;
|
904 |
+
font-size: 25px;
|
905 |
+
}
|
906 |
+
|
907 |
+
.wplc_block.lg:hover:after {
|
908 |
+
height: 6px;
|
909 |
+
opacity: .2;
|
910 |
+
}
|
911 |
+
|
912 |
+
.wplc_block.lg .wplc_block_logo {
|
913 |
+
height: 80px;
|
914 |
+
width: 80px;
|
915 |
+
}
|
916 |
+
|
917 |
+
.wplc_block.lg .wplc_block_text {
|
918 |
+
margin-right: 13px;
|
919 |
+
}
|
920 |
+
|
921 |
+
.wplc_block.lg .wplc_block_icon {
|
922 |
+
margin-right: 13px;
|
923 |
+
}
|
924 |
+
|
css/font-awesome.min.css
CHANGED
@@ -1,4 +1,2337 @@
|
|
1 |
/*!
|
2 |
-
* Font Awesome 4.
|
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.6.3');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.6.3') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.6.3') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.6.3') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.6.3') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.6.3#fontawesomeregular') format('svg');font-weight:normal;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(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{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-remove:before,.fa-close: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-gear:before,.fa-cog: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-rotate-right:before,.fa-repeat: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-photo:before,.fa-image: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-warning:before,.fa-exclamation-triangle: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-gears:before,.fa-cogs: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-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars: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-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard: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-unlink:before,.fa-chain-broken: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-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw: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-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try: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-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap: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-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-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-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-resistance:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-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-soccer-ball-o:before,.fa-futbol-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-shekel:before,.fa-sheqel:before,.fa-ils: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-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator: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{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-stop-o:before,.fa-hand-paper-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-tv:before,.fa-television: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-asl-interpreting:before,.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-deafness:before,.fa-hard-of-hearing:before,.fa-deaf:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-signing:before,.fa-sign-language: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"}.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}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
}
|
css/fontawesome-iconpicker.css
ADDED
@@ -0,0 +1,335 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* Font Awesome Icon Picker
|
3 |
+
* https://itsjavi.com/fontawesome-iconpicker/
|
4 |
+
*
|
5 |
+
* Originally written by (c) 2016 Javi Aguilar
|
6 |
+
* Licensed under the MIT License
|
7 |
+
* https://github.com/itsjavi/fontawesome-iconpicker/blob/master/LICENSE
|
8 |
+
*
|
9 |
+
*/
|
10 |
+
/*
|
11 |
+
* Font Awesome Icon Picker
|
12 |
+
* https://itsjavi.com/fontawesome-iconpicker/
|
13 |
+
*
|
14 |
+
* Originally written by (c) 2016 Javi Aguilar
|
15 |
+
* Licensed under the MIT License
|
16 |
+
* https://github.com/itsjavi/fontawesome-iconpicker/blob/master/LICENSE
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
/*
|
20 |
+
* Font Awesome Icon Picker
|
21 |
+
* https://itsjavi.com/fontawesome-iconpicker/
|
22 |
+
*
|
23 |
+
* Originally written by (c) 2016 Javi Aguilar
|
24 |
+
* Licensed under the MIT License
|
25 |
+
* https://github.com/itsjavi/fontawesome-iconpicker/blob/master/LICENSE
|
26 |
+
*
|
27 |
+
*/
|
28 |
+
.iconpicker-popover.popover {
|
29 |
+
position: absolute;
|
30 |
+
top: 0;
|
31 |
+
left: 0;
|
32 |
+
display: none;
|
33 |
+
max-width: none;
|
34 |
+
padding: 1px;
|
35 |
+
text-align: left;
|
36 |
+
width: 216px;
|
37 |
+
background: #f7f7f7;
|
38 |
+
z-index: 100;
|
39 |
+
border: 1px solid #e7e7e7;
|
40 |
+
border-radius: 3px;
|
41 |
+
}
|
42 |
+
.iconpicker-popover.popover.top,
|
43 |
+
.iconpicker-popover.popover.topLeftCorner,
|
44 |
+
.iconpicker-popover.popover.topLeft,
|
45 |
+
.iconpicker-popover.popover.topRight,
|
46 |
+
.iconpicker-popover.popover.topRightCorner {
|
47 |
+
margin-top: -10px;
|
48 |
+
}
|
49 |
+
.iconpicker-popover.popover.right,
|
50 |
+
.iconpicker-popover.popover.rightTop,
|
51 |
+
.iconpicker-popover.popover.rightBottom {
|
52 |
+
margin-left: 10px;
|
53 |
+
}
|
54 |
+
.iconpicker-popover.popover.bottom,
|
55 |
+
.iconpicker-popover.popover.bottomRightCorner,
|
56 |
+
.iconpicker-popover.popover.bottomRight,
|
57 |
+
.iconpicker-popover.popover.bottomLeft,
|
58 |
+
.iconpicker-popover.popover.bottomLeftCorner {
|
59 |
+
margin-top: 10px;
|
60 |
+
}
|
61 |
+
.iconpicker-popover.popover.left,
|
62 |
+
.iconpicker-popover.popover.leftBottom,
|
63 |
+
.iconpicker-popover.popover.leftTop {
|
64 |
+
margin-left: -10px;
|
65 |
+
}
|
66 |
+
.iconpicker-popover.popover.inline {
|
67 |
+
margin: 0 0 12px 0;
|
68 |
+
position: relative;
|
69 |
+
display: inline-block;
|
70 |
+
opacity: 1;
|
71 |
+
top: auto;
|
72 |
+
left: auto;
|
73 |
+
bottom: auto;
|
74 |
+
right: auto;
|
75 |
+
max-width: 100%;
|
76 |
+
box-shadow: none;
|
77 |
+
z-index: auto;
|
78 |
+
vertical-align: top;
|
79 |
+
}
|
80 |
+
.iconpicker-popover.popover.inline > .arrow {
|
81 |
+
display: none;
|
82 |
+
}
|
83 |
+
.dropdown-menu .iconpicker-popover.inline {
|
84 |
+
margin: 0;
|
85 |
+
border: none;
|
86 |
+
}
|
87 |
+
.dropdown-menu.iconpicker-container {
|
88 |
+
padding: 0;
|
89 |
+
}
|
90 |
+
.iconpicker-popover.popover .popover-title {
|
91 |
+
padding: 12px;
|
92 |
+
font-size: 13px;
|
93 |
+
line-height: 15px;
|
94 |
+
border-bottom: 1px solid #ebebeb;
|
95 |
+
background-color: #f7f7f7;
|
96 |
+
}
|
97 |
+
.iconpicker-popover.popover .popover-title input[type=search].iconpicker-search {
|
98 |
+
margin: 0 0 2px 0;
|
99 |
+
}
|
100 |
+
.iconpicker-popover.popover .popover-title-text ~ input[type=search].iconpicker-search {
|
101 |
+
margin-top: 12px;
|
102 |
+
}
|
103 |
+
.iconpicker-popover.popover .popover-content {
|
104 |
+
padding: 0px;
|
105 |
+
text-align: center;
|
106 |
+
}
|
107 |
+
.iconpicker-popover .popover-footer {
|
108 |
+
float: none;
|
109 |
+
clear: both;
|
110 |
+
padding: 12px;
|
111 |
+
text-align: right;
|
112 |
+
margin: 0;
|
113 |
+
border-top: 1px solid #ebebeb;
|
114 |
+
background-color: #f7f7f7;
|
115 |
+
}
|
116 |
+
.iconpicker-popover .popover-footer:before,
|
117 |
+
.iconpicker-popover .popover-footer:after {
|
118 |
+
content: " ";
|
119 |
+
display: table;
|
120 |
+
}
|
121 |
+
.iconpicker-popover .popover-footer:after {
|
122 |
+
clear: both;
|
123 |
+
}
|
124 |
+
.iconpicker-popover .popover-footer .iconpicker-btn {
|
125 |
+
margin-left: 10px;
|
126 |
+
}
|
127 |
+
.iconpicker-popover .popover-footer input[type=search].iconpicker-search {
|
128 |
+
/*width:auto;
|
129 |
+
float:left;*/
|
130 |
+
margin-bottom: 12px;
|
131 |
+
}
|
132 |
+
.iconpicker-popover.popover > .arrow,
|
133 |
+
.iconpicker-popover.popover > .arrow:after {
|
134 |
+
position: absolute;
|
135 |
+
display: block;
|
136 |
+
width: 0;
|
137 |
+
height: 0;
|
138 |
+
border-color: transparent;
|
139 |
+
border-style: solid;
|
140 |
+
}
|
141 |
+
.iconpicker-popover.popover > .arrow {
|
142 |
+
border-width: 11px;
|
143 |
+
}
|
144 |
+
.iconpicker-popover.popover > .arrow:after {
|
145 |
+
border-width: 10px;
|
146 |
+
content: "";
|
147 |
+
}
|
148 |
+
.iconpicker-popover.popover.top > .arrow,
|
149 |
+
.iconpicker-popover.popover.topLeft > .arrow,
|
150 |
+
.iconpicker-popover.popover.topRight > .arrow {
|
151 |
+
left: 50%;
|
152 |
+
margin-left: -11px;
|
153 |
+
border-bottom-width: 0;
|
154 |
+
border-top-color: #999999;
|
155 |
+
border-top-color: rgba(0, 0, 0, 0.25);
|
156 |
+
bottom: -11px;
|
157 |
+
}
|
158 |
+
.iconpicker-popover.popover.top > .arrow:after,
|
159 |
+
.iconpicker-popover.popover.topLeft > .arrow:after,
|
160 |
+
.iconpicker-popover.popover.topRight > .arrow:after {
|
161 |
+
content: " ";
|
162 |
+
bottom: 1px;
|
163 |
+
margin-left: -10px;
|
164 |
+
border-bottom-width: 0;
|
165 |
+
border-top-color: #ffffff;
|
166 |
+
}
|
167 |
+
.iconpicker-popover.popover.topLeft > .arrow {
|
168 |
+
left: 8px;
|
169 |
+
margin-left: 0;
|
170 |
+
}
|
171 |
+
.iconpicker-popover.popover.topRight > .arrow {
|
172 |
+
left: auto;
|
173 |
+
right: 8px;
|
174 |
+
margin-left: 0;
|
175 |
+
}
|
176 |
+
.iconpicker-popover.popover.right > .arrow,
|
177 |
+
.iconpicker-popover.popover.rightTop > .arrow,
|
178 |
+
.iconpicker-popover.popover.rightBottom > .arrow {
|
179 |
+
top: 50%;
|
180 |
+
left: 23px;
|
181 |
+
margin-top: -11px;
|
182 |
+
border-left-width: 0;
|
183 |
+
border-right-color: #999999;
|
184 |
+
border-right-color: rgba(0, 0, 0, 0.25);
|
185 |
+
}
|
186 |
+
.iconpicker-popover.popover.right > .arrow:after,
|
187 |
+
.iconpicker-popover.popover.rightTop > .arrow:after,
|
188 |
+
.iconpicker-popover.popover.rightBottom > .arrow:after {
|
189 |
+
content: " ";
|
190 |
+
left: 1px;
|
191 |
+
bottom: -10px;
|
192 |
+
border-left-width: 0;
|
193 |
+
border-right-color: #ffffff;
|
194 |
+
}
|
195 |
+
.iconpicker-popover.popover.rightTop > .arrow {
|
196 |
+
top: auto;
|
197 |
+
bottom: 8px;
|
198 |
+
margin-top: 0;
|
199 |
+
}
|
200 |
+
.iconpicker-popover.popover.rightBottom > .arrow {
|
201 |
+
top: 8px;
|
202 |
+
margin-top: 0;
|
203 |
+
}
|
204 |
+
.iconpicker-popover.popover.bottom > .arrow,
|
205 |
+
.iconpicker-popover.popover.bottomRight > .arrow,
|
206 |
+
.iconpicker-popover.popover.bottomLeft > .arrow {
|
207 |
+
left: 50%;
|
208 |
+
margin-left: -11px;
|
209 |
+
border-top-width: 0;
|
210 |
+
border-bottom-color: #999999;
|
211 |
+
border-bottom-color: rgba(0, 0, 0, 0.25);
|
212 |
+
top: -11px;
|
213 |
+
}
|
214 |
+
.iconpicker-popover.popover.bottom > .arrow:after,
|
215 |
+
.iconpicker-popover.popover.bottomRight > .arrow:after,
|
216 |
+
.iconpicker-popover.popover.bottomLeft > .arrow:after {
|
217 |
+
content: " ";
|
218 |
+
top: 1px;
|
219 |
+
margin-left: -10px;
|
220 |
+
border-top-width: 0;
|
221 |
+
border-bottom-color: #ffffff;
|
222 |
+
}
|
223 |
+
.iconpicker-popover.popover.bottomLeft > .arrow {
|
224 |
+
left: 8px;
|
225 |
+
margin-left: 0;
|
226 |
+
}
|
227 |
+
.iconpicker-popover.popover.bottomRight > .arrow {
|
228 |
+
left: auto;
|
229 |
+
right: 8px;
|
230 |
+
margin-left: 0;
|
231 |
+
}
|
232 |
+
.iconpicker-popover.popover.left > .arrow,
|
233 |
+
.iconpicker-popover.popover.leftBottom > .arrow,
|
234 |
+
.iconpicker-popover.popover.leftTop > .arrow {
|
235 |
+
top: 50%;
|
236 |
+
right: -11px;
|
237 |
+
margin-top: -11px;
|
238 |
+
border-right-width: 0;
|
239 |
+
border-left-color: #999999;
|
240 |
+
border-left-color: rgba(0, 0, 0, 0.25);
|
241 |
+
}
|
242 |
+
.iconpicker-popover.popover.left > .arrow:after,
|
243 |
+
.iconpicker-popover.popover.leftBottom > .arrow:after,
|
244 |
+
.iconpicker-popover.popover.leftTop > .arrow:after {
|
245 |
+
content: " ";
|
246 |
+
right: 1px;
|
247 |
+
border-right-width: 0;
|
248 |
+
border-left-color: #ffffff;
|
249 |
+
bottom: -10px;
|
250 |
+
}
|
251 |
+
.iconpicker-popover.popover.leftBottom > .arrow {
|
252 |
+
top: 8px;
|
253 |
+
margin-top: 0;
|
254 |
+
}
|
255 |
+
.iconpicker-popover.popover.leftTop > .arrow {
|
256 |
+
top: auto;
|
257 |
+
bottom: 8px;
|
258 |
+
margin-top: 0;
|
259 |
+
}
|
260 |
+
.iconpicker {
|
261 |
+
position: relative;
|
262 |
+
text-align: left;
|
263 |
+
text-shadow: none;
|
264 |
+
line-height: 0;
|
265 |
+
display: block;
|
266 |
+
margin: 0;
|
267 |
+
overflow: hidden;
|
268 |
+
}
|
269 |
+
.iconpicker * {
|
270 |
+
-webkit-box-sizing: content-box;
|
271 |
+
-moz-box-sizing: content-box;
|
272 |
+
box-sizing: content-box;
|
273 |
+
position: relative;
|
274 |
+
}
|
275 |
+
.iconpicker:before,
|
276 |
+
.iconpicker:after {
|
277 |
+
content: " ";
|
278 |
+
display: table;
|
279 |
+
}
|
280 |
+
.iconpicker:after {
|
281 |
+
clear: both;
|
282 |
+
}
|
283 |
+
.iconpicker .iconpicker-items {
|
284 |
+
position: relative;
|
285 |
+
clear: both;
|
286 |
+
float: none;
|
287 |
+
padding: 12px 0 0 12px;
|
288 |
+
background: #fff;
|
289 |
+
margin: 0;
|
290 |
+
overflow: hidden;
|
291 |
+
overflow-y: auto;
|
292 |
+
min-height: 49px;
|
293 |
+
max-height: 246px;
|
294 |
+
}
|
295 |
+
.iconpicker .iconpicker-items:before,
|
296 |
+
.iconpicker .iconpicker-items:after {
|
297 |
+
content: " ";
|
298 |
+
display: table;
|
299 |
+
}
|
300 |
+
.iconpicker .iconpicker-items:after {
|
301 |
+
clear: both;
|
302 |
+
}
|
303 |
+
.iconpicker .iconpicker-item {
|
304 |
+
float: left;
|
305 |
+
width: 14px;
|
306 |
+
height: 14px;
|
307 |
+
padding: 12px;
|
308 |
+
margin: 0 12px 12px 0;
|
309 |
+
text-align: center;
|
310 |
+
cursor: pointer;
|
311 |
+
border-radius: 3px;
|
312 |
+
font-size: 14px;
|
313 |
+
box-shadow: 0 0 0 1px #dddddd;
|
314 |
+
color: inherit;
|
315 |
+
/*&:nth-child(4n+4) {
|
316 |
+
margin-right: 0;
|
317 |
+
}
|
318 |
+
&:nth-last-child(-n+4) {
|
319 |
+
margin-bottom: 0;
|
320 |
+
}*/
|
321 |
+
}
|
322 |
+
.iconpicker .iconpicker-item:hover:not(.iconpicker-selected) {
|
323 |
+
background-color: #eeeeee;
|
324 |
+
}
|
325 |
+
.iconpicker .iconpicker-item.iconpicker-selected {
|
326 |
+
box-shadow: none;
|
327 |
+
color: #fff;
|
328 |
+
background-color: #ED832F !important;
|
329 |
+
}
|
330 |
+
.iconpicker-component {
|
331 |
+
cursor: pointer;
|
332 |
+
}
|
333 |
+
a.iconpicker-selected {
|
334 |
+
background: #ED832F !important;
|
335 |
+
}
|
css/images/ui-bg_flat_10_000000_40x100.png
CHANGED
File without changes
|
css/images/ui-bg_flat_75_ffffff_40x100.png
CHANGED
File without changes
|
css/images/ui-bg_glass_65_ffffff_1x400.png
CHANGED
File without changes
|
css/images/ui-bg_glass_75_dadada_1x400.png
CHANGED
File without changes
|
css/images/ui-bg_glass_75_e6e6e6_1x400.png
CHANGED
File without changes
|
css/images/ui-bg_highlight-soft_75_cccccc_1x100.png
CHANGED
File without changes
|
css/images/ui-icons_ffffff_256x240.png
CHANGED
File without changes
|
css/jquery-ui.css
CHANGED
File without changes
|
css/node_history_styles.css
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.admin_chat_box_inner_bottom, .end_chat_div, .bleeper-edit-message{
|
2 |
+
display:none !important; /*User cannot type or input any data*/
|
3 |
+
}
|
4 |
+
|
5 |
+
#admin_chat_box {
|
6 |
+
border:none !important;
|
7 |
+
padding:0px !important;
|
8 |
+
background:none !important;
|
9 |
+
}
|
10 |
+
|
11 |
+
.admin_chat_img {
|
12 |
+
border-radius:100px !important;
|
13 |
+
}
|
14 |
+
|
15 |
+
.admin_chat_box {
|
16 |
+
border:none !important;
|
17 |
+
position:absolute !important;
|
18 |
+
background:#fff !important;
|
19 |
+
margin-left:40% !important;
|
20 |
+
padding: 3% !important;
|
21 |
+
width:50% !important;
|
22 |
+
height: 320px !important;
|
23 |
+
|
24 |
+
box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
|
25 |
+
-webkit-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
|
26 |
+
-moz-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
|
27 |
+
-o-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
|
28 |
+
}
|
29 |
+
|
30 |
+
.admin_visitor_info {
|
31 |
+
position:absolute !important;
|
32 |
+
background:#333;
|
33 |
+
padding:3% !important;
|
34 |
+
width:30% !important;
|
35 |
+
border-radius:5px;
|
36 |
+
color:#fff !important;
|
37 |
+
height:320px !important;
|
38 |
+
|
39 |
+
box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
|
40 |
+
-webkit-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
|
41 |
+
-moz-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
|
42 |
+
-o-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
|
43 |
+
}
|
44 |
+
|
45 |
+
.admin_chat_box_inner {
|
46 |
+
height: 90% !important;
|
47 |
+
}
|
48 |
+
|
49 |
+
.admin_visitor_advanced_info .part1 {
|
50 |
+
color: #fff !important;
|
51 |
+
}
|
52 |
+
|
53 |
+
.wplc_bottom_chat_info_container {
|
54 |
+
position: absolute;
|
55 |
+
top: 510px;
|
56 |
+
|
57 |
+
background:#fff;
|
58 |
+
border-radius:5px;
|
59 |
+
padding-left: 3%;
|
60 |
+
padding-right: 3%;
|
61 |
+
padding-top: 20px;
|
62 |
+
padding-bottom: 20px;
|
63 |
+
width: 30%;
|
64 |
+
|
65 |
+
box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
|
66 |
+
-webkit-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
|
67 |
+
-moz-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
|
68 |
+
-o-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
|
69 |
+
|
70 |
+
|
71 |
+
}
|
72 |
+
|
73 |
+
.wplc_bottom_chat_info_container h3{
|
74 |
+
margin-top: 0 !important;
|
75 |
+
}
|
css/remote_dash_styles.css
ADDED
@@ -0,0 +1,1221 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.toplevel_page_wplivechat-menu a {
|
2 |
+
color:#EB832C;
|
3 |
+
}
|
4 |
+
.toplevel_page_wplivechat-menu a:hover {
|
5 |
+
color:#EB832C;
|
6 |
+
text-decoration: underline;
|
7 |
+
}
|
8 |
+
.toplevel_page_wplivechat-menu a:active {
|
9 |
+
color:#EB832C;
|
10 |
+
}
|
11 |
+
.toplevel_page_wplivechat-menu a:focus {
|
12 |
+
color:#EB832C;
|
13 |
+
}
|
14 |
+
.wplc_a2a_dismiss {
|
15 |
+
position: absolute;
|
16 |
+
right: 10px;
|
17 |
+
top: 5px;
|
18 |
+
font-style: italic;
|
19 |
+
font-size: 0.9em;
|
20 |
+
text-decoration: underline;
|
21 |
+
cursor: pointer;
|
22 |
+
}
|
23 |
+
|
24 |
+
.floating-right-toolbar {
|
25 |
+
position: absolute;
|
26 |
+
right: 10px;
|
27 |
+
top: 10px;
|
28 |
+
z-index:9999;
|
29 |
+
}
|
30 |
+
|
31 |
+
.floating-right-toolbar i {
|
32 |
+
text-align: center;
|
33 |
+
display: inline-block;
|
34 |
+
color: #fff;
|
35 |
+
background: #333;
|
36 |
+
width: 25px;
|
37 |
+
height: 25px;
|
38 |
+
line-height: 26px;
|
39 |
+
font-size: 9px;
|
40 |
+
border-radius: 30px;
|
41 |
+
cursor: pointer;
|
42 |
+
transition: background 0.5s ease;
|
43 |
+
-webkit-transition: background 0.5s ease;
|
44 |
+
-moz-transition: background 0.5s ease;
|
45 |
+
-o-transition: background 0.5s ease;
|
46 |
+
}
|
47 |
+
|
48 |
+
.floating-right-toolbar i:hover {
|
49 |
+
background: #075077;
|
50 |
+
}
|
51 |
+
|
52 |
+
.online_agent {
|
53 |
+
position:relative;
|
54 |
+
}
|
55 |
+
.online_agent .unread_count {
|
56 |
+
top: 5px;
|
57 |
+
right:0px;
|
58 |
+
}
|
59 |
+
|
60 |
+
.wplc-admin-message, .wplc-user-message {
|
61 |
+
display: block;
|
62 |
+
padding-left: 40px;
|
63 |
+
font-size: 14px;
|
64 |
+
font-weight: 700;
|
65 |
+
margin-top: 6px;
|
66 |
+
}
|
67 |
+
|
68 |
+
.wplc-admin-message-avatar, .wplc-user-message-avatar {
|
69 |
+
border-radius: 5px;
|
70 |
+
height: 40px;
|
71 |
+
width: 40px;
|
72 |
+
left: 12px;
|
73 |
+
position: absolute;
|
74 |
+
}
|
75 |
+
|
76 |
+
.chatArea span.messageBody {
|
77 |
+
display: block;
|
78 |
+
clear: both;
|
79 |
+
font-size: 14px;
|
80 |
+
font-weight: 100;
|
81 |
+
}
|
82 |
+
|
83 |
+
#agent_list h4 {
|
84 |
+
padding-left:5px;
|
85 |
+
}
|
86 |
+
.userListBox_Wrapper {
|
87 |
+
top: 110px;
|
88 |
+
bottom: 118px;
|
89 |
+
position: absolute;
|
90 |
+
width: 100%;
|
91 |
+
overflow-y: auto;
|
92 |
+
}
|
93 |
+
.agent_involved {
|
94 |
+
width: 22px;
|
95 |
+
}
|
96 |
+
div#choose_online {
|
97 |
+
position: absolute;
|
98 |
+
top: 38px;
|
99 |
+
right: 0px;
|
100 |
+
color: #fff;
|
101 |
+
padding-right:10px;
|
102 |
+
}
|
103 |
+
|
104 |
+
.timedate {
|
105 |
+
font-size: 10px;
|
106 |
+
float: right;
|
107 |
+
position: relative;
|
108 |
+
top: -15px;
|
109 |
+
}
|
110 |
+
|
111 |
+
|
112 |
+
.wplc_remote_dash_below_contianer {
|
113 |
+
border-radius: 4px;
|
114 |
+
overflow: hidden;
|
115 |
+
box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
|
116 |
+
background:#fff;
|
117 |
+
margin-top:10px;
|
118 |
+
margin-right: 20px;
|
119 |
+
padding: 10px;
|
120 |
+
text-align:center;
|
121 |
+
}
|
122 |
+
|
123 |
+
.wplc_remote_dash_below_contianer p{
|
124 |
+
margin:0;
|
125 |
+
}
|
126 |
+
|
127 |
+
.agent_count{
|
128 |
+
text-align: center;
|
129 |
+
display: block;
|
130 |
+
background: #fcfcfc;
|
131 |
+
padding: 5px;
|
132 |
+
border-bottom: 1px solid #eee;
|
133 |
+
font-size: 10px;
|
134 |
+
width:50%;
|
135 |
+
float:left;
|
136 |
+
}
|
137 |
+
.history_link{
|
138 |
+
text-align: center;
|
139 |
+
display: block;
|
140 |
+
background: #fcfcfc;
|
141 |
+
padding: 5px;
|
142 |
+
border-bottom: 1px solid #eee;
|
143 |
+
font-size: 10px;
|
144 |
+
width:50%;
|
145 |
+
float:left;
|
146 |
+
}
|
147 |
+
|
148 |
+
.bleeper_tips_hints {
|
149 |
+
margin-top: 30px;
|
150 |
+
width: 300px;
|
151 |
+
position: relative;
|
152 |
+
display: block;
|
153 |
+
left: 0;
|
154 |
+
top: 15%;
|
155 |
+
color: #000;
|
156 |
+
text-align: center;
|
157 |
+
margin-left: auto;
|
158 |
+
margin-right: auto;
|
159 |
+
font-size: 1.3em;
|
160 |
+
color: #777;
|
161 |
+
}
|
162 |
+
|
163 |
+
#nifty_wrapper #agent_list {
|
164 |
+
display: block;
|
165 |
+
position: absolute;
|
166 |
+
bottom: 0px;
|
167 |
+
width: 100%;
|
168 |
+
max-height: 155px;
|
169 |
+
padding-right: 20px;
|
170 |
+
padding-left: 20px;
|
171 |
+
padding-top: 5px;
|
172 |
+
padding-bottom: 5px;
|
173 |
+
overflow-y: auto;
|
174 |
+
border-top: 1px solid #eee;
|
175 |
+
background: #333333;
|
176 |
+
color: #b8b8b8;
|
177 |
+
}
|
178 |
+
|
179 |
+
span.online_offline.online {
|
180 |
+
background-color: #6da164;
|
181 |
+
border-radius: 15px;
|
182 |
+
}
|
183 |
+
span.online_offline.offline {
|
184 |
+
background-color: #939393;
|
185 |
+
border-radius: 15px;
|
186 |
+
}
|
187 |
+
#agent_list ul li {
|
188 |
+
padding-left: 10px;
|
189 |
+
padding: 5px;
|
190 |
+
border-radius: 5px;
|
191 |
+
}
|
192 |
+
.online_agent.active {
|
193 |
+
background: #075077;
|
194 |
+
color: #fff;
|
195 |
+
}
|
196 |
+
|
197 |
+
/* Is typing indicator */
|
198 |
+
.typing_preview_wplc {
|
199 |
+
position: absolute;
|
200 |
+
bottom: 60px;
|
201 |
+
height: auto;
|
202 |
+
width: 100%;
|
203 |
+
background: #fff;
|
204 |
+
padding-top: 10px;
|
205 |
+
padding-left: 22px;
|
206 |
+
padding-bottom: 10px;
|
207 |
+
color: #777777;
|
208 |
+
background-color: rgba(250, 250, 250, 0.25);
|
209 |
+
box-shadow: 0 0 7px 1px rgba(0,0,0,0.07);
|
210 |
+
}
|
211 |
+
|
212 |
+
#wplc_footer_loading_icon {
|
213 |
+
font-size: 24px;
|
214 |
+
}
|
215 |
+
|
216 |
+
span.bleeper-edit-message {
|
217 |
+
margin-right: 10px;
|
218 |
+
margin-top: -26px;
|
219 |
+
right: 11px;
|
220 |
+
font-weight: 100;
|
221 |
+
color: #1985be;
|
222 |
+
font-size: 11px;
|
223 |
+
position: absolute;
|
224 |
+
cursor: pointer;
|
225 |
+
}
|
226 |
+
#quick_response_drawer_container {
|
227 |
+
top: 174px;
|
228 |
+
left: 30%;
|
229 |
+
z-index:999;
|
230 |
+
}
|
231 |
+
|
232 |
+
@media screen and (max-width: 1300px){
|
233 |
+
#quick_response_drawer_container {
|
234 |
+
left: 40%;
|
235 |
+
}
|
236 |
+
}
|
237 |
+
|
238 |
+
@media screen and (max-width: 700px){
|
239 |
+
#quick_response_drawer_container {
|
240 |
+
left: 10%;
|
241 |
+
}
|
242 |
+
}
|
243 |
+
|
244 |
+
/**
|
245 |
+
* Page with the list of visitors currently on the site, before opening a chat in the admin dashboard
|
246 |
+
*/
|
247 |
+
/* Filter button */
|
248 |
+
#nifty_wrapper .dropdown-toggle,
|
249 |
+
#nifty_wrapper .infoArea .filter-menu.pull-right {
|
250 |
+
margin-top:7px;
|
251 |
+
margin-right: -10px;
|
252 |
+
}
|
253 |
+
#nifty_wrapper .dropdown-toggle {
|
254 |
+
background-color: black;
|
255 |
+
color: #ffffff;
|
256 |
+
}
|
257 |
+
|
258 |
+
/* List header and items */
|
259 |
+
#nifty_wrapper .visitorListBoxHeader .vcol.visCol,
|
260 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visCol {
|
261 |
+
width:25%;
|
262 |
+
}
|
263 |
+
#nifty_wrapper .visitorListBoxHeader .vcol.visStatusCol,
|
264 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visStatusCol {
|
265 |
+
width:10%;
|
266 |
+
}
|
267 |
+
#nifty_wrapper .visitorListBoxHeader .vcol.visPageCol,
|
268 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visPageCol {
|
269 |
+
width:30%;
|
270 |
+
}
|
271 |
+
#nifty_wrapper .visitorListBoxHeader .vcol.visChatStatusCol,
|
272 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visChatStatusCol {
|
273 |
+
width:15%;
|
274 |
+
}
|
275 |
+
#nifty_wrapper .visitorListBoxHeader .vcol.visActionCol,
|
276 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visActionCol {
|
277 |
+
width: 10%;
|
278 |
+
}
|
279 |
+
|
280 |
+
/* List header */
|
281 |
+
#nifty_wrapper .visitorListBoxHeader .vcol.visCol {
|
282 |
+
padding-left:15px;
|
283 |
+
}
|
284 |
+
#nifty_wrapper .visitorListBoxHeader .vcol.visChatStatusCol {
|
285 |
+
padding-left:0px;
|
286 |
+
}
|
287 |
+
#nifty_wrapper .visitorListBoxHeader .vcol.visActionCol {
|
288 |
+
display:none;
|
289 |
+
}
|
290 |
+
|
291 |
+
/* List items */
|
292 |
+
#nifty_wrapper .visitorListBox .visitorList {
|
293 |
+
position: relative;
|
294 |
+
left: 0px;
|
295 |
+
top: 0px;
|
296 |
+
width: 100%;
|
297 |
+
height: auto;
|
298 |
+
padding: 10px;
|
299 |
+
margin: 0px;
|
300 |
+
background-color: #fafafa;
|
301 |
+
border-bottom: 1px solid #e6e6e6;
|
302 |
+
}
|
303 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol {
|
304 |
+
display: inline-block;
|
305 |
+
position: relative;
|
306 |
+
left: 0px;
|
307 |
+
top: 0px;
|
308 |
+
height: auto;
|
309 |
+
padding-left: 0px;
|
310 |
+
padding-top: 7px;
|
311 |
+
padding-right: 0px;
|
312 |
+
padding-bottom: 5px;
|
313 |
+
margin: 0px;
|
314 |
+
}
|
315 |
+
|
316 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visCol {
|
317 |
+
display: inline-block;
|
318 |
+
position: relative;
|
319 |
+
left: 0px;
|
320 |
+
top: 0px;
|
321 |
+
}
|
322 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visCol .userName {
|
323 |
+
padding-left:5px;
|
324 |
+
text-overflow: ellipsis;
|
325 |
+
}
|
326 |
+
|
327 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visStatusCol {
|
328 |
+
padding-top:0px;
|
329 |
+
}
|
330 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visStatusCol .info_chat {
|
331 |
+
display: inline-block;
|
332 |
+
position: relative;
|
333 |
+
left: 0px;
|
334 |
+
top: 0px;
|
335 |
+
font-size: 1.5em;
|
336 |
+
padding: 1px;
|
337 |
+
margin-top: 5px;
|
338 |
+
}
|
339 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visStatusCol .info_chat i {
|
340 |
+
margin-left:2px;
|
341 |
+
}
|
342 |
+
|
343 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visPageCol .referer-link {
|
344 |
+
margin-bottom:5px;
|
345 |
+
}
|
346 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visPageCol .label-default.time-state-label {
|
347 |
+
margin-bottom:3px;
|
348 |
+
text-overflow: ellipsis;
|
349 |
+
}
|
350 |
+
|
351 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visChatStatusCol {
|
352 |
+
padding-left:5px;
|
353 |
+
}
|
354 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visChatStatusCol label {
|
355 |
+
text-overflow: ellipsis;
|
356 |
+
}
|
357 |
+
|
358 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visActionCol {
|
359 |
+
padding-right: 5px;
|
360 |
+
}
|
361 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visActionCol .btn {
|
362 |
+
margin: 0px;
|
363 |
+
padding: 5px;
|
364 |
+
font-size: 1.3em;
|
365 |
+
text-decoration: none;
|
366 |
+
}
|
367 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visActionCol .wplc_initiate_chat {
|
368 |
+
background-color:#5BC0DE;
|
369 |
+
}
|
370 |
+
|
371 |
+
#nifty_wrapper .visitorListBox .visitorList .label-default {
|
372 |
+
background-color: #ffffff;
|
373 |
+
border: 1px solid #e6e6e6;
|
374 |
+
padding: 5px;
|
375 |
+
cursor: default;
|
376 |
+
}
|
377 |
+
|
378 |
+
@media(max-width:767px) {
|
379 |
+
|
380 |
+
/* Filter */
|
381 |
+
#nifty_wrapper .dropdown-toggle, #nifty_wrapper .infoArea .filter-menu.pull-right {
|
382 |
+
margin-top: 4px;
|
383 |
+
}
|
384 |
+
|
385 |
+
/* List header */
|
386 |
+
#nifty_wrapper .visitorListBoxHeader .vcol.visCol {
|
387 |
+
padding-left: 15px;
|
388 |
+
}
|
389 |
+
#nifty_wrapper .visitorListBoxHeader .vcol.visStatusCol,
|
390 |
+
#nifty_wrapper .visitorListBoxHeader .vcol.visPageCol,
|
391 |
+
#nifty_wrapper .visitorListBoxHeader .vcol.visChatStatusCol,
|
392 |
+
#nifty_wrapper .visitorListBoxHeader .vcol.visActionCol {
|
393 |
+
display:none;
|
394 |
+
}
|
395 |
+
|
396 |
+
/* List items */
|
397 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visCol,
|
398 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visPageCol,
|
399 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visChatStatusCol {
|
400 |
+
padding:5px;
|
401 |
+
}
|
402 |
+
|
403 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visCol {
|
404 |
+
width: 75%;
|
405 |
+
}
|
406 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visCol .userName {
|
407 |
+
padding-left:0px;
|
408 |
+
}
|
409 |
+
|
410 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visStatusCol {
|
411 |
+
width: 25%;
|
412 |
+
}
|
413 |
+
|
414 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visPageCol {
|
415 |
+
width: 75%;
|
416 |
+
}
|
417 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visPageCol .label-default.time-state-label {
|
418 |
+
margin-top:5px;
|
419 |
+
}
|
420 |
+
|
421 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visChatStatusCol {
|
422 |
+
width: 25%;
|
423 |
+
}
|
424 |
+
|
425 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visActionCol {
|
426 |
+
width: 100%;
|
427 |
+
}
|
428 |
+
|
429 |
+
#nifty_wrapper .visitorListBox .visitorList .vcol.visActionCol .btn {
|
430 |
+
width:100%;
|
431 |
+
font-size: 1em;
|
432 |
+
}
|
433 |
+
|
434 |
+
}
|
435 |
+
|
436 |
+
/**
|
437 |
+
* Pop Out Dashboard
|
438 |
+
*/
|
439 |
+
.bleeper-out-dash #nifty_wrapper {
|
440 |
+
border-radius:15px;
|
441 |
+
}
|
442 |
+
#nifty_wrapper .nifty_add_media_button {
|
443 |
+
position: absolute;
|
444 |
+
right: 0;
|
445 |
+
bottom: 0;
|
446 |
+
width: 60px;
|
447 |
+
height: 60px;
|
448 |
+
padding-left: 10px;
|
449 |
+
padding-right: 10px;
|
450 |
+
padding-top: 5px;
|
451 |
+
}
|
452 |
+
.bleeper-out-dash .wrap {
|
453 |
+
position: fixed;
|
454 |
+
right: 35px;
|
455 |
+
top: 30px;
|
456 |
+
width: 70%;
|
457 |
+
min-width:400px;
|
458 |
+
box-shadow: 20px 20px 20px 20px rgba(0,0,0,.07);
|
459 |
+
box-shadow: 0 5px 40px rgba(0,0,0,.66)!important;
|
460 |
+
border-radius: 20px;
|
461 |
+
padding: 0;
|
462 |
+
margin: 5px;
|
463 |
+
background-color: transparent !important;
|
464 |
+
}
|
465 |
+
.bleeper-out-dash .floating-right-toolbar i {
|
466 |
+
position:fixed !important;
|
467 |
+
top:56%;
|
468 |
+
right:7px;
|
469 |
+
}
|
470 |
+
.bleeper-out-dash .info_chat img {
|
471 |
+
clear: both;
|
472 |
+
display: block;
|
473 |
+
}
|
474 |
+
|
475 |
+
.bleeper-out-dash #user_count {
|
476 |
+
padding: 6px !important;
|
477 |
+
padding-bottom: 30px !important;
|
478 |
+
text-align: center;
|
479 |
+
}
|
480 |
+
.bleeper-out-dash #active_count {
|
481 |
+
font-size: 1em !important;
|
482 |
+
top: 0px;
|
483 |
+
}
|
484 |
+
.bleeper-out-dash #active_count_string {
|
485 |
+
font-size: 0.8em !important;
|
486 |
+
}
|
487 |
+
.bleeper-out-dash #choose_online {
|
488 |
+
top: 28px !important;
|
489 |
+
width: 100%;
|
490 |
+
padding-right: 0;
|
491 |
+
text-align: center;
|
492 |
+
}
|
493 |
+
.bleeper-out-dash .switchery-small {
|
494 |
+
height: 15px;
|
495 |
+
width: 24px;
|
496 |
+
}
|
497 |
+
.bleeper-out-dash .visActionCol {
|
498 |
+
float:right !important;
|
499 |
+
}
|
500 |
+
.bleeper-out-dash .visChatStatusCol {
|
501 |
+
width:20% !important;
|
502 |
+
}
|
503 |
+
.bleeper-out-dash .visChatDepCol {
|
504 |
+
display: none !important;
|
505 |
+
}
|
506 |
+
.bleeper-out-dash .agents_involved {
|
507 |
+
display: none !important;
|
508 |
+
}
|
509 |
+
.bleeper-out-dash .switchery-small>small {
|
510 |
+
width: 14px !important;
|
511 |
+
height: 14px !important;
|
512 |
+
}
|
513 |
+
.bleeper-out-dash #user_list {
|
514 |
+
width: 25%;
|
515 |
+
}
|
516 |
+
.bleeper-out-dash .agent_count {
|
517 |
+
display: none;
|
518 |
+
}
|
519 |
+
.bleeper-out-dash .history_link {
|
520 |
+
width: 100%;
|
521 |
+
}
|
522 |
+
.bleeper-out-dash #nifty_wrapper {
|
523 |
+
background-color:transparent !important;
|
524 |
+
}
|
525 |
+
.bleeper-out-dash .userListBox_Wrapper {
|
526 |
+
background-color: #fff;
|
527 |
+
top: 86px !important;
|
528 |
+
}
|
529 |
+
.bleeper-out-dash .nifty_bg_holder {
|
530 |
+
position:absolute;
|
531 |
+
left:180px;
|
532 |
+
border-top-right-radius: 15px;
|
533 |
+
border-bottom-right-radius: 15px;
|
534 |
+
}
|
535 |
+
#toolbar-item-open-bleeper {
|
536 |
+
position:fixed;
|
537 |
+
right:7px;
|
538 |
+
top:50%;
|
539 |
+
}
|
540 |
+
|
541 |
+
.bleeper-out-dash .user_header_wrapper_info {
|
542 |
+
width:60% !important;
|
543 |
+
}
|
544 |
+
|
545 |
+
.admin_visitor_advanced_info {
|
546 |
+
border: 1px solid #ccc;
|
547 |
+
border-radius: 3px;
|
548 |
+
padding: 15px;
|
549 |
+
background: #fdfdfd;
|
550 |
+
font-size:12px;
|
551 |
+
}
|
552 |
+
.admin_visitor_advanced_info hr {
|
553 |
+
margin-top:5px !important;
|
554 |
+
margin-bottom:5px !important;
|
555 |
+
}
|
556 |
+
|
557 |
+
.wplc-chat-box-notification--disabled {
|
558 |
+
padding: 5px;
|
559 |
+
padding-left: 15px;
|
560 |
+
padding-right: 15px;
|
561 |
+
display: block;
|
562 |
+
width: fit-content;
|
563 |
+
margin-top: 5px;
|
564 |
+
margin-left: 2px;
|
565 |
+
border-left: 4px solid #d26d6d;
|
566 |
+
background-color: #fff;
|
567 |
+
font-weight: bold;
|
568 |
+
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
|
569 |
+
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
|
570 |
+
-moz-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
|
571 |
+
}
|
572 |
+
|
573 |
+
/* Settings: tooltips */
|
574 |
+
#wplc_settings .tooltip {
|
575 |
+
display: block;
|
576 |
+
position:absolute;
|
577 |
+
width:auto;
|
578 |
+
max-width: 400px;
|
579 |
+
height:auto;
|
580 |
+
padding: 15px;
|
581 |
+
opacity: 0.85;
|
582 |
+
background-color: #333;
|
583 |
+
color: #eee;
|
584 |
+
border-radius: 15px;
|
585 |
+
}
|
586 |
+
|
587 |
+
/* Settings: Extensions box */
|
588 |
+
.wplc-extension-label-box {
|
589 |
+
display:block;
|
590 |
+
overflow:auto;
|
591 |
+
clear:both;
|
592 |
+
}
|
593 |
+
.wplc-extension-label {
|
594 |
+
display:block;
|
595 |
+
float:left;
|
596 |
+
padding:5px;
|
597 |
+
margin-right:5px;
|
598 |
+
font-size:0.8em;
|
599 |
+
background-color:#bbb;
|
600 |
+
color:#FFF;
|
601 |
+
webkit-border-radius: 5px;
|
602 |
+
-moz-border-radius: 5px;
|
603 |
+
border-radius: 5px;
|
604 |
+
}
|
605 |
+
.wplc-extension {
|
606 |
+
float: left;
|
607 |
+
margin: 0 1% 1% 0;
|
608 |
+
background: #fff;
|
609 |
+
border: 1px solid #ccc;
|
610 |
+
width: 320px;
|
611 |
+
padding: 14px;
|
612 |
+
height: 370px;
|
613 |
+
position: relative;
|
614 |
+
}
|
615 |
+
.wplc-extension h3 {
|
616 |
+
margin: 0 0 8px;
|
617 |
+
font-size: 13px;
|
618 |
+
}
|
619 |
+
.wplc-extension .button-secondary {
|
620 |
+
position: absolute;
|
621 |
+
bottom: 14px;
|
622 |
+
left: 14px;
|
623 |
+
}
|
624 |
+
.wplc-plugin {
|
625 |
+
height: 250px;
|
626 |
+
}
|
627 |
+
|
628 |
+
/* Settings: Agents */
|
629 |
+
.wplc_agent_container ul {
|
630 |
+
display:block;
|
631 |
+
overflow:auto;
|
632 |
+
}
|
633 |
+
.wplc_agent_container li{
|
634 |
+
display: block;
|
635 |
+
float: left;
|
636 |
+
text-align: center;
|
637 |
+
border: 1px solid #CCC;
|
638 |
+
width:150px;
|
639 |
+
height:310px;
|
640 |
+
padding: 10px;
|
641 |
+
border-radius: 5px;
|
642 |
+
margin: 10px;
|
643 |
+
box-shadow: 2px 2px 2px #CCC;
|
644 |
+
overflow: auto;
|
645 |
+
|
646 |
+
}
|
647 |
+
.wplc_agent_container img{
|
648 |
+
border-radius: 100px;
|
649 |
+
}
|
650 |
+
.wplc_agent_container h3 {
|
651 |
+
font: bold 12px/16px Arial;
|
652 |
+
padding: 0 0 0 0px;
|
653 |
+
color: #C2BBBE;
|
654 |
+
display: block;
|
655 |
+
height:40px;
|
656 |
+
text-transform: uppercase;
|
657 |
+
}
|
658 |
+
.wplc_agent_container small { word-wrap: break-word; display:block; height:50px; }
|
659 |
+
.wplc_agent_container select { width: 120px; }
|
660 |
+
|
661 |
+
/* Settings: Relevant extensions (bottom of the page) */
|
662 |
+
#wplc_star_rating{
|
663 |
+
text-align: center;
|
664 |
+
padding: 10px;
|
665 |
+
}
|
666 |
+
.relevant_extension p {
|
667 |
+
margin-top:2px;
|
668 |
+
}
|
669 |
+
.relevant_extension h3 {
|
670 |
+
margin-bottom:2px;
|
671 |
+
}
|
672 |
+
.relevant_extension {
|
673 |
+
width: 49% !important;
|
674 |
+
height: 125px !important;
|
675 |
+
opacity:0.5;
|
676 |
+
}
|
677 |
+
.relevant_extension:hover {
|
678 |
+
opacity:1.0;
|
679 |
+
}
|
680 |
+
.relevant_extension .button-secondary {
|
681 |
+
right: 10px !important;
|
682 |
+
text-align: center;
|
683 |
+
}
|
684 |
+
.relevant_extension img {
|
685 |
+
margin-right:10px;
|
686 |
+
}
|
687 |
+
|
688 |
+
@media (min-width:320px) {
|
689 |
+
/* smartphones, portrait iPhone, portrait 480x320 phones (Android) */
|
690 |
+
.relevant_extension {
|
691 |
+
width: 85% !important;
|
692 |
+
height: 145px !important;
|
693 |
+
opacity:0.5;
|
694 |
+
}
|
695 |
+
.relevant_extension img {
|
696 |
+
width:105px;
|
697 |
+
}
|
698 |
+
.wplc-extension .wp-post-image {
|
699 |
+
height: auto;
|
700 |
+
}
|
701 |
+
}
|
702 |
+
@media (min-width:480px) {
|
703 |
+
/* smartphones, Android phones, landscape iPhone */
|
704 |
+
.relevant_extension {
|
705 |
+
width: 94% !important;
|
706 |
+
height: 125px !important;
|
707 |
+
opacity:0.5;
|
708 |
+
}
|
709 |
+
.relevant_extension img {
|
710 |
+
width:105px;
|
711 |
+
}
|
712 |
+
.wplc-extension .wp-post-image {
|
713 |
+
height: auto;
|
714 |
+
}
|
715 |
+
}
|
716 |
+
@media (min-width:600px) {
|
717 |
+
/* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */
|
718 |
+
.relevant_extension {
|
719 |
+
width: 94% !important;
|
720 |
+
height: 125px !important;
|
721 |
+
opacity:0.5;
|
722 |
+
}
|
723 |
+
.relevant_extension img {
|
724 |
+
width:105px;
|
725 |
+
}
|
726 |
+
.wplc-extension .wp-post-image {
|
727 |
+
height: auto;
|
728 |
+
}
|
729 |
+
}
|
730 |
+
@media (min-width:801px) {
|
731 |
+
/* tablet, landscape iPad, lo-res laptops ands desktops */
|
732 |
+
.relevant_extension {
|
733 |
+
width: 43% !important;
|
734 |
+
height: 145px !important;
|
735 |
+
opacity:0.5;
|
736 |
+
}
|
737 |
+
.relevant_extension img {
|
738 |
+
width:95px;
|
739 |
+
}
|
740 |
+
.wplc-extension .wp-post-image {
|
741 |
+
height: auto;
|
742 |
+
}
|
743 |
+
}
|
744 |
+
@media (min-width:1025px) {
|
745 |
+
/* big landscape tablets, laptops, and desktops */
|
746 |
+
.relevant_extension {
|
747 |
+
width: 44% !important;
|
748 |
+
height: 125px !important;
|
749 |
+
opacity:0.5;
|
750 |
+
}
|
751 |
+
.relevant_extension img {
|
752 |
+
width:125px;
|
753 |
+
}
|
754 |
+
.wplc-extension .wp-post-image {
|
755 |
+
height: auto;
|
756 |
+
}
|
757 |
+
}
|
758 |
+
@media (min-width:1281px) {
|
759 |
+
/* hi-res laptops and desktops */
|
760 |
+
.relevant_extension {
|
761 |
+
width: 32% !important;
|
762 |
+
height: 125px !important;
|
763 |
+
opacity:0.5;
|
764 |
+
}
|
765 |
+
.relevant_extension img {
|
766 |
+
width:110px;
|
767 |
+
}
|
768 |
+
.wplc-extension .wp-post-image {
|
769 |
+
height: auto;
|
770 |
+
}
|
771 |
+
}
|
772 |
+
|
773 |
+
/* Settings: Styling Color Palletes */
|
774 |
+
.wplc-palette-selection {
|
775 |
+
border: 1px solid #CCC;
|
776 |
+
border-radius: 5px;
|
777 |
+
padding: 5px;
|
778 |
+
margin: 5px;
|
779 |
+
height:100%;
|
780 |
+
|
781 |
+
}
|
782 |
+
.wplc_palette_single {
|
783 |
+
margin: 5px;
|
784 |
+
margin-top: 15px;
|
785 |
+
width: 162px;
|
786 |
+
height: 122px;
|
787 |
+
text-align: center;
|
788 |
+
display: inline-block;
|
789 |
+
vertical-align: top;
|
790 |
+
cursor: pointer;
|
791 |
+
|
792 |
+
}
|
793 |
+
.wplc-palette-top { display:block; width:100%; height:25%; }
|
794 |
+
|
795 |
+
/* WPLC Modal */
|
796 |
+
.wplc_modal {
|
797 |
+
display: block;
|
798 |
+
position: fixed;
|
799 |
+
top: 0;
|
800 |
+
bottom: 0;
|
801 |
+
left: 0;
|
802 |
+
right: 0;
|
803 |
+
background: rgba(0, 0, 0, 0.3);
|
804 |
+
}
|
805 |
+
.wplc_modal_inner {
|
806 |
+
width: 60%;
|
807 |
+
height: 300px;
|
808 |
+
margin: auto;
|
809 |
+
background: #ffffff;
|
810 |
+
position: fixed;
|
811 |
+
z-index: 9999;
|
812 |
+
display: block;
|
813 |
+
top: 0;
|
814 |
+
bottom: 0;
|
815 |
+
left: 0;
|
816 |
+
right: 0;
|
817 |
+
border: 1px solid #9f9f9f;
|
818 |
+
border-radius: 3px;
|
819 |
+
}
|
820 |
+
.wplc_modal_inner_title {
|
821 |
+
font-size: 18px;
|
822 |
+
padding: 17px;
|
823 |
+
border-bottom: 1px solid #d5d5d5;
|
824 |
+
}
|
825 |
+
.wplc_modal_inner_content {
|
826 |
+
position: absolute;
|
827 |
+
display: block;
|
828 |
+
left: 10px;
|
829 |
+
right: 10px;
|
830 |
+
bottom: 55px;
|
831 |
+
top: 55px;
|
832 |
+
overflow-y: auto;
|
833 |
+
}
|
834 |
+
.wplc_modal_inner_actions {
|
835 |
+
height: 28px;
|
836 |
+
position: absolute;
|
837 |
+
bottom: 5px;
|
838 |
+
left: 0;
|
839 |
+
right: 0;
|
840 |
+
text-align: center;
|
841 |
+
}
|
842 |
+
|
843 |
+
|
844 |
+
span.wplc_system_notification {
|
845 |
+
display: block;
|
846 |
+
clear:both;
|
847 |
+
padding: 8px;
|
848 |
+
font-style: italic;
|
849 |
+
text-align: right;
|
850 |
+
}
|
851 |
+
|
852 |
+
.widefat th.sortable, .widefat th.sorted {
|
853 |
+
padding: 5px 10px !important;
|
854 |
+
}
|
855 |
+
|
856 |
+
@media (max-width: 1145px) {
|
857 |
+
.wplc-badge {
|
858 |
+
max-width: 35% !important;
|
859 |
+
float: none !important;
|
860 |
+
margin: 0 auto !important;
|
861 |
+
}
|
862 |
+
}
|
863 |
+
|
864 |
+
#wplc_tabs .ui-tabs-anchor {
|
865 |
+
width: 100%;
|
866 |
+
}
|
867 |
+
|
868 |
+
.wplc-chat-in-progress {
|
869 |
+
display: inline-block;
|
870 |
+
width: 100px;
|
871 |
+
margin-top: 5px;
|
872 |
+
}
|
873 |
+
|
874 |
+
/* History */
|
875 |
+
.wplc-history__date {
|
876 |
+
display: block;
|
877 |
+
margin-bottom: 5px;
|
878 |
+
}
|
879 |
+
|
880 |
+
.wplc-history__date-end {
|
881 |
+
margin-bottom: 10px;
|
882 |
+
}
|
883 |
+
|
884 |
+
.wplc-history__date strong {
|
885 |
+
margin-right: 5px;
|
886 |
+
}
|
887 |
+
|
888 |
+
.wplc-exclude-post-types__item,
|
889 |
+
.wplc-require-user-info__item {
|
890 |
+
margin-bottom: 5px;
|
891 |
+
}
|
892 |
+
.wplc-chat-box-notification--disabled {
|
893 |
+
padding: 5px;
|
894 |
+
display: block;
|
895 |
+
width: 40%;
|
896 |
+
margin-left: auto;
|
897 |
+
margin-right: auto;
|
898 |
+
border: 1px solid #d26d6d;
|
899 |
+
background-color: #f3bfbf;
|
900 |
+
font-weight: bold;
|
901 |
+
}
|
902 |
+
|
903 |
+
.admin_chat_box_inner span.timedate {
|
904 |
+
clear: both;
|
905 |
+
position: relative;
|
906 |
+
font-size: 0.8em;
|
907 |
+
font-style:italic
|
908 |
+
}
|
909 |
+
|
910 |
+
/* Other components */
|
911 |
+
#nifty_file_holder {
|
912 |
+
float: right;
|
913 |
+
margin-right: 13px;
|
914 |
+
margin-top: 4px;
|
915 |
+
}
|
916 |
+
.nifty_tedit_icon{
|
917 |
+
font-size: 12px;
|
918 |
+
padding-left: 6px;
|
919 |
+
}
|
920 |
+
#nifty_text_editor_holder{
|
921 |
+
margin-top:3px;
|
922 |
+
margin-left:4px;
|
923 |
+
}
|
924 |
+
|
925 |
+
.wplc_faded_upsell {
|
926 |
+
color: lightgrey;
|
927 |
+
}
|
928 |
+
.wplc_chat_area_temp {
|
929 |
+
padding:20px;
|
930 |
+
}
|
931 |
+
|
932 |
+
.offline-quote {
|
933 |
+
font-size: 26px;
|
934 |
+
font-style: italic;
|
935 |
+
text-align: center;
|
936 |
+
width: 100%;
|
937 |
+
display: block;
|
938 |
+
color: #343434;
|
939 |
+
}
|
940 |
+
.offline-status {
|
941 |
+
display: block;
|
942 |
+
width: 100%;
|
943 |
+
clear:both;
|
944 |
+
text-align: center;
|
945 |
+
line-height: 45px;
|
946 |
+
}
|
947 |
+
|
948 |
+
.wplc-logo {
|
949 |
+
padding-top: 50px;
|
950 |
+
max-width: 100vw;
|
951 |
+
padding-bottom: 50px;
|
952 |
+
}
|
953 |
+
.wplc_network_issue {
|
954 |
+
position: absolute;
|
955 |
+
background: white;
|
956 |
+
width: 400px;
|
957 |
+
height: 55px;
|
958 |
+
border-left: 4px solid #ec822c;
|
959 |
+
left: 0;
|
960 |
+
right: 0;
|
961 |
+
top: 0;
|
962 |
+
bottom: 0;
|
963 |
+
margin: auto;
|
964 |
+
box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);
|
965 |
+
-webkit-box-shadow: 0 0px 0px 0 rgba(0,0,0,0.16),0 2px 7px 0 rgba(0,0,0,0.12);
|
966 |
+
-moz-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);
|
967 |
+
-o-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);
|
968 |
+
}
|
969 |
+
.wplc_network_issue span {
|
970 |
+
width: 80%;
|
971 |
+
display: block;
|
972 |
+
padding-top: 5%;
|
973 |
+
padding-bottom: 5%;
|
974 |
+
padding-left: 10%;
|
975 |
+
padding-right: 10%;
|
976 |
+
margin: auto;
|
977 |
+
position: absolute;
|
978 |
+
top: 0;
|
979 |
+
bottom: 0;
|
980 |
+
}
|
981 |
+
.wplc_dashboard_additional_label {
|
982 |
+
width: 100%;
|
983 |
+
text-align: center;
|
984 |
+
display: block;
|
985 |
+
margin-top: 10px;
|
986 |
+
cursor: help;
|
987 |
+
}
|
988 |
+
|
989 |
+
/* Gutenberg styles */
|
990 |
+
#tabs-gutenberg input[type='button'] {
|
991 |
+
cursor: pointer;
|
992 |
+
}
|
993 |
+
|
994 |
+
#wplc_custom_js_editor, #wplc_custom_css_editor, #wplc_custom_html_editor {
|
995 |
+
width: 100%;
|
996 |
+
height: 285px;
|
997 |
+
margin: 10px 0 10px 0;
|
998 |
+
z-index: 0;
|
999 |
+
}
|
1000 |
+
|
1001 |
+
#wplc_gutenberg_icon {
|
1002 |
+
cursor: pointer;
|
1003 |
+
}
|
1004 |
+
|
1005 |
+
.wplc_code {
|
1006 |
+
cursor: pointer;
|
1007 |
+
transition: all .2s ease-in-out;
|
1008 |
+
border-radius: 3px;
|
1009 |
+
color: #696969;
|
1010 |
+
}
|
1011 |
+
|
1012 |
+
.wplc_code:hover {
|
1013 |
+
background: #d7d7d7;
|
1014 |
+
}
|
1015 |
+
|
1016 |
+
.wplc_code:focus, .wplc_code:active {
|
1017 |
+
background: #018add;
|
1018 |
+
color: #fff;
|
1019 |
+
}
|
1020 |
+
|
1021 |
+
#wplc-chat-box {
|
1022 |
+
width: fit-content;
|
1023 |
+
position: relative;
|
1024 |
+
cursor: pointer;
|
1025 |
+
}
|
1026 |
+
|
1027 |
+
.wplc_block {
|
1028 |
+
position: relative;
|
1029 |
+
display:inline-block;
|
1030 |
+
background: #32373c;
|
1031 |
+
color: #eee;
|
1032 |
+
border-radius: 3px;
|
1033 |
+
height: 35px;
|
1034 |
+
padding-left: 45px;
|
1035 |
+
margin: 5px 0 5px 0;
|
1036 |
+
transition: all .2s ease-in-out;
|
1037 |
+
cursor: pointer;
|
1038 |
+
border-bottom: 0px solid #111;
|
1039 |
+
font-size: 17px;
|
1040 |
+
line-height: 35px;
|
1041 |
+
}
|
1042 |
+
|
1043 |
+
.wplc_block:hover {
|
1044 |
+
transform: translateY(-2px);
|
1045 |
+
}
|
1046 |
+
|
1047 |
+
.wplc_block:after {
|
1048 |
+
content: "";
|
1049 |
+
position: absolute;
|
1050 |
+
display: block;
|
1051 |
+
height: 0px;
|
1052 |
+
bottom: 0;
|
1053 |
+
left: 0;
|
1054 |
+
width: 100%;
|
1055 |
+
background-color: #000;
|
1056 |
+
opacity: 0;
|
1057 |
+
transition: all .2s ease-in-out;
|
1058 |
+
}
|
1059 |
+
|
1060 |
+
.wplc_block:hover:after {
|
1061 |
+
height: 3px;
|
1062 |
+
opacity: .2;
|
1063 |
+
}
|
1064 |
+
|
1065 |
+
#wplc-chat-box.disabled:first-child:after {
|
1066 |
+
content: "Disabled";
|
1067 |
+
color:#fff;
|
1068 |
+
font-size: 17px;
|
1069 |
+
text-transform: uppercase;
|
1070 |
+
text-align: center;
|
1071 |
+
display: block;
|
1072 |
+
position: absolute;
|
1073 |
+
height: 100%;
|
1074 |
+
width: 100%;
|
1075 |
+
bottom: 0;
|
1076 |
+
left: 0;
|
1077 |
+
background: #ED832F;
|
1078 |
+
opacity: .9;
|
1079 |
+
}
|
1080 |
+
|
1081 |
+
.wplc_block_logo {
|
1082 |
+
width: 35px;
|
1083 |
+
height: 35px;
|
1084 |
+
position: absolute;
|
1085 |
+
left: 0;
|
1086 |
+
background: #e7e7e7;
|
1087 |
+
display: inline-block;
|
1088 |
+
margin:0;
|
1089 |
+
background-size: cover;
|
1090 |
+
background-position: center;
|
1091 |
+
background-color:#ED832F !important;
|
1092 |
+
transition: all .2s ease-in-out;
|
1093 |
+
box-sizing: border-box;
|
1094 |
+
box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
|
1095 |
+
-webkit-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
|
1096 |
+
-moz-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
|
1097 |
+
}
|
1098 |
+
|
1099 |
+
.wplc_block_text {
|
1100 |
+
display: inline-block;
|
1101 |
+
height: 100%;
|
1102 |
+
margin-right: 7px;
|
1103 |
+
}
|
1104 |
+
|
1105 |
+
.wplc_block_icon {
|
1106 |
+
height: 100%;
|
1107 |
+
width: 35px;
|
1108 |
+
background: transparent;
|
1109 |
+
display: inline-block;
|
1110 |
+
}
|
1111 |
+
|
1112 |
+
.wplc_block_icon.disabled {
|
1113 |
+
display: none;
|
1114 |
+
}
|
1115 |
+
|
1116 |
+
/* Block size styles: small */
|
1117 |
+
.wplc_block.sm {
|
1118 |
+
height: 25px;
|
1119 |
+
line-height: 25px;
|
1120 |
+
padding-left: 30px;
|
1121 |
+
font-size: 12px;
|
1122 |
+
}
|
1123 |
+
|
1124 |
+
.wplc_block.sm:hover:after {
|
1125 |
+
height: 2px;
|
1126 |
+
opacity: .2;
|
1127 |
+
}
|
1128 |
+
|
1129 |
+
.wplc_block.sm .wplc_block_logo {
|
1130 |
+
height: 25px;
|
1131 |
+
width: 25px;
|
1132 |
+
}
|
1133 |
+
|
1134 |
+
.wplc_block.sm .wplc_block_text {
|
1135 |
+
margin-right: 7px;
|
1136 |
+
}
|
1137 |
+
|
1138 |
+
.wplc_block.sm .wplc_block_icon {
|
1139 |
+
margin-right: 7px;
|
1140 |
+
width: 13px;
|
1141 |
+
}
|
1142 |
+
|
1143 |
+
/* Block size styles: large */
|
1144 |
+
.wplc_block.lg {
|
1145 |
+
height: 80px;
|
1146 |
+
line-height: 80px;
|
1147 |
+
padding-left: 100px;
|
1148 |
+
font-size: 25px;
|
1149 |
+
}
|
1150 |
+
|
1151 |
+
.wplc_block.lg:hover:after {
|
1152 |
+
height: 6px;
|
1153 |
+
opacity: .2;
|
1154 |
+
}
|
1155 |
+
|
1156 |
+
.wplc_block.lg .wplc_block_logo {
|
1157 |
+
height: 80px;
|
1158 |
+
width: 80px;
|
1159 |
+
}
|
1160 |
+
|
1161 |
+
.wplc_block.lg .wplc_block_text {
|
1162 |
+
margin-right: 13px;
|
1163 |
+
}
|
1164 |
+
|
1165 |
+
.wplc_block.lg .wplc_block_icon {
|
1166 |
+
margin-right: 13px;
|
1167 |
+
}
|
1168 |
+
|
1169 |
+
/* Warnings */
|
1170 |
+
#wpfooter + #quick_response_drawer_container + .update-nag {
|
1171 |
+
display: none !important;
|
1172 |
+
position: relative;
|
1173 |
+
float: left;
|
1174 |
+
left: 15%;
|
1175 |
+
top: -60px;
|
1176 |
+
width: 80%;
|
1177 |
+
margin-top: 0px;
|
1178 |
+
margin-bottom: 10px;
|
1179 |
+
line-height: 19px;
|
1180 |
+
padding: 11px 15px;
|
1181 |
+
font-size: 14px;
|
1182 |
+
text-align: left;
|
1183 |
+
background-color: #fff;
|
1184 |
+
border-left: 4px solid #ffba00;
|
1185 |
+
box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
|
1186 |
+
}
|
1187 |
+
|
1188 |
+
/* Main containers of the other settings (Surveys, History ...) */
|
1189 |
+
#wpbody-content #screen-meta + .wrap div,
|
1190 |
+
#wpbody-content #screen-meta + .wp-list-table {
|
1191 |
+
display: block;
|
1192 |
+
position: relative;
|
1193 |
+
left: 0px;
|
1194 |
+
top: 0px;
|
1195 |
+
margin-top: 5px;
|
1196 |
+
height:auto;
|
1197 |
+
}
|
1198 |
+
#wpbody-content #screen-meta + .wrap div {
|
1199 |
+
width:98% !important;
|
1200 |
+
}
|
1201 |
+
#wpbody-content #screen-meta + .wrap .widefat {
|
1202 |
+
width: 100% !important;
|
1203 |
+
}
|
1204 |
+
|
1205 |
+
/* Live Chat -> Reports */
|
1206 |
+
#reporting_tabs {
|
1207 |
+
width: auto;
|
1208 |
+
max-width: 98%;
|
1209 |
+
}
|
1210 |
+
|
1211 |
+
/* Live Chat -> Feedback */
|
1212 |
+
#wpbody-content #screen-meta + .wrap form[name='wplc_feedback'] {
|
1213 |
+
width: 70%;
|
1214 |
+
max-width: 70%;
|
1215 |
+
}
|
1216 |
+
#wpbody-content #screen-meta + .wrap form[name='wplc_feedback'] .wp-list-table {
|
1217 |
+
width: 100% !important;
|
1218 |
+
}
|
1219 |
+
#wpbody-content #screen-meta + .wrap form[name='wplc_feedback'] .wp-list-table tbody td input {
|
1220 |
+
width: 100%;
|
1221 |
+
}
|
css/support-css.css
CHANGED
@@ -32,4 +32,11 @@
|
|
32 |
padding:1%;
|
33 |
min-height:420px;
|
34 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
}
|
32 |
padding:1%;
|
33 |
min-height:420px;
|
34 |
}
|
35 |
+
}
|
36 |
+
.wplc_row_col {
|
37 |
+
border-radius:5px;
|
38 |
+
box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
|
39 |
+
-webkit-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
|
40 |
+
-moz-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
|
41 |
+
-o-box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
|
42 |
}
|
css/themes/classic.css
CHANGED
@@ -203,7 +203,7 @@
|
|
203 |
#wp-live-chat-2 {
|
204 |
|
205 |
|
206 |
-
|
207 |
padding:5px;
|
208 |
}
|
209 |
#wp-live-chat-2 input{
|
@@ -342,7 +342,15 @@ span.wplc_system_notification {
|
|
342 |
position: absolute;
|
343 |
top: 3px;
|
344 |
right: -38px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
345 |
}
|
|
|
346 |
.wplc-admin-message img{
|
347 |
border-radius: 25px;
|
348 |
position: absolute;
|
@@ -697,4 +705,110 @@ input#nifty_ratings_comment {
|
|
697 |
.wplc-msg-float-right {
|
698 |
margin-right: 15%;
|
699 |
text-align: right;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
700 |
}
|
203 |
#wp-live-chat-2 {
|
204 |
|
205 |
|
206 |
+
|
207 |
padding:5px;
|
208 |
}
|
209 |
#wp-live-chat-2 input{
|
342 |
position: absolute;
|
343 |
top: 3px;
|
344 |
right: -38px;
|
345 |
+
max-width: 30px;
|
346 |
+
max-height: 30px;
|
347 |
+
}
|
348 |
+
|
349 |
+
.wplc-admin-message-avatar{
|
350 |
+
max-width: 30px;
|
351 |
+
max-height: 30px;
|
352 |
}
|
353 |
+
|
354 |
.wplc-admin-message img{
|
355 |
border-radius: 25px;
|
356 |
position: absolute;
|
705 |
.wplc-msg-float-right {
|
706 |
margin-right: 15%;
|
707 |
text-align: right;
|
708 |
+
}
|
709 |
+
|
710 |
+
.wdt-emoji-popup.open{
|
711 |
+
z-index: 99999;
|
712 |
+
}
|
713 |
+
|
714 |
+
.wdt-emoji-picker {
|
715 |
+
right: 84px !important;
|
716 |
+
bottom: 27px !important;
|
717 |
+
font-size: 17px;
|
718 |
+
text-align: center;
|
719 |
+
line-height: 50px;
|
720 |
+
}
|
721 |
+
|
722 |
+
.wdt-emoji-picker i {
|
723 |
+
position: absolute;
|
724 |
+
left: 61px;
|
725 |
+
top: 27px;
|
726 |
+
}
|
727 |
+
|
728 |
+
.wdt-emoji-popup.ready.open {
|
729 |
+
width: 281px;
|
730 |
+
margin-left: 20px;
|
731 |
+
}
|
732 |
+
|
733 |
+
.wdt-emoji-popup h3.sticky {
|
734 |
+
width: 214px;
|
735 |
+
}
|
736 |
+
|
737 |
+
.wdt-emoji-tab {
|
738 |
+
width: 25px;
|
739 |
+
}
|
740 |
+
|
741 |
+
.wdt-credit{
|
742 |
+
z-index: 999999;
|
743 |
+
position: absolute;
|
744 |
+
right: 5px;
|
745 |
+
bottom: 5px;
|
746 |
+
font-size: 9px;
|
747 |
+
color: #cecece;
|
748 |
+
}
|
749 |
+
|
750 |
+
#chat_drag_zone {
|
751 |
+
background: rgba(51, 51, 51, 0.35);
|
752 |
+
position: absolute;
|
753 |
+
top: 0;
|
754 |
+
left: 0;
|
755 |
+
right: 0;
|
756 |
+
bottom: 0;
|
757 |
+
z-index: 9999999;
|
758 |
+
border-top-left-radius: 11px;
|
759 |
+
border-top-right-radius: 11px;
|
760 |
+
}
|
761 |
+
|
762 |
+
#chat_drag_zone_inner {
|
763 |
+
position: absolute;
|
764 |
+
top: 10%;
|
765 |
+
left: 5%;
|
766 |
+
right: 5%;
|
767 |
+
bottom: 10%;
|
768 |
+
border: 3px dashed #ffffff;
|
769 |
+
}
|
770 |
+
|
771 |
+
#chat_drag_zone_inner span {
|
772 |
+
color: #fff;
|
773 |
+
position: absolute;
|
774 |
+
width: 100%;
|
775 |
+
height: 50px;
|
776 |
+
text-align: center;
|
777 |
+
font-size: 30px;
|
778 |
+
margin-top: auto;
|
779 |
+
margin-bottom: auto;
|
780 |
+
top: 50%;
|
781 |
+
transform: translate(0, -50%);
|
782 |
+
}
|
783 |
+
|
784 |
+
#nifty_text_editor_holder{
|
785 |
+
display:none;
|
786 |
+
}
|
787 |
+
|
788 |
+
.typing_indicator{
|
789 |
+
padding-left: 5px;
|
790 |
+
}
|
791 |
+
|
792 |
+
#wp-live-chat-2-info {
|
793 |
+
background: none !important;
|
794 |
+
color: #333 !important;
|
795 |
+
}
|
796 |
+
a.bleeper_restart_chat {
|
797 |
+
text-align: center;
|
798 |
+
margin-top: 27px;
|
799 |
+
display: block;
|
800 |
+
}
|
801 |
+
|
802 |
+
div#bleeper_chat_ended {
|
803 |
+
min-height: 60px;
|
804 |
+
max-height: 82px;
|
805 |
+
height: 82px;
|
806 |
+
position: absolute;
|
807 |
+
bottom: 0;
|
808 |
+
width: 100%;
|
809 |
+
z-index: 99999999999999999;
|
810 |
+
background-color: #fff;
|
811 |
+
border-bottom-right-radius: 10px;
|
812 |
+
border-bottom-left-radius: 10px;
|
813 |
+
box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
|
814 |
}
|
css/themes/modern.css
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
line-height: 32px;
|
6 |
color: #60686e;
|
7 |
/* width: 100%; */
|
8 |
-
width:
|
9 |
height: 40px;
|
10 |
/* margin-bottom: 10px; */
|
11 |
border: 0;
|
@@ -71,7 +71,7 @@
|
|
71 |
top: 35px;
|
72 |
bottom: 113px;
|
73 |
/* height: 100%; */
|
74 |
-
z-index:
|
75 |
position: absolute;
|
76 |
overflow-y: auto;
|
77 |
padding:10px;
|
@@ -97,6 +97,7 @@
|
|
97 |
}
|
98 |
#wplc_user_message_div {
|
99 |
min-height: 60px;
|
|
|
100 |
position: absolute;
|
101 |
bottom: -60px;
|
102 |
width: 100%;
|
@@ -454,6 +455,8 @@ z-index: 2147483000;
|
|
454 |
position: absolute;
|
455 |
left: -38px;
|
456 |
border-radius: 15px;
|
|
|
|
|
457 |
}
|
458 |
|
459 |
|
@@ -466,7 +469,7 @@ z-index: 2147483000;
|
|
466 |
|
467 |
}
|
468 |
.wplc-shrink {
|
469 |
-
height: 50px !important
|
470 |
}
|
471 |
|
472 |
.wplc-shrink .wplc_agent_name {
|
@@ -517,14 +520,17 @@ z-index: 2147483000;
|
|
517 |
box-shadow: 0 5px 20px -2px rgba(0,0,0,.16) !important;
|
518 |
margin-top:0px;
|
519 |
opacity:0.90;
|
520 |
-
transition:
|
521 |
padding-bottom:18px;
|
|
|
522 |
}
|
523 |
#wplc_chatbox_header_bg {
|
524 |
border-top-left-radius: 10px;
|
525 |
border-top-right-radius: 10px;
|
526 |
-
|
|
|
527 |
}
|
|
|
528 |
.wplc-admin-message:before {
|
529 |
display: block;
|
530 |
width: 0;
|
@@ -579,6 +585,8 @@ z-index: 2147483000;
|
|
579 |
position: absolute;
|
580 |
right: -38px;
|
581 |
border-radius: 15px;
|
|
|
|
|
582 |
}
|
583 |
|
584 |
|
@@ -776,7 +784,7 @@ z-index: 2147483000;
|
|
776 |
}
|
777 |
.nifty_attach_icon {
|
778 |
position: absolute;
|
779 |
-
|
780 |
right: 65px;
|
781 |
color:#999;
|
782 |
font-size:20px;
|
@@ -788,7 +796,7 @@ z-index: 2147483000;
|
|
788 |
}
|
789 |
#nifty_ratings_holder {
|
790 |
position: absolute;
|
791 |
-
z-index:
|
792 |
right: 6px;
|
793 |
top: 16px;
|
794 |
}
|
@@ -953,6 +961,18 @@ button.wplc_retry_chat {
|
|
953 |
box-shadow: 0 5px 10px rgba(0,0,0,.19)!important;
|
954 |
}
|
955 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
956 |
.wplc_thumb32 {
|
957 |
border-radius:32px;
|
958 |
float: left;
|
@@ -962,7 +982,6 @@ button.wplc_retry_chat {
|
|
962 |
}
|
963 |
|
964 |
|
965 |
-
|
966 |
#wplc_chatbox span.timedate {
|
967 |
clear: both;
|
968 |
position: relative;
|
@@ -1021,4 +1040,104 @@ button.wplc_retry_chat {
|
|
1021 |
.wplc_agent_infosection {
|
1022 |
display: none;
|
1023 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1024 |
}
|
5 |
line-height: 32px;
|
6 |
color: #60686e;
|
7 |
/* width: 100%; */
|
8 |
+
width: 268px !important;
|
9 |
height: 40px;
|
10 |
/* margin-bottom: 10px; */
|
11 |
border: 0;
|
71 |
top: 35px;
|
72 |
bottom: 113px;
|
73 |
/* height: 100%; */
|
74 |
+
z-index: 99998;
|
75 |
position: absolute;
|
76 |
overflow-y: auto;
|
77 |
padding:10px;
|
97 |
}
|
98 |
#wplc_user_message_div {
|
99 |
min-height: 60px;
|
100 |
+
max-height: 60px;
|
101 |
position: absolute;
|
102 |
bottom: -60px;
|
103 |
width: 100%;
|
455 |
position: absolute;
|
456 |
left: -38px;
|
457 |
border-radius: 15px;
|
458 |
+
max-width: 30px;
|
459 |
+
max-height: 30px;
|
460 |
}
|
461 |
|
462 |
|
469 |
|
470 |
}
|
471 |
.wplc-shrink {
|
472 |
+
/*height: 50px !important;*/
|
473 |
}
|
474 |
|
475 |
.wplc-shrink .wplc_agent_name {
|
520 |
box-shadow: 0 5px 20px -2px rgba(0,0,0,.16) !important;
|
521 |
margin-top:0px;
|
522 |
opacity:0.90;
|
523 |
+
transition: top 0.7s ease;
|
524 |
padding-bottom:18px;
|
525 |
+
|
526 |
}
|
527 |
#wplc_chatbox_header_bg {
|
528 |
border-top-left-radius: 10px;
|
529 |
border-top-right-radius: 10px;
|
530 |
+
z-index: 99999 !important;
|
531 |
+
position: relative;
|
532 |
}
|
533 |
+
|
534 |
.wplc-admin-message:before {
|
535 |
display: block;
|
536 |
width: 0;
|
585 |
position: absolute;
|
586 |
right: -38px;
|
587 |
border-radius: 15px;
|
588 |
+
max-width: 30px;
|
589 |
+
max-height: 30px;
|
590 |
}
|
591 |
|
592 |
|
784 |
}
|
785 |
.nifty_attach_icon {
|
786 |
position: absolute;
|
787 |
+
top: 19px;
|
788 |
right: 65px;
|
789 |
color:#999;
|
790 |
font-size:20px;
|
796 |
}
|
797 |
#nifty_ratings_holder {
|
798 |
position: absolute;
|
799 |
+
z-index: 9999999;
|
800 |
right: 6px;
|
801 |
top: 16px;
|
802 |
}
|
961 |
box-shadow: 0 5px 10px rgba(0,0,0,.19)!important;
|
962 |
}
|
963 |
|
964 |
+
.wplc_thumb16_stacked{
|
965 |
+
border-radius: 16px;
|
966 |
+
height: 32px;
|
967 |
+
float: left;
|
968 |
+
margin-top:35px;
|
969 |
+
margin-left: -15px;
|
970 |
+
}
|
971 |
+
|
972 |
+
.wplc_thumb16_stacked:first-child{
|
973 |
+
margin-left:35px;
|
974 |
+
}
|
975 |
+
|
976 |
.wplc_thumb32 {
|
977 |
border-radius:32px;
|
978 |
float: left;
|
982 |
}
|
983 |
|
984 |
|
|
|
985 |
#wplc_chatbox span.timedate {
|
986 |
clear: both;
|
987 |
position: relative;
|
1040 |
.wplc_agent_infosection {
|
1041 |
display: none;
|
1042 |
}
|
1043 |
+
}
|
1044 |
+
|
1045 |
+
.wdt-emoji-popup.open{
|
1046 |
+
z-index: 99999;
|
1047 |
+
}
|
1048 |
+
|
1049 |
+
.wdt-emoji-picker {
|
1050 |
+
right: 10px;
|
1051 |
+
bottom: 25px !important;
|
1052 |
+
font-size: 17px;
|
1053 |
+
text-align: center;
|
1054 |
+
line-height: 50px;
|
1055 |
+
}
|
1056 |
+
|
1057 |
+
.wdt-credit{
|
1058 |
+
z-index: 999999;
|
1059 |
+
position: absolute;
|
1060 |
+
right: 5px;
|
1061 |
+
bottom: 5px;
|
1062 |
+
font-size: 9px;
|
1063 |
+
color: #cecece;
|
1064 |
+
}
|
1065 |
+
|
1066 |
+
#chat_drag_zone {
|
1067 |
+
background: rgba(51, 51, 51, 0.35);
|
1068 |
+
position: absolute;
|
1069 |
+
top: 0;
|
1070 |
+
left: 0;
|
1071 |
+
right: 0;
|
1072 |
+
bottom: 0;
|
1073 |
+
z-index: 9999999;
|
1074 |
+
border-top-left-radius: 11px;
|
1075 |
+
border-top-right-radius: 11px;
|
1076 |
+
}
|
1077 |
+
|
1078 |
+
#chat_drag_zone_inner {
|
1079 |
+
position: absolute;
|
1080 |
+
top: 10%;
|
1081 |
+
left: 5%;
|
1082 |
+
right: 5%;
|
1083 |
+
bottom: 10%;
|
1084 |
+
border: 3px dashed #ffffff;
|
1085 |
+
}
|
1086 |
+
|
1087 |
+
#chat_drag_zone_inner span {
|
1088 |
+
color: #fff;
|
1089 |
+
position: absolute;
|
1090 |
+
width: 100%;
|
1091 |
+
height: 50px;
|
1092 |
+
text-align: center;
|
1093 |
+
font-size: 30px;
|
1094 |
+
margin-top: auto;
|
1095 |
+
margin-bottom: auto;
|
1096 |
+
top: 50%;
|
1097 |
+
transform: translate(0, -50%);
|
1098 |
+
}
|
1099 |
+
|
1100 |
+
|
1101 |
+
.wplc_agent_involved {
|
1102 |
+
transition: all 0.4s ease;
|
1103 |
+
}
|
1104 |
+
|
1105 |
+
.wplc-shrink .wplc_agent_involved {
|
1106 |
+
transition: none !important;
|
1107 |
+
}
|
1108 |
+
|
1109 |
+
.wplc_agent_info .wplc_agent_name{
|
1110 |
+
transition: all 0.4s ease;
|
1111 |
+
}
|
1112 |
+
|
1113 |
+
.wplc-shrink .wplc_agent_name{
|
1114 |
+
transition: none !important;
|
1115 |
+
}
|
1116 |
+
|
1117 |
+
|
1118 |
+
span.bleeper_pullup {
|
1119 |
+
position: absolute;
|
1120 |
+
/* top: 11px; */
|
1121 |
+
bottom: 5px;
|
1122 |
+
color: rgba(255, 255, 255, 0.68);
|
1123 |
+
right: 15px;
|
1124 |
+
font-size: 2em;
|
1125 |
+
cursor: pointer;
|
1126 |
+
}
|
1127 |
+
a.bleeper_restart_chat {
|
1128 |
+
text-align: center;
|
1129 |
+
margin-top: 15px;
|
1130 |
+
display: block;
|
1131 |
+
}
|
1132 |
+
div#bleeper_chat_ended {
|
1133 |
+
min-height: 60px;
|
1134 |
+
max-height: 60px;
|
1135 |
+
position: absolute;
|
1136 |
+
bottom: -60px;
|
1137 |
+
width: 100%;
|
1138 |
+
z-index: 99999999999999999;
|
1139 |
+
background-color: #fff;
|
1140 |
+
border-bottom-right-radius: 10px;
|
1141 |
+
border-bottom-left-radius: 10px;
|
1142 |
+
box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
|
1143 |
}
|
css/themes/position-bottom-left.css
CHANGED
File without changes
|
css/themes/position-bottom-right.css
CHANGED
File without changes
|
css/themes/position-left.css
CHANGED
File without changes
|
css/themes/position-right.css
CHANGED
File without changes
|
css/themes/theme-1.css
CHANGED
File without changes
|
css/themes/theme-2.css
CHANGED
File without changes
|
css/themes/theme-3.css
CHANGED
File without changes
|
css/themes/theme-4.css
CHANGED
File without changes
|
css/themes/theme-5.css
CHANGED
File without changes
|
css/themes/theme-default.css
CHANGED
File without changes
|
css/toastr.css
CHANGED
File without changes
|
css/wplc-survey-style-before.css
CHANGED
File without changes
|
css/wplc-survey-style.css
CHANGED
@@ -1,6 +1,3 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
#nimblesquirrel_div { width: auto !important; }
|
5 |
html #nimblesquirrel_main { border-bottom: initial;}
|
6 |
|
@@ -9,11 +6,9 @@ html #nimblesquirrel_main { border-bottom: initial;}
|
|
9 |
border: 0 !important;
|
10 |
}
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
|
18 |
.nps_score { width: 18px !important; }
|
19 |
|
|
|
|
|
|
|
1 |
#nimblesquirrel_div { width: auto !important; }
|
2 |
html #nimblesquirrel_main { border-bottom: initial;}
|
3 |
|
6 |
border: 0 !important;
|
7 |
}
|
8 |
|
9 |
+
#nimblesquirrel_div {
|
10 |
+
width: 100% !important;
|
11 |
+
}
|
|
|
|
|
12 |
|
13 |
.nps_score { width: 18px !important; }
|
14 |
|
css/wplc_gutenberg_template_styles.css
ADDED
@@ -0,0 +1,217 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* WPLC Gutenber Template Styles */
|
2 |
+
/* Custom Templates: Default - Light */
|
3 |
+
.wplc_block.light {
|
4 |
+
background: #ECEFF1;
|
5 |
+
color: #555;
|
6 |
+
border: 1px solid #ccc;
|
7 |
+
}
|
8 |
+
|
9 |
+
/* Custom Templates: Circle */
|
10 |
+
.wplc_block.circle {
|
11 |
+
background: transparent;
|
12 |
+
width: 50px;
|
13 |
+
height: 50px;
|
14 |
+
padding: 0;
|
15 |
+
position: relative;
|
16 |
+
}
|
17 |
+
|
18 |
+
.wplc_block.circle:after {
|
19 |
+
display: none;
|
20 |
+
}
|
21 |
+
|
22 |
+
.wplc_block.circle .wplc_block_logo {
|
23 |
+
position: relative;
|
24 |
+
width: 50px;
|
25 |
+
height: 50px;
|
26 |
+
padding: 0;
|
27 |
+
border-radius: 50%;
|
28 |
+
}
|
29 |
+
|
30 |
+
.wplc_block.sm.circle {
|
31 |
+
background: transparent;
|
32 |
+
width: 35px;
|
33 |
+
height: 35px;
|
34 |
+
padding: 0;
|
35 |
+
}
|
36 |
+
|
37 |
+
.wplc_block.sm.circle:after {
|
38 |
+
display: none;
|
39 |
+
}
|
40 |
+
|
41 |
+
.wplc_block.sm.circle .wplc_block_logo {
|
42 |
+
position: relative;
|
43 |
+
width: 35px;
|
44 |
+
height: 35px;
|
45 |
+
padding: 0;
|
46 |
+
border-radius: 50%;
|
47 |
+
}
|
48 |
+
|
49 |
+
.wplc_block.lg.circle {
|
50 |
+
background: transparent;
|
51 |
+
width: 65px;
|
52 |
+
height: 65px;
|
53 |
+
padding: 0;
|
54 |
+
}
|
55 |
+
|
56 |
+
.wplc_block.lg.circle:after {
|
57 |
+
display: none;
|
58 |
+
}
|
59 |
+
|
60 |
+
.wplc_block.lg.circle .wplc_block_logo {
|
61 |
+
position: relative;
|
62 |
+
width: 65px;
|
63 |
+
height: 65px;
|
64 |
+
padding: 0;
|
65 |
+
border-radius: 50%;
|
66 |
+
}
|
67 |
+
|
68 |
+
/* Custom Templates: Tooltip */
|
69 |
+
.wplc_block:hover .wplc_block_tooltip {
|
70 |
+
top: -62px;
|
71 |
+
background: #333;
|
72 |
+
color: #fff;
|
73 |
+
opacity: .85;
|
74 |
+
display: inline-block;
|
75 |
+
}
|
76 |
+
|
77 |
+
.wplc_block_tooltip {
|
78 |
+
min-width: 100px;
|
79 |
+
border-radius: 3px;
|
80 |
+
color: transparent;
|
81 |
+
position: absolute;
|
82 |
+
line-height: 25px;
|
83 |
+
padding: 10px;
|
84 |
+
top: -50px;
|
85 |
+
left: 0;
|
86 |
+
opacity: 0;
|
87 |
+
transition: opacity .2s ease-in-out, top .2s ease-in-out;
|
88 |
+
}
|
89 |
+
|
90 |
+
.wplc_block.circle:hover .wplc_block_tooltip {
|
91 |
+
top: -75px;
|
92 |
+
display: block;
|
93 |
+
}
|
94 |
+
.wplc_block.circle.sm:hover .wplc_block_tooltip {
|
95 |
+
top: -50px;
|
96 |
+
}
|
97 |
+
|
98 |
+
.wplc_block.circle.lg:hover .wplc_block_tooltip {
|
99 |
+
top: -100px;
|
100 |
+
}
|
101 |
+
|
102 |
+
/* Custom Templates: Chat Bubble */
|
103 |
+
.wplc_block.chat_bubble:before {
|
104 |
+
content: '';
|
105 |
+
position: absolute;
|
106 |
+
width: 0;
|
107 |
+
height: 0;
|
108 |
+
left: 0px;
|
109 |
+
bottom: -10px;
|
110 |
+
border: 8px solid;
|
111 |
+
border-color: #32373c transparent transparent #32373c;
|
112 |
+
}
|
113 |
+
|
114 |
+
.wplc_block.chat_bubble:hover:after {
|
115 |
+
content: '';
|
116 |
+
position: absolute;
|
117 |
+
width: 0;
|
118 |
+
height: 0;
|
119 |
+
}
|
120 |
+
|
121 |
+
.wplc_block.chat_bubble {
|
122 |
+
padding-left: 10px;
|
123 |
+
padding-right: 40px;
|
124 |
+
border-radius: 7px 7px 7px 0;
|
125 |
+
}
|
126 |
+
|
127 |
+
.wplc_block.chat_bubble .wplc_block_logo {
|
128 |
+
border:none;
|
129 |
+
right: 0px;
|
130 |
+
left: initial;
|
131 |
+
border-radius: 0 7px 7px 0;
|
132 |
+
}
|
133 |
+
|
134 |
+
.wplc_block.chat_bubble.sm {
|
135 |
+
padding-left: 10px;
|
136 |
+
padding-right: 25px;
|
137 |
+
}
|
138 |
+
|
139 |
+
.wplc_block.chat_bubble.lg {
|
140 |
+
padding-left: 20px;
|
141 |
+
padding-right: 80px;
|
142 |
+
}
|
143 |
+
|
144 |
+
/* Custom Templates: Rotating circle */
|
145 |
+
.wplc_block.rotate {
|
146 |
+
transform:rotate(0deg);
|
147 |
+
}
|
148 |
+
|
149 |
+
.wplc_block.rotate:hover {
|
150 |
+
transition: all .3s ease-in-out;
|
151 |
+
transform:rotate(-90deg);
|
152 |
+
}
|
153 |
+
|
154 |
+
.wplc_block.rotate .wplc_block_icon {
|
155 |
+
position: relative;
|
156 |
+
height: 100%;
|
157 |
+
width: 100%;
|
158 |
+
text-align: center;
|
159 |
+
font-size: 30px;
|
160 |
+
transform: rotate(90deg);
|
161 |
+
line-height: 150%;
|
162 |
+
}
|
163 |
+
|
164 |
+
.wplc_block.rotate .wplc_block_logo {
|
165 |
+
z-index: 10;
|
166 |
+
position: absolute;
|
167 |
+
}
|
168 |
+
.wplc_block.rotate {
|
169 |
+
border-radius: 50%;
|
170 |
+
background: #32373c;
|
171 |
+
}
|
172 |
+
|
173 |
+
.wplc_block.rotate .wplc_block_logo:hover {
|
174 |
+
opacity: 0;
|
175 |
+
}
|
176 |
+
|
177 |
+
.wplc_block.circle.rotate.lg .wplc_block_logo {
|
178 |
+
padding: 0;
|
179 |
+
margin: 0;
|
180 |
+
position:absolute;
|
181 |
+
}
|
182 |
+
|
183 |
+
.wplc_block.circle.rotate.lg {
|
184 |
+
background: #32373c;
|
185 |
+
}
|
186 |
+
|
187 |
+
.wplc_block.rotate.lg .wplc_block_icon {
|
188 |
+
position: relative;
|
189 |
+
height: 100%;
|
190 |
+
width: 100%;
|
191 |
+
text-align: center;
|
192 |
+
font-size: 30px;
|
193 |
+
transform: rotate(90deg);
|
194 |
+
line-height: 225%;
|
195 |
+
padding-right: 10px;
|
196 |
+
}
|
197 |
+
|
198 |
+
.wplc_block.circle.rotate.sm .wplc_block_logo {
|
199 |
+
padding: 0;
|
200 |
+
margin: 0;
|
201 |
+
position:absolute;
|
202 |
+
}
|
203 |
+
|
204 |
+
.wplc_block.circle.rotate.sm {
|
205 |
+
background: #32373c;
|
206 |
+
}
|
207 |
+
|
208 |
+
.wplc_block.rotate.sm .wplc_block_icon {
|
209 |
+
position: relative;
|
210 |
+
height: 100%;
|
211 |
+
width: 100%;
|
212 |
+
text-align: center;
|
213 |
+
font-size: 20px;
|
214 |
+
transform: rotate(90deg);
|
215 |
+
line-height: 100%;
|
216 |
+
right:5px;
|
217 |
+
}
|
css/wplcstyle.css
CHANGED
@@ -26,3 +26,84 @@
|
|
26 |
color: #fff;
|
27 |
line-height: 30px;
|
28 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
color: #fff;
|
27 |
line-height: 30px;
|
28 |
}
|
29 |
+
|
30 |
+
.bleeper-edit-message {
|
31 |
+
display:none;
|
32 |
+
cursor: pointer;
|
33 |
+
margin-left:10px;
|
34 |
+
font-style: italic;
|
35 |
+
text-decoration: underline;
|
36 |
+
|
37 |
+
}
|
38 |
+
|
39 |
+
|
40 |
+
#wp-live-chat .wpcf_wrapper {
|
41 |
+
display: block;
|
42 |
+
position: initial;
|
43 |
+
padding: 20px;
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Mobile Responsiveness (Jarek)
|
48 |
+
*/
|
49 |
+
@media (max-width: 767px) {
|
50 |
+
#wp-live-chat-2 {
|
51 |
+
min-height: 420px;
|
52 |
+
top: 2px;
|
53 |
+
}
|
54 |
+
|
55 |
+
#wp-live-chat.classic {
|
56 |
+
right: 30px !important;
|
57 |
+
}
|
58 |
+
|
59 |
+
#wp-live-chat.classic.wplc_right {
|
60 |
+
right: 0 !important;
|
61 |
+
}
|
62 |
+
|
63 |
+
#wp-live-chat.classic.wplc_left {
|
64 |
+
right: auto !important;
|
65 |
+
}
|
66 |
+
|
67 |
+
#wp-live-chat.classic.is-active {
|
68 |
+
top: 2px;
|
69 |
+
}
|
70 |
+
|
71 |
+
#wp-live-chat.mobile-active #wp-live-chat-2 {
|
72 |
+
min-height: auto;
|
73 |
+
top: auto;
|
74 |
+
}
|
75 |
+
|
76 |
+
#wp-live-chat-inner {
|
77 |
+
overflow-y: scroll;
|
78 |
+
}
|
79 |
+
|
80 |
+
#wp-live-chat-4 {
|
81 |
+
top: 2px !important;
|
82 |
+
bottom: 150px !important;
|
83 |
+
}
|
84 |
+
|
85 |
+
.wplc_left #wp-live-chat-4 {
|
86 |
+
bottom: 80px !important;
|
87 |
+
}
|
88 |
+
|
89 |
+
#wp-live-chat-4.is-full-height {
|
90 |
+
bottom: 70px !important;
|
91 |
+
}
|
92 |
+
|
93 |
+
#wp-live-chat.is-full-height.classic {
|
94 |
+
top: -40px;
|
95 |
+
}
|
96 |
+
|
97 |
+
.wplc_left #wp-live-chat-4 {
|
98 |
+
width: 225px;
|
99 |
+
}
|
100 |
+
|
101 |
+
.modern[original_pos="bottom_left"] #wp-live-chat-4 {
|
102 |
+
width: 310px;
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
+
/* Gutenberg styles */
|
107 |
+
#wplc-chat-box.disabled {
|
108 |
+
display: none;
|
109 |
+
}
|
css/wplcstyle_old.css
CHANGED
File without changes
|
ding.mp3
CHANGED
File without changes
|
fonts/fontawesome-webfont.woff2
CHANGED
File without changes
|
functions.php
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
<?php
|
2 |
-
$wplc_basic_plugin_url =
|
3 |
|
4 |
function wplc_log_user_on_page($name,$email,$session, $is_mobile = false) {
|
5 |
global $wpdb;
|
6 |
global $wplc_tblname_chats;
|
7 |
-
|
8 |
$wplc_settings = get_option('WPLC_SETTINGS');
|
9 |
-
|
10 |
|
11 |
|
12 |
if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
|
@@ -29,12 +29,12 @@ function wplc_log_user_on_page($name,$email,$session, $is_mobile = false) {
|
|
29 |
}
|
30 |
|
31 |
|
32 |
-
/* user types
|
33 |
* 1 = new
|
34 |
* 2 = returning
|
35 |
* 3 = timed out
|
36 |
*/
|
37 |
-
|
38 |
$other = array(
|
39 |
"user_type" => 1
|
40 |
);
|
@@ -46,15 +46,15 @@ function wplc_log_user_on_page($name,$email,$session, $is_mobile = false) {
|
|
46 |
}
|
47 |
|
48 |
$other = apply_filters("wplc_log_user_on_page_insert_other_data_filter", $other);
|
49 |
-
|
50 |
-
$wplc_chat_session_data = array(
|
51 |
-
'status' => '5',
|
52 |
'timestamp' => current_time('mysql'),
|
53 |
'name' => $name,
|
54 |
'email' => $email,
|
55 |
'session' => $session,
|
56 |
'ip' => maybe_serialize($user_data),
|
57 |
-
'url' => sanitize_text_field($_SERVER['HTTP_REFERER']),
|
58 |
'last_active_timestamp' => current_time('mysql'),
|
59 |
'other' => maybe_serialize($other),
|
60 |
);
|
@@ -62,8 +62,8 @@ function wplc_log_user_on_page($name,$email,$session, $is_mobile = false) {
|
|
62 |
$wplc_chat_session_data = apply_filters("wplc_log_user_on_page_insert_filter", $wplc_chat_session_data);
|
63 |
|
64 |
/* Omitted from inser call as this defaults to string
|
65 |
-
$wplc_chat_session_types = array(
|
66 |
-
'%s',
|
67 |
'%s',
|
68 |
'%s',
|
69 |
'%s',
|
@@ -78,6 +78,9 @@ function wplc_log_user_on_page($name,$email,$session, $is_mobile = false) {
|
|
78 |
$wpdb->insert($wplc_tblname_chats, $wplc_chat_session_data);
|
79 |
$lastid = $wpdb->insert_id;
|
80 |
|
|
|
|
|
|
|
81 |
return $lastid;
|
82 |
|
83 |
}
|
@@ -85,9 +88,9 @@ function wplc_update_user_on_page($cid, $status = 5,$session) {
|
|
85 |
global $wpdb;
|
86 |
global $wplc_tblname_chats;
|
87 |
$wplc_settings = get_option('WPLC_SETTINGS');
|
88 |
-
|
89 |
if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
|
90 |
-
|
91 |
if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {
|
92 |
$ip_address = sanitize_text_field($_SERVER['HTTP_X_FORWARDED_FOR']);
|
93 |
} else {
|
@@ -104,26 +107,26 @@ function wplc_update_user_on_page($cid, $status = 5,$session) {
|
|
104 |
);
|
105 |
}
|
106 |
|
107 |
-
|
108 |
|
109 |
-
|
110 |
-
|
111 |
-
|
|
|
112 |
'url' => sanitize_text_field($_SERVER['HTTP_REFERER']),
|
113 |
'last_active_timestamp' => current_time('mysql'),
|
114 |
'ip' => maybe_serialize($user_data),
|
115 |
'status' => $status,
|
116 |
'session' => $session,
|
117 |
-
),
|
118 |
-
array('id' => $cid),
|
119 |
-
array(
|
120 |
'%s',
|
121 |
'%s',
|
122 |
'%s',
|
123 |
'%d',
|
124 |
'%s'
|
125 |
-
),
|
126 |
-
array('%d')
|
127 |
);
|
128 |
|
129 |
|
@@ -133,9 +136,64 @@ function wplc_update_user_on_page($cid, $status = 5,$session) {
|
|
133 |
}
|
134 |
|
135 |
|
136 |
-
function wplc_record_chat_msg($from
|
137 |
global $wpdb;
|
138 |
global $wplc_tblname_msgs;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
|
140 |
if ($from == "2" && $rest_check == false) {
|
141 |
$wplc_current_user = get_current_user_id();
|
@@ -144,7 +202,7 @@ function wplc_record_chat_msg($from,$cid,$msg,$rest_check = false) {
|
|
144 |
/*
|
145 |
-- modified in in 6.0.04 --
|
146 |
|
147 |
-
if(current_user_can('wplc_ma_agent') || current_user_can('manage_options')){
|
148 |
*/ } else { return "security issue"; }
|
149 |
}
|
150 |
|
@@ -156,45 +214,70 @@ function wplc_record_chat_msg($from,$cid,$msg,$rest_check = false) {
|
|
156 |
}
|
157 |
else {
|
158 |
$fromname = apply_filters("wplc_filter_admin_name","Admin");
|
|
|
159 |
//$fromemail = "SET email";
|
160 |
$orig = '1';
|
161 |
}
|
162 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
$orig_msg = $msg;
|
164 |
|
165 |
$msg = apply_filters("wplc_filter_message_control",$msg);
|
166 |
|
167 |
-
|
168 |
-
|
169 |
-
$
|
|
|
|
|
|
|
|
|
|
|
170 |
} else {
|
171 |
-
$
|
|
|
|
|
|
|
|
|
172 |
}
|
173 |
-
|
174 |
|
175 |
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
|
|
|
|
|
|
180 |
'timestamp' => current_time('mysql'),
|
181 |
'msgfrom' => $fromname,
|
182 |
'msg' => $msg,
|
183 |
'status' => 0,
|
184 |
'originates' => $orig,
|
185 |
-
'other' => maybe_serialize( $other_data )
|
186 |
-
|
187 |
-
|
188 |
-
|
|
|
189 |
'%s',
|
190 |
'%s',
|
191 |
'%s',
|
192 |
'%d',
|
193 |
'%s',
|
|
|
194 |
'%s'
|
195 |
-
|
196 |
);
|
197 |
-
|
198 |
$data = array(
|
199 |
'cid' => $cid,
|
200 |
'from' => $from,
|
@@ -204,8 +287,8 @@ function wplc_record_chat_msg($from,$cid,$msg,$rest_check = false) {
|
|
204 |
do_action("wplc_hook_message_sent",$data);
|
205 |
|
206 |
wplc_update_active_timestamp(sanitize_text_field($cid));
|
207 |
-
|
208 |
-
|
209 |
return true;
|
210 |
|
211 |
}
|
@@ -221,16 +304,16 @@ function wplc_update_active_timestamp($cid) {
|
|
221 |
// LIMIT 1
|
222 |
// "
|
223 |
// );
|
224 |
-
$wpdb->update(
|
225 |
-
$wplc_tblname_chats,
|
226 |
-
array(
|
227 |
'last_active_timestamp' => current_time('mysql')
|
228 |
-
),
|
229 |
-
array('id' => $cid),
|
230 |
-
array('%s'),
|
231 |
-
array('%d')
|
232 |
);
|
233 |
-
|
234 |
//wplc_change_chat_status(sanitize_text_field($cid),3);
|
235 |
return true;
|
236 |
|
@@ -252,6 +335,34 @@ function wplc_return_chat_name($cid) {
|
|
252 |
}
|
253 |
|
254 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
function wplc_return_chat_email($cid) {
|
256 |
global $wpdb;
|
257 |
global $wplc_tblname_chats;
|
@@ -272,42 +383,42 @@ function wplc_list_chats() {
|
|
272 |
global $wpdb;
|
273 |
global $wplc_tblname_chats;
|
274 |
$status = 3;
|
275 |
-
$wplc_c = 0;
|
276 |
$results = $wpdb->get_results(
|
277 |
"
|
278 |
-
|
279 |
-
|
280 |
WHERE `status` = 3 OR `status` = 2 OR `status` = 10
|
281 |
ORDER BY `timestamp` ASC
|
282 |
|
283 |
-
|
284 |
);
|
285 |
-
|
286 |
-
$table = "<div class='wplc_chats_container'>";
|
287 |
-
|
288 |
if (!$results) {
|
289 |
$table.= "<p>".__("No chat sessions available at the moment","wplivechat")."</p>";
|
290 |
} else {
|
291 |
$table .= "<h2>".__('Active Chats', 'wplivechat')."</h2>";
|
292 |
-
|
293 |
foreach ($results as $result) {
|
294 |
unset($trstyle);
|
295 |
unset($actions);
|
296 |
$wplc_c++;
|
297 |
|
298 |
-
|
299 |
global $wplc_basic_plugin_url;
|
300 |
$user_data = maybe_unserialize($result->ip);
|
301 |
$user_ip = $user_data['ip'];
|
302 |
$browser = wplc_return_browser_string($user_data['user_agent']);
|
303 |
$browser_image = wplc_return_browser_image($browser,"16");
|
304 |
-
|
305 |
if($user_ip == ""){
|
306 |
$user_ip = __('IP Address not recorded', 'wplivechat');
|
307 |
} else {
|
308 |
$user_ip = "<a href='http://www.ip-adress.com/ip_tracer/" . $user_ip . "' title='".__('Whois for' ,'wplivechat')." ".$user_ip."' target='_BLANK'>".$user_ip."</a>";
|
309 |
-
}
|
310 |
-
|
311 |
if ($result->status == 2) {
|
312 |
$url = admin_url( 'admin.php?page=wplivechat-menu&action=ac&cid='.$result->id);
|
313 |
$actions = "<a href=\"".$url."\" class=\"wplc_open_chat button button-primary\" window-title=\"WP_Live_Chat_".$result->id."\">".__("Accept Chat","wplivechat")."</a>";
|
@@ -318,14 +429,14 @@ function wplc_list_chats() {
|
|
318 |
$url = admin_url( 'admin.php?page=wplivechat-menu&action=ac&cid='.$result->id);
|
319 |
$actions = "<a href=\"".$url."\" class=\"wplc_open_chat button button-primary\" window-title=\"WP_Live_Chat_".$result->id."\">".__("Open Chat Window","wplivechat")."</a>";
|
320 |
$trstyle = "style='background-color:#F7FCFE; height:30px;'";
|
321 |
-
$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>";
|
322 |
}
|
323 |
-
|
324 |
-
|
325 |
/* if ($wplc_c>1) { $actions = wplc_get_msg(); } */
|
326 |
-
|
327 |
$trstyle = "";
|
328 |
-
|
329 |
$table .= "
|
330 |
<div class='wplc_single_chat' id='record_".$result->id."' $trstyle>
|
331 |
<div class='wplc_chat_section section_1'>
|
@@ -434,7 +545,7 @@ function wplc_time_ago($time_ago)
|
|
434 |
}
|
435 |
}
|
436 |
|
437 |
-
add_filter("wplc_filter_list_chats_actions","wplc_filter_control_list_chats_actions",15,3);
|
438 |
/**
|
439 |
* Only allow agents access
|
440 |
* @return void
|
@@ -444,7 +555,7 @@ add_filter("wplc_filter_list_chats_actions","wplc_filter_control_list_chats_acti
|
|
444 |
*/
|
445 |
function wplc_filter_control_list_chats_actions($actions,$result,$post_data) {
|
446 |
$aid = apply_filters("wplc_filter_aid_in_action","");
|
447 |
-
|
448 |
$wplc_current_user = get_current_user_id();
|
449 |
|
450 |
if( get_user_meta( $wplc_current_user, 'wplc_ma_agent', true ) ){
|
@@ -457,11 +568,11 @@ function wplc_filter_control_list_chats_actions($actions,$result,$post_data) {
|
|
457 |
else if (intval($result->status) == 3 || intval($result->status) == 10) {
|
458 |
$url_params = "&action=ac&cid=".$result->id.$aid;
|
459 |
$url = admin_url( 'admin.php?page=wplivechat-menu'.$url_params);
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
}
|
466 |
else if (intval($result->status) == 2) {
|
467 |
$url_params = "&action=ac&cid=".$result->id.$aid;
|
@@ -483,68 +594,68 @@ function wplc_list_chats_new($post_data) {
|
|
483 |
|
484 |
global $wpdb;
|
485 |
global $wplc_tblname_chats;
|
486 |
-
|
487 |
-
|
488 |
$id_list = array();
|
489 |
-
|
490 |
$status = 3;
|
491 |
-
$wplc_c = 0;
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
$wplc_chat_sql = "SELECT * FROM $wplc_tblname_chats WHERE (`status` = 3 OR `status` = 2 OR `status` = 10 OR `status` = 5 or `status` = 8 or `status` = 9 or `status` = 12)";
|
504 |
$wplc_chat_sql .= apply_filters("wplc_alter_chat_list_sql_before_sorting", "");
|
505 |
-
|
506 |
$wplc_chat_sql .= " ORDER BY `timestamp` ASC";
|
507 |
|
508 |
$results = $wpdb->get_results($wplc_chat_sql);
|
509 |
|
510 |
-
|
511 |
if($results) {
|
512 |
-
|
513 |
-
|
514 |
foreach ($results as $result) {
|
515 |
unset($trstyle);
|
516 |
unset($actions);
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
|
521 |
global $wplc_basic_plugin_url;
|
522 |
$user_data = maybe_unserialize($result->ip);
|
523 |
$user_ip = $user_data['ip'];
|
524 |
$browser = wplc_return_browser_string($user_data['user_agent']);
|
525 |
$browser_image = wplc_return_browser_image($browser,"16");
|
526 |
-
|
527 |
if($user_ip == ""){
|
528 |
$user_ip = __('IP Address not recorded', 'wplivechat');
|
529 |
} else {
|
530 |
$user_ip = "<a href='http://www.ip-adress.com/ip_tracer/" . $user_ip . "' title='".__('Whois for' ,'wplivechat')." ".$user_ip."' target='_BLANK'>".$user_ip."</a>";
|
531 |
-
}
|
532 |
|
533 |
|
534 |
$actions = apply_filters("wplc_filter_list_chats_actions","",$result,$post_data);
|
535 |
-
|
536 |
-
|
537 |
$other_data = maybe_unserialize($result->other);
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
$trstyle = "";
|
542 |
-
|
543 |
$id_list[intval($result->id)] = true;
|
544 |
-
|
545 |
$data_array[$result->id]['name'] = $result->name;
|
546 |
$data_array[$result->id]['email'] = $result->email;
|
547 |
-
|
548 |
$data_array[$result->id]['status'] = $result->status;
|
549 |
$data_array[$result->id]['action'] = $actions;
|
550 |
$data_array[$result->id]['timestamp'] = wplc_time_ago($result->timestamp);
|
@@ -554,25 +665,25 @@ function wplc_list_chats_new($post_data) {
|
|
554 |
} else {
|
555 |
$data_array[$result->id]['type'] = __("Returning","wplivechat");
|
556 |
}
|
557 |
-
|
558 |
$data_array[$result->id]['image'] = "<img src=\"//www.gravatar.com/avatar/".md5($result->email)."?s=30&d=mm\" class='wplc-user-message-avatar' />";
|
559 |
$data_array[$result->id]['data']['browsing'] = $result->url;
|
560 |
$path = parse_url($result->url, PHP_URL_PATH);
|
561 |
-
|
562 |
if (strlen($path) > 20) {
|
563 |
$data_array[$result->id]['data']['browsing_nice_url'] = substr($path,0,20).'...';
|
564 |
-
} else {
|
565 |
$data_array[$result->id]['data']['browsing_nice_url'] = $path;
|
566 |
}
|
567 |
-
|
568 |
$data_array[$result->id]['data']['browser'] = "<img src='" . $wplc_basic_plugin_url . "/images/$browser_image' alt='$browser' title='$browser' /> ";
|
569 |
$data_array[$result->id]['data']['ip'] = $user_ip;
|
570 |
$data_array[$result->id]['other'] = $other_data;
|
571 |
}
|
572 |
-
|
573 |
$data_array['ids'] = $id_list;
|
574 |
}
|
575 |
-
|
576 |
return json_encode($data_array);
|
577 |
}
|
578 |
|
@@ -581,13 +692,13 @@ function wplc_list_chats_new($post_data) {
|
|
581 |
function wplc_return_user_chat_messages($cid,$wplc_settings = false,$cdata = false) {
|
582 |
global $wpdb;
|
583 |
global $wplc_tblname_msgs;
|
584 |
-
|
585 |
-
if (!$wplc_settings) {
|
586 |
$wplc_settings = get_option("WPLC_SETTINGS");
|
587 |
}
|
588 |
|
589 |
if(isset($wplc_settings['wplc_display_name']) && $wplc_settings['wplc_display_name'] == 1){ $display_name = 1; } else { $display_name = 0; }
|
590 |
-
|
591 |
$sql = "SELECT * FROM $wplc_tblname_msgs WHERE `chat_sess_id` = '$cid' AND `status` = '0' AND (`originates` = '1' OR `originates` = '0') ORDER BY `timestamp` ASC";
|
592 |
$results = $wpdb->get_results($sql);
|
593 |
if (!$cdata) {
|
@@ -625,23 +736,23 @@ function wplc_return_user_chat_messages($cid,$wplc_settings = false,$cdata = fal
|
|
625 |
} else {
|
626 |
$other = maybe_unserialize($cdata->other);
|
627 |
if (isset($other['aid'])) {
|
628 |
-
|
629 |
|
630 |
$user_info = get_userdata(intval($other['aid']));
|
631 |
-
|
632 |
-
$image = "<img src='//www.gravatar.com/avatar/".md5($user_info->user_email)."?s=30' class='wplc-admin-message-avatar' />";
|
633 |
} else {
|
634 |
|
635 |
-
|
636 |
$image = "";
|
637 |
if(1 == 1) {
|
638 |
|
639 |
} else {
|
640 |
-
|
641 |
$image = "";
|
642 |
}
|
643 |
}
|
644 |
-
|
645 |
}
|
646 |
|
647 |
$from = apply_filters("wplc_filter_admin_name",$from, $cid);
|
@@ -649,7 +760,7 @@ function wplc_return_user_chat_messages($cid,$wplc_settings = false,$cdata = fal
|
|
649 |
|
650 |
}
|
651 |
else if (intval($result->originates) == 0) {
|
652 |
-
/*
|
653 |
system notifications
|
654 |
from version 7
|
655 |
*/
|
@@ -658,12 +769,12 @@ function wplc_return_user_chat_messages($cid,$wplc_settings = false,$cdata = fal
|
|
658 |
}
|
659 |
else {
|
660 |
|
661 |
-
/*
|
662 |
removed in 7.1.00
|
663 |
$class = "wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1";
|
664 |
-
|
665 |
if(isset($_COOKIE['wplc_email']) && $_COOKIE['wplc_email'] != ""){ $wplc_user_gravatar = md5(strtolower(trim(sanitize_text_field($_COOKIE['wplc_email'])))); } else { $wplc_user_gravatar = ""; }
|
666 |
-
|
667 |
if($wplc_user_gravatar != ""){
|
668 |
$image = "<img src='//www.gravatar.com/avatar/$wplc_user_gravatar?s=30' class='wplc-user-message-avatar' />";
|
669 |
} else {
|
@@ -671,18 +782,18 @@ function wplc_return_user_chat_messages($cid,$wplc_settings = false,$cdata = fal
|
|
671 |
}
|
672 |
*/
|
673 |
}
|
674 |
-
|
675 |
if (!$system_notification) {
|
676 |
/* this is a normal message */
|
677 |
if(function_exists('wplc_encrypt_decrypt_msg')){
|
678 |
$msg = wplc_encrypt_decrypt_msg($msg);
|
679 |
}
|
680 |
-
|
681 |
$msg_array = maybe_unserialize( $msg );
|
682 |
|
683 |
if( is_array( $msg_array ) ){
|
684 |
$msg = $msg_array['m'];
|
685 |
-
}
|
686 |
|
687 |
$msg = stripslashes($msg);
|
688 |
|
@@ -693,12 +804,12 @@ function wplc_return_user_chat_messages($cid,$wplc_settings = false,$cdata = fal
|
|
693 |
$msg_hist[$id]['msg'] = $msg;
|
694 |
$msg_hist[$id]['originates'] = intval($result->originates);
|
695 |
$msg_hist[$id]['other'] = $other_data;
|
696 |
-
|
697 |
/*
|
698 |
removed this in 7.1.00 as the JS now handles this
|
699 |
if($display_name){
|
700 |
$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>";
|
701 |
-
} else {
|
702 |
$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>";
|
703 |
}*/
|
704 |
} else {
|
@@ -708,10 +819,10 @@ function wplc_return_user_chat_messages($cid,$wplc_settings = false,$cdata = fal
|
|
708 |
$msg_hist[$id]['msg'] = $msg;
|
709 |
$msg_hist[$id]['other'] = $other_data;
|
710 |
$msg_hist[$id]['originates'] = intval($result->originates);
|
711 |
-
}
|
|
|
|
|
712 |
|
713 |
-
|
714 |
-
|
715 |
|
716 |
}
|
717 |
|
@@ -772,52 +883,54 @@ function wplc_change_chat_status($id,$status,$aid = 0) {
|
|
772 |
$wplc_welcome = __('Welcome. How may I help you?', 'wplivechat');
|
773 |
if(isset($wplc_settings['wplc_using_localization_plugin']) && $wplc_settings['wplc_using_localization_plugin'] == 1){ $wplc_using_locale = true; } else { $wplc_using_locale = false; }
|
774 |
if (!isset($wplc_settings['wplc_user_welcome_chat']) || $wplc_settings['wplc_user_welcome_chat'] == "") { $wplc_settings['wplc_user_welcome_chat'] = $wplc_welcome; }
|
775 |
-
$text2 = ($wplc_using_locale ? $wplc_welcome : stripslashes($wplc_settings['wplc_user_welcome_chat']));
|
776 |
|
777 |
$chat_id = sanitize_text_field($id);
|
778 |
$chat_msg = sanitize_text_field($text2);
|
779 |
$wplc_rec_msg = wplc_record_chat_msg("2",$chat_id,$chat_msg);
|
780 |
|
781 |
*/
|
782 |
-
|
783 |
-
|
784 |
}
|
785 |
|
786 |
$other['aid'] = $aid;
|
787 |
}
|
788 |
}
|
789 |
|
790 |
-
|
791 |
|
792 |
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
|
|
797 |
'status' => $status,
|
798 |
-
'other' => maybe_serialize($other)
|
799 |
-
|
800 |
-
|
|
|
801 |
array(
|
802 |
'%d',
|
803 |
-
'%s'
|
804 |
-
|
805 |
-
|
806 |
-
|
|
|
807 |
} else {
|
808 |
-
$wpdb->update(
|
809 |
-
$wplc_tblname_chats,
|
810 |
-
array(
|
811 |
'status' => $status
|
812 |
-
),
|
813 |
-
array('id' => $id),
|
814 |
-
array('%d'),
|
815 |
-
array('%d')
|
816 |
);
|
817 |
}
|
818 |
|
819 |
do_action("wplc_change_chat_status_hook", $id, $status);
|
820 |
-
|
821 |
return true;
|
822 |
|
823 |
}
|
@@ -826,17 +939,17 @@ function wplc_change_chat_status($id,$status,$aid = 0) {
|
|
826 |
function wplc_return_chat_messages($cid, $transcript = false, $html = true, $wplc_settings = false, $cdata = false, $display = 'string', $only_read_message = false) {
|
827 |
global $wpdb;
|
828 |
global $wplc_tblname_msgs;
|
829 |
-
|
830 |
|
831 |
if (!$wplc_settings) {
|
832 |
$wplc_settings = get_option("WPLC_SETTINGS");
|
833 |
}
|
834 |
|
835 |
if(isset($wplc_settings['wplc_display_name']) && $wplc_settings['wplc_display_name'] == 1){ $display_name = 1; } else { $display_name = 0; }
|
836 |
-
|
837 |
$results = wplc_get_chat_messages($cid, $only_read_message, $wplc_settings);
|
838 |
if (!$results) { return; }
|
839 |
-
|
840 |
if (!$cdata) {
|
841 |
$cdata = wplc_get_chat_data($cid,__LINE__);
|
842 |
}
|
@@ -849,7 +962,14 @@ function wplc_return_chat_messages($cid, $transcript = false, $html = true, $wpl
|
|
849 |
$system_notification = false;
|
850 |
|
851 |
$from = $result->msgfrom;
|
852 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
853 |
$msg = $result->msg;
|
854 |
|
855 |
|
@@ -858,63 +978,23 @@ function wplc_return_chat_messages($cid, $transcript = false, $html = true, $wpl
|
|
858 |
|
859 |
$timestamp = strtotime( $result->timestamp );
|
860 |
$other_data['datetime'] = $timestamp;
|
|
|
861 |
$nice_time = date("d M Y H:i:s",$timestamp);
|
862 |
-
|
863 |
|
864 |
-
|
865 |
-
|
866 |
-
$image = "";
|
867 |
-
if($result->originates == 1){
|
868 |
-
/* message from admin to user */
|
869 |
-
|
870 |
-
/* removed in 7.1.00
|
871 |
-
$class = "wplc-admin-message wplc-color-bg-4 wplc-color-2 wplc-color-border-4";
|
872 |
-
if(function_exists("wplc_pro_get_admin_picture")){
|
873 |
-
$src = wplc_pro_get_admin_picture();
|
874 |
-
if($src){
|
875 |
-
$image = "<img src=".$src." width='20px' id='wp-live-chat-2-img'/>";
|
876 |
-
}
|
877 |
-
} else {
|
878 |
-
if (isset($cdata->other)) {
|
879 |
-
$other = maybe_unserialize($cdata->other);
|
880 |
-
if (isset($other['aid'])) {
|
881 |
|
882 |
-
$user_info = get_userdata(intval($other['aid']));
|
883 |
-
|
884 |
-
$image = "<img src='//www.gravatar.com/avatar/".md5($user_info->user_email)."?s=30' class='wplc-admin-message-avatar' />";
|
885 |
-
} else {
|
886 |
-
|
887 |
-
$image = "";
|
888 |
-
}
|
889 |
-
} else {
|
890 |
-
$image = "";
|
891 |
-
}
|
892 |
-
|
893 |
-
}
|
894 |
|
895 |
-
$from = apply_filters("wplc_filter_admin_from", $from, $cid);
|
896 |
-
*/
|
897 |
|
|
|
|
|
898 |
|
899 |
} else if ($result->originates == 2){
|
900 |
-
|
901 |
-
|
902 |
-
/* removed in 7.1.00
|
903 |
-
$class = "wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1";
|
904 |
-
|
905 |
-
if(isset($_COOKIE['wplc_email']) && $_COOKIE['wplc_email'] != ""){ $wplc_user_gravatar = md5(strtolower(trim(sanitize_text_field($_COOKIE['wplc_email'])))); } else { $wplc_user_gravatar = ""; }
|
906 |
-
|
907 |
-
if($wplc_user_gravatar != ""){
|
908 |
-
$image = "<img src='//www.gravatar.com/avatar/$wplc_user_gravatar?s=30' class='wplc-user-message-avatar' />";
|
909 |
-
} else {
|
910 |
-
$image = "";
|
911 |
-
}*/
|
912 |
|
913 |
} else if ($result->originates == 0 || $result->originates == 3) {
|
914 |
|
915 |
$system_notification = true;
|
916 |
$cuid = get_current_user_id();
|
917 |
-
$is_agent = get_user_meta(esc_html( $cuid ), 'wplc_ma_agent', true);
|
918 |
if ($is_agent && $result->originates == 3 ) {
|
919 |
/* this user is an agent and the notification is meant for an agent, therefore display it */
|
920 |
$display_notification = true;
|
@@ -934,60 +1014,39 @@ function wplc_return_chat_messages($cid, $transcript = false, $html = true, $wpl
|
|
934 |
}
|
935 |
|
936 |
if (!$system_notification) {
|
937 |
-
|
938 |
if(function_exists('wplc_encrypt_decrypt_msg')){
|
939 |
$msg = wplc_encrypt_decrypt_msg($msg);
|
940 |
-
}
|
941 |
|
942 |
$msg = apply_filters("wplc_filter_message_control_out",$msg);
|
943 |
-
|
944 |
if( is_serialized( $msg ) ){
|
945 |
-
$msg_array = maybe_unserialize( $msg );
|
946 |
-
|
947 |
if( is_array( $msg_array ) ){
|
948 |
$msg = $msg_array['m'];
|
949 |
} else {
|
950 |
$msg = $msg;
|
951 |
-
}
|
952 |
-
|
953 |
$msg = stripslashes($msg);
|
954 |
-
}
|
955 |
-
|
|
|
|
|
|
|
956 |
$msg_array[$id]['msg'] = $msg;
|
957 |
$msg_hist .= $msg;
|
958 |
$msg_array[$id]['originates'] = $result->originates;
|
959 |
$msg_array[$id]['other'] = $other_data;
|
960 |
|
961 |
-
/*
|
962 |
-
removed in 7.1.00
|
963 |
-
if($display_name){
|
964 |
-
if ($html) {
|
965 |
-
$str = "<span class='chat_time wplc-color-4'>$timeshow</span> <span class='$class'>$image <strong>$from </strong> $msg</span><br /><div class='wplc-clear-float-message'></div>";
|
966 |
-
$msg_array[$id]['msg'] = $msg;
|
967 |
-
$msg_hist .= $msg;
|
968 |
|
969 |
-
} else {
|
970 |
-
$str = "($timeshow) $from: $msg\r\n";
|
971 |
-
$msg_array[$id]['msg'] = $msg;
|
972 |
-
$msg_hist .= $msg;
|
973 |
-
}
|
974 |
-
} else {
|
975 |
-
if ($html) {
|
976 |
-
$str = "<span class='chat_time wplc-color-4'>$timeshow</span> <span class='$class'>$msg</span><br /><div class='wplc-clear-float-message'></div>";
|
977 |
-
$msg_array[$id]['msg'] = $msg;
|
978 |
-
$msg_hist .= $msg;
|
979 |
-
} else {
|
980 |
-
$str = "($timeshow) $msg\r\n";
|
981 |
-
$msg_array[$id]['msg'] = $msg;
|
982 |
-
$msg_hist .= $str;
|
983 |
-
}
|
984 |
-
|
985 |
-
}*/
|
986 |
} else {
|
987 |
/* this is a system notification */
|
988 |
if ($display_notification) {
|
989 |
$str = "<span class='chat_time wplc-color-4'>".$nice_time."</span> <span class='wplc_system_notification wplc-color-4'>".$msg."</span>";
|
990 |
-
|
991 |
if ( !isset( $msg_array[$id] ) ) { $msg_array[$id] = array(); }
|
992 |
$msg_array[$id]['msg'] = $str;
|
993 |
$msg_array[$id]['other'] = $other_data;
|
@@ -998,47 +1057,109 @@ function wplc_return_chat_messages($cid, $transcript = false, $html = true, $wpl
|
|
998 |
}
|
999 |
|
1000 |
}
|
1001 |
-
|
1002 |
if ($display == 'string') { return $msg_hist; } else { return $msg_array; }
|
1003 |
|
1004 |
|
1005 |
}
|
1006 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1007 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1008 |
function wplc_mark_as_read_user_chat_messages($cid) {
|
1009 |
global $wpdb;
|
1010 |
global $wplc_tblname_msgs;
|
1011 |
|
1012 |
-
$results = $wpdb->get_results(
|
1013 |
-
"
|
1014 |
-
SELECT *
|
1015 |
FROM $wplc_tblname_msgs
|
1016 |
WHERE `chat_sess_id` = '$cid' AND `status` = '0' AND (`originates` = 1 OR `originates` = 0)
|
1017 |
-
ORDER BY `timestamp` DESC
|
1018 |
|
1019 |
-
|
1020 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1021 |
|
1022 |
|
1023 |
foreach ($results as $result) {
|
1024 |
$id = $result->id;
|
1025 |
-
|
1026 |
-
$wpdb->update(
|
1027 |
-
$wplc_tblname_msgs,
|
1028 |
-
array(
|
1029 |
'status' => 1
|
1030 |
-
),
|
1031 |
-
array('id' => $id),
|
1032 |
-
array('%d'),
|
1033 |
-
array('%d')
|
1034 |
);
|
1035 |
-
|
1036 |
-
|
1037 |
}
|
1038 |
return "ok";
|
1039 |
|
1040 |
|
1041 |
}
|
|
|
|
|
1042 |
//here
|
1043 |
function wplc_return_admin_chat_messages($cid) {
|
1044 |
$wplc_current_user = get_current_user_id();
|
@@ -1046,22 +1167,22 @@ function wplc_return_admin_chat_messages($cid) {
|
|
1046 |
/*
|
1047 |
-- modified in in 6.0.04 --
|
1048 |
|
1049 |
-
if(current_user_can('wplc_ma_agent') || current_user_can('manage_options')){
|
1050 |
*/
|
1051 |
$wplc_settings = get_option("WPLC_SETTINGS");
|
1052 |
|
1053 |
if(isset($wplc_settings['wplc_display_name']) && $wplc_settings['wplc_display_name'] == 1){ $display_name = 1; } else { $display_name = 0; }
|
1054 |
-
|
1055 |
global $wpdb;
|
1056 |
global $wplc_tblname_msgs;
|
1057 |
-
|
1058 |
/**
|
1059 |
* `Originates` - codes:
|
1060 |
* 0 - System notification to be delivered to users
|
1061 |
* 1 - Message from an agent
|
1062 |
* 2 - Message from a user
|
1063 |
* 3 - System notification to be delivered to agents
|
1064 |
-
*
|
1065 |
*/
|
1066 |
$results = $wpdb->get_results("SELECT * FROM $wplc_tblname_msgs WHERE `chat_sess_id` = '$cid' AND `status` = '0' AND (`originates` = '2' OR `originates` = '3') ORDER BY `timestamp` ASC");
|
1067 |
|
@@ -1084,7 +1205,7 @@ function wplc_return_admin_chat_messages($cid) {
|
|
1084 |
$other_data['datetime'] = $timestamp;
|
1085 |
|
1086 |
if (intval($result->originates) == 3) {
|
1087 |
-
/*
|
1088 |
system notifications
|
1089 |
from version 7
|
1090 |
*/
|
@@ -1095,18 +1216,18 @@ function wplc_return_admin_chat_messages($cid) {
|
|
1095 |
|
1096 |
|
1097 |
}
|
1098 |
-
|
1099 |
if (!$system_notification) {
|
1100 |
/* this is a normal message */
|
1101 |
if(function_exists('wplc_encrypt_decrypt_msg')){
|
1102 |
$msg = wplc_encrypt_decrypt_msg($msg);
|
1103 |
}
|
1104 |
-
|
1105 |
$msg_array = maybe_unserialize( $msg );
|
1106 |
|
1107 |
if( is_array( $msg_array ) ){
|
1108 |
$msg = $msg_array['m'];
|
1109 |
-
}
|
1110 |
|
1111 |
$msg = stripslashes($msg);
|
1112 |
|
@@ -1125,10 +1246,10 @@ function wplc_return_admin_chat_messages($cid) {
|
|
1125 |
$msg_hist[$id]['msg'] = $msg;
|
1126 |
$msg_hist[$id]['other'] = $other_data;
|
1127 |
$msg_hist[$id]['originates'] = intval($result->originates);
|
1128 |
-
}
|
|
|
|
|
1129 |
|
1130 |
-
|
1131 |
-
|
1132 |
|
1133 |
}
|
1134 |
|
@@ -1136,39 +1257,40 @@ function wplc_return_admin_chat_messages($cid) {
|
|
1136 |
}
|
1137 |
|
1138 |
|
1139 |
-
|
1140 |
else {
|
1141 |
return "security issue";
|
1142 |
}
|
1143 |
|
1144 |
|
1145 |
}
|
1146 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1147 |
$wplc_current_user = get_current_user_id();
|
1148 |
|
1149 |
if( get_user_meta( $wplc_current_user, 'wplc_ma_agent', true ) ){
|
1150 |
-
/*
|
1151 |
-
-- modified in in 6.0.04 --
|
1152 |
-
|
1153 |
-
if(current_user_can('wplc_ma_agent') || current_user_can('manage_options')){
|
1154 |
-
*/
|
1155 |
-
|
1156 |
global $wpdb;
|
1157 |
global $wplc_tblname_msgs;
|
1158 |
|
1159 |
-
$wpdb->update(
|
1160 |
-
$wplc_tblname_msgs,
|
1161 |
-
array(
|
1162 |
'status' => 1
|
1163 |
-
),
|
1164 |
-
array('id' => $mid),
|
1165 |
-
array('%d'),
|
1166 |
-
array('%d')
|
1167 |
);
|
1168 |
|
1169 |
} else { return "security issue"; }
|
1170 |
|
1171 |
-
|
1172 |
}
|
1173 |
|
1174 |
|
@@ -1233,11 +1355,12 @@ function wplc_return_status($status) {
|
|
1233 |
if($status == 9){
|
1234 |
return __("User is browsing but doesn't want to chat", "wplivechat");
|
1235 |
}
|
1236 |
-
|
1237 |
}
|
1238 |
|
1239 |
add_filter("wplc_filter_mail_body","wplc_filter_control_mail_body",10,2);
|
1240 |
function wplc_filter_control_mail_body($header,$msg) {
|
|
|
1241 |
$body = '
|
1242 |
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">
|
1243 |
<html>
|
@@ -1246,7 +1369,7 @@ function wplc_filter_control_mail_body($header,$msg) {
|
|
1246 |
|
1247 |
|
1248 |
|
1249 |
-
<table id="" border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color:
|
1250 |
<tbody>
|
1251 |
<tr>
|
1252 |
<td width="100%" style="padding: 30px 20px 100px 20px;">
|
@@ -1303,6 +1426,36 @@ function wplc_filter_control_mail_body($header,$msg) {
|
|
1303 |
}
|
1304 |
|
1305 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1306 |
/**
|
1307 |
* Send an email to the admin based on the settings in the settings page
|
1308 |
* @param string $reply_to email of the user
|
@@ -1313,7 +1466,9 @@ function wplc_filter_control_mail_body($header,$msg) {
|
|
1313 |
* @since 5.1.00
|
1314 |
*/
|
1315 |
function wplcmail($reply_to,$reply_to_name,$subject,$msg) {
|
1316 |
-
|
|
|
|
|
1317 |
$wplc_pro_settings = get_option("WPLC_SETTINGS");
|
1318 |
if(isset($wplc_pro_settings['wplc_pro_chat_email_address'])){
|
1319 |
$email_address = $wplc_pro_settings['wplc_pro_chat_email_address'];
|
@@ -1321,8 +1476,8 @@ function wplcmail($reply_to,$reply_to_name,$subject,$msg) {
|
|
1321 |
$email_address = get_option('admin_email');
|
1322 |
}
|
1323 |
|
1324 |
-
$email_address = explode(',', $email_address);
|
1325 |
-
|
1326 |
if(get_option("wplc_mail_type") == "wp_mail" || !get_option('wplc_mail_type')){
|
1327 |
$headers[] = 'Content-type: text/html';
|
1328 |
$headers[] = 'Reply-To: '.$reply_to_name.'<'.$reply_to.'>';
|
@@ -1331,7 +1486,7 @@ function wplcmail($reply_to,$reply_to_name,$subject,$msg) {
|
|
1331 |
/* Send offline message to each email address */
|
1332 |
$overbody = apply_filters("wplc_filter_mail_body",$subject,$msg);
|
1333 |
if (!wp_mail($email, $subject, $overbody, $headers)) {
|
1334 |
-
$handle = fopen(
|
1335 |
$error = date("Y-m-d H:i:s") . " WP-Mail Failed to send \n";
|
1336 |
@fwrite($handle, $error);
|
1337 |
}
|
@@ -1340,7 +1495,7 @@ function wplcmail($reply_to,$reply_to_name,$subject,$msg) {
|
|
1340 |
// $to = $wplc_pro_settings['wplc_pro_chat_email_address'];
|
1341 |
return;
|
1342 |
} else {
|
1343 |
-
|
1344 |
|
1345 |
|
1346 |
//require 'phpmailer/PHPMailerAutoload.php';
|
@@ -1353,7 +1508,7 @@ function wplcmail($reply_to,$reply_to_name,$subject,$msg) {
|
|
1353 |
//Create a new PHPMailer instance
|
1354 |
|
1355 |
global $phpmailer;
|
1356 |
-
|
1357 |
// (Re)create it, if it's gone missing
|
1358 |
if ( ! ( $phpmailer instanceof PHPMailer ) ) {
|
1359 |
require_once ABSPATH . WPINC . '/class-phpmailer.php';
|
@@ -1391,7 +1546,7 @@ function wplcmail($reply_to,$reply_to_name,$subject,$msg) {
|
|
1391 |
$mail->ClearCustomHeaders();
|
1392 |
$mail->ClearReplyTos();
|
1393 |
|
1394 |
-
|
1395 |
//Whether to use SMTP authentication
|
1396 |
$mail->SMTPAuth = true;
|
1397 |
//Username to use for SMTP authentication
|
@@ -1418,9 +1573,9 @@ function wplcmail($reply_to,$reply_to_name,$subject,$msg) {
|
|
1418 |
|
1419 |
//send the message, check for errors
|
1420 |
if (!$mail->send()) {
|
1421 |
-
$handle = fopen(
|
1422 |
$error = date("Y-m-d H:i:s")." ".$mail->ErrorInfo." \n";
|
1423 |
-
@fwrite($handle, $error);
|
1424 |
}
|
1425 |
return;
|
1426 |
}
|
@@ -1440,7 +1595,7 @@ function wplc_send_offline_msg($name,$email,$msg,$cid) {
|
|
1440 |
__("Email", "wplivechat").": $email\n".
|
1441 |
__("Message", "wplivechat").": $msg\n\n".
|
1442 |
__("Via WP Live Chat Support", "wplivechat");
|
1443 |
-
wplcmail($email,$name, $subject, $msg);
|
1444 |
return;
|
1445 |
}
|
1446 |
|
@@ -1456,9 +1611,9 @@ function wplc_send_offline_msg($name,$email,$msg,$cid) {
|
|
1456 |
function wplc_store_offline_message($name, $email, $message){
|
1457 |
global $wpdb;
|
1458 |
global $wplc_tblname_offline_msgs;
|
1459 |
-
|
1460 |
$wplc_settings = get_option('WPLC_SETTINGS');
|
1461 |
-
|
1462 |
if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
|
1463 |
if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {
|
1464 |
$ip_address = sanitize_text_field($_SERVER['HTTP_X_FORWARDED_FOR']);
|
@@ -1479,7 +1634,7 @@ function wplc_store_offline_message($name, $email, $message){
|
|
1479 |
'ip' => sanitize_text_field($offline_ip_address),
|
1480 |
'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
|
1481 |
);
|
1482 |
-
|
1483 |
$rows_affected = $wpdb->insert( $wplc_tblname_offline_msgs, $ins_array );
|
1484 |
return;
|
1485 |
}
|
@@ -1488,7 +1643,7 @@ function wplc_store_offline_message($name, $email, $message){
|
|
1488 |
*/
|
1489 |
function wplc_send_welcome($cid,$wplc_settings) {
|
1490 |
|
1491 |
-
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"); }
|
1492 |
$mdata = array(
|
1493 |
'msg' => $wplc_settings['wplc_welcome_msg']
|
1494 |
);
|
@@ -1502,10 +1657,10 @@ function wplc_user_initiate_chat($name,$email,$cid = null,$session) {
|
|
1502 |
|
1503 |
global $wpdb;
|
1504 |
global $wplc_tblname_chats;
|
1505 |
-
|
1506 |
|
1507 |
$wplc_settings = get_option('WPLC_SETTINGS');
|
1508 |
-
|
1509 |
if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
|
1510 |
if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {
|
1511 |
$ip_address = sanitize_text_field($_SERVER['HTTP_X_FORWARDED_FOR']);
|
@@ -1524,16 +1679,16 @@ function wplc_user_initiate_chat($name,$email,$cid = null,$session) {
|
|
1524 |
);
|
1525 |
$wplc_ce_ip = null;
|
1526 |
}
|
1527 |
-
|
1528 |
if(function_exists('wplc_ce_activate')){
|
1529 |
/* Log the chat for statistical purposes as well */
|
1530 |
if(function_exists('wplc_ce_record_initial_chat')){
|
1531 |
wplc_ce_record_initial_chat($name, $email, $cid, $wplc_ce_ip, sanitize_text_field($_SERVER['HTTP_REFERER']));
|
1532 |
-
}
|
1533 |
}
|
1534 |
-
|
1535 |
-
if ($cid != null) {
|
1536 |
-
/* change from a visitor to a chat */
|
1537 |
|
1538 |
/**
|
1539 |
* This helps us identify if this user needs to be answered. The user can start typing so long but an agent still needs to answer the chat
|
@@ -1547,21 +1702,21 @@ function wplc_user_initiate_chat($name,$email,$cid = null,$session) {
|
|
1547 |
|
1548 |
$other_data = apply_filters("wplc_start_chat_hook_other_data_hook", $other_data);
|
1549 |
if (!isset($other_data['welcome'])) {
|
1550 |
-
//wplc_send_welcome($cid,$wplc_settings);
|
1551 |
$other_data['welcome'] = true;
|
1552 |
}
|
1553 |
|
1554 |
} else {
|
1555 |
-
//wplc_send_welcome($cid,$wplc_settings);
|
1556 |
$other_data = array();
|
1557 |
$other_data['welcome'] = true;
|
1558 |
|
1559 |
}
|
1560 |
|
1561 |
|
1562 |
-
$wpdb->update(
|
1563 |
-
$wplc_tblname_chats,
|
1564 |
-
array(
|
1565 |
'status' => 2,
|
1566 |
'timestamp' => current_time('mysql'),
|
1567 |
'name' => $name,
|
@@ -1571,9 +1726,9 @@ function wplc_user_initiate_chat($name,$email,$cid = null,$session) {
|
|
1571 |
'url' => sanitize_text_field($_SERVER['HTTP_REFERER']),
|
1572 |
'last_active_timestamp' => current_time('mysql'),
|
1573 |
'other' => maybe_serialize($other_data)
|
1574 |
-
),
|
1575 |
-
array('id' => $cid),
|
1576 |
-
array(
|
1577 |
'%d',
|
1578 |
'%s',
|
1579 |
'%s',
|
@@ -1583,27 +1738,27 @@ function wplc_user_initiate_chat($name,$email,$cid = null,$session) {
|
|
1583 |
'%s',
|
1584 |
'%s',
|
1585 |
'%s'
|
1586 |
-
),
|
1587 |
-
array('%d')
|
1588 |
);
|
1589 |
-
|
1590 |
do_action("wplc_hook_initiate_chat",array("cid" => $cid, "name" => $name, "email" => $email));
|
1591 |
|
1592 |
do_action("wplc_start_chat_hook_after_data_insert", $cid);
|
1593 |
return $cid;
|
1594 |
}
|
1595 |
-
else {
|
1596 |
$other_data = array();
|
1597 |
$other_data['unanswered'] = true;
|
1598 |
|
1599 |
$other_data = apply_filters("wplc_start_chat_hook_other_data_hook", $other_data);
|
1600 |
-
|
1601 |
|
1602 |
|
1603 |
-
|
1604 |
-
|
1605 |
-
|
1606 |
-
|
|
|
1607 |
'timestamp' => current_time('mysql'),
|
1608 |
'name' => $name,
|
1609 |
'email' => $email,
|
@@ -1612,9 +1767,9 @@ function wplc_user_initiate_chat($name,$email,$cid = null,$session) {
|
|
1612 |
'url' => sanitize_text_field($_SERVER['HTTP_REFERER']),
|
1613 |
'last_active_timestamp' => current_time('mysql'),
|
1614 |
'other' => maybe_serialize($other_data)
|
1615 |
-
),
|
1616 |
-
array(
|
1617 |
-
'%s',
|
1618 |
'%s',
|
1619 |
'%s',
|
1620 |
'%s',
|
@@ -1623,10 +1778,10 @@ function wplc_user_initiate_chat($name,$email,$cid = null,$session) {
|
|
1623 |
'%s',
|
1624 |
'%s',
|
1625 |
'%s'
|
1626 |
-
)
|
1627 |
);
|
1628 |
-
|
1629 |
-
|
1630 |
$lastid = $wpdb->insert_id;
|
1631 |
|
1632 |
|
@@ -1663,9 +1818,9 @@ function wplc_update_chat_statuses() {
|
|
1663 |
$timestamp = strtotime($result->last_active_timestamp);
|
1664 |
$datenow = current_time('timestamp');
|
1665 |
$difference = $datenow - $timestamp;
|
1666 |
-
|
1667 |
|
1668 |
-
|
|
|
1669 |
if (intval($result->status) == 2) {
|
1670 |
if ($difference >= 30) { // 60 seconds max
|
1671 |
wplc_change_chat_status($id,12);
|
@@ -1738,7 +1893,7 @@ function wplc_convert_array_to_string($array){
|
|
1738 |
|
1739 |
function wplc_return_browser_image($string,$size) {
|
1740 |
switch($string) {
|
1741 |
-
|
1742 |
case "Internet Explorer":
|
1743 |
return "internet-explorer_".$size."x".$size.".png";
|
1744 |
break;
|
@@ -1759,10 +1914,10 @@ function wplc_return_browser_image($string,$size) {
|
|
1759 |
break;
|
1760 |
default:
|
1761 |
return "web_".$size."x".$size.".png";
|
1762 |
-
break;
|
1763 |
}
|
1764 |
-
|
1765 |
-
|
1766 |
}
|
1767 |
function wplc_return_browser_string($user_agent) {
|
1768 |
if(strpos($user_agent, 'MSIE') !== FALSE)
|
@@ -1770,7 +1925,7 @@ if(strpos($user_agent, 'MSIE') !== FALSE)
|
|
1770 |
elseif(strpos($user_agent, 'Trident') !== FALSE) //For Supporting IE 11
|
1771 |
return 'Internet Explorer';
|
1772 |
elseif(strpos($user_agent, 'Edge') !== FALSE)
|
1773 |
-
|
1774 |
elseif(strpos($user_agent, 'Firefox') !== FALSE)
|
1775 |
return 'Mozilla Firefox';
|
1776 |
elseif(strpos($user_agent, 'Chrome') !== FALSE)
|
@@ -1787,35 +1942,36 @@ elseif(strpos($user_agent, 'Edge') !== FALSE)
|
|
1787 |
|
1788 |
function wplc_error_directory() {
|
1789 |
$upload_dir = wp_upload_dir();
|
1790 |
-
|
1791 |
if (is_multisite()) {
|
1792 |
if (!file_exists($upload_dir['basedir'].'/wp-live-chat-support')) {
|
1793 |
wp_mkdir_p($upload_dir['basedir'].'/wp-live-chat-support');
|
1794 |
$content = "Error log created";
|
1795 |
-
$fp = @fopen($upload_dir['basedir'].'/wp-live-chat-support
|
1796 |
@fwrite($fp,$content);
|
1797 |
}
|
1798 |
} else {
|
1799 |
-
if (!file_exists(
|
1800 |
-
wp_mkdir_p(
|
1801 |
$content = "Error log created";
|
1802 |
-
$fp = @fopen(
|
1803 |
@fwrite($fp,$content);
|
1804 |
}
|
1805 |
-
|
1806 |
}
|
1807 |
return true;
|
1808 |
-
|
1809 |
}
|
1810 |
|
1811 |
function wplc_error_log($error) {
|
1812 |
-
return;
|
|
|
1813 |
$content = "\r\n[".date("Y-m-d")."] [".date("H:i:s")."]".$error;
|
1814 |
-
$fp = @fopen(
|
1815 |
@fwrite($fp,$content);
|
1816 |
@fclose($fp);
|
1817 |
-
|
1818 |
-
|
1819 |
}
|
1820 |
function Memory_Usage($decimals = 2) {
|
1821 |
$result = 0;
|
@@ -1850,14 +2006,15 @@ function wplc_get_memory_usage() {
|
|
1850 |
$size = memory_get_usage(true);
|
1851 |
$unit=array('b','kb','mb','gb','tb','pb');
|
1852 |
return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];
|
1853 |
-
|
1854 |
}
|
1855 |
function wplc_record_mem() {
|
|
|
1856 |
$data = array(
|
1857 |
'date' => current_time('mysql'),
|
1858 |
'php_mem' => wplc_get_memory_usage()
|
1859 |
);
|
1860 |
-
$fp = @fopen(
|
1861 |
fputcsv($fp, $data);
|
1862 |
fclose($fp);
|
1863 |
}
|
@@ -1879,7 +2036,7 @@ function wplc_admin_display_missed_chats() {
|
|
1879 |
$delete_sql = "DELETE FROM $wplc_tblname_chats WHERE `id` = '".intval( sanitize_text_field( $_GET['cid'] ) )."' LIMIT 1";
|
1880 |
|
1881 |
$wpdb->query($delete_sql);
|
1882 |
-
if ($wpdb->last_error) {
|
1883 |
echo "<div class='update-nag' style='margin-top: 0px;margin-bottom: 5px;'>
|
1884 |
".__("Error: Could not delete chat", "wplivechat")."<br>
|
1885 |
</div>";
|
@@ -1887,13 +2044,13 @@ function wplc_admin_display_missed_chats() {
|
|
1887 |
echo "<div class='update-nag' style='margin-top: 0px;margin-bottom: 5px;border-color:#67d552;'>
|
1888 |
".__("Chat Deleted", "wplivechat")."<br>
|
1889 |
</div>";
|
1890 |
-
}
|
1891 |
|
1892 |
} else {
|
1893 |
//Prompt
|
1894 |
echo "<div class='update-nag' style='margin-top: 0px;margin-bottom: 5px;'>
|
1895 |
".__("Are you sure you would like to delete this chat?", "wplivechat")."<br>
|
1896 |
-
<a class='button' href='?page=wplivechat-menu-missed-chats&wplc_action=remove_missed_cid&cid=".
|
1897 |
</div>";
|
1898 |
}
|
1899 |
}
|
@@ -1966,7 +2123,7 @@ function wplc_is_user_banned_basic(){
|
|
1966 |
} else {
|
1967 |
$ip_address = $_SERVER['REMOTE_ADDR'];
|
1968 |
}
|
1969 |
-
|
1970 |
if(isset($ip_address)){
|
1971 |
if($ip == $ip_address){
|
1972 |
$banned++;
|
@@ -1988,9 +2145,9 @@ function wplc_is_user_banned_basic(){
|
|
1988 |
|
1989 |
|
1990 |
function wplc_return_animations_basic(){
|
1991 |
-
|
1992 |
$wplc_settings = get_option("WPLC_SETTINGS");
|
1993 |
-
|
1994 |
if ($wplc_settings["wplc_settings_align"] == 1) {
|
1995 |
$original_pos = "bottom_left";
|
1996 |
//$wplc_box_align = "left:100px; bottom:0px;";
|
@@ -2047,7 +2204,7 @@ function wplc_return_animations_basic(){
|
|
2047 |
$wplc_starting_point = 'margin-bottom: 0px; left: -999px;';
|
2048 |
$wplc_animation = 'animation-2-l';
|
2049 |
} else if ($original_pos == 'right'){
|
2050 |
-
$wplc_starting_point = 'margin-bottom: 0px; right: -999px;';
|
2051 |
$wplc_animation = 'animation-2-r';
|
2052 |
}
|
2053 |
|
@@ -2093,7 +2250,7 @@ function wplc_return_animations_basic(){
|
|
2093 |
$animation_data['box_align'] = $wplc_box_align;
|
2094 |
|
2095 |
} else {
|
2096 |
-
|
2097 |
if($original_pos == 'bottom_right'){
|
2098 |
$wplc_starting_point = 'margin-bottom: 0; right: 20px; display: none;';
|
2099 |
} else if ($original_pos == 'bottom_left'){
|
@@ -2103,9 +2260,9 @@ function wplc_return_animations_basic(){
|
|
2103 |
} else if ($original_pos == 'right'){
|
2104 |
$wplc_starting_point = 'margin-bottom: 100px; right: 0px; display: none;';
|
2105 |
}
|
2106 |
-
|
2107 |
$wplc_animation = 'none';
|
2108 |
-
|
2109 |
$animation_data['animation'] = $wplc_animation;
|
2110 |
$animation_data['starting_point'] = $wplc_starting_point;
|
2111 |
$animation_data['box_align'] = $wplc_box_align;
|
@@ -2122,7 +2279,7 @@ function wplc_advanced_settings_above_performance_control($wplc_settings){
|
|
2122 |
$elem_trig_id = isset($wplc_settings['wplc_elem_trigger_id']) ? $wplc_settings['wplc_elem_trigger_id'] : "";
|
2123 |
|
2124 |
echo "<tr>
|
2125 |
-
<td width='
|
2126 |
".__("Open chat window via", "wplivechat").":
|
2127 |
</td>
|
2128 |
<td>
|
@@ -2139,4 +2296,44 @@ function wplc_advanced_settings_above_performance_control($wplc_settings){
|
|
2139 |
</td>
|
2140 |
</tr>
|
2141 |
";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2142 |
}
|
1 |
<?php
|
2 |
+
$wplc_basic_plugin_url = WPLC_BASIC_PLUGIN_URL;
|
3 |
|
4 |
function wplc_log_user_on_page($name,$email,$session, $is_mobile = false) {
|
5 |
global $wpdb;
|
6 |
global $wplc_tblname_chats;
|
7 |
+
|
8 |
$wplc_settings = get_option('WPLC_SETTINGS');
|
9 |
+
|
10 |
|
11 |
|
12 |
if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
|
29 |
}
|
30 |
|
31 |
|
32 |
+
/* user types
|
33 |
* 1 = new
|
34 |
* 2 = returning
|
35 |
* 3 = timed out
|
36 |
*/
|
37 |
+
|
38 |
$other = array(
|
39 |
"user_type" => 1
|
40 |
);
|
46 |
}
|
47 |
|
48 |
$other = apply_filters("wplc_log_user_on_page_insert_other_data_filter", $other);
|
49 |
+
|
50 |
+
$wplc_chat_session_data = array(
|
51 |
+
'status' => '5',
|
52 |
'timestamp' => current_time('mysql'),
|
53 |
'name' => $name,
|
54 |
'email' => $email,
|
55 |
'session' => $session,
|
56 |
'ip' => maybe_serialize($user_data),
|
57 |
+
'url' => sanitize_text_field($_SERVER['HTTP_REFERER']),
|
58 |
'last_active_timestamp' => current_time('mysql'),
|
59 |
'other' => maybe_serialize($other),
|
60 |
);
|
62 |
$wplc_chat_session_data = apply_filters("wplc_log_user_on_page_insert_filter", $wplc_chat_session_data);
|
63 |
|
64 |
/* Omitted from inser call as this defaults to string
|
65 |
+
$wplc_chat_session_types = array(
|
66 |
+
'%s',
|
67 |
'%s',
|
68 |
'%s',
|
69 |
'%s',
|
78 |
$wpdb->insert($wplc_tblname_chats, $wplc_chat_session_data);
|
79 |
$lastid = $wpdb->insert_id;
|
80 |
|
81 |
+
do_action("wplc_log_user_on_page_after_hook", $lastid, $wplc_chat_session_data);
|
82 |
+
|
83 |
+
|
84 |
return $lastid;
|
85 |
|
86 |
}
|
88 |
global $wpdb;
|
89 |
global $wplc_tblname_chats;
|
90 |
$wplc_settings = get_option('WPLC_SETTINGS');
|
91 |
+
|
92 |
if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
|
93 |
+
|
94 |
if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {
|
95 |
$ip_address = sanitize_text_field($_SERVER['HTTP_X_FORWARDED_FOR']);
|
96 |
} else {
|
107 |
);
|
108 |
}
|
109 |
|
|
|
110 |
|
111 |
+
|
112 |
+
$query = $wpdb->update(
|
113 |
+
$wplc_tblname_chats,
|
114 |
+
array(
|
115 |
'url' => sanitize_text_field($_SERVER['HTTP_REFERER']),
|
116 |
'last_active_timestamp' => current_time('mysql'),
|
117 |
'ip' => maybe_serialize($user_data),
|
118 |
'status' => $status,
|
119 |
'session' => $session,
|
120 |
+
),
|
121 |
+
array('id' => $cid),
|
122 |
+
array(
|
123 |
'%s',
|
124 |
'%s',
|
125 |
'%s',
|
126 |
'%d',
|
127 |
'%s'
|
128 |
+
),
|
129 |
+
array('%d')
|
130 |
);
|
131 |
|
132 |
|
136 |
}
|
137 |
|
138 |
|
139 |
+
function wplc_record_chat_msg($from, $cid, $msg, $rest_check = false, $aid = false, $other = false) {
|
140 |
global $wpdb;
|
141 |
global $wplc_tblname_msgs;
|
142 |
+
var_dump($aid);
|
143 |
+
var_dump($cid);
|
144 |
+
|
145 |
+
|
146 |
+
if( ! filter_var($cid, FILTER_VALIDATE_INT) ) {
|
147 |
+
|
148 |
+
/**
|
149 |
+
* We need to identify if this CID is a node CID, and if so, return the WP CID from the wplc_chat_msgs table
|
150 |
+
*/
|
151 |
+
$cid = wplc_return_chat_id_by_rel($cid);
|
152 |
+
}
|
153 |
+
|
154 |
+
/**
|
155 |
+
* check if this CID even exists, if not, create it
|
156 |
+
*
|
157 |
+
* If it doesnt exist, it most likely is an agent-to-agent chat that we now need to save.
|
158 |
+
*/
|
159 |
+
|
160 |
+
global $wplc_tblname_chats;
|
161 |
+
$results = $wpdb->get_results("SELECT * FROM $wplc_tblname_chats WHERE `rel` = '".$cid."' OR `id` = '".$cid."' LIMIT 1");
|
162 |
+
if (!$results) {
|
163 |
+
/* it doesnt exist, lets put it in the table */
|
164 |
+
|
165 |
+
$wpdb->insert(
|
166 |
+
$wplc_tblname_chats,
|
167 |
+
array(
|
168 |
+
'status' => 3,
|
169 |
+
'timestamp' => current_time('mysql'),
|
170 |
+
'name' => 'agent-to-agent chat',
|
171 |
+
'email' => 'none',
|
172 |
+
'session' => '1',
|
173 |
+
'ip' => '0',
|
174 |
+
'url' => '',
|
175 |
+
'last_active_timestamp' => current_time('mysql'),
|
176 |
+
'other' => '',
|
177 |
+
'rel' => $cid,
|
178 |
+
),
|
179 |
+
array(
|
180 |
+
'%s',
|
181 |
+
'%s',
|
182 |
+
'%s',
|
183 |
+
'%s',
|
184 |
+
'%s',
|
185 |
+
'%s',
|
186 |
+
'%s',
|
187 |
+
'%s',
|
188 |
+
'%s',
|
189 |
+
'%s'
|
190 |
+
)
|
191 |
+
);
|
192 |
+
|
193 |
+
|
194 |
+
$cid = $wpdb->insert_id;
|
195 |
+
}
|
196 |
+
|
197 |
|
198 |
if ($from == "2" && $rest_check == false) {
|
199 |
$wplc_current_user = get_current_user_id();
|
202 |
/*
|
203 |
-- modified in in 6.0.04 --
|
204 |
|
205 |
+
if(current_user_can('wplc_ma_agent') || current_user_can('manage_options')){
|
206 |
*/ } else { return "security issue"; }
|
207 |
}
|
208 |
|
214 |
}
|
215 |
else {
|
216 |
$fromname = apply_filters("wplc_filter_admin_name","Admin");
|
217 |
+
|
218 |
//$fromemail = "SET email";
|
219 |
$orig = '1';
|
220 |
}
|
221 |
+
|
222 |
+
$msg_id = '';
|
223 |
+
var_dump($other);
|
224 |
+
if ($other !== false) {
|
225 |
+
if (!empty($other->msgID)) {
|
226 |
+
$msg_id = $other->msgID;
|
227 |
+
} else {
|
228 |
+
$msg_id = '';
|
229 |
+
}
|
230 |
+
}
|
231 |
+
|
232 |
+
|
233 |
$orig_msg = $msg;
|
234 |
|
235 |
$msg = apply_filters("wplc_filter_message_control",$msg);
|
236 |
|
237 |
+
if (!$aid) {
|
238 |
+
$wplc_current_user = get_current_user_id();
|
239 |
+
var_dump($wplc_current_user);
|
240 |
+
if( get_user_meta( $wplc_current_user, 'wplc_ma_agent', true ) ){
|
241 |
+
$other_data = array('aid'=>$wplc_current_user);
|
242 |
+
} else {
|
243 |
+
$other_data = '';
|
244 |
+
}
|
245 |
} else {
|
246 |
+
if( get_user_meta( $aid, 'wplc_ma_agent', true ) ){
|
247 |
+
$other_data = array('aid'=>$aid);
|
248 |
+
} else {
|
249 |
+
$other_data = '';
|
250 |
+
}
|
251 |
}
|
|
|
252 |
|
253 |
|
254 |
+
|
255 |
+
|
256 |
+
|
257 |
+
$wpdb->insert(
|
258 |
+
$wplc_tblname_msgs,
|
259 |
+
array(
|
260 |
+
'chat_sess_id' => $cid,
|
261 |
'timestamp' => current_time('mysql'),
|
262 |
'msgfrom' => $fromname,
|
263 |
'msg' => $msg,
|
264 |
'status' => 0,
|
265 |
'originates' => $orig,
|
266 |
+
'other' => maybe_serialize( $other_data ),
|
267 |
+
'rel' => $msg_id
|
268 |
+
),
|
269 |
+
array(
|
270 |
+
'%s',
|
271 |
'%s',
|
272 |
'%s',
|
273 |
'%s',
|
274 |
'%d',
|
275 |
'%s',
|
276 |
+
'%s',
|
277 |
'%s'
|
278 |
+
)
|
279 |
);
|
280 |
+
|
281 |
$data = array(
|
282 |
'cid' => $cid,
|
283 |
'from' => $from,
|
287 |
do_action("wplc_hook_message_sent",$data);
|
288 |
|
289 |
wplc_update_active_timestamp(sanitize_text_field($cid));
|
290 |
+
|
291 |
+
|
292 |
return true;
|
293 |
|
294 |
}
|
304 |
// LIMIT 1
|
305 |
// "
|
306 |
// );
|
307 |
+
$wpdb->update(
|
308 |
+
$wplc_tblname_chats,
|
309 |
+
array(
|
310 |
'last_active_timestamp' => current_time('mysql')
|
311 |
+
),
|
312 |
+
array('id' => $cid),
|
313 |
+
array('%s'),
|
314 |
+
array('%d')
|
315 |
);
|
316 |
+
|
317 |
//wplc_change_chat_status(sanitize_text_field($cid),3);
|
318 |
return true;
|
319 |
|
335 |
}
|
336 |
|
337 |
}
|
338 |
+
|
339 |
+
|
340 |
+
/**
|
341 |
+
* Find out if we are dealing with a NODE CID and convert it to the WP CID.
|
342 |
+
*
|
343 |
+
* If it cannot find a relative, then simply return the original CID parsed through.
|
344 |
+
*
|
345 |
+
* @param string|int $rel The CId to compare
|
346 |
+
* @return string|int The suggested CID
|
347 |
+
*/
|
348 |
+
function wplc_return_chat_id_by_rel($rel) {
|
349 |
+
global $wpdb;
|
350 |
+
global $wplc_tblname_chats;
|
351 |
+
|
352 |
+
$results = $wpdb->get_results("SELECT * FROM $wplc_tblname_chats WHERE `rel` = '$rel' LIMIT 1");
|
353 |
+
if ($results) {
|
354 |
+
foreach ($results as $result) {
|
355 |
+
if (isset($result->id)) {
|
356 |
+
return $result->id;
|
357 |
+
} else {
|
358 |
+
return $rel;
|
359 |
+
}
|
360 |
+
}
|
361 |
+
} else {
|
362 |
+
return $rel;
|
363 |
+
}
|
364 |
+
|
365 |
+
}
|
366 |
function wplc_return_chat_email($cid) {
|
367 |
global $wpdb;
|
368 |
global $wplc_tblname_chats;
|
383 |
global $wpdb;
|
384 |
global $wplc_tblname_chats;
|
385 |
$status = 3;
|
386 |
+
$wplc_c = 0;
|
387 |
$results = $wpdb->get_results(
|
388 |
"
|
389 |
+
SELECT *
|
390 |
+
FROM $wplc_tblname_chats
|
391 |
WHERE `status` = 3 OR `status` = 2 OR `status` = 10
|
392 |
ORDER BY `timestamp` ASC
|
393 |
|
394 |
+
"
|
395 |
);
|
396 |
+
|
397 |
+
$table = "<div class='wplc_chats_container'>";
|
398 |
+
|
399 |
if (!$results) {
|
400 |
$table.= "<p>".__("No chat sessions available at the moment","wplivechat")."</p>";
|
401 |
} else {
|
402 |
$table .= "<h2>".__('Active Chats', 'wplivechat')."</h2>";
|
403 |
+
|
404 |
foreach ($results as $result) {
|
405 |
unset($trstyle);
|
406 |
unset($actions);
|
407 |
$wplc_c++;
|
408 |
|
409 |
+
|
410 |
global $wplc_basic_plugin_url;
|
411 |
$user_data = maybe_unserialize($result->ip);
|
412 |
$user_ip = $user_data['ip'];
|
413 |
$browser = wplc_return_browser_string($user_data['user_agent']);
|
414 |
$browser_image = wplc_return_browser_image($browser,"16");
|
415 |
+
|
416 |
if($user_ip == ""){
|
417 |
$user_ip = __('IP Address not recorded', 'wplivechat');
|
418 |
} else {
|
419 |
$user_ip = "<a href='http://www.ip-adress.com/ip_tracer/" . $user_ip . "' title='".__('Whois for' ,'wplivechat')." ".$user_ip."' target='_BLANK'>".$user_ip."</a>";
|
420 |
+
}
|
421 |
+
|
422 |
if ($result->status == 2) {
|
423 |
$url = admin_url( 'admin.php?page=wplivechat-menu&action=ac&cid='.$result->id);
|
424 |
$actions = "<a href=\"".$url."\" class=\"wplc_open_chat button button-primary\" window-title=\"WP_Live_Chat_".$result->id."\">".__("Accept Chat","wplivechat")."</a>";
|
429 |
$url = admin_url( 'admin.php?page=wplivechat-menu&action=ac&cid='.$result->id);
|
430 |
$actions = "<a href=\"".$url."\" class=\"wplc_open_chat button button-primary\" window-title=\"WP_Live_Chat_".$result->id."\">".__("Open Chat Window","wplivechat")."</a>";
|
431 |
$trstyle = "style='background-color:#F7FCFE; height:30px;'";
|
432 |
+
$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>";
|
433 |
}
|
434 |
+
|
435 |
+
|
436 |
/* if ($wplc_c>1) { $actions = wplc_get_msg(); } */
|
437 |
+
|
438 |
$trstyle = "";
|
439 |
+
|
440 |
$table .= "
|
441 |
<div class='wplc_single_chat' id='record_".$result->id."' $trstyle>
|
442 |
<div class='wplc_chat_section section_1'>
|
545 |
}
|
546 |
}
|
547 |
|
548 |
+
add_filter("wplc_filter_list_chats_actions","wplc_filter_control_list_chats_actions",15,3);
|
549 |
/**
|
550 |
* Only allow agents access
|
551 |
* @return void
|
555 |
*/
|
556 |
function wplc_filter_control_list_chats_actions($actions,$result,$post_data) {
|
557 |
$aid = apply_filters("wplc_filter_aid_in_action","");
|
558 |
+
|
559 |
$wplc_current_user = get_current_user_id();
|
560 |
|
561 |
if( get_user_meta( $wplc_current_user, 'wplc_ma_agent', true ) ){
|
568 |
else if (intval($result->status) == 3 || intval($result->status) == 10) {
|
569 |
$url_params = "&action=ac&cid=".$result->id.$aid;
|
570 |
$url = admin_url( 'admin.php?page=wplivechat-menu'.$url_params);
|
571 |
+
if ( ! function_exists("wplc_pro_version_control") || !isset( $result->agent_id ) || $wplc_current_user == $result->agent_id ) { //Added backwards compat checks
|
572 |
+
$actions = "<a href=\"".$url."\" class=\"wplc_open_chat button button-primary\" window-title=\"WP_Live_Chat_".$result->id."\">".__("Open Chat","wplivechat")."</a>";
|
573 |
+
} else {
|
574 |
+
$actions = "<span class=\"wplc-chat-in-progress\">" . __( "In progress with another agent", "wplivechat" ) . "</span>";
|
575 |
+
}
|
576 |
}
|
577 |
else if (intval($result->status) == 2) {
|
578 |
$url_params = "&action=ac&cid=".$result->id.$aid;
|
594 |
|
595 |
global $wpdb;
|
596 |
global $wplc_tblname_chats;
|
597 |
+
|
598 |
+
$data_array = array();
|
599 |
$id_list = array();
|
600 |
+
|
601 |
$status = 3;
|
602 |
+
$wplc_c = 0;
|
603 |
+
|
604 |
+
// Retrieve count of users in same department or in no department
|
605 |
+
$user_id = get_current_user_id();
|
606 |
+
$user_department = get_user_meta($user_id ,"wplc_user_department", true);
|
607 |
+
|
608 |
+
$wplc_chat_count_sql = "SELECT COUNT(*) FROM $wplc_tblname_chats WHERE status IN (3,2,10,5,8,9,12)";
|
609 |
+
if($user_department > 0)
|
610 |
+
$wplc_chat_count_sql .= " AND (department_id=0 OR department_id=$user_department)";
|
611 |
+
$data_array['visitor_count'] = $wpdb->get_var($wplc_chat_count_sql);
|
612 |
+
|
613 |
+
// Retrieve data
|
614 |
$wplc_chat_sql = "SELECT * FROM $wplc_tblname_chats WHERE (`status` = 3 OR `status` = 2 OR `status` = 10 OR `status` = 5 or `status` = 8 or `status` = 9 or `status` = 12)";
|
615 |
$wplc_chat_sql .= apply_filters("wplc_alter_chat_list_sql_before_sorting", "");
|
616 |
+
|
617 |
$wplc_chat_sql .= " ORDER BY `timestamp` ASC";
|
618 |
|
619 |
$results = $wpdb->get_results($wplc_chat_sql);
|
620 |
|
621 |
+
|
622 |
if($results) {
|
623 |
+
|
624 |
+
|
625 |
foreach ($results as $result) {
|
626 |
unset($trstyle);
|
627 |
unset($actions);
|
628 |
+
|
629 |
+
|
630 |
+
|
631 |
|
632 |
global $wplc_basic_plugin_url;
|
633 |
$user_data = maybe_unserialize($result->ip);
|
634 |
$user_ip = $user_data['ip'];
|
635 |
$browser = wplc_return_browser_string($user_data['user_agent']);
|
636 |
$browser_image = wplc_return_browser_image($browser,"16");
|
637 |
+
|
638 |
if($user_ip == ""){
|
639 |
$user_ip = __('IP Address not recorded', 'wplivechat');
|
640 |
} else {
|
641 |
$user_ip = "<a href='http://www.ip-adress.com/ip_tracer/" . $user_ip . "' title='".__('Whois for' ,'wplivechat')." ".$user_ip."' target='_BLANK'>".$user_ip."</a>";
|
642 |
+
}
|
643 |
|
644 |
|
645 |
$actions = apply_filters("wplc_filter_list_chats_actions","",$result,$post_data);
|
646 |
+
|
647 |
+
|
648 |
$other_data = maybe_unserialize($result->other);
|
649 |
+
|
650 |
+
|
651 |
+
|
652 |
$trstyle = "";
|
653 |
+
|
654 |
$id_list[intval($result->id)] = true;
|
655 |
+
|
656 |
$data_array[$result->id]['name'] = $result->name;
|
657 |
$data_array[$result->id]['email'] = $result->email;
|
658 |
+
|
659 |
$data_array[$result->id]['status'] = $result->status;
|
660 |
$data_array[$result->id]['action'] = $actions;
|
661 |
$data_array[$result->id]['timestamp'] = wplc_time_ago($result->timestamp);
|
665 |
} else {
|
666 |
$data_array[$result->id]['type'] = __("Returning","wplivechat");
|
667 |
}
|
668 |
+
|
669 |
$data_array[$result->id]['image'] = "<img src=\"//www.gravatar.com/avatar/".md5($result->email)."?s=30&d=mm\" class='wplc-user-message-avatar' />";
|
670 |
$data_array[$result->id]['data']['browsing'] = $result->url;
|
671 |
$path = parse_url($result->url, PHP_URL_PATH);
|
672 |
+
|
673 |
if (strlen($path) > 20) {
|
674 |
$data_array[$result->id]['data']['browsing_nice_url'] = substr($path,0,20).'...';
|
675 |
+
} else {
|
676 |
$data_array[$result->id]['data']['browsing_nice_url'] = $path;
|
677 |
}
|
678 |
+
|
679 |
$data_array[$result->id]['data']['browser'] = "<img src='" . $wplc_basic_plugin_url . "/images/$browser_image' alt='$browser' title='$browser' /> ";
|
680 |
$data_array[$result->id]['data']['ip'] = $user_ip;
|
681 |
$data_array[$result->id]['other'] = $other_data;
|
682 |
}
|
683 |
+
|
684 |
$data_array['ids'] = $id_list;
|
685 |
}
|
686 |
+
|
687 |
return json_encode($data_array);
|
688 |
}
|
689 |
|
692 |
function wplc_return_user_chat_messages($cid,$wplc_settings = false,$cdata = false) {
|
693 |
global $wpdb;
|
694 |
global $wplc_tblname_msgs;
|
695 |
+
|
696 |
+
if (!$wplc_settings) {
|
697 |
$wplc_settings = get_option("WPLC_SETTINGS");
|
698 |
}
|
699 |
|
700 |
if(isset($wplc_settings['wplc_display_name']) && $wplc_settings['wplc_display_name'] == 1){ $display_name = 1; } else { $display_name = 0; }
|
701 |
+
|
702 |
$sql = "SELECT * FROM $wplc_tblname_msgs WHERE `chat_sess_id` = '$cid' AND `status` = '0' AND (`originates` = '1' OR `originates` = '0') ORDER BY `timestamp` ASC";
|
703 |
$results = $wpdb->get_results($sql);
|
704 |
if (!$cdata) {
|
736 |
} else {
|
737 |
$other = maybe_unserialize($cdata->other);
|
738 |
if (isset($other['aid'])) {
|
739 |
+
|
740 |
|
741 |
$user_info = get_userdata(intval($other['aid']));
|
742 |
+
|
743 |
+
$image = "<img src='//www.gravatar.com/avatar/".md5($user_info->user_email)."?s=30' class='wplc-admin-message-avatar' />";
|
744 |
} else {
|
745 |
|
746 |
+
|
747 |
$image = "";
|
748 |
if(1 == 1) {
|
749 |
|
750 |
} else {
|
751 |
+
|
752 |
$image = "";
|
753 |
}
|
754 |
}
|
755 |
+
|
756 |
}
|
757 |
|
758 |
$from = apply_filters("wplc_filter_admin_name",$from, $cid);
|
760 |
|
761 |
}
|
762 |
else if (intval($result->originates) == 0) {
|
763 |
+
/*
|
764 |
system notifications
|
765 |
from version 7
|
766 |
*/
|
769 |
}
|
770 |
else {
|
771 |
|
772 |
+
/*
|
773 |
removed in 7.1.00
|
774 |
$class = "wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1";
|
775 |
+
|
776 |
if(isset($_COOKIE['wplc_email']) && $_COOKIE['wplc_email'] != ""){ $wplc_user_gravatar = md5(strtolower(trim(sanitize_text_field($_COOKIE['wplc_email'])))); } else { $wplc_user_gravatar = ""; }
|
777 |
+
|
778 |
if($wplc_user_gravatar != ""){
|
779 |
$image = "<img src='//www.gravatar.com/avatar/$wplc_user_gravatar?s=30' class='wplc-user-message-avatar' />";
|
780 |
} else {
|
782 |
}
|
783 |
*/
|
784 |
}
|
785 |
+
|
786 |
if (!$system_notification) {
|
787 |
/* this is a normal message */
|
788 |
if(function_exists('wplc_encrypt_decrypt_msg')){
|
789 |
$msg = wplc_encrypt_decrypt_msg($msg);
|
790 |
}
|
791 |
+
|
792 |
$msg_array = maybe_unserialize( $msg );
|
793 |
|
794 |
if( is_array( $msg_array ) ){
|
795 |
$msg = $msg_array['m'];
|
796 |
+
}
|
797 |
|
798 |
$msg = stripslashes($msg);
|
799 |
|
804 |
$msg_hist[$id]['msg'] = $msg;
|
805 |
$msg_hist[$id]['originates'] = intval($result->originates);
|
806 |
$msg_hist[$id]['other'] = $other_data;
|
807 |
+
|
808 |
/*
|
809 |
removed this in 7.1.00 as the JS now handles this
|
810 |
if($display_name){
|
811 |
$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>";
|
812 |
+
} else {
|
813 |
$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>";
|
814 |
}*/
|
815 |
} else {
|
819 |
$msg_hist[$id]['msg'] = $msg;
|
820 |
$msg_hist[$id]['other'] = $other_data;
|
821 |
$msg_hist[$id]['originates'] = intval($result->originates);
|
822 |
+
}
|
823 |
+
|
824 |
+
|
825 |
|
|
|
|
|
826 |
|
827 |
}
|
828 |
|
883 |
$wplc_welcome = __('Welcome. How may I help you?', 'wplivechat');
|
884 |
if(isset($wplc_settings['wplc_using_localization_plugin']) && $wplc_settings['wplc_using_localization_plugin'] == 1){ $wplc_using_locale = true; } else { $wplc_using_locale = false; }
|
885 |
if (!isset($wplc_settings['wplc_user_welcome_chat']) || $wplc_settings['wplc_user_welcome_chat'] == "") { $wplc_settings['wplc_user_welcome_chat'] = $wplc_welcome; }
|
886 |
+
$text2 = ($wplc_using_locale ? $wplc_welcome : stripslashes($wplc_settings['wplc_user_welcome_chat']));
|
887 |
|
888 |
$chat_id = sanitize_text_field($id);
|
889 |
$chat_msg = sanitize_text_field($text2);
|
890 |
$wplc_rec_msg = wplc_record_chat_msg("2",$chat_id,$chat_msg);
|
891 |
|
892 |
*/
|
893 |
+
|
894 |
+
|
895 |
}
|
896 |
|
897 |
$other['aid'] = $aid;
|
898 |
}
|
899 |
}
|
900 |
|
|
|
901 |
|
902 |
|
903 |
+
|
904 |
+
if ($aid > 0) {
|
905 |
+
$wpdb->update(
|
906 |
+
$wplc_tblname_chats,
|
907 |
+
array(
|
908 |
'status' => $status,
|
909 |
+
'other' => maybe_serialize($other),
|
910 |
+
'agent_id' => $aid
|
911 |
+
),
|
912 |
+
array('id' => $id),
|
913 |
array(
|
914 |
'%d',
|
915 |
+
'%s',
|
916 |
+
'%d'
|
917 |
+
),
|
918 |
+
array('%d')
|
919 |
+
);
|
920 |
} else {
|
921 |
+
$wpdb->update(
|
922 |
+
$wplc_tblname_chats,
|
923 |
+
array(
|
924 |
'status' => $status
|
925 |
+
),
|
926 |
+
array('id' => $id),
|
927 |
+
array('%d'),
|
928 |
+
array('%d')
|
929 |
);
|
930 |
}
|
931 |
|
932 |
do_action("wplc_change_chat_status_hook", $id, $status);
|
933 |
+
|
934 |
return true;
|
935 |
|
936 |
}
|
939 |
function wplc_return_chat_messages($cid, $transcript = false, $html = true, $wplc_settings = false, $cdata = false, $display = 'string', $only_read_message = false) {
|
940 |
global $wpdb;
|
941 |
global $wplc_tblname_msgs;
|
942 |
+
|
943 |
|
944 |
if (!$wplc_settings) {
|
945 |
$wplc_settings = get_option("WPLC_SETTINGS");
|
946 |
}
|
947 |
|
948 |
if(isset($wplc_settings['wplc_display_name']) && $wplc_settings['wplc_display_name'] == 1){ $display_name = 1; } else { $display_name = 0; }
|
949 |
+
|
950 |
$results = wplc_get_chat_messages($cid, $only_read_message, $wplc_settings);
|
951 |
if (!$results) { return; }
|
952 |
+
|
953 |
if (!$cdata) {
|
954 |
$cdata = wplc_get_chat_data($cid,__LINE__);
|
955 |
}
|
962 |
$system_notification = false;
|
963 |
|
964 |
$from = $result->msgfrom;
|
965 |
+
|
966 |
+
|
967 |
+
/* added a control here to see if we should use the NODE ID instead of the SQL ID */
|
968 |
+
if (empty($result->rel)) {
|
969 |
+
$id = $result->id;
|
970 |
+
} else {
|
971 |
+
$id = $result->rel;
|
972 |
+
}
|
973 |
$msg = $result->msg;
|
974 |
|
975 |
|
978 |
|
979 |
$timestamp = strtotime( $result->timestamp );
|
980 |
$other_data['datetime'] = $timestamp;
|
981 |
+
$other_data['datetimeUTC'] = strtotime( get_gmt_from_date( $result->timestamp ) );
|
982 |
$nice_time = date("d M Y H:i:s",$timestamp);
|
|
|
983 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
984 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
985 |
|
|
|
|
|
986 |
|
987 |
+
$image = "";
|
988 |
+
if($result->originates == 1){
|
989 |
|
990 |
} else if ($result->originates == 2){
|
991 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
992 |
|
993 |
} else if ($result->originates == 0 || $result->originates == 3) {
|
994 |
|
995 |
$system_notification = true;
|
996 |
$cuid = get_current_user_id();
|
997 |
+
$is_agent = get_user_meta(esc_html( $cuid ), 'wplc_ma_agent', true);
|
998 |
if ($is_agent && $result->originates == 3 ) {
|
999 |
/* this user is an agent and the notification is meant for an agent, therefore display it */
|
1000 |
$display_notification = true;
|
1014 |
}
|
1015 |
|
1016 |
if (!$system_notification) {
|
1017 |
+
|
1018 |
if(function_exists('wplc_encrypt_decrypt_msg')){
|
1019 |
$msg = wplc_encrypt_decrypt_msg($msg);
|
1020 |
+
}
|
1021 |
|
1022 |
$msg = apply_filters("wplc_filter_message_control_out",$msg);
|
1023 |
+
|
1024 |
if( is_serialized( $msg ) ){
|
1025 |
+
$msg_array = maybe_unserialize( $msg );
|
1026 |
+
|
1027 |
if( is_array( $msg_array ) ){
|
1028 |
$msg = $msg_array['m'];
|
1029 |
} else {
|
1030 |
$msg = $msg;
|
1031 |
+
}
|
1032 |
+
|
1033 |
$msg = stripslashes($msg);
|
1034 |
+
}
|
1035 |
+
|
1036 |
+
if ( isset( $result->afrom ) && intval( $result->afrom ) > 0 ) { $msg_array[$id]['afrom'] = intval( $result->afrom ); $other_data['aid'] = intval( $result->afrom ); }
|
1037 |
+
if ( isset( $result->ato ) && intval( $result->ato ) > 0 ) { $msg_array[$id]['ato'] = intval( $result->ato ); }
|
1038 |
+
|
1039 |
$msg_array[$id]['msg'] = $msg;
|
1040 |
$msg_hist .= $msg;
|
1041 |
$msg_array[$id]['originates'] = $result->originates;
|
1042 |
$msg_array[$id]['other'] = $other_data;
|
1043 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1044 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1045 |
} else {
|
1046 |
/* this is a system notification */
|
1047 |
if ($display_notification) {
|
1048 |
$str = "<span class='chat_time wplc-color-4'>".$nice_time."</span> <span class='wplc_system_notification wplc-color-4'>".$msg."</span>";
|
1049 |
+
|
1050 |
if ( !isset( $msg_array[$id] ) ) { $msg_array[$id] = array(); }
|
1051 |
$msg_array[$id]['msg'] = $str;
|
1052 |
$msg_array[$id]['other'] = $other_data;
|
1057 |
}
|
1058 |
|
1059 |
}
|
1060 |
+
|
1061 |
if ($display == 'string') { return $msg_hist; } else { return $msg_array; }
|
1062 |
|
1063 |
|
1064 |
}
|
1065 |
|
1066 |
+
/**
|
1067 |
+
* Mark a message as 'read'
|
1068 |
+
*
|
1069 |
+
* Sets the 'status' of the message to 1 in the message table
|
1070 |
+
*
|
1071 |
+
* @param [int] $mid Message ID - Unique
|
1072 |
+
* @return bool
|
1073 |
+
*/
|
1074 |
+
function wplc_mark_message_as_read( $mid ) {
|
1075 |
+
global $wpdb;
|
1076 |
+
global $wplc_tblname_msgs;
|
1077 |
+
|
1078 |
+
$wpdb->update(
|
1079 |
+
$wplc_tblname_msgs,
|
1080 |
+
array(
|
1081 |
+
'status' => 1
|
1082 |
+
),
|
1083 |
+
array('id' => $mid),
|
1084 |
+
array('%d'),
|
1085 |
+
array('%d')
|
1086 |
+
);
|
1087 |
+
return true;
|
1088 |
+
}
|
1089 |
+
|
1090 |
|
1091 |
+
/**
|
1092 |
+
* Mark all messages sent by an AGENT as read (a user has read them)
|
1093 |
+
*
|
1094 |
+
* @param int $cid Chat ID
|
1095 |
+
* @return string "ok"
|
1096 |
+
*/
|
1097 |
function wplc_mark_as_read_user_chat_messages($cid) {
|
1098 |
global $wpdb;
|
1099 |
global $wplc_tblname_msgs;
|
1100 |
|
1101 |
+
$results = $wpdb->get_results("SELECT *
|
|
|
|
|
1102 |
FROM $wplc_tblname_msgs
|
1103 |
WHERE `chat_sess_id` = '$cid' AND `status` = '0' AND (`originates` = 1 OR `originates` = 0)
|
1104 |
+
ORDER BY `timestamp` DESC");
|
1105 |
|
1106 |
+
|
1107 |
+
foreach ($results as $result) {
|
1108 |
+
$id = $result->id;
|
1109 |
+
|
1110 |
+
$wpdb->update(
|
1111 |
+
$wplc_tblname_msgs,
|
1112 |
+
array(
|
1113 |
+
'status' => 1
|
1114 |
+
),
|
1115 |
+
array('id' => $id),
|
1116 |
+
array('%d'),
|
1117 |
+
array('%d')
|
1118 |
+
);
|
1119 |
+
|
1120 |
+
|
1121 |
+
}
|
1122 |
+
return "ok";
|
1123 |
+
|
1124 |
+
|
1125 |
+
}
|
1126 |
+
/**
|
1127 |
+
* Mark all messages sent by a USER as read (an agent has read them)
|
1128 |
+
*
|
1129 |
+
* @param int $cid Chat ID
|
1130 |
+
* @return string "ok"
|
1131 |
+
*/
|
1132 |
+
function wplc_mark_as_read_agent_chat_messages($cid, $aid) {
|
1133 |
+
global $wpdb;
|
1134 |
+
global $wplc_tblname_msgs;
|
1135 |
+
|
1136 |
+
$results = $wpdb->get_results("SELECT *
|
1137 |
+
FROM $wplc_tblname_msgs
|
1138 |
+
WHERE `chat_sess_id` = '$cid' AND `ato` = '".intval( $aid )."'
|
1139 |
+
ORDER BY `timestamp` DESC");
|
1140 |
|
1141 |
|
1142 |
foreach ($results as $result) {
|
1143 |
$id = $result->id;
|
1144 |
+
|
1145 |
+
$wpdb->update(
|
1146 |
+
$wplc_tblname_msgs,
|
1147 |
+
array(
|
1148 |
'status' => 1
|
1149 |
+
),
|
1150 |
+
array('id' => $id),
|
1151 |
+
array('%d'),
|
1152 |
+
array('%d')
|
1153 |
);
|
1154 |
+
|
1155 |
+
|
1156 |
}
|
1157 |
return "ok";
|
1158 |
|
1159 |
|
1160 |
}
|
1161 |
+
|
1162 |
+
|
1163 |
//here
|
1164 |
function wplc_return_admin_chat_messages($cid) {
|
1165 |
$wplc_current_user = get_current_user_id();
|
1167 |
/*
|
1168 |
-- modified in in 6.0.04 --
|
1169 |
|
1170 |
+
if(current_user_can('wplc_ma_agent') || current_user_can('manage_options')){
|
1171 |
*/
|
1172 |
$wplc_settings = get_option("WPLC_SETTINGS");
|
1173 |
|
1174 |
if(isset($wplc_settings['wplc_display_name']) && $wplc_settings['wplc_display_name'] == 1){ $display_name = 1; } else { $display_name = 0; }
|
1175 |
+
|
1176 |
global $wpdb;
|
1177 |
global $wplc_tblname_msgs;
|
1178 |
+
|
1179 |
/**
|
1180 |
* `Originates` - codes:
|
1181 |
* 0 - System notification to be delivered to users
|
1182 |
* 1 - Message from an agent
|
1183 |
* 2 - Message from a user
|
1184 |
* 3 - System notification to be delivered to agents
|
1185 |
+
*
|
1186 |
*/
|
1187 |
$results = $wpdb->get_results("SELECT * FROM $wplc_tblname_msgs WHERE `chat_sess_id` = '$cid' AND `status` = '0' AND (`originates` = '2' OR `originates` = '3') ORDER BY `timestamp` ASC");
|
1188 |
|
1205 |
$other_data['datetime'] = $timestamp;
|
1206 |
|
1207 |
if (intval($result->originates) == 3) {
|
1208 |
+
/*
|
1209 |
system notifications
|
1210 |
from version 7
|
1211 |
*/
|
1216 |
|
1217 |
|
1218 |
}
|
1219 |
+
|
1220 |
if (!$system_notification) {
|
1221 |
/* this is a normal message */
|
1222 |
if(function_exists('wplc_encrypt_decrypt_msg')){
|
1223 |
$msg = wplc_encrypt_decrypt_msg($msg);
|
1224 |
}
|
1225 |
+
|
1226 |
$msg_array = maybe_unserialize( $msg );
|
1227 |
|
1228 |
if( is_array( $msg_array ) ){
|
1229 |
$msg = $msg_array['m'];
|
1230 |
+
}
|
1231 |
|
1232 |
$msg = stripslashes($msg);
|
1233 |
|
1246 |
$msg_hist[$id]['msg'] = $msg;
|
1247 |
$msg_hist[$id]['other'] = $other_data;
|
1248 |
$msg_hist[$id]['originates'] = intval($result->originates);
|
1249 |
+
}
|
1250 |
+
|
1251 |
+
|
1252 |
|
|
|
|
|
1253 |
|
1254 |
}
|
1255 |
|
1257 |
}
|
1258 |
|
1259 |
|
1260 |
+
|
1261 |
else {
|
1262 |
return "security issue";
|
1263 |
}
|
1264 |
|
1265 |
|
1266 |
}
|
1267 |
+
|
1268 |
+
/**
|
1269 |
+
* Mark all messages sent by a USER as read (an agent has read them)
|
1270 |
+
*
|
1271 |
+
* @param int $cid Chat ID
|
1272 |
+
* @return string "ok"
|
1273 |
+
*/
|
1274 |
+
function wplc_mark_as_read_admin_chat_messages( $mid ) {
|
1275 |
$wplc_current_user = get_current_user_id();
|
1276 |
|
1277 |
if( get_user_meta( $wplc_current_user, 'wplc_ma_agent', true ) ){
|
|
|
|
|
|
|
|
|
|
|
|
|
1278 |
global $wpdb;
|
1279 |
global $wplc_tblname_msgs;
|
1280 |
|
1281 |
+
$wpdb->update(
|
1282 |
+
$wplc_tblname_msgs,
|
1283 |
+
array(
|
1284 |
'status' => 1
|
1285 |
+
),
|
1286 |
+
array('id' => $mid),
|
1287 |
+
array('%d'),
|
1288 |
+
array('%d')
|
1289 |
);
|
1290 |
|
1291 |
} else { return "security issue"; }
|
1292 |
|
1293 |
+
return "ok";
|
1294 |
}
|
1295 |
|
1296 |
|
1355 |
if($status == 9){
|
1356 |
return __("User is browsing but doesn't want to chat", "wplivechat");
|
1357 |
}
|
1358 |
+
|
1359 |
}
|
1360 |
|
1361 |
add_filter("wplc_filter_mail_body","wplc_filter_control_mail_body",10,2);
|
1362 |
function wplc_filter_control_mail_body($header,$msg) {
|
1363 |
+
$primary_bg_color = apply_filters("wplc_mailer_bg_color", "#ec822c"); //Default orange
|
1364 |
$body = '
|
1365 |
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">
|
1366 |
<html>
|
1369 |
|
1370 |
|
1371 |
|
1372 |
+
<table id="" border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color: ' . $primary_bg_color . ';">
|
1373 |
<tbody>
|
1374 |
<tr>
|
1375 |
<td width="100%" style="padding: 30px 20px 100px 20px;">
|
1426 |
}
|
1427 |
|
1428 |
|
1429 |
+
add_filter("wplc_mailer_bg_color","wplc_fitler_mailer_bg_color",10,1);
|
1430 |
+
function wplc_fitler_mailer_bg_color($default_color) {
|
1431 |
+
$wplc_settings = get_option('WPLC_SETTINGS');
|
1432 |
+
|
1433 |
+
if (isset($wplc_settings['wplc_theme'])) {
|
1434 |
+
$wplc_theme = $wplc_settings['wplc_theme'];
|
1435 |
+
}
|
1436 |
+
|
1437 |
+
if (isset($wplc_theme)) {
|
1438 |
+
if($wplc_theme == 'theme-1') {
|
1439 |
+
$default_color = "#DB0000";
|
1440 |
+
} else if ($wplc_theme == 'theme-2'){
|
1441 |
+
$default_color = "#000000";
|
1442 |
+
} else if ($wplc_theme == 'theme-3'){
|
1443 |
+
$default_color = "#B97B9D";
|
1444 |
+
} else if ($wplc_theme == 'theme-4'){
|
1445 |
+
$default_color = "#1A14DB";
|
1446 |
+
} else if ($wplc_theme == 'theme-5'){
|
1447 |
+
$default_color = "#3DCC13";
|
1448 |
+
} else if ($wplc_theme == 'theme-6'){
|
1449 |
+
//Check what color is selected in palette
|
1450 |
+
if (isset($wplc_settings["wplc_settings_color1"])) {
|
1451 |
+
$default_color = "#" . $wplc_settings["wplc_settings_color1"];
|
1452 |
+
}
|
1453 |
+
}
|
1454 |
+
}
|
1455 |
+
|
1456 |
+
return $default_color;
|
1457 |
+
}
|
1458 |
+
|
1459 |
/**
|
1460 |
* Send an email to the admin based on the settings in the settings page
|
1461 |
* @param string $reply_to email of the user
|
1466 |
* @since 5.1.00
|
1467 |
*/
|
1468 |
function wplcmail($reply_to,$reply_to_name,$subject,$msg) {
|
1469 |
+
|
1470 |
+
$upload_dir = wp_upload_dir();
|
1471 |
+
|
1472 |
$wplc_pro_settings = get_option("WPLC_SETTINGS");
|
1473 |
if(isset($wplc_pro_settings['wplc_pro_chat_email_address'])){
|
1474 |
$email_address = $wplc_pro_settings['wplc_pro_chat_email_address'];
|
1476 |
$email_address = get_option('admin_email');
|
1477 |
}
|
1478 |
|
1479 |
+
$email_address = explode(',', $email_address);
|
1480 |
+
|
1481 |
if(get_option("wplc_mail_type") == "wp_mail" || !get_option('wplc_mail_type')){
|
1482 |
$headers[] = 'Content-type: text/html';
|
1483 |
$headers[] = 'Reply-To: '.$reply_to_name.'<'.$reply_to.'>';
|
1486 |
/* Send offline message to each email address */
|
1487 |
$overbody = apply_filters("wplc_filter_mail_body",$subject,$msg);
|
1488 |
if (!wp_mail($email, $subject, $overbody, $headers)) {
|
1489 |
+
$handle = fopen($upload_dir['basedir'].'/wp_livechat_error_log.txt', 'a');
|
1490 |
$error = date("Y-m-d H:i:s") . " WP-Mail Failed to send \n";
|
1491 |
@fwrite($handle, $error);
|
1492 |
}
|
1495 |
// $to = $wplc_pro_settings['wplc_pro_chat_email_address'];
|
1496 |
return;
|
1497 |
} else {
|
1498 |
+
|
1499 |
|
1500 |
|
1501 |
//require 'phpmailer/PHPMailerAutoload.php';
|
1508 |
//Create a new PHPMailer instance
|
1509 |
|
1510 |
global $phpmailer;
|
1511 |
+
|
1512 |
// (Re)create it, if it's gone missing
|
1513 |
if ( ! ( $phpmailer instanceof PHPMailer ) ) {
|
1514 |
require_once ABSPATH . WPINC . '/class-phpmailer.php';
|
1546 |
$mail->ClearCustomHeaders();
|
1547 |
$mail->ClearReplyTos();
|
1548 |
|
1549 |
+
|
1550 |
//Whether to use SMTP authentication
|
1551 |
$mail->SMTPAuth = true;
|
1552 |
//Username to use for SMTP authentication
|
1573 |
|
1574 |
//send the message, check for errors
|
1575 |
if (!$mail->send()) {
|
1576 |
+
$handle = fopen($upload_dir['basedir'].'/wp_livechat_error_log.txt', 'a');
|
1577 |
$error = date("Y-m-d H:i:s")." ".$mail->ErrorInfo." \n";
|
1578 |
+
@fwrite($handle, $error);
|
1579 |
}
|
1580 |
return;
|
1581 |
}
|
1595 |
__("Email", "wplivechat").": $email\n".
|
1596 |
__("Message", "wplivechat").": $msg\n\n".
|
1597 |
__("Via WP Live Chat Support", "wplivechat");
|
1598 |
+
wplcmail($email,$name, $subject, $msg);
|
1599 |
return;
|
1600 |
}
|
1601 |
|
1611 |
function wplc_store_offline_message($name, $email, $message){
|
1612 |
global $wpdb;
|
1613 |
global $wplc_tblname_offline_msgs;
|
1614 |
+
|
1615 |
$wplc_settings = get_option('WPLC_SETTINGS');
|
1616 |
+
|
1617 |
if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
|
1618 |
if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {
|
1619 |
$ip_address = sanitize_text_field($_SERVER['HTTP_X_FORWARDED_FOR']);
|
1634 |
'ip' => sanitize_text_field($offline_ip_address),
|
1635 |
'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
|
1636 |
);
|
1637 |
+
|
1638 |
$rows_affected = $wpdb->insert( $wplc_tblname_offline_msgs, $ins_array );
|
1639 |
return;
|
1640 |
}
|
1643 |
*/
|
1644 |
function wplc_send_welcome($cid,$wplc_settings) {
|
1645 |
|
1646 |
+
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"); }
|
1647 |
$mdata = array(
|
1648 |
'msg' => $wplc_settings['wplc_welcome_msg']
|
1649 |
);
|
1657 |
|
1658 |
global $wpdb;
|
1659 |
global $wplc_tblname_chats;
|
1660 |
+
|
1661 |
|
1662 |
$wplc_settings = get_option('WPLC_SETTINGS');
|
1663 |
+
|
1664 |
if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
|
1665 |
if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {
|
1666 |
$ip_address = sanitize_text_field($_SERVER['HTTP_X_FORWARDED_FOR']);
|
1679 |
);
|
1680 |
$wplc_ce_ip = null;
|
1681 |
}
|
1682 |
+
|
1683 |
if(function_exists('wplc_ce_activate')){
|
1684 |
/* Log the chat for statistical purposes as well */
|
1685 |
if(function_exists('wplc_ce_record_initial_chat')){
|
1686 |
wplc_ce_record_initial_chat($name, $email, $cid, $wplc_ce_ip, sanitize_text_field($_SERVER['HTTP_REFERER']));
|
1687 |
+
}
|
1688 |
}
|
1689 |
+
|
1690 |
+
if ($cid != null) {
|
1691 |
+
/* change from a visitor to a chat */
|
1692 |
|
1693 |
/**
|
1694 |
* This helps us identify if this user needs to be answered. The user can start typing so long but an agent still needs to answer the chat
|
1702 |
|
1703 |
$other_data = apply_filters("wplc_start_chat_hook_other_data_hook", $other_data);
|
1704 |
if (!isset($other_data['welcome'])) {
|
1705 |
+
//wplc_send_welcome($cid,$wplc_settings);
|
1706 |
$other_data['welcome'] = true;
|
1707 |
}
|
1708 |
|
1709 |
} else {
|
1710 |
+
//wplc_send_welcome($cid,$wplc_settings);
|
1711 |
$other_data = array();
|
1712 |
$other_data['welcome'] = true;
|
1713 |
|
1714 |
}
|
1715 |
|
1716 |
|
1717 |
+
$wpdb->update(
|
1718 |
+
$wplc_tblname_chats,
|
1719 |
+
array(
|
1720 |
'status' => 2,
|
1721 |
'timestamp' => current_time('mysql'),
|
1722 |
'name' => $name,
|
1726 |
'url' => sanitize_text_field($_SERVER['HTTP_REFERER']),
|
1727 |
'last_active_timestamp' => current_time('mysql'),
|
1728 |
'other' => maybe_serialize($other_data)
|
1729 |
+
),
|
1730 |
+
array('id' => $cid),
|
1731 |
+
array(
|
1732 |
'%d',
|
1733 |
'%s',
|
1734 |
'%s',
|
1738 |
'%s',
|
1739 |
'%s',
|
1740 |
'%s'
|
1741 |
+
),
|
1742 |
+
array('%d')
|
1743 |
);
|
1744 |
+
|
1745 |
do_action("wplc_hook_initiate_chat",array("cid" => $cid, "name" => $name, "email" => $email));
|
1746 |
|
1747 |
do_action("wplc_start_chat_hook_after_data_insert", $cid);
|
1748 |
return $cid;
|
1749 |
}
|
1750 |
+
else {
|
1751 |
$other_data = array();
|
1752 |
$other_data['unanswered'] = true;
|
1753 |
|
1754 |
$other_data = apply_filters("wplc_start_chat_hook_other_data_hook", $other_data);
|
|
|
1755 |
|
1756 |
|
1757 |
+
|
1758 |
+
$wpdb->insert(
|
1759 |
+
$wplc_tblname_chats,
|
1760 |
+
array(
|
1761 |
+
'status' => 2,
|
1762 |
'timestamp' => current_time('mysql'),
|
1763 |
'name' => $name,
|
1764 |
'email' => $email,
|
1767 |
'url' => sanitize_text_field($_SERVER['HTTP_REFERER']),
|
1768 |
'last_active_timestamp' => current_time('mysql'),
|
1769 |
'other' => maybe_serialize($other_data)
|
1770 |
+
),
|
1771 |
+
array(
|
1772 |
+
'%s',
|
1773 |
'%s',
|
1774 |
'%s',
|
1775 |
'%s',
|
1778 |
'%s',
|
1779 |
'%s',
|
1780 |
'%s'
|
1781 |
+
)
|
1782 |
);
|
1783 |
+
|
1784 |
+
|
1785 |
$lastid = $wpdb->insert_id;
|
1786 |
|
1787 |
|
1818 |
$timestamp = strtotime($result->last_active_timestamp);
|
1819 |
$datenow = current_time('timestamp');
|
1820 |
$difference = $datenow - $timestamp;
|
|
|
1821 |
|
1822 |
+
|
1823 |
+
|
1824 |
if (intval($result->status) == 2) {
|
1825 |
if ($difference >= 30) { // 60 seconds max
|
1826 |
wplc_change_chat_status($id,12);
|
1893 |
|
1894 |
function wplc_return_browser_image($string,$size) {
|
1895 |
switch($string) {
|
1896 |
+
|
1897 |
case "Internet Explorer":
|
1898 |
return "internet-explorer_".$size."x".$size.".png";
|
1899 |
break;
|
1914 |
break;
|
1915 |
default:
|
1916 |
return "web_".$size."x".$size.".png";
|
1917 |
+
break;
|
1918 |
}
|
1919 |
+
|
1920 |
+
|
1921 |
}
|
1922 |
function wplc_return_browser_string($user_agent) {
|
1923 |
if(strpos($user_agent, 'MSIE') !== FALSE)
|
1925 |
elseif(strpos($user_agent, 'Trident') !== FALSE) //For Supporting IE 11
|
1926 |
return 'Internet Explorer';
|
1927 |
elseif(strpos($user_agent, 'Edge') !== FALSE)
|
1928 |
+
return 'Internet Explorer';
|
1929 |
elseif(strpos($user_agent, 'Firefox') !== FALSE)
|
1930 |
return 'Mozilla Firefox';
|
1931 |
elseif(strpos($user_agent, 'Chrome') !== FALSE)
|
1942 |
|
1943 |
function wplc_error_directory() {
|
1944 |
$upload_dir = wp_upload_dir();
|
1945 |
+
|
1946 |
if (is_multisite()) {
|
1947 |
if (!file_exists($upload_dir['basedir'].'/wp-live-chat-support')) {
|
1948 |
wp_mkdir_p($upload_dir['basedir'].'/wp-live-chat-support');
|
1949 |
$content = "Error log created";
|
1950 |
+
$fp = @fopen($upload_dir['basedir'].'/wp-live-chat-support/error_log.txt','w+');
|
1951 |
@fwrite($fp,$content);
|
1952 |
}
|
1953 |
} else {
|
1954 |
+
if (!file_exists($upload_dir['basedir'] .'/wp-live-chat-support')) {
|
1955 |
+
wp_mkdir_p($upload_dir['basedir'] . '/wp-live-chat-support');
|
1956 |
$content = "Error log created";
|
1957 |
+
$fp = @fopen($upload_dir['basedir'] . '/wp-live-chat-support/error_log.txt','w+');
|
1958 |
@fwrite($fp,$content);
|
1959 |
}
|
1960 |
+
|
1961 |
}
|
1962 |
return true;
|
1963 |
+
|
1964 |
}
|
1965 |
|
1966 |
function wplc_error_log($error) {
|
1967 |
+
return;
|
1968 |
+
$upload_dir = wp_upload_dir();
|
1969 |
$content = "\r\n[".date("Y-m-d")."] [".date("H:i:s")."]".$error;
|
1970 |
+
$fp = @fopen($upload_dir['basedir'].'/wp-live-chat-support/error_log.txt','a+');
|
1971 |
@fwrite($fp,$content);
|
1972 |
@fclose($fp);
|
1973 |
+
|
1974 |
+
|
1975 |
}
|
1976 |
function Memory_Usage($decimals = 2) {
|
1977 |
$result = 0;
|
2006 |
$size = memory_get_usage(true);
|
2007 |
$unit=array('b','kb','mb','gb','tb','pb');
|
2008 |
return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];
|
2009 |
+
|
2010 |
}
|
2011 |
function wplc_record_mem() {
|
2012 |
+
$upload_dir = wp_upload_dir();
|
2013 |
$data = array(
|
2014 |
'date' => current_time('mysql'),
|
2015 |
'php_mem' => wplc_get_memory_usage()
|
2016 |
);
|
2017 |
+
$fp = @fopen($upload_dir['basedir'].'/wp-live-chat-support'."/mem_usag.csv","a+");
|
2018 |
fputcsv($fp, $data);
|
2019 |
fclose($fp);
|
2020 |
}
|
2036 |
$delete_sql = "DELETE FROM $wplc_tblname_chats WHERE `id` = '".intval( sanitize_text_field( $_GET['cid'] ) )."' LIMIT 1";
|
2037 |
|
2038 |
$wpdb->query($delete_sql);
|
2039 |
+
if ($wpdb->last_error) {
|
2040 |
echo "<div class='update-nag' style='margin-top: 0px;margin-bottom: 5px;'>
|
2041 |
".__("Error: Could not delete chat", "wplivechat")."<br>
|
2042 |
</div>";
|
2044 |
echo "<div class='update-nag' style='margin-top: 0px;margin-bottom: 5px;border-color:#67d552;'>
|
2045 |
".__("Chat Deleted", "wplivechat")."<br>
|
2046 |
</div>";
|
2047 |
+
}
|
2048 |
|
2049 |
} else {
|
2050 |
//Prompt
|
2051 |
echo "<div class='update-nag' style='margin-top: 0px;margin-bottom: 5px;'>
|
2052 |
".__("Are you sure you would like to delete this chat?", "wplivechat")."<br>
|
2053 |
+
<a class='button' href='?page=wplivechat-menu-missed-chats&wplc_action=remove_missed_cid&cid=".sanitize_text_field( $_GET['cid'] )."&wplc_confirm=1''>".__("Yes", "wplivechat")."</a> <a class='button' href='?page=wplivechat-menu-missed-chats'>".__("No", "wplivechat")."</a>
|
2054 |
</div>";
|
2055 |
}
|
2056 |
}
|
2123 |
} else {
|
2124 |
$ip_address = $_SERVER['REMOTE_ADDR'];
|
2125 |
}
|
2126 |
+
|
2127 |
if(isset($ip_address)){
|
2128 |
if($ip == $ip_address){
|
2129 |
$banned++;
|
2145 |
|
2146 |
|
2147 |
function wplc_return_animations_basic(){
|
2148 |
+
|
2149 |
$wplc_settings = get_option("WPLC_SETTINGS");
|
2150 |
+
|
2151 |
if ($wplc_settings["wplc_settings_align"] == 1) {
|
2152 |
$original_pos = "bottom_left";
|
2153 |
//$wplc_box_align = "left:100px; bottom:0px;";
|
2204 |
$wplc_starting_point = 'margin-bottom: 0px; left: -999px;';
|
2205 |
$wplc_animation = 'animation-2-l';
|
2206 |
} else if ($original_pos == 'right'){
|
2207 |
+
$wplc_starting_point = 'margin-bottom: 0px; right: -999px;';
|
2208 |
$wplc_animation = 'animation-2-r';
|
2209 |
}
|
2210 |
|
2250 |
$animation_data['box_align'] = $wplc_box_align;
|
2251 |
|
2252 |
} else {
|
2253 |
+
|
2254 |
if($original_pos == 'bottom_right'){
|
2255 |
$wplc_starting_point = 'margin-bottom: 0; right: 20px; display: none;';
|
2256 |
} else if ($original_pos == 'bottom_left'){
|
2260 |
} else if ($original_pos == 'right'){
|
2261 |
$wplc_starting_point = 'margin-bottom: 100px; right: 0px; display: none;';
|
2262 |
}
|
2263 |
+
|
2264 |
$wplc_animation = 'none';
|
2265 |
+
|
2266 |
$animation_data['animation'] = $wplc_animation;
|
2267 |
$animation_data['starting_point'] = $wplc_starting_point;
|
2268 |
$animation_data['box_align'] = $wplc_box_align;
|
2279 |
$elem_trig_id = isset($wplc_settings['wplc_elem_trigger_id']) ? $wplc_settings['wplc_elem_trigger_id'] : "";
|
2280 |
|
2281 |
echo "<tr>
|
2282 |
+
<td width='350'>
|
2283 |
".__("Open chat window via", "wplivechat").":
|
2284 |
</td>
|
2285 |
<td>
|
2296 |
</td>
|
2297 |
</tr>
|
2298 |
";
|
2299 |
+
}
|
2300 |
+
|
2301 |
+
/**
|
2302 |
+
* Reverse of wplc_return_chat_id_by_rel
|
2303 |
+
*/
|
2304 |
+
function wplc_return_chat_rel_by_id($cid) {
|
2305 |
+
global $wpdb;
|
2306 |
+
global $wplc_tblname_chats;
|
2307 |
+
|
2308 |
+
$results = $wpdb->get_results("SELECT * FROM $wplc_tblname_chats WHERE `id` = '$cid' LIMIT 1");
|
2309 |
+
if ($results) {
|
2310 |
+
foreach ($results as $result) {
|
2311 |
+
if (isset($result->rel)) {
|
2312 |
+
return $result->rel;
|
2313 |
+
} else {
|
2314 |
+
return $cid;
|
2315 |
+
}
|
2316 |
+
}
|
2317 |
+
} else {
|
2318 |
+
return $cid;
|
2319 |
+
}
|
2320 |
+
|
2321 |
+
}
|
2322 |
+
|
2323 |
+
/*
|
2324 |
+
* Returns total message count for a chat
|
2325 |
+
*/
|
2326 |
+
function wplc_return_message_count_by_cid($cid) {
|
2327 |
+
global $wpdb;
|
2328 |
+
global $wplc_tblname_msgs;
|
2329 |
+
|
2330 |
+
$sql = "SELECT `id` FROM $wplc_tblname_msgs WHERE `chat_sess_id` = '$cid'";
|
2331 |
+
$results = $wpdb->get_results($sql);
|
2332 |
+
|
2333 |
+
$message_count = 0;
|
2334 |
+
foreach ($results as $result) {
|
2335 |
+
$message_count ++;
|
2336 |
+
}
|
2337 |
+
|
2338 |
+
return $message_count;
|
2339 |
}
|
images/48px.png
ADDED
Binary file
|
images/48px_n.png
ADDED
Binary file
|
images/add-on0.jpg
CHANGED
File without changes
|
images/add-on1.jpg
CHANGED
File without changes
|
images/add-on2.jpg
CHANGED
File without changes
|
images/add-on3.jpg
CHANGED
File without changes
|
images/add-on4.jpg
CHANGED
File without changes
|
images/ajax-loader.gif
CHANGED
File without changes
|
images/bg/cloudy.jpg
CHANGED
File without changes
|
images/bg/geometry.jpg
CHANGED
File without changes
|
images/bg/social.jpg
CHANGED
File without changes
|
images/bg/tech.jpg
CHANGED
File without changes
|
images/chaticon.png
CHANGED
File without changes
|
images/chrome_16x16.png
CHANGED
File without changes
|
images/chrome_32x32.png
CHANGED
File without changes
|
images/codecabin.png
CHANGED
File without changes
|
images/firefox_16x16.png
CHANGED
File without changes
|
images/firefox_32x32.png
CHANGED
File without changes
|
images/flash.ico
CHANGED
File without changes
|
images/iconCloseRetina.png
CHANGED
File without changes
|
images/iconRetina.png
CHANGED
File without changes
|
images/iconmicro.png
CHANGED
File without changes
|
images/internet-explorer_16x16.png
CHANGED
File without changes
|
images/internet-explorer_32x32.png
CHANGED
File without changes
|
images/loader2.gif
CHANGED
File without changes
|
images/opera_16x16.png
CHANGED
File without changes
|
images/opera_32x32.png
CHANGED
File without changes
|
images/performance.png
ADDED
Binary file
|
images/plugin1.jpg
CHANGED
File without changes
|
images/plugin2.jpg
CHANGED
File without changes
|
images/reporting_sample.jpg
CHANGED
File without changes
|
images/safari_16x16.png
CHANGED
File without changes
|
images/safari_32x32.png
CHANGED
File without changes
|
images/support.png
CHANGED
File without changes
|
images/themes/newtheme-1.jpg
CHANGED
File without changes
|
images/themes/newtheme-2.jpg
CHANGED
File without changes
|
images/themes/theme-1.png
CHANGED
File without changes
|
images/themes/theme-2.png
CHANGED
File without changes
|
images/themes/theme-3.png
CHANGED
File without changes
|
images/themes/theme-4.png
CHANGED
File without changes
|
images/themes/theme-5.png
CHANGED
File without changes
|
images/themes/theme-6.png
CHANGED
File without changes
|
images/trigger_sample.jpg
CHANGED
File without changes
|
images/trigger_sample_front.jpg
CHANGED
File without changes
|
images/ui-bg_flat_10_000000_40x100.png
CHANGED
File without changes
|
images/ui-bg_glass_65_ffffff_1x400.png
CHANGED
File without changes
|
images/ui-icons_ffffff_256x240.png
CHANGED
File without changes
|
images/web_16x16.png
CHANGED
File without changes
|
images/web_32x32.png
CHANGED
File without changes
|
images/wplc-logo.png
CHANGED
File without changes
|
images/wplc_notification_icon.png
CHANGED
File without changes
|
includes/Mobile_Detect.php
CHANGED
File without changes
|
includes/blocks/wplc-chat-box/block.js
ADDED
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* BLOCK: WP Live Chat Support Chat Box */
|
2 |
+
|
3 |
+
( function() {
|
4 |
+
|
5 |
+
var __ = wp.i18n.__;
|
6 |
+
var el = wp.element.createElement;
|
7 |
+
var children = wp.blocks.source.children;
|
8 |
+
var registerBlockType = wp.blocks.registerBlockType;
|
9 |
+
|
10 |
+
String.prototype.stripSlashes = function(){
|
11 |
+
return this.replace(/\\(.)/mg, "$1");
|
12 |
+
}
|
13 |
+
|
14 |
+
var wplc_logo = ( wplc_settings.wplc_logo ) ? wplc_settings.wplc_logo : 'https://bleeper.io/app/assets/images/wplc_loading.png';
|
15 |
+
var wplc_text = ( wplc_settings.wplc_text ) ? wplc_settings.wplc_text : 'Live Chat';
|
16 |
+
var wplc_icon = ( wplc_settings.wplc_icon ) ? wplc_settings.wplc_icon : 'fa-commenting-o';
|
17 |
+
var classes = ( wplc_settings.wplc_enabled == 0 ) ? ' disabled' : '';
|
18 |
+
var icon_classes = ( wplc_settings.wplc_icon_enabled == 0 ) ? ' disabled' : '';
|
19 |
+
var size_class = ' md';
|
20 |
+
var default_template = '<!-- Default HTML --><div class="wplc_block"><span class="wplc_block_logo">{wplc_logo}</span><span class="wplc_block_text">{wplc_text}</span><span class="wplc_block_icon">{wplc_icon}</span></div>';
|
21 |
+
var wplc_template = ( wplc_settings.wplc_custom_html ) ? wplc_settings.wplc_custom_html : default_template;
|
22 |
+
wplc_template = wplc_template.stripSlashes();
|
23 |
+
|
24 |
+
if ( wplc_settings.wplc_size == 1 ) {
|
25 |
+
size_class = ' sm';
|
26 |
+
} else if ( wplc_settings.wplc_size == 2 ) {
|
27 |
+
size_class = ' md';
|
28 |
+
} else if ( wplc_settings.wplc_size == 3 ) {
|
29 |
+
size_class = ' lg';
|
30 |
+
}
|
31 |
+
|
32 |
+
var wplc_styles = {
|
33 |
+
backgroundImage: 'url(' + wplc_logo + ')'
|
34 |
+
}
|
35 |
+
|
36 |
+
var placeholder_codes = ['wplc_logo', 'wplc_text', 'wplc_icon'],
|
37 |
+
placeholder_values = ['<span class="wplc_block_logo" style="background-image: url(\'' + wplc_logo + '\');"></span>', wplc_text, '<i class="fa ' + wplc_icon + '"></i>'];
|
38 |
+
|
39 |
+
for( var i = 0; i < placeholder_codes.length; i++ ) {
|
40 |
+
wplc_template = wplc_template.replace(new RegExp('{' + placeholder_codes[i] + '}', 'gi'), placeholder_values[i]);
|
41 |
+
}
|
42 |
+
|
43 |
+
registerBlockType( 'wp-live-chat-support/wplc-chat-box', {
|
44 |
+
title: __( 'WP Live Chat Box', 'WPLC' ),
|
45 |
+
icon: 'format-chat',
|
46 |
+
category: 'common',
|
47 |
+
|
48 |
+
edit: function( props ) {
|
49 |
+
output_wplc_block_logo = el(
|
50 |
+
'span',
|
51 |
+
{ className: 'wplc_block_logo',
|
52 |
+
style: wplc_styles
|
53 |
+
}
|
54 |
+
);
|
55 |
+
output_wplc_block_text = el(
|
56 |
+
'span',
|
57 |
+
{ className: 'wplc_block_text' },
|
58 |
+
wplc_text
|
59 |
+
);
|
60 |
+
|
61 |
+
icon = el(
|
62 |
+
'i',
|
63 |
+
{ className: 'fa fa-commenting-o' }
|
64 |
+
);
|
65 |
+
|
66 |
+
output_wplc_block_icon = el(
|
67 |
+
'span',
|
68 |
+
{ className: 'wplc_block_icon' + icon_classes },
|
69 |
+
icon
|
70 |
+
);
|
71 |
+
|
72 |
+
output = el(
|
73 |
+
'span',
|
74 |
+
{ className: 'wplc_block' + classes + size_class },
|
75 |
+
output_wplc_block_logo,
|
76 |
+
output_wplc_block_text,
|
77 |
+
output_wplc_block_icon
|
78 |
+
);
|
79 |
+
|
80 |
+
return el(
|
81 |
+
'div',
|
82 |
+
{ id: 'wplc-chat-box',
|
83 |
+
className: classes,
|
84 |
+
dangerouslySetInnerHTML: { __html: wplc_template }
|
85 |
+
},
|
86 |
+
);
|
87 |
+
},
|
88 |
+
|
89 |
+
save: function( props ) {
|
90 |
+
output_wplc_block_logo = el(
|
91 |
+
'span',
|
92 |
+
{ className: 'wplc_block_logo',
|
93 |
+
style: wplc_styles
|
94 |
+
}
|
95 |
+
);
|
96 |
+
output_wplc_block_text = el(
|
97 |
+
'span',
|
98 |
+
{ className: 'wplc_block_text' },
|
99 |
+
wplc_text
|
100 |
+
);
|
101 |
+
|
102 |
+
icon = el(
|
103 |
+
'i',
|
104 |
+
{ className: 'fa fa-commenting-o' }
|
105 |
+
);
|
106 |
+
|
107 |
+
output_wplc_block_icon = el(
|
108 |
+
'span',
|
109 |
+
{ className: 'wplc_block_icon' + icon_classes },
|
110 |
+
icon
|
111 |
+
);
|
112 |
+
|
113 |
+
output = el(
|
114 |
+
'span',
|
115 |
+
{ className: 'wplc_block' + classes + size_class },
|
116 |
+
output_wplc_block_logo,
|
117 |
+
output_wplc_block_text,
|
118 |
+
output_wplc_block_icon
|
119 |
+
);
|
120 |
+
|
121 |
+
return el(
|
122 |
+
'div',
|
123 |
+
{ id: 'wplc-chat-box',
|
124 |
+
className: classes,
|
125 |
+
dangerouslySetInnerHTML: { __html: wplc_template }
|
126 |
+
}
|
127 |
+
);
|
128 |
+
},
|
129 |
+
} );
|
130 |
+
})();
|
includes/blocks/wplc-chat-box/editor.css
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* CSS for block-editor */
|
2 |
+
|
3 |
+
.wplc_block {
|
4 |
+
position: relative;
|
5 |
+
display:inline-block;
|
6 |
+
background: #32373c;
|
7 |
+
color: #eee;
|
8 |
+
border-radius: 3px;
|
9 |
+
height: 35px;
|
10 |
+
padding-left: 40px;
|
11 |
+
margin: 5px 0 5px 0;
|
12 |
+
transition: all .2s ease-in-out;
|
13 |
+
cursor: pointer;
|
14 |
+
border-bottom: 0px solid #111;
|
15 |
+
font-size: 17px;
|
16 |
+
line-height: 35px;
|
17 |
+
}
|
18 |
+
|
19 |
+
.wplc_block:hover {
|
20 |
+
transform: translateY(-2px);
|
21 |
+
}
|
22 |
+
|
23 |
+
.wplc_block:after {
|
24 |
+
content: "";
|
25 |
+
position: absolute;
|
26 |
+
display: block;
|
27 |
+
height: 0px;
|
28 |
+
bottom: 0;
|
29 |
+
left: 0;
|
30 |
+
width: 100%;
|
31 |
+
background-color: #000;
|
32 |
+
opacity: 0;
|
33 |
+
transition: all .2s ease-in-out;
|
34 |
+
}
|
35 |
+
|
36 |
+
.wplc_block:hover:after {
|
37 |
+
height: 3px;
|
38 |
+
opacity: .2
|
39 |
+
}
|
40 |
+
|
41 |
+
.wplc_block.disabled:after {
|
42 |
+
content: "Disabled";
|
43 |
+
color:#fff;
|
44 |
+
font-size: 17px;
|
45 |
+
text-transform: uppercase;
|
46 |
+
text-align: center;
|
47 |
+
display: block;
|
48 |
+
position: absolute;
|
49 |
+
height: 100%;
|
50 |
+
width: 100%;
|
51 |
+
bottom: 0;
|
52 |
+
left: 0;
|
53 |
+
background: #ED832F;
|
54 |
+
opacity: .9;
|
55 |
+
}
|
56 |
+
|
57 |
+
.wplc_block_logo {
|
58 |
+
width: 35px;
|
59 |
+
height: 35px;
|
60 |
+
position: absolute;
|
61 |
+
left: 0;
|
62 |
+
background: #e7e7e7;
|
63 |
+
display: inline-block;
|
64 |
+
margin:0;
|
65 |
+
background-size: cover;
|
66 |
+
background-position: center;
|
67 |
+
background-color:#ED832F !important;
|
68 |
+
transition: all .2s ease-in-out;
|
69 |
+
box-sizing: border-box;
|
70 |
+
box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
|
71 |
+
-webkit-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
|
72 |
+
-moz-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
|
73 |
+
}
|
74 |
+
|
75 |
+
.wplc_block_text {
|
76 |
+
display: inline-block;
|
77 |
+
height: 100%;
|
78 |
+
margin-right: 7px;
|
79 |
+
}
|
80 |
+
|
81 |
+
.wplc_block_icon {
|
82 |
+
height: 100%;
|
83 |
+
width: 35px;
|
84 |
+
background: transparent;
|
85 |
+
display: inline-block;
|
86 |
+
}
|
87 |
+
|
88 |
+
.wplc_block_icon.disabled {
|
89 |
+
display: none;
|
90 |
+
}
|
includes/blocks/wplc-chat-box/index.php
ADDED
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* BLOCK: WP Live Chat Support Chat box
|
4 |
+
*/
|
5 |
+
|
6 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit;
|
8 |
+
}
|
9 |
+
|
10 |
+
function wplc_gutenberg_block_settings() {
|
11 |
+
add_filter('wplc_filter_setting_tabs','wplc_gutenberg_setting_tabs');
|
12 |
+
add_action("wplc_hook_settings_page_more_tabs","wplc_gutenberg_settings_content");
|
13 |
+
}
|
14 |
+
|
15 |
+
add_action('admin_init', 'wplc_gutenberg_block_settings');
|
16 |
+
|
17 |
+
function wplc_gutenberg_setting_tabs($tab_array) {
|
18 |
+
$tab_array['gutenberg'] = array(
|
19 |
+
'href' => '#tabs-gutenberg',
|
20 |
+
'icon' => 'fa fa-commenting-o',
|
21 |
+
'label' => __('Gutenberg Blocks', 'wplivechat')
|
22 |
+
);
|
23 |
+
return $tab_array;
|
24 |
+
}
|
25 |
+
|
26 |
+
function wplc_gutenberg_settings_content() {
|
27 |
+
$gutenberg_settings = get_option('wplc_gutenberg_settings');
|
28 |
+
|
29 |
+
$gutenberg_enable = ( $gutenberg_settings['wplc_gutenberg_enable'] !== null ) ? $gutenberg_settings['wplc_gutenberg_enable'] : 1;
|
30 |
+
$checked = ( @$gutenberg_enable == 1 ? 'checked' : '' );
|
31 |
+
$gutenberg_size = ( $gutenberg_settings['wplc_gutenberg_size'] ) ? $gutenberg_settings['wplc_gutenberg_size'] : 2;
|
32 |
+
$gutenberg_defail_logo = 'https://bleeper.io/app/assets/images/wplc_loading.png';
|
33 |
+
$gutenberg_logo = ( $gutenberg_settings['wplc_gutenberg_logo'] == '' ) ? $gutenberg_defail_logo : $gutenberg_settings['wplc_gutenberg_logo'];
|
34 |
+
$gutenberg_text = ( $gutenberg_settings['wplc_gutenberg_text'] ) ? $gutenberg_settings['wplc_gutenberg_text'] : 'Live Chat';
|
35 |
+
$gutenberg_icon = ( $gutenberg_settings['wplc_gutenberg_icon'] ) ? $gutenberg_settings['wplc_gutenberg_icon'] : 'fa-commenting-o';
|
36 |
+
$gutenberg_enable_icon = ( $gutenberg_settings['wplc_gutenberg_enable_icon'] !== null ) ? $gutenberg_settings['wplc_gutenberg_enable_icon'] : 1;
|
37 |
+
$icon_checked = ( @$gutenberg_enable_icon == 1 ? 'checked' : '' );
|
38 |
+
$gutenberg_custom_html = ( $gutenberg_settings['wplc_custom_html'] ) ? $gutenberg_settings['wplc_custom_html'] : '';
|
39 |
+
?>
|
40 |
+
|
41 |
+
<div id="tabs-gutenberg">
|
42 |
+
<h3><?php _e('Gutenberg Blocks', 'wplivechat') ?></h3>
|
43 |
+
<table class='form-table wp-list-table widefat fixed striped pages'>
|
44 |
+
|
45 |
+
<tr>
|
46 |
+
<td width='300' valign='top'><?php _e('Enable Gutenberg Blocks', 'wplivechat') ?>:</td>
|
47 |
+
|
48 |
+
<td>
|
49 |
+
<input type="checkbox" id="activate_block" name="activate_block" <?php echo $checked ?>/>
|
50 |
+
</td>
|
51 |
+
</tr>
|
52 |
+
|
53 |
+
<tr>
|
54 |
+
<td width='300' valign='top'><?php _e('Gutenberg Block Size', 'wplivechat') ?>:</td>
|
55 |
+
<td>
|
56 |
+
<select id="wplc_gutenberg_size" name="wplc_gutenberg_size" value="1">
|
57 |
+
<option <?php echo ($gutenberg_size == 1) ? 'selected' : ''; ?> value="1">Small</option>
|
58 |
+
<option <?php echo ($gutenberg_size == 2) ? 'selected' : ''; ?> value="2">Medium</option>
|
59 |
+
<option <?php echo ($gutenberg_size == 3) ? 'selected' : ''; ?> value="3">Large</option>
|
60 |
+
</select>
|
61 |
+
</td>
|
62 |
+
</tr>
|
63 |
+
|
64 |
+
<tr>
|
65 |
+
<td width='300' valign='top'><?php _e('Block Logo', 'wplivechat') ?>:</td>
|
66 |
+
|
67 |
+
<td>
|
68 |
+
<input type="button" id="wplc_gutenberg_upload_logo" class="btn-primary" value="Upload Logo"/>
|
69 |
+
<input type="button" id="wplc_gutenberg_remove_logo" class="btn-default" value="Reset Logo"/>
|
70 |
+
<input type="hidden" id="wplc_gutenberg_default_logo" value="<?php echo $gutenberg_defail_logo; ?>" />
|
71 |
+
<input type="hidden" id="wplc_gutenberg_logo" name="wplc_gutenberg_logo" value="<?php echo $gutenberg_logo; ?>"/>
|
72 |
+
</td>
|
73 |
+
</tr>
|
74 |
+
|
75 |
+
<tr>
|
76 |
+
<td width='300' valign='top'><?php _e('Block Text', 'wplivechat') ?>:</td>
|
77 |
+
|
78 |
+
<td>
|
79 |
+
<input type="text" id="wplc_gutenberg_text" name="wplc_gutenberg_text" placeholder="Block text" value="<?php echo $gutenberg_text ?>"/>
|
80 |
+
</td>
|
81 |
+
</tr>
|
82 |
+
|
83 |
+
<tr>
|
84 |
+
<td width='300' valign='top'><?php _e('Display Icon', 'wplivechat') ?>:<td>
|
85 |
+
<input type="checkbox" id="wplc_gutenberg_enable_icon" name="wplc_gutenberg_enable_icon" <?php echo $icon_checked; ?>/>
|
86 |
+
</td>
|
87 |
+
</tr>
|
88 |
+
|
89 |
+
<tr>
|
90 |
+
<td width='300' valign='top'><?php _e('Block Icon', 'wplivechat') ?>:</td>
|
91 |
+
|
92 |
+
<td>
|
93 |
+
<input type="text" id="wplc_gutenberg_icon" name="wplc_gutenberg_icon" placeholder="Block icon" value="<?php echo $gutenberg_icon ?>"/>
|
94 |
+
</td>
|
95 |
+
</tr>
|
96 |
+
|
97 |
+
<tr>
|
98 |
+
<td width='300' valign='top'><?php _e("Block Preview", "wplivechat") ?>:</td>
|
99 |
+
|
100 |
+
<td>
|
101 |
+
<div id="wplc-chat-box" class="wplc_gutenberg_preview"></div>
|
102 |
+
</td>
|
103 |
+
</tr>
|
104 |
+
|
105 |
+
<tr>
|
106 |
+
<td width='300' valign='top'><?php _e('Custom HTML Template', 'wplivechat') ?>:
|
107 |
+
<small><p><i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip"></i> You can use the following placeholders to add content dynamically:</p>
|
108 |
+
<p><code class="wplc_code" title="Click to copy text">{wplc_logo}</code> - <?php _e('Displays the chosen logo', 'wplivechat'); ?></p>
|
109 |
+
<p><code class="wplc_code" title="Click to copy text">{wplc_text}</code> - <?php _e('Displays the chosen custom text', 'wplivechat'); ?></p>
|
110 |
+
<p><code class="wplc_code" title="Click to copy text">{wplc_icon}</code> - <?php _e('Displays the chosen icon', 'wplivechat'); ?></p></small>
|
111 |
+
</td>
|
112 |
+
|
113 |
+
<td>
|
114 |
+
<div id='wplc_custom_html_editor'></div>
|
115 |
+
<textarea name='wplc_custom_html' id='wplc_custom_html' style='display: none;' data-editor='css' rows='12'>
|
116 |
+
<?php echo strip_tags( stripslashes( trim($gutenberg_custom_html))); ?>
|
117 |
+
</textarea>
|
118 |
+
|
119 |
+
|
120 |
+
<input type="button" id="wplc_gutenberg_reset_html" class="btn-default" value="Reset Default"/>
|
121 |
+
<select id="wplc_custom_templates">
|
122 |
+
<option selected value="0">Select a Template</option>
|
123 |
+
<option value="template_default">Default - Dark</option>
|
124 |
+
<option value="template_default_light">Default - Light</option>
|
125 |
+
<option value="template_default_tooltip">Default - Tooltip</option>
|
126 |
+
<option value="template_circle">Circle - Default</option>
|
127 |
+
<option value="template_tooltip">Circle - Tooltip</option>
|
128 |
+
<option value="template_circle_rotate">Circle - Rotating</option>
|
129 |
+
<option value="template_chat_bubble">Chat Bubble</option>
|
130 |
+
|
131 |
+
</select>
|
132 |
+
</td>
|
133 |
+
</tr>
|
134 |
+
</table>
|
135 |
+
</div>
|
136 |
+
|
137 |
+
<?php
|
138 |
+
}
|
139 |
+
|
140 |
+
add_action('wplc_hook_admin_settings_save','wplc_gutenberg_save_settings');
|
141 |
+
|
142 |
+
function wplc_gutenberg_save_settings() {
|
143 |
+
|
144 |
+
if (isset($_POST['wplc_save_settings'])) {
|
145 |
+
|
146 |
+
if (isset($_POST['activate_block'])) {
|
147 |
+
$wplc_gutenberg_data['wplc_gutenberg_enable'] = 1;
|
148 |
+
} else {
|
149 |
+
$wplc_gutenberg_data['wplc_gutenberg_enable'] = 0;
|
150 |
+
}
|
151 |
+
|
152 |
+
if (isset($_POST['wplc_gutenberg_logo']) && $_POST['wplc_gutenberg_logo'] !== '0') {
|
153 |
+
$wplc_gutenberg_data['wplc_gutenberg_logo'] = esc_attr($_POST['wplc_gutenberg_logo']);
|
154 |
+
} else {
|
155 |
+
$wplc_gutenberg_data['wplc_gutenberg_logo'] = 'https://bleeper.io/app/assets/images/wplc_loading.png';
|
156 |
+
}
|
157 |
+
|
158 |
+
if (isset($_POST['wplc_gutenberg_size']) && $_POST['wplc_gutenberg_size'] !== '0') {
|
159 |
+
$wplc_gutenberg_data['wplc_gutenberg_size'] = esc_attr($_POST['wplc_gutenberg_size']);
|
160 |
+
} else {
|
161 |
+
$wplc_gutenberg_data['wplc_gutenberg_size'] = '2';
|
162 |
+
}
|
163 |
+
|
164 |
+
if (isset($_POST['wplc_gutenberg_text']) && $_POST['wplc_gutenberg_text'] !== '0') {
|
165 |
+
$wplc_gutenberg_data['wplc_gutenberg_text'] = esc_attr($_POST['wplc_gutenberg_text']);
|
166 |
+
} else {
|
167 |
+
$wplc_gutenberg_data['wplc_gutenberg_text'] = 'Live Chat';
|
168 |
+
}
|
169 |
+
|
170 |
+
if (isset($_POST['wplc_gutenberg_icon']) && $_POST['wplc_gutenberg_icon'] !== '0') {
|
171 |
+
$wplc_gutenberg_data['wplc_gutenberg_icon'] = esc_attr($_POST['wplc_gutenberg_icon']);
|
172 |
+
} else {
|
173 |
+
$wplc_gutenberg_data['wplc_gutenberg_icon'] = 'fa-commenting-o';
|
174 |
+
}
|
175 |
+
|
176 |
+
if (isset($_POST['wplc_gutenberg_enable_icon'])) {
|
177 |
+
$wplc_gutenberg_data['wplc_gutenberg_enable_icon'] = 1;
|
178 |
+
} else {
|
179 |
+
$wplc_gutenberg_data['wplc_gutenberg_enable_icon'] = 0;
|
180 |
+
}
|
181 |
+
|
182 |
+
if (isset($_POST['wplc_custom_html']) && $_POST['wplc_custom_html'] !== '0') {
|
183 |
+
$wplc_gutenberg_data['wplc_custom_html'] = esc_attr($_POST['wplc_custom_html']);
|
184 |
+
} else {
|
185 |
+
$default_html = '\n<div class="wplc_block">\n\t<span class="wplc_block_logo">{wplc_logo}</span>\n\t<span class="wplc_block_text">{wplc_text}</span>\n\t<span class="wplc_block_icon">{wplc_icon}</span>\n</div>';
|
186 |
+
|
187 |
+
$wplc_gutenberg_data['wplc_custom_html'] = $default_html;
|
188 |
+
}
|
189 |
+
|
190 |
+
update_option('wplc_gutenberg_settings', $wplc_gutenberg_data);
|
191 |
+
}
|
192 |
+
}
|
193 |
+
|
194 |
+
add_action( 'enqueue_block_editor_assets', 'wplc_chat_box_block_editor_assets' );
|
195 |
+
|
196 |
+
function wplc_chat_box_block_editor_assets() {
|
197 |
+
// Scripts
|
198 |
+
wp_enqueue_script(
|
199 |
+
'wplc_chat_box',
|
200 |
+
plugins_url( 'block.js', __FILE__ ),
|
201 |
+
array( 'wp-blocks', 'wp-i18n', 'wp-element' ),
|
202 |
+
filemtime( plugin_dir_path( __FILE__ ) . 'block.js' )
|
203 |
+
);
|
204 |
+
|
205 |
+
$gutenberg_settings = get_option( 'wplc_gutenberg_settings' );
|
206 |
+
$gutenberg_logo = $gutenberg_settings['wplc_gutenberg_logo'];
|
207 |
+
$settings['wplc_enabled'] = $gutenberg_settings['wplc_gutenberg_enable'];
|
208 |
+
$settings['wplc_size'] = ( $gutenberg_settings['wplc_gutenberg_size'] ? esc_attr( $gutenberg_settings['wplc_gutenberg_size'] ) : 2 );
|
209 |
+
$settings['wplc_logo'] = $gutenberg_logo;
|
210 |
+
$settings['wplc_text'] = ( $gutenberg_settings['wplc_gutenberg_text'] ? esc_attr( $gutenberg_settings['wplc_gutenberg_text'] ) : __( 'Live Chat', 'wplivechat' ) );
|
211 |
+
|
212 |
+
$settings['wplc_icon'] = ( $gutenberg_settings['wplc_gutenberg_icon'] ? esc_attr( $gutenberg_settings['wplc_gutenberg_icon'] ) : 'fa-commenting-o' );
|
213 |
+
$settings['wplc_icon_enabled'] = $gutenberg_settings['wplc_gutenberg_enable_icon'];
|
214 |
+
$settings['wplc_custom_html'] = $gutenberg_settings['wplc_custom_html'];
|
215 |
+
|
216 |
+
wp_localize_script( 'wplc_chat_box', 'wplc_settings', $settings );
|
217 |
+
|
218 |
+
// Styles
|
219 |
+
wp_enqueue_style(
|
220 |
+
'wplc_chat_box-editor',
|
221 |
+
plugins_url( 'editor.css', __FILE__ ),
|
222 |
+
array( 'wp-edit-blocks' ),
|
223 |
+
filemtime( plugin_dir_path( __FILE__ ) . 'editor.css' )
|
224 |
+
);
|
225 |
+
}
|
226 |
+
|
227 |
+
add_action( 'enqueue_block_assets', 'wplc_chat_box_block_block_assets' );
|
228 |
+
|
229 |
+
function wplc_chat_box_block_block_assets() {
|
230 |
+
// Styles for front-end
|
231 |
+
wp_enqueue_style(
|
232 |
+
'wplc_chat_box-front-end',
|
233 |
+
plugins_url( 'style.css', __FILE__ ),
|
234 |
+
array( 'wp-blocks' ),
|
235 |
+
filemtime( plugin_dir_path( __FILE__ ) . 'style.css' )
|
236 |
+
);
|
237 |
+
wp_enqueue_style(
|
238 |
+
'wplc_chat_box-front-end-template', plugins_url( 'wplc_gutenberg_template_styles.css', __FILE__ ), array( 'wp-blocks' ),
|
239 |
+
filemtime( plugin_dir_path( __FILE__ ) . 'wplc_gutenberg_template_styles.css' )
|
240 |
+
);
|
241 |
+
}
|
includes/blocks/wplc-chat-box/style.css
ADDED
@@ -0,0 +1,149 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* CSS for front-end block */
|
2 |
+
#wplc-chat-box {
|
3 |
+
width: fit-content;
|
4 |
+
position: relative;
|
5 |
+
cursor: pointer;
|
6 |
+
}
|
7 |
+
|
8 |
+
.wplc_block {
|
9 |
+
position: relative;
|
10 |
+
display:inline-block;
|
11 |
+
background: #32373c;
|
12 |
+
color: #eee;
|
13 |
+
border-radius: 3px;
|
14 |
+
height: 35px;
|
15 |
+
padding-left: 45px;
|
16 |
+
margin: 5px 0 5px 0;
|
17 |
+
transition: all .2s ease-in-out;
|
18 |
+
cursor: pointer;
|
19 |
+
border-bottom: 0px solid #111;
|
20 |
+
font-size: 17px;
|
21 |
+
line-height: 35px;
|
22 |
+
}
|
23 |
+
|
24 |
+
|
25 |
+
.wplc_block:hover {
|
26 |
+
transform: translateY(-2px);
|
27 |
+
}
|
28 |
+
|
29 |
+
.wplc_block:after {
|
30 |
+
content: "";
|
31 |
+
position: absolute;
|
32 |
+
display: block;
|
33 |
+
height: 0px;
|
34 |
+
bottom: 0;
|
35 |
+
left: 0;
|
36 |
+
width: 100%;
|
37 |
+
background-color: #000;
|
38 |
+
opacity: 0;
|
39 |
+
transition: all .2s ease-in-out;
|
40 |
+
}
|
41 |
+
|
42 |
+
.wplc_block:hover:after {
|
43 |
+
height: 3px;
|
44 |
+
opacity: .2;
|
45 |
+
}
|
46 |
+
|
47 |
+
#wplc-chat-box.disabled:first-child:after {
|
48 |
+
content: "Disabled";
|
49 |
+
color:#fff;
|
50 |
+
font-size: 17px;
|
51 |
+
text-transform: uppercase;
|
52 |
+
text-align: center;
|
53 |
+
display: block;
|
54 |
+
position: absolute;
|
55 |
+
height: 100%;
|
56 |
+
width: 100%;
|
57 |
+
bottom: 0;
|
58 |
+
left: 0;
|
59 |
+
background: #ED832F;
|
60 |
+
opacity: .9;
|
61 |
+
}
|
62 |
+
|
63 |
+
.wplc_block_logo {
|
64 |
+
width: 35px;
|
65 |
+
height: 35px;
|
66 |
+
position: absolute;
|
67 |
+
left: 0;
|
68 |
+
background: #e7e7e7;
|
69 |
+
display: inline-block;
|
70 |
+
margin:0;
|
71 |
+
background-size: cover;
|
72 |
+
background-position: center;
|
73 |
+
background-color:#ED832F !important;
|
74 |
+
transition: all .2s ease-in-out;
|
75 |
+
box-sizing: border-box;
|
76 |
+
box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
|
77 |
+
-webkit-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
|
78 |
+
-moz-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
|
79 |
+
}
|
80 |
+
|
81 |
+
.wplc_block_text {
|
82 |
+
display: inline-block;
|
83 |
+
height: 100%;
|
84 |
+
margin-right: 7px;
|
85 |
+
}
|
86 |
+
|
87 |
+
.wplc_block_icon {
|
88 |
+
height: 100%;
|
89 |
+
width: 35px;
|
90 |
+
background: transparent;
|
91 |
+
display: inline-block;
|
92 |
+
}
|
93 |
+
|
94 |
+
.wplc_block_icon.disabled {
|
95 |
+
display: none;
|
96 |
+
}
|
97 |
+
|
98 |
+
/* Block size styles: small */
|
99 |
+
.wplc_block.sm {
|
100 |
+
height: 25px;
|
101 |
+
line-height: 25px;
|
102 |
+
padding-left: 30px;
|
103 |
+
font-size: 12px;
|
104 |
+
}
|
105 |
+
|
106 |
+
.wplc_block.sm:hover:after {
|
107 |
+
height: 2px;
|
108 |
+
opacity: .2;
|
109 |
+
}
|
110 |
+
|
111 |
+
.wplc_block.sm .wplc_block_logo {
|
112 |
+
height: 25px;
|
113 |
+
width: 25px;
|
114 |
+
}
|
115 |
+
|
116 |
+
.wplc_block.sm .wplc_block_text {
|
117 |
+
margin-right: 7px;
|
118 |
+
}
|
119 |
+
|
120 |
+
.wplc_block.sm .wplc_block_icon {
|
121 |
+
margin-right: 7px;
|
122 |
+
width: 13px;
|
123 |
+
}
|
124 |
+
|
125 |
+
/* Block size styles: large */
|
126 |
+
.wplc_block.lg {
|
127 |
+
height: 80px;
|
128 |
+
line-height: 80px;
|
129 |
+
padding-left: 100px;
|
130 |
+
font-size: 25px;
|
131 |
+
}
|
132 |
+
|
133 |
+
.wplc_block.lg:hover:after {
|
134 |
+
height: 6px;
|
135 |
+
opacity: .2;
|
136 |
+
}
|
137 |
+
|
138 |
+
.wplc_block.lg .wplc_block_logo {
|
139 |
+
height: 80px;
|
140 |
+
width: 80px;
|
141 |
+
}
|
142 |
+
|
143 |
+
.wplc_block.lg .wplc_block_text {
|
144 |
+
margin-right: 13px;
|
145 |
+
}
|
146 |
+
|
147 |
+
.wplc_block.lg .wplc_block_icon {
|
148 |
+
margin-right: 13px;
|
149 |
+
}
|
includes/blocks/wplc-chat-box/wplc_gutenberg_template_styles.css
ADDED
@@ -0,0 +1,366 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* WPLC Gutenber Template Styles */
|
2 |
+
|
3 |
+
#wplc-chat-box {
|
4 |
+
width: fit-content;
|
5 |
+
position: relative;
|
6 |
+
cursor: pointer;
|
7 |
+
}
|
8 |
+
|
9 |
+
.wplc_block {
|
10 |
+
position: relative;
|
11 |
+
display:inline-block;
|
12 |
+
background: #32373c;
|
13 |
+
color: #eee;
|
14 |
+
border-radius: 3px;
|
15 |
+
height: 35px;
|
16 |
+
padding-left: 45px;
|
17 |
+
margin: 5px 0 5px 0;
|
18 |
+
transition: all .2s ease-in-out;
|
19 |
+
cursor: pointer;
|
20 |
+
border-bottom: 0px solid #111;
|
21 |
+
font-size: 17px;
|
22 |
+
line-height: 35px;
|
23 |
+
}
|
24 |
+
|
25 |
+
|
26 |
+
.wplc_block:hover {
|
27 |
+
transform: translateY(-2px);
|
28 |
+
}
|
29 |
+
|
30 |
+
.wplc_block:after {
|
31 |
+
content: "";
|
32 |
+
position: absolute;
|
33 |
+
display: block;
|
34 |
+
height: 0px;
|
35 |
+
bottom: 0;
|
36 |
+
left: 0;
|
37 |
+
width: 100%;
|
38 |
+
background-color: #000;
|
39 |
+
opacity: 0;
|
40 |
+
transition: all .2s ease-in-out;
|
41 |
+
}
|
42 |
+
|
43 |
+
.wplc_block:hover:after {
|
44 |
+
height: 3px;
|
45 |
+
opacity: .2;
|
46 |
+
}
|
47 |
+
|
48 |
+
#wplc-chat-box.disabled:first-child:after {
|
49 |
+
content: "Disabled";
|
50 |
+
color:#fff;
|
51 |
+
font-size: 17px;
|
52 |
+
text-transform: uppercase;
|
53 |
+
text-align: center;
|
54 |
+
display: block;
|
55 |
+
position: absolute;
|
56 |
+
height: 100%;
|
57 |
+
width: 100%;
|
58 |
+
bottom: 0;
|
59 |
+
left: 0;
|
60 |
+
background: #ED832F;
|
61 |
+
opacity: .9;
|
62 |
+
}
|
63 |
+
|
64 |
+
.wplc_block_logo {
|
65 |
+
width: 35px;
|
66 |
+
height: 35px;
|
67 |
+
position: absolute;
|
68 |
+
left: 0;
|
69 |
+
background: #e7e7e7;
|
70 |
+
display: inline-block;
|
71 |
+
margin:0;
|
72 |
+
background-size: cover;
|
73 |
+
background-position: center;
|
74 |
+
background-color:#ED832F !important;
|
75 |
+
transition: all .2s ease-in-out;
|
76 |
+
box-sizing: border-box;
|
77 |
+
box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
|
78 |
+
-webkit-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
|
79 |
+
-moz-box-shadow: inset -2px 0px 0px 0px rgba(0,0,0,0.28);
|
80 |
+
}
|
81 |
+
|
82 |
+
.wplc_block_text {
|
83 |
+
display: inline-block;
|
84 |
+
height: 100%;
|
85 |
+
margin-right: 7px;
|
86 |
+
}
|
87 |
+
|
88 |
+
.wplc_block_icon {
|
89 |
+
height: 100%;
|
90 |
+
width: 35px;
|
91 |
+
background: transparent;
|
92 |
+
display: inline-block;
|
93 |
+
}
|
94 |
+
|
95 |
+
.wplc_block_icon.disabled {
|
96 |
+
display: none;
|
97 |
+
}
|
98 |
+
|
99 |
+
/* Block size styles: small */
|
100 |
+
.wplc_block.sm {
|
101 |
+
height: 25px;
|
102 |
+
line-height: 25px;
|
103 |
+
padding-left: 30px;
|
104 |
+
font-size: 12px;
|
105 |
+
}
|
106 |
+
|
107 |
+
.wplc_block.sm:hover:after {
|
108 |
+
height: 2px;
|
109 |
+
opacity: .2;
|
110 |
+
}
|
111 |
+
|
112 |
+
.wplc_block.sm .wplc_block_logo {
|
113 |
+
height: 25px;
|
114 |
+
width: 25px;
|
115 |
+
}
|
116 |
+
|
117 |
+
.wplc_block.sm .wplc_block_text {
|
118 |
+
margin-right: 7px;
|
119 |
+
}
|
120 |
+
|
121 |
+
.wplc_block.sm .wplc_block_icon {
|
122 |
+
margin-right: 7px;
|
123 |
+
width: 13px;
|
124 |
+
}
|
125 |
+
|
126 |
+
/* Block size styles: large */
|
127 |
+
.wplc_block.lg {
|
128 |
+
height: 80px;
|
129 |
+
line-height: 80px;
|
130 |
+
padding-left: 100px;
|
131 |
+
font-size: 25px;
|
132 |
+
}
|
133 |
+
|
134 |
+
.wplc_block.lg:hover:after {
|
135 |
+
height: 6px;
|
136 |
+
opacity: .2;
|
137 |
+
}
|
138 |
+
|
139 |
+
.wplc_block.lg .wplc_block_logo {
|
140 |
+
height: 80px;
|
141 |
+
width: 80px;
|
142 |
+
}
|
143 |
+
|
144 |
+
.wplc_block.lg .wplc_block_text {
|
145 |
+
margin-right: 13px;
|
146 |
+
}
|
147 |
+
|
148 |
+
.wplc_block.lg .wplc_block_icon {
|
149 |
+
margin-right: 13px;
|
150 |
+
}
|
151 |
+
/* Custom Templates: Default - Light */
|
152 |
+
.wplc_block.light {
|
153 |
+
background: #ECEFF1;
|
154 |
+
color: #555;
|
155 |
+
border: 1px solid #ccc;
|
156 |
+
}
|
157 |
+
|
158 |
+
/* Custom Templates: Circle */
|
159 |
+
.wplc_block.circle {
|
160 |
+
background: transparent;
|
161 |
+
width: 50px;
|
162 |
+
height: 50px;
|
163 |
+
padding: 0;
|
164 |
+
position: relative;
|
165 |
+
}
|
166 |
+
|
167 |
+
.wplc_block.circle:after {
|
168 |
+
display: none;
|
169 |
+
}
|
170 |
+
|
171 |
+
.wplc_block.circle .wplc_block_logo {
|
172 |
+
position: relative;
|
173 |
+
width: 50px;
|
174 |
+
height: 50px;
|
175 |
+
padding: 0;
|
176 |
+
border-radius: 50%;
|
177 |
+
}
|
178 |
+
|
179 |
+
.wplc_block.sm.circle {
|
180 |
+
background: transparent;
|
181 |
+
width: 35px;
|
182 |
+
height: 35px;
|
183 |
+
padding: 0;
|
184 |
+
}
|
185 |
+
|
186 |
+
.wplc_block.sm.circle:after {
|
187 |
+
display: none;
|
188 |
+
}
|
189 |
+
|
190 |
+
.wplc_block.sm.circle .wplc_block_logo {
|
191 |
+
position: relative;
|
192 |
+
width: 35px;
|
193 |
+
height: 35px;
|
194 |
+
padding: 0;
|
195 |
+
border-radius: 50%;
|
196 |
+
}
|
197 |
+
|
198 |
+
.wplc_block.lg.circle {
|
199 |
+
background: transparent;
|
200 |
+
width: 65px;
|
201 |
+
height: 65px;
|
202 |
+
padding: 0;
|
203 |
+
}
|
204 |
+
|
205 |
+
.wplc_block.lg.circle:after {
|
206 |
+
display: none;
|
207 |
+
}
|
208 |
+
|
209 |
+
.wplc_block.lg.circle .wplc_block_logo {
|
210 |
+
position: relative;
|
211 |
+
width: 65px;
|
212 |
+
height: 65px;
|
213 |
+
padding: 0;
|
214 |
+
border-radius: 50%;
|
215 |
+
}
|
216 |
+
|
217 |
+
/* Custom Templates: Tooltip */
|
218 |
+
.wplc_block:hover .wplc_block_tooltip {
|
219 |
+
top: -62px;
|
220 |
+
background: #333;
|
221 |
+
color: #fff;
|
222 |
+
opacity: .85;
|
223 |
+
display: inline-block;
|
224 |
+
}
|
225 |
+
|
226 |
+
.wplc_block_tooltip {
|
227 |
+
min-width: 100px;
|
228 |
+
border-radius: 3px;
|
229 |
+
color: transparent;
|
230 |
+
position: absolute;
|
231 |
+
line-height: 25px;
|
232 |
+
padding: 10px;
|
233 |
+
top: -50px;
|
234 |
+
left: 0;
|
235 |
+
opacity: 0;
|
236 |
+
transition: opacity .2s ease-in-out, top .2s ease-in-out;
|
237 |
+
}
|
238 |
+
|
239 |
+
.wplc_block.circle:hover .wplc_block_tooltip {
|
240 |
+
top: -75px;
|
241 |
+
display: block;
|
242 |
+
}
|
243 |
+
.wplc_block.circle.sm:hover .wplc_block_tooltip {
|
244 |
+
top: -50px;
|
245 |
+
}
|
246 |
+
|
247 |
+
.wplc_block.circle.lg:hover .wplc_block_tooltip {
|
248 |
+
top: -100px;
|
249 |
+
}
|
250 |
+
|
251 |
+
/* Custom Templates: Chat Bubble */
|
252 |
+
.wplc_block.chat_bubble:before {
|
253 |
+
content: '';
|
254 |
+
position: absolute;
|
255 |
+
width: 0;
|
256 |
+
height: 0;
|
257 |
+
left: 0px;
|
258 |
+
bottom: -10px;
|
259 |
+
border: 8px solid;
|
260 |
+
border-color: #32373c transparent transparent #32373c;
|
261 |
+
}
|
262 |
+
|
263 |
+
.wplc_block.chat_bubble:hover:after {
|
264 |
+
content: '';
|
265 |
+
position: absolute;
|
266 |
+
width: 0;
|
267 |
+
height: 0;
|
268 |
+
}
|
269 |
+
|
270 |
+
.wplc_block.chat_bubble {
|
271 |
+
padding-left: 10px;
|
272 |
+
padding-right: 40px;
|
273 |
+
border-radius: 7px 7px 7px 0;
|
274 |
+
}
|
275 |
+
|
276 |
+
.wplc_block.chat_bubble .wplc_block_logo {
|
277 |
+
border:none;
|
278 |
+
right: 0px;
|
279 |
+
left: initial;
|
280 |
+
border-radius: 0 7px 7px 0;
|
281 |
+
}
|
282 |
+
|
283 |
+
.wplc_block.chat_bubble.sm {
|
284 |
+
padding-left: 10px;
|
285 |
+
padding-right: 25px;
|
286 |
+
}
|
287 |
+
|
288 |
+
.wplc_block.chat_bubble.lg {
|
289 |
+
padding-left: 20px;
|
290 |
+
padding-right: 80px;
|
291 |
+
}
|
292 |
+
|
293 |
+
/* Custom Templates: Rotating circle */
|
294 |
+
.wplc_block.rotate {
|
295 |
+
transform:rotate(0deg);
|
296 |
+
}
|
297 |
+
|
298 |
+
.wplc_block.rotate:hover {
|
299 |
+
transition: all .3s ease-in-out;
|
300 |
+
transform:rotate(-90deg);
|
301 |
+
}
|
302 |
+
|
303 |
+
.wplc_block.rotate .wplc_block_icon {
|
304 |
+
position: relative;
|
305 |
+
height: 100%;
|
306 |
+
width: 100%;
|
307 |
+
text-align: center;
|
308 |
+
font-size: 30px;
|
309 |
+
transform: rotate(90deg);
|
310 |
+
line-height: 150%;
|
311 |
+
}
|
312 |
+
|
313 |
+
.wplc_block.rotate .wplc_block_logo {
|
314 |
+
z-index: 10;
|
315 |
+
position: absolute;
|
316 |
+
}
|
317 |
+
.wplc_block.rotate {
|
318 |
+
border-radius: 50%;
|
319 |
+
background: #32373c;
|
320 |
+
}
|
321 |
+
|
322 |
+
.wplc_block.rotate .wplc_block_logo:hover {
|
323 |
+
opacity: 0;
|
324 |
+
}
|
325 |
+
|
326 |
+
.wplc_block.circle.rotate.lg .wplc_block_logo {
|
327 |
+
padding: 0;
|
328 |
+
margin: 0;
|
329 |
+
position:absolute;
|
330 |
+
}
|
331 |
+
|
332 |
+
.wplc_block.circle.rotate.lg {
|
333 |
+
background: #32373c;
|
334 |
+
}
|
335 |
+
|
336 |
+
.wplc_block.rotate.lg .wplc_block_icon {
|
337 |
+
position: relative;
|
338 |
+
height: 100%;
|
339 |
+
width: 100%;
|
340 |
+
text-align: center;
|
341 |
+
font-size: 30px;
|
342 |
+
transform: rotate(90deg);
|
343 |
+
line-height: 225%;
|
344 |
+
padding-right: 10px;
|
345 |
+
}
|
346 |
+
|
347 |
+
.wplc_block.circle.rotate.sm .wplc_block_logo {
|
348 |
+
padding: 0;
|
349 |
+
margin: 0;
|
350 |
+
position:absolute;
|
351 |
+
}
|
352 |
+
|
353 |
+
.wplc_block.circle.rotate.sm {
|
354 |
+
background: #32373c;
|
355 |
+
}
|
356 |
+
|
357 |
+
.wplc_block.rotate.sm .wplc_block_icon {
|
358 |
+
position: relative;
|
359 |
+
height: 100%;
|
360 |
+
width: 100%;
|
361 |
+
text-align: center;
|
362 |
+
font-size: 20px;
|
363 |
+
transform: rotate(90deg);
|
364 |
+
line-height: 100%;
|
365 |
+
right:5px;
|
366 |
+
}
|
includes/credits.php
CHANGED
@@ -4,57 +4,86 @@
|
|
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://
|
8 |
Nick Duncan</a>
|
9 |
-
<span class="title"><?php _e("Founder
|
|
|
|
|
|
|
|
|
|
|
10 |
</li>
|
11 |
</ul>
|
12 |
<h3 class="wp-people-group"><?php _e("Contributors","wplivechat"); ?></h3>
|
13 |
<ul class="wp-people-group " id="wp-people-group-core-developers">
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
</li>
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
23 |
</li>
|
|
|
|
|
24 |
<li class="wp-person" id="wp-person-nathanmiller">
|
25 |
-
<a href="https://profiles.wordpress.org/nathan-miller/" target="_BLANK" class="web"><img src="https://
|
26 |
Nathan Miller</a>
|
27 |
<span class="title"><?php _e("Support","wplivechat"); ?></span>
|
28 |
</li>
|
29 |
-
|
30 |
-
<a href="https://profiles.wordpress.org/andrewza/" target="_BLANK" class="web"><img src="https://en.gravatar.com/avatar/dbd24c87ac41577d55fab74f8604159b?s=60&d=mm&r=g" srcset="http://1.gravatar.com/avatar/76424a001dc6b3ebb4faca0c567800c4?s=120&d=mm&r=g 2x" class="gravatar" alt="">
|
31 |
-
Andrew Lima</a>
|
32 |
-
<span class="title"><?php _e("Developer & Support","wplivechat"); ?></span>
|
33 |
-
</li>
|
34 |
-
<li class="wp-person" id="wp-person-travislima">
|
35 |
-
<a href="https://profiles.wordpress.org/travislima/" target="_BLANK" class="web"><img src="https://en.gravatar.com/avatar/33eb56e7f32e4561965dd7f2ec57430d?s=60&d=mm&r=g" srcset="http://1.gravatar.com/avatar/76424a001dc6b3ebb4faca0c567800c4?s=120&d=mm&r=g 2x" class="gravatar" alt="">
|
36 |
-
Travis Lima</a>
|
37 |
-
<span class="title"><?php _e("Support","wplivechat"); ?></span>
|
38 |
-
</li>
|
39 |
<li class="wp-person" id="wp-person-tamduncan">
|
40 |
-
<a href="https://twitter.com/thebossybabe" target="_BLANK" class="web"><img src="https://
|
41 |
Tam Duncan</a>
|
42 |
<span class="title"><?php _e("Marketing","wplivechat"); ?></span>
|
43 |
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
<li class="wp-person" id="wp-person-veroniquesmit">
|
45 |
-
<a href="https://twitter.com/veroniqs19" target="_BLANK" class="web"><img src="https://
|
46 |
Veronique Smit</a>
|
47 |
<span class="title"><?php _e("Marketing & Support","wplivechat"); ?></span>
|
48 |
</li>
|
49 |
-
|
50 |
-
<a href="https://twitter.com/SteveGriesel" target="_BLANK" class="web"><img src="https://en.gravatar.com/avatar/ed67fe71c0388e17901d711afd8d08b4?s=60&d=mm&r=g" srcset="http://1.gravatar.com/avatar/76424a001dc6b3ebb4faca0c567800c4?s=120&d=mm&r=g 2x" class="gravatar" alt="">
|
51 |
-
Stephan Griesel</a>
|
52 |
-
<span class="title"><?php _e("Support","wplivechat"); ?></span>
|
53 |
-
</li>
|
54 |
<li class="wp-person" id="wp-person-patdumond">
|
55 |
<a href="https://twitter.com/pad2013" target="_BLANK" class="web"><img src="https://en.gravatar.com/avatar/c1aa6c52ca1f5948aba6c9f4aee18de1?s=60&d=mm&r=g" srcset="http://1.gravatar.com/avatar/c1aa6c52ca1f5948aba6c9f4aee18de1?s=120&d=mm&r=g 2x" class="gravatar" alt="">
|
56 |
Patricia Dumond</a>
|
57 |
-
<span class="title"><?php _e("
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
</li>
|
59 |
|
60 |
<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>
|
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 & 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&d=mm&r=g" srcset="http://1.gravatar.com/avatar/c1aa6c52ca1f5948aba6c9f4aee18de1?s=120&d=mm&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>
|
includes/deprecated.php
CHANGED
File without changes
|
includes/feedback-page.php
CHANGED
File without changes
|
includes/modal_control.php
CHANGED
@@ -49,8 +49,9 @@ add_action('admin_print_scripts', 'wplc_admin_modal_javascript');
|
|
49 |
* @return void
|
50 |
*/
|
51 |
function wplc_admin_modal_javascript(){
|
|
|
52 |
if(isset($_GET['page']) && $_GET['page'] == 'wplivechat-menu'){
|
53 |
-
wp_register_script('wplc-admin-modal-js', plugins_url('../js/wplc-admin-modal.js', __FILE__));
|
54 |
wp_enqueue_script('wplc-admin-modal-js');
|
55 |
}
|
56 |
}
|
49 |
* @return void
|
50 |
*/
|
51 |
function wplc_admin_modal_javascript(){
|
52 |
+
global $wplc_version;
|
53 |
if(isset($_GET['page']) && $_GET['page'] == 'wplivechat-menu'){
|
54 |
+
wp_register_script('wplc-admin-modal-js', plugins_url('../js/wplc-admin-modal.js', __FILE__), array(), $wplc_version);
|
55 |
wp_enqueue_script('wplc-admin-modal-js');
|
56 |
}
|
57 |
}
|
includes/notification_control.php
CHANGED
File without changes
|
includes/settings_page.php
CHANGED
@@ -128,10 +128,10 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
|
|
128 |
|
129 |
</ul>
|
130 |
<div id="tabs-1">
|
131 |
-
<h3><?php _e("
|
132 |
<table class='wp-list-table widefat fixed striped pages' width='700'>
|
133 |
<tr>
|
134 |
-
<td width='
|
135 |
<td>
|
136 |
<select id='wplc_settings_enabled' name='wplc_settings_enabled'>
|
137 |
<option value="1" <?php if (isset($wplc_settings_enabled[1])) { echo $wplc_settings_enabled[1]; } ?>><?php _e("Yes","wplivechat"); ?></option>
|
@@ -216,7 +216,7 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
|
|
216 |
</td>
|
217 |
</tr>
|
218 |
<tr>
|
219 |
-
<td width='
|
220 |
<?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>
|
221 |
</td>
|
222 |
<td valign='top'>
|
@@ -241,7 +241,7 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
|
|
241 |
</tr>
|
242 |
<tr>
|
243 |
<td width='300' valign='top'>
|
244 |
-
<?php _e("Enable chat notifications on all admin pages","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("This will
|
245 |
</td>
|
246 |
<td valign='top'>
|
247 |
<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"; } ?> />
|
@@ -497,6 +497,27 @@ if (get_option("WPLC_HIDE_CHAT") == true) {
|
|
497 |
<input type="text" name="wplc_redirect_thank_you_url" value="<?php echo (isset($wplc_settings['wplc_redirect_thank_you_url']) ? urldecode($wplc_settings['wplc_redirect_thank_you_url']) : '' ); ?>" placeholder="<?php _e('Thank You Page URL', 'wplivechat'); ?>" />
|
498 |
</td>
|
499 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
500 |
</table>
|
501 |
|
502 |
<?php if(!function_exists("wplc_chat_social_div") && !function_exists("wplc_pro_activate")){ ?>
|
128 |
|
129 |
</ul>
|
130 |
<div id="tabs-1">
|
131 |
+
<h3><?php _e("General Settings",'wplivechat')?></h3>
|
132 |
<table class='wp-list-table widefat fixed striped pages' width='700'>
|
133 |
<tr>
|
134 |
+
<td width='350' valign='top'><?php _e("Chat enabled","wplivechat")?>: </td>
|
135 |
<td>
|
136 |
<select id='wplc_settings_enabled' name='wplc_settings_enabled'>
|
137 |
<option value="1" <?php if (isset($wplc_settings_enabled[1])) { echo $wplc_settings_enabled[1]; } ?>><?php _e("Yes","wplivechat"); ?></option>
|
216 |
</td>
|
217 |
</tr>
|
218 |
<tr>
|
219 |
+
<td width='350' valign='top'>
|
220 |
<?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>
|
221 |
</td>
|
222 |
<td valign='top'>
|
241 |
</tr>
|
242 |
<tr>
|
243 |
<td width='300' valign='top'>
|
244 |
+
<?php _e("Enable chat dashboard and notifications on all admin pages","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("This will load the chat dashboard on every admin page.", "wplivechat") ?>"></i>
|
245 |
</td>
|
246 |
<td valign='top'>
|
247 |
<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"; } ?> />
|
497 |
<input type="text" name="wplc_redirect_thank_you_url" value="<?php echo (isset($wplc_settings['wplc_redirect_thank_you_url']) ? urldecode($wplc_settings['wplc_redirect_thank_you_url']) : '' ); ?>" placeholder="<?php _e('Thank You Page URL', 'wplivechat'); ?>" />
|
498 |
</td>
|
499 |
</tr>
|
500 |
+
<?php
|
501 |
+
if(defined('WPLC_LIVE_CHAT_SUPPORT_PRO_LOADED'))
|
502 |
+
{
|
503 |
+
?>
|
504 |
+
<tr>
|
505 |
+
<td>
|
506 |
+
<?php
|
507 |
+
_e('Disable Emojis', 'wplivechat');
|
508 |
+
?>
|
509 |
+
</td>
|
510 |
+
<td>
|
511 |
+
<input type="checkbox" name="wplc_disable_emojis"
|
512 |
+
<?php
|
513 |
+
if(!empty($wplc_settings['wplc_disable_emojis']))
|
514 |
+
echo 'checked="checked"';
|
515 |
+
?>
|
516 |
+
/>
|
517 |
+
</tr>
|
518 |
+
<?php
|
519 |
+
}
|
520 |
+
?>
|
521 |
</table>
|
522 |
|
523 |
<?php if(!function_exists("wplc_chat_social_div") && !function_exists("wplc_pro_activate")){ ?>
|
includes/surveys.php
CHANGED
@@ -5,38 +5,37 @@ function wplc_survey_filter_control_setting_tabs($tab_array) {
|
|
5 |
$tab_array['survey'] = array(
|
6 |
"href" => "#tabs-survey",
|
7 |
"icon" => 'fa fa-comment',
|
8 |
-
"label" => __("Surveys","wplivechat")
|
9 |
);
|
10 |
return $tab_array;
|
11 |
}
|
12 |
|
13 |
|
14 |
-
|
15 |
add_action("wplc_hook_settings_page_more_tabs","wplc_survey_hook_control_settings_page_more_tabs");
|
16 |
function wplc_survey_hook_control_settings_page_more_tabs() {
|
17 |
$wplc_survey_data = get_option("WPLC_SURVEY_SETTINGS");
|
18 |
$wplc_settings = get_option('WPLC_SETTINGS');
|
19 |
?>
|
20 |
<div id="tabs-survey">
|
21 |
-
<h3><?php _e("Surveys", "wplivechat") ?></h3>
|
22 |
<table class='form-table wp-list-table widefat fixed striped pages'>
|
23 |
<tr>
|
24 |
-
<td width='300' valign='top'><?php _e("Enable Surveys", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e('Enable surveys within your live chat box, either before or after a live chat session.', 'wplivechat'); ?>"></i></td>
|
25 |
<td>
|
26 |
<input type="checkbox" name="wplc_enable_surveys" id="wplc_enable_surveys" value="1" <?php if(isset($wplc_survey_data['wplc_enable_surveys']) && $wplc_survey_data['wplc_enable_surveys'] == 1){ echo 'checked'; } ?>/>
|
27 |
</td>
|
28 |
</tr>
|
29 |
<tr>
|
30 |
-
<td>Select a survey
|
31 |
<td><?php
|
32 |
-
$surveys =
|
33 |
$link1 = sprintf( __( 'No surveys created. Please <a href="%s" target="_BLANK" title="NimbleSquirrel">create a survey and then refresh this page.</a>', 'wplivechat' ),
|
34 |
'http://app.nimblesquirrel.com/?utm_source=wplc&utm_medium=click&utm_campaign=no_surveys'
|
35 |
);
|
36 |
if( $surveys ){
|
37 |
$surveys = json_decode( $surveys );
|
38 |
if( $surveys ){
|
39 |
-
echo "<select name='nimble_survey'>";
|
40 |
echo "<option value='0'>".__('Select a survey', 'nimble-squirrel')."</option>";
|
41 |
$cnt = 0;
|
42 |
foreach( $surveys as $survey ){
|
@@ -63,7 +62,39 @@ function wplc_survey_hook_control_settings_page_more_tabs() {
|
|
63 |
?></td>
|
64 |
</tr>
|
65 |
<tr>
|
66 |
-
<td
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
<td>
|
68 |
<select name='survey_display'>
|
69 |
<option value='1' <?php if (isset($wplc_survey_data['survey_display']) && $wplc_survey_data['survey_display'] == "1") { echo 'selected'; }?>><?php _e("Before chat","wplivechat"); ?></option>
|
@@ -85,9 +116,15 @@ function wplc_survey_hook_control_settings_page_more_tabs() {
|
|
85 |
</tr>
|
86 |
</table>
|
87 |
</div>
|
88 |
-
|
|
|
|
|
|
|
|
|
|
|
89 |
}
|
90 |
|
|
|
91 |
add_action('wplc_hook_admin_settings_save','wplc_survey_save_settings');
|
92 |
function wplc_survey_save_settings() {
|
93 |
if (isset($_POST['wplc_save_settings'])) {
|
@@ -101,6 +138,11 @@ function wplc_survey_save_settings() {
|
|
101 |
} else {
|
102 |
$wplc_survey_data['survey'] = null;
|
103 |
}
|
|
|
|
|
|
|
|
|
|
|
104 |
if (isset($_POST['survey_user']) && $_POST['survey_user'] !== '0') {
|
105 |
$wplc_survey_data['survey_user'] = esc_attr($_POST['survey_user']);
|
106 |
} else {
|
@@ -117,7 +159,8 @@ function wplc_survey_save_settings() {
|
|
117 |
}
|
118 |
}
|
119 |
|
120 |
-
|
|
|
121 |
$nimble_api = 'http://nimblesquirrel.com/api/wordpress.php';
|
122 |
|
123 |
$response = wp_remote_post( $nimble_api,
|
@@ -125,7 +168,7 @@ function wplc_return_nimble_surveys() {
|
|
125 |
'method' => 'POST',
|
126 |
'body' => array(
|
127 |
'wordpress_plugin' => 1,
|
128 |
-
'action' =>
|
129 |
'siteurl' => site_url()
|
130 |
)
|
131 |
)
|
@@ -140,6 +183,7 @@ function wplc_return_nimble_surveys() {
|
|
140 |
}
|
141 |
}
|
142 |
|
|
|
143 |
add_filter("wplc_filter_live_chat_box_pre_layer1","wplc_filter_control_live_chat_box_pre_layer1",10,1);
|
144 |
function wplc_filter_control_live_chat_box_pre_layer1($content) {
|
145 |
$settings = get_option('WPLC_SURVEY_SETTINGS');
|
@@ -158,6 +202,9 @@ function wplc_is_survey_enabled() {
|
|
158 |
$cnt = 0;
|
159 |
if (isset($wplc_survey_data['wplc_enable_surveys']) && $wplc_survey_data['wplc_enable_surveys'] == "1") { $cnt++; }
|
160 |
if (isset($wplc_survey_data['survey']) && $wplc_survey_data['survey'] !== null) { $cnt++; }
|
|
|
|
|
|
|
161 |
|
162 |
if ($cnt >= 2) { return true; }
|
163 |
else { return false; }
|
@@ -173,8 +220,10 @@ function wplc_nimble_load_scripts() {
|
|
173 |
|
174 |
if( isset( $settings['survey_user'] ) ){ $ns_id = $settings['survey_user']; } else { $ns_id = ''; }
|
175 |
if( isset( $settings['survey'] ) ){ $ns_sid = $settings['survey']; } else { $ns_sid = ''; }
|
|
|
176 |
|
177 |
-
wp_enqueue_script( 'nimble-squirrel-user-script', '//nimblesquirrel.com/api/nimblesquirrel.js', array(), '1.0.0', true );
|
|
|
178 |
wp_localize_script( 'nimble-squirrel-user-script', 'ns_id', $ns_id );
|
179 |
|
180 |
|
@@ -195,7 +244,6 @@ function wplc_nimble_load_scripts() {
|
|
195 |
$clear_div = '0';
|
196 |
$hide_div = 'wp-live-chat-2-inner';
|
197 |
wp_localize_script( 'nimble-squirrel-user-script', 'ns_hide_div', $hide_div );
|
198 |
-
|
199 |
}
|
200 |
}
|
201 |
else if($wplc_newtheme == 'theme-2') {
|
@@ -219,7 +267,14 @@ function wplc_nimble_load_scripts() {
|
|
219 |
|
220 |
|
221 |
wp_localize_script( 'nimble-squirrel-user-script', 'ns_hide_min', '1' );
|
222 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
wp_localize_script( 'nimble-squirrel-user-script', 'ns_clear_div', $clear_div );
|
224 |
|
225 |
|
@@ -282,12 +337,12 @@ function wplc_admin_survey_layout() {
|
|
282 |
$settings = get_option('WPLC_SURVEY_SETTINGS');
|
283 |
|
284 |
echo"<div class=\"wrap\">";
|
285 |
-
echo "<h1>" . __("WP Live Chat Surveys with Nimble Squirrel", "wplivechat") . "</h1>";
|
286 |
echo "<div style='width:100%; display:block; overflow:auto; background-color:#FFF; padding:10px; border-radius:10px;'>";
|
287 |
|
288 |
|
289 |
if( isset( $settings['wplc_enable_surveys'] ) && intval($settings['wplc_enable_surveys']) == 1 ){
|
290 |
-
echo "<h2>".__("Surveys","wplivechat")."</h2>";
|
291 |
echo "<p>".__("To view your responses, click the button below and log in to your NimbleSquirrel account.","wplivechat")."</p>";
|
292 |
echo "<a href='http://app.nimblesquirrel.com/?utm_source=wplc&utm_medium=click&utm_campaign=view_responses' target='_BLANK' class='button button-primary'>View your responses</a>";
|
293 |
echo "<p> </p>";
|
5 |
$tab_array['survey'] = array(
|
6 |
"href" => "#tabs-survey",
|
7 |
"icon" => 'fa fa-comment',
|
8 |
+
"label" => __("Surveys & Lead Forms","wplivechat")
|
9 |
);
|
10 |
return $tab_array;
|
11 |
}
|
12 |
|
13 |
|
|
|
14 |
add_action("wplc_hook_settings_page_more_tabs","wplc_survey_hook_control_settings_page_more_tabs");
|
15 |
function wplc_survey_hook_control_settings_page_more_tabs() {
|
16 |
$wplc_survey_data = get_option("WPLC_SURVEY_SETTINGS");
|
17 |
$wplc_settings = get_option('WPLC_SETTINGS');
|
18 |
?>
|
19 |
<div id="tabs-survey">
|
20 |
+
<h3><?php _e("Surveys & Lead Forms", "wplivechat") ?></h3>
|
21 |
<table class='form-table wp-list-table widefat fixed striped pages'>
|
22 |
<tr>
|
23 |
+
<td width='300' valign='top'><?php _e("Enable Surveys & Lead Forms", "wplivechat") ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e('Enable surveys and lead forms within your live chat box, either before or after a live chat session.', 'wplivechat'); ?>"></i></td>
|
24 |
<td>
|
25 |
<input type="checkbox" name="wplc_enable_surveys" id="wplc_enable_surveys" value="1" <?php if(isset($wplc_survey_data['wplc_enable_surveys']) && $wplc_survey_data['wplc_enable_surveys'] == 1){ echo 'checked'; } ?>/>
|
26 |
</td>
|
27 |
</tr>
|
28 |
<tr>
|
29 |
+
<td>Select a survey: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e('Choosing a survey will reset the lead form selection: the items are alternatives, if you select a survey no lead form can be selected.', 'wplivechat'); ?>"></i></td>
|
30 |
<td><?php
|
31 |
+
$surveys = wplc_return_nimble_surveys_forms('return_surveys');
|
32 |
$link1 = sprintf( __( 'No surveys created. Please <a href="%s" target="_BLANK" title="NimbleSquirrel">create a survey and then refresh this page.</a>', 'wplivechat' ),
|
33 |
'http://app.nimblesquirrel.com/?utm_source=wplc&utm_medium=click&utm_campaign=no_surveys'
|
34 |
);
|
35 |
if( $surveys ){
|
36 |
$surveys = json_decode( $surveys );
|
37 |
if( $surveys ){
|
38 |
+
echo "<select name='nimble_survey' id='nimble_survey'>";
|
39 |
echo "<option value='0'>".__('Select a survey', 'nimble-squirrel')."</option>";
|
40 |
$cnt = 0;
|
41 |
foreach( $surveys as $survey ){
|
62 |
?></td>
|
63 |
</tr>
|
64 |
<tr>
|
65 |
+
<td>Select a lead form: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e('Choosing a lead form will reset the survey selection: the items are alternatives, if you select a lead form no survey can be selected.', 'wplivechat'); ?>"></i></td>
|
66 |
+
<td><?php
|
67 |
+
$lead_forms = wplc_return_nimble_surveys_forms('return_leads');
|
68 |
+
$link1 = sprintf( __( 'No lead forms created. Please <a href="%s" target="_BLANK" title="NimbleSquirrel">create a lead form and then refresh this page.</a>', 'wplivechat' ),
|
69 |
+
'http://app.nimblesquirrel.com/?utm_source=wplc&utm_medium=click&utm_campaign=no_surveys'
|
70 |
+
);
|
71 |
+
if( $lead_forms ){
|
72 |
+
$lead_forms = json_decode( $lead_forms );
|
73 |
+
if( $lead_forms ){
|
74 |
+
echo "<select name='nimble_lead_form' id='nimble_lead_form'>";
|
75 |
+
echo "<option value='0'>".__('Select a lead form', 'nimble-squirrel')."</option>";
|
76 |
+
$cnt = 0;
|
77 |
+
foreach( $lead_forms as $lead_form ){
|
78 |
+
$nimble_user_id = $lead_form->uid;
|
79 |
+
if (isset($lead_form->name)) {
|
80 |
+
$cnt++;
|
81 |
+
if( isset( $wplc_survey_data['lead_form'] ) && $wplc_survey_data['lead_form'] == $lead_form->id ){ $sel = 'selected'; } else { $sel = ''; }
|
82 |
+
echo "<option value='".$lead_form->id."' $sel>".$lead_form->name."</option>";
|
83 |
+
}
|
84 |
+
}
|
85 |
+
echo "</select>";
|
86 |
+
if ($cnt == 0) { echo "<p>".$link1."</p>"; }
|
87 |
+
} else {
|
88 |
+
echo "<p>".$link1."</p>";
|
89 |
+
}
|
90 |
+
} else {
|
91 |
+
echo "<p>".$link1."</p>";
|
92 |
+
}
|
93 |
+
?>
|
94 |
+
</td>
|
95 |
+
</tr>
|
96 |
+
<tr>
|
97 |
+
<td><?php _e("Display survey/form","wplivechat"); ?></td>
|
98 |
<td>
|
99 |
<select name='survey_display'>
|
100 |
<option value='1' <?php if (isset($wplc_survey_data['survey_display']) && $wplc_survey_data['survey_display'] == "1") { echo 'selected'; }?>><?php _e("Before chat","wplivechat"); ?></option>
|
116 |
</tr>
|
117 |
</table>
|
118 |
</div>
|
119 |
+
|
120 |
+
<?php
|
121 |
+
|
122 |
+
global $wplc_version;
|
123 |
+
wp_register_script('wplc-lead-form-script', plugins_url('/js/wplc_lead_forms.js', __DIR__),array('jquery'),$wplc_version);
|
124 |
+
wp_enqueue_script('wplc-lead-form-script');
|
125 |
}
|
126 |
|
127 |
+
|
128 |
add_action('wplc_hook_admin_settings_save','wplc_survey_save_settings');
|
129 |
function wplc_survey_save_settings() {
|
130 |
if (isset($_POST['wplc_save_settings'])) {
|
138 |
} else {
|
139 |
$wplc_survey_data['survey'] = null;
|
140 |
}
|
141 |
+
if (isset($_POST['nimble_lead_form']) && $_POST['nimble_lead_form'] !== '0') {
|
142 |
+
$wplc_survey_data['lead_form'] = esc_attr($_POST['nimble_lead_form']);
|
143 |
+
} else {
|
144 |
+
$wplc_survey_data['lead_form'] = null;
|
145 |
+
}
|
146 |
if (isset($_POST['survey_user']) && $_POST['survey_user'] !== '0') {
|
147 |
$wplc_survey_data['survey_user'] = esc_attr($_POST['survey_user']);
|
148 |
} else {
|
159 |
}
|
160 |
}
|
161 |
|
162 |
+
|
163 |
+
function wplc_return_nimble_surveys_forms($action) {
|
164 |
$nimble_api = 'http://nimblesquirrel.com/api/wordpress.php';
|
165 |
|
166 |
$response = wp_remote_post( $nimble_api,
|
168 |
'method' => 'POST',
|
169 |
'body' => array(
|
170 |
'wordpress_plugin' => 1,
|
171 |
+
'action' => $action,
|
172 |
'siteurl' => site_url()
|
173 |
)
|
174 |
)
|
183 |
}
|
184 |
}
|
185 |
|
186 |
+
|
187 |
add_filter("wplc_filter_live_chat_box_pre_layer1","wplc_filter_control_live_chat_box_pre_layer1",10,1);
|
188 |
function wplc_filter_control_live_chat_box_pre_layer1($content) {
|
189 |
$settings = get_option('WPLC_SURVEY_SETTINGS');
|
202 |
$cnt = 0;
|
203 |
if (isset($wplc_survey_data['wplc_enable_surveys']) && $wplc_survey_data['wplc_enable_surveys'] == "1") { $cnt++; }
|
204 |
if (isset($wplc_survey_data['survey']) && $wplc_survey_data['survey'] !== null) { $cnt++; }
|
205 |
+
if (isset($wplc_survey_data['lead_form']) && $wplc_survey_data['lead_form'] !== null) { $cnt++; }
|
206 |
+
|
207 |
+
$cnt = apply_filter('wplc_filter_list_chats_actions');
|
208 |
|
209 |
if ($cnt >= 2) { return true; }
|
210 |
else { return false; }
|
220 |
|
221 |
if( isset( $settings['survey_user'] ) ){ $ns_id = $settings['survey_user']; } else { $ns_id = ''; }
|
222 |
if( isset( $settings['survey'] ) ){ $ns_sid = $settings['survey']; } else { $ns_sid = ''; }
|
223 |
+
if( isset( $settings['lead_form'] ) ){ $ns_lfid = $settings['lead_form']; } else { $ns_lfid = ''; }
|
224 |
|
225 |
+
//wp_enqueue_script( 'nimble-squirrel-user-script', '//nimblesquirrel.com/api/nimblesquirrel.js', array(), '1.0.0', true );
|
226 |
+
wp_enqueue_script( 'nimble-squirrel-user-script', '//nimblesquirrel.com/api/v2.0/nimblesquirrel.js', array(), '1.0.0', true );
|
227 |
wp_localize_script( 'nimble-squirrel-user-script', 'ns_id', $ns_id );
|
228 |
|
229 |
|
244 |
$clear_div = '0';
|
245 |
$hide_div = 'wp-live-chat-2-inner';
|
246 |
wp_localize_script( 'nimble-squirrel-user-script', 'ns_hide_div', $hide_div );
|
|
|
247 |
}
|
248 |
}
|
249 |
else if($wplc_newtheme == 'theme-2') {
|
267 |
|
268 |
|
269 |
wp_localize_script( 'nimble-squirrel-user-script', 'ns_hide_min', '1' );
|
270 |
+
|
271 |
+
if ( '' != $ns_sid ) {
|
272 |
+
wp_localize_script( 'nimble-squirrel-user-script', 'ns_sid', $ns_sid );
|
273 |
+
}
|
274 |
+
else {
|
275 |
+
wp_localize_script( 'nimble-squirrel-user-script', 'ns_lfid', $ns_lfid );
|
276 |
+
}
|
277 |
+
|
278 |
wp_localize_script( 'nimble-squirrel-user-script', 'ns_clear_div', $clear_div );
|
279 |
|
280 |
|
337 |
$settings = get_option('WPLC_SURVEY_SETTINGS');
|
338 |
|
339 |
echo"<div class=\"wrap\">";
|
340 |
+
echo "<h1>" . __("WP Live Chat Surveys & Lead Forms with Nimble Squirrel", "wplivechat") . "</h1>";
|
341 |
echo "<div style='width:100%; display:block; overflow:auto; background-color:#FFF; padding:10px; border-radius:10px;'>";
|
342 |
|
343 |
|
344 |
if( isset( $settings['wplc_enable_surveys'] ) && intval($settings['wplc_enable_surveys']) == 1 ){
|
345 |
+
echo "<h2>".__("Surveys & Lead Forms","wplivechat")."</h2>";
|
346 |
echo "<p>".__("To view your responses, click the button below and log in to your NimbleSquirrel account.","wplivechat")."</p>";
|
347 |
echo "<a href='http://app.nimblesquirrel.com/?utm_source=wplc&utm_medium=click&utm_campaign=view_responses' target='_BLANK' class='button button-primary'>View your responses</a>";
|
348 |
echo "<p> </p>";
|
includes/update_control.class.php
CHANGED
@@ -144,6 +144,7 @@ final class wplc_update_control {
|
|
144 |
'api_key' => get_option($this->wplc_option)
|
145 |
));
|
146 |
$response = wp_remote_post($this->wplc_api_url, $data_array);
|
|
|
147 |
if (is_array($response)) {
|
148 |
if ( $response['response']['code'] == "200" ) {
|
149 |
$data = $response['body'];
|
@@ -178,6 +179,7 @@ final class wplc_update_control {
|
|
178 |
|
179 |
|
180 |
if (function_exists("wplc_build_api_check")) { return wplc_build_api_check($page_content,$data_array); }
|
|
|
181 |
return $page_content;
|
182 |
|
183 |
}
|
144 |
'api_key' => get_option($this->wplc_option)
|
145 |
));
|
146 |
$response = wp_remote_post($this->wplc_api_url, $data_array);
|
147 |
+
|
148 |
if (is_array($response)) {
|
149 |
if ( $response['response']['code'] == "200" ) {
|
150 |
$data = $response['body'];
|
179 |
|
180 |
|
181 |
if (function_exists("wplc_build_api_check")) { return wplc_build_api_check($page_content,$data_array); }
|
182 |
+
|
183 |
return $page_content;
|
184 |
|
185 |
}
|
includes/welcome_page.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php //global $wpgmza_global_array; ?>
|
2 |
<div class="wrap about-wrap">
|
3 |
<p> </p>
|
4 |
-
<h1 style='margin-right: 0;'><?php _e("Welcome to WP Live Chat Support
|
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 |
|
@@ -30,38 +30,57 @@
|
|
30 |
|
31 |
</h2>
|
32 |
<?php if( !isset( $_GET['action'] ) || ( isset( $_GET['action'] ) && $_GET['action'] == 'welcome' ) ){ ?>
|
33 |
-
<h2>What's new in Version
|
|
|
34 |
<div class="feature-section three-col">
|
35 |
<div class="col">
|
36 |
-
<div style='text-align: center;' ><i class="fa-4x fa fa-
|
37 |
|
38 |
<p style='text-align: center;'><?php _e("Use our server to handle the load and save 1000%+ on server resources!","wplivechat"); ?></p>
|
39 |
</div>
|
40 |
<div class="col">
|
41 |
-
<div style='text-align: center;' ><i class="fa-4x fa fa-
|
42 |
-
<p style='text-align: center;'><?php _e("
|
43 |
</div>
|
44 |
<div class="col">
|
45 |
-
<div style='text-align: center;' ><i class="fa-4x fa fa-
|
46 |
-
<p style='text-align: center;'><?php _e("
|
47 |
</div>
|
48 |
</div>
|
49 |
|
|
|
50 |
<div class="feature-section three-col">
|
51 |
<div class="col">
|
52 |
-
<div style='text-align: center;' ><i class="fa-4x fa fa-
|
53 |
|
54 |
-
<p style='text-align: center;'><?php _e("
|
55 |
</div>
|
56 |
<div class="col">
|
57 |
-
<div style='text-align: center;' ><i class="fa-4x fa fa-
|
58 |
|
59 |
-
<p style='text-align: center;'><?php _e("
|
60 |
</div>
|
61 |
<div class="col">
|
62 |
-
<div style='text-align: center;' ><i class="fa-4x fa fa-
|
63 |
|
64 |
-
<p style='text-align: center;'><?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
</div>
|
66 |
</div>
|
67 |
|
1 |
<?php //global $wpgmza_global_array; ?>
|
2 |
<div class="wrap about-wrap">
|
3 |
<p> </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 plugins_url( "/wp-live-chat-support/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 |
|
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 |
|
js/ace.js
ADDED
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* ***** BEGIN LICENSE BLOCK *****
|
2 |
+
* Distributed under the BSD license:
|
3 |
+
*
|
4 |
+
* Copyright (c) 2010, Ajax.org B.V.
|
5 |
+
* All rights reserved.
|
6 |
+
*
|
7 |
+
* Redistribution and use in source and binary forms, with or without
|
8 |
+
* modification, are permitted provided that the following conditions are met:
|
9 |
+
* * Redistributions of source code must retain the above copyright
|
10 |
+
* notice, this list of conditions and the following disclaimer.
|
11 |
+
* * Redistributions in binary form must reproduce the above copyright
|
12 |
+
* notice, this list of conditions and the following disclaimer in the
|
13 |
+
* documentation and/or other materials provided with the distribution.
|
14 |
+
* * Neither the name of Ajax.org B.V. nor the
|
15 |
+
* names of its contributors may be used to endorse or promote products
|
16 |
+
* derived from this software without specific prior written permission.
|
17 |
+
*
|
18 |
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
19 |
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20 |
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
21 |
+
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
22 |
+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
23 |
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
24 |
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
25 |
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26 |
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27 |
+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
28 |
+
*
|
29 |
+
* ***** END LICENSE BLOCK ***** */
|
30 |
+
|
31 |
+
/**
|
32 |
+
* The main class required to set up an Ace instance in the browser.
|
33 |
+
*
|
34 |
+
* @class Ace
|
35 |
+
**/
|
36 |
+
|
37 |
+
define(function(require, exports, module) {
|
38 |
+
"use strict";
|
39 |
+
|
40 |
+
require("./lib/fixoldbrowsers");
|
41 |
+
|
42 |
+
var dom = require("./lib/dom");
|
43 |
+
var event = require("./lib/event");
|
44 |
+
|
45 |
+
var Editor = require("./editor").Editor;
|
46 |
+
var EditSession = require("./edit_session").EditSession;
|
47 |
+
var UndoManager = require("./undomanager").UndoManager;
|
48 |
+
var Renderer = require("./virtual_renderer").VirtualRenderer;
|
49 |
+
|
50 |
+
// The following require()s are for inclusion in the built ace file
|
51 |
+
require("./worker/worker_client");
|
52 |
+
require("./keyboard/hash_handler");
|
53 |
+
require("./placeholder");
|
54 |
+
require("./multi_select");
|
55 |
+
require("./mode/folding/fold_mode");
|
56 |
+
require("./theme/textmate");
|
57 |
+
require("./ext/error_marker");
|
58 |
+
|
59 |
+
exports.config = require("./config");
|
60 |
+
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Provides access to require in packed noconflict mode
|
64 |
+
* @param {String} moduleName
|
65 |
+
* @returns {Object}
|
66 |
+
**/
|
67 |
+
exports.require = require;
|
68 |
+
define = 'bob';
|
69 |
+
|
70 |
+
if (typeof define === "function")
|
71 |
+
exports.define = define;
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Embeds the Ace editor into the DOM, at the element provided by `el`.
|
75 |
+
* @param {String | DOMElement} el Either the id of an element, or the element itself
|
76 |
+
* @param {Object } options Options for the editor
|
77 |
+
*
|
78 |
+
**/
|
79 |
+
exports.edit = function(el, options) {
|
80 |
+
if (typeof el == "string") {
|
81 |
+
var _id = el;
|
82 |
+
el = document.getElementById(_id);
|
83 |
+
if (!el)
|
84 |
+
throw new Error("ace.edit can't find div #" + _id);
|
85 |
+
}
|
86 |
+
|
87 |
+
if (el && el.env && el.env.editor instanceof Editor)
|
88 |
+
return el.env.editor;
|
89 |
+
|
90 |
+
var value = "";
|
91 |
+
if (el && /input|textarea/i.test(el.tagName)) {
|
92 |
+
var oldNode = el;
|
93 |
+
value = oldNode.value;
|
94 |
+
el = dom.createElement("pre");
|
95 |
+
oldNode.parentNode.replaceChild(el, oldNode);
|
96 |
+
} else if (el) {
|
97 |
+
value = dom.getInnerText(el);
|
98 |
+
el.innerHTML = "";
|
99 |
+
}
|
100 |
+
|
101 |
+
var doc = exports.createEditSession(value);
|
102 |
+
|
103 |
+
var editor = new Editor(new Renderer(el), doc, options);
|
104 |
+
|
105 |
+
var env = {
|
106 |
+
document: doc,
|
107 |
+
editor: editor,
|
108 |
+
onResize: editor.resize.bind(editor, null)
|
109 |
+
};
|
110 |
+
if (oldNode) env.textarea = oldNode;
|
111 |
+
event.addListener(window, "resize", env.onResize);
|
112 |
+
editor.on("destroy", function() {
|
113 |
+
event.removeListener(window, "resize", env.onResize);
|
114 |
+
env.editor.container.env = null; // prevent memory leak on old ie
|
115 |
+
});
|
116 |
+
editor.container.env = editor.env = env;
|
117 |
+
return editor;
|
118 |
+
};
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Creates a new [[EditSession]], and returns the associated [[Document]].
|
122 |
+
* @param {Document | String} text {:textParam}
|
123 |
+
* @param {TextMode} mode {:modeParam}
|
124 |
+
*
|
125 |
+
**/
|
126 |
+
exports.createEditSession = function(text, mode) {
|
127 |
+
var doc = new EditSession(text, mode);
|
128 |
+
doc.setUndoManager(new UndoManager());
|
129 |
+
return doc;
|
130 |
+
};
|
131 |
+
exports.EditSession = EditSession;
|
132 |
+
exports.UndoManager = UndoManager;
|
133 |
+
exports.version = "1.2.9";
|
134 |
+
});
|
js/arrow.gif
CHANGED
File without changes
|
js/cross.gif
CHANGED
File without changes
|
js/fontawesome-iconpicker.js
ADDED
@@ -0,0 +1,1025 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function(a) {
|
2 |
+
if (typeof define === "function" && define.amd) {
|
3 |
+
define([ "jquery" ], a);
|
4 |
+
} else {
|
5 |
+
a(jQuery);
|
6 |
+
}
|
7 |
+
})(function(a) {
|
8 |
+
a.ui = a.ui || {};
|
9 |
+
var b = a.ui.version = "1.12.1";
|
10 |
+
(function() {
|
11 |
+
var b, c = Math.max, d = Math.abs, e = /left|center|right/, f = /top|center|bottom/, g = /[\+\-]\d+(\.[\d]+)?%?/, h = /^\w+/, i = /%$/, j = a.fn.pos;
|
12 |
+
function k(a, b, c) {
|
13 |
+
return [ parseFloat(a[0]) * (i.test(a[0]) ? b / 100 : 1), parseFloat(a[1]) * (i.test(a[1]) ? c / 100 : 1) ];
|
14 |
+
}
|
15 |
+
function l(b, c) {
|
16 |
+
return parseInt(a.css(b, c), 10) || 0;
|
17 |
+
}
|
18 |
+
function m(b) {
|
19 |
+
var c = b[0];
|
20 |
+
if (c.nodeType === 9) {
|
21 |
+
return {
|
22 |
+
width: b.width(),
|
23 |
+
height: b.height(),
|
24 |
+
offset: {
|
25 |
+
top: 0,
|
26 |
+
left: 0
|
27 |
+
}
|
28 |
+
};
|
29 |
+
}
|
30 |
+
if (a.isWindow(c)) {
|
31 |
+
return {
|
32 |
+
width: b.width(),
|
33 |
+
height: b.height(),
|
34 |
+
offset: {
|
35 |
+
top: b.scrollTop(),
|
36 |
+
left: b.scrollLeft()
|
37 |
+
}
|
38 |
+
};
|
39 |
+
}
|
40 |
+
if (c.preventDefault) {
|
41 |
+
return {
|
42 |
+
width: 0,
|
43 |
+
height: 0,
|
44 |
+
offset: {
|
45 |
+
top: c.pageY,
|
46 |
+
left: c.pageX
|
47 |
+
}
|
48 |
+
};
|
49 |
+
}
|
50 |
+
return {
|
51 |
+
width: b.outerWidth(),
|
52 |
+
height: b.outerHeight(),
|
53 |
+
offset: b.offset()
|
54 |
+
};
|
55 |
+
}
|
56 |
+
a.pos = {
|
57 |
+
scrollbarWidth: function() {
|
58 |
+
if (b !== undefined) {
|
59 |
+
return b;
|
60 |
+
}
|
61 |
+
var c, d, e = a("<div " + "style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'>" + "<div style='height:100px;width:auto;'></div></div>"), f = e.children()[0];
|
62 |
+
a("body").append(e);
|
63 |
+
c = f.offsetWidth;
|
64 |
+
e.css("overflow", "scroll");
|
65 |
+
d = f.offsetWidth;
|
66 |
+
if (c === d) {
|
67 |
+
d = e[0].clientWidth;
|
68 |
+
}
|
69 |
+
e.remove();
|
70 |
+
return b = c - d;
|
71 |
+
},
|
72 |
+
getScrollInfo: function(b) {
|
73 |
+
var c = b.isWindow || b.isDocument ? "" : b.element.css("overflow-x"), d = b.isWindow || b.isDocument ? "" : b.element.css("overflow-y"), e = c === "scroll" || c === "auto" && b.width < b.element[0].scrollWidth, f = d === "scroll" || d === "auto" && b.height < b.element[0].scrollHeight;
|
74 |
+
return {
|
75 |
+
width: f ? a.pos.scrollbarWidth() : 0,
|
76 |
+
height: e ? a.pos.scrollbarWidth() : 0
|
77 |
+
};
|
78 |
+
},
|
79 |
+
getWithinInfo: function(b) {
|
80 |
+
var c = a(b || window), d = a.isWindow(c[0]), e = !!c[0] && c[0].nodeType === 9, f = !d && !e;
|
81 |
+
return {
|
82 |
+
element: c,
|
83 |
+
isWindow: d,
|
84 |
+
isDocument: e,
|
85 |
+
offset: f ? a(b).offset() : {
|
86 |
+
left: 0,
|
87 |
+
top: 0
|
88 |
+
},
|
89 |
+
scrollLeft: c.scrollLeft(),
|
90 |
+
scrollTop: c.scrollTop(),
|
91 |
+
width: c.outerWidth(),
|
92 |
+
height: c.outerHeight()
|
93 |
+
};
|
94 |
+
}
|
95 |
+
};
|
96 |
+
a.fn.pos = function(b) {
|
97 |
+
if (!b || !b.of) {
|
98 |
+
return j.apply(this, arguments);
|
99 |
+
}
|
100 |
+
b = a.extend({}, b);
|
101 |
+
var i, n, o, p, q, r, s = a(b.of), t = a.pos.getWithinInfo(b.within), u = a.pos.getScrollInfo(t), v = (b.collision || "flip").split(" "), w = {};
|
102 |
+
r = m(s);
|
103 |
+
if (s[0].preventDefault) {
|
104 |
+
b.at = "left top";
|
105 |
+
}
|
106 |
+
n = r.width;
|
107 |
+
o = r.height;
|
108 |
+
p = r.offset;
|
109 |
+
q = a.extend({}, p);
|
110 |
+
a.each([ "my", "at" ], function() {
|
111 |
+
var a = (b[this] || "").split(" "), c, d;
|
112 |
+
if (a.length === 1) {
|
113 |
+
a = e.test(a[0]) ? a.concat([ "center" ]) : f.test(a[0]) ? [ "center" ].concat(a) : [ "center", "center" ];
|
114 |
+
}
|
115 |
+
a[0] = e.test(a[0]) ? a[0] : "center";
|
116 |
+
a[1] = f.test(a[1]) ? a[1] : "center";
|
117 |
+
c = g.exec(a[0]);
|
118 |
+
d = g.exec(a[1]);
|
119 |
+
w[this] = [ c ? c[0] : 0, d ? d[0] : 0 ];
|
120 |
+
b[this] = [ h.exec(a[0])[0], h.exec(a[1])[0] ];
|
121 |
+
});
|
122 |
+
if (v.length === 1) {
|
123 |
+
v[1] = v[0];
|
124 |
+
}
|
125 |
+
if (b.at[0] === "right") {
|
126 |
+
q.left += n;
|
127 |
+
} else if (b.at[0] === "center") {
|
128 |
+
q.left += n / 2;
|
129 |
+
}
|
130 |
+
if (b.at[1] === "bottom") {
|
131 |
+
q.top += o;
|
132 |
+
} else if (b.at[1] === "center") {
|
133 |
+
q.top += o / 2;
|
134 |
+
}
|
135 |
+
i = k(w.at, n, o);
|
136 |
+
q.left += i[0];
|
137 |
+
q.top += i[1];
|
138 |
+
return this.each(function() {
|
139 |
+
var e, f, g = a(this), h = g.outerWidth(), j = g.outerHeight(), m = l(this, "marginLeft"), r = l(this, "marginTop"), x = h + m + l(this, "marginRight") + u.width, y = j + r + l(this, "marginBottom") + u.height, z = a.extend({}, q), A = k(w.my, g.outerWidth(), g.outerHeight());
|
140 |
+
if (b.my[0] === "right") {
|
141 |
+
z.left -= h;
|
142 |
+
} else if (b.my[0] === "center") {
|
143 |
+
z.left -= h / 2;
|
144 |
+
}
|
145 |
+
if (b.my[1] === "bottom") {
|
146 |
+
z.top -= j;
|
147 |
+
} else if (b.my[1] === "center") {
|
148 |
+
z.top -= j / 2;
|
149 |
+
}
|
150 |
+
z.left += A[0];
|
151 |
+
z.top += A[1];
|
152 |
+
e = {
|
153 |
+
marginLeft: m,
|
154 |
+
marginTop: r
|
155 |
+
};
|
156 |
+
a.each([ "left", "top" ], function(c, d) {
|
157 |
+
if (a.ui.pos[v[c]]) {
|
158 |
+
a.ui.pos[v[c]][d](z, {
|
159 |
+
targetWidth: n,
|
160 |
+
targetHeight: o,
|
161 |
+
elemWidth: h,
|
162 |
+
elemHeight: j,
|
163 |
+
collisionPosition: e,
|
164 |
+
collisionWidth: x,
|
165 |
+
collisionHeight: y,
|
166 |
+
offset: [ i[0] + A[0], i[1] + A[1] ],
|
167 |
+
my: b.my,
|
168 |
+
at: b.at,
|
169 |
+
within: t,
|
170 |
+
elem: g
|
171 |
+
});
|
172 |
+
}
|
173 |
+
});
|
174 |
+
if (b.using) {
|
175 |
+
f = function(a) {
|
176 |
+
var e = p.left - z.left, f = e + n - h, i = p.top - z.top, k = i + o - j, l = {
|
177 |
+
target: {
|
178 |
+
element: s,
|
179 |
+
left: p.left,
|
180 |
+
top: p.top,
|
181 |
+
width: n,
|
182 |
+
height: o
|
183 |
+
},
|
184 |
+
element: {
|
185 |
+
element: g,
|
186 |
+
left: z.left,
|
187 |
+
top: z.top,
|
188 |
+
width: h,
|
189 |
+
height: j
|
190 |
+
},
|
191 |
+
horizontal: f < 0 ? "left" : e > 0 ? "right" : "center",
|
192 |
+
vertical: k < 0 ? "top" : i > 0 ? "bottom" : "middle"
|
193 |
+
};
|
194 |
+
if (n < h && d(e + f) < n) {
|
195 |
+
l.horizontal = "center";
|
196 |
+
}
|
197 |
+
if (o < j && d(i + k) < o) {
|
198 |
+
l.vertical = "middle";
|
199 |
+
}
|
200 |
+
if (c(d(e), d(f)) > c(d(i), d(k))) {
|
201 |
+
l.important = "horizontal";
|
202 |
+
} else {
|
203 |
+
l.important = "vertical";
|
204 |
+
}
|
205 |
+
b.using.call(this, a, l);
|
206 |
+
};
|
207 |
+
}
|
208 |
+
g.offset(a.extend(z, {
|
209 |
+
using: f
|
210 |
+
}));
|
211 |
+
});
|
212 |
+
};
|
213 |
+
a.ui.pos = {
|
214 |
+
_trigger: function(a, b, c, d) {
|
215 |
+
if (b.elem) {
|
216 |
+
b.elem.trigger({
|
217 |
+
type: c,
|
218 |
+
position: a,
|
219 |
+
positionData: b,
|
220 |
+
triggered: d
|
221 |
+
});
|
222 |
+
}
|
223 |
+
},
|
224 |
+
fit: {
|
225 |
+
left: function(b, d) {
|
226 |
+
a.ui.pos._trigger(b, d, "posCollide", "fitLeft");
|
227 |
+
var e = d.within, f = e.isWindow ? e.scrollLeft : e.offset.left, g = e.width, h = b.left - d.collisionPosition.marginLeft, i = f - h, j = h + d.collisionWidth - g - f, k;
|
228 |
+
if (d.collisionWidth > g) {
|
229 |
+
if (i > 0 && j <= 0) {
|
230 |
+
k = b.left + i + d.collisionWidth - g - f;
|
231 |
+
b.left += i - k;
|
232 |
+
} else if (j > 0 && i <= 0) {
|
233 |
+
b.left = f;
|
234 |
+
} else {
|
235 |
+
if (i > j) {
|
236 |
+
b.left = f + g - d.collisionWidth;
|
237 |
+
} else {
|
238 |
+
b.left = f;
|
239 |
+
}
|
240 |
+
}
|
241 |
+
} else if (i > 0) {
|
242 |
+
b.left += i;
|
243 |
+
} else if (j > 0) {
|
244 |
+
b.left -= j;
|
245 |
+
} else {
|
246 |
+
b.left = c(b.left - h, b.left);
|
247 |
+
}
|
248 |
+
a.ui.pos._trigger(b, d, "posCollided", "fitLeft");
|
249 |
+
},
|
250 |
+
top: function(b, d) {
|
251 |
+
a.ui.pos._trigger(b, d, "posCollide", "fitTop");
|
252 |
+
var e = d.within, f = e.isWindow ? e.scrollTop : e.offset.top, g = d.within.height, h = b.top - d.collisionPosition.marginTop, i = f - h, j = h + d.collisionHeight - g - f, k;
|
253 |
+
if (d.collisionHeight > g) {
|
254 |
+
if (i > 0 && j <= 0) {
|
255 |
+
k = b.top + i + d.collisionHeight - g - f;
|
256 |
+
b.top += i - k;
|
257 |
+
} else if (j > 0 && i <= 0) {
|
258 |
+
b.top = f;
|
259 |
+
} else {
|
260 |
+
if (i > j) {
|
261 |
+
b.top = f + g - d.collisionHeight;
|
262 |
+
} else {
|
263 |
+
b.top = f;
|
264 |
+
}
|
265 |
+
}
|
266 |
+
} else if (i > 0) {
|
267 |
+
b.top += i;
|
268 |
+
} else if (j > 0) {
|
269 |
+
b.top -= j;
|
270 |
+
} else {
|
271 |
+
b.top = c(b.top - h, b.top);
|
272 |
+
}
|
273 |
+
a.ui.pos._trigger(b, d, "posCollided", "fitTop");
|
274 |
+
}
|
275 |
+
},
|
276 |
+
flip: {
|
277 |
+
left: function(b, c) {
|
278 |
+
a.ui.pos._trigger(b, c, "posCollide", "flipLeft");
|
279 |
+
var e = c.within, f = e.offset.left + e.scrollLeft, g = e.width, h = e.isWindow ? e.scrollLeft : e.offset.left, i = b.left - c.collisionPosition.marginLeft, j = i - h, k = i + c.collisionWidth - g - h, l = c.my[0] === "left" ? -c.elemWidth : c.my[0] === "right" ? c.elemWidth : 0, m = c.at[0] === "left" ? c.targetWidth : c.at[0] === "right" ? -c.targetWidth : 0, n = -2 * c.offset[0], o, p;
|
280 |
+
if (j < 0) {
|
281 |
+
o = b.left + l + m + n + c.collisionWidth - g - f;
|
282 |
+
if (o < 0 || o < d(j)) {
|
283 |
+
b.left += l + m + n;
|
284 |
+
}
|
285 |
+
} else if (k > 0) {
|
286 |
+
p = b.left - c.collisionPosition.marginLeft + l + m + n - h;
|
287 |
+
if (p > 0 || d(p) < k) {
|
288 |
+
b.left += l + m + n;
|
289 |
+
}
|
290 |
+
}
|
291 |
+
a.ui.pos._trigger(b, c, "posCollided", "flipLeft");
|
292 |
+
},
|
293 |
+
top: function(b, c) {
|
294 |
+
a.ui.pos._trigger(b, c, "posCollide", "flipTop");
|
295 |
+
var e = c.within, f = e.offset.top + e.scrollTop, g = e.height, h = e.isWindow ? e.scrollTop : e.offset.top, i = b.top - c.collisionPosition.marginTop, j = i - h, k = i + c.collisionHeight - g - h, l = c.my[1] === "top", m = l ? -c.elemHeight : c.my[1] === "bottom" ? c.elemHeight : 0, n = c.at[1] === "top" ? c.targetHeight : c.at[1] === "bottom" ? -c.targetHeight : 0, o = -2 * c.offset[1], p, q;
|
296 |
+
if (j < 0) {
|
297 |
+
q = b.top + m + n + o + c.collisionHeight - g - f;
|
298 |
+
if (q < 0 || q < d(j)) {
|
299 |
+
b.top += m + n + o;
|
300 |
+
}
|
301 |
+
} else if (k > 0) {
|
302 |
+
p = b.top - c.collisionPosition.marginTop + m + n + o - h;
|
303 |
+
if (p > 0 || d(p) < k) {
|
304 |
+
b.top += m + n + o;
|
305 |
+
}
|
306 |
+
}
|
307 |
+
a.ui.pos._trigger(b, c, "posCollided", "flipTop");
|
308 |
+
}
|
309 |
+
},
|
310 |
+
flipfit: {
|
311 |
+
left: function() {
|
312 |
+
a.ui.pos.flip.left.apply(this, arguments);
|
313 |
+
a.ui.pos.fit.left.apply(this, arguments);
|
314 |
+
},
|
315 |
+
top: function() {
|
316 |
+
a.ui.pos.flip.top.apply(this, arguments);
|
317 |
+
a.ui.pos.fit.top.apply(this, arguments);
|
318 |
+
}
|
319 |
+
}
|
320 |
+
};
|
321 |
+
(function() {
|
322 |
+
var b, c, d, e, f, g = document.getElementsByTagName("body")[0], h = document.createElement("div");
|
323 |
+
b = document.createElement(g ? "div" : "body");
|
324 |
+
d = {
|
325 |
+
visibility: "hidden",
|
326 |
+
width: 0,
|
327 |
+
height: 0,
|
328 |
+
border: 0,
|
329 |
+
margin: 0,
|
330 |
+
background: "none"
|
331 |
+
};
|
332 |
+
if (g) {
|
333 |
+
a.extend(d, {
|
334 |
+
position: "absolute",
|
335 |
+
left: "-1000px",
|
336 |
+
top: "-1000px"
|
337 |
+
});
|
338 |
+
}
|
339 |
+
for (f in d) {
|
340 |
+
b.style[f] = d[f];
|
341 |
+
}
|
342 |
+
b.appendChild(h);
|
343 |
+
c = g || document.documentElement;
|
344 |
+
c.insertBefore(b, c.firstChild);
|
345 |
+
h.style.cssText = "position: absolute; left: 10.7432222px;";
|
346 |
+
e = a(h).offset().left;
|
347 |
+
a.support.offsetFractions = e > 10 && e < 11;
|
348 |
+
b.innerHTML = "";
|
349 |
+
c.removeChild(b);
|
350 |
+
})();
|
351 |
+
})();
|
352 |
+
var c = a.ui.position;
|
353 |
+
});
|
354 |
+
|
355 |
+
(function(a) {
|
356 |
+
"use strict";
|
357 |
+
if (typeof define === "function" && define.amd) {
|
358 |
+
define([ "jquery" ], a);
|
359 |
+
} else if (window.jQuery && !window.jQuery.fn.iconpicker) {
|
360 |
+
a(window.jQuery);
|
361 |
+
}
|
362 |
+
})(function(a) {
|
363 |
+
"use strict";
|
364 |
+
var b = {
|
365 |
+
isEmpty: function(a) {
|
366 |
+
return a === false || a === "" || a === null || a === undefined;
|
367 |
+
},
|
368 |
+
isEmptyObject: function(a) {
|
369 |
+
return this.isEmpty(a) === true || a.length === 0;
|
370 |
+
},
|
371 |
+
isElement: function(b) {
|
372 |
+
return a(b).length > 0;
|
373 |
+
},
|
374 |
+
isString: function(a) {
|
375 |
+
return typeof a === "string" || a instanceof String;
|
376 |
+
},
|
377 |
+
isArray: function(b) {
|
378 |
+
return a.isArray(b);
|
379 |
+
},
|
380 |
+
inArray: function(b, c) {
|
381 |
+
return a.inArray(b, c) !== -1;
|
382 |
+
},
|
383 |
+
throwError: function(a) {
|
384 |
+
throw "Font Awesome Icon Picker Exception: " + a;
|
385 |
+
}
|
386 |
+
};
|
387 |
+
var c = function(d, e) {
|
388 |
+
this._id = c._idCounter++;
|
389 |
+
this.element = a(d).addClass("iconpicker-element");
|
390 |
+
this._trigger("iconpickerCreate");
|
391 |
+
this.options = a.extend({}, c.defaultOptions, this.element.data(), e);
|
392 |
+
this.options.templates = a.extend({}, c.defaultOptions.templates, this.options.templates);
|
393 |
+
this.options.originalPlacement = this.options.placement;
|
394 |
+
this.container = b.isElement(this.options.container) ? a(this.options.container) : false;
|
395 |
+
if (this.container === false) {
|
396 |
+
if (this.element.is(".dropdown-toggle")) {
|
397 |
+
this.container = a("~ .dropdown-menu:first", this.element);
|
398 |
+
} else {
|
399 |
+
this.container = this.element.is("input,textarea,button,.btn") ? this.element.parent() : this.element;
|
400 |
+
}
|
401 |
+
}
|
402 |
+
this.container.addClass("iconpicker-container");
|
403 |
+
if (this.isDropdownMenu()) {
|
404 |
+
this.options.templates.search = false;
|
405 |
+
this.options.templates.buttons = false;
|
406 |
+
this.options.placement = "inline";
|
407 |
+
}
|
408 |
+
this.input = this.element.is("input,textarea") ? this.element.addClass("iconpicker-input") : false;
|
409 |
+
if (this.input === false) {
|
410 |
+
this.input = this.container.find(this.options.input);
|
411 |
+
if (!this.input.is("input,textarea")) {
|
412 |
+
this.input = false;
|
413 |
+
}
|
414 |
+
}
|
415 |
+
this.component = this.isDropdownMenu() ? this.container.parent().find(this.options.component) : this.container.find(this.options.component);
|
416 |
+
if (this.component.length === 0) {
|
417 |
+
this.component = false;
|
418 |
+
} else {
|
419 |
+
this.component.find("i").addClass("iconpicker-component");
|
420 |
+
}
|
421 |
+
this._createPopover();
|
422 |
+
this._createIconpicker();
|
423 |
+
if (this.getAcceptButton().length === 0) {
|
424 |
+
this.options.mustAccept = false;
|
425 |
+
}
|
426 |
+
if (this.isInputGroup()) {
|
427 |
+
this.container.parent().append(this.popover);
|
428 |
+
} else {
|
429 |
+
this.container.append(this.popover);
|
430 |
+
}
|
431 |
+
this._bindElementEvents();
|
432 |
+
this._bindWindowEvents();
|
433 |
+
this.update(this.options.selected);
|
434 |
+
if (this.isInline()) {
|
435 |
+
this.show();
|
436 |
+
}
|
437 |
+
this._trigger("iconpickerCreated");
|
438 |
+
};
|
439 |
+
c._idCounter = 0;
|
440 |
+
c.defaultOptions = {
|
441 |
+
title: false,
|
442 |
+
selected: false,
|
443 |
+
defaultValue: false,
|
444 |
+
placement: "bottom",
|
445 |
+
collision: "none",
|
446 |
+
animation: true,
|
447 |
+
hideOnSelect: false,
|
448 |
+
showFooter: false,
|
449 |
+
searchInFooter: false,
|
450 |
+
mustAccept: false,
|
451 |
+
selectedCustomClass: "bg-primary",
|
452 |
+
icons: [],
|
453 |
+
fullClassFormatter: function(a) {
|
454 |
+
return "fa " + a;
|
455 |
+
},
|
456 |
+
input: "input,.iconpicker-input",
|
457 |
+
inputSearch: false,
|
458 |
+
container: false,
|
459 |
+
component: ".input-group-addon,.iconpicker-component",
|
460 |
+
templates: {
|
461 |
+
popover: '<div class="iconpicker-popover popover"><div class="arrow"></div>' + '<div class="popover-title"></div><div class="popover-content"></div></div>',
|
462 |
+
footer: '<div class="popover-footer"></div>',
|
463 |
+
buttons: '<button class="iconpicker-btn iconpicker-btn-cancel btn btn-default btn-sm">Cancel</button>' + ' <button class="iconpicker-btn iconpicker-btn-accept btn btn-primary btn-sm">Accept</button>',
|
464 |
+
search: '<input type="search" class="form-control iconpicker-search" placeholder="Type to filter" />',
|
465 |
+
iconpicker: '<div class="iconpicker"><div class="iconpicker-items"></div></div>',
|
466 |
+
iconpickerItem: '<a role="button" href="#" class="iconpicker-item"><i></i></a>'
|
467 |
+
}
|
468 |
+
};
|
469 |
+
c.batch = function(b, c) {
|
470 |
+
var d = Array.prototype.slice.call(arguments, 2);
|
471 |
+
return a(b).each(function() {
|
472 |
+
var b = a(this).data("iconpicker");
|
473 |
+
if (!!b) {
|
474 |
+
b[c].apply(b, d);
|
475 |
+
}
|
476 |
+
});
|
477 |
+
};
|
478 |
+
c.prototype = {
|
479 |
+
constructor: c,
|
480 |
+
options: {},
|
481 |
+
_id: 0,
|
482 |
+
_trigger: function(b, c) {
|
483 |
+
c = c || {};
|
484 |
+
this.element.trigger(a.extend({
|
485 |
+
type: b,
|
486 |
+
iconpickerInstance: this
|
487 |
+
}, c));
|
488 |
+
},
|
489 |
+
_createPopover: function() {
|
490 |
+
this.popover = a(this.options.templates.popover);
|
491 |
+
var c = this.popover.find(".popover-title");
|
492 |
+
if (!!this.options.title) {
|
493 |
+
c.append(a('<div class="popover-title-text">' + this.options.title + "</div>"));
|
494 |
+
}
|
495 |
+
if (this.hasSeparatedSearchInput() && !this.options.searchInFooter) {
|
496 |
+
c.append(this.options.templates.search);
|
497 |
+
} else if (!this.options.title) {
|
498 |
+
c.remove();
|
499 |
+
}
|
500 |
+
if (this.options.showFooter && !b.isEmpty(this.options.templates.footer)) {
|
501 |
+
var d = a(this.options.templates.footer);
|
502 |
+
if (this.hasSeparatedSearchInput() && this.options.searchInFooter) {
|
503 |
+
d.append(a(this.options.templates.search));
|
504 |
+
}
|
505 |
+
if (!b.isEmpty(this.options.templates.buttons)) {
|
506 |
+
d.append(a(this.options.templates.buttons));
|
507 |
+
}
|
508 |
+
this.popover.append(d);
|
509 |
+
}
|
510 |
+
if (this.options.animation === true) {
|
511 |
+
this.popover.addClass("fade");
|
512 |
+
}
|
513 |
+
return this.popover;
|
514 |
+
},
|
515 |
+
_createIconpicker: function() {
|
516 |
+
var b = this;
|
517 |
+
this.iconpicker = a(this.options.templates.iconpicker);
|
518 |
+
var c = function(c) {
|
519 |
+
var d = a(this);
|
520 |
+
if (d.is("i")) {
|
521 |
+
d = d.parent();
|
522 |
+
}
|
523 |
+
b._trigger("iconpickerSelect", {
|
524 |
+
iconpickerItem: d,
|
525 |
+
iconpickerValue: b.iconpickerValue
|
526 |
+
});
|
527 |
+
if (b.options.mustAccept === false) {
|
528 |
+
b.update(d.data("iconpickerValue"));
|
529 |
+
b._trigger("iconpickerSelected", {
|
530 |
+
iconpickerItem: this,
|
531 |
+
iconpickerValue: b.iconpickerValue
|
532 |
+
});
|
533 |
+
} else {
|
534 |
+
b.update(d.data("iconpickerValue"), true);
|
535 |
+
}
|
536 |
+
if (b.options.hideOnSelect && b.options.mustAccept === false) {
|
537 |
+
b.hide();
|
538 |
+
}
|
539 |
+
c.preventDefault();
|
540 |
+
return false;
|
541 |
+
};
|
542 |
+
for (var d in this.options.icons) {
|
543 |
+
if (typeof this.options.icons[d] === "string") {
|
544 |
+
var e = a(this.options.templates.iconpickerItem);
|
545 |
+
e.find("i").addClass(this.options.fullClassFormatter(this.options.icons[d]));
|
546 |
+
e.data("iconpickerValue", this.options.icons[d]).on("click.iconpicker", c);
|
547 |
+
this.iconpicker.find(".iconpicker-items").append(e.attr("title", "." + this.options.icons[d]));
|
548 |
+
}
|
549 |
+
}
|
550 |
+
this.popover.find(".popover-content").append(this.iconpicker);
|
551 |
+
return this.iconpicker;
|
552 |
+
},
|
553 |
+
_isEventInsideIconpicker: function(b) {
|
554 |
+
var c = a(b.target);
|
555 |
+
if ((!c.hasClass("iconpicker-element") || c.hasClass("iconpicker-element") && !c.is(this.element)) && c.parents(".iconpicker-popover").length === 0) {
|
556 |
+
return false;
|
557 |
+
}
|
558 |
+
return true;
|
559 |
+
},
|
560 |
+
_bindElementEvents: function() {
|
561 |
+
var c = this;
|
562 |
+
this.getSearchInput().on("keyup.iconpicker", function() {
|
563 |
+
c.filter(a(this).val().toLowerCase());
|
564 |
+
});
|
565 |
+
this.getAcceptButton().on("click.iconpicker", function() {
|
566 |
+
var a = c.iconpicker.find(".iconpicker-selected").get(0);
|
567 |
+
c.update(c.iconpickerValue);
|
568 |
+
c._trigger("iconpickerSelected", {
|
569 |
+
iconpickerItem: a,
|
570 |
+
iconpickerValue: c.iconpickerValue
|
571 |
+
});
|
572 |
+
if (!c.isInline()) {
|
573 |
+
c.hide();
|
574 |
+
}
|
575 |
+
});
|
576 |
+
this.getCancelButton().on("click.iconpicker", function() {
|
577 |
+
if (!c.isInline()) {
|
578 |
+
c.hide();
|
579 |
+
}
|
580 |
+
});
|
581 |
+
this.element.on("focus.iconpicker", function(a) {
|
582 |
+
c.show();
|
583 |
+
a.stopPropagation();
|
584 |
+
});
|
585 |
+
if (this.hasComponent()) {
|
586 |
+
this.component.on("click.iconpicker", function() {
|
587 |
+
c.toggle();
|
588 |
+
});
|
589 |
+
}
|
590 |
+
if (this.hasInput()) {
|
591 |
+
this.input.on("keyup.iconpicker", function(d) {
|
592 |
+
if (!b.inArray(d.keyCode, [ 38, 40, 37, 39, 16, 17, 18, 9, 8, 91, 93, 20, 46, 186, 190, 46, 78, 188, 44, 86 ])) {
|
593 |
+
c.update();
|
594 |
+
} else {
|
595 |
+
c._updateFormGroupStatus(c.getValid(this.value) !== false);
|
596 |
+
}
|
597 |
+
if (c.options.inputSearch === true) {
|
598 |
+
c.filter(a(this).val().toLowerCase());
|
599 |
+
}
|
600 |
+
});
|
601 |
+
}
|
602 |
+
},
|
603 |
+
_bindWindowEvents: function() {
|
604 |
+
var b = a(window.document);
|
605 |
+
var c = this;
|
606 |
+
var d = ".iconpicker.inst" + this._id;
|
607 |
+
a(window).on("resize.iconpicker" + d + " orientationchange.iconpicker" + d, function(a) {
|
608 |
+
if (c.popover.hasClass("in")) {
|
609 |
+
c.updatePlacement();
|
610 |
+
}
|
611 |
+
});
|
612 |
+
if (!c.isInline()) {
|
613 |
+
b.on("mouseup" + d, function(a) {
|
614 |
+
if (!c._isEventInsideIconpicker(a) && !c.isInline()) {
|
615 |
+
c.hide();
|
616 |
+
}
|
617 |
+
a.stopPropagation();
|
618 |
+
a.preventDefault();
|
619 |
+
return false;
|
620 |
+
});
|
621 |
+
}
|
622 |
+
return false;
|
623 |
+
},
|
624 |
+
_unbindElementEvents: function() {
|
625 |
+
this.popover.off(".iconpicker");
|
626 |
+
this.element.off(".iconpicker");
|
627 |
+
if (this.hasInput()) {
|
628 |
+
this.input.off(".iconpicker");
|
629 |
+
}
|
630 |
+
if (this.hasComponent()) {
|
631 |
+
this.component.off(".iconpicker");
|
632 |
+
}
|
633 |
+
if (this.hasContainer()) {
|
634 |
+
this.container.off(".iconpicker");
|
635 |
+
}
|
636 |
+
},
|
637 |
+
_unbindWindowEvents: function() {
|
638 |
+
a(window).off(".iconpicker.inst" + this._id);
|
639 |
+
a(window.document).off(".iconpicker.inst" + this._id);
|
640 |
+
},
|
641 |
+
updatePlacement: function(b, c) {
|
642 |
+
b = b || this.options.placement;
|
643 |
+
this.options.placement = b;
|
644 |
+
c = c || this.options.collision;
|
645 |
+
c = c === true ? "flip" : c;
|
646 |
+
var d = {
|
647 |
+
at: "right bottom",
|
648 |
+
my: "right top",
|
649 |
+
of: this.hasInput() && !this.isInputGroup() ? this.input : this.container,
|
650 |
+
collision: c === true ? "flip" : c,
|
651 |
+
within: window
|
652 |
+
};
|
653 |
+
this.popover.removeClass("inline topLeftCorner topLeft top topRight topRightCorner " + "rightTop right rightBottom bottomRight bottomRightCorner " + "bottom bottomLeft bottomLeftCorner leftBottom left leftTop");
|
654 |
+
if (typeof b === "object") {
|
655 |
+
return this.popover.pos(a.extend({}, d, b));
|
656 |
+
}
|
657 |
+
switch (b) {
|
658 |
+
case "inline":
|
659 |
+
{
|
660 |
+
d = false;
|
661 |
+
}
|
662 |
+
break;
|
663 |
+
|
664 |
+
case "topLeftCorner":
|
665 |
+
{
|
666 |
+
d.my = "right bottom";
|
667 |
+
d.at = "left top";
|
668 |
+
}
|
669 |
+
break;
|
670 |
+
|
671 |
+
case "topLeft":
|
672 |
+
{
|
673 |
+
d.my = "left bottom";
|
674 |
+
d.at = "left top";
|
675 |
+
}
|
676 |
+
break;
|
677 |
+
|
678 |
+
case "top":
|
679 |
+
{
|
680 |
+
d.my = "center bottom";
|
681 |
+
d.at = "center top";
|
682 |
+
}
|
683 |
+
break;
|
684 |
+
|
685 |
+
case "topRight":
|
686 |
+
{
|
687 |
+
d.my = "right bottom";
|
688 |
+
d.at = "right top";
|
689 |
+
}
|
690 |
+
break;
|
691 |
+
|
692 |
+
case "topRightCorner":
|
693 |
+
{
|
694 |
+
d.my = "left bottom";
|
695 |
+
d.at = "right top";
|
696 |
+
}
|
697 |
+
break;
|
698 |
+
|
699 |
+
case "rightTop":
|
700 |
+
{
|
701 |
+
d.my = "left bottom";
|
702 |
+
d.at = "right center";
|
703 |
+
}
|
704 |
+
break;
|
705 |
+
|
706 |
+
case "right":
|
707 |
+
{
|
708 |
+
d.my = "left center";
|
709 |
+
d.at = "right center";
|
710 |
+
}
|
711 |
+
break;
|
712 |
+
|
713 |
+
case "rightBottom":
|
714 |
+
{
|
715 |
+
d.my = "left top";
|
716 |
+
d.at = "right center";
|
717 |
+
}
|
718 |
+
break;
|
719 |
+
|
720 |
+
case "bottomRightCorner":
|
721 |
+
{
|
722 |
+
d.my = "left top";
|
723 |
+
d.at = "right bottom";
|
724 |
+
}
|
725 |
+
break;
|
726 |
+
|
727 |
+
case "bottomRight":
|
728 |
+
{
|
729 |
+
d.my = "right top";
|
730 |
+
d.at = "right bottom";
|
731 |
+
}
|
732 |
+
break;
|
733 |
+
|
734 |
+
case "bottom":
|
735 |
+
{
|
736 |
+
d.my = "center top";
|
737 |
+
d.at = "center bottom";
|
738 |
+
}
|
739 |
+
break;
|
740 |
+
|
741 |
+
case "bottomLeft":
|
742 |
+
{
|
743 |
+
d.my = "left top";
|
744 |
+
d.at = "left bottom";
|
745 |
+
}
|
746 |
+
break;
|
747 |
+
|
748 |
+
case "bottomLeftCorner":
|
749 |
+
{
|
750 |
+
d.my = "right top";
|
751 |
+
d.at = "left bottom";
|
752 |
+
}
|
753 |
+
break;
|
754 |
+
|
755 |
+
case "leftBottom":
|
756 |
+
{
|
757 |
+
d.my = "right top";
|
758 |
+
d.at = "left center";
|
759 |
+
}
|
760 |
+
break;
|
761 |
+
|
762 |
+
case "left":
|
763 |
+
{
|
764 |
+
d.my = "right center";
|
765 |
+
d.at = "left center";
|
766 |
+
}
|
767 |
+
break;
|
768 |
+
|
769 |
+
case "leftTop":
|
770 |
+
{
|
771 |
+
d.my = "right bottom";
|
772 |
+
d.at = "left center";
|
773 |
+
}
|
774 |
+
break;
|
775 |
+
|
776 |
+
default:
|
777 |
+
{
|
778 |
+
return false;
|
779 |
+
}
|
780 |
+
break;
|
781 |
+
}
|
782 |
+
this.popover.css({
|
783 |
+
display: this.options.placement === "inline" ? "" : "block"
|
784 |
+
});
|
785 |
+
if (d !== false) {
|
786 |
+
this.popover.pos(d).css("maxWidth", a(window).width() - this.container.offset().left - 5);
|
787 |
+
} else {
|
788 |
+
this.popover.css({
|
789 |
+
top: "auto",
|
790 |
+
right: "auto",
|
791 |
+
bottom: "auto",
|
792 |
+
left: "auto",
|
793 |
+
maxWidth: "none"
|
794 |
+
});
|
795 |
+
}
|
796 |
+
this.popover.addClass(this.options.placement);
|
797 |
+
return true;
|
798 |
+
},
|
799 |
+
_updateComponents: function() {
|
800 |
+
this.iconpicker.find(".iconpicker-item.iconpicker-selected").removeClass("iconpicker-selected " + this.options.selectedCustomClass);
|
801 |
+
if (this.iconpickerValue) {
|
802 |
+
this.iconpicker.find("." + this.options.fullClassFormatter(this.iconpickerValue).replace(/ /g, ".")).parent().addClass("iconpicker-selected " + this.options.selectedCustomClass);
|
803 |
+
}
|
804 |
+
if (this.hasComponent()) {
|
805 |
+
var a = this.component.find("i");
|
806 |
+
if (a.length > 0) {
|
807 |
+
a.attr("class", this.options.fullClassFormatter(this.iconpickerValue));
|
808 |
+
} else {
|
809 |
+
this.component.html(this.getHtml());
|
810 |
+
}
|
811 |
+
}
|
812 |
+
},
|
813 |
+
_updateFormGroupStatus: function(a) {
|
814 |
+
if (this.hasInput()) {
|
815 |
+
if (a !== false) {
|
816 |
+
this.input.parents(".form-group:first").removeClass("has-error");
|
817 |
+
} else {
|
818 |
+
this.input.parents(".form-group:first").addClass("has-error");
|
819 |
+
}
|
820 |
+
return true;
|
821 |
+
}
|
822 |
+
return false;
|
823 |
+
},
|
824 |
+
getValid: function(c) {
|
825 |
+
if (!b.isString(c)) {
|
826 |
+
c = "";
|
827 |
+
}
|
828 |
+
var d = c === "";
|
829 |
+
c = a.trim(c);
|
830 |
+
if (b.inArray(c, this.options.icons) || d) {
|
831 |
+
return c;
|
832 |
+
}
|
833 |
+
return false;
|
834 |
+
},
|
835 |
+
setValue: function(a) {
|
836 |
+
var b = this.getValid(a);
|
837 |
+
if (b !== false) {
|
838 |
+
this.iconpickerValue = b;
|
839 |
+
this._trigger("iconpickerSetValue", {
|
840 |
+
iconpickerValue: b
|
841 |
+
});
|
842 |
+
return this.iconpickerValue;
|
843 |
+
} else {
|
844 |
+
this._trigger("iconpickerInvalid", {
|
845 |
+
iconpickerValue: a
|
846 |
+
});
|
847 |
+
return false;
|
848 |
+
}
|
849 |
+
},
|
850 |
+
getHtml: function() {
|
851 |
+
return '<i class="' + this.options.fullClassFormatter(this.iconpickerValue) + '"></i>';
|
852 |
+
},
|
853 |
+
setSourceValue: function(a) {
|
854 |
+
a = this.setValue(a);
|
855 |
+
if (a !== false && a !== "") {
|
856 |
+
if (this.hasInput()) {
|
857 |
+
this.input.val(this.iconpickerValue);
|
858 |
+
} else {
|
859 |
+
this.element.data("iconpickerValue", this.iconpickerValue);
|
860 |
+
}
|
861 |
+
this._trigger("iconpickerSetSourceValue", {
|
862 |
+
iconpickerValue: a
|
863 |
+
});
|
864 |
+
}
|
865 |
+
return a;
|
866 |
+
},
|
867 |
+
getSourceValue: function(a) {
|
868 |
+
a = a || this.options.defaultValue;
|
869 |
+
var b = a;
|
870 |
+
if (this.hasInput()) {
|
871 |
+
b = this.input.val();
|
872 |
+
} else {
|
873 |
+
b = this.element.data("iconpickerValue");
|
874 |
+
}
|
875 |
+
if (b === undefined || b === "" || b === null || b === false) {
|
876 |
+
b = a;
|
877 |
+
}
|
878 |
+
return b;
|
879 |
+
},
|
880 |
+
hasInput: function() {
|
881 |
+
return this.input !== false;
|
882 |
+
},
|
883 |
+
isInputSearch: function() {
|
884 |
+
return this.hasInput() && this.options.inputSearch === true;
|
885 |
+
},
|
886 |
+
isInputGroup: function() {
|
887 |
+
return this.container.is(".input-group");
|
888 |
+
},
|
889 |
+
isDropdownMenu: function() {
|
890 |
+
return this.container.is(".dropdown-menu");
|
891 |
+
},
|
892 |
+
hasSeparatedSearchInput: function() {
|
893 |
+
return this.options.templates.search !== false && !this.isInputSearch();
|
894 |
+
},
|
895 |
+
hasComponent: function() {
|
896 |
+
return this.component !== false;
|
897 |
+
},
|
898 |
+
hasContainer: function() {
|
899 |
+
return this.container !== false;
|
900 |
+
},
|
901 |
+
getAcceptButton: function() {
|
902 |
+
return this.popover.find(".iconpicker-btn-accept");
|
903 |
+
},
|
904 |
+
getCancelButton: function() {
|
905 |
+
return this.popover.find(".iconpicker-btn-cancel");
|
906 |
+
},
|
907 |
+
getSearchInput: function() {
|
908 |
+
return this.popover.find(".iconpicker-search");
|
909 |
+
},
|
910 |
+
filter: function(c) {
|
911 |
+
if (b.isEmpty(c)) {
|
912 |
+
this.iconpicker.find(".iconpicker-item").show();
|
913 |
+
return a(false);
|
914 |
+
} else {
|
915 |
+
var d = [];
|
916 |
+
this.iconpicker.find(".iconpicker-item").each(function() {
|
917 |
+
var b = a(this);
|
918 |
+
var e = b.attr("title").toLowerCase();
|
919 |
+
var f = false;
|
920 |
+
try {
|
921 |
+
f = new RegExp(c, "g");
|
922 |
+
} catch (a) {
|
923 |
+
f = false;
|
924 |
+
}
|
925 |
+
if (f !== false && e.match(f)) {
|
926 |
+
d.push(b);
|
927 |
+
b.show();
|
928 |
+
} else {
|
929 |
+
b.hide();
|
930 |
+
}
|
931 |
+
});
|
932 |
+
return d;
|
933 |
+
}
|
934 |
+
},
|
935 |
+
show: function() {
|
936 |
+
if (this.popover.hasClass("in")) {
|
937 |
+
return false;
|
938 |
+
}
|
939 |
+
a.iconpicker.batch(a(".iconpicker-popover.in:not(.inline)").not(this.popover), "hide");
|
940 |
+
this._trigger("iconpickerShow");
|
941 |
+
this.updatePlacement();
|
942 |
+
this.popover.addClass("in");
|
943 |
+
setTimeout(a.proxy(function() {
|
944 |
+
this.popover.css("display", this.isInline() ? "" : "block");
|
945 |
+
this._trigger("iconpickerShown");
|
946 |
+
}, this), this.options.animation ? 300 : 1);
|
947 |
+
},
|
948 |
+
hide: function() {
|
949 |
+
if (!this.popover.hasClass("in")) {
|
950 |
+
return false;
|
951 |
+
}
|
952 |
+
this._trigger("iconpickerHide");
|
953 |
+
this.popover.removeClass("in");
|
954 |
+
setTimeout(a.proxy(function() {
|
955 |
+
this.popover.css("display", "none");
|
956 |
+
this.getSearchInput().val("");
|
957 |
+
this.filter("");
|
958 |
+
this._trigger("iconpickerHidden");
|
959 |
+
}, this), this.options.animation ? 300 : 1);
|
960 |
+
},
|
961 |
+
toggle: function() {
|
962 |
+
if (this.popover.is(":visible")) {
|
963 |
+
this.hide();
|
964 |
+
} else {
|
965 |
+
this.show(true);
|
966 |
+
}
|
967 |
+
},
|
968 |
+
update: function(a, b) {
|
969 |
+
a = a ? a : this.getSourceValue(this.iconpickerValue);
|
970 |
+
this._trigger("iconpickerUpdate");
|
971 |
+
if (b === true) {
|
972 |
+
a = this.setValue(a);
|
973 |
+
} else {
|
974 |
+
a = this.setSourceValue(a);
|
975 |
+
this._updateFormGroupStatus(a !== false);
|
976 |
+
}
|
977 |
+
if (a !== false) {
|
978 |
+
this._updateComponents();
|
979 |
+
}
|
980 |
+
this._trigger("iconpickerUpdated");
|
981 |
+
return a;
|
982 |
+
},
|
983 |
+
destroy: function() {
|
984 |
+
this._trigger("iconpickerDestroy");
|
985 |
+
this.element.removeData("iconpicker").removeData("iconpickerValue").removeClass("iconpicker-element");
|
986 |
+
this._unbindElementEvents();
|
987 |
+
this._unbindWindowEvents();
|
988 |
+
a(this.popover).remove();
|
989 |
+
this._trigger("iconpickerDestroyed");
|
990 |
+
},
|
991 |
+
disable: function() {
|
992 |
+
if (this.hasInput()) {
|
993 |
+
this.input.prop("disabled", true);
|
994 |
+
return true;
|
995 |
+
}
|
996 |
+
return false;
|
997 |
+
},
|
998 |
+
enable: function() {
|
999 |
+
if (this.hasInput()) {
|
1000 |
+
this.input.prop("disabled", false);
|
1001 |
+
return true;
|
1002 |
+
}
|
1003 |
+
return false;
|
1004 |
+
},
|
1005 |
+
isDisabled: function() {
|
1006 |
+
if (this.hasInput()) {
|
1007 |
+
return this.input.prop("disabled") === true;
|
1008 |
+
}
|
1009 |
+
return false;
|
1010 |
+
},
|
1011 |
+
isInline: function() {
|
1012 |
+
return this.options.placement === "inline" || this.popover.hasClass("inline");
|
1013 |
+
}
|
1014 |
+
};
|
1015 |
+
a.iconpicker = c;
|
1016 |
+
a.fn.iconpicker = function(b) {
|
1017 |
+
return this.each(function() {
|
1018 |
+
var d = a(this);
|
1019 |
+
if (!d.data("iconpicker")) {
|
1020 |
+
d.data("iconpicker", new c(this, typeof b === "object" ? b : {}));
|
1021 |
+
}
|
1022 |
+
});
|
1023 |
+
};
|
1024 |
+
c.defaultOptions.icons = [ "fa-500px", "fa-adjust", "fa-adn", "fa-align-center", "fa-align-justify", "fa-align-left", "fa-align-right", "fa-amazon", "fa-ambulance", "fa-american-sign-language-interpreting", "fa-anchor", "fa-android", "fa-angellist", "fa-angle-double-down", "fa-angle-double-left", "fa-angle-double-right", "fa-angle-double-up", "fa-angle-down", "fa-angle-left", "fa-angle-right", "fa-angle-up", "fa-apple", "fa-archive", "fa-area-chart", "fa-arrow-circle-down", "fa-arrow-circle-left", "fa-arrow-circle-o-down", "fa-arrow-circle-o-left", "fa-arrow-circle-o-right", "fa-arrow-circle-o-up", "fa-arrow-circle-right", "fa-arrow-circle-up", "fa-arrow-down", "fa-arrow-left", "fa-arrow-right", "fa-arrow-up", "fa-arrows", "fa-arrows-alt", "fa-arrows-h", "fa-arrows-v", "fa-asl-interpreting", "fa-assistive-listening-systems", "fa-asterisk", "fa-at", "fa-audio-description", "fa-automobile", "fa-backward", "fa-balance-scale", "fa-ban", "fa-bandcamp", "fa-bank", "fa-bar-chart", "fa-bar-chart-o", "fa-barcode", "fa-bars", "fa-bath", "fa-bathtub", "fa-battery", "fa-battery-0", "fa-battery-1", "fa-battery-2", "fa-battery-3", "fa-battery-4", "fa-battery-empty", "fa-battery-full", "fa-battery-half", "fa-battery-quarter", "fa-battery-three-quarters", "fa-bed", "fa-beer", "fa-behance", "fa-behance-square", "fa-bell", "fa-bell-o", "fa-bell-slash", "fa-bell-slash-o", "fa-bicycle", "fa-binoculars", "fa-birthday-cake", "fa-bitbucket", "fa-bitbucket-square", "fa-bitcoin", "fa-black-tie", "fa-blind", "fa-bluetooth", "fa-bluetooth-b", "fa-bold", "fa-bolt", "fa-bomb", "fa-book", "fa-bookmark", "fa-bookmark-o", "fa-braille", "fa-briefcase", "fa-btc", "fa-bug", "fa-building", "fa-building-o", "fa-bullhorn", "fa-bullseye", "fa-bus", "fa-buysellads", "fa-cab", "fa-calculator", "fa-calendar", "fa-calendar-check-o", "fa-calendar-minus-o", "fa-calendar-o", "fa-calendar-plus-o", "fa-calendar-times-o", "fa-camera", "fa-camera-retro", "fa-car", "fa-caret-down", "fa-caret-left", "fa-caret-right", "fa-caret-square-o-down", "fa-caret-square-o-left", "fa-caret-square-o-right", "fa-caret-square-o-up", "fa-caret-up", "fa-cart-arrow-down", "fa-cart-plus", "fa-cc", "fa-cc-amex", "fa-cc-diners-club", "fa-cc-discover", "fa-cc-jcb", "fa-cc-mastercard", "fa-cc-paypal", "fa-cc-stripe", "fa-cc-visa", "fa-certificate", "fa-chain", "fa-chain-broken", "fa-check", "fa-check-circle", "fa-check-circle-o", "fa-check-square", "fa-check-square-o", "fa-chevron-circle-down", "fa-chevron-circle-left", "fa-chevron-circle-right", "fa-chevron-circle-up", "fa-chevron-down", "fa-chevron-left", "fa-chevron-right", "fa-chevron-up", "fa-child", "fa-chrome", "fa-circle", "fa-circle-o", "fa-circle-o-notch", "fa-circle-thin", "fa-clipboard", "fa-clock-o", "fa-clone", "fa-close", "fa-cloud", "fa-cloud-download", "fa-cloud-upload", "fa-cny", "fa-code", "fa-code-fork", "fa-codepen", "fa-codiepie", "fa-coffee", "fa-cog", "fa-cogs", "fa-columns", "fa-comment", "fa-comment-o", "fa-commenting", "fa-commenting-o", "fa-comments", "fa-comments-o", "fa-compass", "fa-compress", "fa-connectdevelop", "fa-contao", "fa-copy", "fa-copyright", "fa-creative-commons", "fa-credit-card", "fa-credit-card-alt", "fa-crop", "fa-crosshairs", "fa-css3", "fa-cube", "fa-cubes", "fa-cut", "fa-cutlery", "fa-dashboard", "fa-dashcube", "fa-database", "fa-deaf", "fa-deafness", "fa-dedent", "fa-delicious", "fa-desktop", "fa-deviantart", "fa-diamond", "fa-digg", "fa-dollar", "fa-dot-circle-o", "fa-download", "fa-dribbble", "fa-drivers-license", "fa-drivers-license-o", "fa-dropbox", "fa-drupal", "fa-edge", "fa-edit", "fa-eercast", "fa-eject", "fa-ellipsis-h", "fa-ellipsis-v", "fa-empire", "fa-envelope", "fa-envelope-o", "fa-envelope-open", "fa-envelope-open-o", "fa-envelope-square", "fa-envira", "fa-eraser", "fa-etsy", "fa-eur", "fa-euro", "fa-exchange", "fa-exclamation", "fa-exclamation-circle", "fa-exclamation-triangle", "fa-expand", "fa-expeditedssl", "fa-external-link", "fa-external-link-square", "fa-eye", "fa-eye-slash", "fa-eyedropper", "fa-fa", "fa-facebook", "fa-facebook-f", "fa-facebook-official", "fa-facebook-square", "fa-fast-backward", "fa-fast-forward", "fa-fax", "fa-feed", "fa-female", "fa-fighter-jet", "fa-file", "fa-file-archive-o", "fa-file-audio-o", "fa-file-code-o", "fa-file-excel-o", "fa-file-image-o", "fa-file-movie-o", "fa-file-o", "fa-file-pdf-o", "fa-file-photo-o", "fa-file-picture-o", "fa-file-powerpoint-o", "fa-file-sound-o", "fa-file-text", "fa-file-text-o", "fa-file-video-o", "fa-file-word-o", "fa-file-zip-o", "fa-files-o", "fa-film", "fa-filter", "fa-fire", "fa-fire-extinguisher", "fa-firefox", "fa-first-order", "fa-flag", "fa-flag-checkered", "fa-flag-o", "fa-flash", "fa-flask", "fa-flickr", "fa-floppy-o", "fa-folder", "fa-folder-o", "fa-folder-open", "fa-folder-open-o", "fa-font", "fa-font-awesome", "fa-fonticons", "fa-fort-awesome", "fa-forumbee", "fa-forward", "fa-foursquare", "fa-free-code-camp", "fa-frown-o", "fa-futbol-o", "fa-gamepad", "fa-gavel", "fa-gbp", "fa-ge", "fa-gear", "fa-gears", "fa-genderless", "fa-get-pocket", "fa-gg", "fa-gg-circle", "fa-gift", "fa-git", "fa-git-square", "fa-github", "fa-github-alt", "fa-github-square", "fa-gitlab", "fa-gittip", "fa-glass", "fa-glide", "fa-glide-g", "fa-globe", "fa-google", "fa-google-plus", "fa-google-plus-circle", "fa-google-plus-official", "fa-google-plus-square", "fa-google-wallet", "fa-graduation-cap", "fa-gratipay", "fa-grav", "fa-group", "fa-h-square", "fa-hacker-news", "fa-hand-grab-o", "fa-hand-lizard-o", "fa-hand-o-down", "fa-hand-o-left", "fa-hand-o-right", "fa-hand-o-up", "fa-hand-paper-o", "fa-hand-peace-o", "fa-hand-pointer-o", "fa-hand-rock-o", "fa-hand-scissors-o", "fa-hand-spock-o", "fa-hand-stop-o", "fa-hard-of-hearing", "fa-hashtag", "fa-hdd-o", "fa-header", "fa-headphones", "fa-heart", "fa-heart-o", "fa-heartbeat", "fa-history", "fa-home", "fa-hospital-o", "fa-hotel", "fa-hourglass", "fa-hourglass-1", "fa-hourglass-2", "fa-hourglass-3", "fa-hourglass-end", "fa-hourglass-half", "fa-hourglass-o", "fa-hourglass-start", "fa-houzz", "fa-html5", "fa-i-cursor", "fa-id-badge", "fa-id-card", "fa-id-card-o", "fa-ils", "fa-image", "fa-imdb", "fa-inbox", "fa-indent", "fa-industry", "fa-info", "fa-info-circle", "fa-inr", "fa-instagram", "fa-institution", "fa-internet-explorer", "fa-intersex", "fa-ioxhost", "fa-italic", "fa-joomla", "fa-jpy", "fa-jsfiddle", "fa-key", "fa-keyboard-o", "fa-krw", "fa-language", "fa-laptop", "fa-lastfm", "fa-lastfm-square", "fa-leaf", "fa-leanpub", "fa-legal", "fa-lemon-o", "fa-level-down", "fa-level-up", "fa-life-bouy", "fa-life-buoy", "fa-life-ring", "fa-life-saver", "fa-lightbulb-o", "fa-line-chart", "fa-link", "fa-linkedin", "fa-linkedin-square", "fa-linux", "fa-list", "fa-list-alt", "fa-list-ol", "fa-list-ul", "fa-location-arrow", "fa-lock", "fa-long-arrow-down", "fa-long-arrow-left", "fa-long-arrow-right", "fa-long-arrow-up", "fa-low-vision", "fa-magic", "fa-magnet", "fa-mail-forward", "fa-mail-reply", "fa-mail-reply-all", "fa-male", "fa-map", "fa-map-marker", "fa-map-o", "fa-map-pin", "fa-map-signs", "fa-mars", "fa-mars-double", "fa-mars-stroke", "fa-mars-stroke-h", "fa-mars-stroke-v", "fa-maxcdn", "fa-meanpath", "fa-medium", "fa-medkit", "fa-meetup", "fa-meh-o", "fa-mercury", "fa-microchip", "fa-microphone", "fa-microphone-slash", "fa-minus", "fa-minus-circle", "fa-minus-square", "fa-minus-square-o", "fa-mixcloud", "fa-mobile", "fa-mobile-phone", "fa-modx", "fa-money", "fa-moon-o", "fa-mortar-board", "fa-motorcycle", "fa-mouse-pointer", "fa-music", "fa-navicon", "fa-neuter", "fa-newspaper-o", "fa-object-group", "fa-object-ungroup", "fa-odnoklassniki", "fa-odnoklassniki-square", "fa-opencart", "fa-openid", "fa-opera", "fa-optin-monster", "fa-outdent", "fa-pagelines", "fa-paint-brush", "fa-paper-plane", "fa-paper-plane-o", "fa-paperclip", "fa-paragraph", "fa-paste", "fa-pause", "fa-pause-circle", "fa-pause-circle-o", "fa-paw", "fa-paypal", "fa-pencil", "fa-pencil-square", "fa-pencil-square-o", "fa-percent", "fa-phone", "fa-phone-square", "fa-photo", "fa-picture-o", "fa-pie-chart", "fa-pied-piper", "fa-pied-piper-alt", "fa-pied-piper-pp", "fa-pinterest", "fa-pinterest-p", "fa-pinterest-square", "fa-plane", "fa-play", "fa-play-circle", "fa-play-circle-o", "fa-plug", "fa-plus", "fa-plus-circle", "fa-plus-square", "fa-plus-square-o", "fa-podcast", "fa-power-off", "fa-print", "fa-product-hunt", "fa-puzzle-piece", "fa-qq", "fa-qrcode", "fa-question", "fa-question-circle", "fa-question-circle-o", "fa-quora", "fa-quote-left", "fa-quote-right", "fa-ra", "fa-random", "fa-ravelry", "fa-rebel", "fa-recycle", "fa-reddit", "fa-reddit-alien", "fa-reddit-square", "fa-refresh", "fa-registered", "fa-remove", "fa-renren", "fa-reorder", "fa-repeat", "fa-reply", "fa-reply-all", "fa-resistance", "fa-retweet", "fa-rmb", "fa-road", "fa-rocket", "fa-rotate-left", "fa-rotate-right", "fa-rouble", "fa-rss", "fa-rss-square", "fa-rub", "fa-ruble", "fa-rupee", "fa-s15", "fa-safari", "fa-save", "fa-scissors", "fa-scribd", "fa-search", "fa-search-minus", "fa-search-plus", "fa-sellsy", "fa-send", "fa-send-o", "fa-server", "fa-share", "fa-share-alt", "fa-share-alt-square", "fa-share-square", "fa-share-square-o", "fa-shekel", "fa-sheqel", "fa-shield", "fa-ship", "fa-shirtsinbulk", "fa-shopping-bag", "fa-shopping-basket", "fa-shopping-cart", "fa-shower", "fa-sign-in", "fa-sign-language", "fa-sign-out", "fa-signal", "fa-signing", "fa-simplybuilt", "fa-sitemap", "fa-skyatlas", "fa-skype", "fa-slack", "fa-sliders", "fa-slideshare", "fa-smile-o", "fa-snapchat", "fa-snapchat-ghost", "fa-snapchat-square", "fa-snowflake-o", "fa-soccer-ball-o", "fa-sort", "fa-sort-alpha-asc", "fa-sort-alpha-desc", "fa-sort-amount-asc", "fa-sort-amount-desc", "fa-sort-asc", "fa-sort-desc", "fa-sort-down", "fa-sort-numeric-asc", "fa-sort-numeric-desc", "fa-sort-up", "fa-soundcloud", "fa-space-shuttle", "fa-spinner", "fa-spoon", "fa-spotify", "fa-square", "fa-square-o", "fa-stack-exchange", "fa-stack-overflow", "fa-star", "fa-star-half", "fa-star-half-empty", "fa-star-half-full", "fa-star-half-o", "fa-star-o", "fa-steam", "fa-steam-square", "fa-step-backward", "fa-step-forward", "fa-stethoscope", "fa-sticky-note", "fa-sticky-note-o", "fa-stop", "fa-stop-circle", "fa-stop-circle-o", "fa-street-view", "fa-strikethrough", "fa-stumbleupon", "fa-stumbleupon-circle", "fa-subscript", "fa-subway", "fa-suitcase", "fa-sun-o", "fa-superpowers", "fa-superscript", "fa-support", "fa-table", "fa-tablet", "fa-tachometer", "fa-tag", "fa-tags", "fa-tasks", "fa-taxi", "fa-telegram", "fa-television", "fa-tencent-weibo", "fa-terminal", "fa-text-height", "fa-text-width", "fa-th", "fa-th-large", "fa-th-list", "fa-themeisle", "fa-thermometer", "fa-thermometer-0", "fa-thermometer-1", "fa-thermometer-2", "fa-thermometer-3", "fa-thermometer-4", "fa-thermometer-empty", "fa-thermometer-full", "fa-thermometer-half", "fa-thermometer-quarter", "fa-thermometer-three-quarters", "fa-thumb-tack", "fa-thumbs-down", "fa-thumbs-o-down", "fa-thumbs-o-up", "fa-thumbs-up", "fa-ticket", "fa-times", "fa-times-circle", "fa-times-circle-o", "fa-times-rectangle", "fa-times-rectangle-o", "fa-tint", "fa-toggle-down", "fa-toggle-left", "fa-toggle-off", "fa-toggle-on", "fa-toggle-right", "fa-toggle-up", "fa-trademark", "fa-train", "fa-transgender", "fa-transgender-alt", "fa-trash", "fa-trash-o", "fa-tree", "fa-trello", "fa-tripadvisor", "fa-trophy", "fa-truck", "fa-try", "fa-tty", "fa-tumblr", "fa-tumblr-square", "fa-turkish-lira", "fa-tv", "fa-twitch", "fa-twitter", "fa-twitter-square", "fa-umbrella", "fa-underline", "fa-undo", "fa-universal-access", "fa-university", "fa-unlink", "fa-unlock", "fa-unlock-alt", "fa-unsorted", "fa-upload", "fa-usb", "fa-usd", "fa-user", "fa-user-circle", "fa-user-circle-o", "fa-user-md", "fa-user-o", "fa-user-plus", "fa-user-secret", "fa-user-times", "fa-users", "fa-vcard", "fa-vcard-o", "fa-venus", "fa-venus-double", "fa-venus-mars", "fa-viacoin", "fa-viadeo", "fa-viadeo-square", "fa-video-camera", "fa-vimeo", "fa-vimeo-square", "fa-vine", "fa-vk", "fa-volume-control-phone", "fa-volume-down", "fa-volume-off", "fa-volume-up", "fa-warning", "fa-wechat", "fa-weibo", "fa-weixin", "fa-whatsapp", "fa-wheelchair", "fa-wheelchair-alt", "fa-wifi", "fa-wikipedia-w", "fa-window-close", "fa-window-close-o", "fa-window-maximize", "fa-window-minimize", "fa-window-restore", "fa-windows", "fa-won", "fa-wordpress", "fa-wpbeginner", "fa-wpexplorer", "fa-wpforms", "fa-wrench", "fa-xing", "fa-xing-square", "fa-y-combinator", "fa-y-combinator-square", "fa-yahoo", "fa-yc", "fa-yc-square", "fa-yelp", "fa-yen", "fa-yoast", "fa-youtube", "fa-youtube-play", "fa-youtube-square" ];
|
1025 |
+
});
|
js/hs.png
CHANGED
File without changes
|
js/hv.png
CHANGED
File without changes
|
js/jquery-cookie.js
CHANGED
File without changes
|
js/jscolor.js
CHANGED
File without changes
|
js/md5.js
CHANGED
File without changes
|
js/themes/classic.js
CHANGED
@@ -47,7 +47,6 @@ jQuery(document).on("wplc_start_chat", function( e ) {
|
|
47 |
});
|
48 |
jQuery(document).on( "wplc_open_chat_1", function( e ) {
|
49 |
|
50 |
-
|
51 |
jQuery('#wp-live-chat').removeClass("wplc_close");
|
52 |
jQuery('#wp-live-chat').addClass("wplc_open");
|
53 |
jQuery("#wp-live-chat-react").hide();
|
@@ -65,15 +64,15 @@ jQuery(document).on( "wplc_open_chat_1", function( e ) {
|
|
65 |
}
|
66 |
|
67 |
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
|
78 |
|
79 |
});
|
@@ -81,12 +80,15 @@ jQuery(document).on( "wplc_open_chat_1", function( e ) {
|
|
81 |
|
82 |
jQuery(document).on( "wplc_open_chat_2", function( e ) {
|
83 |
|
84 |
-
|
85 |
|
86 |
if(!jQuery("#wp-live-chat").hasClass("wplc_open")){
|
87 |
jQuery("#wplc_chatmsg").focus();
|
88 |
}
|
89 |
|
|
|
|
|
|
|
90 |
wplc_chat_status = Cookies.get('wplc_chat_status');
|
91 |
if (typeof e.wplc_online !== "undefined" && e.wplc_online === true) {
|
92 |
jQuery("#wp-live-chat-4").show();
|
@@ -102,17 +104,17 @@ jQuery(document).on( "wplc_open_chat_2", function( e ) {
|
|
102 |
jQuery("#wp-live-chat-1").css("cursor","pointer");
|
103 |
}
|
104 |
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
});
|
110 |
|
111 |
jQuery(document).ready(function() {
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
jQuery("body").on("click", ".wplc_retry_chat", function() {
|
117 |
Cookies.set('wplc_chat_status', 5);
|
118 |
jQuery("#wplc_chatbox").html("");
|
@@ -125,7 +127,7 @@ jQuery(document).ready(function() {
|
|
125 |
jQuery("#wplc_hovercard").hide();
|
126 |
wplc_is_chat_open = true;
|
127 |
jQuery.event.trigger({type: "wplc_open_chat"});
|
128 |
-
|
129 |
|
130 |
});
|
131 |
|
@@ -139,4 +141,23 @@ jQuery(document).ready(function() {
|
|
139 |
jQuery("#wplc-chat-alert").removeClass('is-active');
|
140 |
});
|
141 |
|
142 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
});
|
48 |
jQuery(document).on( "wplc_open_chat_1", function( e ) {
|
49 |
|
|
|
50 |
jQuery('#wp-live-chat').removeClass("wplc_close");
|
51 |
jQuery('#wp-live-chat').addClass("wplc_open");
|
52 |
jQuery("#wp-live-chat-react").hide();
|
64 |
}
|
65 |
|
66 |
|
67 |
+
jQuery(function() {
|
68 |
+
jQuery( "#wp-live-chat" ).draggable({
|
69 |
+
handle: "#wp-live-chat-header",
|
70 |
+
drag: function( event, ui ) {
|
71 |
+
jQuery(this).css("right","");
|
72 |
+
jQuery(this).css("bottom","inherit");
|
73 |
+
}
|
74 |
+
});
|
75 |
+
});
|
76 |
|
77 |
|
78 |
});
|
80 |
|
81 |
jQuery(document).on( "wplc_open_chat_2", function( e ) {
|
82 |
|
83 |
+
jQuery("#wp-live-chat-2").hide();
|
84 |
|
85 |
if(!jQuery("#wp-live-chat").hasClass("wplc_open")){
|
86 |
jQuery("#wplc_chatmsg").focus();
|
87 |
}
|
88 |
|
89 |
+
jQuery("#wp-live-chat-header").addClass("active");
|
90 |
+
jQuery("#wp-live-chat").addClass("mobile-active");
|
91 |
+
|
92 |
wplc_chat_status = Cookies.get('wplc_chat_status');
|
93 |
if (typeof e.wplc_online !== "undefined" && e.wplc_online === true) {
|
94 |
jQuery("#wp-live-chat-4").show();
|
104 |
jQuery("#wp-live-chat-1").css("cursor","pointer");
|
105 |
}
|
106 |
|
107 |
+
jQuery("#wp-live-chat-3").hide();
|
108 |
+
jQuery("#wp-live-chat-close").hide();
|
109 |
+
//jQuery("#wp-live-chat-minimize").css("right","23px");
|
110 |
+
Cookies.set('wplc_minimize', "", { expires: 1, path: '/' });
|
111 |
});
|
112 |
|
113 |
jQuery(document).ready(function() {
|
114 |
+
//opens chat when clicked on top bar
|
115 |
+
jQuery("body").on("click", "#wp-live-chat-1", function() {
|
116 |
+
//jQuery.event.trigger({type: "wplc_open_chat"});
|
117 |
+
});
|
118 |
jQuery("body").on("click", ".wplc_retry_chat", function() {
|
119 |
Cookies.set('wplc_chat_status', 5);
|
120 |
jQuery("#wplc_chatbox").html("");
|
127 |
jQuery("#wplc_hovercard").hide();
|
128 |
wplc_is_chat_open = true;
|
129 |
jQuery.event.trigger({type: "wplc_open_chat"});
|
130 |
+
jQuery("#wp-live-chat-minimize").show();
|
131 |
|
132 |
});
|
133 |
|
141 |
jQuery("#wplc-chat-alert").removeClass('is-active');
|
142 |
});
|
143 |
|
144 |
+
jQuery("body").on("click", "#wp-live-chat-header", function(){
|
145 |
+
//if (!wplc_is_chat_open) {
|
146 |
+
|
147 |
+
if (jQuery(this).hasClass('active')) {
|
148 |
+
jQuery(this).removeClass('active');
|
149 |
+
jQuery.event.trigger({type: "wplc_minimize_chat"});
|
150 |
+
|
151 |
+
} else {
|
152 |
+
//jQuery(this).addClass('active');
|
153 |
+
jQuery.event.trigger({type: "wplc_open_chat"});
|
154 |
+
jQuery("#wp-live-chat-minimize").show();
|
155 |
+
|
156 |
+
}
|
157 |
+
|
158 |
+
|
159 |
+
|
160 |
+
//}
|
161 |
+
});
|
162 |
+
|
163 |
+
});
|
js/themes/modern.js
CHANGED
@@ -1,3 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
2 |
|
3 |
jQuery(document).on("wplc_minimize_chat", function( e ) {
|
@@ -41,8 +57,8 @@ jQuery(document).on("wplc_minimize_chat", function( e ) {
|
|
41 |
});
|
42 |
|
43 |
jQuery(document).on("wplc_start_chat", function( e ) {
|
44 |
-
|
45 |
-
|
46 |
/* jQuery("#wp-live-chat-3").show(); */
|
47 |
jQuery.event.trigger({type: "wplc_open_chat_1"});
|
48 |
jQuery.event.trigger({type: "wplc_open_chat_2", wplc_online: wplc_online});
|
@@ -74,36 +90,124 @@ jQuery(document).on("wplc_agent_joined", function(e) {
|
|
74 |
|
75 |
if (typeof e.ndata.other.email !== "undefined") { temail = e.ndata.other.email; }
|
76 |
if (typeof e.ndata.other.name !== "undefined") { tname = e.ndata.other.name; }
|
77 |
-
if (typeof e.ndata.other.aid !== "undefined") { taid = e.ndata.other.aid; }
|
78 |
if (typeof e.ndata.other.agent_tagline !== "undefined") { ta_tagline = e.ndata.other.agent_tagline; }
|
79 |
if (typeof e.ndata.other.agent_bio !== "undefined") { ta_bio = e.ndata.other.agent_bio; }
|
80 |
if (typeof e.ndata.other.social_links !== "undefined") { ta_social_links = e.ndata.other.social_links; }
|
81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
|
83 |
-
|
|
|
84 |
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
|
89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
|
91 |
-
|
92 |
-
if ( ! jQuery( '#agent_grav_'+taid ).length ) {
|
93 |
-
jQuery('<p/>', {
|
94 |
-
'class': '',
|
95 |
-
'style': 'text-align:center;',
|
96 |
-
html: '<img class="img-thumbnail img-circle wplc_thumb32 wplc_agent_involved" style="max-width:inherit;" id="agent_grav_'+taid+'" title="'+tname+'" src="'+timageurl+'?s=40" /><br /><span class="wplc_agent_name wplc-color-2">'+tname+'</span>'+ta_tagline+ta_bio+ta_social_links
|
97 |
-
}).appendTo('.wplc_agent_info');
|
98 |
}
|
99 |
-
var csst = "url(https://www.gravatar.com/avatar/20a6e5c8b75ce87f4896f46ed6f49832?s=60);";
|
100 |
|
101 |
-
|
102 |
-
jQuery("#wplc_chatbox").css("top",
|
103 |
-
jQuery("#wplc_chatbox_header").height()+18+"px"
|
104 |
-
);
|
105 |
});
|
106 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
|
108 |
|
109 |
jQuery(document).on("wplc_animation_done", function(e) {
|
@@ -141,31 +245,36 @@ jQuery(document).on("wplc_animation_done", function(e) {
|
|
141 |
|
142 |
});
|
143 |
jQuery(document).on( "wplc_open_chat_2", function( e ) {
|
144 |
-
|
145 |
-
|
146 |
|
147 |
-
|
148 |
|
149 |
if(!jQuery("#wp-live-chat-header").hasClass("active")){
|
150 |
jQuery("#wplc_chatmsg").focus();
|
151 |
}
|
152 |
|
153 |
jQuery("#wp-live-chat-header").addClass("active");
|
|
|
|
|
154 |
|
155 |
wplc_chat_status = Cookies.get('wplc_chat_status');
|
156 |
if (typeof e.wplc_online !== "undefined" && e.wplc_online === true) {
|
157 |
-
|
158 |
jQuery("#wplc_social_holder").show();
|
159 |
jQuery("#nifty_ratings_holder").show();
|
160 |
jQuery.event.trigger({type: "wplc_animation_done"});
|
161 |
|
162 |
|
163 |
}
|
|
|
|
|
|
|
164 |
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
|
170 |
|
171 |
|
@@ -174,6 +283,7 @@ jQuery(document).on( "wplc_open_chat_2", function( e ) {
|
|
174 |
|
175 |
|
176 |
var wplc_leave_window_alone = false;
|
|
|
177 |
|
178 |
jQuery(document).ready(function() {
|
179 |
|
@@ -184,36 +294,36 @@ jQuery(document).ready(function() {
|
|
184 |
/**
|
185 |
* The +18px is to compensate for the 18px of padding at the bottom of the header box
|
186 |
*/
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
jQuery("#wplc_logo").show();
|
192 |
-
}
|
193 |
-
else {
|
194 |
// going down
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
/**
|
199 |
* The +18px is to compensate for the 18px of padding at the bottom of the header box
|
200 |
*/
|
201 |
-
|
202 |
-
jQuery("#wplc_chatbox").css("top",
|
203 |
-
jQuery("#wplc_chatbox_header").height()+18+"px"
|
204 |
-
);
|
205 |
-
jQuery("#wplc_logo").hide();
|
206 |
|
207 |
}
|
208 |
|
209 |
});
|
210 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
|
212 |
-
|
213 |
-
|
214 |
|
215 |
|
216 |
-
|
217 |
|
218 |
|
219 |
jQuery("body").on("click", ".wplc_retry_chat", function() {
|
@@ -239,7 +349,8 @@ jQuery(document).ready(function() {
|
|
239 |
jQuery(this).addClass('active');
|
240 |
|
241 |
wplc_chat_status = Cookies.get('wplc_chat_status');
|
242 |
-
|
|
|
243 |
jQuery("#speeching_button").click();
|
244 |
}
|
245 |
|
@@ -262,7 +373,10 @@ jQuery(document).ready(function() {
|
|
262 |
jQuery("body").on("click", "#wp-live-chat-minimize", function() {
|
263 |
|
264 |
jQuery("#wp-live-chat-header").removeClass('active');
|
265 |
-
})
|
|
|
|
|
|
|
266 |
|
267 |
|
268 |
|
@@ -271,4 +385,76 @@ jQuery(document).ready(function() {
|
|
271 |
|
272 |
});
|
273 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
|
1 |
+
jQuery(document).on("bleeper_agent_disconnected", function(e) {
|
2 |
+
var taid = jQuery(".wplc_agent_info").attr('aid');
|
3 |
+
if (taid == e.ndata.aid) {
|
4 |
+
jQuery(".wplc_agent_info").html("");
|
5 |
+
wplc_animate_agent_header_down();
|
6 |
+
jQuery("#wplc_chatbox").css("top","18px");
|
7 |
+
}
|
8 |
+
});
|
9 |
+
jQuery(document).on("bleeper_agent_left", function(e) {
|
10 |
+
var taid = jQuery(".wplc_agent_info").attr('aid');
|
11 |
+
if (taid == e.ndata.agent) {
|
12 |
+
jQuery(".wplc_agent_info").html("");
|
13 |
+
wplc_animate_agent_header_down();
|
14 |
+
jQuery("#wplc_chatbox").css("top","18px");
|
15 |
+
}
|
16 |
+
});
|
17 |
|
18 |
|
19 |
jQuery(document).on("wplc_minimize_chat", function( e ) {
|
57 |
});
|
58 |
|
59 |
jQuery(document).on("wplc_start_chat", function( e ) {
|
60 |
+
jQuery("#wp-live-chat-2-inner").hide("slow");
|
61 |
+
/* changed in version 7 as we now allow users to start typing immediately */
|
62 |
/* jQuery("#wp-live-chat-3").show(); */
|
63 |
jQuery.event.trigger({type: "wplc_open_chat_1"});
|
64 |
jQuery.event.trigger({type: "wplc_open_chat_2", wplc_online: wplc_online});
|
90 |
|
91 |
if (typeof e.ndata.other.email !== "undefined") { temail = e.ndata.other.email; }
|
92 |
if (typeof e.ndata.other.name !== "undefined") { tname = e.ndata.other.name; }
|
93 |
+
if (typeof e.ndata.other.aid !== "undefined") { taid = parseInt(e.ndata.other.aid); }
|
94 |
if (typeof e.ndata.other.agent_tagline !== "undefined") { ta_tagline = e.ndata.other.agent_tagline; }
|
95 |
if (typeof e.ndata.other.agent_bio !== "undefined") { ta_bio = e.ndata.other.agent_bio; }
|
96 |
if (typeof e.ndata.other.social_links !== "undefined") { ta_social_links = e.ndata.other.social_links; }
|
97 |
|
98 |
+
//Ensure this agent ID is valid before proceeding
|
99 |
+
if(!isNaN(taid)){
|
100 |
+
|
101 |
+
jQuery(".wplc_no_answer").remove();
|
102 |
+
|
103 |
+
jQuery(".admin_chat_name").html(tname);
|
104 |
+
wplc_node_pair_name = tname;
|
105 |
+
wplc_agent_name = tname;
|
106 |
+
|
107 |
+
var timageurl = 'https://www.gravatar.com/avatar/'+temail;
|
108 |
+
|
109 |
+
if(jQuery(".wplc_agent_info").html().trim() === "" || typeof jQuery(".wplc_agent_info").attr("aid") === "undefined"){
|
110 |
+
//No Agents have joined yet
|
111 |
+
jQuery(".wplc_agent_info").html('');
|
112 |
+
jQuery(".wplc_agent_info").attr("aid",taid);
|
113 |
+
|
114 |
+
if ( ! jQuery( '#agent_grav_'+taid ).length ) {
|
115 |
+
jQuery('<p/>', {
|
116 |
+
'class': '',
|
117 |
+
'style': 'text-align:center;',
|
118 |
+
html: '<img class="img-thumbnail img-circle wplc_thumb32 wplc_agent_involved" style="max-width:inherit;" id="agent_grav_'+taid+'" title="'+tname+'" src="'+timageurl+'?s=40" /><br /><span class="wplc_agent_name wplc-color-2">'+tname+'</span>'+ta_tagline+ta_bio+ta_social_links
|
119 |
+
}).appendTo('.wplc_agent_info');
|
120 |
+
|
121 |
+
jQuery('<span/>', {
|
122 |
+
'class': 'bleeper_pullup down',
|
123 |
+
html: '<i class="fa fa-angle-up"></i>'
|
124 |
+
|
125 |
+
}).appendTo('.wplc_agent_info');
|
126 |
+
}
|
127 |
+
|
128 |
+
var csst = "url(https://www.gravatar.com/avatar/20a6e5c8b75ce87f4896f46ed6f49832?s=60);";
|
129 |
+
|
130 |
+
jQuery("#wplc_chatbox_header_bg").css('background-image', 'url('+timageurl+'?s=380)');
|
131 |
+
jQuery("#wplc_chatbox").css("top",
|
132 |
+
jQuery("#wplc_chatbox_header").height()+18+"px"
|
133 |
+
);
|
134 |
+
|
135 |
+
} else {
|
136 |
+
|
137 |
+
var wplc_tracked_agents = jQuery(".wplc_agent_info").attr("aid");
|
138 |
+
var wplc_tracked_agents_object = wplc_tracked_agents.split(",");
|
139 |
+
|
140 |
+
var wplc_tracked_agent_match = false; //No duplicates found yet
|
141 |
+
for(var i in wplc_tracked_agents_object){
|
142 |
+
var wplc_indexed_agent_id = parseInt(wplc_tracked_agents_object[i]);
|
143 |
+
|
144 |
+
if(wplc_indexed_agent_id === taid){
|
145 |
+
//Match - This agent is already being tracked
|
146 |
+
wplc_tracked_agent_match = true;
|
147 |
+
}
|
148 |
+
}
|
149 |
+
|
150 |
+
if(!wplc_tracked_agent_match) {
|
151 |
+
//Agent is not being tracked yet
|
152 |
+
wplc_tracked_agents += "," + taid;
|
153 |
+
jQuery(".wplc_agent_info").attr("aid", wplc_tracked_agents);
|
154 |
+
|
155 |
+
//Update Names
|
156 |
+
var wplc_current_agent_names = jQuery(".wplc_agent_name").text();
|
157 |
+
jQuery(".wplc_agent_name").text(wplc_current_agent_names + ", " + tname);
|
158 |
+
|
159 |
+
//Hide the tagline, it is not needed for two agents in my opinion - Dylan Auty
|
160 |
+
jQuery(".wplc_agent_tagline").hide();
|
161 |
+
|
162 |
+
//Hide social links, it is too cluttered to add more here
|
163 |
+
jQuery(".wplc_agent_social_links").hide();
|
164 |
|
165 |
+
//Change the way the images are displayed
|
166 |
+
jQuery("img.wplc_agent_involved").removeClass("wplc_thumb32").addClass("wplc_thumb16_stacked");
|
167 |
|
168 |
+
//Add the new agents image as well
|
169 |
+
var wplc_new_agent_grav = '<img class="img-thumbnail img-circle wplc_thumb16_stacked wplc_agent_involved" style="max-width:inherit;" id="agent_grav_'+taid+'" title="'+tname+'" src="'+timageurl+'?s=40" />';
|
170 |
+
jQuery(wplc_new_agent_grav).insertAfter("img.wplc_agent_involved:last");
|
171 |
|
172 |
+
//Update the height of the header
|
173 |
+
jQuery("#wplc_chatbox_header").css("max-height", jQuery("#wplc_chatbox_header").outerHeight());
|
174 |
+
jQuery("#wplc_chatbox").css("top", jQuery("#wplc_chatbox_header").height()+"px"); //Final update incase anything has changes
|
175 |
+
|
176 |
+
|
177 |
+
jQuery("#wplc_chatbox_header_bg").css("background-image", "none");
|
178 |
+
}
|
179 |
|
180 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
}
|
|
|
182 |
|
183 |
+
|
|
|
|
|
|
|
184 |
});
|
185 |
|
186 |
+
jQuery(document).on("bleeper_build_involved_agents_header", function(e){
|
187 |
+
if(typeof e.ndata !== "undefined"){
|
188 |
+
if(typeof e.ndata.chatid !== "undefined" && typeof e.ndata.agents !== "undefined"){
|
189 |
+
if(e.ndata.chatid === chatid){
|
190 |
+
var agent_match = e.ndata.agents;
|
191 |
+
for(var i in agent_match){
|
192 |
+
var current_agent = agent_match[i];
|
193 |
+
|
194 |
+
if(typeof wplc_agent_data[current_agent] !== "undefined"){
|
195 |
+
wplc_agent_data[current_agent].md5;
|
196 |
+
wplc_agent_data[current_agent].name;
|
197 |
+
|
198 |
+
var other = {
|
199 |
+
email: wplc_agent_data[current_agent].md5,
|
200 |
+
name: wplc_agent_data[current_agent].name,
|
201 |
+
aid: current_agent
|
202 |
+
};
|
203 |
+
|
204 |
+
jQuery.event.trigger({type: "wplc_agent_joined", ndata: {other: other}});
|
205 |
+
}
|
206 |
+
}
|
207 |
+
}
|
208 |
+
}
|
209 |
+
}
|
210 |
+
});
|
211 |
|
212 |
|
213 |
jQuery(document).on("wplc_animation_done", function(e) {
|
245 |
|
246 |
});
|
247 |
jQuery(document).on( "wplc_open_chat_2", function( e ) {
|
248 |
+
jQuery("#wp-live-chat-1").hide();
|
249 |
+
jQuery("#wp-live-chat-2-inner").hide();
|
250 |
|
251 |
+
jQuery("#wp-live-chat-2").show();
|
252 |
|
253 |
if(!jQuery("#wp-live-chat-header").hasClass("active")){
|
254 |
jQuery("#wplc_chatmsg").focus();
|
255 |
}
|
256 |
|
257 |
jQuery("#wp-live-chat-header").addClass("active");
|
258 |
+
jQuery("#wp-live-chat").addClass("mobile-active");
|
259 |
+
|
260 |
|
261 |
wplc_chat_status = Cookies.get('wplc_chat_status');
|
262 |
if (typeof e.wplc_online !== "undefined" && e.wplc_online === true) {
|
263 |
+
jQuery("#wp-live-chat-4").show();
|
264 |
jQuery("#wplc_social_holder").show();
|
265 |
jQuery("#nifty_ratings_holder").show();
|
266 |
jQuery.event.trigger({type: "wplc_animation_done"});
|
267 |
|
268 |
|
269 |
}
|
270 |
+
setTimeout(function() {
|
271 |
+
wplc_scroll_to_bottom();
|
272 |
+
},1000);
|
273 |
|
274 |
+
jQuery("#wp-live-chat-3").hide();
|
275 |
+
jQuery("#wplc_chatmsg").focus();
|
276 |
+
jQuery("#wp-live-chat-minimize").css("right","23px");
|
277 |
+
Cookies.set('wplc_minimize', "", { expires: 1, path: '/' });
|
278 |
|
279 |
|
280 |
|
283 |
|
284 |
|
285 |
var wplc_leave_window_alone = false;
|
286 |
+
var wplc_currently_animating_agent_header = false;
|
287 |
|
288 |
jQuery(document).ready(function() {
|
289 |
|
294 |
/**
|
295 |
* The +18px is to compensate for the 18px of padding at the bottom of the header box
|
296 |
*/
|
297 |
+
|
298 |
+
wplc_animate_agent_header_up();
|
299 |
+
|
300 |
+
} else {
|
|
|
|
|
|
|
301 |
// going down
|
|
|
|
|
|
|
302 |
/**
|
303 |
* The +18px is to compensate for the 18px of padding at the bottom of the header box
|
304 |
*/
|
305 |
+
wplc_animate_agent_header_down();
|
|
|
|
|
|
|
|
|
306 |
|
307 |
}
|
308 |
|
309 |
});
|
310 |
|
311 |
+
jQuery("body").on("click", ".bleeper_pullup", function() {
|
312 |
+
if (jQuery(".bleeper_pullup").hasClass('down')) {
|
313 |
+
wplc_animate_agent_header_down();
|
314 |
+
|
315 |
+
} else {
|
316 |
+
wplc_animate_agent_header_up();
|
317 |
+
|
318 |
+
}
|
319 |
+
});
|
320 |
+
|
321 |
|
322 |
+
//opens chat when clicked on top bar
|
323 |
+
jQuery("body").on("click", "#wp-live-chat-header", function() {
|
324 |
|
325 |
|
326 |
+
});
|
327 |
|
328 |
|
329 |
jQuery("body").on("click", ".wplc_retry_chat", function() {
|
349 |
jQuery(this).addClass('active');
|
350 |
|
351 |
wplc_chat_status = Cookies.get('wplc_chat_status');
|
352 |
+
nc_status = Cookies.get('nc_status');
|
353 |
+
if (parseInt(wplc_chat_status) == 3 || parseInt(wplc_chat_status) == 2 || parseInt(wplc_chat_status) == 0 || parseInt(wplc_chat_status) == 12 || parseInt(wplc_chat_status) == 10 || nc_status === 'active') {
|
354 |
jQuery("#speeching_button").click();
|
355 |
}
|
356 |
|
373 |
jQuery("body").on("click", "#wp-live-chat-minimize", function() {
|
374 |
|
375 |
jQuery("#wp-live-chat-header").removeClass('active');
|
376 |
+
});
|
377 |
+
|
378 |
+
|
379 |
+
|
380 |
|
381 |
|
382 |
|
385 |
|
386 |
});
|
387 |
|
388 |
+
|
389 |
+
|
390 |
+
function wplc_animate_agent_header_up() {
|
391 |
+
if(!wplc_currently_animating_agent_header && jQuery("#wplc_chatbox_header").hasClass("wplc-shrink") && jQuery('#wplc_chatbox_header .wplc_agent_info:first-child').html() !== ""){
|
392 |
+
wplc_currently_animating_agent_header = true;
|
393 |
+
jQuery("#wplc_chatbox_header").removeClass("wplc-shrink");
|
394 |
+
|
395 |
+
jQuery("#wplc_chatbox_header").animate(
|
396 |
+
{ maxHeight: "280px", },
|
397 |
+
{
|
398 |
+
duration: 700,
|
399 |
+
complete: function() {
|
400 |
+
// Animation complete
|
401 |
+
|
402 |
+
jQuery("#wplc_logo").show();
|
403 |
+
wplc_currently_animating_agent_header = false;
|
404 |
+
|
405 |
+
jQuery("#wplc_chatbox_header").css("max-height", jQuery("#wplc_chatbox_header").outerHeight());
|
406 |
+
jQuery("#wplc_chatbox").css("top", jQuery("#wplc_chatbox_header").height()+18+"px"); //Final update incase anything has changes
|
407 |
+
|
408 |
+
|
409 |
+
},
|
410 |
+
progress: function() {
|
411 |
+
jQuery("#wplc_chatbox").css("top", jQuery("#wplc_chatbox_header").height()+18+"px"); //Live movement updates
|
412 |
+
|
413 |
+
}
|
414 |
+
}
|
415 |
+
);
|
416 |
+
}
|
417 |
+
jQuery(".bleeper_pullup").removeClass('up');
|
418 |
+
jQuery(".bleeper_pullup").addClass('down');
|
419 |
+
jQuery(".bleeper_pullup").html("<i class='fa fa-angle-up'></i>");
|
420 |
+
jQuery(".bleeper_pullup").css('bottom','5px');
|
421 |
+
}
|
422 |
+
function wplc_animate_agent_header_down() {
|
423 |
+
if(!wplc_currently_animating_agent_header && !jQuery("#wplc_chatbox_header").hasClass("wplc-shrink") && jQuery('#wplc_chatbox_header .wplc_agent_info:first-child').html() !== ""){
|
424 |
+
wplc_currently_animating_agent_header = true;
|
425 |
+
|
426 |
+
jQuery("#wplc_chatbox_header").addClass("wplc-shrink");
|
427 |
+
|
428 |
+
jQuery("#wplc_chatbox").css("top", "50px");
|
429 |
+
|
430 |
+
|
431 |
+
jQuery("#wplc_chatbox_header").animate(
|
432 |
+
{ height: "50px", maxHeight: "50px"},
|
433 |
+
{
|
434 |
+
duration: 200,
|
435 |
+
start: function(){
|
436 |
+
jQuery("#wplc_logo").hide();
|
437 |
+
|
438 |
+
},
|
439 |
+
complete: function() {
|
440 |
+
// Animation complete
|
441 |
+
wplc_currently_animating_agent_header = false;
|
442 |
+
|
443 |
+
jQuery("#wplc_chatbox_header").css("max-height", "50px");
|
444 |
+
jQuery("#wplc_chatbox_header").css("height", "auto");
|
445 |
+
|
446 |
+
//jQuery("#wplc_chatbox").css("top", jQuery("#wplc_chatbox_header").height()+18+"px");
|
447 |
+
|
448 |
+
|
449 |
+
}
|
450 |
+
}
|
451 |
+
);
|
452 |
+
|
453 |
+
}
|
454 |
+
jQuery(".bleeper_pullup").removeClass('down');
|
455 |
+
jQuery(".bleeper_pullup").addClass('up');
|
456 |
+
jQuery(".bleeper_pullup").html("<i class='fa fa-angle-down'></i>");
|
457 |
+
jQuery(".bleeper_pullup").css('bottom','0px');
|
458 |
+
}
|
459 |
+
|
460 |
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
|
js/toastr.js
CHANGED
File without changes
|
js/wplc-admin-modal.js
CHANGED
@@ -57,4 +57,28 @@ function wplc_modal_initialize(init_callback, confirm_callback, cancel_callback,
|
|
57 |
function wplc_modal_remove_callback(){
|
58 |
wplc_modal_confirm_callback = null;
|
59 |
wplc_modal_cancel_callback = null;
|
60 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
function wplc_modal_remove_callback(){
|
58 |
wplc_modal_confirm_callback = null;
|
59 |
wplc_modal_cancel_callback = null;
|
60 |
+
}
|
61 |
+
|
62 |
+
(function($) {
|
63 |
+
|
64 |
+
$(document).ready(function(event) {
|
65 |
+
if(!window.wdtEmojiBundle)
|
66 |
+
return;
|
67 |
+
|
68 |
+
$(document.body).on("click", function(event) {
|
69 |
+
|
70 |
+
// If click event isn't on the emoji window, or the emoji open button, close the emoji window
|
71 |
+
if($(event.target).closest(".wdt-emoji-picker, .wdt-emoji-popup").length == 0 && !(
|
72 |
+
event.target.parentNode == null && $(event.target).hasClass("fa-smile-o")
|
73 |
+
))
|
74 |
+
wdtEmojiBundle.close();
|
75 |
+
|
76 |
+
});
|
77 |
+
|
78 |
+
// Close emoji window on scroll
|
79 |
+
$(window).scroll(function(event) {
|
80 |
+
wdtEmojiBundle.close();
|
81 |
+
});
|
82 |
+
});
|
83 |
+
|
84 |
+
})(jQuery);
|
js/wplc-admin-pointers.js
CHANGED
@@ -20,18 +20,34 @@ wp_button_pointer_array[3] = {
|
|
20 |
'position': {'edge': 'right', 'align': 'middle'}
|
21 |
}
|
22 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
|
25 |
jQuery(document).ready( function($) {
|
26 |
|
27 |
jQuery('body').on("click", ".wplc_initiate_chat", function (e) {
|
28 |
-
e.preventDefault();
|
29 |
if(typeof(jQuery().pointer) != 'undefined') { // make sure the pointer class exists
|
30 |
|
31 |
if(jQuery('.wp-pointer').is(":visible")) { // if a pointer is already open...
|
32 |
var openid = jQuery('.wp-pointer:visible').attr("id").replace('wp-pointer-',''); // ... note its id
|
33 |
jQuery('#' + wp_button_pointer_array[2].element).pointer('close'); // ... and close it
|
34 |
jQuery('#' + wp_button_pointer_array[3].element).pointer('close'); // ... and close it
|
|
|
|
|
35 |
var pointerid = parseInt(openid) + 1;
|
36 |
} else {
|
37 |
var pointerid = 1; // ... otherwise we want to open the first pointer
|
@@ -42,16 +58,18 @@ jQuery(document).ready( function($) {
|
|
42 |
var nextid = pointerid + 1;
|
43 |
}
|
44 |
}
|
45 |
-
});
|
46 |
|
47 |
jQuery('body').on("click", ".wplc-agent-info", function (e) {
|
48 |
-
e.preventDefault();
|
49 |
if(typeof(jQuery().pointer) != 'undefined') { // make sure the pointer class exists
|
50 |
|
51 |
if(jQuery('.wp-pointer').is(":visible")) { // if a pointer is already open...
|
52 |
var openid = jQuery('.wp-pointer:visible').attr("id").replace('wp-pointer-',''); // ... note its id
|
53 |
jQuery('#' + wp_button_pointer_array[1].element).pointer('close'); // ... and close it
|
54 |
jQuery('#' + wp_button_pointer_array[3].element).pointer('close'); // ... and close it
|
|
|
|
|
55 |
var pointerid = parseInt(openid) + 1;
|
56 |
} else {
|
57 |
var pointerid = 1; // ... otherwise we want to open the first pointer
|
@@ -72,6 +90,8 @@ jQuery(document).ready( function($) {
|
|
72 |
var openid = jQuery('.wp-pointer:visible').attr("id").replace('wp-pointer-',''); // ... note its id
|
73 |
jQuery('#' + wp_button_pointer_array[2].element).pointer('close'); // ... and close it
|
74 |
jQuery('#' + wp_button_pointer_array[1].element).pointer('close'); // ... and close it
|
|
|
|
|
75 |
var pointerid = parseInt(openid) + 1;
|
76 |
} else {
|
77 |
var pointerid = 1; // ... otherwise we want to open the first pointer
|
@@ -82,7 +102,116 @@ jQuery(document).ready( function($) {
|
|
82 |
var nextid = pointerid + 1;
|
83 |
}
|
84 |
}
|
85 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
|
88 |
});
|
20 |
'position': {'edge': 'right', 'align': 'middle'}
|
21 |
}
|
22 |
};
|
23 |
+
wp_button_pointer_array[4] = {
|
24 |
+
'element' : 'chatTransferUps',
|
25 |
+
'options' : {
|
26 |
+
'content': pointer_localize_strings["transfer"],
|
27 |
+
'position': {'edge': 'right', 'align': 'middle'}
|
28 |
+
}
|
29 |
+
};
|
30 |
+
wp_button_pointer_array[5] = {
|
31 |
+
'element' : 'chatDirectUserToPageUps',
|
32 |
+
'options' : {
|
33 |
+
'content': pointer_localize_strings["direct_to_page"],
|
34 |
+
'position': {'edge': 'right', 'align': 'middle'}
|
35 |
+
}
|
36 |
+
};
|
37 |
|
38 |
|
39 |
jQuery(document).ready( function($) {
|
40 |
|
41 |
jQuery('body').on("click", ".wplc_initiate_chat", function (e) {
|
42 |
+
e.preventDefault();
|
43 |
if(typeof(jQuery().pointer) != 'undefined') { // make sure the pointer class exists
|
44 |
|
45 |
if(jQuery('.wp-pointer').is(":visible")) { // if a pointer is already open...
|
46 |
var openid = jQuery('.wp-pointer:visible').attr("id").replace('wp-pointer-',''); // ... note its id
|
47 |
jQuery('#' + wp_button_pointer_array[2].element).pointer('close'); // ... and close it
|
48 |
jQuery('#' + wp_button_pointer_array[3].element).pointer('close'); // ... and close it
|
49 |
+
jQuery('#' + wp_button_pointer_array[4].element).pointer('close'); // ... and close it
|
50 |
+
jQuery('#' + wp_button_pointer_array[5].element).pointer('close'); // ... and close it
|
51 |
var pointerid = parseInt(openid) + 1;
|
52 |
} else {
|
53 |
var pointerid = 1; // ... otherwise we want to open the first pointer
|
58 |
var nextid = pointerid + 1;
|
59 |
}
|
60 |
}
|
61 |
+
});
|
62 |
|
63 |
jQuery('body').on("click", ".wplc-agent-info", function (e) {
|
64 |
+
e.preventDefault();
|
65 |
if(typeof(jQuery().pointer) != 'undefined') { // make sure the pointer class exists
|
66 |
|
67 |
if(jQuery('.wp-pointer').is(":visible")) { // if a pointer is already open...
|
68 |
var openid = jQuery('.wp-pointer:visible').attr("id").replace('wp-pointer-',''); // ... note its id
|
69 |
jQuery('#' + wp_button_pointer_array[1].element).pointer('close'); // ... and close it
|
70 |
jQuery('#' + wp_button_pointer_array[3].element).pointer('close'); // ... and close it
|
71 |
+
jQuery('#' + wp_button_pointer_array[4].element).pointer('close'); // ... and close it
|
72 |
+
jQuery('#' + wp_button_pointer_array[5].element).pointer('close'); // ... and close it
|
73 |
var pointerid = parseInt(openid) + 1;
|
74 |
} else {
|
75 |
var pointerid = 1; // ... otherwise we want to open the first pointer
|
90 |
var openid = jQuery('.wp-pointer:visible').attr("id").replace('wp-pointer-',''); // ... note its id
|
91 |
jQuery('#' + wp_button_pointer_array[2].element).pointer('close'); // ... and close it
|
92 |
jQuery('#' + wp_button_pointer_array[1].element).pointer('close'); // ... and close it
|
93 |
+
jQuery('#' + wp_button_pointer_array[4].element).pointer('close'); // ... and close it
|
94 |
+
jQuery('#' + wp_button_pointer_array[5].element).pointer('close'); // ... and close it
|
95 |
var pointerid = parseInt(openid) + 1;
|
96 |
} else {
|
97 |
var pointerid = 1; // ... otherwise we want to open the first pointer
|
102 |
var nextid = pointerid + 1;
|
103 |
}
|
104 |
}
|
105 |
+
});
|
106 |
+
|
107 |
+
jQuery('body').on("mouseenter", ".chatTransferUps", function (e) {
|
108 |
+
e.preventDefault();
|
109 |
+
|
110 |
+
if(typeof(jQuery().pointer) != 'undefined') { // make sure the pointer class exists
|
111 |
+
if(jQuery('.wp-pointer').is(":visible")) { // if a pointer is already open...
|
112 |
+
jQuery('#' + wp_button_pointer_array[5].element).pointer('close'); // ... and close it
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
+
if(typeof(jQuery().pointer) != 'undefined') { // make sure the pointer class exists
|
117 |
+
|
118 |
+
if(jQuery('.wp-pointer').is(":visible")) { // if a pointer is already open...
|
119 |
+
var openid = jQuery('.wp-pointer:visible').attr("id").replace('wp-pointer-',''); // ... note its id
|
120 |
+
jQuery('#' + wp_button_pointer_array[2].element).pointer('close'); // ... and close it
|
121 |
+
jQuery('#' + wp_button_pointer_array[1].element).pointer('close'); // ... and close it
|
122 |
+
jQuery('#' + wp_button_pointer_array[3].element).pointer('close'); // ... and close it
|
123 |
+
jQuery('#' + wp_button_pointer_array[5].element).pointer('close'); // ... and close it
|
124 |
+
var pointerid = parseInt(openid) + 1;
|
125 |
+
} else {
|
126 |
+
var pointerid = 1; // ... otherwise we want to open the first pointer
|
127 |
+
}
|
128 |
+
|
129 |
+
if(wp_button_pointer_array[pointerid] != undefined) { // check if next pointer exists
|
130 |
+
jQuery('.' + wp_button_pointer_array[4].element).pointer(wp_button_pointer_array[4].options).pointer('open');
|
131 |
+
var nextid = pointerid + 1;
|
132 |
+
}
|
133 |
+
}
|
134 |
+
});
|
135 |
+
|
136 |
+
/*jQuery('body').on("mouseleave", ".chatTransferUps", function (e) {
|
137 |
+
e.preventDefault();
|
138 |
+
if(typeof(jQuery().pointer) != 'undefined') { // make sure the pointer class exists
|
139 |
+
if(jQuery('.wp-pointer').is(":visible")) { // if a pointer is already open...
|
140 |
+
jQuery('#' + wp_button_pointer_array[4].element).pointer('close'); // ... and close it
|
141 |
+
}
|
142 |
+
}
|
143 |
+
}); */
|
144 |
+
|
145 |
+
jQuery('body').on("mouseover", ".chatDirectUserToPageUps", function (e) {
|
146 |
+
e.preventDefault();
|
147 |
+
|
148 |
+
if(typeof(jQuery().pointer) != 'undefined') { // make sure the pointer class exists
|
149 |
+
if(jQuery('.wp-pointer').is(":visible")) { // if a pointer is already open...
|
150 |
+
jQuery('#' + wp_button_pointer_array[4].element).pointer('close'); // ... and close it
|
151 |
+
}
|
152 |
+
}
|
153 |
+
|
154 |
+
if(typeof(jQuery().pointer) != 'undefined') { // make sure the pointer class exists
|
155 |
+
|
156 |
+
if(jQuery('.wp-pointer').is(":visible")) { // if a pointer is already open...
|
157 |
+
var openid = jQuery('.wp-pointer:visible').attr("id").replace('wp-pointer-',''); // ... note its id
|
158 |
+
jQuery('#' + wp_button_pointer_array[2].element).pointer('close'); // ... and close it
|
159 |
+
jQuery('#' + wp_button_pointer_array[1].element).pointer('close'); // ... and close it
|
160 |
+
jQuery('#' + wp_button_pointer_array[3].element).pointer('close'); // ... and close it
|
161 |
+
jQuery('#' + wp_button_pointer_array[4].element).pointer('close'); // ... and close it
|
162 |
+
var pointerid = parseInt(openid) + 1;
|
163 |
+
} else {
|
164 |
+
var pointerid = 1; // ... otherwise we want to open the first pointer
|
165 |
+
}
|
166 |
+
|
167 |
+
if(wp_button_pointer_array[pointerid] != undefined) { // check if next pointer exists
|
168 |
+
jQuery('.' + wp_button_pointer_array[5].element).pointer(wp_button_pointer_array[5].options).pointer('open');
|
169 |
+
var nextid = pointerid + 1;
|
170 |
+
}
|
171 |
+
}
|
172 |
+
});
|
173 |
+
|
174 |
+
jQuery('body').on("mouseleave", ".chatDirectUserToPageUps", function (e) {
|
175 |
+
/*e.preventDefault();
|
176 |
+
if(typeof(jQuery().pointer) != 'undefined') { // make sure the pointer class exists
|
177 |
+
if(jQuery('.wp-pointer').is(":visible")) { // if a pointer is already open...
|
178 |
+
jQuery('#' + wp_button_pointer_array[5].element).pointer('close'); // ... and close it
|
179 |
+
}
|
180 |
+
}*/
|
181 |
+
});
|
182 |
+
|
183 |
+
(function($) {
|
184 |
+
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
|
185 |
+
if(MutationObserver)
|
186 |
+
{
|
187 |
+
var observer = new MutationObserver(function(mutations) {
|
188 |
+
mutations.forEach(function(mutation) {
|
189 |
+
if(!$(mutation.target).hasClass("open"))
|
190 |
+
{
|
191 |
+
for(var pointer_id in wp_button_pointer_array)
|
192 |
+
{
|
193 |
+
try{
|
194 |
+
$('#' + wp_button_pointer_array[pointer_id].element).pointer("close");
|
195 |
+
}catch(e) {
|
196 |
+
// The pointer may not be initialized, fail silently if that is the case
|
197 |
+
}
|
198 |
+
}
|
199 |
+
}
|
200 |
+
});
|
201 |
+
});
|
202 |
|
203 |
+
var intervalID;
|
204 |
+
intervalID = setInterval(function(event) {
|
205 |
+
var elems = $("#chat_area .dropdown.inchat-menu.pull-right");
|
206 |
+
if(elems.length)
|
207 |
+
{
|
208 |
+
observer.observe(elems[0], {
|
209 |
+
attributes: true
|
210 |
+
});
|
211 |
+
clearInterval(intervalID);
|
212 |
+
}
|
213 |
+
}, 1000);
|
214 |
+
}
|
215 |
+
})(jQuery);
|
216 |
|
217 |
});
|
js/wplc_admin_dynamic_translations.js
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(function(){
|
2 |
+
jQuery(document).on("bleeper_dom_ready", function(e) {
|
3 |
+
if(typeof wplc_dynamic_translation_array !== "undefined"){
|
4 |
+
for(var index in wplc_dynamic_translation_array){
|
5 |
+
jQuery("#" + index).html(wplc_dynamic_translation_array[index]);
|
6 |
+
}
|
7 |
+
}
|
8 |
+
});
|
9 |
+
});
|
js/wplc_admin_popup.js
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function($) {
|
2 |
+
|
3 |
+
$(document).ready(function(event) {
|
4 |
+
var container = "#wpbody";
|
5 |
+
|
6 |
+
if($("#editor.gutenberg__editor").length)
|
7 |
+
container = "#editor.gutenberg__editor";
|
8 |
+
|
9 |
+
$(".floating-right-toolbar i").draggable({
|
10 |
+
snap: container,
|
11 |
+
containment: container // This prevents the icon from being dragged into the header, where it becomes invisible
|
12 |
+
});
|
13 |
+
});
|
14 |
+
|
15 |
+
})(jQuery);
|
js/wplc_error_handling.js
CHANGED
File without changes
|
js/wplc_gutenberg.js
ADDED
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Gutenberg functions
|
2 |
+
jQuery(document).ready(function($){
|
3 |
+
|
4 |
+
var sizes = ['sm','md','lg'];
|
5 |
+
|
6 |
+
// Initate settings
|
7 |
+
initiate_gutenberg_settings();
|
8 |
+
|
9 |
+
$('#wplc_gutenberg_size').on('change', function() {
|
10 |
+
$('.wplc_block').removeClass('sm').removeClass('md').removeClass('lg');
|
11 |
+
$('.wplc_block').addClass(sizes[$(this).val()-1]);
|
12 |
+
});
|
13 |
+
|
14 |
+
$('#wplc_gutenberg_icon').on('change', function() {
|
15 |
+
var fontawesome_class = 'fa ' + $(this).val().replace(/\./g, "");
|
16 |
+
$('.wplc_block_icon i').removeClass().addClass(fontawesome_class);
|
17 |
+
});
|
18 |
+
|
19 |
+
$('.iconpicker-item').on('click', function() {
|
20 |
+
var fontawesome_class = 'fa ' + $(this).attr('title').replace(/\./g, "");
|
21 |
+
$('.wplc_block_icon i').removeClass().addClass(fontawesome_class);
|
22 |
+
});
|
23 |
+
|
24 |
+
$('#wplc_gutenberg_text').on('change', function() {
|
25 |
+
var text = $(this).val();
|
26 |
+
$('.wplc_block_text').html(text);
|
27 |
+
});
|
28 |
+
|
29 |
+
$('#activate_block').on('change', function() {
|
30 |
+
if ($(this).is(':checked')) {
|
31 |
+
$('.wplc_block').removeClass('disabled');
|
32 |
+
} else {
|
33 |
+
$('.wplc_block').addClass('disabled');
|
34 |
+
}
|
35 |
+
});
|
36 |
+
|
37 |
+
$('#wplc_gutenberg_enable_icon').on('change', function() {
|
38 |
+
if ($(this).is(':checked')) {
|
39 |
+
$('.wplc_block_icon').show();
|
40 |
+
$('#wplc_gutenberg_icon').removeAttr('disabled');
|
41 |
+
} else {
|
42 |
+
$('.wplc_block_icon').hide();
|
43 |
+
$('#wplc_gutenberg_icon').attr('disabled', 'disabled');
|
44 |
+
}
|
45 |
+
});
|
46 |
+
|
47 |
+
$('.wplc_code').on('click', function(){
|
48 |
+
var $temp = $('<input>');
|
49 |
+
$('body').append($temp);
|
50 |
+
$temp.val($(this).text()).select();
|
51 |
+
document.execCommand('copy');
|
52 |
+
$temp.remove();
|
53 |
+
$(this).closest('p').append('<p class="wplc_copied_message">'+ $(this).text() + ' copied to clipboard.</p>').find('.wplc_copied_message').fadeOut( 'slow' );
|
54 |
+
});
|
55 |
+
|
56 |
+
// Allow users to upload a logo image
|
57 |
+
var media_uploader;
|
58 |
+
$('#wplc_gutenberg_upload_logo').on( 'click', function(e) {
|
59 |
+
|
60 |
+
e.preventDefault();
|
61 |
+
|
62 |
+
if ( media_uploader ) {
|
63 |
+
media_uploader.open();
|
64 |
+
return;
|
65 |
+
}
|
66 |
+
|
67 |
+
media_uploader = wp.media.frames.file_frame = wp.media({
|
68 |
+
title: 'Select a Logo',
|
69 |
+
button: {
|
70 |
+
text: 'Select Logo'
|
71 |
+
},
|
72 |
+
multiple: false
|
73 |
+
});
|
74 |
+
|
75 |
+
media_uploader.on( 'select', function() {
|
76 |
+
attachment = media_uploader.state().get( 'selection' ).first().toJSON();
|
77 |
+
$('#wplc_gutenberg_logo').val(attachment.url);
|
78 |
+
$('.wplc_block_logo').css('background-image', 'url(' + attachment.url + ')');
|
79 |
+
});
|
80 |
+
|
81 |
+
media_uploader.open();
|
82 |
+
|
83 |
+
});
|
84 |
+
|
85 |
+
$('#wplc_gutenberg_remove_logo').on('click', function(e) {
|
86 |
+
e.preventDefault();
|
87 |
+
if (confirm("Are you sure you want to reset the logo to the default logo?")) {
|
88 |
+
$('#wplc_gutenberg_logo').val($('#wplc_gutenberg_default_logo').val());
|
89 |
+
$('.wplc_block_logo').css('background-image', 'url("' + $('#wplc_gutenberg_default_logo').val() + '")');
|
90 |
+
}
|
91 |
+
return;
|
92 |
+
});
|
93 |
+
|
94 |
+
function initiate_gutenberg_settings() {
|
95 |
+
// Editor
|
96 |
+
var editor_js = ace.edit( 'wplc_custom_js_editor' );
|
97 |
+
editor_js.setTheme( 'ace/theme/monokai' );
|
98 |
+
editor_js.getSession().setMode( 'ace/mode/javascript' );
|
99 |
+
editor_js.setValue( $('#wplc_custom_js').val(), 1 );
|
100 |
+
editor_js.getSession().on("change", function () {
|
101 |
+
$('#wplc_custom_js').val( editor_js.getSession().getValue() );
|
102 |
+
});
|
103 |
+
|
104 |
+
var editor_css = ace.edit( 'wplc_custom_css_editor' );
|
105 |
+
editor_css.setTheme( 'ace/theme/monokai' );
|
106 |
+
editor_css.getSession().setMode( 'ace/mode/css' );
|
107 |
+
editor_css.setValue( $('#wplc_custom_css').val(), 1 );
|
108 |
+
editor_css.getSession().on("change", function () {
|
109 |
+
$('#wplc_custom_css').val( editor_css.getSession().getValue() );
|
110 |
+
});
|
111 |
+
|
112 |
+
var editor_html = ace.edit( 'wplc_custom_html_editor' );
|
113 |
+
editor_html.$blockScrolling = Infinity;
|
114 |
+
editor_html.setTheme( 'ace/theme/monokai' );
|
115 |
+
editor_html.getSession().setMode( 'ace/mode/html' );
|
116 |
+
editor_html.setValue( $.trim($('#wplc_custom_html').val()), 1 );
|
117 |
+
editor_html.getSession().on("change", function () {
|
118 |
+
$('#wplc_custom_html').val( editor_html.getSession().getValue() );
|
119 |
+
});
|
120 |
+
|
121 |
+
if ($.trim(editor_html.getSession().getValue()) == '') {
|
122 |
+
editor_html.setValue( $.trim(default_html), 1 );
|
123 |
+
}
|
124 |
+
|
125 |
+
$('#wplc_gutenberg_reset_html').on('click', function() {
|
126 |
+
editor_html.setValue( $.trim(default_html), 1 );
|
127 |
+
});
|
128 |
+
|
129 |
+
$('#wplc_settings').on('submit', function(){
|
130 |
+
if ($.trim(editor_html.getSession().getValue()) == '' ) {
|
131 |
+
editor_html.setValue( default_html, 1 );
|
132 |
+
}
|
133 |
+
});
|
134 |
+
|
135 |
+
// Predefined Templates
|
136 |
+
wplc_gutenberg_templates( editor_html );
|
137 |
+
|
138 |
+
// Initiate FontAwesome Icon Picker
|
139 |
+
$('#wplc_gutenberg_icon').iconpicker({
|
140 |
+
placement: 'bottomRight'
|
141 |
+
});
|
142 |
+
|
143 |
+
$('.wplc_block').removeClass('sm').removeClass('md').removeClass('lg');
|
144 |
+
$('.wplc_block').addClass(sizes[$('#wplc_gutenberg_size').val()-1]);
|
145 |
+
|
146 |
+
if ($('#wplc_gutenberg_enable_icon').is(':checked')) {
|
147 |
+
$('.wplc_block_icon').show();
|
148 |
+
$('#wplc_gutenberg_icon').removeAttr('disabled');
|
149 |
+
} else {
|
150 |
+
$('.wplc_block_icon').hide();
|
151 |
+
$('#wplc_gutenberg_icon').attr('disabled', 'disabled');
|
152 |
+
}
|
153 |
+
|
154 |
+
if ($('#activate_block').is(':checked')) {
|
155 |
+
$('.wplc_block').removeClass('disabled');
|
156 |
+
} else {
|
157 |
+
$('.wplc_block').addClass('disabled');
|
158 |
+
}
|
159 |
+
}
|
160 |
+
|
161 |
+
function wplc_gutenberg_templates( editor ) {
|
162 |
+
|
163 |
+
var templates = new Array();
|
164 |
+
templates['template_default'] = '<!-- Default Template - Dark -->\n<div class="wplc_block">\n\t<span class="wplc_block_logo">{wplc_logo}</span>\n\t<span class="wplc_block_text">{wplc_text}</span>\n\t<span class="wplc_block_icon">{wplc_icon}</span>\n</div>';
|
165 |
+
templates['template_default_tooltip'] = '<!-- Default - Tooltip -->\n<!-- Hover over the block to see the tooltip -->\n<div class="wplc_block">\n\t<span class="wplc_block_tooltip">Want to chat?</span>\n\t<span class="wplc_block_logo">{wplc_logo}</span>\n\t<span class="wplc_block_text">{wplc_text}</span>\n\t<span class="wplc_block_icon">{wplc_icon}</span>\n</div>';
|
166 |
+
templates['template_default_light'] = '<!-- Default - Light Template -->\n<div class="wplc_block light">\n\t<span class="wplc_block_logo">{wplc_logo}</span>\n\t<span class="wplc_block_text">{wplc_text}</span>\n\t<span class="wplc_block_icon">{wplc_icon}</span>\n</div>';
|
167 |
+
templates['template_tooltip'] = '<!-- Cricle - Tooltip Template -->\n<!-- Hover over the block to see the tooltip -->\n<div class="wplc_block circle">\n\t<span class="wplc_block_tooltip">Chat with us!</span>\n\t<span class="wplc_block_logo">{wplc_logo}</span>\n</div>';
|
168 |
+
templates['template_circle'] = '<!-- Circle Template -->\n<div class="wplc_block circle">\n\t<span class="wplc_block_logo">{wplc_logo}</span>\n</div>';
|
169 |
+
templates['template_chat_bubble'] = '<!-- Chat Bubble Template -->\n<div class="wplc_block chat_bubble">\n\t<span class="wplc_block_logo">{wplc_logo}</span>\n\t<span class="wplc_block_text">{wplc_text}</span>\n</div>';
|
170 |
+
templates['template_circle_rotate'] = '<!-- Circle - Rotating Template -->\n<!-- Hover over the icon to see it rotate -->\n<div class="wplc_block circle rotate">\n\t<span class="wplc_block_logo">{wplc_logo}</span>\n\t<span class="wplc_block_icon">{wplc_icon}</span>\n</div>';
|
171 |
+
|
172 |
+
var current_template = wplc_gutenberg_filter_template( editor.getSession().getValue() );
|
173 |
+
|
174 |
+
$(document).find('.wplc_gutenberg_preview').html(current_template);
|
175 |
+
var sizes = ['sm','md','lg'];
|
176 |
+
|
177 |
+
$('#wplc_custom_templates').on('change', function(){
|
178 |
+
if ($(this).val() !== '0') {
|
179 |
+
var template = wplc_gutenberg_filter_template( $.trim(templates[$(this).val()]) );
|
180 |
+
template = template.replace('wplc_block', 'wplc_block ' + sizes[$(document).find('#wplc_gutenberg_size').val()-1]);
|
181 |
+
editor.setValue( template, 1 );
|
182 |
+
$(document).find('.wplc_gutenberg_preview').html(template);
|
183 |
+
}
|
184 |
+
});
|
185 |
+
}
|
186 |
+
|
187 |
+
function wplc_gutenberg_filter_template( template ) {
|
188 |
+
var logo = $(document).find('#wplc_gutenberg_logo').val();
|
189 |
+
var text = $(document).find('#wplc_gutenberg_text').val();
|
190 |
+
var icon = $(document).find('#wplc_gutenberg_icon').val();
|
191 |
+
var placeholder_codes = ['wplc_logo', 'wplc_text', 'wplc_icon'],
|
192 |
+
placeholder_values = ['<span class="wplc_block_logo" style="background-image: url(\'' + logo + '\');"></span>', text, '<i class="fa ' + icon + '"></i>'];
|
193 |
+
|
194 |
+
for( var i = 0; i < placeholder_codes.length; i++ ) {
|
195 |
+
template = template.replace(new RegExp('{' + placeholder_codes[i] + '}', 'gi'), placeholder_values[i]);
|
196 |
+
}
|
197 |
+
|
198 |
+
return template;
|
199 |
+
}
|
200 |
+
|
201 |
+
});
|
js/wplc_heartbeat.js
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function( $ ) {
|
2 |
+
"use strict";
|
3 |
+
$(function() {
|
4 |
+
$( document ).on( 'heartbeat-send', function( e, data ) {
|
5 |
+
data['client'] = 'wplc_heartbeat';
|
6 |
+
});
|
7 |
+
|
8 |
+
|
9 |
+
var wplc_set_transient = null;
|
10 |
+
|
11 |
+
wplc_set_transient = setInterval(function () {
|
12 |
+
wpcl_admin_set_transient();
|
13 |
+
}, 60000);
|
14 |
+
wpcl_admin_set_transient();
|
15 |
+
function wpcl_admin_set_transient() {
|
16 |
+
var data = {
|
17 |
+
action: 'wplc_admin_set_transient',
|
18 |
+
security: wplc_transient_nonce
|
19 |
+
|
20 |
+
};
|
21 |
+
if (typeof ajaxurl === "undefined" && typeof wplc_ajaxurl !== "undefined") { var ajaxurl = wplc_ajaxurl; }
|
22 |
+
$.post(ajaxurl, data, function (response) {});
|
23 |
+
}
|
24 |
+
});
|
25 |
+
}( jQuery ));
|
js/wplc_lead_forms.js
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery("#nimble_lead_form").change(function() {
|
2 |
+
jQuery("#nimble_survey").prop('selectedIndex',0);
|
3 |
+
});
|
4 |
+
|
5 |
+
jQuery("#nimble_survey").change(function() {
|
6 |
+
jQuery("#nimble_lead_form").prop('selectedIndex',0);
|
7 |
+
});
|
js/wplc_node_offline_mode_controller.js
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(function(){
|
2 |
+
jQuery(document).on("bleeper_connect", function(e) {
|
3 |
+
setTimeout(function(){
|
4 |
+
var wplc_offline_prompt_title = jQuery("#wplc_offline_mode_prompt").text();
|
5 |
+
var wplc_offline_prompt_body = jQuery("#wplc_offline_mode_prompt_container").html();
|
6 |
+
jQuery("#wplc_offline_mode_prompt_container").hide();
|
7 |
+
jQuery(".nifty_admin_overlay").fadeIn();
|
8 |
+
niftyShowDialog(wplc_offline_prompt_title, "", "", function(){}, function(){});
|
9 |
+
|
10 |
+
jQuery(".nifty_admin_chat_prompt_message").html(wplc_offline_prompt_body);
|
11 |
+
jQuery('.nifty_admin_chat_prompt_actions').hide();
|
12 |
+
|
13 |
+
jQuery('.nifty_admin_chat_prompt').css("width", "50%");
|
14 |
+
}, 1500);
|
15 |
+
})
|
16 |
+
});
|
js/wplc_plugin_row.js
CHANGED
File without changes
|
js/wplc_server.js
CHANGED
@@ -4,18 +4,18 @@
|
|
4 |
var wplc_server_method = null;
|
5 |
var wplc_supress_server_logs = true; //We are now surpressing server logs
|
6 |
var wplc_node_socket = null; //Will not be set unless
|
7 |
-
var wplc_node_send_queue = new Array();
|
8 |
var wplc_node_message_receiver = null;
|
9 |
var wplc_node_message_restart_handler = null;
|
10 |
var wplc_node_client_event_logger = null;
|
11 |
var wplc_node_sockets_ready = false;
|
12 |
var wplc_transport_prepared = false;
|
13 |
-
|
14 |
var wplc_node_async_array = new Array(); //Array which will be sent to our async URL for storage
|
15 |
var wplc_node_async_send_rate = 1; //Amount of messages that need to be present before we sent the async request
|
16 |
var wplc_node_async_cookie_check_complete = false;
|
17 |
|
18 |
-
var wplc_node_port_open = true; //This can be set to false to prevent any future data being sent
|
19 |
var wplc_node_is_client_typing = false;
|
20 |
var wplc_node_is_pair_typing_indicator_visible = false;
|
21 |
var wplc_node_pair_name = "";
|
@@ -25,6 +25,9 @@ var wplc_node_retry_count = 0;
|
|
25 |
|
26 |
var wplc_msg_history = new Array();
|
27 |
|
|
|
|
|
|
|
28 |
|
29 |
function WPLCServer(){
|
30 |
var wplc_server_ref = this;
|
@@ -121,19 +124,21 @@ function WPLCServer(){
|
|
121 |
return false;
|
122 |
}
|
123 |
} else {
|
124 |
-
return false;
|
125 |
}
|
126 |
}
|
127 |
}
|
128 |
|
129 |
WPLCServer.Socket = {
|
|
|
130 |
init : function(callback, messageHandler, failOver, restartHandler, clientEventLog){
|
131 |
wplc_node_message_receiver = (typeof messageHandler !== "undefined" && typeof messageHandler === "function") ? messageHandler : false;
|
132 |
wplc_node_message_restart_handler = (typeof restartHandler !== "undefined" && typeof restartHandler === "function") ? restartHandler : false;
|
133 |
wplc_node_client_event_logger = (typeof clientEventLog !== "undefined" && typeof clientEventLog === "function") ? clientEventLog : false;
|
134 |
|
135 |
wplc_server_log("Socket Init");
|
136 |
-
wplc_node_socket = new WebSocket('wss://wp-livechat.us-2.evennode.com');
|
|
|
137 |
|
138 |
if(wplc_node_async_cookie_check_complete !== true){
|
139 |
//Check if there are any messages we forgot to send via async
|
@@ -145,7 +150,7 @@ WPLCServer.Socket = {
|
|
145 |
wplc_node_async_cookie_check_complete = true;
|
146 |
});
|
147 |
}
|
148 |
-
}
|
149 |
}
|
150 |
|
151 |
wplc_node_socket.onerror = function(event){
|
@@ -169,7 +174,7 @@ WPLCServer.Socket = {
|
|
169 |
|
170 |
wplc_node_socket.onmessage = function(event){
|
171 |
if(typeof wplc_node_message_receiver === "function" && wplc_node_message_receiver !== false && wplc_node_message_receiver !== null){
|
172 |
-
//Delegate to handler
|
173 |
if(wplc_node_port_open){
|
174 |
wplc_node_message_receiver(event.data);
|
175 |
wplc_node_global_message_receiver(event.data);
|
@@ -199,7 +204,7 @@ WPLCServer.Socket = {
|
|
199 |
}
|
200 |
}
|
201 |
|
202 |
-
|
203 |
},
|
204 |
send : function (wplc_send_url, wplc_send_data, wplc_send_type, wplc_send_timeout, wplc_send_success_callback, wplc_send_fail_callback, wplc_send_complete_callback){
|
205 |
wplc_origin_url = wplc_send_url.replace("/wp-admin/admin-ajax.php", "");
|
@@ -246,7 +251,8 @@ WPLCServer.Socket = {
|
|
246 |
wplc_origin_url = wplc_send_url.replace("/wp-admin/admin-ajax.php", "");
|
247 |
wplc_send_data.origin_url = wplc_origin_url;
|
248 |
wplc_socket_add_to_queue(wplc_send_data, wplc_send_success_callback, wplc_send_fail_callback, wplc_send_complete_callback);
|
249 |
-
}
|
|
|
250 |
};
|
251 |
|
252 |
WPLCServer.Ajax = {
|
@@ -267,7 +273,7 @@ WPLCServer.Ajax = {
|
|
267 |
if(typeof wplc_send_data['action'] !== "undefined" && wplc_send_data['action'] !== "wplc_start_chat"){ //Is this the start?
|
268 |
wplc_send_success_callback(response);
|
269 |
} else {
|
270 |
-
//Check if we are going to go into socket mode after this?
|
271 |
if(typeof wplc_use_node_server !== "undefined" && wplc_use_node_server === "true"){
|
272 |
if(window.WebSocket){
|
273 |
wplc_send_success_callback(response); //Send the data if we are going to sockets after this
|
@@ -305,7 +311,7 @@ WPLCServer.Ajax = {
|
|
305 |
return wplc_transport_prepared;
|
306 |
},
|
307 |
asyncStorage : function(wplc_send_url, wplc_send_data, wplc_send_timeout){
|
308 |
-
//Do nothing -> Ajax handles
|
309 |
},
|
310 |
forceClosePort : function(){
|
311 |
//Do Nothing ajax doesnt use socket ports
|
@@ -339,20 +345,20 @@ function wplc_socket_send(data, success, fail, complete){
|
|
339 |
if(wplc_node_socket.readyState !== WebSocket.CONNECTING && wplc_node_socket.readyState !== WebSocket.CLOSING && wplc_node_socket.readyState !== WebSocket.CLOSED){
|
340 |
wplc_current_queue_item.data.is_typing = typeof wplc_node_is_client_typing !== "undefined" ? wplc_node_is_client_typing : false;
|
341 |
wplc_node_socket.send(JSON.stringify(wplc_current_queue_item.data));
|
342 |
-
|
343 |
if(typeof wplc_current_queue_item.success === "function"){
|
344 |
-
wplc_current_queue_item.success();
|
345 |
}
|
346 |
} else {
|
347 |
//Try again in a sec just now -> Add it to the queue
|
348 |
setTimeout(function(){
|
349 |
-
wplc_socket_send(data, success, fail, complete);
|
350 |
}, 500);
|
351 |
}
|
352 |
} else {
|
353 |
setTimeout(function(){
|
354 |
//Try again in a sec just now -> Add it to the queue
|
355 |
-
wplc_socket_send(data, success, fail, complete);
|
356 |
}, 500);
|
357 |
}
|
358 |
}
|
@@ -360,10 +366,20 @@ function wplc_socket_send(data, success, fail, complete){
|
|
360 |
}
|
361 |
}
|
362 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
363 |
function wplc_socket_add_to_queue(data, success, fail, complete){
|
364 |
if(typeof data.server_token === "undefined"){
|
365 |
-
if(typeof
|
366 |
-
data.server_token =
|
367 |
} else {
|
368 |
wplc_server_error("No Server Token Present, Something will go wrong");
|
369 |
}
|
@@ -395,11 +411,66 @@ function wplc_socket_get_next_in_queue(){
|
|
395 |
}
|
396 |
}
|
397 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
398 |
function wplc_socket_async_storage_handler(wplc_send_url, wplc_send_data, wplc_send_timeout){
|
399 |
var wplc_node_ajax_action = "wplc_node_async_storage_ajax";
|
400 |
//Send the data to the Async
|
401 |
if(typeof wplc_restapi_enabled !== "undefined" && parseInt(wplc_restapi_enabled) === 1 && typeof wplc_restapi_endpoint !== "undefined"){
|
402 |
-
//REST API is ready to rumble
|
403 |
wplc_send_url = wplc_restapi_endpoint + "/async_storage";
|
404 |
} else {
|
405 |
//Ajax time! Cause the Rest she Left
|
@@ -414,15 +485,16 @@ function wplc_socket_async_storage_handler(wplc_send_url, wplc_send_data, wplc_s
|
|
414 |
wplc_extra_data:document.wplc_extra_data
|
415 |
};
|
416 |
|
417 |
-
if(typeof
|
418 |
-
prepared_data.server_token =
|
419 |
}
|
420 |
|
|
|
421 |
wplc_node_async_array = new Array(); //Clearing the storage array before the next data can be sent through
|
422 |
if(typeof Cookies !== "undefined" && typeof Cookies === "function"){
|
423 |
Cookies.remove('wplc_server_async_storage'); //Clear the cookies now so that we don't do this again.
|
424 |
}
|
425 |
-
|
426 |
jQuery.ajax({
|
427 |
url : wplc_send_url,
|
428 |
data : prepared_data,
|
@@ -435,7 +507,7 @@ function wplc_socket_async_storage_handler(wplc_send_url, wplc_send_data, wplc_s
|
|
435 |
wplc_server_log("ASYNC STORAGE = FAIL");
|
436 |
},
|
437 |
complete : function(response){
|
438 |
-
|
439 |
}
|
440 |
});
|
441 |
}
|
@@ -464,7 +536,7 @@ function wplc_node_parse_async_from_object(obj, complete){
|
|
464 |
function wplc_node_global_message_receiver(data){
|
465 |
if(data){
|
466 |
if (typeof data !== "object") {
|
467 |
-
data = JSON.parse(data);
|
468 |
}
|
469 |
}
|
470 |
|
@@ -501,8 +573,9 @@ String.prototype.wplcStripSlashes = function(){
|
|
501 |
}
|
502 |
|
503 |
function wplc_add_date_and_time(the_message,originates) {
|
|
|
504 |
if (parseInt(originates) === 1 || parseInt(originates) === 2) {
|
505 |
-
|
506 |
var time_msg = '';
|
507 |
|
508 |
/* identfy the timestamp */
|
@@ -516,28 +589,64 @@ function wplc_add_date_and_time(the_message,originates) {
|
|
516 |
|
517 |
}
|
518 |
}
|
519 |
-
|
520 |
|
521 |
if (typeof the_message.other === "undefined" || typeof the_message.other.datetime === "undefined") {
|
522 |
/* there is no datetime so return nothing */
|
523 |
return '';
|
524 |
} else {
|
525 |
if (typeof wplc_show_chat_detail !== "undefined") {
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
538 |
|
539 |
-
|
540 |
-
}
|
541 |
if (time_msg !== '') {
|
542 |
if (parseInt(originates) === 1) { aoru_class = 'wplc-msg-float-left'; } else { aoru_class = 'wplc-msg-float-right'; }
|
543 |
time_msg = '<span class="timedate '+aoru_class+'">'+time_msg+'</span>';
|
@@ -550,12 +659,20 @@ function wplc_add_date_and_time(the_message,originates) {
|
|
550 |
} else {
|
551 |
return '';
|
552 |
}
|
553 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
554 |
}
|
555 |
|
556 |
/**
|
557 |
* Pushes the message object to the chat box
|
558 |
-
*
|
559 |
* @param {object} the_message The message object
|
560 |
* @param {string} aoru a for Agent, u for User
|
561 |
* @return void
|
@@ -568,7 +685,7 @@ function wplc_push_message_to_chatbox(the_message, aoru, next) {
|
|
568 |
* Some system notifications may not come through with an ID so we can accept those.
|
569 |
*/
|
570 |
var add_message = true;
|
571 |
-
if (typeof the_message.mid !== "undefined") {
|
572 |
if (parseInt(the_message.mid) === 0 || the_message.mid === null) {
|
573 |
add_message = true;
|
574 |
} else {
|
@@ -582,7 +699,7 @@ function wplc_push_message_to_chatbox(the_message, aoru, next) {
|
|
582 |
}
|
583 |
}
|
584 |
if (add_message) {
|
585 |
-
|
586 |
var message_class = "";
|
587 |
var grav_hash = "";
|
588 |
var message_grav = "";
|
@@ -590,10 +707,11 @@ function wplc_push_message_to_chatbox(the_message, aoru, next) {
|
|
590 |
var message_content = "";
|
591 |
var message_aid;
|
592 |
|
|
|
|
|
|
|
|
|
593 |
|
594 |
-
if(parseInt(the_message.originates) === 1) {
|
595 |
-
//From Admin
|
596 |
-
|
597 |
/* Define which agent it was sent from */
|
598 |
if (typeof the_message.other !== "undefined" && typeof the_message.other.aid !== "undefined") {
|
599 |
message_aid = the_message.other.aid.toString(); /* set it to a string because wp_localize doesnt know how to set keys as integers */
|
@@ -605,45 +723,53 @@ function wplc_push_message_to_chatbox(the_message, aoru, next) {
|
|
605 |
}
|
606 |
message_class = "wplc-admin-message wplc-color-bg-4 wplc-color-2 wplc-color-border-4";
|
607 |
|
608 |
-
|
|
|
|
|
609 |
if (message_aid !== false && typeof wplc_agent_data !== "undefined" && typeof wplc_agent_data[message_aid] !== "undefined") {
|
610 |
/* we know who the agent was that sent this message (v7.1.00+) */
|
611 |
if (typeof wplc_show_chat_detail !== "undefined") {
|
612 |
-
if (typeof wplc_show_chat_detail.avatar !== "undefined" && wplc_show_chat_detail.avatar === "1") { message_grav = (typeof wplc_agent_data[message_aid].md5 !== "undefined" ? "<img src='//www.gravatar.com/avatar/"+wplc_agent_data[message_aid].md5+"?s=
|
613 |
-
if (typeof wplc_show_chat_detail.name !== "undefined" && wplc_show_chat_detail.name === "1") { message_from = (typeof wplc_agent_data[message_aid].name !== "undefined" ? wplc_agent_data[message_aid].name : "")
|
614 |
}
|
615 |
|
616 |
} else {
|
617 |
/* we do'nt know which agent sent this message, so lets set it as the current user instead (backwards compat) */
|
618 |
if (typeof wplc_show_chat_detail !== "undefined") {
|
619 |
-
if (typeof wplc_show_chat_detail.avatar !== "undefined" && wplc_show_chat_detail.avatar === "1") { message_grav = (typeof wplc_current_agent.email !== "undefined" ? "<img src='//www.gravatar.com/avatar/"+wplc_current_agent.email+"?s=
|
620 |
-
if (typeof wplc_show_chat_detail.name !== "undefined" && wplc_show_chat_detail.name === "1") { message_from = (typeof wplc_current_agent.name !== "undefined" ? wplc_current_agent.name : "")
|
621 |
}
|
622 |
}
|
623 |
} else {
|
|
|
624 |
if (message_aid !== false && typeof wplc_agent_data !== "undefined" && typeof wplc_agent_data[message_aid] !== "undefined") {
|
|
|
625 |
/* we know who the agent was that sent this message (v7.1.00+) */
|
626 |
if (typeof wplc_show_chat_detail !== "undefined") {
|
627 |
-
if (typeof wplc_show_chat_detail.avatar !== "undefined" && wplc_show_chat_detail.avatar === "1") { message_grav = (typeof wplc_agent_data[message_aid].md5 !== "undefined" ? "<img src='//www.gravatar.com/avatar/"+wplc_agent_data[message_aid].md5+"?s=
|
628 |
-
if (typeof wplc_show_chat_detail.name !== "undefined" && wplc_show_chat_detail.name === "1") { message_from = (typeof wplc_agent_data[message_aid].name !== "undefined" ? wplc_agent_data[message_aid].name : "")
|
629 |
}
|
630 |
|
631 |
} else {
|
632 |
-
|
633 |
-
|
|
|
|
|
|
|
|
|
634 |
}
|
635 |
}
|
636 |
|
637 |
message_content = the_message.msg.wplcStripSlashes();
|
638 |
wplc_new_message_sound = true;
|
639 |
-
|
640 |
} else if (parseInt(the_message.originates) === 0 || parseInt(the_message.originates) === 3) {
|
641 |
//System Notification
|
642 |
message_class = "wplc_system_notification wplc-color-4";
|
643 |
message_content = the_message.msg;
|
644 |
if (typeof the_message.other.ntype !== "undefined") {
|
645 |
if (the_message.other.ntype === "joined") {
|
646 |
-
jQuery.event.trigger({type: "wplc_agent_joined", ndata:the_message});
|
647 |
}
|
648 |
}
|
649 |
|
@@ -651,94 +777,183 @@ function wplc_push_message_to_chatbox(the_message, aoru, next) {
|
|
651 |
/* most likely from the user */
|
652 |
message_class = "wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1";
|
653 |
if (aoru === 'u') {
|
|
|
|
|
654 |
if (jQuery(wplc_email).val() !== "") {
|
655 |
message_grav = md5(jQuery(wplc_email).val());
|
656 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
657 |
}
|
658 |
-
|
659 |
-
|
|
|
|
|
660 |
} else {
|
661 |
-
message_from = Cookies.get("wplc_name")
|
662 |
}
|
663 |
} else {
|
664 |
if (typeof wplc_chat_email !== "undefined") {
|
665 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
666 |
}
|
|
|
667 |
if (typeof wplc_chat_name !== "undefined") {
|
668 |
-
message_from = wplc_chat_name
|
669 |
}
|
670 |
}
|
671 |
message_content = the_message.msg.wplcStripSlashes();
|
672 |
}
|
673 |
|
674 |
-
if(
|
675 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
676 |
|
677 |
-
var concatenated_message = "<span class='" + message_class + "'>";
|
678 |
-
if (typeof wplc_show_chat_detail !== "undefined") {
|
679 |
if (typeof wplc_show_chat_detail.avatar !== "undefined" && wplc_show_chat_detail.avatar === "1") {
|
680 |
-
concatenated_message += message_grav;
|
681 |
-
|
|
|
|
|
|
|
|
|
682 |
if (typeof wplc_show_chat_detail.name !== "undefined" && wplc_show_chat_detail.name === "1") {
|
683 |
-
|
684 |
}
|
|
|
|
|
|
|
|
|
685 |
|
686 |
-
|
687 |
-
|
688 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
689 |
concatenated_message += "</span>";
|
690 |
concatenated_message += wplc_add_date_and_time(the_message,the_message.originates);
|
691 |
|
692 |
if (aoru === 'u') {
|
693 |
wplc_chat_box_elemn = "#wplc_chatbox";
|
694 |
} else {
|
695 |
-
wplc_chat_box_elemn = "#admin_chat_box_area_"+wplc_cid;
|
696 |
-
}
|
697 |
-
|
698 |
-
|
699 |
-
if(typeof niftyFormatParser !== "undefined"){
|
700 |
|
701 |
-
|
702 |
-
|
703 |
-
|
|
|
|
|
704 |
}
|
|
|
705 |
|
706 |
-
|
707 |
-
|
|
|
|
|
708 |
}
|
709 |
next();
|
710 |
}
|
711 |
|
712 |
-
function wplc_sanitize_attributes( str ){
|
713 |
-
var wplc_allowed_attributes = "onload,onclick,alert,onerror,dalert";
|
714 |
-
var allowed_attr = wplc_allowed_attributes.split(",");
|
715 |
-
for( i = 0; i < allowed_attr.length; i++ ){
|
716 |
-
str = str.replace(allowed_attr[i], '');
|
717 |
-
}
|
718 |
-
|
719 |
-
return str;
|
720 |
-
|
721 |
-
}
|
722 |
-
|
723 |
jQuery(function(){
|
724 |
jQuery(document).ready(function(){
|
725 |
-
var wplc_node_searchTimeout;
|
726 |
-
|
727 |
jQuery("body").on("keydown","#wplc_chatmsg, #wplc_admin_chatmsg", function(e) {
|
728 |
if(typeof wplc_node_sockets_ready !== "undefined" && wplc_node_sockets_ready === true){
|
729 |
if(typeof wplc_node_is_client_typing !== "undefined"){
|
730 |
if (e.which <= 90 && e.which >= 48) {
|
731 |
-
if (wplc_node_is_client_typing) {
|
732 |
wplc_node_renew_typing();
|
733 |
-
return;
|
734 |
}
|
735 |
wplc_node_is_client_typing = true;
|
736 |
-
|
737 |
wplc_node_searchTimeout = setTimeout(wplc_node_clear_typing, 1000);
|
738 |
}
|
739 |
}
|
740 |
}
|
741 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
742 |
|
743 |
function wplc_node_renew_typing() {
|
744 |
clearTimeout(wplc_node_searchTimeout);
|
@@ -747,6 +962,30 @@ jQuery(function(){
|
|
747 |
function wplc_node_clear_typing() {
|
748 |
wplc_node_is_client_typing = false;
|
749 |
clearTimeout(wplc_node_searchTimeout);
|
750 |
-
}
|
751 |
});
|
752 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
var wplc_server_method = null;
|
5 |
var wplc_supress_server_logs = true; //We are now surpressing server logs
|
6 |
var wplc_node_socket = null; //Will not be set unless
|
7 |
+
var wplc_node_send_queue = new Array();
|
8 |
var wplc_node_message_receiver = null;
|
9 |
var wplc_node_message_restart_handler = null;
|
10 |
var wplc_node_client_event_logger = null;
|
11 |
var wplc_node_sockets_ready = false;
|
12 |
var wplc_transport_prepared = false;
|
13 |
+
|
14 |
var wplc_node_async_array = new Array(); //Array which will be sent to our async URL for storage
|
15 |
var wplc_node_async_send_rate = 1; //Amount of messages that need to be present before we sent the async request
|
16 |
var wplc_node_async_cookie_check_complete = false;
|
17 |
|
18 |
+
var wplc_node_port_open = true; //This can be set to false to prevent any future data being sent
|
19 |
var wplc_node_is_client_typing = false;
|
20 |
var wplc_node_is_pair_typing_indicator_visible = false;
|
21 |
var wplc_node_pair_name = "";
|
25 |
|
26 |
var wplc_msg_history = new Array();
|
27 |
|
28 |
+
var wplc_xhr; //XHR global (allows us to abort previous AJAX request when the agent flips between screens quickly)
|
29 |
+
|
30 |
+
|
31 |
|
32 |
function WPLCServer(){
|
33 |
var wplc_server_ref = this;
|
124 |
return false;
|
125 |
}
|
126 |
} else {
|
127 |
+
return false;
|
128 |
}
|
129 |
}
|
130 |
}
|
131 |
|
132 |
WPLCServer.Socket = {
|
133 |
+
/*
|
134 |
init : function(callback, messageHandler, failOver, restartHandler, clientEventLog){
|
135 |
wplc_node_message_receiver = (typeof messageHandler !== "undefined" && typeof messageHandler === "function") ? messageHandler : false;
|
136 |
wplc_node_message_restart_handler = (typeof restartHandler !== "undefined" && typeof restartHandler === "function") ? restartHandler : false;
|
137 |
wplc_node_client_event_logger = (typeof clientEventLog !== "undefined" && typeof clientEventLog === "function") ? clientEventLog : false;
|
138 |
|
139 |
wplc_server_log("Socket Init");
|
140 |
+
//wplc_node_socket = new WebSocket('wss://wp-livechat.us-2.evennode.com');
|
141 |
+
|
142 |
|
143 |
if(wplc_node_async_cookie_check_complete !== true){
|
144 |
//Check if there are any messages we forgot to send via async
|
150 |
wplc_node_async_cookie_check_complete = true;
|
151 |
});
|
152 |
}
|
153 |
+
}
|
154 |
}
|
155 |
|
156 |
wplc_node_socket.onerror = function(event){
|
174 |
|
175 |
wplc_node_socket.onmessage = function(event){
|
176 |
if(typeof wplc_node_message_receiver === "function" && wplc_node_message_receiver !== false && wplc_node_message_receiver !== null){
|
177 |
+
//Delegate to handler
|
178 |
if(wplc_node_port_open){
|
179 |
wplc_node_message_receiver(event.data);
|
180 |
wplc_node_global_message_receiver(event.data);
|
204 |
}
|
205 |
}
|
206 |
|
207 |
+
|
208 |
},
|
209 |
send : function (wplc_send_url, wplc_send_data, wplc_send_type, wplc_send_timeout, wplc_send_success_callback, wplc_send_fail_callback, wplc_send_complete_callback){
|
210 |
wplc_origin_url = wplc_send_url.replace("/wp-admin/admin-ajax.php", "");
|
251 |
wplc_origin_url = wplc_send_url.replace("/wp-admin/admin-ajax.php", "");
|
252 |
wplc_send_data.origin_url = wplc_origin_url;
|
253 |
wplc_socket_add_to_queue(wplc_send_data, wplc_send_success_callback, wplc_send_fail_callback, wplc_send_complete_callback);
|
254 |
+
} */
|
255 |
+
|
256 |
};
|
257 |
|
258 |
WPLCServer.Ajax = {
|
273 |
if(typeof wplc_send_data['action'] !== "undefined" && wplc_send_data['action'] !== "wplc_start_chat"){ //Is this the start?
|
274 |
wplc_send_success_callback(response);
|
275 |
} else {
|
276 |
+
//Check if we are going to go into socket mode after this?
|
277 |
if(typeof wplc_use_node_server !== "undefined" && wplc_use_node_server === "true"){
|
278 |
if(window.WebSocket){
|
279 |
wplc_send_success_callback(response); //Send the data if we are going to sockets after this
|
311 |
return wplc_transport_prepared;
|
312 |
},
|
313 |
asyncStorage : function(wplc_send_url, wplc_send_data, wplc_send_timeout){
|
314 |
+
//Do nothing -> Ajax handles
|
315 |
},
|
316 |
forceClosePort : function(){
|
317 |
//Do Nothing ajax doesnt use socket ports
|
345 |
if(wplc_node_socket.readyState !== WebSocket.CONNECTING && wplc_node_socket.readyState !== WebSocket.CLOSING && wplc_node_socket.readyState !== WebSocket.CLOSED){
|
346 |
wplc_current_queue_item.data.is_typing = typeof wplc_node_is_client_typing !== "undefined" ? wplc_node_is_client_typing : false;
|
347 |
wplc_node_socket.send(JSON.stringify(wplc_current_queue_item.data));
|
348 |
+
|
349 |
if(typeof wplc_current_queue_item.success === "function"){
|
350 |
+
wplc_current_queue_item.success();
|
351 |
}
|
352 |
} else {
|
353 |
//Try again in a sec just now -> Add it to the queue
|
354 |
setTimeout(function(){
|
355 |
+
wplc_socket_send(data, success, fail, complete);
|
356 |
}, 500);
|
357 |
}
|
358 |
} else {
|
359 |
setTimeout(function(){
|
360 |
//Try again in a sec just now -> Add it to the queue
|
361 |
+
wplc_socket_send(data, success, fail, complete);
|
362 |
}, 500);
|
363 |
}
|
364 |
}
|
366 |
}
|
367 |
}
|
368 |
|
369 |
+
function wplc_sanitize_attributes( str ){
|
370 |
+
var wplc_allowed_attributes = "onload,onclick,alert,onerror,dalert";
|
371 |
+
var allowed_attr = wplc_allowed_attributes.split(",");
|
372 |
+
for( i = 0; i < allowed_attr.length; i++ ){
|
373 |
+
str = str.replace(allowed_attr[i], '');
|
374 |
+
}
|
375 |
+
|
376 |
+
return str;
|
377 |
+
}
|
378 |
+
|
379 |
function wplc_socket_add_to_queue(data, success, fail, complete){
|
380 |
if(typeof data.server_token === "undefined"){
|
381 |
+
if(typeof bleeper_api_key !== "undefined"){
|
382 |
+
data.server_token = bleeper_api_key;
|
383 |
} else {
|
384 |
wplc_server_error("No Server Token Present, Something will go wrong");
|
385 |
}
|
411 |
}
|
412 |
}
|
413 |
|
414 |
+
function wplc_rest_api(type, wplc_send_data, wplc_send_timeout, next) {
|
415 |
+
|
416 |
+
if (typeof wplc_xhr !== "undefined" && typeof wplc_xhr.abort() !== "undefined") { wplc_xhr.abort(); }
|
417 |
+
if (typeof next === "undefined" || next === null) { next = function() {}; }
|
418 |
+
var wplc_node_ajax_action = type;
|
419 |
+
//Send the data to the Async
|
420 |
+
if(typeof wplc_restapi_enabled !== "undefined" && parseInt(wplc_restapi_enabled) === 1 && typeof wplc_restapi_endpoint !== "undefined"){
|
421 |
+
//REST API is ready to rumble
|
422 |
+
wplc_send_url = wplc_restapi_endpoint + "/" + type;
|
423 |
+
|
424 |
+
var prepared_data = wplc_send_data;
|
425 |
+
|
426 |
+
var x = {
|
427 |
+
action : wplc_node_ajax_action,
|
428 |
+
relay_action : wplc_send_data.action,
|
429 |
+
chat_id : wplc_send_data.cid,
|
430 |
+
security : wplc_send_data.security,
|
431 |
+
message : wplc_send_data.msg,
|
432 |
+
server_token : wplc_restapi_token,
|
433 |
+
wplc_extra_data:document.wplc_extra_data,
|
434 |
+
wplc_data : wplc_send_data
|
435 |
+
};
|
436 |
+
|
437 |
+
|
438 |
+
prepared_data.server_token = wplc_restapi_token;
|
439 |
+
prepared_data.token = wplc_restapi_token; /* backwards compat */
|
440 |
+
if (typeof prepared_data.wplc_extra_data === "undefined") {
|
441 |
+
prepared_data.wplc_extra_data = document.wplc_extra_data;
|
442 |
+
}
|
443 |
+
prepared_data._wpnonce = wplc_restapi_nonce;
|
444 |
+
|
445 |
+
wplc_xhr = jQuery.ajax({
|
446 |
+
url : wplc_send_url,
|
447 |
+
data : prepared_data,
|
448 |
+
type : "POST",
|
449 |
+
timeout : wplc_send_timeout,
|
450 |
+
success : function(response){
|
451 |
+
wplc_server_log("REST SEND = SUCCESS");
|
452 |
+
next(response);
|
453 |
+
},
|
454 |
+
error : function(error, exception){
|
455 |
+
wplc_server_log("REST SEND = FAIL");
|
456 |
+
next();
|
457 |
+
},
|
458 |
+
complete : function(response){
|
459 |
+
next(response);
|
460 |
+
}
|
461 |
+
});
|
462 |
+
} else {
|
463 |
+
wplc_server_log("NO REST API :(");
|
464 |
+
next();
|
465 |
+
}
|
466 |
+
|
467 |
+
}
|
468 |
+
|
469 |
function wplc_socket_async_storage_handler(wplc_send_url, wplc_send_data, wplc_send_timeout){
|
470 |
var wplc_node_ajax_action = "wplc_node_async_storage_ajax";
|
471 |
//Send the data to the Async
|
472 |
if(typeof wplc_restapi_enabled !== "undefined" && parseInt(wplc_restapi_enabled) === 1 && typeof wplc_restapi_endpoint !== "undefined"){
|
473 |
+
//REST API is ready to rumble
|
474 |
wplc_send_url = wplc_restapi_endpoint + "/async_storage";
|
475 |
} else {
|
476 |
//Ajax time! Cause the Rest she Left
|
485 |
wplc_extra_data:document.wplc_extra_data
|
486 |
};
|
487 |
|
488 |
+
if(typeof bleeper_api_key !== "undefined"){
|
489 |
+
prepared_data.server_token = bleeper_api_key;
|
490 |
}
|
491 |
|
492 |
+
/*
|
493 |
wplc_node_async_array = new Array(); //Clearing the storage array before the next data can be sent through
|
494 |
if(typeof Cookies !== "undefined" && typeof Cookies === "function"){
|
495 |
Cookies.remove('wplc_server_async_storage'); //Clear the cookies now so that we don't do this again.
|
496 |
}
|
497 |
+
*/
|
498 |
jQuery.ajax({
|
499 |
url : wplc_send_url,
|
500 |
data : prepared_data,
|
507 |
wplc_server_log("ASYNC STORAGE = FAIL");
|
508 |
},
|
509 |
complete : function(response){
|
510 |
+
|
511 |
}
|
512 |
});
|
513 |
}
|
536 |
function wplc_node_global_message_receiver(data){
|
537 |
if(data){
|
538 |
if (typeof data !== "object") {
|
539 |
+
data = JSON.parse(data);
|
540 |
}
|
541 |
}
|
542 |
|
573 |
}
|
574 |
|
575 |
function wplc_add_date_and_time(the_message,originates) {
|
576 |
+
|
577 |
if (parseInt(originates) === 1 || parseInt(originates) === 2) {
|
578 |
+
|
579 |
var time_msg = '';
|
580 |
|
581 |
/* identfy the timestamp */
|
589 |
|
590 |
}
|
591 |
}
|
|
|
592 |
|
593 |
if (typeof the_message.other === "undefined" || typeof the_message.other.datetime === "undefined") {
|
594 |
/* there is no datetime so return nothing */
|
595 |
return '';
|
596 |
} else {
|
597 |
if (typeof wplc_show_chat_detail !== "undefined") {
|
598 |
+
|
599 |
+
var datetimestamp = the_message.other.hasOwnProperty( 'datetimeUTC' ) ? the_message.other.datetimeUTC : the_message.other.datetime;
|
600 |
+
var dateTime = new Date( parseInt( datetimestamp ) * 1000 );
|
601 |
+
|
602 |
+
if ( typeof wplc_show_chat_detail.date !== 'undefined' && '1' === wplc_show_chat_detail.date ) {
|
603 |
+
|
604 |
+
var date_format = typeof wplc_datetime_format !== 'undefined' && wplc_datetime_format.hasOwnProperty( 'date_format' ) ? wplc_datetime_format.date_format : 'n/d';
|
605 |
+
var date_month = dateTime.getMonth();
|
606 |
+
var date_day = dateTime.getDate();
|
607 |
+
var date_months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
|
608 |
+
var date_days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
609 |
+
var date_day_no = dateTime.getDay();
|
610 |
+
var date_year = dateTime.getFullYear();
|
611 |
+
|
612 |
+
time_msg += date_format
|
613 |
+
.replace( /S/g, '%S%' )
|
614 |
+
.replace( /D/g, '%D%' )
|
615 |
+
.replace( /l/g, '%l%' )
|
616 |
+
.replace( /F/g, '%F%' )
|
617 |
+
.replace( /M/g, '%M%' )
|
618 |
+
.replace( /j/g, date_day )
|
619 |
+
.replace( /d/g, date_day < 10 ? '0' + date_day : date_day )
|
620 |
+
.replace( /w/g, date_day_no )
|
621 |
+
.replace( /n/g, date_month + 1 )
|
622 |
+
.replace( /m/g, date_month + 1 < 10 ? '0' + ( date_month + 1 ) : date_month + 1 )
|
623 |
+
.replace( /Y/g, date_year )
|
624 |
+
.replace( /y/g, date_year.toString().substr( 2, 2 ) )
|
625 |
+
.replace( /%S%/g, 1 === date_day ? 'st' : ( 2 === date_day ? 'nd' : ( 3 === date_day ? 'rd' : 'th' ) ) )
|
626 |
+
.replace( /%D%/g, date_days[ date_day_no ].substr( 0, 3 ) )
|
627 |
+
.replace( /%l%/g, date_days[ date_day_no ] )
|
628 |
+
.replace( /%F%/g, date_months[ date_month ] )
|
629 |
+
.replace( /%M%/g, date_months[ date_month ].substr( 0, 3 ) ) + ' ';
|
630 |
+
|
631 |
+
}
|
632 |
+
if ( typeof wplc_show_chat_detail.time !== "undefined" && '1' === wplc_show_chat_detail.time ) {
|
633 |
+
|
634 |
+
var time_format = typeof wplc_datetime_format !== 'undefined' && wplc_datetime_format.hasOwnProperty( 'time_format' ) ? wplc_datetime_format.time_format : 'H:i';
|
635 |
+
var time_hours_12 = dateTime.getHours() > 12 ? dateTime.getHours() - 12 : ( dateTime.getHours() < 1 ? 12 : dateTime.getHours() );
|
636 |
+
var time_hours_24 = dateTime.getHours();
|
637 |
+
var time_am_pm = time_hours_24 > 11 ? 'pm' : 'am';
|
638 |
+
var time_minutes = dateTime.getMinutes();
|
639 |
+
|
640 |
+
time_msg += time_format
|
641 |
+
.replace( /g/g, time_hours_12 )
|
642 |
+
.replace( /h/g, time_hours_12 < 10 ? '0' + time_hours_12 : time_hours_12 )
|
643 |
+
.replace( /G/g, time_hours_24 )
|
644 |
+
.replace( /H/g, time_hours_24 < 10 ? '0' + time_hours_24 : time_hours_24 )
|
645 |
+
.replace( /i/g, time_minutes < 10 ? '0' + time_hours_24 : time_hours_24 )
|
646 |
+
.replace( /a/g, time_am_pm.toLowerCase() )
|
647 |
+
.replace( /A/g, time_am_pm.toUpperCase() );
|
648 |
|
649 |
+
}
|
|
|
650 |
if (time_msg !== '') {
|
651 |
if (parseInt(originates) === 1) { aoru_class = 'wplc-msg-float-left'; } else { aoru_class = 'wplc-msg-float-right'; }
|
652 |
time_msg = '<span class="timedate '+aoru_class+'">'+time_msg+'</span>';
|
659 |
} else {
|
660 |
return '';
|
661 |
}
|
662 |
+
|
663 |
+
}
|
664 |
+
|
665 |
+
function wplc_get_chat_person_name_msg_field(name) {
|
666 |
+
try {
|
667 |
+
return '<span class="wplc-chat-person-name">' + name + ': </span>';
|
668 |
+
} catch(err) {
|
669 |
+
//console.log("Could not wplc_get_chat_person_name_msg_field() " + err);
|
670 |
+
}
|
671 |
}
|
672 |
|
673 |
/**
|
674 |
* Pushes the message object to the chat box
|
675 |
+
*
|
676 |
* @param {object} the_message The message object
|
677 |
* @param {string} aoru a for Agent, u for User
|
678 |
* @return void
|
685 |
* Some system notifications may not come through with an ID so we can accept those.
|
686 |
*/
|
687 |
var add_message = true;
|
688 |
+
if (typeof the_message.mid !== "undefined" && aoru === "u") {
|
689 |
if (parseInt(the_message.mid) === 0 || the_message.mid === null) {
|
690 |
add_message = true;
|
691 |
} else {
|
699 |
}
|
700 |
}
|
701 |
if (add_message) {
|
702 |
+
if (typeof the_message.originates !== "undefined" && the_message.originates !== null && the_message.originates !== "null"){
|
703 |
var message_class = "";
|
704 |
var grav_hash = "";
|
705 |
var message_grav = "";
|
707 |
var message_content = "";
|
708 |
var message_aid;
|
709 |
|
710 |
+
var message_edit_string = "";
|
711 |
+
|
712 |
+
if (parseInt(the_message.originates) === 1) {
|
713 |
+
//From Admin
|
714 |
|
|
|
|
|
|
|
715 |
/* Define which agent it was sent from */
|
716 |
if (typeof the_message.other !== "undefined" && typeof the_message.other.aid !== "undefined") {
|
717 |
message_aid = the_message.other.aid.toString(); /* set it to a string because wp_localize doesnt know how to set keys as integers */
|
723 |
}
|
724 |
message_class = "wplc-admin-message wplc-color-bg-4 wplc-color-2 wplc-color-border-4";
|
725 |
|
726 |
+
if (aoru === 'u') {
|
727 |
+
|
728 |
+
/* message came from admin, intended for user */
|
729 |
if (message_aid !== false && typeof wplc_agent_data !== "undefined" && typeof wplc_agent_data[message_aid] !== "undefined") {
|
730 |
/* we know who the agent was that sent this message (v7.1.00+) */
|
731 |
if (typeof wplc_show_chat_detail !== "undefined") {
|
732 |
+
if (typeof wplc_show_chat_detail.avatar !== "undefined" && wplc_show_chat_detail.avatar === "1") { message_grav = (typeof wplc_agent_data[message_aid].md5 !== "undefined" ? "<img src='//www.gravatar.com/avatar/"+wplc_agent_data[message_aid].md5+"?s=80' class='wplc-admin-message-avatar' />" : ""); }
|
733 |
+
if (typeof wplc_show_chat_detail.name !== "undefined" && wplc_show_chat_detail.name === "1") { message_from = (typeof wplc_agent_data[message_aid].name !== "undefined" ? wplc_get_chat_person_name_msg_field(wplc_agent_data[message_aid].name) : ""); }
|
734 |
}
|
735 |
|
736 |
} else {
|
737 |
/* we do'nt know which agent sent this message, so lets set it as the current user instead (backwards compat) */
|
738 |
if (typeof wplc_show_chat_detail !== "undefined") {
|
739 |
+
if (typeof wplc_show_chat_detail.avatar !== "undefined" && wplc_show_chat_detail.avatar === "1") { message_grav = (typeof wplc_current_agent.email !== "undefined" ? "<img src='//www.gravatar.com/avatar/"+wplc_current_agent.email+"?s=80' class='wplc-admin-message-avatar' />" : ""); }
|
740 |
+
if (typeof wplc_show_chat_detail.name !== "undefined" && wplc_show_chat_detail.name === "1") { message_from = (typeof wplc_current_agent.name !== "undefined" ? wplc_get_chat_person_name_msg_field(wplc_current_agent.name) : ""); }
|
741 |
}
|
742 |
}
|
743 |
} else {
|
744 |
+
message_edit_string = "<span class='bleeper-edit-message' style='display:none;'>Edit</span>";
|
745 |
if (message_aid !== false && typeof wplc_agent_data !== "undefined" && typeof wplc_agent_data[message_aid] !== "undefined") {
|
746 |
+
|
747 |
/* we know who the agent was that sent this message (v7.1.00+) */
|
748 |
if (typeof wplc_show_chat_detail !== "undefined") {
|
749 |
+
if (typeof wplc_show_chat_detail.avatar !== "undefined" && wplc_show_chat_detail.avatar === "1") { message_grav = (typeof wplc_agent_data[message_aid].md5 !== "undefined" ? "<img src='//www.gravatar.com/avatar/"+wplc_agent_data[message_aid].md5+"?s=80' class='wplc-admin-message-avatar' />" : ""); }
|
750 |
+
if (typeof wplc_show_chat_detail.name !== "undefined" && wplc_show_chat_detail.name === "1") { message_from = (typeof wplc_agent_data[message_aid].name !== "undefined" ? wplc_get_chat_person_name_msg_field(wplc_agent_data[message_aid].name) : ""); }
|
751 |
}
|
752 |
|
753 |
} else {
|
754 |
+
if (typeof wplc_show_chat_detail.avatar !== "undefined" && wplc_show_chat_detail.avatar === "1") {
|
755 |
+
message_grav = (typeof wplc_admin_agent_email !== "undefined" ? "<img src='//www.gravatar.com/avatar/"+wplc_admin_agent_email+"?s=80' class='wplc-admin-message-avatar' />" : "");
|
756 |
+
}
|
757 |
+
if (typeof wplc_show_chat_detail.name !== "undefined" && wplc_show_chat_detail.name === "1") {
|
758 |
+
message_from = (typeof wplc_admin_agent_name !== "undefined" ? wplc_get_chat_person_name_msg_field(wplc_admin_agent_name) : "");
|
759 |
+
}
|
760 |
}
|
761 |
}
|
762 |
|
763 |
message_content = the_message.msg.wplcStripSlashes();
|
764 |
wplc_new_message_sound = true;
|
765 |
+
|
766 |
} else if (parseInt(the_message.originates) === 0 || parseInt(the_message.originates) === 3) {
|
767 |
//System Notification
|
768 |
message_class = "wplc_system_notification wplc-color-4";
|
769 |
message_content = the_message.msg;
|
770 |
if (typeof the_message.other.ntype !== "undefined") {
|
771 |
if (the_message.other.ntype === "joined") {
|
772 |
+
jQuery.event.trigger({type: "wplc_agent_joined", ndata:the_message});
|
773 |
}
|
774 |
}
|
775 |
|
777 |
/* most likely from the user */
|
778 |
message_class = "wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1";
|
779 |
if (aoru === 'u') {
|
780 |
+
message_edit_string = "<span class='bleeper-edit-message' style='display:none;'>Edit</span>";
|
781 |
+
|
782 |
if (jQuery(wplc_email).val() !== "") {
|
783 |
message_grav = md5(jQuery(wplc_email).val());
|
784 |
+
|
785 |
+
} else {
|
786 |
+
if (typeof visitor_list !== "undefined" && typeof visitor_list[active_chatid] !== "undefined" && typeof visitor_list[active_chatid].email !== "undefined") {
|
787 |
+
message_grav = md5(visitor_list[active_chatid].email);
|
788 |
+
} else {
|
789 |
+
if(typeof wplc_cookie_email !== "undefined" && wplc_cookie_email !== ""){
|
790 |
+
message_grav = md5(wplc_cookie_email);
|
791 |
+
} else {
|
792 |
+
message_grav = 'x';
|
793 |
+
}
|
794 |
+
}
|
795 |
}
|
796 |
+
|
797 |
+
message_grav = "<img src='//www.gravatar.com/avatar/" + message_grav + "?s=80' class='wplc-user-message-avatar' />";
|
798 |
+
if (typeof Cookies.get("wplc_name") === "undefined") {
|
799 |
+
message_from = wplc_get_chat_person_name_msg_field("Guest");
|
800 |
} else {
|
801 |
+
message_from = wplc_get_chat_person_name_msg_field(Cookies.get("wplc_name"));
|
802 |
}
|
803 |
} else {
|
804 |
if (typeof wplc_chat_email !== "undefined") {
|
805 |
+
message_grav = wplc_chat_email;
|
806 |
+
|
807 |
+
} else {
|
808 |
+
if (typeof visitor_list !== "undefined" && typeof visitor_list[active_chatid] !== "undefined" && typeof visitor_list[active_chatid].email !== "undefined") {
|
809 |
+
message_grav = md5(visitor_list[active_chatid].email);
|
810 |
+
} else {
|
811 |
+
if(typeof wplc_cookie_email !== "undefined" && wplc_cookie_email !== ""){
|
812 |
+
message_grav = md5(wplc_cookie_email);
|
813 |
+
} else {
|
814 |
+
message_grav = 'x';
|
815 |
+
}
|
816 |
+
}
|
817 |
}
|
818 |
+
message_grav = "<img src='//www.gravatar.com/avatar/" + message_grav + "?s=80' class='wplc-user-message-avatar' />";
|
819 |
if (typeof wplc_chat_name !== "undefined") {
|
820 |
+
message_from = wplc_get_chat_person_name_msg_field(wplc_chat_name);
|
821 |
}
|
822 |
}
|
823 |
message_content = the_message.msg.wplcStripSlashes();
|
824 |
}
|
825 |
|
826 |
+
if (typeof the_message.other !== "undefined" && typeof the_message.other.from_an_agent !== "undefined"){
|
827 |
+
if(the_message.other.from_an_agent === true || the_message.other.from_an_agent === "true"){
|
828 |
+
//Cannot edit this
|
829 |
+
message_edit_string = "";
|
830 |
+
}
|
831 |
+
}
|
832 |
+
message_class += " message_"+the_message.mid;
|
833 |
+
|
834 |
+
if (message_content !== ""){
|
835 |
+
message_content = wplc_sanitize_attributes(message_content);
|
836 |
+
|
837 |
+
// Open the HTML of a message
|
838 |
+
var concatenated_message = "<span class='" + message_class + "' mid='"+the_message.mid+"'>";
|
839 |
+
|
840 |
+
if (typeof wplc_show_chat_detail !== "undefined") {
|
841 |
|
|
|
|
|
842 |
if (typeof wplc_show_chat_detail.avatar !== "undefined" && wplc_show_chat_detail.avatar === "1") {
|
843 |
+
concatenated_message += message_grav;
|
844 |
+
}
|
845 |
+
|
846 |
+
// Add a wrapper for the person name and the message, this wrapper is necessary to implement the UI of the admin chat
|
847 |
+
concatenated_message += "<div class='wplc-msg-content' mid='"+the_message.mid+"'>";
|
848 |
+
|
849 |
if (typeof wplc_show_chat_detail.name !== "undefined" && wplc_show_chat_detail.name === "1") {
|
850 |
+
concatenated_message += message_from;
|
851 |
}
|
852 |
+
} else {
|
853 |
+
// Add a wrapper for the person name and the message, this wrapper is necessary to implement the UI of the admin chat
|
854 |
+
concatenated_message += "<div class='wplc-msg-content'>";
|
855 |
+
}
|
856 |
|
857 |
+
var original_message = message_content;
|
858 |
+
if (typeof niftyFormatParser !== "undefined"){
|
859 |
+
message_content = niftyFormatParser(message_content);
|
860 |
+
}
|
861 |
+
|
862 |
+
concatenated_message += "<span class='messageBody' data-message='" + original_message + "'>"+message_content+"</span>"+ message_edit_string;
|
863 |
+
|
864 |
+
// Close the person name and message wrapper, if it was added
|
865 |
+
concatenated_message += "</div>";
|
866 |
+
|
867 |
+
// Close the HTML of a message
|
868 |
concatenated_message += "</span>";
|
869 |
concatenated_message += wplc_add_date_and_time(the_message,the_message.originates);
|
870 |
|
871 |
if (aoru === 'u') {
|
872 |
wplc_chat_box_elemn = "#wplc_chatbox";
|
873 |
} else {
|
|
|
|
|
|
|
|
|
|
|
874 |
|
875 |
+
if (typeof bleeper_remote_enabled !== "undefined"){
|
876 |
+
wplc_chat_box_elemn = "#messages";
|
877 |
+
} else {
|
878 |
+
wplc_chat_box_elemn = "#admin_chat_box_area_"+wplc_cid;
|
879 |
+
}
|
880 |
}
|
881 |
+
|
882 |
|
883 |
+
jQuery(wplc_chat_box_elemn).append(concatenated_message);
|
884 |
+
|
885 |
+
}
|
886 |
+
}
|
887 |
}
|
888 |
next();
|
889 |
}
|
890 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
891 |
jQuery(function(){
|
892 |
jQuery(document).ready(function(){
|
893 |
+
var wplc_node_searchTimeout;
|
894 |
+
|
895 |
jQuery("body").on("keydown","#wplc_chatmsg, #wplc_admin_chatmsg", function(e) {
|
896 |
if(typeof wplc_node_sockets_ready !== "undefined" && wplc_node_sockets_ready === true){
|
897 |
if(typeof wplc_node_is_client_typing !== "undefined"){
|
898 |
if (e.which <= 90 && e.which >= 48) {
|
899 |
+
if (wplc_node_is_client_typing) {
|
900 |
wplc_node_renew_typing();
|
901 |
+
return;
|
902 |
}
|
903 |
wplc_node_is_client_typing = true;
|
904 |
+
|
905 |
wplc_node_searchTimeout = setTimeout(wplc_node_clear_typing, 1000);
|
906 |
}
|
907 |
}
|
908 |
}
|
909 |
+
});
|
910 |
+
|
911 |
+
jQuery("body").on("click", "#wplc_na_msg_btn", function() {
|
912 |
+
var wplc_name = jQuery("#wplc_name").val();
|
913 |
+
var wplc_email = jQuery("#wplc_email").val();
|
914 |
+
var wplc_msg = jQuery("#wplc_message").val();
|
915 |
+
var wplc_domain = jQuery("#wplc_domain_offline").val();
|
916 |
+
var ip_address = jQuery("#wplc_ip_address").val();
|
917 |
+
|
918 |
+
if (wplc_name.length <= 0) { alert(wplc_error_messages.valid_name); return false; }
|
919 |
+
if (wplc_email.length <= 0) { alert(wplc_error_messages.valid_email); return false; }
|
920 |
+
var testEmail = /^[A-Z0-9._%+-]+@([A-Z0-9-]+\.)+[A-Z]{2,12}$/i;
|
921 |
+
if (!testEmail.test(wplc_email)){
|
922 |
+
alert(wplc_error_messages.valid_email); return false;
|
923 |
+
}
|
924 |
+
if (wplc_msg.length <= 0) { alert(wplc_error_messages.empty_message); return false; }
|
925 |
+
jQuery("#wp-live-chat-2-info").hide();
|
926 |
+
jQuery("#wplc_message_div").html(wplc_offline_msg);
|
927 |
+
|
928 |
+
wplc_cid = Cookies.get('wplc_cid');
|
929 |
+
|
930 |
+
var data = {
|
931 |
+
action: 'wplc_user_send_offline_message',
|
932 |
+
security: wplc_nonce,
|
933 |
+
cid: wplc_cid,
|
934 |
+
name: wplc_name,
|
935 |
+
email: wplc_email,
|
936 |
+
msg: wplc_msg,
|
937 |
+
ip: ip_address,
|
938 |
+
domain: wplc_domain,
|
939 |
+
wplc_extra_data:wplc_extra_data
|
940 |
+
};
|
941 |
+
|
942 |
+
jQuery.post(wplc_ajaxurl_site, data, function(response) {
|
943 |
+
jQuery("#wplc_message_div").html(wplc_offline_msg3);
|
944 |
+
});
|
945 |
+
if (typeof wplc_enable_ga !== "undefined" && wplc_enable_ga === '1') {
|
946 |
+
if (typeof ga !== "undefined") {
|
947 |
+
ga('send', {
|
948 |
+
hitType: 'event',
|
949 |
+
eventCategory: 'WP_Live_Chat_Support',
|
950 |
+
eventAction: 'Event',
|
951 |
+
eventLabel: 'User Send Offline Message'
|
952 |
+
});
|
953 |
+
}
|
954 |
+
}
|
955 |
+
});
|
956 |
+
|
957 |
|
958 |
function wplc_node_renew_typing() {
|
959 |
clearTimeout(wplc_node_searchTimeout);
|
962 |
function wplc_node_clear_typing() {
|
963 |
wplc_node_is_client_typing = false;
|
964 |
clearTimeout(wplc_node_searchTimeout);
|
965 |
+
}
|
966 |
});
|
967 |
+
});
|
968 |
+
|
969 |
+
var wplc_generate_system_notification_object = function(msg,other,originates) {
|
970 |
+
the_message = {};
|
971 |
+
the_message.originates = originates;
|
972 |
+
the_message.msg = msg;
|
973 |
+
the_message.other = other;
|
974 |
+
var wplc_d = new Date();
|
975 |
+
the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
|
976 |
+
return the_message;
|
977 |
+
}
|
978 |
+
|
979 |
+
/*
|
980 |
+
* Updates the message element with a new message.
|
981 |
+
* - mid: Message ID which is appended to class selector as .message_{mid}
|
982 |
+
* - message: The html/text to insert into this container
|
983 |
+
* - inner_container_class: Optional, used to select the first child of the class type within the primary message container
|
984 |
+
* Nice for selecting the 'messageBody' class specifically
|
985 |
+
*/
|
986 |
+
function wplc_update_message_element_by_mid(mid, message, inner_container_class){
|
987 |
+
var element_selector = ".message_" + mid;
|
988 |
+
element_selector += (typeof inner_container_class !== "undefined" && inner_container_class !== false) ? (" ." + inner_container_class) : "";
|
989 |
+
|
990 |
+
jQuery(element_selector).html(message);
|
991 |
+
}
|
js/wplc_surveys.js
CHANGED
@@ -5,7 +5,9 @@ jQuery(document).on("wplc_end_chat", function( e ) {
|
|
5 |
jQuery("#wplc-extra-div").show();
|
6 |
orig_title_wplc = jQuery("#wplc_first_message").html();
|
7 |
jQuery("#wplc_first_message").html(wplc_end_chat_string);
|
|
|
8 |
}
|
|
|
9 |
});
|
10 |
|
11 |
|
@@ -14,6 +16,9 @@ jQuery(document).on("wplc_minimize_chat", function( e ) {
|
|
14 |
jQuery("#wplc-extra-div").hide();
|
15 |
jQuery("#wplc_first_message").html(orig_title_wplc);
|
16 |
}
|
|
|
17 |
|
18 |
|
19 |
-
|
|
|
|
5 |
jQuery("#wplc-extra-div").show();
|
6 |
orig_title_wplc = jQuery("#wplc_first_message").html();
|
7 |
jQuery("#wplc_first_message").html(wplc_end_chat_string);
|
8 |
+
jQuery("#nimblesquirrel_div").attr('style', 'width: 100% !important');
|
9 |
}
|
10 |
+
|
11 |
});
|
12 |
|
13 |
|
16 |
jQuery("#wplc-extra-div").hide();
|
17 |
jQuery("#wplc_first_message").html(orig_title_wplc);
|
18 |
}
|
19 |
+
});
|
20 |
|
21 |
|
22 |
+
jQuery(document).on("click", "#wp-live-chat-header", function() {
|
23 |
+
jQuery("#nimblesquirrel_div").attr('style', 'width: 100% !important');
|
24 |
+
});
|
js/wplc_tabs.js
CHANGED
@@ -1,5 +1,29 @@
|
|
1 |
-
|
2 |
jQuery("document").ready(function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
if(jQuery("input[type=radio][name='wplc_mail_type']:checked").val() === "php_mailer"){
|
5 |
jQuery("#wplc_smtp_details").show();
|
@@ -16,9 +40,19 @@ jQuery("document").ready(function() {
|
|
16 |
}
|
17 |
});
|
18 |
|
|
|
19 |
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
jQuery( "#wplc_tabs li" ).removeClass( "ui-corner-top" ).addClass( "ui-corner-left" );
|
23 |
|
24 |
|
@@ -213,7 +247,20 @@ jQuery("document").ready(function() {
|
|
213 |
|
214 |
jQuery(function () {
|
215 |
jQuery(".wplc_settings_tooltip").tooltip({
|
216 |
-
position: {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
});
|
218 |
});
|
219 |
});
|
|
|
1 |
jQuery("document").ready(function() {
|
2 |
+
|
3 |
+
function storeActiveTab(event, ui)
|
4 |
+
{
|
5 |
+
if(!window.sessionStorage)
|
6 |
+
return;
|
7 |
+
|
8 |
+
sessionStorage.setItem(
|
9 |
+
"wplc-tabs-index",
|
10 |
+
$(event.target).tabs("option", "active")
|
11 |
+
);
|
12 |
+
}
|
13 |
+
|
14 |
+
function recallActiveTab()
|
15 |
+
{
|
16 |
+
if(!window.sessionStorage)
|
17 |
+
return 0;
|
18 |
+
|
19 |
+
var active = sessionStorage.getItem("wplc-tabs-index");
|
20 |
+
|
21 |
+
if(isNaN(active))
|
22 |
+
active = 0;
|
23 |
+
|
24 |
+
return active;
|
25 |
+
}
|
26 |
+
|
27 |
|
28 |
if(jQuery("input[type=radio][name='wplc_mail_type']:checked").val() === "php_mailer"){
|
29 |
jQuery("#wplc_smtp_details").show();
|
40 |
}
|
41 |
});
|
42 |
|
43 |
+
|
44 |
|
45 |
+
jQuery("#wplc_tabs").tabs({
|
46 |
+
create: function(event, ui)
|
47 |
+
{
|
48 |
+
jQuery("#wplc_settings_page_loader").remove();
|
49 |
+
jQuery(".wrap").fadeIn();
|
50 |
+
jQuery(".wplc_settings_save_notice").fadeIn();
|
51 |
+
},
|
52 |
+
active: recallActiveTab(),
|
53 |
+
activate: storeActiveTab
|
54 |
+
}).addClass( "ui-tabs-vertical ui-helper-clearfix" );
|
55 |
+
|
56 |
jQuery( "#wplc_tabs li" ).removeClass( "ui-corner-top" ).addClass( "ui-corner-left" );
|
57 |
|
58 |
|
247 |
|
248 |
jQuery(function () {
|
249 |
jQuery(".wplc_settings_tooltip").tooltip({
|
250 |
+
position: {
|
251 |
+
my: "left+15 center",
|
252 |
+
at: "right center",
|
253 |
+
|
254 |
+
},
|
255 |
+
template: '<div class="tooltip wplc_tooltip_control"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
|
256 |
+
onShow: function(){
|
257 |
+
var $trigger = this.getTrigger();
|
258 |
+
var offset = $trigger.offset();
|
259 |
+
this.getTip().css({
|
260 |
+
'top' : offset.top,
|
261 |
+
'left' : offset.left
|
262 |
+
});
|
263 |
+
}
|
264 |
});
|
265 |
});
|
266 |
});
|
js/wplc_u.js
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
/*
|
2 |
* Cookie Status
|
3 |
-
*
|
4 |
* 1 - complete - user has left site
|
5 |
* 2 - pending - user waiting for chat to be answered by admin
|
6 |
* 3 - active chat - user and admin are chatting
|
7 |
* 4 - deleted
|
8 |
* 5 - browsing - no data has been inputted
|
9 |
* 6 - requesting chat - admin has requested a chat with user
|
10 |
-
* 7 - timed out - visitor has timed out
|
11 |
* 8 - complete but now browsing again
|
12 |
* 9 - user closed chat before starting chat
|
13 |
* 10 - user minimized active chat
|
14 |
* 11 - user moved on to another page (session variable is different)
|
15 |
* 12 - user has not been answered after sending chat request and is still active
|
16 |
-
*
|
17 |
*/
|
18 |
var wplc_is_chat_open = false;
|
19 |
var wplc_online = false;
|
@@ -34,46 +34,72 @@ var wplc_shown_welcome = false;
|
|
34 |
|
35 |
var wplc_current_agent = false;
|
36 |
|
|
|
|
|
37 |
|
38 |
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
-
|
50 |
-
var wplc_fist_run = true;
|
51 |
-
var wplc_long_poll_delay = 1500;
|
52 |
|
53 |
/* preload the images */
|
54 |
wplc_preload();
|
55 |
|
56 |
wplc_cid = Cookies.get('wplc_cid');
|
57 |
-
|
58 |
if(typeof wplc_cid === 'undefined'){
|
59 |
wplc_cid = null;
|
60 |
} else {
|
61 |
wplc_cid = Cookies.get('wplc_cid');
|
62 |
}
|
63 |
-
|
64 |
wplc_check_hide_cookie = Cookies.get('wplc_hide');
|
65 |
wplc_check_minimize_cookie = Cookies.get('wplc_minimize');
|
66 |
wplc_chat_status = Cookies.get('wplc_chat_status');
|
67 |
wplc_cookie_name = Cookies.get('wplc_name');
|
68 |
wplc_cookie_email = Cookies.get('wplc_email');
|
69 |
// Always start on 5 - ajax will then return chat status if active
|
70 |
-
|
71 |
Cookies.set('wplc_chat_status', 5, { expires: 1, path: '/' });
|
72 |
wplc_chat_status = 5;
|
73 |
//if (typeof wplc_chat_status !== "undefined" && parseInt(wplc_chat_status) === 3) { } else {
|
74 |
-
|
75 |
//}
|
76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
var data = {
|
78 |
action: 'wplc_get_chat_box',
|
79 |
security: wplc_nonce,
|
@@ -89,34 +115,37 @@ jQuery(document).ready(function() {
|
|
89 |
if(response){
|
90 |
if (response === "0") { if (window.console) { console.log('WP Live Chat Support Return Error'); } wplc_run = false; return; }
|
91 |
response = JSON.parse(response);
|
92 |
-
|
93 |
-
|
94 |
jQuery( "body" ).append( response['cbox']);
|
95 |
|
96 |
wplc_listenForScrollEvent(jQuery("#wplc_chatbox"));
|
97 |
|
98 |
if( typeof wplc_cookie_name == 'undefined' || typeof wplc_cookie_email == 'undefined' ){
|
99 |
|
100 |
-
var wplc_cookie_name = jQuery( jQuery.parseHTML( response['cbox'] ) ).find( "#wplc_name" ).val();
|
101 |
-
var wplc_cookie_email = jQuery( jQuery.parseHTML( response['cbox'] ) ).find( "#wplc_email" ).val();
|
102 |
|
103 |
}
|
104 |
-
|
105 |
|
106 |
|
107 |
/* is an agent online? */
|
108 |
if (response['online'] === false) {
|
109 |
wplc_run = false;
|
110 |
wplc_online = false;
|
|
|
|
|
111 |
} else {
|
112 |
wplc_online = true;
|
|
|
113 |
}
|
114 |
|
115 |
-
|
116 |
|
117 |
if (wplc_filter_run_override !== "1" || wplc_online === false) { wplc_run = false; } else { /* we can run */ }
|
118 |
|
119 |
-
|
120 |
/* has this user been assigned an agent? */
|
121 |
if (typeof response['type'] === "undefined") {
|
122 |
wplc_shown_welcome = false;
|
@@ -124,13 +153,13 @@ jQuery(document).ready(function() {
|
|
124 |
if (response['type'] === "returning") {
|
125 |
wplc_shown_welcome = true;
|
126 |
/* set the agent vars so we can access them on the fly */
|
127 |
-
if (typeof response['agent_data'] !== "undefined") {
|
128 |
wplc_current_agent = response['agent_data'];
|
129 |
}
|
130 |
} else {
|
131 |
wplc_shown_welcome = false;
|
132 |
}
|
133 |
-
|
134 |
}
|
135 |
|
136 |
|
@@ -155,21 +184,36 @@ jQuery(document).ready(function() {
|
|
155 |
|
156 |
if(wplc_server.browserIsSocketReady()){
|
157 |
data.socket = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
}
|
159 |
|
160 |
initial_data = data;
|
161 |
// ajax long polling function
|
162 |
-
if (wplc_filter_run_override !== "1" || wplc_online === false) {
|
|
|
163 |
wplc_call_to_server_chat(data,true,true);
|
164 |
-
} else {
|
|
|
165 |
wplc_call_to_server_chat(data,true,false);
|
166 |
}
|
167 |
-
|
168 |
if(wplc_cid !== null && wplc_init_chat_box_check == true && wplc_init_chat_box !== false){
|
169 |
wplc_init_chat_box(wplc_cid,wplc_chat_status);
|
|
|
|
|
|
|
|
|
|
|
170 |
}
|
171 |
-
|
172 |
-
|
173 |
}
|
174 |
|
175 |
}
|
@@ -197,9 +241,9 @@ jQuery(document).ready(function() {
|
|
197 |
* Detect if the chatbox is being scrolled.
|
198 |
*
|
199 |
* This had to be created as jQuery does not allow the scroll event to bubble up the DOM tree.
|
200 |
-
*
|
201 |
* Thank you Bikal Basnet (https://stackoverflow.com/questions/16505182/bind-scroll-event-to-dynamic-div)
|
202 |
-
*
|
203 |
* @param object el The element in question
|
204 |
*/
|
205 |
function wplc_listenForScrollEvent(el) {
|
@@ -209,76 +253,151 @@ jQuery(document).ready(function() {
|
|
209 |
|
210 |
}
|
211 |
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
}
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
|
|
|
|
|
|
|
234 |
}
|
|
|
235 |
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
243 |
}
|
244 |
-
function wplc_user_message_receiver(data){
|
245 |
-
if(typeof wplc_loop_response_handler !== "undefined" && typeof wplc_loop_response_handler === "function"){
|
246 |
-
wplc_loop_response_handler(data, wplc_server_last_loop_data);
|
247 |
-
data = JSON.parse(data);
|
248 |
-
if(typeof data['status'] !== "undefined"){
|
249 |
-
delete wplc_server_last_loop_data.status;
|
250 |
-
}
|
251 |
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
258 |
}
|
259 |
}
|
260 |
-
|
261 |
-
function wplc_user_retry_handler(data){
|
262 |
-
var tstatus = Cookies.get("wplc_chat_status");
|
263 |
|
264 |
-
|
265 |
-
|
266 |
-
wplc_retry_interval = setTimeout(function(){
|
267 |
-
|
268 |
-
wplc_server.prepareTransport(function(){
|
269 |
-
//Transport ready...
|
270 |
-
wplc_server_last_loop_data.status = parseInt(tstatus); //Set to existing status
|
271 |
-
wplc_call_to_server_chat(wplc_server_last_loop_data);
|
272 |
-
}, wplc_user_message_receiver, wplc_user_retry_handler, wplc_log_connection_error);
|
273 |
|
|
|
|
|
|
|
274 |
|
275 |
-
|
276 |
-
|
|
|
|
|
|
|
277 |
|
|
|
|
|
278 |
}
|
|
|
279 |
}
|
|
|
280 |
|
281 |
-
|
|
|
|
|
|
|
|
|
|
|
282 |
|
283 |
|
284 |
if (typeof first_run === "undefined") { first_run = false; };
|
@@ -289,7 +408,7 @@ jQuery(document).ready(function() {
|
|
289 |
if(typeof Cookies.get('wplc_name') !== "undefined"){
|
290 |
data.msg_from_print = Cookies.get('wplc_name');
|
291 |
}
|
292 |
-
|
293 |
wplc_server_last_loop_data = data;
|
294 |
|
295 |
wplc_server.send(wplc_ajaxurl, data, "POST", 120000,
|
@@ -302,35 +421,35 @@ jQuery(document).ready(function() {
|
|
302 |
|
303 |
if (jqXHR.status == 404) {
|
304 |
wplc_log_connection_error('Error: Requested page not found. [404]');
|
305 |
-
|
306 |
} else if (jqXHR.status == 500) {
|
307 |
-
wplc_log_connection_error('Error: Internal Server Error [500].');
|
308 |
wplc_log_connection_error('Retrying in 5 seconds...');
|
309 |
-
|
310 |
} else if (exception === 'parsererror') {
|
311 |
-
wplc_log_connection_error('Error: Requested JSON parse failed.');
|
312 |
-
|
313 |
} else if (exception === 'abort') {
|
314 |
wplc_log_connection_error('Error: Ajax request aborted.');
|
315 |
-
|
316 |
} else {
|
317 |
-
wplc_log_connection_error('Error: Uncaught Error.\n' + jqXHR.responseText);
|
318 |
wplc_log_connection_error('Retrying in 5 seconds...');
|
319 |
-
|
320 |
-
}
|
321 |
},
|
322 |
function(response){
|
323 |
if (wplc_run) {
|
324 |
if(wplc_server.isInSocketMode() === false && wplc_server.isPreparingSocketMode() === false){
|
325 |
-
setTimeout(function() {
|
326 |
-
wplc_call_to_server_chat(data,false,false);
|
327 |
}, wplc_long_poll_delay);
|
328 |
} else if ((wplc_server.isInSocketMode() === false && wplc_server.isPreparingSocketMode() === true) && (typeof wplc_transport_prepared !== "undefined" && wplc_transport_prepared === false)) {
|
329 |
/* Allows for initiate chat to work on the node server */
|
330 |
if (typeof wplc_use_node_server !== "undefined" && wplc_use_node_server === "true") {
|
331 |
/* do not run this if using not the node jedi */
|
332 |
-
setTimeout(function() {
|
333 |
-
wplc_call_to_server_chat(data,false,true);
|
334 |
}, 7500);
|
335 |
}
|
336 |
} else {
|
@@ -340,1008 +459,448 @@ jQuery(document).ready(function() {
|
|
340 |
if(wplc_transport_prepared !== true && (parseInt(response_data.status) === 3 || parseInt(response_data.status) === 2)){
|
341 |
//Transport is unprepared and the user has returned to the page with a status 3/2
|
342 |
wplc_server.prepareTransport(function(){
|
343 |
-
wplc_call_to_server_chat(data,false,false);
|
344 |
}, wplc_user_message_receiver, wplc_user_retry_handler, wplc_log_connection_error);
|
345 |
}
|
346 |
}
|
347 |
}
|
348 |
}
|
349 |
}
|
350 |
-
}
|
351 |
-
);
|
352 |
-
|
353 |
-
};
|
354 |
-
|
355 |
-
function wplc_loop_response_handler(response, data){
|
356 |
-
if(response){
|
357 |
-
if (response === "0") { if (window.console) { console.log('WP Live Chat Support Return Error'); } wplc_run = false; return; }
|
358 |
-
if (typeof response !== "object") {
|
359 |
-
response = JSON.parse(response);
|
360 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
361 |
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
}
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
/* Process status changes */
|
378 |
-
if(data['status'] == response['status']){
|
379 |
-
|
380 |
-
if(data['status'] == 5 && wplc_init_chat_box_check === true && wplc_init_chat_box !== false){ // open chat box on load
|
381 |
-
wplc_init_chat_box(data['cid'], data['status']);
|
382 |
-
}
|
383 |
-
if((response['status'] == 3 || response['status'] == 2) && response['data'] != null){ // if active and data is returned
|
384 |
-
wplc_run = true;
|
385 |
-
var wplc_new_message_sound = false;
|
386 |
-
if (typeof response['data'] === "object") {
|
387 |
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
msg_to_parse = response['data'][index].wplcStripSlashes();
|
396 |
|
397 |
-
|
398 |
-
jQuery("#wplc_chatbox").append(niftyFormatParser(msg_to_parse));
|
399 |
-
} else{
|
400 |
|
401 |
-
|
402 |
-
|
|
|
403 |
|
404 |
-
|
405 |
-
|
406 |
-
} else {
|
407 |
-
/* we already have this message */
|
408 |
}
|
409 |
-
} else {
|
410 |
-
var the_message = response['data'][index];
|
411 |
-
the_message.mid = index;
|
412 |
-
wplc_push_message_to_chatbox(the_message,'u', function() {
|
413 |
-
wplc_scroll_to_bottom();
|
414 |
-
});
|
415 |
|
416 |
-
|
|
|
|
|
|
|
417 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
418 |
}
|
419 |
-
}
|
420 |
-
else {
|
421 |
-
/* backwards compatibility - response['data'] is a string */
|
422 |
-
if(typeof niftyFormatParser !== "undefined"){
|
423 |
-
jQuery("#wplc_chatbox").append(niftyFormatParser(response['data'].wplcStripSlashes()));
|
424 |
-
} else{
|
425 |
-
jQuery("#wplc_chatbox").append(response['data'].wplcStripSlashes());
|
426 |
-
|
427 |
-
}
|
428 |
-
wplc_new_message_sound = true;
|
429 |
}
|
430 |
-
|
431 |
-
if(wplc_new_message_sound){
|
432 |
-
wplc_scroll_to_bottom();
|
433 |
-
if (typeof wplc_enable_ding !== 'undefined' && wplc_enable_ding === "1") {
|
434 |
-
new Audio(wplc_plugin_url+'/wp-live-chat-support/ding.mp3').play();
|
435 |
-
}
|
436 |
-
}
|
437 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
438 |
|
439 |
-
} else {
|
440 |
-
data['status'] = wplc_chat_status;
|
441 |
-
Cookies.set('wplc_chat_status', wplc_chat_status, { expires: 1, path: '/' });
|
442 |
-
if(response['status'] == 0 || response['status'] == 12){ // no answer from admin
|
443 |
-
jQuery("#wp-live-chat-3").hide();
|
444 |
-
if (typeof response['data'] !== "undefined") {
|
445 |
-
jQuery("#wplc_chatbox").append(response['data'].wplcStripSlashes()+"<hr />");
|
446 |
}
|
447 |
-
|
448 |
}
|
449 |
-
else if(response['status'] == 8){ // chat has been ended by admin
|
450 |
-
wplc_run = false;
|
451 |
-
|
452 |
-
document.getElementById('wplc_chatmsg').disabled = true;
|
453 |
-
wplc_shown_welcome = false;
|
454 |
-
|
455 |
-
the_message = {};
|
456 |
-
the_message.originates = 0;
|
457 |
-
the_message.msg = wplc_error_messages.chat_ended_by_operator;
|
458 |
-
the_message.other = {};
|
459 |
-
var wplc_d = new Date();
|
460 |
-
the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
|
461 |
-
|
462 |
-
wplc_push_message_to_chatbox(the_message,'u', function() {
|
463 |
-
wplc_scroll_to_bottom();
|
464 |
-
});
|
465 |
-
|
466 |
-
|
467 |
-
/*
|
468 |
-
if(typeof response['data'] === "object") {
|
469 |
-
for (var index in response['data']) {
|
470 |
-
if(typeof response['data'][index] === "object"){
|
471 |
-
|
472 |
-
var the_message = response['data'][index];
|
473 |
-
if(typeof the_message.originates !== "undefined"){
|
474 |
-
var message_class = "";
|
475 |
-
var message_content = "";
|
476 |
-
|
477 |
-
if (parseInt(the_message.originates) === 0){
|
478 |
-
//System Notification
|
479 |
-
message_class = "wplc_system_notification wplc-color-4";
|
480 |
-
message_content = the_message.msg;
|
481 |
-
if(message_content !== ""){
|
482 |
-
var concatenated_message = "<span class='" + message_class + "'>";
|
483 |
-
concatenated_message += message_content;
|
484 |
-
concatenated_message += "</span>";
|
485 |
-
|
486 |
-
if(typeof niftyFormatParser !== "undefined"){
|
487 |
-
jQuery("#wplc_chatbox").append(niftyFormatParser(concatenated_message));
|
488 |
-
} else{
|
489 |
-
jQuery("#wplc_chatbox").append(concatenated_message);
|
490 |
-
}
|
491 |
-
}
|
492 |
-
}
|
493 |
-
}
|
494 |
-
}
|
495 |
-
}
|
496 |
-
} else {
|
497 |
-
//Backwards Compat
|
498 |
-
jQuery("#wplc_chatbox").append("<em>"+response['data']+"</em><br />");
|
499 |
-
}*/
|
500 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
501 |
|
502 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
503 |
|
|
|
|
|
|
|
504 |
|
505 |
-
|
506 |
-
|
507 |
-
}
|
508 |
-
else if(parseInt(response['status']) == 11){ /* use moved on to another page (perhaps in another tab so close this instance */
|
509 |
-
jQuery("#wp-live-chat").css({ "display" : "none" });
|
510 |
-
wplc_run = false;
|
511 |
-
}
|
512 |
-
else if(parseInt(response['status']) == 3 || parseInt(response['status']) == 2 || parseInt(response['status']) == 10){ // re-initialize chat
|
513 |
-
wplc_run = true;
|
514 |
-
if(parseInt(response['status']) == 3) { // only if not minimized open aswell
|
515 |
-
/* HERE NODE */
|
516 |
|
517 |
-
|
518 |
-
|
|
|
|
|
519 |
|
520 |
-
if (typeof wplc_transport_prepared !== "undefined" && wplc_transport_prepared === false) {
|
521 |
-
wplc_server.prepareTransport(function(){
|
522 |
-
wplc_call_to_server_chat(wplc_server_last_loop_data,false,false);
|
523 |
-
}, wplc_user_message_receiver, wplc_user_retry_handler, wplc_log_connection_error);
|
524 |
-
}
|
525 |
-
}
|
526 |
-
if (!wplc_is_minimized) {
|
527 |
-
if (!wplc_is_chat_open) {
|
528 |
-
wplc_cbox_animation();
|
529 |
-
setTimeout(function() {
|
530 |
-
open_chat(0);
|
531 |
-
},1500);
|
532 |
-
}
|
533 |
-
}
|
534 |
|
|
|
|
|
|
|
|
|
535 |
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
if(parseInt(response['status']) == 10) { // only if not minimized open aswell
|
541 |
-
wplc_run = true;
|
542 |
-
open_chat(0);
|
543 |
-
|
544 |
-
}
|
545 |
-
if(response['data'] != null){ // append messages to chat area
|
546 |
-
if (typeof response['data'] === "object") {
|
547 |
|
548 |
-
|
549 |
-
|
550 |
-
|
|
|
|
|
|
|
|
|
|
|
551 |
|
552 |
-
if (typeof msg_history[index] === "undefined") {
|
553 |
-
/* we dont have this message */
|
554 |
-
msg_history[index] = true;
|
555 |
if(typeof niftyFormatParser !== "undefined"){
|
556 |
-
jQuery("#wplc_chatbox").append(niftyFormatParser(
|
557 |
} else{
|
558 |
-
jQuery("#wplc_chatbox").append(
|
559 |
}
|
560 |
-
|
561 |
-
wplc_new_message_sound = true;
|
562 |
-
} else {
|
563 |
-
/* we already have this message */
|
564 |
-
}
|
565 |
-
} else {
|
566 |
-
var the_message = response['data'][index];
|
567 |
-
the_message.mid = index;
|
568 |
-
wplc_push_message_to_chatbox(the_message,'u', function() {
|
569 |
-
wplc_scroll_to_bottom();
|
570 |
-
});
|
571 |
-
|
572 |
-
|
573 |
-
}
|
574 |
-
|
575 |
-
if(wplc_new_message_sound){
|
576 |
-
if (response['alert']) {
|
577 |
-
jQuery('#wplc-chat-alert').addClass('is-active');
|
578 |
-
}
|
579 |
-
wplc_scroll_to_bottom();
|
580 |
-
if (typeof wplc_enable_ding !== 'undefined' && wplc_enable_ding === "1") {
|
581 |
-
new Audio(wplc_plugin_url+'/wp-live-chat-support/ding.mp3').play();
|
582 |
}
|
583 |
}
|
584 |
}
|
585 |
-
}
|
586 |
-
else {
|
587 |
-
/* backwards compatibility - response['data'] is a string */
|
588 |
-
if(typeof niftyFormatParser !== "undefined"){
|
589 |
-
jQuery("#wplc_chatbox").append(niftyFormatParser(response['data'].wplcStripSlashes()));
|
590 |
-
} else{
|
591 |
-
jQuery("#wplc_chatbox").append(response['data'].wplcStripSlashes());
|
592 |
-
|
593 |
-
}
|
594 |
}
|
595 |
-
|
596 |
-
if(response['data']){
|
597 |
-
wplc_scroll_to_bottom();
|
598 |
-
|
599 |
-
}
|
600 |
}
|
601 |
-
}
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
function wplc_log_connection_error(error){
|
609 |
-
if (window.console) { console.log(error); }
|
610 |
-
|
611 |
-
jQuery("#wplc_chatbox").append("<small>" + error + "</small><br>");
|
612 |
-
wplc_scroll_to_bottom();
|
613 |
-
}
|
614 |
-
|
615 |
-
function wplc_display_error(error) {
|
616 |
-
|
617 |
-
the_message = {};
|
618 |
-
the_message.originates = 2;
|
619 |
-
the_message.msg = error;
|
620 |
-
the_message.other = {};
|
621 |
-
var wplc_d = new Date();
|
622 |
-
the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
|
623 |
-
wplc_push_message_to_chatbox(the_message,'u', function() {
|
624 |
-
wplc_scroll_to_bottom();
|
625 |
-
});
|
626 |
-
|
627 |
-
|
628 |
|
629 |
-
}
|
630 |
-
|
631 |
-
function wplc_init_chat_box(cid, status){
|
632 |
|
633 |
-
|
634 |
-
if(wplc_chat_status == 9 && wplc_check_hide_cookie == "yes"){
|
635 |
-
|
636 |
-
} else if (wplc_chat_status === 3) {
|
637 |
-
wplc_cbox_animation();
|
638 |
-
} else {
|
639 |
-
if(wplc_check_hide_cookie != "yes"){
|
640 |
-
wplc_dc = setTimeout(function (){
|
641 |
-
wplc_cbox_animation();
|
642 |
-
}, parseInt(window.wplc_delay));
|
643 |
-
}
|
644 |
-
}
|
645 |
-
wplc_init_chat_box = false;
|
646 |
-
}
|
647 |
-
|
648 |
-
function wplc_cbox_animation() {
|
649 |
-
/*
|
650 |
-
* 1- Slide Up
|
651 |
-
* 2- Slide Across (Left/Right)
|
652 |
-
* 3- Slide Down
|
653 |
-
* 4- Fade In
|
654 |
-
*/
|
655 |
-
|
656 |
-
|
657 |
-
var wplc_window_id = jQuery("#wp-live-chat");
|
658 |
-
|
659 |
-
var wplc_theme_chosen = jQuery(wplc_window_id).attr('wplc_animation');
|
660 |
-
|
661 |
-
switch(wplc_theme_chosen){
|
662 |
-
case 'none':
|
663 |
-
jQuery(wplc_window_id).css('display', 'block');
|
664 |
-
break;
|
665 |
-
case 'animation-1':
|
666 |
-
// Slide Up
|
667 |
-
jQuery(wplc_window_id).animate({'marginBottom' : '0px'}, 1000);
|
668 |
-
break;
|
669 |
-
case 'animation-2-bl':
|
670 |
-
// Slide Accross from left
|
671 |
-
jQuery(wplc_window_id).animate({'left' : '20px'}, 1000);
|
672 |
-
break;
|
673 |
-
case 'animation-2-br':
|
674 |
-
// Slide Accross from right
|
675 |
-
jQuery(wplc_window_id).animate({'right' : '20px'}, 1000);
|
676 |
-
break;
|
677 |
-
case 'animation-2-l':
|
678 |
-
// Slide Accross from left
|
679 |
-
jQuery(wplc_window_id).animate({"left" : '0px'}, 1000);
|
680 |
-
break;
|
681 |
-
case 'animation-2-r':
|
682 |
-
|
683 |
-
// Slide Accross from right
|
684 |
-
jQuery(wplc_window_id).animate({'right' : '0px'}, 1000);
|
685 |
-
break;
|
686 |
-
case 'animation-3':
|
687 |
-
// Fade In
|
688 |
-
jQuery(wplc_window_id).fadeIn('slow');
|
689 |
-
case 'animation-4':
|
690 |
-
jQuery(wplc_window_id).css('display', 'block');
|
691 |
-
break;
|
692 |
-
default:
|
693 |
-
jQuery(wplc_window_id).css('display', 'block');
|
694 |
-
break;
|
695 |
-
}
|
696 |
-
|
697 |
-
//jQuery("#wp-live-chat").css({ "display" : "block" });
|
698 |
-
if(jQuery("#wp-live-chat").attr('wplc-auto-pop-up') === "1"){
|
699 |
|
700 |
-
open_chat(0);
|
701 |
-
}
|
702 |
|
703 |
-
jQuery.event.trigger({type: "wplc_animation_done"});
|
704 |
-
}
|
705 |
|
|
|
706 |
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
var son;
|
712 |
-
this.son=son;
|
713 |
-
this.finish=false;
|
714 |
-
this.stop=function()
|
715 |
-
{
|
716 |
-
document.body.removeChild(this.son);
|
717 |
-
}
|
718 |
-
this.start=function()
|
719 |
-
{
|
720 |
-
if(this.finish)return false;
|
721 |
-
this.son=document.createElement("embed");
|
722 |
-
this.son.setAttribute("src",this.source);
|
723 |
-
this.son.setAttribute("hidden","true");
|
724 |
-
this.son.setAttribute("volume",this.volume);
|
725 |
-
this.son.setAttribute("autostart","true");
|
726 |
-
this.son.setAttribute("loop",this.loop);
|
727 |
-
document.body.appendChild(this.son);
|
728 |
-
}
|
729 |
-
this.remove=function()
|
730 |
-
{
|
731 |
-
document.body.removeChild(this.son);
|
732 |
-
this.finish=true;
|
733 |
-
}
|
734 |
-
this.init=function(volume,loop)
|
735 |
-
{
|
736 |
-
this.finish=false;
|
737 |
-
this.volume=volume;
|
738 |
-
this.loop=loop;
|
739 |
-
}
|
740 |
-
}
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
//placeholder text fix for IE
|
745 |
-
jQuery('#wp-live-chat [placeholder]').focus(function() {
|
746 |
-
var input = jQuery(this);
|
747 |
-
if (input.val() == input.attr('placeholder')) {
|
748 |
-
input.val('');
|
749 |
-
input.removeClass('placeholder');
|
750 |
-
}
|
751 |
-
}).blur(function() {
|
752 |
-
var input = jQuery(this);
|
753 |
-
if (input.val() == '' || input.val() == input.attr('placeholder')) {
|
754 |
-
input.addClass('placeholder');
|
755 |
-
input.val(input.attr('placeholder'));
|
756 |
-
}
|
757 |
-
}).blur();
|
758 |
-
|
759 |
-
|
760 |
-
/* minimize chat window */
|
761 |
-
jQuery("body").on("click", "#wp-live-chat-minimize", function() {
|
762 |
-
|
763 |
-
jQuery.event.trigger({type: "wplc_minimize_chat"});
|
764 |
-
|
765 |
-
|
766 |
-
});
|
767 |
-
|
768 |
-
|
769 |
-
/* close chat window */
|
770 |
-
jQuery("body").on("click", "#wp-live-chat-close", function() {
|
771 |
-
|
772 |
-
jQuery("#wp-live-chat").hide();
|
773 |
-
jQuery("#wp-live-chat-1").hide();
|
774 |
-
jQuery("#wp-live-chat-2").hide();
|
775 |
-
jQuery("#wp-live-chat-3").hide();
|
776 |
-
jQuery("#wp-live-chat-4").hide();
|
777 |
-
jQuery("#wplc_social_holder").hide();
|
778 |
-
jQuery("#nifty_ratings_holder").hide();
|
779 |
-
jQuery("#wp-live-chat-react").hide();
|
780 |
-
jQuery("#wp-live-chat-minimize").hide();
|
781 |
-
if (typeof wplc_hide_chat !== "undefined" && wplc_hide_chat !== "" && wplc_hide_chat !== null) { Cookies.set('wplc_hide', wplc_hide_chat , { expires: 1, path: '/' }); } else {
|
782 |
-
var wplc_expire_date = new Date();
|
783 |
-
var minutes = 2;
|
784 |
-
wplc_expire_date.setTime(wplc_expire_date.getTime() + (minutes * 60 * 1000));
|
785 |
-
Cookies.set('wplc_hide', "yes" , { expires: wplc_expire_date , path: '/' });
|
786 |
}
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
* https://github.com/CodeCabin/wp-live-chat-support/issues/313
|
810 |
-
*/
|
811 |
-
if( wplc_chat_status == null || wplc_chat_status == 'null' ){
|
812 |
-
Cookies.set('wplc_chat_status', 5, { expires: 1, path: '/' });
|
813 |
-
wplc_chat_status = 5;
|
814 |
-
}
|
815 |
-
|
816 |
-
|
817 |
-
if (parseInt(wplc_chat_status) == 3 || parseInt(wplc_chat_status) == 2 || parseInt(wplc_chat_status) == 0 || parseInt(wplc_chat_status) == 12) {
|
818 |
-
|
819 |
-
jQuery.event.trigger({type: "wplc_open_chat_2", wplc_online: wplc_online});
|
820 |
-
|
821 |
-
Cookies.set('wplc_had_chat', true, { path: '/' });
|
822 |
-
|
823 |
|
824 |
-
wplc_send_welcome_message();
|
825 |
|
826 |
-
|
827 |
-
|
828 |
-
wplc_chat_status = 2;
|
829 |
-
}
|
830 |
-
if(typeof wplc_start_chat_pro_custom_fields_filter !== "undefined" && typeof wplc_start_chat_pro_custom_fields_filter === "function"){
|
831 |
-
wplc_extra_data = wplc_start_chat_pro_custom_fields_filter(wplc_extra_data);
|
832 |
-
}
|
833 |
-
|
834 |
-
if (wplc_online) {
|
835 |
-
var data = {
|
836 |
-
action: 'wplc_user_maximize_chat',
|
837 |
-
security: wplc_nonce,
|
838 |
-
cid: wplc_cid,
|
839 |
-
chat_status : parseInt(wplc_chat_status),
|
840 |
-
wplc_extra_data:wplc_extra_data
|
841 |
-
};
|
842 |
-
jQuery.post(wplc_ajaxurl, data, function(response) {
|
843 |
-
|
844 |
-
//log("user maximized chat success");
|
845 |
-
});
|
846 |
-
}
|
847 |
-
|
848 |
-
}
|
849 |
-
else if (parseInt(wplc_chat_status) == 10) {
|
850 |
-
jQuery("#wp-live-chat-minimize").trigger("click");
|
851 |
-
|
852 |
-
}
|
853 |
-
|
854 |
-
else if (wplc_chat_status == 5 || wplc_chat_status == 9 || wplc_chat_status == 8){
|
855 |
-
if(jQuery("#wp-live-chat-2").is(":visible") === false && jQuery("#wp-live-chat-4").is(":visible") === false){
|
856 |
-
jQuery("#wp-live-chat-2").show();
|
857 |
-
jQuery("#wp-live-chat-2-inner").show();
|
858 |
-
var wplc_visitor_name = Cookies.get('wplc_name');
|
859 |
-
if(Cookies.get('wplc_email') !== "no email set" && typeof wplc_visitor_name !== "undefined"){
|
860 |
-
jQuery("#wplc_name").val(Cookies.get('wplc_name'));
|
861 |
-
jQuery("#wplc_email").val(Cookies.get('wplc_email'));
|
862 |
}
|
863 |
-
jQuery("#wp-live-chat-header").addClass("active");
|
864 |
}
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
} */
|
869 |
-
else if(wplc_chat_status == 1){
|
870 |
-
jQuery("#wp-live-chat-4").show();
|
871 |
-
jQuery("#wplc_social_holder").show();
|
872 |
-
jQuery("#nifty_ratings_holder").show();
|
873 |
-
jQuery.event.trigger({type: "wplc_animation_done"});
|
874 |
-
jQuery("#wplc_chatbox").append(wplc_error_messages.chat_ended_by_operator+"<br />");
|
875 |
-
wplc_scroll_to_bottom();
|
876 |
-
jQuery("#wp-live-chat-minimize").hide();
|
877 |
-
document.getElementById('wplc_chatmsg').disabled = true;
|
878 |
-
}
|
879 |
|
880 |
-
|
|
|
|
|
881 |
|
882 |
-
|
|
|
|
|
883 |
|
884 |
-
|
885 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
886 |
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
if(typeof wplc_start_chat_pro_custom_fields_filter !== "undefined" && typeof wplc_start_chat_pro_custom_fields_filter === "function"){
|
899 |
-
wplc_extra_data = wplc_start_chat_pro_custom_fields_filter(wplc_extra_data);
|
900 |
-
}
|
901 |
|
902 |
-
if(wplc_chat_status != 5 && wplc_chat_status != 10 && wplc_chat_status != 9 && wplc_chat_status != 8){
|
903 |
-
if (wplc_online) {
|
904 |
-
var data = {
|
905 |
-
action: 'wplc_user_minimize_chat',
|
906 |
-
security: wplc_nonce,
|
907 |
-
cid: wplc_cid,
|
908 |
-
wplc_extra_data:wplc_extra_data
|
909 |
-
};
|
910 |
-
|
911 |
-
jQuery.post(wplc_ajaxurl, data, function(response) {
|
912 |
-
|
913 |
-
});
|
914 |
-
}
|
915 |
-
}
|
916 |
|
917 |
-
|
918 |
-
if (typeof ga !== "undefined") {
|
919 |
-
ga('send', {
|
920 |
-
hitType: 'event',
|
921 |
-
eventCategory: 'WP_Live_Chat_Support',
|
922 |
-
eventAction: 'Event',
|
923 |
-
eventLabel: 'Minimize Chat'
|
924 |
-
});
|
925 |
-
}
|
926 |
-
}
|
927 |
-
});
|
928 |
-
jQuery(document).on("wplc_start_chat", function() {
|
929 |
-
if (typeof wplc_enable_ga !== "undefined" && wplc_enable_ga === '1') {
|
930 |
-
if (typeof ga !== "undefined") {
|
931 |
-
ga('send', {
|
932 |
-
hitType: 'event',
|
933 |
-
eventCategory: 'WP_Live_Chat_Support',
|
934 |
-
eventAction: 'Event',
|
935 |
-
eventLabel: 'Start Chat'
|
936 |
-
});
|
937 |
-
}
|
938 |
-
}
|
939 |
-
});
|
940 |
-
jQuery(document).on("wplc_open_chat_1", function() {
|
941 |
-
if (typeof wplc_enable_ga !== "undefined" && wplc_enable_ga === '1') {
|
942 |
-
if (typeof ga !== "undefined") {
|
943 |
-
ga('send', {
|
944 |
-
hitType: 'event',
|
945 |
-
eventCategory: 'WP_Live_Chat_Support',
|
946 |
-
eventAction: 'Event',
|
947 |
-
eventLabel: 'Start Chat - Step 1'
|
948 |
-
});
|
949 |
-
}
|
950 |
-
}
|
951 |
-
});
|
952 |
-
jQuery(document).on("wplc_open_chat_2", function() {
|
953 |
-
if (typeof wplc_enable_ga !== "undefined" && wplc_enable_ga === '1') {
|
954 |
-
if (typeof ga !== "undefined") {
|
955 |
-
ga('send', {
|
956 |
-
hitType: 'event',
|
957 |
-
eventCategory: 'WP_Live_Chat_Support',
|
958 |
-
eventAction: 'Event',
|
959 |
-
eventLabel: 'Start Chat - Step 2'
|
960 |
-
});
|
961 |
-
}
|
962 |
-
}
|
963 |
-
});
|
964 |
-
|
965 |
-
jQuery(document).on("wplc_agent_joined", function(e) {
|
966 |
-
var temail = '';
|
967 |
-
var tname = '';
|
968 |
-
var taid = '';
|
969 |
-
var ta_tagline = '';
|
970 |
-
var ta_bio = '';
|
971 |
-
|
972 |
-
if (typeof e.ndata.other.email !== "undefined") { temail = e.ndata.other.email; }
|
973 |
-
if (typeof e.ndata.other.name !== "undefined") { tname = e.ndata.other.name; }
|
974 |
-
if (typeof e.ndata.other.aid !== "undefined") { taid = e.ndata.other.aid; }
|
975 |
-
if (typeof e.ndata.other.agent_tagline !== "undefined") { ta_tagline = e.ndata.other.agent_tagline; }
|
976 |
-
if (typeof e.ndata.other.agent_bio !== "undefined") { ta_bio = e.ndata.other.agent_bio; }
|
977 |
-
wplc_current_agent = e.ndata.other;
|
978 |
-
|
979 |
-
jQuery(".wplc_no_answer").remove();
|
980 |
-
|
981 |
-
jQuery(".admin_chat_name").html(tname);
|
982 |
-
wplc_node_pair_name = tname;
|
983 |
-
wplc_agent_name = tname;
|
984 |
-
});
|
985 |
-
|
986 |
-
|
987 |
-
jQuery("body").on("click", "#wplc_start_chat_btn", function() {
|
988 |
-
var wplc_name = jQuery("#wplc_name").val();
|
989 |
-
var wplc_email = jQuery("#wplc_email").val();
|
990 |
-
|
991 |
-
if (wplc_name.length <= 0) { alert(wplc_error_messages.valid_name); return false; }
|
992 |
-
if (wplc_email.length <= 0) { alert(wplc_error_messages.valid_email); return false; }
|
993 |
-
|
994 |
-
if(jQuery("#wplc_email").attr('wplc_hide') !== "1"){
|
995 |
-
var testEmail = /^[A-Z0-9._%+-]+@([A-Z0-9-]+\.)+[A-Z]{2,12}$/i;
|
996 |
-
|
997 |
-
//var testEmail = /^[A-Z0-9._%+-]+@([A-Z0-9-]+\.)+[A-Z]{2,4}$/i;
|
998 |
-
if (!testEmail.test(wplc_email)){
|
999 |
-
alert(wplc_error_messages.valid_email); return false;
|
1000 |
-
}
|
1001 |
-
}
|
1002 |
-
document.getElementById('wplc_chatmsg').disabled = false;
|
1003 |
-
|
1004 |
-
/* start the long polling */
|
1005 |
-
wplc_run = true;
|
1006 |
-
|
1007 |
-
wplc_send_welcome_message();
|
1008 |
-
wplc_scroll_to_bottom();
|
1009 |
-
|
1010 |
-
/*
|
1011 |
-
if (wplc_filter_run_override === "1" || wplc_online === false) { } else {
|
1012 |
-
initial_data.status = 2;
|
1013 |
-
// force the loop to start only now, as we are not using the initiate extension
|
1014 |
-
wplc_call_to_server_chat(initial_data,false,false);
|
1015 |
-
}*/
|
1016 |
-
|
1017 |
-
jQuery.event.trigger({type: "wplc_start_chat"});
|
1018 |
-
|
1019 |
-
|
1020 |
-
var date = new Date();
|
1021 |
-
date.setTime(date.getTime() + (2 * 60 * 1000));
|
1022 |
-
|
1023 |
-
wplc_cid = Cookies.get('wplc_cid');
|
1024 |
-
|
1025 |
-
if(typeof wplc_start_chat_pro_custom_fields_filter !== "undefined" && typeof wplc_start_chat_pro_custom_fields_filter === "function"){
|
1026 |
-
wplc_extra_data = wplc_start_chat_pro_custom_fields_filter(wplc_extra_data);
|
1027 |
-
}
|
1028 |
-
|
1029 |
-
if (typeof wplc_cid !== "undefined" && wplc_cid !== null) {
|
1030 |
-
/* we've already recorded a cookie for this person */
|
1031 |
-
var data = {
|
1032 |
-
action: 'wplc_start_chat',
|
1033 |
-
security: wplc_nonce,
|
1034 |
-
name: wplc_name,
|
1035 |
-
email: wplc_email,
|
1036 |
-
cid: wplc_cid,
|
1037 |
-
wplcsession: wplc_session_variable,
|
1038 |
-
wplc_extra_data:wplc_extra_data
|
1039 |
-
};
|
1040 |
-
|
1041 |
-
if(typeof wplc_start_chat_pro_data !== "undefined" && typeof wplc_start_chat_pro_data === "function"){
|
1042 |
-
data = wplc_start_chat_pro_data(data);
|
1043 |
-
}
|
1044 |
-
} else { // no cookie recorded yet for this visitor
|
1045 |
-
var data = {
|
1046 |
-
action: 'wplc_start_chat',
|
1047 |
-
security: wplc_nonce,
|
1048 |
-
name: wplc_name,
|
1049 |
-
email: wplc_email,
|
1050 |
-
wplcsession: wplc_session_variable,
|
1051 |
-
wplc_extra_data:wplc_extra_data
|
1052 |
-
};
|
1053 |
-
|
1054 |
-
if(typeof wplc_start_chat_pro_data !== "undefined" && typeof wplc_start_chat_pro_data === "function"){
|
1055 |
-
data = wplc_start_chat_pro_data(data);
|
1056 |
-
}
|
1057 |
-
}
|
1058 |
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
//All sorted, let's check for message transport mode
|
1069 |
-
wplc_server.prepareTransport(function(){
|
1070 |
-
//Transport ready...
|
1071 |
-
wplc_server_last_loop_data.status = 2; //Set to waiting
|
1072 |
-
if (wplc_filter_run_override === "1" || wplc_online === false) { } else {
|
1073 |
-
wplc_call_to_server_chat(wplc_server_last_loop_data);
|
1074 |
-
}
|
1075 |
-
}, wplc_user_message_receiver, wplc_user_retry_handler, wplc_log_connection_error);
|
1076 |
-
},
|
1077 |
-
function(){
|
1078 |
-
//Fails
|
1079 |
-
},
|
1080 |
-
function(response, wplc_send_data){
|
1081 |
-
//Complete
|
1082 |
-
if (typeof wplc_send_data !== "undefined" && typeof wplc_send_data['action'] !== "undefined" && wplc_send_data['action'] == 'wplc_start_chat') {
|
1083 |
-
/* we got here because the short poll (when disabling the initiate chat feature) comes back on the "complete" callback. This check makes sure we restart the longpoll */
|
1084 |
-
wplc_chat_status = 2;
|
1085 |
-
Cookies.set('wplc_chat_status', 2, { expires: date, path: '/' });
|
1086 |
-
wplc_cid = jQuery.trim(response);
|
1087 |
-
|
1088 |
-
//All sorted, let's check for message transport mode
|
1089 |
-
wplc_server.prepareTransport(function(){
|
1090 |
-
//Transport ready...
|
1091 |
-
wplc_server_last_loop_data.status = 2; //Set to waiting
|
1092 |
-
if (wplc_filter_run_override === "1" || wplc_online === false) { } else {
|
1093 |
-
wplc_call_to_server_chat(wplc_server_last_loop_data);
|
1094 |
}
|
1095 |
-
}
|
1096 |
}
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
jQuery("body").on("click", "#wplc_na_msg_btn", function() {
|
1104 |
-
var wplc_name = jQuery("#wplc_name").val();
|
1105 |
-
var wplc_email = jQuery("#wplc_email").val();
|
1106 |
-
var wplc_msg = jQuery("#wplc_message").val();
|
1107 |
-
var wplc_domain = jQuery("#wplc_domain_offline").val();
|
1108 |
-
var ip_address = jQuery("#wplc_ip_address").val();
|
1109 |
-
|
1110 |
-
if (wplc_name.length <= 0) { alert(wplc_error_messages.valid_name); return false; }
|
1111 |
-
if (wplc_email.length <= 0) { alert(wplc_error_messages.valid_email); return false; }
|
1112 |
-
var testEmail = /^[A-Z0-9._%+-]+@([A-Z0-9-]+\.)+[A-Z]{2,12}$/i;
|
1113 |
-
if (!testEmail.test(wplc_email)){
|
1114 |
-
alert(wplc_error_messages.valid_email); return false;
|
1115 |
-
}
|
1116 |
-
if (wplc_msg.length <= 0) { alert(wplc_error_messages.empty_message); return false; }
|
1117 |
-
jQuery("#wp-live-chat-2-info").hide();
|
1118 |
-
jQuery("#wplc_message_div").html(wplc_offline_msg);
|
1119 |
-
|
1120 |
-
wplc_cid = Cookies.get('wplc_cid');
|
1121 |
-
|
1122 |
-
var data = {
|
1123 |
-
action: 'wplc_user_send_offline_message',
|
1124 |
-
security: wplc_nonce,
|
1125 |
-
cid: wplc_cid,
|
1126 |
-
name: wplc_name,
|
1127 |
-
email: wplc_email,
|
1128 |
-
msg: wplc_msg,
|
1129 |
-
ip: ip_address,
|
1130 |
-
domain: wplc_domain,
|
1131 |
-
wplc_extra_data:wplc_extra_data
|
1132 |
-
};
|
1133 |
-
|
1134 |
-
jQuery.post(wplc_ajaxurl_site, data, function(response) {
|
1135 |
-
jQuery("#wplc_message_div").html(wplc_offline_msg3);
|
1136 |
-
});
|
1137 |
-
if (typeof wplc_enable_ga !== "undefined" && wplc_enable_ga === '1') {
|
1138 |
-
if (typeof ga !== "undefined") {
|
1139 |
-
ga('send', {
|
1140 |
-
hitType: 'event',
|
1141 |
-
eventCategory: 'WP_Live_Chat_Support',
|
1142 |
-
eventAction: 'Event',
|
1143 |
-
eventLabel: 'User Send Offline Message'
|
1144 |
-
});
|
1145 |
-
}
|
1146 |
-
}
|
1147 |
-
});
|
1148 |
-
|
1149 |
-
|
1150 |
-
function wplc_strip(str) {
|
1151 |
-
str=str.replace(/<br>/gi, "\n");
|
1152 |
-
str=str.replace(/<p.*>/gi, "\n");
|
1153 |
-
str=str.replace(/<a.*href="(.*?)".*>(.*?)<\/a>/gi, " $2 ($1) ");
|
1154 |
-
str=str.replace(/<(?:.|\s)*?>/g, "");
|
1155 |
-
|
1156 |
-
str=str.replace('iframe', "");
|
1157 |
-
str=str.replace('src', "");
|
1158 |
-
str=str.replace('href', "");
|
1159 |
-
str=str.replace('<', "");
|
1160 |
-
str=str.replace('>', "");
|
1161 |
-
|
1162 |
-
/* remove the last carriage return from the text area output */
|
1163 |
-
str=str.replace(/\n$/, "")
|
1164 |
-
|
1165 |
-
return str;
|
1166 |
-
}
|
1167 |
-
|
1168 |
-
|
1169 |
-
jQuery("body").on("keyup","#wplc_chatmsg", function(event){
|
1170 |
-
if(event.keyCode === 13){
|
1171 |
-
jQuery("#wplc_send_msg").trigger("click");
|
1172 |
-
}
|
1173 |
-
});
|
1174 |
-
jQuery("body").on("click", "#wplc_send_msg", function() {
|
1175 |
-
var wplc_cid = jQuery("#wplc_cid").val();
|
1176 |
-
if (wplc_cid.length < 1) {
|
1177 |
-
/* failover for wplc_cid */
|
1178 |
-
var wplc_cid = Cookies.get('wplc_cid');
|
1179 |
-
}
|
1180 |
-
var wplc_chat = wplc_strip(document.getElementById('wplc_chatmsg').value);
|
1181 |
-
|
1182 |
-
if(wplc_chat !== ""){
|
1183 |
-
var wplc_name = jQuery("#wplc_name").val();
|
1184 |
-
if (typeof wplc_name == "undefined" || wplc_name == null || wplc_name == "") {
|
1185 |
-
wplc_name = Cookies.get('wplc_name');
|
1186 |
-
}
|
1187 |
-
if (typeof wplc_name == "undefined") {
|
1188 |
-
wplc_name = 'Guest';
|
1189 |
-
}
|
1190 |
-
|
1191 |
-
var wplc_email = jQuery("#wplc_email").val();
|
1192 |
-
if (typeof wplc_email == "undefined" || wplc_email == null || wplc_email == "") {
|
1193 |
-
wplc_email = Cookies.get('wplc_email');
|
1194 |
-
}
|
1195 |
-
if (typeof wplc_email == "undefined") {
|
1196 |
-
wplc_email = '';
|
1197 |
-
}
|
1198 |
-
|
1199 |
|
1200 |
-
|
1201 |
-
|
1202 |
-
/*Nifty format Parse*/
|
1203 |
-
var wplc_chat_parsed = wplc_chat;
|
1204 |
-
|
1205 |
-
//if(typeof niftyFormatParser !== "undefined"){
|
1206 |
-
// wplc_chat_parsed = niftyFormatParser(wplc_chat_parsed);
|
1207 |
-
//}
|
1208 |
-
|
1209 |
-
if( typeof wplc_display_name !== 'undefined' ){
|
1210 |
-
/**
|
1211 |
-
* We're still using the old options
|
1212 |
-
*/
|
1213 |
-
if(wplc_display_name == 'display'){
|
1214 |
-
if (wplc_gravatar_image.length > 1) {
|
1215 |
-
jQuery("#wplc_chatbox").append("<span class='wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1'>"+wplc_gravatar_image+" <strong>"+wplc_name+"</strong>: "+wplc_chat_parsed+"</span><br /><div class='wplc-clear-float-message'></div>");
|
1216 |
-
} else {
|
1217 |
-
jQuery("#wplc_chatbox").append("<span class='wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1'><img src='//www.gravatar.com/avatar/"+md5(wplc_email)+"?s=30' class='wplc-user-message-avatar' \/> <strong>"+wplc_name+"</strong>: "+wplc_chat_parsed+"</span><br /><div class='wplc-clear-float-message'></div>");
|
1218 |
}
|
1219 |
-
} else {
|
1220 |
-
jQuery("#wplc_chatbox").append("<span class='wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1'>"+wplc_chat_parsed+"</span><div class='wplc-clear-float-message'></div>");
|
1221 |
}
|
1222 |
-
} else {
|
1223 |
-
the_message = {};
|
1224 |
-
the_message.originates = 2;
|
1225 |
-
the_message.msg = wplc_chat_parsed;
|
1226 |
-
the_message.other = {};
|
1227 |
-
var wplc_d = new Date();
|
1228 |
-
the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
|
1229 |
-
wplc_push_message_to_chatbox(the_message,'u', function() {
|
1230 |
-
wplc_scroll_to_bottom();
|
1231 |
-
});
|
1232 |
-
|
1233 |
-
|
1234 |
-
}
|
1235 |
-
|
1236 |
-
wplc_scroll_to_bottom();
|
1237 |
-
|
1238 |
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
-
cid: wplc_cid,
|
1243 |
-
msg: wplc_chat_parsed,
|
1244 |
-
wplc_extra_data:wplc_extra_data
|
1245 |
-
};
|
1246 |
-
|
1247 |
-
wplc_server.sendMessage(wplc_ajaxurl, data, "POST", 120000,
|
1248 |
-
function(){
|
1249 |
-
//Success
|
1250 |
-
wplc_server.asyncStorage(wplc_ajaxurl, data, 120000);
|
1251 |
-
}, function(){
|
1252 |
-
//Fail
|
1253 |
-
}, function(){
|
1254 |
-
//Complete
|
1255 |
-
}
|
1256 |
-
);
|
1257 |
-
|
1258 |
-
if (typeof wplc_enable_ga !== "undefined" && wplc_enable_ga === '1') {
|
1259 |
-
if (typeof ga !== "undefined") {
|
1260 |
-
ga('send', {
|
1261 |
-
hitType: 'event',
|
1262 |
-
eventCategory: 'WP_Live_Chat_Support',
|
1263 |
-
eventAction: 'Event',
|
1264 |
-
eventLabel: 'User Send Message'
|
1265 |
-
});
|
1266 |
}
|
1267 |
}
|
1268 |
}
|
|
|
|
|
|
|
1269 |
|
1270 |
-
jQuery("#wplc_chatmsg").val('');
|
1271 |
|
1272 |
|
1273 |
-
|
|
|
1274 |
|
1275 |
-
|
1276 |
-
|
1277 |
-
|
1278 |
-
if( typeof wplc_chat_status === 'undefined' ){
|
1279 |
-
Cookies.set('wplc_chat_status', 5, { expires: 1, path: '/' });
|
1280 |
-
}
|
1281 |
-
var wplc_tmp_checker = wplc_pre_open_check_status(status, function() {
|
1282 |
-
open_chat();
|
1283 |
-
});
|
1284 |
-
});
|
1285 |
|
1286 |
-
|
1287 |
-
/* Clear Cookies */
|
1288 |
-
Cookies.remove('wplc_chat_status');
|
1289 |
-
Cookies.remove('wplc_cid');
|
1290 |
-
//Cookies.remove('wplc_name');
|
1291 |
-
//Cookies.remove('wplc_email');
|
1292 |
|
1293 |
-
|
1294 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1295 |
|
1296 |
-
/* Check if we should redirect */
|
1297 |
-
if(typeof wplc_redirect_thank_you !== "undefined" && wplc_redirect_thank_you !== null && wplc_redirect_thank_you !== ""){
|
1298 |
-
window.location = wplc_redirect_thank_you;
|
1299 |
-
}
|
1300 |
-
});
|
1301 |
|
1302 |
-
function wplc_pre_open_check_status(status, callback) {
|
1303 |
-
if (typeof wplc_chat_status !== 'undefined' && ( typeof wplc_chat_status.length !== 'undefined' && wplc_chat_status.length > 0 ) ) {
|
1304 |
-
if (parseInt(wplc_chat_status) === 10 || parseInt(wplc_chat_status) === 7) {
|
1305 |
-
/* it was minimized or timedout, now we need to open it - set status to 3 (back to open chat) */
|
1306 |
-
Cookies.set('wplc_chat_status', 3, { expires: 1, path: '/' });
|
1307 |
|
1308 |
-
|
1309 |
-
if (parseInt(wplc_chat_status) === 0 || parseInt(wplc_chat_status) === 12) {
|
1310 |
-
/* no answer from agent previously */
|
1311 |
-
// Cookies.set('wplc_chat_status', 5, { expires: 1, path: '/' });
|
1312 |
-
}
|
1313 |
-
if (parseInt(wplc_chat_status) === 8) {
|
1314 |
-
/* no answer from agent previously */
|
1315 |
-
cnonsole.log("now setting it to 5");
|
1316 |
-
Cookies.set('wplc_chat_status', 5, { expires: 1, path: '/' });
|
1317 |
-
}
|
1318 |
-
|
1319 |
-
}
|
1320 |
-
callback();
|
1321 |
-
}
|
1322 |
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
|
|
|
|
1326 |
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
open_chat(0);
|
1332 |
-
});
|
1333 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1334 |
|
1335 |
-
// Fix conflict with Responsive Lighbox plugin
|
1336 |
-
setTimeout(function () {
|
1337 |
-
if (jQuery('html').hasClass('nivo-lightbox-notouch') || jQuery('a[rel*="lightbox"]').length) {
|
1338 |
-
jQuery("body").on("keyup", function (event) {
|
1339 |
-
if (event.keyCode === 13) {
|
1340 |
-
jQuery("#wplc_send_msg").trigger("click");
|
1341 |
-
}
|
1342 |
-
});
|
1343 |
-
}
|
1344 |
-
}, 5000);
|
1345 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1346 |
|
1347 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
/*
|
2 |
* Cookie Status
|
3 |
+
*
|
4 |
* 1 - complete - user has left site
|
5 |
* 2 - pending - user waiting for chat to be answered by admin
|
6 |
* 3 - active chat - user and admin are chatting
|
7 |
* 4 - deleted
|
8 |
* 5 - browsing - no data has been inputted
|
9 |
* 6 - requesting chat - admin has requested a chat with user
|
10 |
+
* 7 - timed out - visitor has timed out
|
11 |
* 8 - complete but now browsing again
|
12 |
* 9 - user closed chat before starting chat
|
13 |
* 10 - user minimized active chat
|
14 |
* 11 - user moved on to another page (session variable is different)
|
15 |
* 12 - user has not been answered after sending chat request and is still active
|
16 |
+
*
|
17 |
*/
|
18 |
var wplc_is_chat_open = false;
|
19 |
var wplc_online = false;
|
34 |
|
35 |
var wplc_current_agent = false;
|
36 |
|
37 |
+
/* node support */
|
38 |
+
var ns_obj = {};
|
39 |
|
40 |
|
41 |
+
/* node variable mapping */
|
42 |
+
var welcome_message = '';
|
43 |
+
|
44 |
+
var wplc_session_variable = new Date().getTime();
|
45 |
+
var wplc_cid;
|
46 |
+
var wplc_check_hide_cookie;
|
47 |
+
var wplc_chat_status = "";
|
48 |
+
var wplc_cookie_name = "";
|
49 |
+
var wplc_cookie_email = "";
|
50 |
+
var wplc_init_chat_box_check = true;
|
51 |
+
var wplc_cid = null;
|
52 |
+
|
53 |
+
var initial_data = {};
|
54 |
+
var wplc_fist_run = true;
|
55 |
+
var wplc_long_poll_delay = 1500;
|
56 |
+
|
57 |
+
|
58 |
+
jQuery(document).ready(function() {
|
59 |
+
|
60 |
+
/* Gutenberg functions */
|
61 |
+
jQuery('.wp-block-wp-live-chat-support-wplc-chat-box').on('click',function(){
|
62 |
+
jQuery("#wplc_hovercard").fadeOut("fast");
|
63 |
+
jQuery("#wplc-chat-alert").removeClass('is-active');
|
64 |
+
wplc_is_chat_open = true;
|
65 |
+
jQuery.event.trigger({type: "wplc_open_chat"});
|
66 |
+
});
|
67 |
|
68 |
+
wplc_map_node_variables();
|
|
|
|
|
69 |
|
70 |
/* preload the images */
|
71 |
wplc_preload();
|
72 |
|
73 |
wplc_cid = Cookies.get('wplc_cid');
|
74 |
+
|
75 |
if(typeof wplc_cid === 'undefined'){
|
76 |
wplc_cid = null;
|
77 |
} else {
|
78 |
wplc_cid = Cookies.get('wplc_cid');
|
79 |
}
|
80 |
+
|
81 |
wplc_check_hide_cookie = Cookies.get('wplc_hide');
|
82 |
wplc_check_minimize_cookie = Cookies.get('wplc_minimize');
|
83 |
wplc_chat_status = Cookies.get('wplc_chat_status');
|
84 |
wplc_cookie_name = Cookies.get('wplc_name');
|
85 |
wplc_cookie_email = Cookies.get('wplc_email');
|
86 |
// Always start on 5 - ajax will then return chat status if active
|
87 |
+
|
88 |
Cookies.set('wplc_chat_status', 5, { expires: 1, path: '/' });
|
89 |
wplc_chat_status = 5;
|
90 |
//if (typeof wplc_chat_status !== "undefined" && parseInt(wplc_chat_status) === 3) { } else {
|
91 |
+
|
92 |
//}
|
93 |
|
94 |
+
//Preflight check for WPML integration
|
95 |
+
var wplc_wpml_body_language = jQuery("html").attr("lang");
|
96 |
+
if(typeof wplc_wpml_body_language !== "undefined"){
|
97 |
+
if(wplc_wpml_body_language.indexOf("-") !== -1){
|
98 |
+
wplc_wpml_body_language = wplc_wpml_body_language.substr(0, wplc_wpml_body_language.indexOf("-"));
|
99 |
+
}
|
100 |
+
Cookies.set('_icl_current_language', wplc_wpml_body_language, { expires: 1, path: '/' });
|
101 |
+
}
|
102 |
+
|
103 |
var data = {
|
104 |
action: 'wplc_get_chat_box',
|
105 |
security: wplc_nonce,
|
115 |
if(response){
|
116 |
if (response === "0") { if (window.console) { console.log('WP Live Chat Support Return Error'); } wplc_run = false; return; }
|
117 |
response = JSON.parse(response);
|
118 |
+
|
119 |
+
|
120 |
jQuery( "body" ).append( response['cbox']);
|
121 |
|
122 |
wplc_listenForScrollEvent(jQuery("#wplc_chatbox"));
|
123 |
|
124 |
if( typeof wplc_cookie_name == 'undefined' || typeof wplc_cookie_email == 'undefined' ){
|
125 |
|
126 |
+
var wplc_cookie_name = jQuery( jQuery.parseHTML( response['cbox'] ) ).find( "#wplc_name" ).val();
|
127 |
+
var wplc_cookie_email = jQuery( jQuery.parseHTML( response['cbox'] ) ).find( "#wplc_email" ).val();
|
128 |
|
129 |
}
|
130 |
+
|
131 |
|
132 |
|
133 |
/* is an agent online? */
|
134 |
if (response['online'] === false) {
|
135 |
wplc_run = false;
|
136 |
wplc_online = false;
|
137 |
+
ns_obj.o = '0';
|
138 |
+
|
139 |
} else {
|
140 |
wplc_online = true;
|
141 |
+
ns_obj.o = '1';
|
142 |
}
|
143 |
|
144 |
+
|
145 |
|
146 |
if (wplc_filter_run_override !== "1" || wplc_online === false) { wplc_run = false; } else { /* we can run */ }
|
147 |
|
148 |
+
|
149 |
/* has this user been assigned an agent? */
|
150 |
if (typeof response['type'] === "undefined") {
|
151 |
wplc_shown_welcome = false;
|
153 |
if (response['type'] === "returning") {
|
154 |
wplc_shown_welcome = true;
|
155 |
/* set the agent vars so we can access them on the fly */
|
156 |
+
if (typeof response['agent_data'] !== "undefined") {
|
157 |
wplc_current_agent = response['agent_data'];
|
158 |
}
|
159 |
} else {
|
160 |
wplc_shown_welcome = false;
|
161 |
}
|
162 |
+
|
163 |
}
|
164 |
|
165 |
|
184 |
|
185 |
if(wplc_server.browserIsSocketReady()){
|
186 |
data.socket = true;
|
187 |
+
|
188 |
+
/* load node relay code */
|
189 |
+
var nc = document.createElement("script");
|
190 |
+
nc.type = "text/javascript";
|
191 |
+
nc.async = true;
|
192 |
+
nc.src = "https://bleeper.io/app/assets/js/bleeper-dev.js";
|
193 |
+
document.getElementsByTagName("head")[0].appendChild(nc);
|
194 |
+
|
195 |
}
|
196 |
|
197 |
initial_data = data;
|
198 |
// ajax long polling function
|
199 |
+
if (wplc_filter_run_override !== "1" || wplc_online === false) {
|
200 |
+
|
201 |
wplc_call_to_server_chat(data,true,true);
|
202 |
+
} else {
|
203 |
+
|
204 |
wplc_call_to_server_chat(data,true,false);
|
205 |
}
|
206 |
+
|
207 |
if(wplc_cid !== null && wplc_init_chat_box_check == true && wplc_init_chat_box !== false){
|
208 |
wplc_init_chat_box(wplc_cid,wplc_chat_status);
|
209 |
+
} else {
|
210 |
+
//Node and offline
|
211 |
+
if(typeof wplc_use_node_server !== "undefined" && (wplc_use_node_server === "true" || wplc_use_node_server === true)){
|
212 |
+
wplc_cbox_animation();
|
213 |
+
}
|
214 |
}
|
215 |
+
|
216 |
+
|
217 |
}
|
218 |
|
219 |
}
|
241 |
* Detect if the chatbox is being scrolled.
|
242 |
*
|
243 |
* This had to be created as jQuery does not allow the scroll event to bubble up the DOM tree.
|
244 |
+
*
|
245 |
* Thank you Bikal Basnet (https://stackoverflow.com/questions/16505182/bind-scroll-event-to-dynamic-div)
|
246 |
+
*
|
247 |
* @param object el The element in question
|
248 |
*/
|
249 |
function wplc_listenForScrollEvent(el) {
|
253 |
|
254 |
}
|
255 |
|
256 |
+
|
257 |
+
|
258 |
+
jQuery("body").on('keyup', '#wplc_email, #wplc_name', function (e) {
|
259 |
+
if (e.keyCode == 13) {
|
260 |
+
jQuery("#wplc_start_chat_btn").trigger("click")
|
261 |
+
}
|
262 |
+
});
|
263 |
+
|
264 |
+
// Fix conflict with Responsive Lighbox plugin
|
265 |
+
setTimeout(function () {
|
266 |
+
if (jQuery('html').hasClass('nivo-lightbox-notouch') || jQuery('a[rel*="lightbox"]').length) {
|
267 |
+
jQuery("body").on("keyup", function (event) {
|
268 |
+
if (event.keyCode === 13) {
|
269 |
+
jQuery("#wplc_send_msg").trigger("click");
|
270 |
+
}
|
271 |
+
});
|
272 |
+
}
|
273 |
+
}, 5000);
|
274 |
+
|
275 |
+
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
|
276 |
+
setTimeout(function () {
|
277 |
+
var liveChat4 = jQuery('#wp-live-chat-4');
|
278 |
+
var liveChat = jQuery('#wp-live-chat');
|
279 |
+
if (!liveChat.hasClass('classic')) {
|
280 |
+
jQuery('body').on('click', function (event) {
|
281 |
+
if (liveChat.hasClass('mobile-active')) {
|
282 |
+
if (event.target.id !== 'wplc_chatmsg' && event.target.className !== 'wdt-emoji-picker') {
|
283 |
+
liveChat4.removeClass('is-full-height');
|
284 |
+
} else {
|
285 |
+
liveChat4.addClass('is-full-height');
|
286 |
+
}
|
287 |
+
}
|
288 |
+
});
|
289 |
+
} else {
|
290 |
+
jQuery('body').on('click', function (event) {
|
291 |
+
if (liveChat.hasClass('mobile-active')) {
|
292 |
+
if (event.target.id !== 'wplc_chatmsg' && event.target.className !== 'wdt-emoji-picker') {
|
293 |
+
liveChat.removeClass('is-full-height');
|
294 |
+
} else {
|
295 |
+
liveChat.addClass('is-full-height');
|
296 |
+
}
|
297 |
+
}
|
298 |
+
});
|
299 |
}
|
300 |
+
}, 500);
|
301 |
+
}
|
302 |
+
});
|
303 |
+
|
304 |
|
305 |
+
function wplc_map_node_variables() {
|
306 |
+
if (typeof wplc_welcome_msg !== "undefined") {
|
307 |
+
welcome_message = wplc_welcome_msg;
|
308 |
}
|
309 |
+
}
|
310 |
|
311 |
+
/**
|
312 |
+
* This instantly sends the user the welcome message (i.e. to wait for any agent and start typing so long)
|
313 |
+
*
|
314 |
+
*
|
315 |
+
*/
|
316 |
+
function wplc_send_welcome_message() {
|
317 |
+
if(wplc_welcome_msg !== "" && !wplc_shown_welcome){
|
318 |
+
message_class = "wplc_system_notification wplc-color-4";
|
319 |
+
var concatenated_message = "<span class='" + message_class + "'>";
|
320 |
+
concatenated_message += wplc_welcome_msg;
|
321 |
+
concatenated_message += "</span>";
|
322 |
+
|
323 |
+
if(typeof niftyFormatParser !== "undefined"){
|
324 |
+
jQuery("#wplc_chatbox").append(niftyFormatParser(concatenated_message));
|
325 |
+
} else{
|
326 |
+
jQuery("#wplc_chatbox").append(concatenated_message);
|
327 |
+
}
|
328 |
+
wplc_scroll_to_bottom();
|
329 |
+
|
330 |
+
wplc_shown_welcome = true;
|
331 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
332 |
|
333 |
+
}
|
334 |
+
|
335 |
+
jQuery(document).ready(function(){
|
336 |
+
if (wplc_online) {
|
337 |
+
jQuery(document).on('click', '#wp-live-chat-header', function() {
|
338 |
+
jQuery('#speeching_button').html(wplc_pro_sst1);
|
339 |
+
jQuery('#wplc_name').val(wplc_user_default_visitor_name);
|
340 |
+
})
|
341 |
+
} else {
|
342 |
+
jQuery('#wplc_na_msg_btn').val(wplc_pro_offline_btn_send);
|
343 |
+
}
|
344 |
+
})
|
345 |
+
|
346 |
+
/**
|
347 |
+
* Scrolls the chat box to the bottom
|
348 |
+
*
|
349 |
+
*/
|
350 |
+
function wplc_scroll_to_bottom() {
|
351 |
+
var height = jQuery('#wplc_chatbox')[0].scrollHeight;
|
352 |
+
jQuery('#wplc_chatbox').scrollTop(height);
|
353 |
+
}
|
354 |
+
|
355 |
+
|
356 |
+
|
357 |
+
function wplc_user_message_receiver(data){
|
358 |
+
if(typeof wplc_loop_response_handler !== "undefined" && typeof wplc_loop_response_handler === "function"){
|
359 |
+
wplc_loop_response_handler(data, wplc_server_last_loop_data);
|
360 |
+
data = JSON.parse(data);
|
361 |
+
if(typeof data['status'] !== "undefined"){
|
362 |
+
delete wplc_server_last_loop_data.status;
|
363 |
+
}
|
364 |
+
|
365 |
+
if(data.keep_alive === true){
|
366 |
+
|
367 |
+
setTimeout(function(){
|
368 |
+
wplc_server_last_loop_data.status = wplc_chat_status;
|
369 |
+
wplc_call_to_server_chat(wplc_server_last_loop_data);
|
370 |
+
},100);
|
371 |
}
|
372 |
}
|
373 |
+
}
|
|
|
|
|
374 |
|
375 |
+
function wplc_user_retry_handler(data){
|
376 |
+
var tstatus = Cookies.get("wplc_chat_status");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
377 |
|
378 |
+
if (tstatus !== "undefined") {
|
379 |
+
if(tstatus !== 8 || tstatus !== 1){
|
380 |
+
wplc_retry_interval = setTimeout(function(){
|
381 |
|
382 |
+
wplc_server.prepareTransport(function(){
|
383 |
+
//Transport ready...
|
384 |
+
wplc_server_last_loop_data.status = parseInt(tstatus); //Set to existing status
|
385 |
+
wplc_call_to_server_chat(wplc_server_last_loop_data);
|
386 |
+
}, wplc_user_message_receiver, wplc_user_retry_handler, wplc_log_connection_error);
|
387 |
|
388 |
+
|
389 |
+
},500);
|
390 |
}
|
391 |
+
|
392 |
}
|
393 |
+
}
|
394 |
|
395 |
+
function wplc_call_to_server_chat(data,first_run,short_poll) {
|
396 |
+
|
397 |
+
if (typeof wplc_use_node_server !== "undefined" && wplc_use_node_server === "true") {
|
398 |
+
//not sending to WP
|
399 |
+
return;
|
400 |
+
} else {
|
401 |
|
402 |
|
403 |
if (typeof first_run === "undefined") { first_run = false; };
|
408 |
if(typeof Cookies.get('wplc_name') !== "undefined"){
|
409 |
data.msg_from_print = Cookies.get('wplc_name');
|
410 |
}
|
411 |
+
|
412 |
wplc_server_last_loop_data = data;
|
413 |
|
414 |
wplc_server.send(wplc_ajaxurl, data, "POST", 120000,
|
421 |
|
422 |
if (jqXHR.status == 404) {
|
423 |
wplc_log_connection_error('Error: Requested page not found. [404]');
|
424 |
+
wplc_run = false;
|
425 |
} else if (jqXHR.status == 500) {
|
426 |
+
wplc_log_connection_error('Error: Internal Server Error [500].');
|
427 |
wplc_log_connection_error('Retrying in 5 seconds...');
|
428 |
+
wplc_run = true;
|
429 |
} else if (exception === 'parsererror') {
|
430 |
+
wplc_log_connection_error('Error: Requested JSON parse failed.');
|
431 |
+
wplc_run = false;
|
432 |
} else if (exception === 'abort') {
|
433 |
wplc_log_connection_error('Error: Ajax request aborted.');
|
434 |
+
wplc_run = false;
|
435 |
} else {
|
436 |
+
wplc_log_connection_error('Error: Uncaught Error.\n' + jqXHR.responseText);
|
437 |
wplc_log_connection_error('Retrying in 5 seconds...');
|
438 |
+
wplc_run = true;
|
439 |
+
}
|
440 |
},
|
441 |
function(response){
|
442 |
if (wplc_run) {
|
443 |
if(wplc_server.isInSocketMode() === false && wplc_server.isPreparingSocketMode() === false){
|
444 |
+
setTimeout(function() {
|
445 |
+
wplc_call_to_server_chat(data,false,false);
|
446 |
}, wplc_long_poll_delay);
|
447 |
} else if ((wplc_server.isInSocketMode() === false && wplc_server.isPreparingSocketMode() === true) && (typeof wplc_transport_prepared !== "undefined" && wplc_transport_prepared === false)) {
|
448 |
/* Allows for initiate chat to work on the node server */
|
449 |
if (typeof wplc_use_node_server !== "undefined" && wplc_use_node_server === "true") {
|
450 |
/* do not run this if using not the node jedi */
|
451 |
+
setTimeout(function() {
|
452 |
+
wplc_call_to_server_chat(data,false,true);
|
453 |
}, 7500);
|
454 |
}
|
455 |
} else {
|
459 |
if(wplc_transport_prepared !== true && (parseInt(response_data.status) === 3 || parseInt(response_data.status) === 2)){
|
460 |
//Transport is unprepared and the user has returned to the page with a status 3/2
|
461 |
wplc_server.prepareTransport(function(){
|
462 |
+
wplc_call_to_server_chat(data,false,false);
|
463 |
}, wplc_user_message_receiver, wplc_user_retry_handler, wplc_log_connection_error);
|
464 |
}
|
465 |
}
|
466 |
}
|
467 |
}
|
468 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
469 |
}
|
470 |
+
);
|
471 |
+
}
|
472 |
+
|
473 |
+
};
|
474 |
+
|
475 |
+
function wplc_loop_response_handler(response, data){
|
476 |
+
if(response){
|
477 |
+
if (response === "0") { if (window.console) { console.log('WP Live Chat Support Return Error'); } wplc_run = false; return; }
|
478 |
+
if (typeof response !== "object") {
|
479 |
+
response = JSON.parse(response);
|
480 |
+
}
|
481 |
|
482 |
+
data['action_2'] = "";
|
483 |
+
if(typeof response['wplc_name'] !== "undefined"){ data['wplc_name'] = response['wplc_name']; /* Cookies.set('wplc_name', response['wplc_name'], { expires: 1, path: '/' });*/ }
|
484 |
+
if(typeof response['wplc_email'] !== "undefined"){ data['wplc_email'] = response['wplc_email']; /* Cookies.set('wplc_email', response['wplc_email'], { expires: 1, path: '/' }); */ }
|
485 |
+
if(typeof response['cid'] !== "undefined"){ data['cid'] = response['cid']; Cookies.set('wplc_cid', response['cid'], { expires: 1, path: '/' }); }
|
486 |
+
if(typeof response['aname'] !== "undefined") { wplc_agent_name = response['aname']; }
|
487 |
+
if(typeof response['cid'] !== "undefined" && wplc_cid !== jQuery.trim(response['cid'])){ wplc_cid = jQuery.trim(response['cid']); jQuery("#wplc_cid").val(wplc_cid); }
|
488 |
+
if(typeof response['status'] !== "undefined" && parseInt(wplc_chat_status) !== parseInt(response['status'])){
|
489 |
+
wplc_chat_status = response['status'];
|
490 |
+
Cookies.set('wplc_chat_status', null, { path: '/' });
|
491 |
+
Cookies.set('wplc_chat_status', wplc_chat_status, { expires: 1, path: '/' });
|
492 |
+
}
|
493 |
+
|
494 |
+
/* Trigger for handling responses */
|
495 |
+
jQuery.event.trigger({type: "wplc_user_chat_loop",response:response});
|
496 |
+
|
497 |
+
/* Process status changes */
|
498 |
+
if(data['status'] == response['status']){
|
499 |
+
|
500 |
+
if(data['status'] == 5 && wplc_init_chat_box_check === true && wplc_init_chat_box !== false){ // open chat box on load
|
501 |
+
wplc_init_chat_box(data['cid'], data['status']);
|
502 |
}
|
503 |
+
if((response['status'] == 3 || response['status'] == 2) && response['data'] != null){ // if active and data is returned
|
504 |
+
wplc_run = true;
|
505 |
+
var wplc_new_message_sound = false;
|
506 |
+
if (typeof response['data'] === "object") {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
507 |
|
508 |
+
for (var index in response['data']) {
|
509 |
+
if(typeof response['data'][index] !== "object"){
|
510 |
+
if (typeof msg_history[index] === "undefined") {
|
511 |
+
//Not from node
|
512 |
+
/* we dont have this message */
|
513 |
+
msg_history[index] = true;
|
|
|
|
|
514 |
|
515 |
+
msg_to_parse = response['data'][index].wplcStripSlashes();
|
|
|
|
|
516 |
|
517 |
+
if(typeof niftyFormatParser !== "undefined"){
|
518 |
+
jQuery("#wplc_chatbox").append(niftyFormatParser(msg_to_parse));
|
519 |
+
} else{
|
520 |
|
521 |
+
jQuery("#wplc_chatbox").append(response['data'][index].wplcStripSlashes());
|
|
|
|
|
|
|
522 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
523 |
|
524 |
+
wplc_new_message_sound = true;
|
525 |
+
|
526 |
+
} else {
|
527 |
+
/* we already have this message */
|
528 |
}
|
529 |
+
} else {
|
530 |
+
var the_message = response['data'][index];
|
531 |
+
the_message.mid = index;
|
532 |
+
wplc_push_message_to_chatbox(the_message,'u', function() {
|
533 |
+
wplc_scroll_to_bottom();
|
534 |
+
});
|
535 |
+
|
536 |
+
|
537 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
538 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
539 |
}
|
540 |
+
else {
|
541 |
+
/* backwards compatibility - response['data'] is a string */
|
542 |
+
if(typeof niftyFormatParser !== "undefined"){
|
543 |
+
jQuery("#wplc_chatbox").append(niftyFormatParser(response['data'].wplcStripSlashes()));
|
544 |
+
} else{
|
545 |
+
jQuery("#wplc_chatbox").append(response['data'].wplcStripSlashes());
|
546 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
547 |
}
|
548 |
+
wplc_new_message_sound = true;
|
549 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
550 |
|
551 |
+
if(wplc_new_message_sound){
|
552 |
+
wplc_scroll_to_bottom();
|
553 |
+
if (typeof wplc_enable_ding !== 'undefined' && wplc_enable_ding === "1") {
|
554 |
+
new Audio(wplc_plugin_url+'/wp-live-chat-support/ding.mp3').play();
|
555 |
+
}
|
556 |
+
}
|
557 |
+
}
|
558 |
|
559 |
+
} else {
|
560 |
+
data['status'] = wplc_chat_status;
|
561 |
+
Cookies.set('wplc_chat_status', wplc_chat_status, { expires: 1, path: '/' });
|
562 |
+
if(response['status'] == 0 || response['status'] == 12){ // no answer from admin
|
563 |
+
jQuery("#wp-live-chat-3").hide();
|
564 |
+
if (typeof response['data'] !== "undefined") {
|
565 |
+
jQuery("#wplc_chatbox").append(response['data'].wplcStripSlashes()+"<hr />");
|
566 |
+
}
|
567 |
|
568 |
+
}
|
569 |
+
else if(response['status'] == 8){ // chat has been ended by admin
|
570 |
+
wplc_run = false;
|
571 |
|
572 |
+
document.getElementById('wplc_chatmsg').disabled = true;
|
573 |
+
wplc_shown_welcome = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
574 |
|
575 |
+
the_message = wplc_generate_system_notification_object(wplc_error_messages.chat_ended_by_operator, {}, 0);
|
576 |
+
wplc_push_message_to_chatbox(the_message,'u', function() {
|
577 |
+
wplc_scroll_to_bottom();
|
578 |
+
});
|
579 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
580 |
|
581 |
+
/*
|
582 |
+
if(typeof response['data'] === "object") {
|
583 |
+
for (var index in response['data']) {
|
584 |
+
if(typeof response['data'][index] === "object"){
|
585 |
|
586 |
+
var the_message = response['data'][index];
|
587 |
+
if(typeof the_message.originates !== "undefined"){
|
588 |
+
var message_class = "";
|
589 |
+
var message_content = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
590 |
|
591 |
+
if (parseInt(the_message.originates) === 0){
|
592 |
+
//System Notification
|
593 |
+
message_class = "wplc_system_notification wplc-color-4";
|
594 |
+
message_content = the_message.msg;
|
595 |
+
if(message_content !== ""){
|
596 |
+
var concatenated_message = "<span class='" + message_class + "'>";
|
597 |
+
concatenated_message += message_content;
|
598 |
+
concatenated_message += "</span>";
|
599 |
|
|
|
|
|
|
|
600 |
if(typeof niftyFormatParser !== "undefined"){
|
601 |
+
jQuery("#wplc_chatbox").append(niftyFormatParser(concatenated_message));
|
602 |
} else{
|
603 |
+
jQuery("#wplc_chatbox").append(concatenated_message);
|
604 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
605 |
}
|
606 |
}
|
607 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
608 |
}
|
|
|
|
|
|
|
|
|
|
|
609 |
}
|
610 |
+
} else {
|
611 |
+
//Backwards Compat
|
612 |
+
jQuery("#wplc_chatbox").append("<em>"+response['data']+"</em><br />");
|
613 |
+
}*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
614 |
|
|
|
|
|
|
|
615 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
616 |
|
|
|
|
|
617 |
|
|
|
|
|
618 |
|
619 |
+
jQuery.event.trigger({type: "wplc_end_chat"});
|
620 |
|
621 |
+
}
|
622 |
+
else if(parseInt(response['status']) == 11){ /* use moved on to another page (perhaps in another tab so close this instance */
|
623 |
+
jQuery("#wp-live-chat").css({ "display" : "none" });
|
624 |
+
wplc_run = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
625 |
}
|
626 |
+
else if(parseInt(response['status']) == 3 || parseInt(response['status']) == 2 || parseInt(response['status']) == 10){ // re-initialize chat
|
627 |
+
wplc_run = true;
|
628 |
+
if(parseInt(response['status']) == 3) { // only if not minimized open aswell
|
629 |
+
/* HERE NODE */
|
630 |
+
|
631 |
+
if (typeof wplc_use_node_server !== "undefined" && wplc_use_node_server === "true") {
|
632 |
+
/* do not run this if using not the node jedi */
|
633 |
+
|
634 |
+
if (typeof wplc_transport_prepared !== "undefined" && wplc_transport_prepared === false) {
|
635 |
+
wplc_server.prepareTransport(function(){
|
636 |
+
wplc_call_to_server_chat(wplc_server_last_loop_data,false,false);
|
637 |
+
}, wplc_user_message_receiver, wplc_user_retry_handler, wplc_log_connection_error);
|
638 |
+
}
|
639 |
+
}
|
640 |
+
if (!wplc_is_minimized) {
|
641 |
+
if (!wplc_is_chat_open) {
|
642 |
+
wplc_cbox_animation();
|
643 |
+
setTimeout(function() {
|
644 |
+
open_chat(0);
|
645 |
+
},1500);
|
646 |
+
}
|
647 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
648 |
|
|
|
649 |
|
650 |
+
if(jQuery('#wp-live-chat').hasClass('wplc_left') === true || jQuery('#wp-live-chat').hasClass('wplc_right') === true){
|
651 |
+
//jQuery('#wp-live-chat').height("400px");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
652 |
}
|
|
|
653 |
}
|
654 |
+
if(parseInt(response['status']) == 10) { // only if not minimized open aswell
|
655 |
+
wplc_run = true;
|
656 |
+
open_chat(0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
657 |
|
658 |
+
}
|
659 |
+
if(response['data'] != null){ // append messages to chat area
|
660 |
+
if (typeof response['data'] === "object") {
|
661 |
|
662 |
+
for (var index in response['data']) {
|
663 |
+
wplc_new_message_sound = false;
|
664 |
+
if(typeof response['data'][index] !== "object"){
|
665 |
|
666 |
+
if (typeof msg_history[index] === "undefined") {
|
667 |
+
/* we dont have this message */
|
668 |
+
msg_history[index] = true;
|
669 |
+
if(typeof niftyFormatParser !== "undefined"){
|
670 |
+
jQuery("#wplc_chatbox").append(niftyFormatParser(response['data'][index].wplcStripSlashes()));
|
671 |
+
} else{
|
672 |
+
jQuery("#wplc_chatbox").append(response['data'][index].wplcStripSlashes());
|
673 |
+
}
|
674 |
|
675 |
+
wplc_new_message_sound = true;
|
676 |
+
} else {
|
677 |
+
/* we already have this message */
|
678 |
+
}
|
679 |
+
} else {
|
680 |
+
var the_message = response['data'][index];
|
681 |
+
the_message.mid = index;
|
682 |
+
wplc_push_message_to_chatbox(the_message,'u', function() {
|
683 |
+
wplc_scroll_to_bottom();
|
684 |
+
});
|
|
|
|
|
|
|
|
|
685 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
686 |
|
687 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
688 |
|
689 |
+
if(wplc_new_message_sound){
|
690 |
+
if (response['alert']) {
|
691 |
+
jQuery('#wplc-chat-alert').addClass('is-active');
|
692 |
+
}
|
693 |
+
wplc_scroll_to_bottom();
|
694 |
+
if (typeof wplc_enable_ding !== 'undefined' && wplc_enable_ding === "1") {
|
695 |
+
new Audio(wplc_plugin_url+'/wp-live-chat-support/ding.mp3').play();
|
696 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
697 |
}
|
698 |
+
}
|
699 |
}
|
700 |
+
else {
|
701 |
+
/* backwards compatibility - response['data'] is a string */
|
702 |
+
if(typeof niftyFormatParser !== "undefined"){
|
703 |
+
jQuery("#wplc_chatbox").append(niftyFormatParser(response['data'].wplcStripSlashes()));
|
704 |
+
} else{
|
705 |
+
jQuery("#wplc_chatbox").append(response['data'].wplcStripSlashes());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
706 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
707 |
}
|
|
|
|
|
708 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
709 |
|
710 |
+
if(response['data']){
|
711 |
+
wplc_scroll_to_bottom();
|
712 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
713 |
}
|
714 |
}
|
715 |
}
|
716 |
+
}
|
717 |
+
}
|
718 |
+
}
|
719 |
|
|
|
720 |
|
721 |
|
722 |
+
function wplc_log_connection_error(error){
|
723 |
+
if (window.console) { console.log(error); }
|
724 |
|
725 |
+
jQuery("#wplc_chatbox").append("<small>" + error + "</small><br>");
|
726 |
+
wplc_scroll_to_bottom();
|
727 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
728 |
|
729 |
+
function wplc_display_error(error) {
|
|
|
|
|
|
|
|
|
|
|
730 |
|
731 |
+
the_message = {};
|
732 |
+
the_message.originates = 2;
|
733 |
+
the_message.msg = error;
|
734 |
+
the_message.other = {};
|
735 |
+
var wplc_d = new Date();
|
736 |
+
the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
|
737 |
+
wplc_push_message_to_chatbox(the_message,'u', function() {
|
738 |
+
wplc_scroll_to_bottom();
|
739 |
+
});
|
740 |
|
|
|
|
|
|
|
|
|
|
|
741 |
|
|
|
|
|
|
|
|
|
|
|
742 |
|
743 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
744 |
|
745 |
+
var wplc_init_chat_box = function(cid, status){
|
746 |
+
if(wplc_chat_status == 9 && wplc_check_hide_cookie == "yes"){
|
747 |
+
} else if (wplc_chat_status === 3) {
|
748 |
+
wplc_cbox_animation();
|
749 |
+
} else {
|
750 |
|
751 |
+
if(wplc_check_hide_cookie != "yes"){
|
752 |
+
wplc_dc = setTimeout(function (){
|
753 |
+
wplc_cbox_animation();
|
754 |
+
}, parseInt(window.wplc_delay));
|
|
|
|
|
755 |
}
|
756 |
+
}
|
757 |
+
wplc_init_chat_box = false;
|
758 |
+
jQuery.event.trigger({type: "wplc_init_complete"});
|
759 |
+
}
|
760 |
+
|
761 |
+
function wplc_cbox_animation() {
|
762 |
+
/*
|
763 |
+
* 1- Slide Up
|
764 |
+
* 2- Slide Across (Left/Right)
|
765 |
+
* 3- Slide Down
|
766 |
+
* 4- Fade In
|
767 |
+
*/
|
768 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
769 |
|
770 |
+
var wplc_window_id = jQuery("#wp-live-chat");
|
771 |
+
|
772 |
+
var wplc_theme_chosen = jQuery(wplc_window_id).attr('wplc_animation');
|
773 |
+
|
774 |
+
switch(wplc_theme_chosen){
|
775 |
+
case 'none':
|
776 |
+
jQuery(wplc_window_id).css('display', 'block');
|
777 |
+
break;
|
778 |
+
case 'animation-1':
|
779 |
+
// Slide Up
|
780 |
+
jQuery(wplc_window_id).animate({'marginBottom' : '0px'}, 1000);
|
781 |
+
break;
|
782 |
+
case 'animation-2-bl':
|
783 |
+
// Slide Accross from left
|
784 |
+
jQuery(wplc_window_id).animate({'left' : '20px'}, 1000);
|
785 |
+
break;
|
786 |
+
case 'animation-2-br':
|
787 |
+
// Slide Accross from right
|
788 |
+
jQuery(wplc_window_id).animate({'right' : '20px'}, 1000);
|
789 |
+
break;
|
790 |
+
case 'animation-2-l':
|
791 |
+
// Slide Accross from left
|
792 |
+
jQuery(wplc_window_id).animate({"left" : '0px'}, 1000);
|
793 |
+
break;
|
794 |
+
case 'animation-2-r':
|
795 |
+
|
796 |
+
// Slide Accross from right
|
797 |
+
jQuery(wplc_window_id).animate({'right' : '0px'}, 1000);
|
798 |
+
break;
|
799 |
+
case 'animation-3':
|
800 |
+
// Fade In
|
801 |
+
jQuery(wplc_window_id).fadeIn('slow');
|
802 |
+
case 'animation-4':
|
803 |
+
jQuery(wplc_window_id).css('display', 'block');
|
804 |
+
break;
|
805 |
+
default:
|
806 |
+
jQuery(wplc_window_id).css('display', 'block');
|
807 |
+
break;
|
808 |
+
}
|
809 |
|
810 |
+
//jQuery("#wp-live-chat").css({ "display" : "block" });
|
811 |
+
if(jQuery("#wp-live-chat").attr('wplc-auto-pop-up') === "1"){
|
812 |
+
|
813 |
+
setTimeout(function(){
|
814 |
+
open_chat(0);
|
815 |
+
},1000);
|
816 |
+
/**
|
817 |
+
* Adding this fixes the bug that stops the chat window from opening when an agent initialises a chat with a user
|
818 |
+
*
|
819 |
+
* Reasoning: when running open_chat(), wplc_is_chat_open is set to TRUE at the end of the function, and stops any future request to open_chat();
|
820 |
+
*
|
821 |
+
*/
|
822 |
+
wplc_is_chat_open = false;
|
823 |
+
}
|
824 |
+
|
825 |
+
jQuery.event.trigger({type: "wplc_animation_done"});
|
826 |
+
}
|
827 |
+
|
828 |
+
|
829 |
+
function wplc_sound(source,volume,loop) {
|
830 |
+
this.source=source;
|
831 |
+
this.volume=volume;
|
832 |
+
this.loop=loop;
|
833 |
+
var son;
|
834 |
+
this.son=son;
|
835 |
+
this.finish=false;
|
836 |
+
this.stop=function()
|
837 |
+
{
|
838 |
+
document.body.removeChild(this.son);
|
839 |
+
}
|
840 |
+
this.start=function()
|
841 |
+
{
|
842 |
+
if(this.finish)return false;
|
843 |
+
this.son=document.createElement("embed");
|
844 |
+
this.son.setAttribute("src",this.source);
|
845 |
+
this.son.setAttribute("hidden","true");
|
846 |
+
this.son.setAttribute("volume",this.volume);
|
847 |
+
this.son.setAttribute("autostart","true");
|
848 |
+
this.son.setAttribute("loop",this.loop);
|
849 |
+
document.body.appendChild(this.son);
|
850 |
+
}
|
851 |
+
this.remove=function()
|
852 |
+
{
|
853 |
+
document.body.removeChild(this.son);
|
854 |
+
this.finish=true;
|
855 |
+
}
|
856 |
+
this.init=function(volume,loop)
|
857 |
+
{
|
858 |
+
this.finish=false;
|
859 |
+
this.volume=volume;
|
860 |
+
this.loop=loop;
|
861 |
+
}
|
862 |
+
}
|
863 |
+
|
864 |
+
|
865 |
+
function wplc_strip(str) {
|
866 |
+
str=str.replace(/<br>/gi, "\n");
|
867 |
+
str=str.replace(/<p.*>/gi, "\n");
|
868 |
+
str=str.replace(/<a.*href="(.*?)".*>(.*?)<\/a>/gi, " $2 ($1) ");
|
869 |
+
str=str.replace(/<(?:.|\s)*?>/g, "");
|
870 |
+
|
871 |
+
str=str.replace('iframe', "");
|
872 |
+
str=str.replace('src', "");
|
873 |
+
str=str.replace('href', "");
|
874 |
+
str=str.replace('<', "");
|
875 |
+
str=str.replace('>', "");
|
876 |
+
|
877 |
+
/* remove the last carriage return from the text area output */
|
878 |
+
str=str.replace(/\n$/, "")
|
879 |
+
|
880 |
+
return str;
|
881 |
+
}
|
882 |
+
|
883 |
+
(function($) {
|
884 |
+
|
885 |
+
$(document).ready(function(event) {
|
886 |
+
|
887 |
+
if(!window.wdtEmojiBundle)
|
888 |
+
return;
|
889 |
+
|
890 |
+
$(document.body).on("click", function(event) {
|
891 |
+
|
892 |
+
// If click event isn't on the emoji window, or the emoji open button, close the emoji window
|
893 |
+
if($(event.target).closest(".wdt-emoji-picker, .wdt-emoji-popup").length == 0 && !(
|
894 |
+
event.target.parentNode == null && $(event.target).hasClass("fa-smile-o")
|
895 |
+
))
|
896 |
+
wdtEmojiBundle.close();
|
897 |
+
|
898 |
+
});
|
899 |
+
|
900 |
+
// Close emoji window on scroll
|
901 |
+
$(window).scroll(function(event) {
|
902 |
+
wdtEmojiBundle.close();
|
903 |
+
});
|
904 |
+
});
|
905 |
+
|
906 |
+
})(jQuery);
|
js/wplc_u.min.js
CHANGED
File without changes
|
js/wplc_u_admin.js
CHANGED
@@ -17,6 +17,10 @@ var wplc_notification_icon_url = wplc_notification_icon;
|
|
17 |
|
18 |
var wplc_poll_delay = 1500;
|
19 |
|
|
|
|
|
|
|
|
|
20 |
Object.size = function(obj) {
|
21 |
var size = 0, key;
|
22 |
for (key in obj) {
|
@@ -58,6 +62,7 @@ function wplc_notify_agent() {
|
|
58 |
|
59 |
|
60 |
}
|
|
|
61 |
function wplc_call_to_server(data) {
|
62 |
if(typeof wplc_pro_admin_long_poll_data !== "undefined" && typeof wplc_pro_admin_long_poll_data === "function"){
|
63 |
data = wplc_pro_admin_long_poll_data(data);
|
@@ -405,6 +410,9 @@ if (update === false) {
|
|
405 |
}
|
406 |
|
407 |
|
|
|
|
|
|
|
408 |
jQuery(document).ready(function () {
|
409 |
jQuery('body').on("click", "a", function (event) {
|
410 |
if (jQuery(this).hasClass('wplc_open_chat')) {
|
@@ -459,6 +467,7 @@ jQuery(document).ready(function () {
|
|
459 |
}
|
460 |
|
461 |
|
|
|
462 |
jQuery("body").on("change","#wplc_environment", function() {
|
463 |
|
464 |
var selection = jQuery(this).val();
|
@@ -531,7 +540,4 @@ jQuery(window).ready(function(){
|
|
531 |
|
532 |
}
|
533 |
|
534 |
-
});
|
535 |
-
|
536 |
-
|
537 |
-
|
17 |
|
18 |
var wplc_poll_delay = 1500;
|
19 |
|
20 |
+
var bleeper_favico_noti = '../wp-content/plugins/wp-live-chat-support/images/48px_n.png';
|
21 |
+
var bleeper_favico = '../wp-content/plugins/wp-live-chat-support/images/48px.png';
|
22 |
+
|
23 |
+
|
24 |
Object.size = function(obj) {
|
25 |
var size = 0, key;
|
26 |
for (key in obj) {
|
62 |
|
63 |
|
64 |
}
|
65 |
+
|
66 |
function wplc_call_to_server(data) {
|
67 |
if(typeof wplc_pro_admin_long_poll_data !== "undefined" && typeof wplc_pro_admin_long_poll_data === "function"){
|
68 |
data = wplc_pro_admin_long_poll_data(data);
|
410 |
}
|
411 |
|
412 |
|
413 |
+
|
414 |
+
|
415 |
+
|
416 |
jQuery(document).ready(function () {
|
417 |
jQuery('body').on("click", "a", function (event) {
|
418 |
if (jQuery(this).hasClass('wplc_open_chat')) {
|
467 |
}
|
468 |
|
469 |
|
470 |
+
|
471 |
jQuery("body").on("change","#wplc_environment", function() {
|
472 |
|
473 |
var selection = jQuery(this).val();
|
540 |
|
541 |
}
|
542 |
|
543 |
+
});
|
|
|
|
|
|
js/wplc_u_admin_chat.js
CHANGED
@@ -57,7 +57,7 @@ var wplc_display_name = wplc_name;
|
|
57 |
var wplc_enable_ding = wplc_enable_ding;
|
58 |
var wplc_first_run = true;
|
59 |
|
60 |
-
|
61 |
//Parse existing data
|
62 |
if(typeof niftyFormatParser !== "undefined"){
|
63 |
var htmlToParse = jQuery(".admin_chat_box_inner").html();
|
@@ -135,7 +135,7 @@ function wplc_loop_response_handler(response){
|
|
135 |
wplc_run = false;
|
136 |
} else {
|
137 |
jQuery(".end_chat_div").empty();
|
138 |
-
jQuery('#admin_chat_box').empty().append("<h2>
|
139 |
wplc_run = false;
|
140 |
}
|
141 |
}
|
@@ -173,16 +173,13 @@ function wplc_loop_response_handler(response){
|
|
173 |
});
|
174 |
|
175 |
new_length = jQuery("#admin_chat_box_area_" + cid).html().length;
|
|
|
176 |
if (current_len < new_length) {
|
177 |
if (typeof wplc_enable_ding !== 'undefined' && wplc_enable_ding === "1" && ! (/User is browsing <small/.test(response['chat_message']))) {
|
178 |
new Audio(wplc_ding_file).play()
|
179 |
}
|
180 |
}
|
181 |
-
|
182 |
}
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
}
|
187 |
if (response['action'] === "wplc_user_open_chat") {
|
188 |
data['action_2'] = "";
|
@@ -204,9 +201,9 @@ function wplc_loop_response_handler(response){
|
|
204 |
}
|
205 |
}
|
206 |
}
|
|
|
207 |
/**
|
208 |
* Scrolls the chat box to the bottom
|
209 |
-
*
|
210 |
*/
|
211 |
function wplc_scroll_to_bottom() {
|
212 |
var height = jQuery('#admin_chat_box_area_' + cid)[0].scrollHeight;
|
@@ -221,64 +218,63 @@ function wplc_display_error(error) {
|
|
221 |
}
|
222 |
|
223 |
function wplc_display_chat_status_update(new_chat_status, cid) {
|
224 |
-
if (new_chat_status
|
225 |
-
} else {
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
|
|
277 |
}
|
278 |
}
|
279 |
}
|
280 |
-
}
|
281 |
-
|
282 |
|
283 |
jQuery(document).ready(function () {
|
284 |
|
@@ -315,7 +311,6 @@ jQuery(document).ready(function () {
|
|
315 |
var wplc_cid = jQuery("#wplc_admin_cid").val();
|
316 |
wplc_scroll_to_bottom();
|
317 |
}
|
318 |
-
|
319 |
|
320 |
|
321 |
jQuery(".wplc_admin_accept").on("click", function () {
|
@@ -337,12 +332,14 @@ jQuery(document).ready(function () {
|
|
337 |
});
|
338 |
});
|
339 |
|
|
|
340 |
jQuery("#wplc_admin_chatmsg").keyup(function (event) {
|
341 |
if (event.keyCode == 13) {
|
342 |
jQuery("#wplc_admin_send_msg").click();
|
343 |
}
|
344 |
});
|
345 |
|
|
|
346 |
jQuery("#wplc_admin_close_chat").on("click", function () {
|
347 |
var wplc_cid = jQuery("#wplc_admin_cid").val();
|
348 |
var data = {
|
@@ -450,12 +447,6 @@ jQuery(document).ready(function () {
|
|
450 |
|
451 |
});
|
452 |
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
});
|
460 |
|
461 |
/* Handles Uploading and sharing a file within chat*/
|
57 |
var wplc_enable_ding = wplc_enable_ding;
|
58 |
var wplc_first_run = true;
|
59 |
|
60 |
+
jQuery(document).ready(function(){
|
61 |
//Parse existing data
|
62 |
if(typeof niftyFormatParser !== "undefined"){
|
63 |
var htmlToParse = jQuery(".admin_chat_box_inner").html();
|
135 |
wplc_run = false;
|
136 |
} else {
|
137 |
jQuery(".end_chat_div").empty();
|
138 |
+
jQuery('#admin_chat_box').empty().append("<h2>This chat has already been answered. Please close the chat window</h2>");
|
139 |
wplc_run = false;
|
140 |
}
|
141 |
}
|
173 |
});
|
174 |
|
175 |
new_length = jQuery("#admin_chat_box_area_" + cid).html().length;
|
176 |
+
|
177 |
if (current_len < new_length) {
|
178 |
if (typeof wplc_enable_ding !== 'undefined' && wplc_enable_ding === "1" && ! (/User is browsing <small/.test(response['chat_message']))) {
|
179 |
new Audio(wplc_ding_file).play()
|
180 |
}
|
181 |
}
|
|
|
182 |
}
|
|
|
|
|
|
|
183 |
}
|
184 |
if (response['action'] === "wplc_user_open_chat") {
|
185 |
data['action_2'] = "";
|
201 |
}
|
202 |
}
|
203 |
}
|
204 |
+
|
205 |
/**
|
206 |
* Scrolls the chat box to the bottom
|
|
|
207 |
*/
|
208 |
function wplc_scroll_to_bottom() {
|
209 |
var height = jQuery('#admin_chat_box_area_' + cid)[0].scrollHeight;
|
218 |
}
|
219 |
|
220 |
function wplc_display_chat_status_update(new_chat_status, cid) {
|
221 |
+
if (new_chat_status !== "0") {
|
222 |
+
} else {
|
223 |
+
if (chat_status !== new_chat_status) {
|
224 |
+
previous_chat_status = chat_status;
|
225 |
+
chat_status = new_chat_status;
|
226 |
+
|
227 |
+
if ((previous_chat_status === "2" && chat_status === "3") || (previous_chat_status === "5" && chat_status === "3")) {
|
228 |
+
//jQuery("#admin_chat_box_area_" + cid).append("<em>"+wplc_string1+"</em><br />");
|
229 |
+
wplc_scroll_to_bottom();
|
230 |
+
|
231 |
+
} else if (chat_status == "10" && previous_chat_status == "3") {
|
232 |
+
//jQuery("#admin_chat_box_area_" + cid).append("<em>"+wplc_string2+"</em><br />");
|
233 |
+
the_message = {};
|
234 |
+
the_message.originates = 3;
|
235 |
+
the_message.msg = wplc_string2;
|
236 |
+
the_message.other = {};
|
237 |
+
var wplc_d = new Date();
|
238 |
+
the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
|
239 |
+
wplc_push_message_to_chatbox(the_message,'a', function() {
|
240 |
+
wplc_scroll_to_bottom();
|
241 |
+
});
|
242 |
+
|
243 |
+
}
|
244 |
+
else if (chat_status === "3" && previous_chat_status === "10") {
|
245 |
+
//jQuery("#admin_chat_box_area_" + cid).append("<em>"+wplc_string3+"</em><br />");
|
246 |
+
the_message = {};
|
247 |
+
the_message.originates = 3;
|
248 |
+
the_message.msg = wplc_string3;
|
249 |
+
the_message.other = {};
|
250 |
+
var wplc_d = new Date();
|
251 |
+
the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
|
252 |
+
wplc_push_message_to_chatbox(the_message,'a', function() {
|
253 |
+
wplc_scroll_to_bottom();
|
254 |
+
});
|
255 |
+
}
|
256 |
+
else if (chat_status === "1" || chat_status === "8") {
|
257 |
+
wplc_run = false;
|
258 |
+
the_message = {};
|
259 |
+
the_message.originates = 3;
|
260 |
+
the_message.msg = wplc_string4;
|
261 |
+
the_message.other = {};
|
262 |
+
var wplc_d = new Date();
|
263 |
+
the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
|
264 |
+
wplc_push_message_to_chatbox(the_message,'a', function() {
|
265 |
+
wplc_scroll_to_bottom();
|
266 |
+
document.getElementById('wplc_admin_chatmsg').disabled = true;
|
267 |
+
});
|
268 |
+
//jQuery("#admin_chat_box_area_" + cid).append("<em>"+wplc_string4+"</em><br />");
|
269 |
+
wplc_scroll_to_bottom();
|
270 |
+
|
271 |
+
jQuery(".admin_chat_box_inner_bottom").hide();
|
272 |
+
jQuery(".admin_chat_quick_controls").hide();
|
273 |
+
jQuery(".end_chat_div").hide();
|
274 |
+
}
|
275 |
}
|
276 |
}
|
277 |
}
|
|
|
|
|
278 |
|
279 |
jQuery(document).ready(function () {
|
280 |
|
311 |
var wplc_cid = jQuery("#wplc_admin_cid").val();
|
312 |
wplc_scroll_to_bottom();
|
313 |
}
|
|
|
314 |
|
315 |
|
316 |
jQuery(".wplc_admin_accept").on("click", function () {
|
332 |
});
|
333 |
});
|
334 |
|
335 |
+
|
336 |
jQuery("#wplc_admin_chatmsg").keyup(function (event) {
|
337 |
if (event.keyCode == 13) {
|
338 |
jQuery("#wplc_admin_send_msg").click();
|
339 |
}
|
340 |
});
|
341 |
|
342 |
+
|
343 |
jQuery("#wplc_admin_close_chat").on("click", function () {
|
344 |
var wplc_cid = jQuery("#wplc_admin_cid").val();
|
345 |
var data = {
|
447 |
|
448 |
});
|
449 |
|
|
|
|
|
|
|
|
|
|
|
|
|
450 |
});
|
451 |
|
452 |
/* Handles Uploading and sharing a file within chat*/
|
js/wplc_u_admin_chatbox_ui_events.js
ADDED
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* wplc_u_admin_chatbox_ui_events.js is a controller for the UI related actions that happen
|
3 |
+
* inside the chatbox of the admin area.
|
4 |
+
*/
|
5 |
+
|
6 |
+
function WPLC_U_Admin_Chatbox_UI_Events() {
|
7 |
+
this._initialized = false;
|
8 |
+
}
|
9 |
+
|
10 |
+
WPLC_U_Admin_Chatbox_UI_Events.prototype = {
|
11 |
+
|
12 |
+
TIMESTAMP_HTML_ATTR: "mid",
|
13 |
+
|
14 |
+
SELECTORS : {
|
15 |
+
wplc_u_admin_chatbox_msg_body: " .wplc-msg-content",
|
16 |
+
wplc_u_admin_chatbox_user_msg: " .wplc-user-message .wplc-msg-content",
|
17 |
+
wplc_u_admin_chatbox_admin_msg: " .wplc-admin-message .wplc-msg-content",
|
18 |
+
wplc_u_admin_chatbox_msg: " .wplc-admin-message, .wplc-user-message",
|
19 |
+
wplc_u_admin_chatbox_msg_btn_edit: " .bleeper-edit-message"
|
20 |
+
},
|
21 |
+
|
22 |
+
CLASSES: {
|
23 |
+
POPUP_TIMESTAMP: "wplc-chatbox-msg-timestamp",
|
24 |
+
ONLY_HOURS: "only-hours"
|
25 |
+
},
|
26 |
+
|
27 |
+
showDate: false,
|
28 |
+
showTime: false,
|
29 |
+
showName: false,
|
30 |
+
showAvatar: false,
|
31 |
+
userName: "",
|
32 |
+
|
33 |
+
getClassSelector: function(className) {
|
34 |
+
try {
|
35 |
+
return "." + this.CLASSES.POPUP_TIMESTAMP;
|
36 |
+
} catch(err) {
|
37 |
+
//console.log("Failed to getSelectorFromClass" + err);
|
38 |
+
}
|
39 |
+
},
|
40 |
+
|
41 |
+
getTimestampPop: function(dateTime) {
|
42 |
+
try {
|
43 |
+
|
44 |
+
if (this.showDate || this.showTime) {
|
45 |
+
|
46 |
+
if (this.showDate && this.showTime) {
|
47 |
+
return '<span class="'+ this.CLASSES.POPUP_TIMESTAMP +'">' + $(dateTime).text() + '</span>';
|
48 |
+
} else {
|
49 |
+
return '<span class="'+ this.CLASSES.POPUP_TIMESTAMP +' '+ this.CLASSES.ONLY_HOURS +'">' + $(dateTime).text() + '</span>';
|
50 |
+
}
|
51 |
+
}
|
52 |
+
} catch(err) {
|
53 |
+
//console.log("Failed to getTimestampPop " + err.message);
|
54 |
+
}
|
55 |
+
},
|
56 |
+
|
57 |
+
/**
|
58 |
+
* This method append and displays the Timestamp of a message sent by a Chat Agent or a User.
|
59 |
+
*
|
60 |
+
* @param {*} message HTML object that contains a msg from a User or a Chat Agent
|
61 |
+
*/
|
62 |
+
displayMsgTimeStamp: function(message) {
|
63 |
+
try {
|
64 |
+
var msgTimeStamp = jQuery(message).parent().next();
|
65 |
+
|
66 |
+
if (msgTimeStamp !== undefined && msgTimeStamp !== '') {
|
67 |
+
var popupTimeStamp = this.getTimestampPop(msgTimeStamp);
|
68 |
+
jQuery(message).prepend(popupTimeStamp);
|
69 |
+
}
|
70 |
+
} catch(err) {
|
71 |
+
//console.log("Failed to displayMsgTimeStamp " + err);
|
72 |
+
}
|
73 |
+
},
|
74 |
+
|
75 |
+
/**
|
76 |
+
* This method simply displays the edit button which is within a message.
|
77 |
+
*
|
78 |
+
* @param {*} message HTML object that contains a msg from a User or a Chat Agent
|
79 |
+
*/
|
80 |
+
displayEditBtn: function(message) {
|
81 |
+
try {
|
82 |
+
|
83 |
+
var editMsgBtn = jQuery(message).parent().find(this.SELECTORS.wplc_u_admin_chatbox_msg_btn_edit)
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
+
if (editMsgBtn !== undefined && editMsgBtn !== '' && wplc_is_pro) {
|
88 |
+
jQuery(editMsgBtn).css("display", "inline-block");
|
89 |
+
}
|
90 |
+
|
91 |
+
|
92 |
+
} catch(err) {
|
93 |
+
//console.log("Failed to displayEditBtn " + err);
|
94 |
+
}
|
95 |
+
},
|
96 |
+
|
97 |
+
/**
|
98 |
+
* This method removes the timestapm
|
99 |
+
*
|
100 |
+
* @param {*} message HTML object that contains a msg from a User or a Chat Agent
|
101 |
+
*/
|
102 |
+
removeMsgTimeStamp: function(message) {
|
103 |
+
try {
|
104 |
+
jQuery(message).find(this.getClassSelector(this.CLASSES.POPUP_TIMESTAMP)).remove();
|
105 |
+
} catch(err) {
|
106 |
+
//console.log("Failed to removeMsgTimeStamp " + err);
|
107 |
+
}
|
108 |
+
},
|
109 |
+
|
110 |
+
/**
|
111 |
+
* This method hides the edit button which is within a message
|
112 |
+
*
|
113 |
+
* @param {*} message HTML object that contains a msg from a User or a Chat Agent
|
114 |
+
*/
|
115 |
+
hideEditBtn: function(message) {
|
116 |
+
try {
|
117 |
+
jQuery(message).find(this.SELECTORS.wplc_u_admin_chatbox_msg_btn_edit).css("display", "none");
|
118 |
+
} catch(err) {
|
119 |
+
//console.log("Failed to removeMsgTimeStamp " + err);
|
120 |
+
}
|
121 |
+
},
|
122 |
+
|
123 |
+
initEvents: function() {
|
124 |
+
try {
|
125 |
+
var ctx = this;
|
126 |
+
|
127 |
+
// Add and remove the edit button and the msg timestamp by toggling the hover event over a message
|
128 |
+
jQuery(document).on("mouseover", ctx.SELECTORS.wplc_u_admin_chatbox_user_msg, function() {
|
129 |
+
ctx.displayMsgTimeStamp(jQuery(this));
|
130 |
+
ctx.displayEditBtn(jQuery(this));
|
131 |
+
});
|
132 |
+
jQuery(document).on("mouseover", ctx.SELECTORS.wplc_u_admin_chatbox_admin_msg, function() {
|
133 |
+
ctx.displayMsgTimeStamp(jQuery(this));
|
134 |
+
ctx.displayEditBtn(jQuery(this));
|
135 |
+
});
|
136 |
+
jQuery(document).on("mouseout", ctx.SELECTORS.wplc_u_admin_chatbox_msg, function() {
|
137 |
+
ctx.removeMsgTimeStamp(jQuery(this));
|
138 |
+
ctx.hideEditBtn(jQuery(this));
|
139 |
+
});
|
140 |
+
|
141 |
+
} catch(err) {
|
142 |
+
//console.log("Failed to initEvents " + err);
|
143 |
+
}
|
144 |
+
},
|
145 |
+
|
146 |
+
initVars: function() {
|
147 |
+
try {
|
148 |
+
|
149 |
+
if (typeof wplc_show_date !== "undefined") {
|
150 |
+
|
151 |
+
if (wplc_show_date === 'true') {
|
152 |
+
this.showDate = true;
|
153 |
+
}
|
154 |
+
}
|
155 |
+
|
156 |
+
if (typeof wplc_show_time !== "undefined") {
|
157 |
+
|
158 |
+
if (wplc_show_time === 'true') {
|
159 |
+
this.showTime = true;
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
if (typeof wplc_show_name !== "undefined") {
|
164 |
+
|
165 |
+
if (wplc_show_name === 'true') {
|
166 |
+
this.showName = true;
|
167 |
+
}
|
168 |
+
}
|
169 |
+
|
170 |
+
if (typeof wplc_show_avatar !== "undefined") {
|
171 |
+
|
172 |
+
if (wplc_show_avatar === 'true') {
|
173 |
+
this.showAvatar = true;
|
174 |
+
}
|
175 |
+
}
|
176 |
+
} catch(err) {
|
177 |
+
//console.log("Failed to initVars " + err);
|
178 |
+
}
|
179 |
+
},
|
180 |
+
|
181 |
+
init: function() {
|
182 |
+
try {
|
183 |
+
var ctx = this;
|
184 |
+
|
185 |
+
jQuery(document).ready(function() {
|
186 |
+
ctx.initEvents();
|
187 |
+
ctx.initVars();
|
188 |
+
});
|
189 |
+
} catch(err) {
|
190 |
+
//console.log("Failed to init " + err);
|
191 |
+
}
|
192 |
+
}
|
193 |
+
|
194 |
+
}
|
195 |
+
|
196 |
+
var wplcAdminChatboxUi = new WPLC_U_Admin_Chatbox_UI_Events();
|
197 |
+
wplcAdminChatboxUi.init();
|
js/wplc_u_admin_events.js
ADDED
@@ -0,0 +1,849 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var wplc_upsell_events_array = [];
|
2 |
+
var wplc_new_chat_ringer_dismissed = false;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* This helps us keep track of which agent has left or joined a chat so we do not show the notification more than once.
|
6 |
+
* @type {Array}
|
7 |
+
*/
|
8 |
+
var wplc_agent_chat_statuses = [];
|
9 |
+
|
10 |
+
jQuery("#toolbar-item-open-bleeper").hide();
|
11 |
+
|
12 |
+
|
13 |
+
jQuery(document).ready(function(){
|
14 |
+
if ( typeof bleeper_in_dashboard !== "undefined" && bleeper_in_dashboard === "0") {
|
15 |
+
|
16 |
+
jQuery(".nifty_top_wrapper").hide();
|
17 |
+
jQuery(".nifty_top_wrapper").addClass("bleeper-out-dash");
|
18 |
+
jQuery(".wplc_remote_dash_below_contianer").hide();
|
19 |
+
|
20 |
+
}
|
21 |
+
|
22 |
+
|
23 |
+
if(typeof bleeper_remote_form_data_array !== "undefined" && typeof bleeper_remote_form_api_url !== "undefined" && typeof bleeper_remote_form_route !== "undefined"){
|
24 |
+
jQuery.post(bleeper_remote_form_api_url + bleeper_remote_form_route, bleeper_remote_form_data_array, function(response) {
|
25 |
+
|
26 |
+
}).done(function(response){
|
27 |
+
jQuery(response).insertAfter("#bleeper_content_wrapper");
|
28 |
+
jQuery.event.trigger({type: "bleeper_dom_ready"});
|
29 |
+
|
30 |
+
if ( typeof bleeper_in_dashboard !== "undefined" && bleeper_in_dashboard === "0") {
|
31 |
+
|
32 |
+
jQuery(".nifty_top_wrapper").hide();
|
33 |
+
jQuery(".nifty_top_wrapper").addClass("bleeper-out-dash");
|
34 |
+
jQuery(".wplc_remote_dash_below_contianer").hide();
|
35 |
+
jQuery("#toolbar-item-open-bleeper").show();
|
36 |
+
|
37 |
+
}
|
38 |
+
|
39 |
+
}).fail(function(){
|
40 |
+
jQuery("#bleeper_inline_connection_error").fadeIn();
|
41 |
+
});
|
42 |
+
}
|
43 |
+
|
44 |
+
});
|
45 |
+
|
46 |
+
var agent_dash_open = false;
|
47 |
+
jQuery(document).on("click", "#toolbar-item-open-bleeper", function() {
|
48 |
+
if (agent_dash_open) {
|
49 |
+
agent_dash_open = false;
|
50 |
+
jQuery(this).css("background-image","url("+wplc_url+"/images/48px.png)");
|
51 |
+
jQuery(this).css("background-color","#333");
|
52 |
+
jQuery(".bleeper-out-dash").fadeOut("1000");
|
53 |
+
} else {
|
54 |
+
agent_dash_open = true;
|
55 |
+
jQuery(this).css("background-image","url("+wplc_url+"/images/iconCloseRetina.png)");
|
56 |
+
jQuery(this).css("background-color","#333");
|
57 |
+
jQuery(".bleeper-out-dash").fadeIn("1000");
|
58 |
+
}
|
59 |
+
});
|
60 |
+
|
61 |
+
|
62 |
+
jQuery(document).on("bleeper_connect", function(e) {
|
63 |
+
if(typeof wplc_disabled !== "undefined" && wplc_disabled === "true"){
|
64 |
+
var wplc_disabled_content = (typeof wplc_disabled_html !== "undefined" ? wplc_disabled_html : "Chat has been disabled in the settings area.");
|
65 |
+
jQuery("#nifty_bg_holder_text_inner").html(wplc_disabled_content);
|
66 |
+
jQuery("#nifty_bg_holder_text_inner").css("font-size", "19px");
|
67 |
+
} else {
|
68 |
+
if (typeof wplc_choose_accept_chats !== "undefined" && wplc_choose_accept_chats === "0") {
|
69 |
+
jQuery(".nifty_bg_holder_text").html("");
|
70 |
+
jQuery(".nifty_bg_holder").fadeOut();
|
71 |
+
jQuery(".nifty_bg_holder_text").html("You are not accepting chats");
|
72 |
+
jQuery(".nifty_bg_holder").fadeIn();
|
73 |
+
jQuery(".nifty_bg_holder").css('left','25%');
|
74 |
+
|
75 |
+
} else {
|
76 |
+
socket = io.connect(node_uri, { secure:true, query : e.ndata.query_string } );
|
77 |
+
bleeper_delegates();
|
78 |
+
bleeper_update_agent_unread();
|
79 |
+
|
80 |
+
}
|
81 |
+
}
|
82 |
+
});
|
83 |
+
jQuery(document).on("bleeper_limited", function(e){
|
84 |
+
if(typeof e.ndata !== "undefined" && e.ndata.limited !== "undefined"){
|
85 |
+
var is_limited = e.ndata.limited;
|
86 |
+
if(is_limited === "true" || is_limited === true){
|
87 |
+
jQuery("#wplc_limited_container").fadeIn();
|
88 |
+
} else {
|
89 |
+
//console.log("not_limited");
|
90 |
+
}
|
91 |
+
}
|
92 |
+
});
|
93 |
+
jQuery(document).on("bleeper_invalid_agent", function(e){
|
94 |
+
//disable life
|
95 |
+
jQuery("#nifty_wrapper").remove();
|
96 |
+
jQuery(".nifty_bg_holder").remove();
|
97 |
+
jQuery("#page-wrapper").hide();
|
98 |
+
jQuery("#wplc_agent_invalid_container").fadeIn();
|
99 |
+
});
|
100 |
+
|
101 |
+
//Chat Notification
|
102 |
+
jQuery(document).on("bleeper_user_chat_notification", function(e){
|
103 |
+
if(typeof e.ndata !== "undefined"){
|
104 |
+
if(typeof e.ndata.chatid !== "undefined" && typeof e.ndata.notification_text !== "undefined"){
|
105 |
+
if(e.ndata.chatid === active_chatid){
|
106 |
+
the_message = {};
|
107 |
+
the_message.msg = (typeof wplc_user_chat_notification_prefix !== "undefined" ? "<strong><em>" + wplc_user_chat_notification_prefix + "</strong></em><br>" : "") + e.ndata.notification_text;
|
108 |
+
the_message.originates = 0;
|
109 |
+
the_message.other = {};
|
110 |
+
wplc_push_message_to_chatbox(the_message, agent_id, function(){
|
111 |
+
});
|
112 |
+
}
|
113 |
+
}
|
114 |
+
}
|
115 |
+
});
|
116 |
+
|
117 |
+
//jQuery(document).ready(function(){
|
118 |
+
jQuery(document).on("bleeper_dom_ready", function(e) {
|
119 |
+
|
120 |
+
|
121 |
+
if (typeof wplc_upsell_a2a !== "undefined" && wplc_upsell_a2a === '1') {
|
122 |
+
jQuery("#agent_list").hide();
|
123 |
+
jQuery(".userListBox_Wrapper").css('bottom','0px');
|
124 |
+
}
|
125 |
+
|
126 |
+
jQuery("body").on("click", ".wplc_a2a_dismiss", function() {
|
127 |
+
jQuery('#agent_list').hide();
|
128 |
+
jQuery(".userListBox_Wrapper").css('bottom','0px');
|
129 |
+
|
130 |
+
var data = {
|
131 |
+
action: 'wplc_a2a_dismiss',
|
132 |
+
security: wplc_nonce
|
133 |
+
};
|
134 |
+
|
135 |
+
jQuery.post(ajaxurl, data, function(response) {
|
136 |
+
|
137 |
+
|
138 |
+
});
|
139 |
+
});
|
140 |
+
|
141 |
+
|
142 |
+
|
143 |
+
if (jQuery(".online_agent_list").length && typeof wplc_is_pro === "undefined") {
|
144 |
+
|
145 |
+
jQuery('<span/>', {
|
146 |
+
'class' : 'wplc_a2a_dismiss',
|
147 |
+
html: 'Dismiss'
|
148 |
+
|
149 |
+
}).appendTo("#agent_list");
|
150 |
+
|
151 |
+
jQuery('<li/>', {
|
152 |
+
'class': 'upsell',
|
153 |
+
'id': '',
|
154 |
+
'aid': '',
|
155 |
+
html: agent_to_agent_chat_upsell
|
156 |
+
}).appendTo(".online_agent_list");
|
157 |
+
}
|
158 |
+
|
159 |
+
jQuery("#page-wrapper").css("height", (jQuery(window).height() - 100) + "px");
|
160 |
+
|
161 |
+
jQuery(window).on("resize", function(){
|
162 |
+
jQuery("#page-wrapper").css("height", (jQuery(window).height() - 100) + "px");
|
163 |
+
});
|
164 |
+
|
165 |
+
jQuery("#toolbar-item-fullscreen-wp").click(function(){
|
166 |
+
jQuery("#collapse-button").click();
|
167 |
+
});
|
168 |
+
|
169 |
+
jQuery(document).on("bleeper_new_chat", function(e) {
|
170 |
+
wplc_new_chat_notifications();
|
171 |
+
wplc_desktop_notification();
|
172 |
+
wplc_new_chat_ringer_dismissed = false; //Ensure it is reset here
|
173 |
+
wplc_repeat_new_chat_notification(1);
|
174 |
+
});
|
175 |
+
|
176 |
+
jQuery(document).on("bleeper_send_message", function(e) {
|
177 |
+
var the_message = {}
|
178 |
+
the_message.originates = 1;
|
179 |
+
the_message.msg = typeof e.message !== "undefined" ? e.message : false;
|
180 |
+
the_message.other = {};
|
181 |
+
|
182 |
+
var wplc_d = new Date();
|
183 |
+
the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
|
184 |
+
the_message.other.agent_id = agent_id;
|
185 |
+
|
186 |
+
if(the_message.msg !== false){
|
187 |
+
if (typeof message_type === 'undefined' || message_type === 'u') {
|
188 |
+
/* this message is going to a user */
|
189 |
+
var api_endpoint = 'send_message';
|
190 |
+
var ato = '';
|
191 |
+
} else {
|
192 |
+
/* this message is going to another agent */
|
193 |
+
var api_endpoint = 'send_agent_message';
|
194 |
+
var ato = message_type;
|
195 |
+
}
|
196 |
+
var data = {
|
197 |
+
relay_action: 'wplc_admin_send_msg',
|
198 |
+
agent_id: agent_id,
|
199 |
+
security: wplc_nonce,
|
200 |
+
chat_id: wplc_cid,
|
201 |
+
message: the_message.msg,
|
202 |
+
ato: ato,
|
203 |
+
msg_id: e.msg_id
|
204 |
+
|
205 |
+
};
|
206 |
+
wplc_rest_api(api_endpoint, data, 12000, null);
|
207 |
+
}
|
208 |
+
});
|
209 |
+
|
210 |
+
jQuery(document).on("bleeper_add_message_chatbox", function(e) {
|
211 |
+
|
212 |
+
|
213 |
+
if(typeof e.message !== "object"){
|
214 |
+
var the_message = {}
|
215 |
+
the_message.originates = 1; //Assume from admin
|
216 |
+
the_message.msg = typeof e.message !== "undefined" ? e.message : false;
|
217 |
+
the_message.mid = typeof e.msgID !== "undefined" ? e.msgID : undefined;
|
218 |
+
the_message.other = {};
|
219 |
+
|
220 |
+
var wplc_d = new Date();
|
221 |
+
the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
|
222 |
+
the_message.other.agent_id = agent_id;
|
223 |
+
|
224 |
+
if(the_message.msg !== false){
|
225 |
+
wplc_push_message_to_chatbox(the_message, agent_id, function(){
|
226 |
+
|
227 |
+
});
|
228 |
+
}
|
229 |
+
} else {
|
230 |
+
//message is already an object
|
231 |
+
var the_message = e.message;
|
232 |
+
the_message.mid = typeof e.message.msgID !== "undefined" ? e.message.msgID : undefined;
|
233 |
+
the_message.originates = the_message.aoru === "u" ? 2 : 1; //Assume from admin
|
234 |
+
|
235 |
+
if(typeof the_message.msg === "undefined"){
|
236 |
+
the_message.msg = typeof the_message.message !== "undefined" ? the_message.message : false;
|
237 |
+
}
|
238 |
+
if (the_message.aoru !== 'u') {
|
239 |
+
if (typeof the_message.other !== 'object') { the_message.other = {}; }
|
240 |
+
the_message.other.aid = parseInt(the_message.aoru);
|
241 |
+
}
|
242 |
+
|
243 |
+
if (the_message.aoru === 'u') {
|
244 |
+
the_message.other = {};
|
245 |
+
var wplc_d = new Date();
|
246 |
+
the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
|
247 |
+
}
|
248 |
+
|
249 |
+
if(the_message.msg !== false){
|
250 |
+
wplc_push_message_to_chatbox(the_message, agent_id, function(){
|
251 |
+
|
252 |
+
});
|
253 |
+
}
|
254 |
+
}
|
255 |
+
|
256 |
+
jQuery.event.trigger({type: "bleeper_scroll_bottom"});
|
257 |
+
});
|
258 |
+
|
259 |
+
|
260 |
+
|
261 |
+
/**
|
262 |
+
* Triggered when an agent clicks the "accept chat" button
|
263 |
+
*
|
264 |
+
* We need to send the AID to a WP REST API endpoint so that we can save the AID in the table
|
265 |
+
*
|
266 |
+
* @return void
|
267 |
+
*/
|
268 |
+
jQuery(document).on("bleeper_agent_accepted_chat", function(e){
|
269 |
+
var data = {
|
270 |
+
relay_action: 'wplc_admin_send_msg',
|
271 |
+
agent_id: e.ndata.agent_id,
|
272 |
+
token: wplc_restapi_token,
|
273 |
+
chat_id: e.ndata.chat_id
|
274 |
+
|
275 |
+
};
|
276 |
+
wplc_rest_api('accept_chat', data, 12000, null);
|
277 |
+
|
278 |
+
});
|
279 |
+
|
280 |
+
jQuery(document).on("bleeper_open_chat", function(e) {
|
281 |
+
var new_chat_id = typeof e.cid !== "undefined" ? e.cid : false;
|
282 |
+
var new_username = typeof e.username !== "undefined" ? e.username : false;
|
283 |
+
if(new_username !== false){
|
284 |
+
wplc_chat_name = new_username;
|
285 |
+
}
|
286 |
+
|
287 |
+
if(new_chat_id !== false){
|
288 |
+
wplc_cid = new_chat_id;
|
289 |
+
jQuery.event.trigger({type: "bleeper_get_history"});
|
290 |
+
}
|
291 |
+
|
292 |
+
if (typeof wplc_is_pro === 'undefined' && typeof wplc_upsell_events_array[new_chat_id] === 'undefined') {
|
293 |
+
wplc_upsell_events_array[new_chat_id] = true;
|
294 |
+
bleeper_save_event(new_chat_id, 'fa-lightbulb-o', wplc_event_upsell);
|
295 |
+
}
|
296 |
+
|
297 |
+
wplc_new_chat_ringer_dismissed = true; //Dismiss it now regardless
|
298 |
+
|
299 |
+
|
300 |
+
});
|
301 |
+
|
302 |
+
jQuery(document).on("bleeper_get_history", function(e) {
|
303 |
+
|
304 |
+
|
305 |
+
/**
|
306 |
+
* Pull from sessionStorage if we can
|
307 |
+
*/
|
308 |
+
/*
|
309 |
+
if (bleeper_test_sessionStorage()) {
|
310 |
+
|
311 |
+
if (sessionStorage.getItem(wplc_cid+"_m") !== null) {
|
312 |
+
var msg_obj = JSON.parse(sessionStorage.getItem(wplc_cid+"_m"));
|
313 |
+
for (var key in msg_obj) {
|
314 |
+
var the_message = msg_obj[key];
|
315 |
+
the_message.mid = key;
|
316 |
+
|
317 |
+
if(typeof the_message.afrom !== "undefined"){
|
318 |
+
if(parseInt(the_message.afrom) !== parseInt(agent_id)){
|
319 |
+
//From a different agent
|
320 |
+
if(typeof the_message.other === "undefined"){ the_message.other = {}; }
|
321 |
+
the_message.other.from_an_agent = true;
|
322 |
+
}
|
323 |
+
}
|
324 |
+
|
325 |
+
wplc_push_message_to_chatbox(the_message, agent_id, function() {
|
326 |
+
jQuery.event.trigger({type: "bleeper_scroll_bottom"});
|
327 |
+
});
|
328 |
+
}
|
329 |
+
|
330 |
+
|
331 |
+
}
|
332 |
+
}
|
333 |
+
*/
|
334 |
+
bleeper_sort_and_send_messages(wplc_cid);
|
335 |
+
|
336 |
+
var data = {
|
337 |
+
relay_action: 'wplc_get_messages',
|
338 |
+
security: wplc_nonce,
|
339 |
+
chat_id: wplc_cid,
|
340 |
+
limit:50,
|
341 |
+
offset:0,
|
342 |
+
received_via: agent_id
|
343 |
+
};
|
344 |
+
|
345 |
+
wplc_rest_api('get_messages', data, 12000, function(message_history) {
|
346 |
+
if (typeof message_history !== "undefined" && typeof message_history.data !== "undefined" && typeof message_history.data.messages !== "undefined" && typeof message_history.data.messages === "object") {
|
347 |
+
message_history = message_history.data.messages;
|
348 |
+
for (var key in message_history) {
|
349 |
+
var wplc_push_to_chatbox = true;
|
350 |
+
|
351 |
+
/* first check if we have this in sessionStorage */
|
352 |
+
if (bleeper_test_sessionStorage()) {
|
353 |
+
if (sessionStorage.getItem(wplc_cid+"_m") !== null) {
|
354 |
+
var msg_obj = JSON.parse(sessionStorage.getItem(wplc_cid+"_m"));
|
355 |
+
if (typeof msg_obj[key] !== "undefined") {
|
356 |
+
//Check if message has changed - if so, live update the element
|
357 |
+
if(typeof msg_obj[key].msg !== "undefined" && typeof message_history[key].msg !== "undefined"){
|
358 |
+
if(msg_obj[key].msg !== message_history[key].msg){
|
359 |
+
//Message has changed, most likely an edit
|
360 |
+
wplc_update_message_element_by_mid(key, message_history[key].msg, "messageBody");
|
361 |
+
}
|
362 |
+
}
|
363 |
+
|
364 |
+
/* we've already got this message but lets update it anyway incase it was edited along the way and we never caught the edit */
|
365 |
+
msg_obj[key] = message_history[key];
|
366 |
+
wplc_push_to_chatbox = false;
|
367 |
+
|
368 |
+
} else {
|
369 |
+
msg_obj[key] = message_history[key];
|
370 |
+
}
|
371 |
+
sessionStorage.setItem(wplc_cid+"_m", JSON.stringify(msg_obj));
|
372 |
+
} else {
|
373 |
+
var msg_obj = {};
|
374 |
+
msg_obj[key] = message_history[key];
|
375 |
+
sessionStorage.setItem(wplc_cid+"_m", JSON.stringify(msg_obj));
|
376 |
+
}
|
377 |
+
|
378 |
+
} else {
|
379 |
+
/* we arent using sessionStorage or it is disabled so push message to window */
|
380 |
+
wplc_push_to_chatbox = true;
|
381 |
+
}
|
382 |
+
|
383 |
+
/*
|
384 |
+
if (wplc_push_to_chatbox) {
|
385 |
+
var the_message = message_history[key];
|
386 |
+
the_message.mid = key;
|
387 |
+
|
388 |
+
|
389 |
+
if(typeof the_message.afrom !== "undefined"){
|
390 |
+
if(parseInt(the_message.afrom) !== parseInt(agent_id)){
|
391 |
+
//From a different agent
|
392 |
+
if(typeof the_message.other === "undefined"){ the_message.other = {}; }
|
393 |
+
the_message.other.from_an_agent = true;
|
394 |
+
}
|
395 |
+
}
|
396 |
+
|
397 |
+
wplc_push_message_to_chatbox(the_message, agent_id, function() {
|
398 |
+
jQuery.event.trigger({type: "bleeper_scroll_bottom"});
|
399 |
+
});
|
400 |
+
}*/
|
401 |
+
}
|
402 |
+
|
403 |
+
bleeper_sort_and_send_messages(wplc_cid);
|
404 |
+
jQuery.event.trigger({type: "bleeper_messages_added", ndata:{cid:wplc_cid}});
|
405 |
+
|
406 |
+
|
407 |
+
}
|
408 |
+
});
|
409 |
+
});
|
410 |
+
|
411 |
+
jQuery(document).on("bleeper_scroll_bottom", function(e) {
|
412 |
+
jQuery("#messages").scrollTop(jQuery("#messages")[0].scrollHeight);
|
413 |
+
});
|
414 |
+
|
415 |
+
jQuery(document).on("bleeper_add_initiate_button_no_col", function(e) {
|
416 |
+
|
417 |
+
if(typeof bleeper_integration_pro_active === "undefined"){
|
418 |
+
var tmp_chatid = typeof e.cid !== "undefined" ? e.cid : false;
|
419 |
+
|
420 |
+
if(tmp_chatid !== false){
|
421 |
+
jQuery('<div/>', {
|
422 |
+
'class': '',
|
423 |
+
html: "<a href='javascript:void(0);' id='wplc_initiate_chat' class='wplc_initiate_chat btn btn-info pull-right' cid='"+ tmp_chatid +"'>Initiate Chat</a>"
|
424 |
+
}).appendTo('#vis'+e.cid + ' .visActionCol');
|
425 |
+
|
426 |
+
|
427 |
+
|
428 |
+
}
|
429 |
+
}
|
430 |
+
|
431 |
+
});
|
432 |
+
|
433 |
+
jQuery(document).on("bleeper_remove_initiate_button", function(e) {
|
434 |
+
if(typeof bleeper_integration_pro_active === "undefined"){
|
435 |
+
var tmp_chatid = typeof e.cid !== "undefined" ? e.cid : false;
|
436 |
+
if(tmp_chatid !== false){
|
437 |
+
jQuery('#vis'+ tmp_chatid + " #wplc_initiate_chat").remove();
|
438 |
+
}
|
439 |
+
}
|
440 |
+
|
441 |
+
});
|
442 |
+
|
443 |
+
if(typeof wplc_tip_header !== "undefined" && typeof wplc_tip_array !== "undefined"){
|
444 |
+
|
445 |
+
jQuery(".bleeper_tips_hints").fadeOut(500, function(){
|
446 |
+
var tip_content = wplc_tip_header + "<br><br>" + wplc_tip_array[0];
|
447 |
+
jQuery(".bleeper_tips_hints").html(tip_content).fadeIn();
|
448 |
+
});
|
449 |
+
|
450 |
+
var wplc_tip_index = 1;
|
451 |
+
setInterval(function(){
|
452 |
+
jQuery(".bleeper_tips_hints").fadeOut(500, function(){
|
453 |
+
var tip_content = wplc_tip_header + "<hr>" + wplc_tip_array[wplc_tip_index];
|
454 |
+
jQuery(".bleeper_tips_hints").html(tip_content).fadeIn();
|
455 |
+
});
|
456 |
+
|
457 |
+
|
458 |
+
if(wplc_tip_index + 1 >= wplc_tip_array.length){
|
459 |
+
wplc_tip_index = 0;
|
460 |
+
} else {
|
461 |
+
wplc_tip_index ++;
|
462 |
+
}
|
463 |
+
}, 30000);
|
464 |
+
}
|
465 |
+
|
466 |
+
/**
|
467 |
+
* Handles the "add agent" event.
|
468 |
+
*
|
469 |
+
* Takes over the 'add agent' event and adds our own data to it. In this case we add the agent's data so that it can be displayed in the header section of the live chat box on the front end
|
470 |
+
*
|
471 |
+
* @return void
|
472 |
+
*/
|
473 |
+
jQuery(document).on("bleeper_add_agent", function(e) {
|
474 |
+
|
475 |
+
socket.emit('add agent', e.ndata);
|
476 |
+
socket.emit('custom data',{action:'send_custom_header',chatid:e.ndata.chatid,agentid:e.ndata.agent,ndata:wplc_head_data});
|
477 |
+
|
478 |
+
|
479 |
+
});
|
480 |
+
|
481 |
+
/**
|
482 |
+
* Handles the "agent left" event.
|
483 |
+
*
|
484 |
+
* @return void
|
485 |
+
*/
|
486 |
+
jQuery(document).on("bleeper_agent_left", function(e) {
|
487 |
+
wplc_agent_chat_statuses[active_chatid] = 0;
|
488 |
+
if (active_chatid === e.ndata.chatid) {
|
489 |
+
the_message = wplc_generate_system_notification_object(e.ndata.agent_name+" left.", {}, 0);
|
490 |
+
wplc_push_message_to_chatbox(the_message,'a', function() {
|
491 |
+
//jQuery.event.trigger({type: "bleeper_scroll_bottom"});
|
492 |
+
});
|
493 |
+
}
|
494 |
+
});
|
495 |
+
|
496 |
+
/**
|
497 |
+
* Handles the "agent joined" event.
|
498 |
+
*
|
499 |
+
* @return void
|
500 |
+
*/
|
501 |
+
jQuery(document).on("bleeper_agent_joined", function(e) {
|
502 |
+
if (active_chatid === e.ndata.chatid) {
|
503 |
+
if (typeof wplc_agent_chat_statuses[active_chatid] === "undefined" || wplc_agent_chat_statuses[active_chatid] === 0) {
|
504 |
+
|
505 |
+
/* set this to 1 so we know this agent has joined the chat already */
|
506 |
+
wplc_agent_chat_statuses[active_chatid] = 1;
|
507 |
+
|
508 |
+
|
509 |
+
the_message = wplc_generate_system_notification_object(e.ndata.agent_name+" joined.", {}, 0);
|
510 |
+
wplc_push_message_to_chatbox(the_message,'a', function() {
|
511 |
+
//jQuery.event.trigger({type: "bleeper_scroll_bottom"});
|
512 |
+
});
|
513 |
+
}
|
514 |
+
}
|
515 |
+
});
|
516 |
+
|
517 |
+
/**
|
518 |
+
* Add the agent to the chat list items
|
519 |
+
*
|
520 |
+
* @return void
|
521 |
+
*/
|
522 |
+
jQuery(document).on('mouseenter', '.agent_involved', function() {
|
523 |
+
jQuery(this).addClass('agent_selected');
|
524 |
+
});
|
525 |
+
jQuery(document).on('mouseleave', '.agent_involved', function() {
|
526 |
+
jQuery(this).removeClass('agent_selected');
|
527 |
+
});
|
528 |
+
|
529 |
+
|
530 |
+
jQuery(document).on("bleeper_add_agent_involved", function(e) {
|
531 |
+
if(typeof wplc_agent_data !== "undefined"){
|
532 |
+
|
533 |
+
|
534 |
+
if(typeof wplc_agent_data[e.agentid] !== "undefined" && typeof wplc_agent_data[e.agentid].md5 !== "undefined" && typeof wplc_agent_data[e.agentid].name !== "undefined"){
|
535 |
+
|
536 |
+
var num_age = $(".agent_involved_"+e.chatid).length;
|
537 |
+
if (num_age > 2) {
|
538 |
+
var marg_right = num_age * -1.5;
|
539 |
+
$(".agent_involved_"+e.chatid).addClass('morethan2');
|
540 |
+
}
|
541 |
+
else {
|
542 |
+
var marg_right = 2;
|
543 |
+
$(".agent_involved_"+e.chatid).removeClass('morethan2');
|
544 |
+
}
|
545 |
+
if (marg_right < -12) { marg_right = 12; }
|
546 |
+
|
547 |
+
agent_involved = wplc_agent_data[e.agentid];
|
548 |
+
agent_involved_email = agent_involved.md5;
|
549 |
+
agent_involved_name = agent_involved.name;
|
550 |
+
$(".agent_involved_"+e.chatid).css('margin-right',marg_right+'px');
|
551 |
+
|
552 |
+
if ( ! $( '#agent_grav_'+e.chatid+'_'+e.agentid ).length ) {
|
553 |
+
$('<img/>', {
|
554 |
+
'style': 'max-width:inherit; margin-right:'+marg_right+'px',
|
555 |
+
'id' : 'agent_grav_'+e.chatid+'_'+e.agentid,
|
556 |
+
'title' : agent_involved_name,
|
557 |
+
'alt' : agent_involved_name,
|
558 |
+
'src' : 'https://www.gravatar.com/avatar/'+agent_involved_email+'?s=32&d=identicon',
|
559 |
+
'class' : "img-thumbnail img-circle thumb16 agent_involved agent_involved_"+e.chatid
|
560 |
+
}).appendTo('#'+e.chatid+ " .agents_involved");
|
561 |
+
}
|
562 |
+
}
|
563 |
+
}
|
564 |
+
});
|
565 |
+
/**
|
566 |
+
* Add the involved agent's gravatar to the visitor list, under the CHAT STATUS column
|
567 |
+
*/
|
568 |
+
jQuery(document).on("bleeper_add_agent_involved_visitor_list", function(e) {
|
569 |
+
|
570 |
+
if(typeof wplc_agent_data !== "undefined"){
|
571 |
+
|
572 |
+
|
573 |
+
if(typeof wplc_agent_data[e.agentid] !== "undefined" && typeof wplc_agent_data[e.agentid].md5 !== "undefined" && typeof wplc_agent_data[e.agentid].name !== "undefined"){
|
574 |
+
|
575 |
+
var num_age = $(".agent_involved_"+e.chatid).length;
|
576 |
+
if (num_age > 2) {
|
577 |
+
var marg_right = num_age * -1.5;
|
578 |
+
$(".agent_involved_"+e.chatid).addClass('morethan2');
|
579 |
+
}
|
580 |
+
else {
|
581 |
+
var marg_right = 2;
|
582 |
+
$(".agent_involved_"+e.chatid).removeClass('morethan2');
|
583 |
+
}
|
584 |
+
if (marg_right < -12) { marg_right = 12; }
|
585 |
+
|
586 |
+
agent_involved = wplc_agent_data[e.agentid];
|
587 |
+
agent_involved_email = agent_involved.md5;
|
588 |
+
agent_involved_name = agent_involved.name;
|
589 |
+
$(".agent_involved_"+e.chatid).css('margin-right',marg_right+'px');
|
590 |
+
|
591 |
+
if ( ! $( '#agent_grav_visitor_'+e.chatid+'_'+e.agentid ).length ) {
|
592 |
+
$('<img/>', {
|
593 |
+
'style': 'max-width:inherit; margin-right:'+marg_right+'px',
|
594 |
+
'id' : 'agent_grav_visitor_'+e.chatid+'_'+e.agentid,
|
595 |
+
'title' : agent_involved_name,
|
596 |
+
'alt' : agent_involved_name,
|
597 |
+
'src' : 'https://www.gravatar.com/avatar/'+agent_involved_email+'?s=32&d=identicon',
|
598 |
+
'class' : "img-thumbnail img-circle thumb16 agent_involved agent_involved_"+e.chatid
|
599 |
+
}).appendTo('#vis'+e.chatid+ " .agents_involved_visitor");
|
600 |
+
}
|
601 |
+
}
|
602 |
+
}
|
603 |
+
});
|
604 |
+
jQuery(document).on('bleeper_disconnected', function(e) {
|
605 |
+
if (connection_lost_type == '' || typeof connection_lost_type === "undefined") {
|
606 |
+
jQuery(".nifty_bg_holder_text").html("Connection to the server lost.. please be patient while we try restore the connection...");
|
607 |
+
jQuery(".nifty_bg_holder").fadeIn();
|
608 |
+
jQuery(".nifty_bg_holder").css('left','0');
|
609 |
+
} else if (connection_lost_type === 'offline_status') {
|
610 |
+
jQuery(".nifty_bg_holder_text").html("You are not accepting chats");
|
611 |
+
jQuery(".nifty_bg_holder").fadeIn();
|
612 |
+
jQuery(".nifty_bg_holder").css('left','25%');
|
613 |
+
}
|
614 |
+
});
|
615 |
+
|
616 |
+
|
617 |
+
/**
|
618 |
+
* User has toggled their status
|
619 |
+
*
|
620 |
+
* This will either disconnect the socket connection or re-establish it.
|
621 |
+
*
|
622 |
+
* @return void
|
623 |
+
*/
|
624 |
+
jQuery(document).on("wplc_switchery_changed", function(e) {
|
625 |
+
if (typeof e.ndata !== "undefined" && typeof e.ndata.action !== "undefined" && e.ndata.action === "wplc_choose_not_accepting") {
|
626 |
+
/* drop the connection */
|
627 |
+
if (socket.connected) {
|
628 |
+
socket.disconnect();
|
629 |
+
}
|
630 |
+
} else if (e.ndata.action === "wplc_choose_accepting") {
|
631 |
+
if (typeof socket === "undefined" || socket.connected === false) {
|
632 |
+
socket = io.connect(node_uri, { secure:true, query : query_string } );
|
633 |
+
bleeper_delegates();
|
634 |
+
jQuery(".nifty_bg_holder").fadeOut();
|
635 |
+
|
636 |
+
}
|
637 |
+
}
|
638 |
+
})
|
639 |
+
|
640 |
+
|
641 |
+
/**
|
642 |
+
* Handles the "get chat history" event.
|
643 |
+
*
|
644 |
+
* Attaching an object called "other" to the parent object will allow this object to traverse through all socket events from this point
|
645 |
+
*
|
646 |
+
* Example:
|
647 |
+
* e.ndata.other = {};
|
648 |
+
* e.ndata.other.my_unique_variable = 'This is extra data'
|
649 |
+
*
|
650 |
+
* @return void
|
651 |
+
*/
|
652 |
+
jQuery(document).on("bleeper_send_get_chat_history", function(e) {
|
653 |
+
|
654 |
+
|
655 |
+
socket.emit('get chat history',e.ndata);
|
656 |
+
|
657 |
+
wplc_head_data.aid = agent_id;
|
658 |
+
wplc_head_data.name = wplc_agent_data[agent_id].name;
|
659 |
+
wplc_head_data.email = wplc_agent_data[agent_id].md5;
|
660 |
+
|
661 |
+
//Removing this as we should not be sending the custom header unless the agent is joining the chat
|
662 |
+
//socket.emit('custom data',{action:'send_custom_header',chatid:e.ndata.chatid,agentid:e.ndata.agentid,ndata:wplc_head_data});
|
663 |
+
});
|
664 |
+
|
665 |
+
|
666 |
+
/**
|
667 |
+
* We have received our socketID and instanceID
|
668 |
+
*
|
669 |
+
* @return void
|
670 |
+
*/
|
671 |
+
jQuery(document).on("bleeper_socketid_received", function(e) {
|
672 |
+
jQuery(".online_agent_"+agent_id).attr("socket",e.ndata.socketid);
|
673 |
+
jQuery(".bleeper_instance").html(" <em>[Instance: "+e.ndata.instanceid+"]</em> ");
|
674 |
+
|
675 |
+
|
676 |
+
|
677 |
+
|
678 |
+
|
679 |
+
});
|
680 |
+
|
681 |
+
/**
|
682 |
+
* Chat was ended by another agent, lets handle the events.
|
683 |
+
*
|
684 |
+
* @return void
|
685 |
+
*/
|
686 |
+
jQuery(document).on("bleeper_chat_ended_by_other_agent", function(e) {
|
687 |
+
if (typeof e.ndata !== "undefined" && typeof e.ndata === "object") {
|
688 |
+
|
689 |
+
the_message = wplc_generate_system_notification_object(e.ndata.agent_name+" ended the chat.", {}, 0);
|
690 |
+
|
691 |
+
bleeper_add_message_to_sessionStorage(e.ndata.chatid, the_message);
|
692 |
+
|
693 |
+
if (e.ndata.chatid === active_chatid) {
|
694 |
+
wplc_push_message_to_chatbox(the_message,'a', function() {
|
695 |
+
jQuery.event.trigger({type: "bleeper_scroll_bottom"});
|
696 |
+
});
|
697 |
+
}
|
698 |
+
|
699 |
+
}
|
700 |
+
})
|
701 |
+
|
702 |
+
|
703 |
+
/**
|
704 |
+
* What to do when a visitor has left or a chat has disconnected
|
705 |
+
*
|
706 |
+
* @return void
|
707 |
+
*/
|
708 |
+
jQuery(document).on("bleeper_remove_visitor", function(e) {
|
709 |
+
if (typeof e.ndata !== "undefined" && typeof e.ndata === "object") {
|
710 |
+
|
711 |
+
if (typeof visitor_list[e.ndata.chatid] !== "undefined" && visitor_list[e.ndata.chatid].state === 'active') {
|
712 |
+
the_message = wplc_generate_system_notification_object(e.ndata.username+" may have left (disconnected).", {}, 0);
|
713 |
+
|
714 |
+
bleeper_add_message_to_sessionStorage(e.ndata.chatid, the_message);
|
715 |
+
|
716 |
+
if (e.ndata.chatid === active_chatid) {
|
717 |
+
wplc_push_message_to_chatbox(the_message,'a', function() {
|
718 |
+
jQuery.event.trigger({type: "bleeper_scroll_bottom"});
|
719 |
+
});
|
720 |
+
}
|
721 |
+
}
|
722 |
+
$("#"+e.ndata.chatid).removeClass('active');
|
723 |
+
$("#"+e.ndata.chatid).addClass('inactive');
|
724 |
+
$(".bleeper_close_item_"+e.ndata.chatid).show();
|
725 |
+
$("#vis"+e.ndata.chatid).remove();
|
726 |
+
}
|
727 |
+
|
728 |
+
});
|
729 |
+
|
730 |
+
|
731 |
+
|
732 |
+
/**
|
733 |
+
* Custom data trigger
|
734 |
+
*
|
735 |
+
* If custom data is sent through the socket, this is where you would want to handle it
|
736 |
+
*
|
737 |
+
* @return void
|
738 |
+
*/
|
739 |
+
/*
|
740 |
+
jQuery(document).on("bleeper_custom_data_received", function(e) {
|
741 |
+
if (typeof e.ndata !== "undefined") {
|
742 |
+
|
743 |
+
if (e.ndata.action === "send_user_click_data") {
|
744 |
+
if (typeof e.ndata.ndata.elem_class !== "undefined") { var elem_class = e.ndata.ndata.elem_class; } else { var elem_class = '-'; }
|
745 |
+
if (typeof e.ndata.ndata.elem_id !== "undefined") { var elem_id = e.ndata.ndata.elem_id; } else { var elem_id = '-'; }
|
746 |
+
the_message = wplc_generate_system_notification_object("User clicked on an element (Class: "+elem_class+", ID: "+elem_id+")", {}, 0);
|
747 |
+
wplc_push_message_to_chatbox(the_message,'a', function() {
|
748 |
+
jQuery.event.trigger({type: "bleeper_scroll_bottom"});
|
749 |
+
});
|
750 |
+
|
751 |
+
}
|
752 |
+
|
753 |
+
}
|
754 |
+
});
|
755 |
+
*/
|
756 |
+
|
757 |
+
|
758 |
+
/**
|
759 |
+
* bleeper_online_agent_packet_received
|
760 |
+
*
|
761 |
+
* A packet of information has been received from the socket that contains data about an online agent.
|
762 |
+
*
|
763 |
+
* This is run iteratively from 'the information received' socket event
|
764 |
+
*
|
765 |
+
* @return void
|
766 |
+
*/
|
767 |
+
jQuery(document).on("bleeper_online_agent_packet_received", function(e) {
|
768 |
+
if (typeof e.ndata !== "undefined" && typeof e.ndata === "object") {
|
769 |
+
t_ag_sock = e.ndata.from_socket;
|
770 |
+
t_ag_name = e.ndata.username;
|
771 |
+
t_ag_id = e.ndata.agent_id;
|
772 |
+
|
773 |
+
t_ag_cid = nifty_api_key+''+Math.min(parseInt(agent_id), parseInt(t_ag_id))+''+Math.max(parseInt(agent_id), parseInt(t_ag_id));
|
774 |
+
t_ag_cid = md5(t_ag_cid);
|
775 |
+
|
776 |
+
|
777 |
+
|
778 |
+
$(".online_agent_"+t_ag_id+" .online_offline").removeClass('offline');
|
779 |
+
$(".online_agent_"+t_ag_id+" .online_offline").addClass('online');
|
780 |
+
$(".online_agent_"+t_ag_id+"").attr('socket',t_ag_sock);
|
781 |
+
$(".online_agent_"+t_ag_id+"").attr('id',t_ag_cid);
|
782 |
+
|
783 |
+
/**
|
784 |
+
* Add each agent as an 'involved agent' to the chat ID
|
785 |
+
*/
|
786 |
+
//socket.emit('chat accepted',{chatid: t_ag_cid,agent_id:t_ag_id,agent_name:wplc_agent_data[t_ag_id].name});
|
787 |
+
}
|
788 |
+
});
|
789 |
+
|
790 |
+
});
|
791 |
+
|
792 |
+
/**
|
793 |
+
* Scrolls the chat box to the bottom
|
794 |
+
*
|
795 |
+
*/
|
796 |
+
var wplc_scroll_to_bottom = function() {
|
797 |
+
var height = jQuery('#messages')[0].scrollHeight;
|
798 |
+
jQuery('#messages').scrollTop(height);
|
799 |
+
}
|
800 |
+
|
801 |
+
/**
|
802 |
+
* Recursive Ringer
|
803 |
+
*/
|
804 |
+
function wplc_repeat_new_chat_notification(count){
|
805 |
+
var limit = 5; //Default
|
806 |
+
if(typeof bleeper_ringer_count !== "undefined"){
|
807 |
+
limit = parseInt(bleeper_ringer_count);
|
808 |
+
}
|
809 |
+
|
810 |
+
count ++;
|
811 |
+
if(count <= limit){
|
812 |
+
if(wplc_new_chat_ringer_dismissed !== true){
|
813 |
+
setTimeout(function(){
|
814 |
+
if(wplc_new_chat_ringer_dismissed !== true){
|
815 |
+
wplc_new_chat_notifications();
|
816 |
+
}
|
817 |
+
wplc_repeat_new_chat_notification(count);
|
818 |
+
}, 3000);
|
819 |
+
}
|
820 |
+
} else {
|
821 |
+
wplc_new_chat_ringer_dismissed = true; //Set it to dismissed now
|
822 |
+
}
|
823 |
+
}
|
824 |
+
|
825 |
+
/**
|
826 |
+
* New Chat Notification Controller
|
827 |
+
*/
|
828 |
+
function wplc_new_chat_notifications(){
|
829 |
+
bleeper_ring.play();
|
830 |
+
bleeper_change_favico(bleeper_favico_noti);
|
831 |
+
}
|
832 |
+
|
833 |
+
/**
|
834 |
+
* Desktop notification
|
835 |
+
*/
|
836 |
+
function wplc_desktop_notification() {
|
837 |
+
if (typeof Notification !== 'undefined') {
|
838 |
+
if (!Notification) {
|
839 |
+
return;
|
840 |
+
}
|
841 |
+
if (Notification.permission !== "granted")
|
842 |
+
Notification.requestPermission();
|
843 |
+
|
844 |
+
var wplc_desktop_notification = new Notification(bleeper_new_chat_notification_title, {
|
845 |
+
icon: bleeper_new_chat_notification_icon,
|
846 |
+
body: bleeper_new_chat_notification_text
|
847 |
+
});
|
848 |
+
}
|
849 |
+
}
|
js/wplc_u_events.js
ADDED
@@ -0,0 +1,540 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function() {
|
2 |
+
|
3 |
+
|
4 |
+
|
5 |
+
//placeholder text fix for IE
|
6 |
+
jQuery('#wp-live-chat [placeholder]').focus(function() {
|
7 |
+
var input = jQuery(this);
|
8 |
+
if (input.val() == input.attr('placeholder')) {
|
9 |
+
input.val('');
|
10 |
+
input.removeClass('placeholder');
|
11 |
+
}
|
12 |
+
}).blur(function() {
|
13 |
+
var input = jQuery(this);
|
14 |
+
if (input.val() == '' || input.val() == input.attr('placeholder')) {
|
15 |
+
input.addClass('placeholder');
|
16 |
+
input.val(input.attr('placeholder'));
|
17 |
+
}
|
18 |
+
}).blur();
|
19 |
+
|
20 |
+
|
21 |
+
/* minimize chat window */
|
22 |
+
jQuery("body").on("click", "#wp-live-chat-minimize", function() {
|
23 |
+
|
24 |
+
jQuery.event.trigger({type: "wplc_minimize_chat"});
|
25 |
+
|
26 |
+
|
27 |
+
});
|
28 |
+
|
29 |
+
|
30 |
+
/* close chat window */
|
31 |
+
jQuery("body").on("click", "#wp-live-chat-close", function() {
|
32 |
+
|
33 |
+
jQuery("#wp-live-chat").hide();
|
34 |
+
jQuery("#wp-live-chat-1").hide();
|
35 |
+
jQuery("#wp-live-chat-2").hide();
|
36 |
+
jQuery("#wp-live-chat-3").hide();
|
37 |
+
jQuery("#wp-live-chat-4").hide();
|
38 |
+
jQuery("#wplc_social_holder").hide();
|
39 |
+
jQuery("#nifty_ratings_holder").hide();
|
40 |
+
jQuery("#wp-live-chat-react").hide();
|
41 |
+
jQuery("#wp-live-chat-minimize").hide();
|
42 |
+
if (typeof wplc_hide_chat !== "undefined" && wplc_hide_chat !== "" && wplc_hide_chat !== null) { Cookies.set('wplc_hide', wplc_hide_chat , { expires: 1, path: '/' }); } else {
|
43 |
+
var wplc_expire_date = new Date();
|
44 |
+
var minutes = 2;
|
45 |
+
wplc_expire_date.setTime(wplc_expire_date.getTime() + (minutes * 60 * 1000));
|
46 |
+
Cookies.set('wplc_hide', "yes" , { expires: wplc_expire_date , path: '/' });
|
47 |
+
}
|
48 |
+
var data = {
|
49 |
+
action: 'wplc_user_close_chat',
|
50 |
+
security: wplc_nonce,
|
51 |
+
cid: wplc_cid,
|
52 |
+
status: wplc_chat_status
|
53 |
+
};
|
54 |
+
jQuery.post(wplc_ajaxurl, data, function(response) {
|
55 |
+
|
56 |
+
|
57 |
+
});
|
58 |
+
});
|
59 |
+
|
60 |
+
|
61 |
+
//allows for a class to open chat window now
|
62 |
+
jQuery("body").on("click", ".wp-live-chat-now", function() {
|
63 |
+
open_chat(0);
|
64 |
+
});
|
65 |
+
|
66 |
+
jQuery(document).on("wplc_minimize_chat", function() {
|
67 |
+
wplc_is_minimized = true;
|
68 |
+
|
69 |
+
Cookies.set('wplc_minimize', "yes", { expires: 1, path: '/' });
|
70 |
+
wplc_chat_status = Cookies.get('wplc_chat_status');
|
71 |
+
|
72 |
+
if(typeof wplc_start_chat_pro_custom_fields_filter !== "undefined" && typeof wplc_start_chat_pro_custom_fields_filter === "function"){
|
73 |
+
wplc_extra_data = wplc_start_chat_pro_custom_fields_filter(wplc_extra_data);
|
74 |
+
}
|
75 |
+
|
76 |
+
if(wplc_chat_status != 5 && wplc_chat_status != 10 && wplc_chat_status != 9 && wplc_chat_status != 8){
|
77 |
+
if (wplc_online) {
|
78 |
+
var data = {
|
79 |
+
action: 'wplc_user_minimize_chat',
|
80 |
+
security: wplc_nonce,
|
81 |
+
cid: wplc_cid,
|
82 |
+
wplc_extra_data:wplc_extra_data
|
83 |
+
};
|
84 |
+
|
85 |
+
jQuery.post(wplc_ajaxurl, data, function(response) {
|
86 |
+
|
87 |
+
});
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
if (typeof wplc_enable_ga !== "undefined" && wplc_enable_ga === '1' && wplc_online) {
|
92 |
+
if (typeof ga !== "undefined") {
|
93 |
+
ga('send', {
|
94 |
+
hitType: 'event',
|
95 |
+
eventCategory: 'WP_Live_Chat_Support',
|
96 |
+
eventAction: 'Event',
|
97 |
+
eventLabel: 'Minimize Chat'
|
98 |
+
});
|
99 |
+
}
|
100 |
+
}
|
101 |
+
});
|
102 |
+
jQuery(document).on("wplc_start_chat", function() {
|
103 |
+
if (typeof wplc_enable_ga !== "undefined" && wplc_enable_ga === '1') {
|
104 |
+
if (typeof ga !== "undefined") {
|
105 |
+
ga('send', {
|
106 |
+
hitType: 'event',
|
107 |
+
eventCategory: 'WP_Live_Chat_Support',
|
108 |
+
eventAction: 'Event',
|
109 |
+
eventLabel: 'Start Chat'
|
110 |
+
});
|
111 |
+
}
|
112 |
+
}
|
113 |
+
});
|
114 |
+
jQuery(document).on("wplc_open_chat_1", function() {
|
115 |
+
if (typeof wplc_enable_ga !== "undefined" && wplc_enable_ga === '1') {
|
116 |
+
if (typeof ga !== "undefined") {
|
117 |
+
ga('send', {
|
118 |
+
hitType: 'event',
|
119 |
+
eventCategory: 'WP_Live_Chat_Support',
|
120 |
+
eventAction: 'Event',
|
121 |
+
eventLabel: 'Start Chat - Step 1'
|
122 |
+
});
|
123 |
+
}
|
124 |
+
}
|
125 |
+
});
|
126 |
+
jQuery(document).on("wplc_open_chat_2", function() {
|
127 |
+
if (typeof wplc_enable_ga !== "undefined" && wplc_enable_ga === '1') {
|
128 |
+
if (typeof ga !== "undefined") {
|
129 |
+
ga('send', {
|
130 |
+
hitType: 'event',
|
131 |
+
eventCategory: 'WP_Live_Chat_Support',
|
132 |
+
eventAction: 'Event',
|
133 |
+
eventLabel: 'Start Chat - Step 2'
|
134 |
+
});
|
135 |
+
}
|
136 |
+
}
|
137 |
+
});
|
138 |
+
|
139 |
+
jQuery(document).on("wplc_agent_joined", function(e) {
|
140 |
+
var temail = '';
|
141 |
+
var tname = '';
|
142 |
+
var taid = '';
|
143 |
+
var ta_tagline = '';
|
144 |
+
var ta_bio = '';
|
145 |
+
var ta_social_links = '';
|
146 |
+
|
147 |
+
if (typeof e.ndata.other.email !== "undefined") { temail = e.ndata.other.email; }
|
148 |
+
if (typeof e.ndata.other.name !== "undefined") { tname = e.ndata.other.name; }
|
149 |
+
if (typeof e.ndata.other.aid !== "undefined") { taid = e.ndata.other.aid; }
|
150 |
+
if (typeof e.ndata.other.agent_tagline !== "undefined") { ta_tagline = e.ndata.other.agent_tagline; }
|
151 |
+
if (typeof e.ndata.other.agent_bio !== "undefined") { ta_bio = e.ndata.other.agent_bio; }
|
152 |
+
if (typeof e.ndata.other.social_links !== "undefined") { ta_social_links = e.ndata.other.social_links; }
|
153 |
+
wplc_current_agent = e.ndata.other;
|
154 |
+
|
155 |
+
jQuery(".wplc_no_answer").remove();
|
156 |
+
|
157 |
+
jQuery(".admin_chat_name").html(tname);
|
158 |
+
wplc_node_pair_name = tname;
|
159 |
+
wplc_agent_name = tname;
|
160 |
+
});
|
161 |
+
|
162 |
+
|
163 |
+
jQuery("body").on("click", "#wplc_start_chat_btn", function() {
|
164 |
+
var wplc_name = jQuery("#wplc_name").val();
|
165 |
+
var wplc_email = jQuery("#wplc_email").val();
|
166 |
+
|
167 |
+
if (wplc_name.length <= 0) { alert(wplc_error_messages.valid_name); return false; }
|
168 |
+
if (wplc_email.length <= 0) { alert(wplc_error_messages.valid_email); return false; }
|
169 |
+
|
170 |
+
if(jQuery("#wplc_email").attr('wplc_hide') !== "1"){
|
171 |
+
var testEmail = /^[A-Z0-9._%+-]+@([A-Z0-9-]+\.)+[A-Z]{2,12}$/i;
|
172 |
+
|
173 |
+
//var testEmail = /^[A-Z0-9._%+-]+@([A-Z0-9-]+\.)+[A-Z]{2,4}$/i;
|
174 |
+
if (!testEmail.test(wplc_email)){
|
175 |
+
alert(wplc_error_messages.valid_email); return false;
|
176 |
+
}
|
177 |
+
}
|
178 |
+
document.getElementById('wplc_chatmsg').disabled = false;
|
179 |
+
|
180 |
+
/* start the long polling */
|
181 |
+
wplc_run = true;
|
182 |
+
|
183 |
+
wplc_send_welcome_message();
|
184 |
+
wplc_scroll_to_bottom();
|
185 |
+
|
186 |
+
/*
|
187 |
+
if (wplc_filter_run_override === "1" || wplc_online === false) { } else {
|
188 |
+
initial_data.status = 2;
|
189 |
+
// force the loop to start only now, as we are not using the initiate extension
|
190 |
+
wplc_call_to_server_chat(initial_data,false,false);
|
191 |
+
}*/
|
192 |
+
|
193 |
+
jQuery.event.trigger({type: "wplc_start_chat"});
|
194 |
+
|
195 |
+
|
196 |
+
var date = new Date();
|
197 |
+
date.setTime(date.getTime() + (2 * 60 * 1000));
|
198 |
+
|
199 |
+
wplc_cid = Cookies.get('wplc_cid');
|
200 |
+
|
201 |
+
if(typeof wplc_start_chat_pro_custom_fields_filter !== "undefined" && typeof wplc_start_chat_pro_custom_fields_filter === "function"){
|
202 |
+
wplc_extra_data = wplc_start_chat_pro_custom_fields_filter(wplc_extra_data);
|
203 |
+
}
|
204 |
+
|
205 |
+
if (typeof wplc_cid !== "undefined" && wplc_cid !== null) {
|
206 |
+
/* we've already recorded a cookie for this person */
|
207 |
+
var data = {
|
208 |
+
action: 'wplc_start_chat',
|
209 |
+
security: wplc_nonce,
|
210 |
+
name: wplc_name,
|
211 |
+
email: wplc_email,
|
212 |
+
cid: wplc_cid,
|
213 |
+
wplcsession: wplc_session_variable,
|
214 |
+
wplc_extra_data:wplc_extra_data
|
215 |
+
};
|
216 |
+
|
217 |
+
if(typeof wplc_start_chat_pro_data !== "undefined" && typeof wplc_start_chat_pro_data === "function"){
|
218 |
+
data = wplc_start_chat_pro_data(data);
|
219 |
+
}
|
220 |
+
} else { // no cookie recorded yet for this visitor
|
221 |
+
var data = {
|
222 |
+
action: 'wplc_start_chat',
|
223 |
+
security: wplc_nonce,
|
224 |
+
name: wplc_name,
|
225 |
+
email: wplc_email,
|
226 |
+
wplcsession: wplc_session_variable,
|
227 |
+
wplc_extra_data:wplc_extra_data
|
228 |
+
};
|
229 |
+
|
230 |
+
if(typeof wplc_start_chat_pro_data !== "undefined" && typeof wplc_start_chat_pro_data === "function"){
|
231 |
+
data = wplc_start_chat_pro_data(data);
|
232 |
+
}
|
233 |
+
}
|
234 |
+
|
235 |
+
Cookies.set('wplc_name', wplc_name, { path: '/' } );
|
236 |
+
Cookies.set('wplc_email', wplc_email, { path: '/' } );
|
237 |
+
|
238 |
+
wplc_server.send(wplc_ajaxurl, data, "POST", 120000,
|
239 |
+
function(response){
|
240 |
+
wplc_chat_status = 2;
|
241 |
+
Cookies.set('wplc_chat_status', 2, { expires: date, path: '/' });
|
242 |
+
wplc_cid = jQuery.trim(response);
|
243 |
+
|
244 |
+
//All sorted, let's check for message transport mode
|
245 |
+
wplc_server.prepareTransport(function(){
|
246 |
+
//Transport ready...
|
247 |
+
wplc_server_last_loop_data.status = 2; //Set to waiting
|
248 |
+
if (wplc_filter_run_override === "1" || wplc_online === false) { } else {
|
249 |
+
wplc_call_to_server_chat(wplc_server_last_loop_data);
|
250 |
+
}
|
251 |
+
}, wplc_user_message_receiver, wplc_user_retry_handler, wplc_log_connection_error);
|
252 |
+
},
|
253 |
+
function(){
|
254 |
+
//Fails
|
255 |
+
},
|
256 |
+
function(response, wplc_send_data){
|
257 |
+
//Complete
|
258 |
+
if (typeof wplc_send_data !== "undefined" && typeof wplc_send_data['action'] !== "undefined" && wplc_send_data['action'] == 'wplc_start_chat') {
|
259 |
+
/* we got here because the short poll (when disabling the initiate chat feature) comes back on the "complete" callback. This check makes sure we restart the longpoll */
|
260 |
+
wplc_chat_status = 2;
|
261 |
+
Cookies.set('wplc_chat_status', 2, { expires: date, path: '/' });
|
262 |
+
wplc_cid = jQuery.trim(response);
|
263 |
+
|
264 |
+
//All sorted, let's check for message transport mode
|
265 |
+
wplc_server.prepareTransport(function(){
|
266 |
+
//Transport ready...
|
267 |
+
wplc_server_last_loop_data.status = 2; //Set to waiting
|
268 |
+
if (wplc_filter_run_override === "1" || wplc_online === false) { } else {
|
269 |
+
wplc_call_to_server_chat(wplc_server_last_loop_data);
|
270 |
+
}
|
271 |
+
}, wplc_user_message_receiver, wplc_user_retry_handler, wplc_log_connection_error);
|
272 |
+
}
|
273 |
+
|
274 |
+
}
|
275 |
+
);
|
276 |
+
});
|
277 |
+
|
278 |
+
|
279 |
+
|
280 |
+
|
281 |
+
|
282 |
+
|
283 |
+
|
284 |
+
jQuery("body").on("keyup","#wplc_chatmsg", function(event){
|
285 |
+
if(event.keyCode === 13){
|
286 |
+
jQuery("#wplc_send_msg").trigger("click");
|
287 |
+
}
|
288 |
+
});
|
289 |
+
jQuery("body").on("click", "#wplc_send_msg", function() {
|
290 |
+
var wplc_cid = jQuery("#wplc_cid").val();
|
291 |
+
if (wplc_cid.length < 1) {
|
292 |
+
/* failover for wplc_cid */
|
293 |
+
var wplc_cid = Cookies.get('wplc_cid');
|
294 |
+
}
|
295 |
+
var wplc_chat = wplc_strip(document.getElementById('wplc_chatmsg').value);
|
296 |
+
|
297 |
+
if(wplc_chat !== ""){
|
298 |
+
var wplc_name = jQuery("#wplc_name").val();
|
299 |
+
if (typeof wplc_name == "undefined" || wplc_name == null || wplc_name == "") {
|
300 |
+
wplc_name = Cookies.get('wplc_name');
|
301 |
+
}
|
302 |
+
if (typeof wplc_name == "undefined") {
|
303 |
+
wplc_name = 'Guest';
|
304 |
+
}
|
305 |
+
|
306 |
+
var wplc_email = jQuery("#wplc_email").val();
|
307 |
+
if (typeof wplc_email == "undefined" || wplc_email == null || wplc_email == "") {
|
308 |
+
wplc_email = Cookies.get('wplc_email');
|
309 |
+
}
|
310 |
+
if (typeof wplc_email == "undefined") {
|
311 |
+
wplc_email = '';
|
312 |
+
}
|
313 |
+
|
314 |
+
|
315 |
+
|
316 |
+
|
317 |
+
/*Nifty format Parse*/
|
318 |
+
var wplc_chat_parsed = wplc_chat;
|
319 |
+
|
320 |
+
//if(typeof niftyFormatParser !== "undefined"){
|
321 |
+
// wplc_chat_parsed = niftyFormatParser(wplc_chat_parsed);
|
322 |
+
//}
|
323 |
+
|
324 |
+
if( typeof wplc_display_name !== 'undefined' ){
|
325 |
+
/**
|
326 |
+
* We're still using the old options
|
327 |
+
*/
|
328 |
+
if(wplc_display_name == 'display'){
|
329 |
+
if (wplc_gravatar_image.length > 1) {
|
330 |
+
jQuery("#wplc_chatbox").append("<span class='wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1'>"+wplc_gravatar_image+" <strong>"+wplc_name+"</strong>: "+wplc_chat_parsed+"</span><br /><div class='wplc-clear-float-message'></div>");
|
331 |
+
} else {
|
332 |
+
jQuery("#wplc_chatbox").append("<span class='wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1'><img src='//www.gravatar.com/avatar/"+md5(wplc_email)+"?s=30' class='wplc-user-message-avatar' \/> <strong>"+wplc_name+"</strong>: "+wplc_chat_parsed+"</span><br /><div class='wplc-clear-float-message'></div>");
|
333 |
+
}
|
334 |
+
} else {
|
335 |
+
jQuery("#wplc_chatbox").append("<span class='wplc-user-message wplc-color-bg-1 wplc-color-2 wplc-color-border-1'>"+wplc_chat_parsed+"</span><div class='wplc-clear-float-message'></div>");
|
336 |
+
}
|
337 |
+
} else {
|
338 |
+
the_message = {};
|
339 |
+
the_message.originates = 2;
|
340 |
+
the_message.msg = wplc_chat_parsed;
|
341 |
+
the_message.other = {};
|
342 |
+
var wplc_d = new Date();
|
343 |
+
the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
|
344 |
+
wplc_push_message_to_chatbox(the_message,'u', function() {
|
345 |
+
wplc_scroll_to_bottom();
|
346 |
+
});
|
347 |
+
|
348 |
+
|
349 |
+
}
|
350 |
+
|
351 |
+
wplc_scroll_to_bottom();
|
352 |
+
|
353 |
+
|
354 |
+
var data = {
|
355 |
+
action: 'wplc_user_send_msg',
|
356 |
+
security: wplc_nonce,
|
357 |
+
cid: wplc_cid,
|
358 |
+
msg: wplc_chat_parsed,
|
359 |
+
wplc_extra_data:wplc_extra_data
|
360 |
+
};
|
361 |
+
|
362 |
+
wplc_server.sendMessage(wplc_ajaxurl, data, "POST", 120000,
|
363 |
+
function(){
|
364 |
+
//Success
|
365 |
+
wplc_server.asyncStorage(wplc_ajaxurl, data, 120000);
|
366 |
+
}, function(){
|
367 |
+
//Fail
|
368 |
+
}, function(){
|
369 |
+
//Complete
|
370 |
+
}
|
371 |
+
);
|
372 |
+
|
373 |
+
if (typeof wplc_enable_ga !== "undefined" && wplc_enable_ga === '1') {
|
374 |
+
if (typeof ga !== "undefined") {
|
375 |
+
ga('send', {
|
376 |
+
hitType: 'event',
|
377 |
+
eventCategory: 'WP_Live_Chat_Support',
|
378 |
+
eventAction: 'Event',
|
379 |
+
eventLabel: 'User Send Message'
|
380 |
+
});
|
381 |
+
}
|
382 |
+
}
|
383 |
+
}
|
384 |
+
|
385 |
+
jQuery("#wplc_chatmsg").val('');
|
386 |
+
|
387 |
+
|
388 |
+
});
|
389 |
+
|
390 |
+
jQuery(document).on("wplc_open_chat", function (event) {
|
391 |
+
/* what is the current status? */
|
392 |
+
wplc_chat_status = Cookies.get('wplc_chat_status');
|
393 |
+
if( typeof wplc_chat_status === 'undefined' ){
|
394 |
+
Cookies.set('wplc_chat_status', 5, { expires: 1, path: '/' });
|
395 |
+
}
|
396 |
+
var wplc_tmp_checker = wplc_pre_open_check_status(status, function() {
|
397 |
+
open_chat();
|
398 |
+
});
|
399 |
+
});
|
400 |
+
|
401 |
+
jQuery(document).on("wplc_end_chat", function(){
|
402 |
+
/* Clear Cookies */
|
403 |
+
Cookies.remove('wplc_chat_status');
|
404 |
+
Cookies.remove('wplc_cid');
|
405 |
+
//Cookies.remove('wplc_name');
|
406 |
+
//Cookies.remove('wplc_email');
|
407 |
+
|
408 |
+
/* Close ports if applicable*/
|
409 |
+
wplc_server.forceClosePort();
|
410 |
+
|
411 |
+
/* Check if we should redirect */
|
412 |
+
if(typeof wplc_redirect_thank_you !== "undefined" && wplc_redirect_thank_you !== null && wplc_redirect_thank_you !== ""){
|
413 |
+
window.location = wplc_redirect_thank_you;
|
414 |
+
}
|
415 |
+
});
|
416 |
+
|
417 |
+
function wplc_pre_open_check_status(status, callback) {
|
418 |
+
if (typeof wplc_chat_status !== 'undefined' && ( typeof wplc_chat_status.length !== 'undefined' && wplc_chat_status.length > 0 ) ) {
|
419 |
+
if (parseInt(wplc_chat_status) === 10 || parseInt(wplc_chat_status) === 7) {
|
420 |
+
/* it was minimized or timedout, now we need to open it - set status to 3 (back to open chat) */
|
421 |
+
Cookies.set('wplc_chat_status', 3, { expires: 1, path: '/' });
|
422 |
+
|
423 |
+
}
|
424 |
+
if (parseInt(wplc_chat_status) === 0 || parseInt(wplc_chat_status) === 12) {
|
425 |
+
/* no answer from agent previously */
|
426 |
+
// Cookies.set('wplc_chat_status', 5, { expires: 1, path: '/' });
|
427 |
+
}
|
428 |
+
if (parseInt(wplc_chat_status) === 8) {
|
429 |
+
/* no answer from agent previously */
|
430 |
+
cnonsole.log("now setting it to 5");
|
431 |
+
Cookies.set('wplc_chat_status', 5, { expires: 1, path: '/' });
|
432 |
+
}
|
433 |
+
|
434 |
+
}
|
435 |
+
callback();
|
436 |
+
}
|
437 |
+
|
438 |
+
if(typeof wplc_elem_trigger_id !== "undefined" && wplc_elem_trigger_id !== ""){
|
439 |
+
var wplc_click_or_hover = 0;
|
440 |
+
var wplc_class_or_id = 0;
|
441 |
+
|
442 |
+
if(typeof wplc_elem_trigger_action !== "undefined" && wplc_elem_trigger_action !== ""){ wplc_click_or_hover = parseInt(wplc_elem_trigger_action); }
|
443 |
+
if(typeof wplc_elem_trigger_type !== "undefined" && wplc_elem_trigger_type !== ""){ wplc_class_or_id = parseInt(wplc_elem_trigger_type); }
|
444 |
+
|
445 |
+
jQuery( (wplc_class_or_id === 1 ? "#" : ".") + wplc_elem_trigger_id).on( (wplc_click_or_hover === 1 ? "mouseenter" : "click"), function(){
|
446 |
+
open_chat(0);
|
447 |
+
});
|
448 |
+
}
|
449 |
+
|
450 |
+
});
|
451 |
+
|
452 |
+
|
453 |
+
//open chat window function
|
454 |
+
|
455 |
+
function open_chat(force){
|
456 |
+
jQuery.event.trigger({type: "wplc_open_chat_1"});
|
457 |
+
|
458 |
+
|
459 |
+
|
460 |
+
wplc_chat_status = Cookies.get('wplc_chat_status');
|
461 |
+
|
462 |
+
/**
|
463 |
+
* double check we have a cookie. If not, set to 5 so that the chat box can atleast restart
|
464 |
+
* https://github.com/CodeCabin/wp-live-chat-support/issues/313
|
465 |
+
*/
|
466 |
+
if( wplc_chat_status == null || wplc_chat_status == 'null' ){
|
467 |
+
Cookies.set('wplc_chat_status', 5, { expires: 1, path: '/' });
|
468 |
+
wplc_chat_status = 5;
|
469 |
+
}
|
470 |
+
|
471 |
+
|
472 |
+
if (parseInt(wplc_chat_status) == 3 || parseInt(wplc_chat_status) == 2 || parseInt(wplc_chat_status) == 0 || parseInt(wplc_chat_status) == 12) {
|
473 |
+
|
474 |
+
jQuery.event.trigger({type: "wplc_open_chat_2", wplc_online: wplc_online});
|
475 |
+
|
476 |
+
Cookies.set('wplc_had_chat', true, { path: '/' });
|
477 |
+
|
478 |
+
|
479 |
+
wplc_send_welcome_message();
|
480 |
+
|
481 |
+
if (parseInt(wplc_chat_status) == 0 || parseInt( wplc_chat_status ) == 11 || parseInt(wplc_chat_status) == 12) {
|
482 |
+
/* user was a missed chat, now lets change them back to "pending" */
|
483 |
+
wplc_chat_status = 2;
|
484 |
+
}
|
485 |
+
if(typeof wplc_start_chat_pro_custom_fields_filter !== "undefined" && typeof wplc_start_chat_pro_custom_fields_filter === "function"){
|
486 |
+
wplc_extra_data = wplc_start_chat_pro_custom_fields_filter(wplc_extra_data);
|
487 |
+
}
|
488 |
+
|
489 |
+
if (wplc_online) {
|
490 |
+
var data = {
|
491 |
+
action: 'wplc_user_maximize_chat',
|
492 |
+
security: wplc_nonce,
|
493 |
+
cid: wplc_cid,
|
494 |
+
chat_status : parseInt(wplc_chat_status),
|
495 |
+
wplc_extra_data:wplc_extra_data
|
496 |
+
};
|
497 |
+
jQuery.post(wplc_ajaxurl, data, function(response) {
|
498 |
+
|
499 |
+
//log("user maximized chat success");
|
500 |
+
});
|
501 |
+
}
|
502 |
+
|
503 |
+
}
|
504 |
+
else if (parseInt(wplc_chat_status) == 10) {
|
505 |
+
jQuery("#wp-live-chat-minimize").trigger("click");
|
506 |
+
|
507 |
+
}
|
508 |
+
|
509 |
+
else if (wplc_chat_status == 5 || wplc_chat_status == 9 || wplc_chat_status == 8){
|
510 |
+
if(jQuery("#wp-live-chat-2").is(":visible") === false && jQuery("#wp-live-chat-4").is(":visible") === false){
|
511 |
+
jQuery("#wp-live-chat-2").show();
|
512 |
+
jQuery("#wp-live-chat-2-inner").show();
|
513 |
+
var wplc_visitor_name = Cookies.get('wplc_name');
|
514 |
+
if(Cookies.get('wplc_email') !== "no email set" && typeof wplc_visitor_name !== "undefined"){
|
515 |
+
jQuery("#wplc_name").val(Cookies.get('wplc_name'));
|
516 |
+
jQuery("#wplc_email").val(Cookies.get('wplc_email'));
|
517 |
+
}
|
518 |
+
jQuery("#wp-live-chat-header").addClass("active");
|
519 |
+
}
|
520 |
+
}
|
521 |
+
/*else if (wplc_chat_status == 2){
|
522 |
+
jQuery("#wp-live-chat-3").show();
|
523 |
+
} */
|
524 |
+
else if(wplc_chat_status == 1){
|
525 |
+
jQuery("#wp-live-chat-4").show();
|
526 |
+
jQuery("#wplc_social_holder").show();
|
527 |
+
jQuery("#nifty_ratings_holder").show();
|
528 |
+
jQuery.event.trigger({type: "wplc_animation_done"});
|
529 |
+
jQuery("#wplc_chatbox").append(wplc_error_messages.chat_ended_by_operator+"<br />");
|
530 |
+
wplc_scroll_to_bottom();
|
531 |
+
jQuery("#wp-live-chat-minimize").hide();
|
532 |
+
document.getElementById('wplc_chatmsg').disabled = true;
|
533 |
+
}
|
534 |
+
|
535 |
+
wplc_is_chat_open = true;
|
536 |
+
|
537 |
+
|
538 |
+
|
539 |
+
|
540 |
+
}
|
js/wplc_u_node_events.js
ADDED
@@ -0,0 +1,410 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
/**
|
3 |
+
* Create an object so that we can track if we've displayed 'agent has joined' notices
|
4 |
+
* @type {Object}
|
5 |
+
*/
|
6 |
+
var agent_joined = {};
|
7 |
+
|
8 |
+
|
9 |
+
/**
|
10 |
+
* This disables the MongoDB storage engine on the Node server
|
11 |
+
* @type {Boolean}
|
12 |
+
*/
|
13 |
+
var bleeper_disable_mongo = true;
|
14 |
+
|
15 |
+
jQuery(document).ready(function() {
|
16 |
+
bleeper_disable_mongo = true;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Set the bleeper override settings
|
20 |
+
*/
|
21 |
+
bleeper_disable_add_message = true;
|
22 |
+
|
23 |
+
|
24 |
+
jQuery(document).on("wplc_open_chat", function(e) {
|
25 |
+
jQuery("#bleeper_chat_ended").html('').hide();
|
26 |
+
nc_status = Cookies.get("nc_status");
|
27 |
+
if (typeof nc_status === "undefined" || nc_status === "browsing") {
|
28 |
+
/* show the part that requests name, email and department, etc */
|
29 |
+
jQuery("#wp-live-chat-2").show();
|
30 |
+
jQuery("#wp-live-chat-2-inner").show();
|
31 |
+
var wplc_visitor_name = Cookies.get('wplc_name');
|
32 |
+
if(Cookies.get('wplc_email') !== "no email set" && typeof wplc_visitor_name !== "undefined"){
|
33 |
+
jQuery("#wplc_name").val(Cookies.get('wplc_name'));
|
34 |
+
jQuery("#wplc_email").val(Cookies.get('wplc_email'));
|
35 |
+
}
|
36 |
+
jQuery("#wp-live-chat-header").addClass("active");
|
37 |
+
} else if (nc_status === "active") {
|
38 |
+
/* go straight into chat */
|
39 |
+
jQuery.event.trigger({type: "wplc_open_chat_2", wplc_online: wplc_online});
|
40 |
+
|
41 |
+
|
42 |
+
}
|
43 |
+
|
44 |
+
});
|
45 |
+
|
46 |
+
//Chat Notification
|
47 |
+
jQuery(document).on("bleeper_user_chat_notification", function(e){
|
48 |
+
if(typeof e.ndata !== "undefined"){
|
49 |
+
if(typeof e.ndata.chatid !== "undefined" && typeof e.ndata.notification_text !== "undefined"){
|
50 |
+
if(e.ndata.chatid === wplc_cid){
|
51 |
+
the_message = {};
|
52 |
+
the_message.msg = e.ndata.notification_text;
|
53 |
+
the_message.originates = 0;
|
54 |
+
the_message.other = {};
|
55 |
+
wplc_push_message_to_chatbox(the_message, "u", function(){
|
56 |
+
});
|
57 |
+
}
|
58 |
+
}
|
59 |
+
}
|
60 |
+
});
|
61 |
+
|
62 |
+
jQuery(document).on("bleeper_socket_connected", function(e) {
|
63 |
+
if (e.status === "active") {
|
64 |
+
jQuery.event.trigger({type: "wplc_open_chat_2", wplc_online: wplc_online});
|
65 |
+
}
|
66 |
+
});
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Handle the disconnect notice
|
70 |
+
*
|
71 |
+
* @return void
|
72 |
+
*/
|
73 |
+
jQuery(document).on("bleeper_disconnected", function() {
|
74 |
+
if(typeof wplc_error_messages !== "undefined" && typeof wplc_error_messages['disconnected_message'] !== "undefined"){
|
75 |
+
var the_message = wplc_generate_system_notification_object(wplc_error_messages['disconnected_message'], {}, 0);
|
76 |
+
wplc_push_message_to_chatbox(the_message,'u', function() {
|
77 |
+
wplc_scroll_to_bottom();
|
78 |
+
});
|
79 |
+
}
|
80 |
+
});
|
81 |
+
|
82 |
+
jQuery(document).on("nifty_trigger_open_chat_2", function( e ) {
|
83 |
+
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
+
});
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Get chat messages from WP storage once the chat box init has been completed.
|
91 |
+
*
|
92 |
+
*/
|
93 |
+
jQuery(document).on("wplc_init_complete", function(e) {
|
94 |
+
if (wplc_online && Cookies.get('bleeper_received_msg') === "true") {
|
95 |
+
var data = {
|
96 |
+
relay_action: 'wplc_get_messages',
|
97 |
+
security: wplc_nonce,
|
98 |
+
chat_id: wplc_cid,
|
99 |
+
limit:50,
|
100 |
+
offset:0,
|
101 |
+
received_via: 'u',
|
102 |
+
wplc_extra_data:wplc_extra_data
|
103 |
+
};
|
104 |
+
wplc_rest_api('get_messages', data, 12000, function(message_history) {
|
105 |
+
if (typeof message_history.data !== "undefined" && typeof message_history.data.messages !== "undefined" && typeof message_history.data.messages === "object") {
|
106 |
+
message_history = message_history.data.messages;
|
107 |
+
for (var key in message_history) {
|
108 |
+
var the_message = message_history[key];
|
109 |
+
the_message.mid = key;
|
110 |
+
wplc_push_message_to_chatbox(the_message,'u', function() {
|
111 |
+
wplc_scroll_to_bottom();
|
112 |
+
});
|
113 |
+
}
|
114 |
+
}
|
115 |
+
});
|
116 |
+
}
|
117 |
+
|
118 |
+
var wplc_node_status_from_cookie = Cookies.get("nc_status");
|
119 |
+
if(typeof wplc_node_status_from_cookie !== "undefined" && wplc_node_status_from_cookie === "active"){
|
120 |
+
if(typeof wplc_cbox_animation !== "undefined"){
|
121 |
+
wplc_cbox_animation();
|
122 |
+
}
|
123 |
+
}
|
124 |
+
|
125 |
+
});
|
126 |
+
|
127 |
+
/**
|
128 |
+
* New message received from socket, add it to the DOM
|
129 |
+
* @return void
|
130 |
+
*/
|
131 |
+
jQuery(document).on("bleeper_new_message", function(e) {
|
132 |
+
|
133 |
+
/**
|
134 |
+
* set the bleeper_received_msg = true so that we can know when to /get_messages in the future
|
135 |
+
*/
|
136 |
+
Cookies.set('bleeper_received_msg', true, { expires: 1, path: '/' });
|
137 |
+
|
138 |
+
if (typeof e.ndata === "object") {
|
139 |
+
if (typeof e.ndata.message === "undefined") { e.ndata.message = ''; }
|
140 |
+
|
141 |
+
the_message = {};
|
142 |
+
the_message.other = {};
|
143 |
+
|
144 |
+
if (e.ndata.aoru === 'u') {
|
145 |
+
the_message.originates = 2;
|
146 |
+
} else {
|
147 |
+
the_message.originates = 1;
|
148 |
+
the_message.other.aid = e.ndata.aoru;
|
149 |
+
|
150 |
+
}
|
151 |
+
|
152 |
+
the_message.msg = wplc_strip(e.ndata.message);
|
153 |
+
the_message.mid = e.ndata.msgID;
|
154 |
+
|
155 |
+
var wplc_d = new Date();
|
156 |
+
the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
|
157 |
+
wplc_push_message_to_chatbox(the_message,'u', function() {
|
158 |
+
wplc_scroll_to_bottom();
|
159 |
+
});
|
160 |
+
}
|
161 |
+
});
|
162 |
+
|
163 |
+
|
164 |
+
|
165 |
+
jQuery(document).on("bleeper_send_message", function(e) {
|
166 |
+
var wplc_chat = wplc_strip(e.message);
|
167 |
+
|
168 |
+
/*
|
169 |
+
the_message = {};
|
170 |
+
the_message.originates = 2;
|
171 |
+
the_message.msg = wplc_chat;
|
172 |
+
the_message.other = {};
|
173 |
+
var wplc_d = new Date();
|
174 |
+
the_message.other.datetime = Math.round( wplc_d.getTime() / 1000 );
|
175 |
+
wplc_push_message_to_chatbox(the_message,'u', function() {
|
176 |
+
wplc_scroll_to_bottom();
|
177 |
+
});
|
178 |
+
*/
|
179 |
+
var data = {
|
180 |
+
relay_action: 'wplc_user_send_msg',
|
181 |
+
security: wplc_nonce,
|
182 |
+
chat_id: wplc_cid,
|
183 |
+
message: wplc_chat,
|
184 |
+
msg_id: e.msg_id,
|
185 |
+
wplc_extra_data:wplc_extra_data
|
186 |
+
};
|
187 |
+
wplc_rest_api('send_message', data, 12000, null);
|
188 |
+
|
189 |
+
|
190 |
+
|
191 |
+
|
192 |
+
jQuery("#wplc_chatmsg").val('');
|
193 |
+
|
194 |
+
|
195 |
+
|
196 |
+
});
|
197 |
+
|
198 |
+
|
199 |
+
/**
|
200 |
+
* Handle the chat history object returned from the socket
|
201 |
+
*
|
202 |
+
* @return void
|
203 |
+
*/
|
204 |
+
jQuery(document).on("bleeper_chat_history", function(e) {
|
205 |
+
if (typeof e.ndata !== "undefined" && e.ndata !== null) {
|
206 |
+
|
207 |
+
}
|
208 |
+
});
|
209 |
+
|
210 |
+
/**
|
211 |
+
* Handle the agent joined event
|
212 |
+
*
|
213 |
+
* @return void
|
214 |
+
*/
|
215 |
+
jQuery(document).on("bleeper_agent_joined", function(e) {
|
216 |
+
if (typeof e.ndata !== "undefined" && typeof e.ndata === "object") {
|
217 |
+
if (typeof agent_joined[parseInt(e.ndata.agent)] === "undefined") {
|
218 |
+
the_message = wplc_generate_system_notification_object(e.ndata.agent_name+" has joined.", {}, 0);
|
219 |
+
wplc_push_message_to_chatbox(the_message,'u', function() {
|
220 |
+
wplc_scroll_to_bottom();
|
221 |
+
});
|
222 |
+
agent_joined[parseInt(e.ndata.agent)] = true;
|
223 |
+
}
|
224 |
+
|
225 |
+
}
|
226 |
+
});
|
227 |
+
|
228 |
+
/**
|
229 |
+
* Handle the agent left event
|
230 |
+
*
|
231 |
+
* @return void
|
232 |
+
*/
|
233 |
+
jQuery(document).on("bleeper_agent_left", function(e) {
|
234 |
+
if (typeof e.ndata !== "undefined" && typeof e.ndata === "object") {
|
235 |
+
the_message = wplc_generate_system_notification_object(e.ndata.agent_name+" has left.", {}, 0);
|
236 |
+
if (typeof agent_joined[parseInt(e.ndata.agent)] !== "undefined" && agent_joined[parseInt(e.ndata.agent)] === true) {
|
237 |
+
agent_joined[parseInt(e.ndata.agent)] = undefined;
|
238 |
+
wplc_push_message_to_chatbox(the_message,'u', function() {
|
239 |
+
wplc_scroll_to_bottom();
|
240 |
+
});
|
241 |
+
}
|
242 |
+
|
243 |
+
}
|
244 |
+
});
|
245 |
+
|
246 |
+
|
247 |
+
jQuery(document).on("bleeper_chat_ended_notification", function(e) {
|
248 |
+
if (typeof e.ndata !== "undefined" && typeof e.ndata === "object") {
|
249 |
+
the_message = wplc_generate_system_notification_object(e.ndata.agent_name+" has ended the chat.", {}, 0);
|
250 |
+
wplc_push_message_to_chatbox(the_message,'u', function() {
|
251 |
+
wplc_scroll_to_bottom();
|
252 |
+
});
|
253 |
+
}
|
254 |
+
|
255 |
+
if(typeof wplc_redirect_thank_you !== "undefined" && wplc_redirect_thank_you !== null && wplc_redirect_thank_you !== ""){
|
256 |
+
window.location = wplc_redirect_thank_you;
|
257 |
+
}
|
258 |
+
|
259 |
+
});
|
260 |
+
|
261 |
+
/**
|
262 |
+
* Handle the agent disconnected event
|
263 |
+
*
|
264 |
+
* @return void
|
265 |
+
*/
|
266 |
+
jQuery(document).on("bleeper_agent_disconnected", function(e) {
|
267 |
+
the_message = wplc_generate_system_notification_object(e.ndata.agent_name+" has disconnected.", {}, 0);
|
268 |
+
if (typeof agent_joined[parseInt(e.ndata.aid)] !== "undefined" && agent_joined[parseInt(e.ndata.aid)] === true) {
|
269 |
+
agent_joined[parseInt(e.ndata.aid)] = undefined;
|
270 |
+
wplc_push_message_to_chatbox(the_message,'u', function() {
|
271 |
+
wplc_scroll_to_bottom();
|
272 |
+
});
|
273 |
+
}
|
274 |
+
|
275 |
+
});
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Custom data trigger
|
279 |
+
*
|
280 |
+
* If custom data is sent through the socket, this is where you would want to handle it
|
281 |
+
*
|
282 |
+
* @return void
|
283 |
+
*/
|
284 |
+
jQuery(document).on("bleeper_custom_data_received", function(e) {
|
285 |
+
if (typeof e.ndata !== "undefined") {
|
286 |
+
if (typeof e.ndata.action !== "undefined") {
|
287 |
+
if (e.ndata.action === "send_custom_header") {
|
288 |
+
|
289 |
+
var temail = '';
|
290 |
+
var tname = '';
|
291 |
+
var taid = '';
|
292 |
+
var ta_tagline = '';
|
293 |
+
var ta_bio = '';
|
294 |
+
var ta_social_links = '';
|
295 |
+
if (typeof e.ndata.ndata.email !== "undefined") { temail = e.ndata.ndata.email; }
|
296 |
+
if (typeof e.ndata.ndata.name !== "undefined") { tname = e.ndata.ndata.name; }
|
297 |
+
if (typeof e.ndata.ndata.aid !== "undefined") { taid = e.ndata.ndata.aid; }
|
298 |
+
if (typeof e.ndata.ndata.tagline !== "undefined") { ta_tagline = e.ndata.ndata.tagline; }
|
299 |
+
if (typeof e.ndata.ndata.bio !== "undefined") { ta_bio = e.ndata.ndata.bio; }
|
300 |
+
if (typeof e.ndata.ndata.social !== "undefined") { ta_social_links = e.ndata.ndata.social; }
|
301 |
+
|
302 |
+
|
303 |
+
|
304 |
+
var data = {
|
305 |
+
social_links: ta_social_links,
|
306 |
+
agent_bio: ta_bio,
|
307 |
+
agent_tagline: ta_tagline,
|
308 |
+
aid: taid,
|
309 |
+
email: temail,
|
310 |
+
name: tname
|
311 |
+
}
|
312 |
+
|
313 |
+
|
314 |
+
jQuery.event.trigger({type: "wplc_agent_joined", ndata:{other:data}});
|
315 |
+
} else if(e.ndata.action === "send_user_direct_to_page"){
|
316 |
+
if(typeof e.ndata.direction !== "undefined"){
|
317 |
+
if(typeof e.ndata.pretty_name !== "undefined"){
|
318 |
+
var link_url = e.ndata.pretty_name + " - " + e.ndata.direction;
|
319 |
+
|
320 |
+
var notice = "<span>";
|
321 |
+
notice += (typeof e.ndata.agent_name !== "undefined" ? e.ndata.agent_name : "Agent") + " ";
|
322 |
+
notice += (typeof bleeper_direct_to_page_localized_notice !== "undefined" ? bleeper_direct_to_page_localized_notice : "would like to direct you to the following page: ");
|
323 |
+
notice += link_url;
|
324 |
+
notice += "</span>";
|
325 |
+
|
326 |
+
the_message = {};
|
327 |
+
the_message.msg = notice;
|
328 |
+
the_message.originates = 0;
|
329 |
+
the_message.other = {};
|
330 |
+
wplc_push_message_to_chatbox(the_message, "u", function(){
|
331 |
+
});
|
332 |
+
}
|
333 |
+
}
|
334 |
+
}
|
335 |
+
}
|
336 |
+
|
337 |
+
}
|
338 |
+
|
339 |
+
});
|
340 |
+
|
341 |
+
|
342 |
+
jQuery(document).on("bleeper_init_chat_box", function() {
|
343 |
+
|
344 |
+
/* find out if we are actively involved in a chat, if yes, then open the chat window, unless the user has minimized it.. */
|
345 |
+
|
346 |
+
nifty_chat_status_temp = Cookies.get("nc_status");
|
347 |
+
if (typeof nifty_chat_status_temp !== "undefined" && nifty_chat_status_temp === "active" && !nifty_is_minimized) {
|
348 |
+
open_chat(1);
|
349 |
+
jQuery.event.trigger({type: "wplc_open_chat_2", wplc_online: wplc_online});
|
350 |
+
} else {
|
351 |
+
wplc_init_chat_box(false, false);
|
352 |
+
}
|
353 |
+
|
354 |
+
|
355 |
+
});
|
356 |
+
|
357 |
+
jQuery(document).on("nifty_trigger_start_chat", function(e) {
|
358 |
+
wplc_cookie_name = Cookies.get('wplc_name');
|
359 |
+
wplc_cookie_email = Cookies.get('wplc_email');
|
360 |
+
|
361 |
+
if( typeof wplc_cookie_name == 'undefined' ){ var wplc_cookie_name = jQuery( "#wp-live-chat" ).find( "#wplc_name" ).val(); }
|
362 |
+
if( typeof wplc_cookie_email == 'undefined' ){ var wplc_cookie_email = jQuery( "#wp-live-chat" ).find( "#wplc_email" ).val(); }
|
363 |
+
|
364 |
+
|
365 |
+
wplc_send_welcome_message();
|
366 |
+
|
367 |
+
var start_data = {
|
368 |
+
relay_action: 'wplc_new_chat',
|
369 |
+
security: wplc_nonce,
|
370 |
+
cid: wplc_cid,
|
371 |
+
wplc_name: wplc_cookie_name,
|
372 |
+
wplc_email: wplc_cookie_email,
|
373 |
+
wplc_extra_data: {},
|
374 |
+
url : window.location.href,
|
375 |
+
session : wplc_session_variable
|
376 |
+
};
|
377 |
+
|
378 |
+
|
379 |
+
|
380 |
+
if(typeof wplc_start_chat_pro_custom_fields_filter !== "undefined" && typeof wplc_start_chat_pro_custom_fields_filter === "function"){
|
381 |
+
wplc_start_chat_pro_custom_fields_filter(wplc_extra_data, start_data, function(passed_extra_data, passed_action_data){
|
382 |
+
//Callback after processing custom field
|
383 |
+
wplc_rest_api('start_chat', passed_action_data, 12000, null);
|
384 |
+
|
385 |
+
});
|
386 |
+
} else {
|
387 |
+
start_data["wplc_extra_data"] = wplc_extra_data;
|
388 |
+
wplc_rest_api('start_chat', start_data, 12000, null);
|
389 |
+
}
|
390 |
+
|
391 |
+
jQuery.event.trigger({type: "wplc_open_chat_2", wplc_online: wplc_online});
|
392 |
+
|
393 |
+
|
394 |
+
});
|
395 |
+
|
396 |
+
if(typeof wplc_elem_trigger_id !== "undefined" && wplc_elem_trigger_id !== ""){
|
397 |
+
var wplc_click_or_hover = 0;
|
398 |
+
var wplc_class_or_id = 0;
|
399 |
+
|
400 |
+
if(typeof wplc_elem_trigger_action !== "undefined" && wplc_elem_trigger_action !== ""){ wplc_click_or_hover = parseInt(wplc_elem_trigger_action); }
|
401 |
+
if(typeof wplc_elem_trigger_type !== "undefined" && wplc_elem_trigger_type !== ""){ wplc_class_or_id = parseInt(wplc_elem_trigger_type); }
|
402 |
+
|
403 |
+
jQuery( (wplc_class_or_id === 1 ? "#" : ".") + wplc_elem_trigger_id).on( (wplc_click_or_hover === 1 ? "mouseenter" : "click"), function(){
|
404 |
+
open_chat(0);
|
405 |
+
});
|
406 |
+
}
|
407 |
+
|
408 |
+
|
409 |
+
});
|
410 |
+
|
languages/wplivechat-cs_CZ.mo
CHANGED
File without changes
|
languages/wplivechat-cs_CZ.po
CHANGED
File without changes
|
languages/wplivechat-da_DA.mo
CHANGED
File without changes
|
languages/wplivechat-da_DA.po
CHANGED
File without changes
|
languages/wplivechat-da_DK.mo
CHANGED
File without changes
|
languages/wplivechat-da_DK.po
CHANGED
File without changes
|
languages/wplivechat-de_CH.po
CHANGED
File without changes
|
languages/wplivechat-de_DE.mo
CHANGED
File without changes
|
languages/wplivechat-de_DE.po
CHANGED
File without changes
|
languages/wplivechat-el.mo
CHANGED
File without changes
|
languages/wplivechat-el.po
CHANGED
File without changes
|
languages/wplivechat-en_EN.mo
CHANGED
File without changes
|
languages/wplivechat-en_EN.po
CHANGED
File without changes
|
languages/wplivechat-es_ES.mo
CHANGED
File without changes
|
languages/wplivechat-es_ES.po
CHANGED
File without changes
|
languages/wplivechat-et_EE.mo
CHANGED
File without changes
|
languages/wplivechat-et_EE.po
CHANGED
File without changes
|
languages/wplivechat-fa_IR.mo
CHANGED
File without changes
|
languages/wplivechat-fa_IR.po
CHANGED
File without changes
|
languages/wplivechat-fi.mo
CHANGED
File without changes
|
languages/wplivechat-fi.po
CHANGED
File without changes
|
languages/wplivechat-fi_FI.mo
CHANGED
File without changes
|
languages/wplivechat-fi_FI.po
CHANGED
File without changes
|
languages/wplivechat-fr_FR.mo
CHANGED
File without changes
|
languages/wplivechat-fr_FR.po
CHANGED
File without changes
|
languages/wplivechat-he_IL.mo
CHANGED
File without changes
|
languages/wplivechat-he_IL.po
CHANGED
File without changes
|
languages/wplivechat-hr.mo
CHANGED
File without changes
|
languages/wplivechat-hr.po
CHANGED
File without changes
|
languages/wplivechat-hu-HU.mo
CHANGED
File without changes
|
languages/wplivechat-hu-HU.po
CHANGED
File without changes
|
languages/wplivechat-hu.mo
CHANGED
File without changes
|
languages/wplivechat-hu.po
CHANGED
File without changes
|
languages/wplivechat-hu_HU.mo
CHANGED
File without changes
|
languages/wplivechat-hu_HU.po
CHANGED
File without changes
|
languages/wplivechat-in_ID.mo
CHANGED
File without changes
|
languages/wplivechat-in_ID.po
CHANGED
File without changes
|
languages/wplivechat-it_IT.mo
CHANGED
File without changes
|
languages/wplivechat-it_IT.po
CHANGED
File without changes
|
languages/wplivechat-ja.po
CHANGED
File without changes
|
languages/wplivechat-ko_KR.mo
CHANGED
File without changes
|
languages/wplivechat-ko_KR.po
CHANGED
File without changes
|
languages/wplivechat-mn_MN.mo
CHANGED
File without changes
|
languages/wplivechat-mn_MN.po
CHANGED
File without changes
|
languages/wplivechat-nb_NO.mo
CHANGED
File without changes
|
languages/wplivechat-nb_NO.po
CHANGED
File without changes
|
languages/wplivechat-nl_NL.mo
CHANGED
File without changes
|
languages/wplivechat-nl_NL.po
CHANGED
File without changes
|
languages/wplivechat-pl_PL.mo
CHANGED
File without changes
|
languages/wplivechat-pl_PL.po
CHANGED
File without changes
|
languages/wplivechat-pt_BR.mo
CHANGED
File without changes
|
languages/wplivechat-pt_BR.po
CHANGED
File without changes
|
languages/wplivechat-pt_PT.mo
CHANGED
File without changes
|
languages/wplivechat-pt_PT.po
CHANGED
File without changes
|
languages/wplivechat-ro_RO.mo
CHANGED
File without changes
|
languages/wplivechat-ro_RO.po
CHANGED
File without changes
|
languages/wplivechat-ru_RU.mo
CHANGED
File without changes
|
languages/wplivechat-ru_RU.po
CHANGED
File without changes
|
languages/wplivechat-sk_SK.mo
CHANGED
File without changes
|
languages/wplivechat-sk_SK.po
CHANGED
File without changes
|
languages/wplivechat-sq.mo
CHANGED
File without changes
|
languages/wplivechat-sq.po
CHANGED
File without changes
|
languages/wplivechat-sv_SE.mo
CHANGED
File without changes
|
languages/wplivechat-sv_SE.po
CHANGED
File without changes
|
languages/wplivechat-tr-TR.mo
CHANGED
File without changes
|
languages/wplivechat-tr-TR.po
CHANGED
File without changes
|
languages/wplivechat-zh_CN.mo
CHANGED
File without changes
|
languages/wplivechat-zh_CN.po
CHANGED
File without changes
|
languages/wplivechat-zh_TW.mo
CHANGED
File without changes
|
languages/wplivechat-zh_TW.po
CHANGED
File without changes
|
lib/codecabin/plugin-deactivation-survey/README.md
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## Synopsis
|
2 |
+
|
3 |
+
This library will show a de-activation survey dialog when the user clicks "deactivate" on plugins.php on any plugins you've bound the library to. The form data will be posted to ccplugins.co
|
4 |
+
|
5 |
+
## Installation
|
6 |
+
|
7 |
+
- Copy the files into your project (I recommend using the path /lib/codecabin/plugin-deactivation-survey)
|
8 |
+
- Include deactivate-feedback-form.php in your plugin
|
9 |
+
- Run the code below with your plugins slug
|
10 |
+
|
11 |
+
## Usage
|
12 |
+
|
13 |
+
add_filter('codecabin_deactivate_feedback_form_plugins', function($plugins) {
|
14 |
+
|
15 |
+
$plugins[] = (object)array(
|
16 |
+
'slug' => 'wp-google-maps',
|
17 |
+
'version' => '7.0.6'
|
18 |
+
);
|
19 |
+
|
20 |
+
return $plugins;
|
21 |
+
|
22 |
+
});
|
23 |
+
|
24 |
+
## Notes
|
25 |
+
|
26 |
+
You can include any other arbitrary data you might want to store in the object you pass to the $plugins array in the example above
|
lib/codecabin/plugin-deactivation-survey/deactivate-feedback-form.css
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.codecabin-deactivate-dialog
|
2 |
+
{
|
3 |
+
text-align: left;
|
4 |
+
width: auto;
|
5 |
+
}
|
6 |
+
|
7 |
+
.codecabin-deactivate-dialog-buttons
|
8 |
+
{
|
9 |
+
text-align: right;
|
10 |
+
}
|
11 |
+
|
12 |
+
.codecabin-deactivate-dialog
|
13 |
+
{
|
14 |
+
width: auto !important;
|
15 |
+
}
|
16 |
+
|
17 |
+
.codecabin-deactivate-dialog h2
|
18 |
+
{
|
19 |
+
color: gray;
|
20 |
+
font-variant: small-caps;
|
21 |
+
font-size: 1.2em;
|
22 |
+
padding-bottom: 0.2em;
|
23 |
+
border-bottom: 1px solid lightgray;
|
24 |
+
|
25 |
+
}
|
26 |
+
|
27 |
+
.codecabin-deactivate-dialog input[name="comments"]
|
28 |
+
{
|
29 |
+
width: 380px;
|
30 |
+
}
|
lib/codecabin/plugin-deactivation-survey/deactivate-feedback-form.js
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function($) {
|
2 |
+
|
3 |
+
if(!window.codecabin)
|
4 |
+
window.codecabin = {};
|
5 |
+
|
6 |
+
if(codecabin.DeactivateFeedbackForm)
|
7 |
+
return;
|
8 |
+
|
9 |
+
codecabin.DeactivateFeedbackForm = function(plugin)
|
10 |
+
{
|
11 |
+
var self = this;
|
12 |
+
var strings = codecabin_deactivate_feedback_form_strings;
|
13 |
+
|
14 |
+
this.plugin = plugin;
|
15 |
+
|
16 |
+
// Dialog HTML
|
17 |
+
var element = $('\
|
18 |
+
<div class="codecabin-deactivate-dialog" data-remodal-id="' + plugin.slug + '">\
|
19 |
+
<form>\
|
20 |
+
<input type="hidden" name="plugin"/>\
|
21 |
+
<h2>' + strings.quick_feedback + '</h2>\
|
22 |
+
<p>\
|
23 |
+
' + strings.foreword + '\
|
24 |
+
</p>\
|
25 |
+
<ul class="codecabin-deactivate-reasons"></ul>\
|
26 |
+
<input name="comments" placeholder="' + strings.brief_description + '"/>\
|
27 |
+
<br>\
|
28 |
+
<p class="codecabin-deactivate-dialog-buttons">\
|
29 |
+
<input type="submit" class="button confirm" value="' + strings.skip_and_deactivate + '"/>\
|
30 |
+
<button data-remodal-action="cancel" class="button button-primary">' + strings.cancel + '</button>\
|
31 |
+
</p>\
|
32 |
+
</form>\
|
33 |
+
</div>\
|
34 |
+
')[0];
|
35 |
+
this.element = element;
|
36 |
+
|
37 |
+
$(element).find("input[name='plugin']").val(JSON.stringify(plugin));
|
38 |
+
|
39 |
+
$(element).on("click", "input[name='reason']", function(event) {
|
40 |
+
$(element).find("input[type='submit']").val(
|
41 |
+
strings.submit_and_deactivate
|
42 |
+
);
|
43 |
+
});
|
44 |
+
|
45 |
+
$(element).find("form").on("submit", function(event) {
|
46 |
+
self.onSubmit(event);
|
47 |
+
});
|
48 |
+
|
49 |
+
// Reasons list
|
50 |
+
var ul = $(element).find("ul.codecabin-deactivate-reasons");
|
51 |
+
for(var key in plugin.reasons)
|
52 |
+
{
|
53 |
+
var li = $("<li><input type='radio' name='reason'/> <span></span></li>");
|
54 |
+
|
55 |
+
$(li).find("input").val(key);
|
56 |
+
$(li).find("span").html(plugin.reasons[key]);
|
57 |
+
|
58 |
+
$(ul).append(li);
|
59 |
+
}
|
60 |
+
|
61 |
+
// Listen for deactivate
|
62 |
+
$("#the-list [data-slug='" + plugin.slug + "'] .deactivate>a").on("click", function(event) {
|
63 |
+
self.onDeactivateClicked(event);
|
64 |
+
});
|
65 |
+
}
|
66 |
+
|
67 |
+
codecabin.DeactivateFeedbackForm.prototype.onDeactivateClicked = function(event)
|
68 |
+
{
|
69 |
+
this.deactivateURL = event.target.href;
|
70 |
+
|
71 |
+
event.preventDefault();
|
72 |
+
|
73 |
+
if(!this.dialog)
|
74 |
+
this.dialog = $(this.element).remodal();
|
75 |
+
this.dialog.open();
|
76 |
+
}
|
77 |
+
|
78 |
+
codecabin.DeactivateFeedbackForm.prototype.onSubmit = function(event)
|
79 |
+
{
|
80 |
+
var element = this.element;
|
81 |
+
var strings = codecabin_deactivate_feedback_form_strings;
|
82 |
+
var self = this;
|
83 |
+
var data = $(element).find("form").serialize();
|
84 |
+
|
85 |
+
$(element).find("button, input[type='submit']").prop("disabled", true);
|
86 |
+
|
87 |
+
if($(element).find("input[name='reason']:checked").length)
|
88 |
+
{
|
89 |
+
$(element).find("input[type='submit']").val(strings.thank_you);
|
90 |
+
|
91 |
+
$.ajax({
|
92 |
+
type: "POST",
|
93 |
+
url: "https://www.ccplugins.co/api-deactivation-dialog/feedback.php",
|
94 |
+
data: data,
|
95 |
+
complete: function() {
|
96 |
+
window.location.href = self.deactivateURL;
|
97 |
+
}
|
98 |
+
});
|
99 |
+
}
|
100 |
+
else
|
101 |
+
{
|
102 |
+
$(element).find("input[type='submit']").val(strings.please_wait);
|
103 |
+
window.location.href = self.deactivateURL;
|
104 |
+
}
|
105 |
+
|
106 |
+
event.preventDefault();
|
107 |
+
return false;
|
108 |
+
}
|
109 |
+
|
110 |
+
$(document).ready(function() {
|
111 |
+
|
112 |
+
for(var i = 0; i < codecabin_deactivate_feedback_form_plugins.length; i++)
|
113 |
+
{
|
114 |
+
var plugin = codecabin_deactivate_feedback_form_plugins[i];
|
115 |
+
new codecabin.DeactivateFeedbackForm(plugin);
|
116 |
+
}
|
117 |
+
|
118 |
+
});
|
119 |
+
|
120 |
+
})(jQuery);
|
lib/codecabin/plugin-deactivation-survey/deactivate-feedback-form.php
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
|
5 |
+
if(!is_admin())
|
6 |
+
return;
|
7 |
+
|
8 |
+
global $pagenow;
|
9 |
+
|
10 |
+
if($pagenow != "plugins.php")
|
11 |
+
return;
|
12 |
+
|
13 |
+
if(defined('CODECABIN_DEACTIVATE_FEEDBACK_FORM_INCLUDED'))
|
14 |
+
return;
|
15 |
+
define('CODECABIN_DEACTIVATE_FEEDBACK_FORM_INCLUDED', true);
|
16 |
+
|
17 |
+
|
18 |
+
add_action('admin_enqueue_scripts', 'codecabin_wplc_deactivation_survey2');
|
19 |
+
function codecabin_wplc_deactivation_survey2() {
|
20 |
+
|
21 |
+
// Enqueue scripts
|
22 |
+
wp_enqueue_script('remodal', plugin_dir_url(__FILE__) . 'remodal.min.js');
|
23 |
+
wp_enqueue_style('remodal', plugin_dir_url(__FILE__) . 'remodal.css');
|
24 |
+
wp_enqueue_style('remodal-default-theme', plugin_dir_url(__FILE__) . 'remodal-default-theme.css');
|
25 |
+
|
26 |
+
wp_enqueue_script('codecabin-deactivate-feedback-form', plugin_dir_url(__FILE__) . 'deactivate-feedback-form.js');
|
27 |
+
wp_enqueue_style('codecabin-deactivate-feedback-form', plugin_dir_url(__FILE__) . 'deactivate-feedback-form.css');
|
28 |
+
|
29 |
+
// Localized strings
|
30 |
+
wp_localize_script('codecabin-deactivate-feedback-form', 'codecabin_deactivate_feedback_form_strings', array(
|
31 |
+
'quick_feedback' => __('Quick Feedback', 'codecabin'),
|
32 |
+
'foreword' => __('If you would be kind enough, please tell us why you\'re deactivating?', 'codecabin'),
|
33 |
+
'better_plugins_name' => __('Please tell us which plugin?', 'codecabin'),
|
34 |
+
'please_tell_us' => __('Please tell us the reason so we can improve the plugin', 'codecabin'),
|
35 |
+
'do_not_attach_email' => __('Do not send my e-mail address with this feedback', 'codecabin'),
|
36 |
+
|
37 |
+
'brief_description' => __('Please give us any feedback that could help us improve', 'codecabin'),
|
38 |
+
|
39 |
+
'cancel' => __('Cancel', 'codecabin'),
|
40 |
+
'skip_and_deactivate' => __('Skip & Deactivate', 'codecabin'),
|
41 |
+
'submit_and_deactivate' => __('Submit & Deactivate', 'codecabin'),
|
42 |
+
'please_wait' => __('Please wait', 'codecabin'),
|
43 |
+
'thank_you' => __('Thank you!', 'codecabin')
|
44 |
+
));
|
45 |
+
|
46 |
+
// Plugins
|
47 |
+
$plugins = apply_filters('codecabin_deactivate_feedback_form_plugins', array());
|
48 |
+
|
49 |
+
// Reasons
|
50 |
+
$defaultReasons = array(
|
51 |
+
'suddenly-stopped-working' => __('The plugin suddenly stopped working', 'codecabin'),
|
52 |
+
'plugin-broke-site' => __('The plugin broke my site', 'codecabin'),
|
53 |
+
'no-longer-needed' => __('I don\'t need this plugin any more', 'codecabin'),
|
54 |
+
'found-better-plugin' => __('I found a better plugin', 'codecabin'),
|
55 |
+
'temporary-deactivation' => __('It\'s a temporary deactivation, I\'m troubleshooting', 'codecabin'),
|
56 |
+
'other' => __('Other', 'codecabin')
|
57 |
+
);
|
58 |
+
|
59 |
+
foreach($plugins as $plugin)
|
60 |
+
{
|
61 |
+
$plugin->reasons = apply_filters('codecabin_deactivate_feedback_form_reasons', $defaultReasons, $plugin);
|
62 |
+
}
|
63 |
+
|
64 |
+
// Send plugin data
|
65 |
+
wp_localize_script('codecabin-deactivate-feedback-form', 'codecabin_deactivate_feedback_form_plugins', $plugins);
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Hook for adding plugins, pass an array of objects in the following format:
|
70 |
+
* 'slug' => 'plugin-slug'
|
71 |
+
* 'version' => 'plugin-version'
|
72 |
+
* @return array The plugins in the format described above
|
73 |
+
*/
|
74 |
+
add_filter('codecabin_deactivate_feedback_form_plugins', 'wplc_codecabin_deactivate_feedback_form_plugins');
|
75 |
+
function wplc_codecabin_deactivate_feedback_form_plugins($plugins) {
|
76 |
+
return $plugins;
|
77 |
+
}
|
78 |
+
|
lib/codecabin/plugin-deactivation-survey/remodal-default-theme.css
ADDED
@@ -0,0 +1,323 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* Remodal - v1.1.1
|
3 |
+
* Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
|
4 |
+
* http://vodkabears.github.io/remodal/
|
5 |
+
*
|
6 |
+
* Made by Ilya Makarov
|
7 |
+
* Under MIT License
|
8 |
+
*/
|
9 |
+
|
10 |
+
/* ==========================================================================
|
11 |
+
Remodal's default mobile first theme
|
12 |
+
========================================================================== */
|
13 |
+
|
14 |
+
/* Default theme styles for the background */
|
15 |
+
|
16 |
+
.remodal-bg.remodal-is-opening,
|
17 |
+
.remodal-bg.remodal-is-opened {
|
18 |
+
-webkit-filter: blur(3px);
|
19 |
+
filter: blur(3px);
|
20 |
+
}
|
21 |
+
|
22 |
+
/* Default theme styles of the overlay */
|
23 |
+
|
24 |
+
.remodal-overlay {
|
25 |
+
background: rgba(43, 46, 56, 0.9);
|
26 |
+
}
|
27 |
+
|
28 |
+
.remodal-overlay.remodal-is-opening,
|
29 |
+
.remodal-overlay.remodal-is-closing {
|
30 |
+
-webkit-animation-duration: 0.3s;
|
31 |
+
animation-duration: 0.3s;
|
32 |
+
-webkit-animation-fill-mode: forwards;
|
33 |
+
animation-fill-mode: forwards;
|
34 |
+
}
|
35 |
+
|
36 |
+
.remodal-overlay.remodal-is-opening {
|
37 |
+
-webkit-animation-name: remodal-overlay-opening-keyframes;
|
38 |
+
animation-name: remodal-overlay-opening-keyframes;
|
39 |
+
}
|
40 |
+
|
41 |
+
.remodal-overlay.remodal-is-closing {
|
42 |
+
-webkit-animation-name: remodal-overlay-closing-keyframes;
|
43 |
+
animation-name: remodal-overlay-closing-keyframes;
|
44 |
+
}
|
45 |
+
|
46 |
+
/* Default theme styles of the wrapper */
|
47 |
+
|
48 |
+
.remodal-wrapper {
|
49 |
+
padding: 10px 10px 0;
|
50 |
+
}
|
51 |
+
|
52 |
+
/* Default theme styles of the modal dialog */
|
53 |
+
|
54 |
+
.remodal {
|
55 |
+
box-sizing: border-box;
|
56 |
+
width: 100%;
|
57 |
+
margin-bottom: 10px;
|
58 |
+
padding: 35px;
|
59 |
+
|
60 |
+
-webkit-transform: translate3d(0, 0, 0);
|
61 |
+
transform: translate3d(0, 0, 0);
|
62 |
+
|
63 |
+
color: #2b2e38;
|
64 |
+
background: #fff;
|
65 |
+
}
|
66 |
+
|
67 |
+
.remodal.remodal-is-opening,
|
68 |
+
.remodal.remodal-is-closing {
|
69 |
+
-webkit-animation-duration: 0.3s;
|
70 |
+
animation-duration: 0.3s;
|
71 |
+
-webkit-animation-fill-mode: forwards;
|
72 |
+
animation-fill-mode: forwards;
|
73 |
+
}
|
74 |
+
|
75 |
+
.remodal.remodal-is-opening {
|
76 |
+
-webkit-animation-name: remodal-opening-keyframes;
|
77 |
+
animation-name: remodal-opening-keyframes;
|
78 |
+
}
|
79 |
+
|
80 |
+
.remodal.remodal-is-closing {
|
81 |
+
-webkit-animation-name: remodal-closing-keyframes;
|
82 |
+
animation-name: remodal-closing-keyframes;
|
83 |
+
}
|
84 |
+
|
85 |
+
/* Vertical align of the modal dialog */
|
86 |
+
|
87 |
+
.remodal,
|
88 |
+
.remodal-wrapper:after {
|
89 |
+
vertical-align: middle;
|
90 |
+
}
|
91 |
+
|
92 |
+
/* Close button */
|
93 |
+
|
94 |
+
.remodal-close {
|
95 |
+
position: absolute;
|
96 |
+
top: 0;
|
97 |
+
left: 0;
|
98 |
+
|
99 |
+
display: block;
|
100 |
+
overflow: visible;
|
101 |
+
|
102 |
+
width: 35px;
|
103 |
+
height: 35px;
|
104 |
+
margin: 0;
|
105 |
+
padding: 0;
|
106 |
+
|
107 |
+
cursor: pointer;
|
108 |
+
-webkit-transition: color 0.2s;
|
109 |
+
transition: color 0.2s;
|
110 |
+
text-decoration: none;
|
111 |
+
|
112 |
+
color: #95979c;
|
113 |
+
border: 0;
|
114 |
+
outline: 0;
|
115 |
+
background: transparent;
|
116 |
+
}
|
117 |
+
|
118 |
+
.remodal-close:hover,
|
119 |
+
.remodal-close:focus {
|
120 |
+
color: #2b2e38;
|
121 |
+
}
|
122 |
+
|
123 |
+
.remodal-close:before {
|
124 |
+
font-family: Arial, "Helvetica CY", "Nimbus Sans L", sans-serif !important;
|
125 |
+
font-size: 25px;
|
126 |
+
line-height: 35px;
|
127 |
+
|
128 |
+
position: absolute;
|
129 |
+
top: 0;
|
130 |
+
left: 0;
|
131 |
+
|
132 |
+
display: block;
|
133 |
+
|
134 |
+
width: 35px;
|
135 |
+
|
136 |
+
content: "\00d7";
|
137 |
+
text-align: center;
|
138 |
+
}
|
139 |
+
|
140 |
+
/* Dialog buttons */
|
141 |
+
|
142 |
+
.remodal-confirm,
|
143 |
+
.remodal-cancel {
|
144 |
+
font: inherit;
|
145 |
+
|
146 |
+
display: inline-block;
|
147 |
+
overflow: visible;
|
148 |
+
|
149 |
+
min-width: 110px;
|
150 |
+
margin: 0;
|
151 |
+
padding: 12px 0;
|
152 |
+
|
153 |
+
cursor: pointer;
|
154 |
+
-webkit-transition: background 0.2s;
|
155 |
+
transition: background 0.2s;
|
156 |
+
text-align: center;
|
157 |
+
vertical-align: middle;
|
158 |
+
text-decoration: none;
|
159 |
+
|
160 |
+
border: 0;
|
161 |
+
outline: 0;
|
162 |
+
}
|
163 |
+
|
164 |
+
.remodal-confirm {
|
165 |
+
color: #fff;
|
166 |
+
background: #81c784;
|
167 |
+
}
|
168 |
+
|
169 |
+
.remodal-confirm:hover,
|
170 |
+
.remodal-confirm:focus {
|
171 |
+
background: #66bb6a;
|
172 |
+
}
|
173 |
+
|
174 |
+
.remodal-cancel {
|
175 |
+
color: #fff;
|
176 |
+
background: #e57373;
|
177 |
+
}
|
178 |
+
|
179 |
+
.remodal-cancel:hover,
|
180 |
+
.remodal-cancel:focus {
|
181 |
+
background: #ef5350;
|
182 |
+
}
|
183 |
+
|
184 |
+
/* Remove inner padding and border in Firefox 4+ for the button tag. */
|
185 |
+
|
186 |
+
.remodal-confirm::-moz-focus-inner,
|
187 |
+
.remodal-cancel::-moz-focus-inner,
|
188 |
+
.remodal-close::-moz-focus-inner {
|
189 |
+
padding: 0;
|
190 |
+
|
191 |
+
border: 0;
|
192 |
+
}
|
193 |
+
|
194 |
+
/* Keyframes
|
195 |
+
========================================================================== */
|
196 |
+
|
197 |
+
@-webkit-keyframes remodal-opening-keyframes {
|
198 |
+
from {
|
199 |
+
-webkit-transform: scale(1.05);
|
200 |
+
transform: scale(1.05);
|
201 |
+
|
202 |
+
opacity: 0;
|
203 |
+
}
|
204 |
+
to {
|
205 |
+
-webkit-transform: none;
|
206 |
+
transform: none;
|
207 |
+
|
208 |
+
opacity: 1;
|
209 |
+
|
210 |
+
-webkit-filter: blur(0);
|
211 |
+
filter: blur(0);
|
212 |
+
}
|
213 |
+
}
|
214 |
+
|
215 |
+
@keyframes remodal-opening-keyframes {
|
216 |
+
from {
|
217 |
+
-webkit-transform: scale(1.05);
|
218 |
+
transform: scale(1.05);
|
219 |
+
|
220 |
+
opacity: 0;
|
221 |
+
}
|
222 |
+
to {
|
223 |
+
-webkit-transform: none;
|
224 |
+
transform: none;
|
225 |
+
|
226 |
+
opacity: 1;
|
227 |
+
|
228 |
+
-webkit-filter: blur(0);
|
229 |
+
filter: blur(0);
|
230 |
+
}
|
231 |
+
}
|
232 |
+
|
233 |
+
@-webkit-keyframes remodal-closing-keyframes {
|
234 |
+
from {
|
235 |
+
-webkit-transform: scale(1);
|
236 |
+
transform: scale(1);
|
237 |
+
|
238 |
+
opacity: 1;
|
239 |
+
}
|
240 |
+
to {
|
241 |
+
-webkit-transform: scale(0.95);
|
242 |
+
transform: scale(0.95);
|
243 |
+
|
244 |
+
opacity: 0;
|
245 |
+
|
246 |
+
-webkit-filter: blur(0);
|
247 |
+
filter: blur(0);
|
248 |
+
}
|
249 |
+
}
|
250 |
+
|
251 |
+
@keyframes remodal-closing-keyframes {
|
252 |
+
from {
|
253 |
+
-webkit-transform: scale(1);
|
254 |
+
transform: scale(1);
|
255 |
+
|
256 |
+
opacity: 1;
|
257 |
+
}
|
258 |
+
to {
|
259 |
+
-webkit-transform: scale(0.95);
|
260 |
+
transform: scale(0.95);
|
261 |
+
|
262 |
+
opacity: 0;
|
263 |
+
|
264 |
+
-webkit-filter: blur(0);
|
265 |
+
filter: blur(0);
|
266 |
+
}
|
267 |
+
}
|
268 |
+
|
269 |
+
@-webkit-keyframes remodal-overlay-opening-keyframes {
|
270 |
+
from {
|
271 |
+
opacity: 0;
|
272 |
+
}
|
273 |
+
to {
|
274 |
+
opacity: 1;
|
275 |
+
}
|
276 |
+
}
|
277 |
+
|
278 |
+
@keyframes remodal-overlay-opening-keyframes {
|
279 |
+
from {
|
280 |
+
opacity: 0;
|
281 |
+
}
|
282 |
+
to {
|
283 |
+
opacity: 1;
|
284 |
+
}
|
285 |
+
}
|
286 |
+
|
287 |
+
@-webkit-keyframes remodal-overlay-closing-keyframes {
|
288 |
+
from {
|
289 |
+
opacity: 1;
|
290 |
+
}
|
291 |
+
to {
|
292 |
+
opacity: 0;
|
293 |
+
}
|
294 |
+
}
|
295 |
+
|
296 |
+
@keyframes remodal-overlay-closing-keyframes {
|
297 |
+
from {
|
298 |
+
opacity: 1;
|
299 |
+
}
|
300 |
+
to {
|
301 |
+
opacity: 0;
|
302 |
+
}
|
303 |
+
}
|
304 |
+
|
305 |
+
/* Media queries
|
306 |
+
========================================================================== */
|
307 |
+
|
308 |
+
@media only screen and (min-width: 641px) {
|
309 |
+
.remodal {
|
310 |
+
max-width: 700px;
|
311 |
+
}
|
312 |
+
}
|
313 |
+
|
314 |
+
/* IE8
|
315 |
+
========================================================================== */
|
316 |
+
|
317 |
+
.lt-ie9 .remodal-overlay {
|
318 |
+
background: #2b2e38;
|
319 |
+
}
|
320 |
+
|
321 |
+
.lt-ie9 .remodal {
|
322 |
+
width: 700px;
|
323 |
+
}
|
lib/codecabin/plugin-deactivation-survey/remodal.css
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* Remodal - v1.1.1
|
3 |
+
* Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
|
4 |
+
* http://vodkabears.github.io/remodal/
|
5 |
+
*
|
6 |
+
* Made by Ilya Makarov
|
7 |
+
* Under MIT License
|
8 |
+
*/
|
9 |
+
|
10 |
+
/* ==========================================================================
|
11 |
+
Remodal's necessary styles
|
12 |
+
========================================================================== */
|
13 |
+
|
14 |
+
/* Hide scroll bar */
|
15 |
+
|
16 |
+
html.remodal-is-locked {
|
17 |
+
overflow: hidden;
|
18 |
+
|
19 |
+
-ms-touch-action: none;
|
20 |
+
touch-action: none;
|
21 |
+
}
|
22 |
+
|
23 |
+
/* Anti FOUC */
|
24 |
+
|
25 |
+
.remodal,
|
26 |
+
[data-remodal-id] {
|
27 |
+
display: none;
|
28 |
+
}
|
29 |
+
|
30 |
+
/* Necessary styles of the overlay */
|
31 |
+
|
32 |
+
.remodal-overlay {
|
33 |
+
position: fixed;
|
34 |
+
z-index: 9999;
|
35 |
+
top: -5000px;
|
36 |
+
right: -5000px;
|
37 |
+
bottom: -5000px;
|
38 |
+
left: -5000px;
|
39 |
+
|
40 |
+
display: none;
|
41 |
+
}
|
42 |
+
|
43 |
+
/* Necessary styles of the wrapper */
|
44 |
+
|
45 |
+
.remodal-wrapper {
|
46 |
+
position: fixed;
|
47 |
+
z-index: 10000;
|
48 |
+
top: 0;
|
49 |
+
right: 0;
|
50 |
+
bottom: 0;
|
51 |
+
left: 0;
|
52 |
+
|
53 |
+
display: none;
|
54 |
+
overflow: auto;
|
55 |
+
|
56 |
+
text-align: center;
|
57 |
+
|
58 |
+
-webkit-overflow-scrolling: touch;
|
59 |
+
}
|
60 |
+
|
61 |
+
.remodal-wrapper:after {
|
62 |
+
display: inline-block;
|
63 |
+
|
64 |
+
height: 100%;
|
65 |
+
margin-left: -0.05em;
|
66 |
+
|
67 |
+
content: "";
|
68 |
+
}
|
69 |
+
|
70 |
+
/* Fix iPad, iPhone glitches */
|
71 |
+
|
72 |
+
.remodal-overlay,
|
73 |
+
.remodal-wrapper {
|
74 |
+
-webkit-backface-visibility: hidden;
|
75 |
+
backface-visibility: hidden;
|
76 |
+
}
|
77 |
+
|
78 |
+
/* Necessary styles of the modal dialog */
|
79 |
+
|
80 |
+
.remodal {
|
81 |
+
position: relative;
|
82 |
+
|
83 |
+
outline: none;
|
84 |
+
|
85 |
+
-webkit-text-size-adjust: 100%;
|
86 |
+
-ms-text-size-adjust: 100%;
|
87 |
+
text-size-adjust: 100%;
|
88 |
+
}
|
89 |
+
|
90 |
+
.remodal-is-initialized {
|
91 |
+
/* Disable Anti-FOUC */
|
92 |
+
display: inline-block;
|
93 |
+
}
|
lib/codecabin/plugin-deactivation-survey/remodal.min.js
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* Remodal - v1.1.1
|
3 |
+
* Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
|
4 |
+
* http://vodkabears.github.io/remodal/
|
5 |
+
*
|
6 |
+
* Made by Ilya Makarov
|
7 |
+
* Under MIT License
|
8 |
+
*/
|
9 |
+
|
10 |
+
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(c){return b(a,c)}):"object"==typeof exports?b(a,require("jquery")):b(a,a.jQuery||a.Zepto)}(this,function(a,b){"use strict";function c(a){if(w&&"none"===a.css("animation-name")&&"none"===a.css("-webkit-animation-name")&&"none"===a.css("-moz-animation-name")&&"none"===a.css("-o-animation-name")&&"none"===a.css("-ms-animation-name"))return 0;var b,c,d,e,f=a.css("animation-duration")||a.css("-webkit-animation-duration")||a.css("-moz-animation-duration")||a.css("-o-animation-duration")||a.css("-ms-animation-duration")||"0s",g=a.css("animation-delay")||a.css("-webkit-animation-delay")||a.css("-moz-animation-delay")||a.css("-o-animation-delay")||a.css("-ms-animation-delay")||"0s",h=a.css("animation-iteration-count")||a.css("-webkit-animation-iteration-count")||a.css("-moz-animation-iteration-count")||a.css("-o-animation-iteration-count")||a.css("-ms-animation-iteration-count")||"1";for(f=f.split(", "),g=g.split(", "),h=h.split(", "),e=0,c=f.length,b=Number.NEGATIVE_INFINITY;e<c;e++)d=parseFloat(f[e])*parseInt(h[e],10)+parseFloat(g[e]),d>b&&(b=d);return b}function d(){if(b(document).height()<=b(window).height())return 0;var a,c,d=document.createElement("div"),e=document.createElement("div");return d.style.visibility="hidden",d.style.width="100px",document.body.appendChild(d),a=d.offsetWidth,d.style.overflow="scroll",e.style.width="100%",d.appendChild(e),c=e.offsetWidth,d.parentNode.removeChild(d),a-c}function e(){if(!x){var a,c,e=b("html"),f=k("is-locked");e.hasClass(f)||(c=b(document.body),a=parseInt(c.css("padding-right"),10)+d(),c.css("padding-right",a+"px"),e.addClass(f))}}function f(){if(!x){var a,c,e=b("html"),f=k("is-locked");e.hasClass(f)&&(c=b(document.body),a=parseInt(c.css("padding-right"),10)-d(),c.css("padding-right",a+"px"),e.removeClass(f))}}function g(a,b,c,d){var e=k("is",b),f=[k("is",u.CLOSING),k("is",u.OPENING),k("is",u.CLOSED),k("is",u.OPENED)].join(" ");a.$bg.removeClass(f).addClass(e),a.$overlay.removeClass(f).addClass(e),a.$wrapper.removeClass(f).addClass(e),a.$modal.removeClass(f).addClass(e),a.state=b,!c&&a.$modal.trigger({type:b,reason:d},[{reason:d}])}function h(a,d,e){var f=0,g=function(a){a.target===this&&f++},h=function(a){a.target===this&&0===--f&&(b.each(["$bg","$overlay","$wrapper","$modal"],function(a,b){e[b].off(r+" "+s)}),d())};b.each(["$bg","$overlay","$wrapper","$modal"],function(a,b){e[b].on(r,g).on(s,h)}),a(),0===c(e.$bg)&&0===c(e.$overlay)&&0===c(e.$wrapper)&&0===c(e.$modal)&&(b.each(["$bg","$overlay","$wrapper","$modal"],function(a,b){e[b].off(r+" "+s)}),d())}function i(a){a.state!==u.CLOSED&&(b.each(["$bg","$overlay","$wrapper","$modal"],function(b,c){a[c].off(r+" "+s)}),a.$bg.removeClass(a.settings.modifier),a.$overlay.removeClass(a.settings.modifier).hide(),a.$wrapper.hide(),f(),g(a,u.CLOSED,!0))}function j(a){var b,c,d,e,f={};for(a=a.replace(/\s*:\s*/g,":").replace(/\s*,\s*/g,","),b=a.split(","),e=0,c=b.length;e<c;e++)b[e]=b[e].split(":"),d=b[e][1],("string"==typeof d||d instanceof String)&&(d="true"===d||"false"!==d&&d),("string"==typeof d||d instanceof String)&&(d=isNaN(d)?d:+d),f[b[e][0]]=d;return f}function k(){for(var a=q,b=0;b<arguments.length;++b)a+="-"+arguments[b];return a}function l(){var a,c,d=location.hash.replace("#","");if(d){try{c=b('[data-remodal-id="'+d+'"]')}catch(e){}c&&c.length&&(a=b[p].lookup[c.data(p)],a&&a.settings.hashTracking&&a.open())}else n&&n.state===u.OPENED&&n.settings.hashTracking&&n.close()}function m(a,c){var d=b(document.body),e=d,f=this;f.settings=b.extend({},t,c),f.index=b[p].lookup.push(f)-1,f.state=u.CLOSED,f.$overlay=b("."+k("overlay")),null!==f.settings.appendTo&&f.settings.appendTo.length&&(e=b(f.settings.appendTo)),f.$overlay.length||(f.$overlay=b("<div>").addClass(k("overlay")+" "+k("is",u.CLOSED)).hide(),e.append(f.$overlay)),f.$bg=b("."+k("bg")).addClass(k("is",u.CLOSED)),f.$modal=a.addClass(q+" "+k("is-initialized")+" "+f.settings.modifier+" "+k("is",u.CLOSED)).attr("tabindex","-1"),f.$wrapper=b("<div>").addClass(k("wrapper")+" "+f.settings.modifier+" "+k("is",u.CLOSED)).hide().append(f.$modal),e.append(f.$wrapper),f.$wrapper.on("click."+q,'[data-remodal-action="close"]',function(a){a.preventDefault(),f.close()}),f.$wrapper.on("click."+q,'[data-remodal-action="cancel"]',function(a){a.preventDefault(),f.$modal.trigger(v.CANCELLATION),f.settings.closeOnCancel&&f.close(v.CANCELLATION)}),f.$wrapper.on("click."+q,'[data-remodal-action="confirm"]',function(a){a.preventDefault(),f.$modal.trigger(v.CONFIRMATION),f.settings.closeOnConfirm&&f.close(v.CONFIRMATION)}),f.$wrapper.on("click."+q,function(a){var c=b(a.target);c.hasClass(k("wrapper"))&&f.settings.closeOnOutsideClick&&f.close()})}var n,o,p="remodal",q=a.REMODAL_GLOBALS&&a.REMODAL_GLOBALS.NAMESPACE||p,r=b.map(["animationstart","webkitAnimationStart","MSAnimationStart","oAnimationStart"],function(a){return a+"."+q}).join(" "),s=b.map(["animationend","webkitAnimationEnd","MSAnimationEnd","oAnimationEnd"],function(a){return a+"."+q}).join(" "),t=b.extend({hashTracking:!0,closeOnConfirm:!0,closeOnCancel:!0,closeOnEscape:!0,closeOnOutsideClick:!0,modifier:"",appendTo:null},a.REMODAL_GLOBALS&&a.REMODAL_GLOBALS.DEFAULTS),u={CLOSING:"closing",CLOSED:"closed",OPENING:"opening",OPENED:"opened"},v={CONFIRMATION:"confirmation",CANCELLATION:"cancellation"},w=function(){var a=document.createElement("div").style;return void 0!==a.animationName||void 0!==a.WebkitAnimationName||void 0!==a.MozAnimationName||void 0!==a.msAnimationName||void 0!==a.OAnimationName}(),x=/iPad|iPhone|iPod/.test(navigator.platform);m.prototype.open=function(){var a,c=this;c.state!==u.OPENING&&c.state!==u.CLOSING&&(a=c.$modal.attr("data-remodal-id"),a&&c.settings.hashTracking&&(o=b(window).scrollTop(),location.hash=a),n&&n!==c&&i(n),n=c,e(),c.$bg.addClass(c.settings.modifier),c.$overlay.addClass(c.settings.modifier).show(),c.$wrapper.show().scrollTop(0),c.$modal.focus(),h(function(){g(c,u.OPENING)},function(){g(c,u.OPENED)},c))},m.prototype.close=function(a){var c=this;c.state!==u.OPENING&&c.state!==u.CLOSING&&c.state!==u.CLOSED&&(c.settings.hashTracking&&c.$modal.attr("data-remodal-id")===location.hash.substr(1)&&(location.hash="",b(window).scrollTop(o)),h(function(){g(c,u.CLOSING,!1,a)},function(){c.$bg.removeClass(c.settings.modifier),c.$overlay.removeClass(c.settings.modifier).hide(),c.$wrapper.hide(),f(),g(c,u.CLOSED,!1,a)},c))},m.prototype.getState=function(){return this.state},m.prototype.destroy=function(){var a,c=b[p].lookup;i(this),this.$wrapper.remove(),delete c[this.index],a=b.grep(c,function(a){return!!a}).length,0===a&&(this.$overlay.remove(),this.$bg.removeClass(k("is",u.CLOSING)+" "+k("is",u.OPENING)+" "+k("is",u.CLOSED)+" "+k("is",u.OPENED)))},b[p]={lookup:[]},b.fn[p]=function(a){var c,d;return this.each(function(e,f){d=b(f),null==d.data(p)?(c=new m(d,a),d.data(p,c.index),c.settings.hashTracking&&d.attr("data-remodal-id")===location.hash.substr(1)&&c.open()):c=b[p].lookup[d.data(p)]}),c},b(document).ready(function(){b(document).on("click","[data-remodal-target]",function(a){a.preventDefault();var c=a.currentTarget,d=c.getAttribute("data-remodal-target"),e=b('[data-remodal-id="'+d+'"]');b[p].lookup[e.data(p)].open()}),b(document).find("."+q).each(function(a,c){var d=b(c),e=d.data("remodal-options");e?("string"==typeof e||e instanceof String)&&(e=j(e)):e={},d[p](e)}),b(document).on("keydown."+q,function(a){n&&n.settings.closeOnEscape&&n.state===u.OPENED&&27===a.keyCode&&n.close()}),b(window).on("hashchange."+q,l)})});
|
modules/api/wplc-api-functions.php
CHANGED
@@ -16,10 +16,16 @@ function wplc_api_accept_chat(WP_REST_Request $request){
|
|
16 |
if(isset($request)){
|
17 |
if(isset($request['token'])){
|
18 |
$check_token = get_option('wplc_api_secret_token');
|
19 |
-
if($check_token !== false && $request['token'] === $check_token){
|
20 |
if(isset($request['chat_id'])){
|
21 |
if(isset($request['agent_id'])){
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
$return_array['response'] = "Chat accepted successfully";
|
24 |
$return_array['code'] = "200";
|
25 |
$return_array['data'] = array("chat_id" => intval($request['chat_id']),
|
@@ -124,6 +130,113 @@ function wplc_api_end_chat(WP_REST_Request $request){
|
|
124 |
return $return_array;
|
125 |
}
|
126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
/*
|
128 |
* Send a message to a chat within the WP Live Chat Support Dashboard
|
129 |
* Required GET/POST variables:
|
@@ -134,51 +247,83 @@ function wplc_api_end_chat(WP_REST_Request $request){
|
|
134 |
function wplc_api_send_message(WP_REST_Request $request){
|
135 |
$return_array = array();
|
136 |
if(isset($request)){
|
137 |
-
if(isset($request['
|
138 |
$check_token = get_option('wplc_api_secret_token');
|
139 |
-
if($check_token !== false && $request['
|
140 |
if(isset($request['chat_id'])){
|
141 |
if(isset($request['message'])){
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
} else {
|
154 |
$return_array['response'] = "No 'message' found";
|
155 |
$return_array['code'] = "401";
|
156 |
-
$return_array['requirements'] = array("
|
157 |
"chat_id" => "Chat ID",
|
158 |
"message" => "Message");
|
159 |
}
|
160 |
} else {
|
161 |
$return_array['response'] = "No 'chat_id' found";
|
162 |
$return_array['code'] = "401";
|
163 |
-
$return_array['requirements'] = array("
|
164 |
"chat_id" => "Chat ID",
|
165 |
"message" => "Message");
|
166 |
}
|
167 |
} else {
|
168 |
-
$return_array['response'] = "Secret
|
169 |
$return_array['code'] = "401";
|
170 |
}
|
171 |
}else{
|
172 |
-
$return_array['response'] = "No secret '
|
173 |
$return_array['code'] = "401";
|
174 |
-
$return_array['requirements'] = array("
|
175 |
"chat_id" => "Chat ID",
|
176 |
"message" => "Message");
|
177 |
}
|
178 |
}else{
|
179 |
$return_array['response'] = "No request data found";
|
180 |
$return_array['code'] = "400";
|
181 |
-
$return_array['requirements'] = array("
|
182 |
"chat_id" => "Chat ID",
|
183 |
"message" => "Message");
|
184 |
}
|
@@ -238,6 +383,7 @@ function wplc_api_get_status(WP_REST_Request $request){
|
|
238 |
return $return_array;
|
239 |
}
|
240 |
|
|
|
241 |
/*
|
242 |
* Fetch a chat status within the WP Live Chat Support Dashboard
|
243 |
* Required GET/POST variables:
|
@@ -263,7 +409,13 @@ function wplc_api_get_messages(WP_REST_Request $request){
|
|
263 |
$offset = intval($request['offset']);
|
264 |
}
|
265 |
|
266 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
267 |
|
268 |
if($message_data){
|
269 |
$return_array['response'] = "Message data returned";
|
@@ -381,65 +533,20 @@ function wplc_api_record_admin_message($cid, $msg){
|
|
381 |
/*
|
382 |
* Returns messages from server
|
383 |
*/
|
384 |
-
function wplc_api_return_messages($cid, $limit, $offset){
|
385 |
-
global $wpdb;
|
386 |
-
global $wplc_tblname_msgs;
|
387 |
-
|
388 |
-
$cid = intval($cid);
|
389 |
-
$limit = intval($limit);
|
390 |
-
$offset = intval($offset);
|
391 |
|
392 |
-
|
393 |
-
$wplc_settings = get_option("WPLC_SETTINGS");
|
394 |
|
|
|
395 |
|
396 |
-
|
397 |
-
|
398 |
-
|
|
|
|
|
|
|
399 |
|
400 |
-
$results = $wpdb->get_results(
|
401 |
-
"
|
402 |
-
SELECT *
|
403 |
-
FROM $wplc_tblname_msgs
|
404 |
-
WHERE `chat_sess_id` = '$cid'
|
405 |
-
ORDER BY `timestamp` ASC
|
406 |
-
LIMIT $limit OFFSET $offset
|
407 |
-
"
|
408 |
-
);
|
409 |
|
410 |
-
$messages = array(); //The message array
|
411 |
-
if ($results) {
|
412 |
-
foreach ($results as $result) {
|
413 |
-
$messages[$result->id] = array(); //Message object
|
414 |
-
|
415 |
-
$messages[$result->id]['from'] = $result->msgfrom;
|
416 |
-
$messages[$result->id]['message'] = stripslashes($result->msg);
|
417 |
-
$messages[$result->id]['timestamp'] = strtotime($result->timestamp);
|
418 |
-
$messages[$result->id]['is_admin'] = $result->originates == 1 ? true : false;
|
419 |
-
|
420 |
-
$gravatar = "";
|
421 |
-
if($messages[$result->id]['is_admin']){
|
422 |
-
if (isset($cdata->other)) {
|
423 |
-
$other = maybe_unserialize($cdata->other);
|
424 |
-
if (isset($other['aid'])) {
|
425 |
-
$user_info = get_userdata(intval($other['aid']));
|
426 |
-
$gravatar = "//www.gravatar.com/avatar/".md5($user_info->user_email)."?s=30";
|
427 |
-
}
|
428 |
-
}
|
429 |
-
} else {
|
430 |
-
if (isset($cdata->email)) {
|
431 |
-
$gravatar = "//www.gravatar.com/avatar/".md5($cdata->email)."?s=30";
|
432 |
-
}
|
433 |
-
}
|
434 |
-
|
435 |
-
if(function_exists('wplc_decrypt_msg')){
|
436 |
-
$messages[$result->id]['message'] = wplc_decrypt_msg($messages[$result->id]['message']);
|
437 |
-
}
|
438 |
-
|
439 |
-
$messages[$result->id]['message'] = stripslashes($messages[$result->id]['message']);
|
440 |
-
}
|
441 |
-
}
|
442 |
-
return $messages;
|
443 |
}
|
444 |
|
445 |
|
@@ -497,6 +604,132 @@ function wplc_api_return_sessions() {
|
|
497 |
}
|
498 |
|
499 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
500 |
|
501 |
/**
|
502 |
* EXPIRIMENTAL - Works when changing the ajaxurl to the relevat endpoint
|
@@ -788,4 +1021,55 @@ function wplc_api_call_to_server_visitor(WP_REST_Request $request){
|
|
788 |
}
|
789 |
|
790 |
return $return_array;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
791 |
}
|
16 |
if(isset($request)){
|
17 |
if(isset($request['token'])){
|
18 |
$check_token = get_option('wplc_api_secret_token');
|
19 |
+
if($check_token !== false && $request['token'] === $check_token){
|
20 |
if(isset($request['chat_id'])){
|
21 |
if(isset($request['agent_id'])){
|
22 |
+
|
23 |
+
$cid = wplc_return_chat_id_by_rel($request['chat_id']);
|
24 |
+
if(wplc_change_chat_status($cid, 3, intval($request['agent_id']))){
|
25 |
+
|
26 |
+
|
27 |
+
do_action("wplc_hook_update_agent_id",$request['cid'],intval($request['agent_id']));
|
28 |
+
|
29 |
$return_array['response'] = "Chat accepted successfully";
|
30 |
$return_array['code'] = "200";
|
31 |
$return_array['data'] = array("chat_id" => intval($request['chat_id']),
|
130 |
return $return_array;
|
131 |
}
|
132 |
|
133 |
+
|
134 |
+
/*
|
135 |
+
* Edit a message in DB
|
136 |
+
* Required GET/POST variables:
|
137 |
+
* - Token
|
138 |
+
* - Chat ID (Rel)
|
139 |
+
* - Message
|
140 |
+
* - Message ID (Rel)
|
141 |
+
*/
|
142 |
+
function wplc_edit_message(WP_REST_Request $request){
|
143 |
+
$return_array = array();
|
144 |
+
if(isset($request)){
|
145 |
+
if(isset($request['server_token'])){
|
146 |
+
$check_token = get_option('wplc_api_secret_token');
|
147 |
+
if($check_token !== false && $request['server_token'] === $check_token){
|
148 |
+
if(isset($request['chat_id'])){
|
149 |
+
if(isset($request['message'])){
|
150 |
+
if(isset($request['msg_id'])){
|
151 |
+
global $wpdb;
|
152 |
+
global $wplc_tblname_msgs;
|
153 |
+
|
154 |
+
$chat_id = sanitize_text_field($request['chat_id']);
|
155 |
+
$message = sanitize_text_field($request['message']);
|
156 |
+
$msg_id = sanitize_text_field($request['msg_id']); //We assume this is rel
|
157 |
+
|
158 |
+
if( ! filter_var($chat_id, FILTER_VALIDATE_INT) ) {
|
159 |
+
/* We need to identify if this CID is a node CID, and if so, return the WP CID */
|
160 |
+
$chat_id = wplc_return_chat_id_by_rel($chat_id);
|
161 |
+
}
|
162 |
+
|
163 |
+
$message = apply_filters("wplc_filter_message_control", $message);
|
164 |
+
|
165 |
+
|
166 |
+
if(!empty($chat_id) && !empty($message) && !empty($msg_id)){
|
167 |
+
$wpdb->update(
|
168 |
+
$wplc_tblname_msgs,
|
169 |
+
array(
|
170 |
+
'msg' => $message
|
171 |
+
),
|
172 |
+
array(
|
173 |
+
'chat_sess_id' => $chat_id,
|
174 |
+
'rel' => $msg_id
|
175 |
+
)
|
176 |
+
);
|
177 |
+
|
178 |
+
$return_array['response'] = "Success";
|
179 |
+
$return_array['code'] = "200";
|
180 |
+
|
181 |
+
} else {
|
182 |
+
$return_array['response'] = "One or more value not set";
|
183 |
+
$return_array['code'] = "401";
|
184 |
+
$return_array['requirements'] = array("server_token" => "YOUR_SECRET_TOKEN",
|
185 |
+
"chat_id" => "Chat ID",
|
186 |
+
"message" => "Message",
|
187 |
+
"msg_id" => "Your Message ID");
|
188 |
+
}
|
189 |
+
|
190 |
+
|
191 |
+
} else {
|
192 |
+
$return_array['response'] = "No 'msg_id' found";
|
193 |
+
$return_array['code'] = "401";
|
194 |
+
$return_array['requirements'] = array("server_token" => "YOUR_SECRET_TOKEN",
|
195 |
+
"chat_id" => "Chat ID",
|
196 |
+
"message" => "Message",
|
197 |
+
"msg_id" => "Your Message ID");
|
198 |
+
}
|
199 |
+
} else {
|
200 |
+
$return_array['response'] = "No 'message' found";
|
201 |
+
$return_array['code'] = "401";
|
202 |
+
$return_array['requirements'] = array("server_token" => "YOUR_SECRET_TOKEN",
|
203 |
+
"chat_id" => "Chat ID",
|
204 |
+
"message" => "Message",
|
205 |
+
"msg_id" => "Your Message ID");
|
206 |
+
}
|
207 |
+
} else {
|
208 |
+
$return_array['response'] = "No 'chat_id' found";
|
209 |
+
$return_array['code'] = "401";
|
210 |
+
$return_array['requirements'] = array("server_token" => "YOUR_SECRET_TOKEN",
|
211 |
+
"chat_id" => "Chat ID",
|
212 |
+
"message" => "Message",
|
213 |
+
"msg_id" => "Your Message ID");
|
214 |
+
}
|
215 |
+
} else {
|
216 |
+
$return_array['response'] = "Secret server_token is invalid";
|
217 |
+
$return_array['code'] = "401";
|
218 |
+
}
|
219 |
+
}else{
|
220 |
+
$return_array['response'] = "No secret 'server_token' found";
|
221 |
+
$return_array['code'] = "401";
|
222 |
+
$return_array['requirements'] = array("server_token" => "YOUR_SECRET_TOKEN",
|
223 |
+
"chat_id" => "Chat ID",
|
224 |
+
"message" => "Message",
|
225 |
+
"msg_id" => "Your Message ID");
|
226 |
+
}
|
227 |
+
}else{
|
228 |
+
$return_array['response'] = "No request data found";
|
229 |
+
$return_array['code'] = "400";
|
230 |
+
$return_array['requirements'] = array("server_token" => "YOUR_SECRET_TOKEN",
|
231 |
+
"chat_id" => "Chat ID",
|
232 |
+
"message" => "Message",
|
233 |
+
"msg_id" => "Your Message ID");
|
234 |
+
}
|
235 |
+
|
236 |
+
return $return_array;
|
237 |
+
}
|
238 |
+
|
239 |
+
|
240 |
/*
|
241 |
* Send a message to a chat within the WP Live Chat Support Dashboard
|
242 |
* Required GET/POST variables:
|
247 |
function wplc_api_send_message(WP_REST_Request $request){
|
248 |
$return_array = array();
|
249 |
if(isset($request)){
|
250 |
+
if(isset($request['server_token'])){
|
251 |
$check_token = get_option('wplc_api_secret_token');
|
252 |
+
if($check_token !== false && $request['server_token'] === $check_token){
|
253 |
if(isset($request['chat_id'])){
|
254 |
if(isset($request['message'])){
|
255 |
+
if(isset($request['relay_action'])){
|
256 |
+
|
257 |
+
$chat_id = sanitize_text_field($request['chat_id']);
|
258 |
+
$message = $request['message'];
|
259 |
+
$action = $request['relay_action'];
|
260 |
+
|
261 |
+
if (!empty($request['msg_id'])) {
|
262 |
+
$other = new stdClass();
|
263 |
+
$other->msgID = $request['msg_id'];
|
264 |
+
} else {
|
265 |
+
$other = false;
|
266 |
+
}
|
267 |
+
|
268 |
+
if($action == "wplc_user_send_msg"){
|
269 |
+
$message = sanitize_text_field($message);
|
270 |
+
|
271 |
+
wplc_record_chat_msg("1", $chat_id, $message, false, false, $other);
|
272 |
+
wplc_update_active_timestamp($chat_id);
|
273 |
+
|
274 |
+
$return_array['response'] = "Message sent successfully";
|
275 |
+
$return_array['code'] = "200";
|
276 |
+
$return_array['data'] = array("chat_id" => intval($request['chat_id']),
|
277 |
+
"agent_id" => intval($request['agent_id']));
|
278 |
+
|
279 |
+
|
280 |
+
} else if ($action == "wplc_admin_send_msg"){
|
281 |
+
$message = sanitize_text_field($message);
|
282 |
+
wplc_record_chat_msg("2", $chat_id, $message, true, sanitize_text_field( $request['agent_id'] ), $other);
|
283 |
+
wplc_update_active_timestamp($chat_id);
|
284 |
+
|
285 |
+
$return_array['response'] = "Message sent successfully";
|
286 |
+
$return_array['code'] = "200";
|
287 |
+
$return_array['data'] = array("chat_id" => intval($request['chat_id']),
|
288 |
+
"agent_id" => intval($request['agent_id']));
|
289 |
+
|
290 |
+
do_action("wplc_new_user_message_after_record_hook", $chat_id, $message);
|
291 |
+
}
|
292 |
+
|
293 |
+
|
294 |
+
|
295 |
+
} else {
|
296 |
+
$return_array['request_information'] = __("Action not set", "wplivechat");
|
297 |
+
}
|
298 |
} else {
|
299 |
$return_array['response'] = "No 'message' found";
|
300 |
$return_array['code'] = "401";
|
301 |
+
$return_array['requirements'] = array("server_token" => "YOUR_SECRET_TOKEN",
|
302 |
"chat_id" => "Chat ID",
|
303 |
"message" => "Message");
|
304 |
}
|
305 |
} else {
|
306 |
$return_array['response'] = "No 'chat_id' found";
|
307 |
$return_array['code'] = "401";
|
308 |
+
$return_array['requirements'] = array("server_token" => "YOUR_SECRET_TOKEN",
|
309 |
"chat_id" => "Chat ID",
|
310 |
"message" => "Message");
|
311 |
}
|
312 |
} else {
|
313 |
+
$return_array['response'] = "Secret server_token is invalid";
|
314 |
$return_array['code'] = "401";
|
315 |
}
|
316 |
}else{
|
317 |
+
$return_array['response'] = "No secret 'server_token' found";
|
318 |
$return_array['code'] = "401";
|
319 |
+
$return_array['requirements'] = array("server_token" => "YOUR_SECRET_TOKEN",
|
320 |
"chat_id" => "Chat ID",
|
321 |
"message" => "Message");
|
322 |
}
|
323 |
}else{
|
324 |
$return_array['response'] = "No request data found";
|
325 |
$return_array['code'] = "400";
|
326 |
+
$return_array['requirements'] = array("server_token" => "YOUR_SECRET_TOKEN",
|
327 |
"chat_id" => "Chat ID",
|
328 |
"message" => "Message");
|
329 |
}
|
383 |
return $return_array;
|
384 |
}
|
385 |
|
386 |
+
|
387 |
/*
|
388 |
* Fetch a chat status within the WP Live Chat Support Dashboard
|
389 |
* Required GET/POST variables:
|
409 |
$offset = intval($request['offset']);
|
410 |
}
|
411 |
|
412 |
+
if ( isset( $request['received_via'] ) ) {
|
413 |
+
$received_via = sanitize_text_field( $request['received_via'] );
|
414 |
+
} else {
|
415 |
+
$received_via = 'u';
|
416 |
+
}
|
417 |
+
|
418 |
+
$message_data = wplc_api_return_messages($request['chat_id'], $limit, $offset, $received_via);
|
419 |
|
420 |
if($message_data){
|
421 |
$return_array['response'] = "Message data returned";
|
533 |
/*
|
534 |
* Returns messages from server
|
535 |
*/
|
536 |
+
function wplc_api_return_messages($cid, $limit, $offset, $received_via = 'u'){
|
|
|
|
|
|
|
|
|
|
|
|
|
537 |
|
538 |
+
$cid = wplc_return_chat_id_by_rel($cid);
|
|
|
539 |
|
540 |
+
$messages = wplc_return_chat_messages( $cid, false, true, false, false, 'array', false );
|
541 |
|
542 |
+
if ($received_via === 'u') {
|
543 |
+
wplc_mark_as_read_user_chat_messages( $cid );
|
544 |
+
} else {
|
545 |
+
wplc_mark_as_read_agent_chat_messages( $cid, $received_via );
|
546 |
+
}
|
547 |
+
return $messages;
|
548 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
549 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
550 |
}
|
551 |
|
552 |
|
604 |
}
|
605 |
|
606 |
|
607 |
+
/**
|
608 |
+
* Starts a chat
|
609 |
+
* @param $name string <Visitors Name>
|
610 |
+
* @param $email string <Visitors Email Address>
|
611 |
+
* @param $session string <Visitors Session ID>
|
612 |
+
* @param $wplc_cid int <Current visitor chat ID>
|
613 |
+
* @return $return_array array
|
614 |
+
*/
|
615 |
+
function wplc_api_call_start_chat( WP_REST_Request $request ){
|
616 |
+
|
617 |
+
$return_array = array();
|
618 |
+
|
619 |
+
if(isset($request)){
|
620 |
+
|
621 |
+
if( isset( $request['server_token'] ) ){
|
622 |
+
|
623 |
+
if( isset( $request['wplc_name'] ) && isset( $request['wplc_email'] ) && isset( $request['session'] ) ){
|
624 |
+
|
625 |
+
$cid = isset( $request['wplc_cid'] ) ? intval( $request['wplc_cid'] ) : null;
|
626 |
+
|
627 |
+
|
628 |
+
|
629 |
+
global $wpdb;
|
630 |
+
global $wplc_tblname_chats;
|
631 |
+
|
632 |
+
$wplc_settings = get_option('WPLC_SETTINGS');
|
633 |
+
|
634 |
+
if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
|
635 |
+
if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {
|
636 |
+
$ip_address = sanitize_text_field($_SERVER['HTTP_X_FORWARDED_FOR']);
|
637 |
+
} else {
|
638 |
+
$ip_address = sanitize_text_field($_SERVER['REMOTE_ADDR']);
|
639 |
+
}
|
640 |
+
$user_data = array(
|
641 |
+
'ip' => $ip_address,
|
642 |
+
'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
|
643 |
+
);
|
644 |
+
$wplc_ce_ip = $ip_address;
|
645 |
+
} else {
|
646 |
+
$user_data = array(
|
647 |
+
'ip' => "",
|
648 |
+
'user_agent' => sanitize_text_field($_SERVER['HTTP_USER_AGENT'])
|
649 |
+
);
|
650 |
+
$wplc_ce_ip = null;
|
651 |
+
}
|
652 |
+
|
653 |
+
|
654 |
+
|
655 |
+
$other_data = array();
|
656 |
+
$other_data['unanswered'] = true;
|
657 |
+
|
658 |
+
$other_data = apply_filters("wplc_start_chat_hook_other_data_hook", $other_data);
|
659 |
+
|
660 |
+
$wpdb->insert(
|
661 |
+
$wplc_tblname_chats,
|
662 |
+
array(
|
663 |
+
'status' => 2,
|
664 |
+
'timestamp' => current_time('mysql'),
|
665 |
+
'name' => $request['wplc_name'],
|
666 |
+
'email' => $request['wplc_email'],
|
667 |
+
'session' => $request['session'],
|
668 |
+
'ip' => maybe_serialize($user_data),
|
669 |
+
'url' => $request['url'],
|
670 |
+
'last_active_timestamp' => current_time('mysql'),
|
671 |
+
'other' => maybe_serialize($other_data),
|
672 |
+
'rel' => $request['cid']
|
673 |
+
),
|
674 |
+
array(
|
675 |
+
'%s',
|
676 |
+
'%s',
|
677 |
+
'%s',
|
678 |
+
'%s',
|
679 |
+
'%s',
|
680 |
+
'%s',
|
681 |
+
'%s',
|
682 |
+
'%s',
|
683 |
+
'%s',
|
684 |
+
'%s'
|
685 |
+
)
|
686 |
+
);
|
687 |
+
|
688 |
+
$cid = $wpdb->insert_id;
|
689 |
+
|
690 |
+
/* Nick: moved from top of function to bottom of function to try speed up the process of accepting the chart - version 7 */
|
691 |
+
if (function_exists("wplc_list_chats_pro")) { /* check if functions-pro is around */
|
692 |
+
wplc_pro_notify_via_email();
|
693 |
+
}
|
694 |
+
|
695 |
+
do_action("wplc_start_chat_hook_after_data_insert", $cid, 2, $request['wplc_name']);
|
696 |
+
|
697 |
+
do_action("wplc_change_chat_status_hook", $cid, 2); /* so we fire off onesignal events */
|
698 |
+
|
699 |
+
|
700 |
+
$return_array['response'] = "Visitor successfully started chat";
|
701 |
+
$return_array['code'] = "200";
|
702 |
+
$return_array['data'] = array( 'wplc_cid' => $cid );
|
703 |
+
|
704 |
+
} else {
|
705 |
+
|
706 |
+
$return_array['response'] = "Missing Parameter";
|
707 |
+
$return_array['code'] = "401";
|
708 |
+
$return_array['requirements'] = array( 'wplc_name' => 'VISITORS_NAME', 'wplc_email' => 'VISITORS_EMAIL', 'session' => 'VISITORS_SESSION' );
|
709 |
+
|
710 |
+
}
|
711 |
+
|
712 |
+
} else{
|
713 |
+
|
714 |
+
$return_array['response'] = "No 'security' found";
|
715 |
+
$return_array['code'] = "401";
|
716 |
+
$return_array['requirements'] = array( 'server_token' => 'SECRET_TOKEN', 'wplc_name' => 'VISITORS_NAME', 'wplc_email' => 'VISITORS_EMAIL', 'session' => 'VISITORS_SESSION' );
|
717 |
+
|
718 |
+
}
|
719 |
+
|
720 |
+
}else{
|
721 |
+
|
722 |
+
$return_array['response'] = "No request data found";
|
723 |
+
$return_array['code'] = "400";
|
724 |
+
$return_array['requirements'] = array( 'server_token' => 'SECRET_TOKEN', 'wplc_name' => 'VISITORS_NAME', 'wplc_email' => 'VISITORS_EMAIL', 'session' => 'VISITORS_SESSION' );
|
725 |
+
|
726 |
+
}
|
727 |
+
|
728 |
+
return $return_array;
|
729 |
+
|
730 |
+
}
|
731 |
+
|
732 |
+
|
733 |
|
734 |
/**
|
735 |
* EXPIRIMENTAL - Works when changing the ajaxurl to the relevat endpoint
|
1021 |
}
|
1022 |
|
1023 |
return $return_array;
|
1024 |
+
}
|
1025 |
+
|
1026 |
+
/*
|
1027 |
+
* Upload end point
|
1028 |
+
*/
|
1029 |
+
function wplc_api_remote_upload(WP_REST_Request $request){
|
1030 |
+
$return_array = array();
|
1031 |
+
$return_array['response'] = 'false';
|
1032 |
+
|
1033 |
+
$return_array = apply_filters("wplc_api_remote_upload_filter", $return_array, $request); //Filter for use in pro
|
1034 |
+
|
1035 |
+
return $return_array;
|
1036 |
+
}
|
1037 |
+
|
1038 |
+
/*
|
1039 |
+
* Rest Permission check for restricted end points
|
1040 |
+
*/
|
1041 |
+
function wplc_api_permission_check(){
|
1042 |
+
$wplc_rest_access_allowed = check_ajax_referer( 'wp_rest', '_wpnonce', false );
|
1043 |
+
if($wplc_rest_access_allowed === false){
|
1044 |
+
//Check if the special access token is here
|
1045 |
+
if(isset($_REQUEST['auth_forced']) && $_REQUEST['auth_forced'] === "90e1da97979422f558a517c1668fde93"){
|
1046 |
+
$wplc_rest_access_allowed = true;
|
1047 |
+
}
|
1048 |
+
}
|
1049 |
+
return $wplc_rest_access_allowed;
|
1050 |
+
}
|
1051 |
+
|
1052 |
+
function wplc_validate_agent_check(WP_REST_Request $request){
|
1053 |
+
$return_array = array();
|
1054 |
+
if(isset($request)){
|
1055 |
+
if(isset($request['agent_id'])){
|
1056 |
+
if( get_user_meta(intval($request['agent_id']), 'wplc_ma_agent', true) ){
|
1057 |
+
$return_array['response'] = "true";
|
1058 |
+
$return_array['code'] = "200";
|
1059 |
+
} else {
|
1060 |
+
$return_array['response'] = "false";
|
1061 |
+
$return_array['code'] = "200";
|
1062 |
+
}
|
1063 |
+
}else{
|
1064 |
+
$return_array['response'] = "No Agent ID found";
|
1065 |
+
$return_array['code'] = "401";
|
1066 |
+
$return_array['requirements'] = array("agent_id" => "Agent ID");
|
1067 |
+
}
|
1068 |
+
}else{
|
1069 |
+
$return_array['response'] = "No request data found";
|
1070 |
+
$return_array['code'] = "400";
|
1071 |
+
$return_array['requirements'] = array("agent_id" => "Agent ID");
|
1072 |
+
}
|
1073 |
+
|
1074 |
+
return $return_array;
|
1075 |
}
|
modules/api/wplc-api-routes.php
CHANGED
@@ -9,41 +9,63 @@
|
|
9 |
add_action('rest_api_init', 'wplc_rest_routes_init');
|
10 |
|
11 |
function wplc_rest_routes_init() {
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
}
|
9 |
add_action('rest_api_init', 'wplc_rest_routes_init');
|
10 |
|
11 |
function wplc_rest_routes_init() {
|
12 |
+
register_rest_route('wp_live_chat_support/v1','/accept_chat', array(
|
13 |
+
'methods' => 'GET, POST',
|
14 |
+
'callback' => 'wplc_api_accept_chat',
|
15 |
+
'permission_callback' => 'wplc_api_permission_check'
|
16 |
+
));
|
17 |
+
|
18 |
+
register_rest_route('wp_live_chat_support/v1','/end_chat', array(
|
19 |
+
'methods' => 'GET, POST',
|
20 |
+
'callback' => 'wplc_api_end_chat',
|
21 |
+
'permission_callback' => 'wplc_api_permission_check'
|
22 |
+
));
|
23 |
+
|
24 |
+
register_rest_route('wp_live_chat_support/v1','/send_message', array(
|
25 |
+
'methods' => 'GET, POST',
|
26 |
+
'callback' => 'wplc_api_send_message',
|
27 |
+
'permission_callback' => 'wplc_api_permission_check'
|
28 |
+
));
|
29 |
+
|
30 |
+
register_rest_route('wp_live_chat_support/v1','/get_status', array(
|
31 |
+
'methods' => 'GET, POST',
|
32 |
+
'callback' => 'wplc_api_get_status'
|
33 |
+
));
|
34 |
+
|
35 |
+
register_rest_route('wp_live_chat_support/v1','/get_messages', array(
|
36 |
+
'methods' => 'GET, POST',
|
37 |
+
'callback' => 'wplc_api_get_messages',
|
38 |
+
'permission_callback' => 'wplc_api_permission_check'
|
39 |
+
));
|
40 |
+
|
41 |
+
register_rest_route('wp_live_chat_support/v1','/get_sessions', array(
|
42 |
+
'methods' => 'GET, POST',
|
43 |
+
'callback' => 'wplc_api_get_sessions'
|
44 |
+
));
|
45 |
+
|
46 |
+
register_rest_route('wp_live_chat_support/v1','/call_to_server_visitor', array(
|
47 |
+
'methods' => 'GET, POST',
|
48 |
+
'callback' => 'wplc_api_call_to_server_visitor'
|
49 |
+
));
|
50 |
+
|
51 |
+
register_rest_route('wp_live_chat_support/v1','/start_chat', array(
|
52 |
+
'methods' => 'GET, POST',
|
53 |
+
'callback' => 'wplc_api_call_start_chat'
|
54 |
+
));
|
55 |
+
|
56 |
+
register_rest_route('wp_live_chat_support/v1','/remote_upload', array(
|
57 |
+
'methods' => 'GET, POST',
|
58 |
+
'callback' => 'wplc_api_remote_upload',
|
59 |
+
));
|
60 |
+
register_rest_route('wp_live_chat_support/v1','/validate_agent', array(
|
61 |
+
'methods' => 'GET, POST',
|
62 |
+
'callback' => 'wplc_validate_agent_check',
|
63 |
+
));
|
64 |
+
register_rest_route('wp_live_chat_support/v1','/edit_message', array(
|
65 |
+
'methods' => 'GET, POST',
|
66 |
+
'callback' => 'wplc_edit_message',
|
67 |
+
'permission_callback' => 'wplc_api_permission_check'
|
68 |
+
));
|
69 |
+
|
70 |
+
do_action("wplc_api_route_hook");
|
71 |
}
|
modules/api/wplc-api.php
CHANGED
@@ -41,7 +41,7 @@ function wplc_api_settings_tab_heading($tab_array) {
|
|
41 |
$tab_array['api'] = array(
|
42 |
"href" => "#tabs-api",
|
43 |
"icon" => 'fa fa-plug',
|
44 |
-
"label" => __("
|
45 |
);
|
46 |
return $tab_array;
|
47 |
}
|
41 |
$tab_array['api'] = array(
|
42 |
"href" => "#tabs-api",
|
43 |
"icon" => 'fa fa-plug',
|
44 |
+
"label" => __("REST API","wplivechat")
|
45 |
);
|
46 |
return $tab_array;
|
47 |
}
|
modules/beta_features.php
CHANGED
@@ -10,8 +10,8 @@ add_filter("wplc_filter_setting_tabs","wplc_beta_settings_tab_heading");
|
|
10 |
function wplc_beta_settings_tab_heading($tab_array) {
|
11 |
$tab_array['beta'] = array(
|
12 |
"href" => "#tabs-beta",
|
13 |
-
"icon" => 'fa fa-
|
14 |
-
"label" => __("
|
15 |
);
|
16 |
return $tab_array;
|
17 |
}
|
@@ -22,65 +22,110 @@ add_action("wplc_hook_settings_page_more_tabs","wplc_beta_settings_tab_content")
|
|
22 |
* Adds 'Beta Features' content to settings area
|
23 |
*/
|
24 |
function wplc_beta_settings_tab_content() {
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
}
|
73 |
-
|
74 |
add_filter("wplc_settings_save_filter_hook", "wplc_beta_settings_save_hooked", 10, 1);
|
75 |
/**
|
76 |
* Save 'Beta Features' settings
|
77 |
*/
|
78 |
function wplc_beta_settings_save_hooked($wplc_data){
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
return $wplc_data;
|
86 |
}
|
10 |
function wplc_beta_settings_tab_heading($tab_array) {
|
11 |
$tab_array['beta'] = array(
|
12 |
"href" => "#tabs-beta",
|
13 |
+
"icon" => 'fa fa-bolt',
|
14 |
+
"label" => __("Advanced Features","wplivechat")
|
15 |
);
|
16 |
return $tab_array;
|
17 |
}
|
22 |
* Adds 'Beta Features' content to settings area
|
23 |
*/
|
24 |
function wplc_beta_settings_tab_content() {
|
25 |
+
$wplc_settings = get_option("WPLC_SETTINGS");
|
26 |
+
if(isset($_GET['wplc_action']) && $_GET['wplc_action'] === "node_server_new_token"){
|
27 |
+
if(function_exists("wplc_node_server_token_regenerate")){
|
28 |
+
wplc_node_server_token_regenerate();
|
29 |
+
}
|
30 |
+
}
|
31 |
+
$wplc_node_token = get_option("wplc_node_server_secret_token");
|
32 |
+
if(!$wplc_node_token){
|
33 |
+
$wplc_node_token = __("No token found", "wplivechat") . "...";
|
34 |
+
}
|
35 |
+
$wplc_end_point_override = get_option("wplc_end_point_override");
|
36 |
+
$wplc_end_point_override = $wplc_end_point_override === false ? "" : $wplc_end_point_override;
|
37 |
+
$wplc_new_chat_ringer_count = 5;
|
38 |
+
if(isset($wplc_settings['wplc_new_chat_ringer_count'])){
|
39 |
+
$wplc_new_chat_ringer_count = intval($wplc_settings['wplc_new_chat_ringer_count']);
|
40 |
+
}
|
41 |
+
?>
|
42 |
+
<div id="tabs-beta">
|
43 |
+
<h4><?php _e("Chat Server", "wplivechat") ?></h4>
|
44 |
+
<?php
|
45 |
+
/*if (function_exists("wplc_cloud_load_updates")) { echo "<p><span class='update-nag'>".__('The node server cannot be activated while using the Cloud extension as they are not compatible. Please deactivate the cloud extension to make use of the new Node server.','wplivechat')."</span></p>"; } */
|
46 |
+
do_action("wplc_admin_general_node_compat_check");
|
47 |
+
?>
|
48 |
+
<table class="wp-list-table widefat fixed striped pages">
|
49 |
+
<tbody>
|
50 |
+
<tr>
|
51 |
+
<td width="250" valign="top">
|
52 |
+
<label for="wplc_use_node_server"><?php _e("Use our server to handle chats","wplivechat"); ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e('Disabling this will result in the plugin reverting back to using the legacy chat dashboard.', 'wplivechat'); ?>"></i></label>
|
53 |
+
</td>
|
54 |
+
<td valign="top">
|
55 |
+
<input type="checkbox" value="1" name="wplc_use_node_server" <?php /*if (function_exists("wplc_cloud_load_updates")) { echo 'disabled="disabled" readonly="readonly"'; } */ ?> <?php if (isset($wplc_settings['wplc_use_node_server']) && $wplc_settings['wplc_use_node_server'] == '1') { echo "checked"; } ?>>
|
56 |
+
<small><em><?php _e("Disabling this will revert the chat dashboard back to the legacy version.", "wplivechat"); ?></em></small>
|
57 |
+
</td>
|
58 |
+
</tr>
|
59 |
+
<tr>
|
60 |
+
<td width="250" valign="top">
|
61 |
+
<label for="wplc_use_node_server"><?php _e("Chat server token","wplivechat"); ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e('Security token for accessing chats on the node server. Changing this will remove current chats', 'wplivechat'); ?>"></i></label>
|
62 |
+
</td>
|
63 |
+
<td valign="top">
|
64 |
+
<input type="text" value="<?php echo $wplc_node_token; ?>" id="wplc_node_token_input" name="wplc_node_token_input">
|
65 |
+
<a class="button button-secondary" href="?page=wplivechat-menu-settings&wplc_action=node_server_new_token"><?php _e("Generate New", "wplivechat"); ?></a>
|
66 |
+
<a class="button button-secondary" id='wplc_copy_code_btn' onclick=""><?php _e("Copy", "wplivechat"); ?></a>
|
67 |
+
</td>
|
68 |
+
</tr>
|
69 |
+
<tr>
|
70 |
+
<td width="250" valign="top">
|
71 |
+
<label for="wplc_end_point_override"><?php _e("Server end point override","wplivechat"); ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e('Do not change this unless advised to do so by a WP Live Chat Support representative', 'wplivechat'); ?>"></i></label>
|
72 |
+
</td>
|
73 |
+
<td valign="top">
|
74 |
+
<input type="text" value="<?php echo $wplc_end_point_override; ?>" id="wplc_end_point_override" name="wplc_end_point_override" placeholder="<?php _e('Leave empty unless advised by a WP Live Chat Support representative', 'wplivechat'); ?>">
|
75 |
+
</td>
|
76 |
+
</tr>
|
77 |
+
<?php do_action("wplc_hook_beta_options_content_inside_table"); ?>
|
78 |
+
<tr>
|
79 |
+
<td width="250" valign="top">
|
80 |
+
<label for="wplc_new_chat_ringer_count"><?php _e("Limit chat ring amount","wplivechat"); ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e('Limit the amount of time the new chat ringer will play', 'wplivechat'); ?>"></i></label>
|
81 |
+
</td>
|
82 |
+
<td valign="top">
|
83 |
+
<input type="number" value="<?php echo $wplc_new_chat_ringer_count; ?>" id="wplc_new_chat_ringer_count" name="wplc_new_chat_ringer_count">
|
84 |
+
</td>
|
85 |
+
</tr>
|
86 |
+
<tr>
|
87 |
+
<td width="250" valign="top"></td>
|
88 |
+
<td valign="top">
|
89 |
+
<span class='update-nag' style='margin-top:0; font-size:12px; border-color: #0180bc ;'><strong><?php _e("Did you know?", "wplivechat"); ?></strong><br> <?php _e('You can copy this node server token to multiple sites in order to manage more than one domain from a single chat dashboard','wplivechat'); ?></span>
|
90 |
+
</td>
|
91 |
+
</tr>
|
92 |
+
</tbody>
|
93 |
+
</table>
|
94 |
+
<script>
|
95 |
+
jQuery(function(){
|
96 |
+
jQuery("#wplc_copy_code_btn").click(function(){
|
97 |
+
|
98 |
+
jQuery("#wplc_node_token_input").select();
|
99 |
+
document.execCommand("copy");
|
100 |
+
jQuery("#wplc_node_token_input").blur();
|
101 |
+
jQuery(this).html("<i class='fa fa-check'></i>");
|
102 |
+
});
|
103 |
+
});
|
104 |
+
</script>
|
105 |
+
<?php
|
106 |
+
do_action("wplc_hook_beta_options_content");
|
107 |
+
?>
|
108 |
+
</div>
|
109 |
+
<?php
|
110 |
}
|
|
|
111 |
add_filter("wplc_settings_save_filter_hook", "wplc_beta_settings_save_hooked", 10, 1);
|
112 |
/**
|
113 |
* Save 'Beta Features' settings
|
114 |
*/
|
115 |
function wplc_beta_settings_save_hooked($wplc_data){
|
116 |
+
|
117 |
+
if (isset($_POST['wplc_use_node_server'])) { $wplc_data['wplc_use_node_server'] = esc_attr($_POST['wplc_use_node_server']); }
|
118 |
+
|
119 |
+
if (isset($_POST['wplc_node_token_input'])) {
|
120 |
+
$wplc_node_new_token = esc_attr($_POST['wplc_node_token_input']);
|
121 |
+
update_option("wplc_node_server_secret_token", $wplc_node_new_token);
|
122 |
+
}
|
123 |
+
|
124 |
+
if (isset($_POST['wplc_end_point_override'])) {
|
125 |
+
update_option("wplc_end_point_override", esc_attr($_POST['wplc_end_point_override']));
|
126 |
+
}
|
127 |
+
if (isset($_POST['wplc_new_chat_ringer_count'])) {
|
128 |
+
$wplc_data['wplc_new_chat_ringer_count'] = intval($_POST['wplc_new_chat_ringer_count']);
|
129 |
+
}
|
130 |
return $wplc_data;
|
131 |
}
|
modules/documentation_suggestions.php
CHANGED
File without changes
|
modules/google_analytics.php
CHANGED
@@ -13,7 +13,7 @@ function wplc_hook_settings_page_ga_integration() {
|
|
13 |
<table class="wp-list-table widefat fixed striped pages">
|
14 |
<tbody>
|
15 |
<tr>
|
16 |
-
<td width="
|
17 |
<label for="wplc_enable_ga"><?php _e("Enable Google Analytics Integration","wplivechat"); ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="When enabled we will send custom events to your Google Analytics account for events such as when a user starts a chat, sends an offline message, closes a chat, etc."></i></label>
|
18 |
</td>
|
19 |
<td valign="top">
|
13 |
<table class="wp-list-table widefat fixed striped pages">
|
14 |
<tbody>
|
15 |
<tr>
|
16 |
+
<td width="350" valign="top">
|
17 |
<label for="wplc_enable_ga"><?php _e("Enable Google Analytics Integration","wplivechat"); ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="When enabled we will send custom events to your Google Analytics account for events such as when a user starts a chat, sends an offline message, closes a chat, etc."></i></label>
|
18 |
</td>
|
19 |
<td valign="top">
|
modules/module_subscribe.php
CHANGED
File without changes
|
modules/node_server.php
CHANGED
@@ -3,10 +3,19 @@
|
|
3 |
* Node Code -> Insert pun here
|
4 |
*/
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
add_action("wplc_activate_hook", "wplc_node_server_token_check", 10);
|
7 |
add_action("wplc_update_hook", "wplc_node_server_token_check", 10);
|
8 |
/**
|
9 |
-
* Checks if a secret key has been created.
|
10 |
* If not create one for use in the API
|
11 |
*
|
12 |
* @return void
|
@@ -18,6 +27,17 @@ function wplc_node_server_token_check(){
|
|
18 |
}
|
19 |
}
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
/**
|
22 |
* Generates a new Secret Token
|
23 |
*
|
@@ -40,44 +60,47 @@ function wplc_node_server_token_regenerate(){
|
|
40 |
}
|
41 |
|
42 |
/**
|
43 |
-
* Post to the NODE server -
|
44 |
-
*
|
45 |
* @param string $route Route you would like to use for the node server
|
46 |
* @param string $form_data data to send
|
47 |
* @return string (or false on fail)
|
48 |
*/
|
49 |
function wplc_node_server_post($route, $form_data){
|
50 |
-
|
51 |
-
//$url = "http://" . "34.193.164.98:6086" . "/" . $route;
|
52 |
-
if(!isset($form_data['server_token'])){
|
53 |
-
$wplc_node_token = get_option("wplc_node_server_secret_token");
|
54 |
-
if(!$wplc_node_token){
|
55 |
-
if(function_exists("wplc_node_server_token_regenerate")){
|
56 |
-
wplc_node_server_token_regenerate();
|
57 |
-
$wplc_node_token = get_option("wplc_node_server_secret_token");
|
58 |
-
}
|
59 |
-
}
|
60 |
|
61 |
-
|
62 |
-
|
|
|
|
|
63 |
|
64 |
-
if(!isset($form_data['origin_url'])){
|
65 |
-
$ajax_url = admin_url('admin-ajax.php');
|
66 |
-
$origin_url = str_replace("/wp-admin/admin-ajax.php", "", $ajax_url);
|
67 |
-
$form_data['origin_url'] = $origin_url; //Add the security token
|
68 |
-
}
|
69 |
|
70 |
-
$
|
71 |
-
'
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
)
|
76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
$context = @stream_context_create($options);
|
78 |
-
$result = @file_get_contents($url, false, $context);
|
79 |
-
|
80 |
-
if ($result === FALSE) {
|
81 |
return false;
|
82 |
} else {
|
83 |
return $result;
|
@@ -92,167 +115,30 @@ add_action("wplc_hook_chat_notification","wplc_filter_notification_hook_node",20
|
|
92 |
*/
|
93 |
function wplc_filter_notification_hook_node($type,$cid,$data){
|
94 |
$wplc_settings = get_option("WPLC_SETTINGS");
|
95 |
-
if(isset($wplc_settings['wplc_use_node_server']) && intval($wplc_settings['wplc_use_node_server']) == 1) {
|
96 |
-
|
97 |
-
$msg = false;
|
98 |
-
$msg_admin = false;
|
99 |
|
|
|
|
|
|
|
|
|
100 |
|
101 |
-
$
|
102 |
switch($type){
|
103 |
-
case "user_loaded":
|
104 |
-
$msg_admin = sprintf( __("User is browsing <small><a href='%s' target='_BLANK'>%s</a></small>","wplivechat") , $data['uri'] , wplc_shortenurl($data['uri']) );
|
105 |
-
break;
|
106 |
-
case "await_agent":
|
107 |
-
/**
|
108 |
-
* Removed this as it is duplicated on the second loop to the server
|
109 |
-
*/
|
110 |
-
$msg = $data['msg'];
|
111 |
-
break;
|
112 |
-
case "joined":
|
113 |
-
$user_info = get_userdata(intval($data['aid']));
|
114 |
-
$agent = $user_info->display_name;
|
115 |
-
$msg = $agent . " ". __("has joined the chat.","wplivechat");
|
116 |
-
|
117 |
-
$agent_tagline = '';
|
118 |
-
$agent_bio = '';
|
119 |
-
$a_twitter = '';
|
120 |
-
$a_linkedin = '';
|
121 |
-
$a_facebook = '';
|
122 |
-
$a_website = '';
|
123 |
-
$social_links = '';
|
124 |
-
|
125 |
-
$tagline = get_user_meta( intval($data['aid']), '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( intval($data['aid']), '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( intval($data['aid']), 'wplc_user_twitter', true );
|
137 |
-
$a_linkedin = get_user_meta( intval($data['aid']), 'wplc_user_linkedin', true );
|
138 |
-
$a_facebook = get_user_meta( intval($data['aid']), 'wplc_user_facebook', true );
|
139 |
-
$a_website = get_user_meta( intval($data['aid']), 'wplc_user_website', true );
|
140 |
-
|
141 |
-
if ($a_twitter === '' && $a_linkedin === '' && $a_facebook === '' && $a_website === '') {
|
142 |
-
$social_links = '';
|
143 |
-
} else {
|
144 |
-
$social_links = '<span class="wplc_agent_infosection wplc_agent_social_links wplc-color-2">';
|
145 |
-
if ($a_twitter !== '') {
|
146 |
-
$social_links .= '<a href="'.$a_twitter.'" title="'.$agent.' - Twitter" border="0" rel="nofollow" target="_BLANK"><img src="'.plugins_url('/images/social/twitter.png',__FILE__).'" title="'.$agent.' - Twitter" border="0" /></a> ';
|
147 |
-
}
|
148 |
-
if ($a_linkedin !== '') {
|
149 |
-
$social_links .= '<a href="'.$a_linkedin.'" title="'.$agent.' - Twitter" border="0" rel="nofollow" target="_BLANK"><img src="'.plugins_url('/images/social/linkedin.png',__FILE__).'" title="'.$agent.' - LinkedIn" border="0" /></a> ';
|
150 |
-
}
|
151 |
-
if ($a_facebook !== '') {
|
152 |
-
$social_links .= '<a href="'.$a_facebook.'" title="'.$agent.' - Twitter" border="0" rel="nofollow" target="_BLANK"><img src="'.plugins_url('/images/social/facebook.png',__FILE__).'" title="'.$agent.' - Facebook" border="0" /></a> ';
|
153 |
-
}
|
154 |
-
if ($a_website !== '') {
|
155 |
-
$social_links .= '<a href="'.$a_website.'" title="'.$agent.' - Twitter" border="0" rel="nofollow" target="_BLANK"><img src="'.plugins_url('/images/social/website.png',__FILE__).'" title="'.$agent.' - Website" border="0" /></a> ';
|
156 |
-
}
|
157 |
-
$social_links .= '</span>';
|
158 |
-
}
|
159 |
-
|
160 |
-
$other = array(
|
161 |
-
'ntype' => 'joined',
|
162 |
-
'email' => md5($user_info->user_email),
|
163 |
-
'name' => $agent,
|
164 |
-
'aid' => $user_info->ID,
|
165 |
-
'agent_tagline' => $agent_tagline,
|
166 |
-
'agent_bio' => $agent_bio,
|
167 |
-
'social_links' => $social_links
|
168 |
-
);
|
169 |
-
break;
|
170 |
case "doc_suggestion":
|
171 |
$msg = $data['formatted_msg'];
|
172 |
-
$msg_admin = $data['formatted_msg_admin'];
|
173 |
-
break;
|
174 |
-
case "system_dep_transfer":
|
175 |
-
if(function_exists("wplc_filter_control_chat_notification_auto_department_transfer")){
|
176 |
-
$from_department = null;
|
177 |
-
$to_department = null;
|
178 |
-
|
179 |
-
if(isset($data['to_dep_id']) && isset($data['from_dep_id'])){
|
180 |
-
if(function_exists("wplc_get_department")){
|
181 |
-
$from_department = wplc_get_department(intval($data['from_dep_id']));
|
182 |
-
$to_department = wplc_get_department(intval($data['to_dep_id']));
|
183 |
-
}
|
184 |
-
}
|
185 |
-
|
186 |
-
//User
|
187 |
-
$msg = __("No agents available in","wplivechat") . " ";
|
188 |
-
if($from_department === null){
|
189 |
-
$msg .= __("selected department", "wplivechat");
|
190 |
-
} else {
|
191 |
-
$msg .= $from_department[0]->name;
|
192 |
-
}
|
193 |
-
$msg .= ", " . __("automatically transferring you to", "wplivechat") . " ";
|
194 |
-
if($to_department === null){
|
195 |
-
$msg .= __("the next available department", "wplivechat");
|
196 |
-
} else {
|
197 |
-
$msg .= $to_department[0]->name;
|
198 |
-
}
|
199 |
-
$msg .= ".";
|
200 |
-
|
201 |
-
//Admin
|
202 |
-
$msg_admin = __("User has been transfered from ","wplivechat") . " ";
|
203 |
-
if($from_department === null){
|
204 |
-
$msg_admin .= __("department", "wplivechat");
|
205 |
-
} else {
|
206 |
-
$msg_admin .= $from_department[0]->name;
|
207 |
-
}
|
208 |
-
|
209 |
-
if($to_department !== null){
|
210 |
-
$msg_admin .= __(" to ", "wplivechat") . " " . $to_department[0]->name;
|
211 |
-
}
|
212 |
-
$msg_admin .= " " . __("as there were no agents online") . ".";
|
213 |
-
}
|
214 |
-
break;
|
215 |
-
case "transfer":
|
216 |
-
|
217 |
-
$user_info = get_userdata(intval($data['aid']));
|
218 |
-
if( $user_info ){
|
219 |
-
$agent = $user_info->display_name;
|
220 |
-
} else {
|
221 |
-
$agent = "";
|
222 |
-
}
|
223 |
-
|
224 |
-
if(isset($data["auto_transfer"]) && $data["auto_transfer"] == true){
|
225 |
-
if(intval($data['aid']) === 0){
|
226 |
-
//Came from a department originally
|
227 |
-
$msg = __("Department took too long to respond, we are transferring this chat to the next available agent.","wplivechat");
|
228 |
-
} else {
|
229 |
-
$msg = $agent . " " . __("took too long to respond, we are transferring this chat to the next available agent.","wplivechat");
|
230 |
-
}
|
231 |
-
} else {
|
232 |
-
$msg = $agent . " ". __("has transferred the chat.","wplivechat");
|
233 |
-
}
|
234 |
-
|
235 |
-
$msg_admin = "<strong>" . __("User received this message", "wplivechat") . ":</strong> " . $msg;
|
236 |
-
|
237 |
break;
|
238 |
default:
|
239 |
break;
|
240 |
}
|
241 |
|
242 |
if(isset($cid)){
|
243 |
-
$cid = intval($cid);
|
244 |
if($msg !== false){
|
245 |
-
$
|
246 |
-
'
|
247 |
-
'
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
'originates' => '0',
|
252 |
-
'other' => $other
|
253 |
-
);
|
254 |
-
|
255 |
-
$user_request = wplc_node_server_post("system_message", $user_message);
|
256 |
|
257 |
if($user_request === false){
|
258 |
//Something is wrong
|
@@ -260,25 +146,6 @@ function wplc_filter_notification_hook_node($type,$cid,$data){
|
|
260 |
|
261 |
}
|
262 |
}
|
263 |
-
|
264 |
-
if($msg_admin !== false){
|
265 |
-
$agent_message = array(
|
266 |
-
'cid' => $cid,
|
267 |
-
'timestamp' => current_time('mysql'),
|
268 |
-
'msgfrom' => __('System notification',"wplivechat"),
|
269 |
-
'msg' => $msg_admin,
|
270 |
-
'status' => 0,
|
271 |
-
'originates' => '3'
|
272 |
-
);
|
273 |
-
|
274 |
-
$agent_request = wplc_node_server_post("system_message", $agent_message);
|
275 |
-
if($agent_request === false){
|
276 |
-
//Something is wrong
|
277 |
-
} else {
|
278 |
-
|
279 |
-
}
|
280 |
-
}
|
281 |
-
|
282 |
}
|
283 |
}
|
284 |
|
@@ -304,7 +171,7 @@ function wplc_api_node_routes(){
|
|
304 |
* - Chat ID
|
305 |
* - Security Key
|
306 |
* - Message (JSON encoded array)
|
307 |
-
* - Action
|
308 |
*
|
309 |
* @param WP_REST_Request $request Request Data
|
310 |
* @return void
|
@@ -329,6 +196,7 @@ function wplc_node_async_storage_rest(WP_REST_Request $request){
|
|
329 |
foreach ($message_data as $message) {
|
330 |
$message = sanitize_text_field($message);
|
331 |
wplc_record_chat_msg("1", $chat_id, $message);
|
|
|
332 |
//wplc_update_user_on_page($chat_id, "3", $chat_session); //Keep timestamp active
|
333 |
wplc_update_active_timestamp($chat_id);
|
334 |
}
|
@@ -339,6 +207,7 @@ function wplc_node_async_storage_rest(WP_REST_Request $request){
|
|
339 |
foreach ($message_data as $message) {
|
340 |
$message = sanitize_text_field($message);
|
341 |
wplc_record_chat_msg("2", $chat_id, $message, true);
|
|
|
342 |
//wplc_update_user_on_page($chat_id, "3", $chat_session); //Keep timestamp active
|
343 |
wplc_update_active_timestamp($chat_id);
|
344 |
}
|
@@ -365,7 +234,7 @@ function wplc_node_async_storage_rest(WP_REST_Request $request){
|
|
365 |
}
|
366 |
|
367 |
return $return_array;
|
368 |
-
|
369 |
}
|
370 |
|
371 |
add_action("wp_ajax_wplc_node_async_storage_ajax", "wplc_node_async_storage_ajax");
|
@@ -376,7 +245,7 @@ add_action("wp_ajax_nopriv_wplc_node_async_storage_ajax", "wplc_node_async_stora
|
|
376 |
* - Chat ID
|
377 |
* - Security Key
|
378 |
* - Message (JSON encoded array)
|
379 |
-
* - Action
|
380 |
*
|
381 |
* @return void
|
382 |
*/
|
@@ -437,111 +306,883 @@ function wplc_node_async_storage_ajax(){
|
|
437 |
}
|
438 |
|
439 |
return $return_array;
|
440 |
-
|
441 |
}
|
442 |
|
443 |
-
add_action("wplc_change_chat_status_hook", "wplc_node_notify_server_of_status_change", 10, 2);
|
444 |
/**
|
445 |
-
*
|
446 |
*
|
447 |
* @return void
|
448 |
*/
|
449 |
-
function
|
450 |
-
|
451 |
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
'originates' => '0'
|
482 |
-
);
|
483 |
-
|
484 |
-
|
485 |
-
$node_request = wplc_node_server_post("system_message", $system_message);
|
486 |
-
if($node_request === false){ } else { }
|
487 |
-
|
488 |
-
|
489 |
|
490 |
}
|
491 |
-
|
492 |
}
|
493 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
494 |
/**
|
495 |
-
*
|
496 |
-
*
|
497 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
498 |
* @return void
|
499 |
*/
|
500 |
-
function
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
505 |
}
|
506 |
-
return $other_data;
|
507 |
}
|
508 |
|
509 |
-
add_action(
|
510 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
511 |
/**
|
512 |
-
*
|
513 |
*
|
514 |
* @return void
|
515 |
*/
|
516 |
-
function
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
544 |
}
|
545 |
-
|
546 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
547 |
}
|
3 |
* Node Code -> Insert pun here
|
4 |
*/
|
5 |
|
6 |
+
define("BLEEPER_API_URL", "https://bleeper.io/app/api/v1/");
|
7 |
+
define("BLEEPER_REMOTE_DASH_ROUTE", "remote_dashboard.php");
|
8 |
+
|
9 |
+
define("BLEEPER_NODE_SERVER_URL", "https://bleeper.us-3.evennode.com");
|
10 |
+
|
11 |
+
//define("BLEEPER_NODE_SERVER_URL", "http://localhost:3000");
|
12 |
+
define("BLEEPER_NODE_END_POINTS_ROUTE", "api/v1/");
|
13 |
+
define("BLEEPER_NODE_END_POINT_TOKEN", "zf6fe1399sdfgsdfg02ad09ab6a8cb7345s");
|
14 |
+
|
15 |
add_action("wplc_activate_hook", "wplc_node_server_token_check", 10);
|
16 |
add_action("wplc_update_hook", "wplc_node_server_token_check", 10);
|
17 |
/**
|
18 |
+
* Checks if a secret key has been created.
|
19 |
* If not create one for use in the API
|
20 |
*
|
21 |
* @return void
|
27 |
}
|
28 |
}
|
29 |
|
30 |
+
add_action("wplc_admin_remote_dashboard_below", "wplc_admin_remote_dashboard_thank_you_footer");
|
31 |
+
/*
|
32 |
+
* Adds a simple thank you message to the footer of the dashboard
|
33 |
+
*/
|
34 |
+
function wplc_admin_remote_dashboard_thank_you_footer(){
|
35 |
+
echo "<p id='wplc_footer_message' style='display:none;'>";
|
36 |
+
echo __("Thank you for using WP Live Chat Support - Need assistance? Please get in touch here: ", "wplivechat");
|
37 |
+
echo "<a href='https://wp-livechat.com/contact-us/' rel='nofollow' target='_blank'>" . __("Contact us", "wplivechat") . "</a><span class='bleeper_stats'></span><span class='bleeper_instance'></span>";
|
38 |
+
echo "</p>";
|
39 |
+
}
|
40 |
+
|
41 |
/**
|
42 |
* Generates a new Secret Token
|
43 |
*
|
60 |
}
|
61 |
|
62 |
/**
|
63 |
+
* Post to the NODE server -
|
64 |
+
*
|
65 |
* @param string $route Route you would like to use for the node server
|
66 |
* @param string $form_data data to send
|
67 |
* @return string (or false on fail)
|
68 |
*/
|
69 |
function wplc_node_server_post($route, $form_data){
|
70 |
+
$url = BLEEPER_NODE_SERVER_URL . BLEEPER_NODE_END_POINTS_ROUTE . $route;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
+
$wplc_end_point_override = get_option("wplc_end_point_override");
|
73 |
+
if($wplc_end_point_override !== false && $wplc_end_point_override !== ""){
|
74 |
+
$url = $wplc_end_point_override . BLEEPER_NODE_END_POINTS_ROUTE . $route; //Use the override URL
|
75 |
+
}
|
76 |
|
|
|
|
|
|
|
|
|
|
|
77 |
|
78 |
+
if(!isset($form_data['token'])){
|
79 |
+
$form_data['token'] = BLEEPER_NODE_END_POINT_TOKEN; //Add the security token
|
80 |
+
}
|
81 |
+
|
82 |
+
if(!isset($form_data['api_key'])){
|
83 |
+
$wplc_node_token = get_option("wplc_node_server_secret_token");
|
84 |
+
if(!$wplc_node_token){
|
85 |
+
if(function_exists("wplc_node_server_token_regenerate")){
|
86 |
+
wplc_node_server_token_regenerate();
|
87 |
+
$wplc_node_token = get_option("wplc_node_server_secret_token");
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
$form_data['api_key'] = $wplc_node_token; //Add the security token
|
92 |
+
}
|
93 |
+
|
94 |
+
if(!isset($form_data['origin_url'])){
|
95 |
+
$ajax_url = admin_url('admin-ajax.php');
|
96 |
+
$origin_url = str_replace("/wp-admin/admin-ajax.php", "", $ajax_url);
|
97 |
+
$form_data['origin_url'] = $origin_url; //Add the security token
|
98 |
+
}
|
99 |
+
|
100 |
$context = @stream_context_create($options);
|
101 |
+
$result = @file_get_contents($url . "?" . http_build_query($form_data), false, $context);
|
102 |
+
|
103 |
+
if ($result === FALSE) {
|
104 |
return false;
|
105 |
} else {
|
106 |
return $result;
|
115 |
*/
|
116 |
function wplc_filter_notification_hook_node($type,$cid,$data){
|
117 |
$wplc_settings = get_option("WPLC_SETTINGS");
|
118 |
+
if(isset($wplc_settings['wplc_use_node_server']) && intval($wplc_settings['wplc_use_node_server']) == 1) {
|
|
|
|
|
|
|
119 |
|
120 |
+
if(filter_var($cid, FILTER_VALIDATE_INT) ) {
|
121 |
+
//Let's reverse the CID back to it's rel counterpart
|
122 |
+
$cid = wplc_return_chat_rel_by_id($cid);
|
123 |
+
}
|
124 |
|
125 |
+
$msg = false;
|
126 |
switch($type){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
case "doc_suggestion":
|
128 |
$msg = $data['formatted_msg'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
break;
|
130 |
default:
|
131 |
break;
|
132 |
}
|
133 |
|
134 |
if(isset($cid)){
|
|
|
135 |
if($msg !== false){
|
136 |
+
$form_data = array(
|
137 |
+
'chat_id' => $cid,
|
138 |
+
'notification_text' => $msg,
|
139 |
+
);
|
140 |
+
|
141 |
+
$user_request = wplc_node_server_post("user_chat_notification", $form_data);
|
|
|
|
|
|
|
|
|
|
|
142 |
|
143 |
if($user_request === false){
|
144 |
//Something is wrong
|
146 |
|
147 |
}
|
148 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
}
|
150 |
}
|
151 |
|
171 |
* - Chat ID
|
172 |
* - Security Key
|
173 |
* - Message (JSON encoded array)
|
174 |
+
* - Action
|
175 |
*
|
176 |
* @param WP_REST_Request $request Request Data
|
177 |
* @return void
|
196 |
foreach ($message_data as $message) {
|
197 |
$message = sanitize_text_field($message);
|
198 |
wplc_record_chat_msg("1", $chat_id, $message);
|
199 |
+
|
200 |
//wplc_update_user_on_page($chat_id, "3", $chat_session); //Keep timestamp active
|
201 |
wplc_update_active_timestamp($chat_id);
|
202 |
}
|
207 |
foreach ($message_data as $message) {
|
208 |
$message = sanitize_text_field($message);
|
209 |
wplc_record_chat_msg("2", $chat_id, $message, true);
|
210 |
+
|
211 |
//wplc_update_user_on_page($chat_id, "3", $chat_session); //Keep timestamp active
|
212 |
wplc_update_active_timestamp($chat_id);
|
213 |
}
|
234 |
}
|
235 |
|
236 |
return $return_array;
|
237 |
+
|
238 |
}
|
239 |
|
240 |
add_action("wp_ajax_wplc_node_async_storage_ajax", "wplc_node_async_storage_ajax");
|
245 |
* - Chat ID
|
246 |
* - Security Key
|
247 |
* - Message (JSON encoded array)
|
248 |
+
* - Action
|
249 |
*
|
250 |
* @return void
|
251 |
*/
|
306 |
}
|
307 |
|
308 |
return $return_array;
|
309 |
+
|
310 |
}
|
311 |
|
|
|
312 |
/**
|
313 |
+
* Loads remote dashboard
|
314 |
*
|
315 |
* @return void
|
316 |
*/
|
317 |
+
function wplc_admin_dashboard_layout_node( $location = 'dashboard' ){
|
318 |
+
if ( $location === 'dashboard') {
|
319 |
|
320 |
+
if( ! get_user_meta( get_current_user_id(), 'wplc_ma_agent', true ) ){
|
321 |
+
echo "<div class='error below-h1'>";
|
322 |
+
echo "<h2>".__("Error", "wplivechat")."</h2>";
|
323 |
+
echo "<p>".__("Only chat agents can access this page.", "wplivechat")."</p>";
|
324 |
+
echo "</div>";
|
325 |
+
return;
|
326 |
+
}
|
327 |
+
|
328 |
+
do_action("wplc_admin_remote_dashboard_above");
|
329 |
+
|
330 |
+
echo "<div id='bleeper_content_wrapper'></div>";
|
331 |
+
|
332 |
+
if ( ! isset( $_GET['action'] ) || 'history' !== $_GET['action'] ) {
|
333 |
+
|
334 |
+
echo "<div class='wplc_remote_dash_below_contianer'>";
|
335 |
+
do_action("wplc_admin_remote_dashboard_below");
|
336 |
+
echo "</div>";
|
337 |
+
|
338 |
+
}
|
339 |
+
} else {
|
340 |
+
do_action("wplc_admin_remote_dashboard_above");
|
341 |
+
|
342 |
+
echo "<div id='bleeper_content_wrapper'></div>";
|
343 |
+
|
344 |
+
if ( ! empty( $_GET['page'] ) && 'wplivechat-menu' === $_GET['page'] ) { // This div is also hidden by js under the same conditions
|
345 |
+
|
346 |
+
echo "<div class='wplc_remote_dash_below_contianer'>";
|
347 |
+
do_action("wplc_admin_remote_dashboard_below");
|
348 |
+
echo "</div>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
349 |
|
350 |
}
|
351 |
+
}
|
352 |
}
|
353 |
+
|
354 |
+
add_action("wplc_admin_remote_dashboard_below", "wplc_admin_remote_dashboard_below_delegate");
|
355 |
+
/*
|
356 |
+
* Delegates the below dashboard hooks
|
357 |
+
*/
|
358 |
+
function wplc_admin_remote_dashboard_below_delegate(){
|
359 |
+
do_action("wplc_hook_chat_dashboard_bottom");
|
360 |
+
}
|
361 |
+
|
362 |
+
add_action("wplc_hook_chat_dashboard_bottom","wplc_hook_control_dashboard_bottom_loading_logo",1);
|
363 |
/**
|
364 |
+
* Decides whether or not to show the available extensions for this area.
|
365 |
+
* @return void
|
366 |
+
* @since 6.0.00
|
367 |
+
* @author Nick Duncan <nick@codecabin.co.za>
|
368 |
+
*/
|
369 |
+
function wplc_hook_control_dashboard_bottom_loading_logo() {
|
370 |
+
$wplc_settings = get_option("WPLC_SETTINGS");
|
371 |
+
if(isset($wplc_settings['wplc_use_node_server']) && $wplc_settings['wplc_use_node_server'] == 1){
|
372 |
+
echo "<div id='wplc_footer_loading_icon'><img src='https://bleeper.io/app/assets/images/wplc_loading.png' width='50' /><br />Connecting...</div>";
|
373 |
+
}
|
374 |
+
}
|
375 |
+
|
376 |
+
add_action('admin_enqueue_scripts', 'wplc_enqueue_dashboard_popup_scripts');
|
377 |
+
/**
|
378 |
+
* Enqueues the scripts for the admin dashboard popup icon and chat box
|
379 |
+
* @return void
|
380 |
+
*/
|
381 |
+
function wplc_enqueue_dashboard_popup_scripts() {
|
382 |
+
global $wplc_version;
|
383 |
+
wp_enqueue_script('jquery-ui-draggable');
|
384 |
+
wp_enqueue_script('wplc-admin-popup', plugin_dir_url(__DIR__) . 'js/wplc_admin_popup.js', array(), $wplc_version);
|
385 |
+
|
386 |
+
wp_button_pointers_load_scripts('toplevel_page_wplivechat-menu');
|
387 |
+
}
|
388 |
+
|
389 |
+
add_action( "admin_footer", "wplc_dashboard_display_decide" );
|
390 |
+
/**
|
391 |
+
* Decide whether or not to display the dashboard layout on an admin page
|
392 |
+
* @return void
|
393 |
+
*/
|
394 |
+
function wplc_dashboard_display_decide() {
|
395 |
+
$wplc_settings = get_option("WPLC_SETTINGS");
|
396 |
+
if ( isset( $wplc_settings['wplc_use_node_server'] ) && $wplc_settings['wplc_use_node_server'] == 1 ) {
|
397 |
+
//Node in use, load remote dashboard
|
398 |
+
if ( isset( $_GET['page'] ) && $_GET['page'] === 'wplivechat-menu') {
|
399 |
+
// we control this in the wplc_admin_menu_layout function
|
400 |
+
//wplc_admin_dashboard_layout_node('dashboard');
|
401 |
+
} else {
|
402 |
+
if (function_exists("wplc_pro_version_control")) {
|
403 |
+
global $wplc_pro_version;
|
404 |
+
$wplc_ver = str_replace('.', '', $wplc_pro_version);
|
405 |
+
$checker = intval($wplc_ver);
|
406 |
+
if (function_exists("wplc_pro_version_control") && $checker < 8000) {
|
407 |
+
/* ONLY SHOW THE POPOUT DASHBOARD IF THEY ARE USING PRO 8.0.00 and above */
|
408 |
+
return;
|
409 |
+
}
|
410 |
+
}
|
411 |
+
|
412 |
+
|
413 |
+
/**
|
414 |
+
* Check to see if we have enabled "Enable chat dashboard and notifications on all admin pages"
|
415 |
+
*/
|
416 |
+
|
417 |
+
if ( isset( $wplc_settings['wplc_enable_all_admin_pages'] ) && $wplc_settings['wplc_enable_all_admin_pages'] === '1' ) {
|
418 |
+
|
419 |
+
|
420 |
+
wplc_admin_dashboard_layout_node('other');
|
421 |
+
|
422 |
+
echo '<div class="floating-right-toolbar">';
|
423 |
+
echo '<label for="user_list_bleeper_control" style="margin-bottom: 0; display:none;"></label>';
|
424 |
+
|
425 |
+
echo '<i id="toolbar-item-open-bleeper" class="fa fa-fw" style="background:url(\''.plugins_url('images/48px.png', dirname(__FILE__)).'\') no-repeat; background-size: cover;"></i>';
|
426 |
+
echo '</div>';
|
427 |
+
}
|
428 |
+
|
429 |
+
}
|
430 |
+
}
|
431 |
+
|
432 |
+
|
433 |
+
|
434 |
+
}
|
435 |
+
|
436 |
+
|
437 |
+
/**
|
438 |
+
* Loads remote dashboard scripts and styles
|
439 |
+
*
|
440 |
* @return void
|
441 |
*/
|
442 |
+
function wplc_admin_remote_dashboard_scripts($wplc_settings){
|
443 |
+
global $wplc_version;
|
444 |
+
$wplc_current_user = get_current_user_id();
|
445 |
+
if( get_user_meta( $wplc_current_user, 'wplc_ma_agent', true )) {
|
446 |
+
|
447 |
+
$user_info = get_userdata(intval($wplc_current_user));
|
448 |
+
|
449 |
+
$user_array = get_users(array(
|
450 |
+
'meta_key' => 'wplc_ma_agent',
|
451 |
+
));
|
452 |
+
|
453 |
+
$a_array = array();
|
454 |
+
if ($user_array) {
|
455 |
+
foreach ($user_array as $user) {
|
456 |
+
$current_user_name = apply_filters("wplc_agent_display_name_filter", $user->display_name);
|
457 |
+
$a_array[$user->ID] = array();
|
458 |
+
$a_array[$user->ID]['name'] = $user->display_name;
|
459 |
+
$a_array[$user->ID]['display_name'] = $user->display_name;
|
460 |
+
$a_array[$user->ID]['md5'] = md5( $user->user_email );
|
461 |
+
$a_array[$user->ID]['email'] = md5( $user->user_email );
|
462 |
+
}
|
463 |
+
}
|
464 |
+
|
465 |
+
|
466 |
+
if( isset($wplc_settings['wplc_show_name']) && $wplc_settings['wplc_show_name'] == '1' ){ $wplc_show_name = true; } else { $wplc_show_name = false; }
|
467 |
+
if( isset($wplc_settings['wplc_show_avatar']) && $wplc_settings['wplc_show_avatar'] ){ $wplc_show_avatar = true; } else { $wplc_show_avatar = false; }
|
468 |
+
if( isset($wplc_settings['wplc_show_date']) && $wplc_settings['wplc_show_date'] == '1' ){ $wplc_show_date = true; } else { $wplc_show_date = false; }
|
469 |
+
if( isset($wplc_settings['wplc_show_time']) && $wplc_settings['wplc_show_time'] == '1' ){ $wplc_show_time = true; } else { $wplc_show_time = false; }
|
470 |
+
|
471 |
+
$wplc_chat_detail = array( 'name' => $wplc_show_name, 'avatar' => $wplc_show_avatar, 'date' => $wplc_show_date, 'time' => $wplc_show_time );
|
472 |
+
|
473 |
+
|
474 |
+
|
475 |
+
|
476 |
+
$wplc_end_point_override = get_option("wplc_end_point_override");
|
477 |
+
if($wplc_end_point_override !== false && $wplc_end_point_override !== ""){
|
478 |
+
$bleeper_url = $wplc_end_point_override; //Use the override URL
|
479 |
+
} else {
|
480 |
+
$bleeper_url = BLEEPER_NODE_SERVER_URL;
|
481 |
+
}
|
482 |
+
|
483 |
+
|
484 |
+
|
485 |
+
|
486 |
+
wp_register_script('wplc-admin-js-sockets', trailingslashit( $bleeper_url ) . "socket.io/socket.io.js", false, $wplc_version, false);
|
487 |
+
//wp_register_script('wplc-admin-js-sockets', "http://localhost:3000/socket.io/socket.io.js", false, $wplc_version, false);
|
488 |
+
wp_enqueue_script('wplc-admin-js-sockets');
|
489 |
+
|
490 |
+
wp_register_script('wplc-admin-js-bootstrap', "https://bleeper.io/app/assets/js/bootstrap.js", array("wplc-admin-js-sockets"), $wplc_version, false);
|
491 |
+
wp_enqueue_script('wplc-admin-js-bootstrap');
|
492 |
+
|
493 |
+
// NB: This causes Failed to initVars ReferenceError: wplc_show_date is not defined when uncommented and enabled
|
494 |
+
if(empty($wplc_settings['wplc_disable_emojis']))
|
495 |
+
{
|
496 |
+
wp_register_script('wplc-admin-js-emoji', "https://bleeper.io/app/assets/wdt-emoji/emoji.min.js", array("wplc-admin-js-sockets"), $wplc_version, false);
|
497 |
+
wp_enqueue_script('wplc-admin-js-emoji');
|
498 |
+
|
499 |
+
wp_register_script('wplc-admin-js-emoji-bundle', "https://bleeper.io/app/assets/wdt-emoji/wdt-emoji-bundle.min.js", array("wplc-admin-js-emoji"), $wplc_version, false);
|
500 |
+
wp_enqueue_script('wplc-admin-js-emoji-bundle');
|
501 |
+
}
|
502 |
+
|
503 |
+
wp_register_script('md5', plugins_url( 'js/md5.js', __DIR__ ), array("wplc-admin-js-sockets"), false, false);
|
504 |
+
wp_enqueue_script('md5');
|
505 |
+
|
506 |
+
$dependencies = array();
|
507 |
+
if(empty($wplc_settings['wplc_disable_emojis']))
|
508 |
+
$dependencies[] = "wplc-admin-js-emoji-bundle";
|
509 |
+
wp_register_script('wplc-admin-js-agent', "https://bleeper.io/app/assets/js/bleeper-agent-dev.js", $dependencies, $wplc_version, false);
|
510 |
+
|
511 |
+
wp_localize_script('wplc-admin-js-agent', 'bleeper_remote_enabled', "true");
|
512 |
+
|
513 |
+
if (isset($wplc_settings['wplc_enable_msg_sound'])) {
|
514 |
+
|
515 |
+
if (intval($wplc_settings['wplc_enable_msg_sound']) == 1) {
|
516 |
+
wp_localize_script('wplc-admin-js-agent', "bleeper_ping_sound_notification_enabled", "true");
|
517 |
+
} else {
|
518 |
+
wp_localize_script('wplc-admin-js-agent', "bleeper_ping_sound_notification_enabled", "false");
|
519 |
+
}
|
520 |
+
|
521 |
+
}
|
522 |
+
|
523 |
+
wp_register_script('my-wplc-admin-chatbox-ui-events', plugins_url('../js/wplc_u_admin_chatbox_ui_events.js', __FILE__), array('jquery'), $wplc_version, true);
|
524 |
+
wp_enqueue_script('my-wplc-admin-chatbox-ui-events');
|
525 |
+
|
526 |
+
$wplc_node_token = get_option("wplc_node_server_secret_token");
|
527 |
+
if(!$wplc_node_token){
|
528 |
+
if(function_exists("wplc_node_server_token_regenerate")){
|
529 |
+
wplc_node_server_token_regenerate();
|
530 |
+
$wplc_node_token = get_option("wplc_node_server_secret_token");
|
531 |
+
}
|
532 |
+
}
|
533 |
+
|
534 |
+
$form_data = array("node_token" => $wplc_node_token, "action" => "wordpress");
|
535 |
+
$form_data = apply_filters("wplc_admin_dashboard_layout_node_request_variable_filter", $form_data); //Filter for pro to add a few request variables to the mix for additional structure
|
536 |
+
|
537 |
+
/*$options = array(
|
538 |
+
'http' => array(
|
539 |
+
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
|
540 |
+
'method' => 'POST',
|
541 |
+
'content' => http_build_query($form_data)
|
542 |
+
)
|
543 |
+
);
|
544 |
+
$context = @stream_context_create($options);
|
545 |
+
$result = @file_get_contents(BLEEPER_API_URL . BLEEPER_REMOTE_DASH_ROUTE, false, $context);*/
|
546 |
+
|
547 |
+
wp_localize_script('wplc-admin-js-agent', 'bleeper_remote_form_data_array', $form_data);
|
548 |
+
wp_localize_script('wplc-admin-js-agent', 'bleeper_remote_form_api_url', BLEEPER_API_URL);
|
549 |
+
wp_localize_script('wplc-admin-js-agent', 'bleeper_remote_form_route', BLEEPER_REMOTE_DASH_ROUTE);
|
550 |
+
|
551 |
+
|
552 |
+
if ( isset( $_GET['page'] ) && $_GET['page'] === 'wplivechat-menu' ) {
|
553 |
+
wp_localize_script('wplc-admin-js-agent', 'bleeper_in_dashboard', '1');
|
554 |
+
} else {
|
555 |
+
wp_localize_script('wplc-admin-js-agent', 'bleeper_in_dashboard', '0');
|
556 |
+
}
|
557 |
+
|
558 |
+
$inline_error_message = "<div class='error below-h1' style='display:none;' id='bleeper_inline_connection_error'>
|
559 |
+
<p>" . __("Connection Error", "wplivechat") . "<br /></p>
|
560 |
+
<p>" . __("We are having some trouble contacting the server. Please try again later.", "wplivechat") . "</p>
|
561 |
+
</div>";
|
562 |
+
wp_localize_script('wplc-admin-js-agent', 'bleeper_remote_form_error', $inline_error_message);
|
563 |
+
|
564 |
+
|
565 |
+
|
566 |
+
|
567 |
+
|
568 |
+
|
569 |
+
|
570 |
+
|
571 |
+
|
572 |
+
|
573 |
+
$agent_display_name = $user_info->display_name;
|
574 |
+
|
575 |
+
wp_localize_script('wplc-admin-js-agent', 'agent_id', "" . $wplc_current_user);
|
576 |
+
wp_localize_script('wplc-admin-js-agent', 'bleeper_agent_name', apply_filters("wplc_agent_display_name_filter", $agent_display_name) );
|
577 |
+
wp_localize_script('wplc-admin-js-agent', 'nifty_api_key', get_option("wplc_node_server_secret_token"));
|
578 |
+
|
579 |
+
//For node verification
|
580 |
+
if(function_exists("wplc_pro_activate")){
|
581 |
+
wp_localize_script('wplc-admin-js-agent', 'bleeper_pro_auth', get_option('wp-live-chat-support-pro_key', "false"));
|
582 |
+
} else {
|
583 |
+
wp_localize_script('wplc-admin-js-agent', 'bleeper_pro_auth', 'false');
|
584 |
+
}
|
585 |
+
wp_localize_script('wplc-admin-js-agent', 'bleeper_agent_verification_end_point', get_rest_url() . "wp_live_chat_support/v1/validate_agent");
|
586 |
+
wp_localize_script('wplc-admin-js-agent', 'bleeper_disable_mongo', "true");
|
587 |
+
wp_localize_script('wplc-admin-js-agent', 'bleeper_disable_add_message', "true");
|
588 |
+
wp_localize_script('wplc-admin-js-agent', 'wplc_nonce', wp_create_nonce("wplc"));
|
589 |
+
wp_localize_script('wplc-admin-js-agent', 'wplc_cid', "null");
|
590 |
+
wp_localize_script('wplc-admin-js-agent', 'wplc_chat_name', "null");
|
591 |
+
//wp_localize_script('wplc-admin-js-agent', 'wplc_chat_email', "null"); //TODO: Parse the email
|
592 |
+
|
593 |
+
wp_localize_script( 'wplc-admin-js-agent', 'wplc_show_chat_detail', $wplc_chat_detail );
|
594 |
+
|
595 |
+
wp_localize_script('wplc-admin-js-agent', 'wplc_agent_data', $a_array);
|
596 |
+
wp_localize_script('wplc-admin-js-agent', 'all_agents', $a_array);
|
597 |
+
|
598 |
+
wp_localize_script('wplc-admin-js-agent', 'wplc_url', plugins_url( '', dirname( __FILE__ ) ) );
|
599 |
+
|
600 |
+
if( isset($wplc_settings['wplc_settings_enabled']) && intval($wplc_settings["wplc_settings_enabled"]) == 2) {
|
601 |
+
|
602 |
+
$wplc_disabled_html = __("Chat is disabled in settings area, re-enable", "wplivechat");
|
603 |
+
$wplc_disabled_html .= " <a href='?page=wplivechat-menu-settings'>" . __("here", "wplivechat") . "</a>";
|
604 |
+
|
605 |
+
wp_localize_script('wplc-admin-js-agent', 'wplc_disabled', 'true');
|
606 |
+
wp_localize_script('wplc-admin-js-agent', 'wplc_disabled_html', $wplc_disabled_html);
|
607 |
+
}
|
608 |
+
|
609 |
+
|
610 |
+
//Added rest nonces
|
611 |
+
if(class_exists("WP_REST_Request")) {
|
612 |
+
wp_localize_script('wplc-admin-js-agent', 'wplc_restapi_enabled', '1');
|
613 |
+
wp_localize_script('wplc-admin-js-agent', 'wplc_restapi_token', get_option('wplc_api_secret_token'));
|
614 |
+
wp_localize_script('wplc-admin-js-agent', 'wplc_restapi_endpoint', site_url().'/wp-json/wp_live_chat_support/v1');
|
615 |
+
wp_localize_script('wplc-admin-js-agent', 'bleeper_override_upload_url', site_url().'/wp-json/wp_live_chat_support/v1/remote_upload');
|
616 |
+
wp_localize_script('wplc-admin-js-agent', 'wplc_restapi_nonce', wp_create_nonce( 'wp_rest' ));
|
617 |
+
|
618 |
+
} else {
|
619 |
+
wp_localize_script('wplc-admin-js-agent', 'wplc_restapi_enabled', '0');
|
620 |
+
wp_localize_script('wplc-admin-js-agent', 'wplc_restapi_nonce', "false");
|
621 |
+
}
|
622 |
+
|
623 |
+
$agent_tagline = apply_filters( "wplc_filter_simple_agent_data_agent_tagline", '', get_current_user_id() );
|
624 |
+
$agent_bio = apply_filters( "wplc_filter_simple_agent_data_agent_bio", '', '', get_current_user_id() );
|
625 |
+
$social_links = apply_filters( "wplc_filter_simple_agent_data_social_links", '', get_current_user_id() );
|
626 |
+
$head_data = array(
|
627 |
+
'tagline' => $agent_tagline,
|
628 |
+
'bio' => $agent_bio,
|
629 |
+
'social' => $social_links
|
630 |
+
);
|
631 |
+
wp_localize_script( 'wplc-admin-js-agent', 'wplc_head_data', $head_data );
|
632 |
+
wp_localize_script( 'wplc-admin-js-agent', 'wplc_user_chat_notification_prefix', __("User received notification:", "wplivechat") );
|
633 |
+
|
634 |
+
wp_localize_script( 'wplc-admin-js-agent', 'bleeper_valid_direct_to_page_array', wplc_node_pages_posts_array() );
|
635 |
+
|
636 |
+
if( isset($wplc_settings['wplc_new_chat_ringer_count']) && $wplc_settings['wplc_new_chat_ringer_count'] !== "") {
|
637 |
+
$wplc_ringer_count = intval($wplc_settings['wplc_new_chat_ringer_count']);
|
638 |
+
wp_localize_script( 'wplc-admin-js-agent', 'bleeper_ringer_count', "" . $wplc_ringer_count );
|
639 |
+
}
|
640 |
+
|
641 |
+
$wplc_end_point_override = get_option("wplc_end_point_override");
|
642 |
+
if($wplc_end_point_override !== false && $wplc_end_point_override !== ""){
|
643 |
+
wp_localize_script( 'wplc-admin-js-agent', 'bleeper_end_point_override', $wplc_end_point_override );
|
644 |
+
}
|
645 |
+
|
646 |
+
wp_localize_script( 'wplc-admin-js-agent', 'bleeper_new_chat_notification_title', __('New chat received', 'wplivechat') );
|
647 |
+
wp_localize_script( 'wplc-admin-js-agent', 'bleeper_new_chat_notification_text', __("A new chat has been received. Please go the 'Live Chat' page to accept the chat", "wplivechat") );
|
648 |
+
|
649 |
+
$wplc_notification_icon = plugin_dir_url(dirname(__FILE__)) . 'images/wplc_notification_icon.png';
|
650 |
+
wp_localize_script( 'wplc-admin-js-agent', 'bleeper_new_chat_notification_icon', $wplc_notification_icon );
|
651 |
+
|
652 |
+
do_action("wplc_admin_remoter_dashboard_scripts_localizer"); //For pro localization of agents list, and departments
|
653 |
+
|
654 |
+
wp_enqueue_script('wplc-admin-js-agent');
|
655 |
+
|
656 |
+
wp_register_script('wplc-admin-chat-server', plugins_url( 'js/wplc_server.js', __DIR__ ), array("wplc-admin-js-agent", "wplc-admin-js-sockets"), $wplc_version, false); //Added this for async storage calls
|
657 |
+
wp_enqueue_script('wplc-admin-chat-server');
|
658 |
+
|
659 |
+
wp_localize_script( 'wplc-admin-chat-server', 'wplc_datetime_format', array(
|
660 |
+
'date_format' => get_option( 'date_format' ),
|
661 |
+
'time_format' => get_option( 'time_format' ),
|
662 |
+
) );
|
663 |
+
|
664 |
+
wp_register_script('wplc-admin-chat-events', plugins_url( 'js/wplc_u_admin_events.js', __DIR__ ), array("wplc-admin-js-agent", "wplc-admin-js-sockets", "wplc-admin-chat-server"), $wplc_version, false); //Added this for async storage calls
|
665 |
+
wp_enqueue_script('wplc-admin-chat-events');
|
666 |
+
|
667 |
+
if (isset($wplc_settings['wplc_show_date']) && $wplc_settings["wplc_show_date"] == '1') {
|
668 |
+
wp_localize_script('wplc-admin-chat-server', 'wplc_show_date', 'true');
|
669 |
+
} else {
|
670 |
+
wp_localize_script('wplc-admin-chat-server', 'wplc_show_date', 'false');
|
671 |
+
}
|
672 |
+
|
673 |
+
if (isset($wplc_settings['wplc_show_time']) && $wplc_settings["wplc_show_time"] == '1') {
|
674 |
+
wp_localize_script('wplc-admin-chat-server', 'wplc_show_time', 'true');
|
675 |
+
} else {
|
676 |
+
wp_localize_script('wplc-admin-chat-server', 'wplc_show_time', 'false');
|
677 |
+
}
|
678 |
+
|
679 |
+
if (isset($wplc_settings['wplc_show_name']) && $wplc_settings["wplc_show_name"] == '1') {
|
680 |
+
wp_localize_script('wplc-admin-chat-server', 'wplc_show_name', 'true');
|
681 |
+
} else {
|
682 |
+
wp_localize_script('wplc-admin-chat-server', 'wplc_show_name', 'false');
|
683 |
+
}
|
684 |
+
|
685 |
+
if (isset($wplc_settings['wplc_show_avatar']) && $wplc_settings["wplc_show_avatar"] == '1') {
|
686 |
+
wp_localize_script('wplc-admin-chat-server', 'wplc_show_avatar', 'true');
|
687 |
+
} else {
|
688 |
+
wp_localize_script('wplc-admin-chat-server', 'wplc_show_avatar', 'false');
|
689 |
+
}
|
690 |
}
|
|
|
691 |
}
|
692 |
|
693 |
+
add_action("wplc_admin_remoter_dashboard_scripts_localizer", "wplc_admin_remote_dashboard_localize_upselling_tips");
|
694 |
+
/*
|
695 |
+
* Localizes an array of upselling tips
|
696 |
+
*/
|
697 |
+
function wplc_admin_remote_dashboard_localize_upselling_tips(){
|
698 |
+
$tips_header = __("Did you know?", "wplivechat");
|
699 |
+
|
700 |
+
$tips_array = array(
|
701 |
+
"0" => "<p><a href='http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=unlimited_agents_tip' title='".__("Add unlimited agents", "wplivechat")."' target=\"_BLANK\">".__("Add unlimited agents", "wplivechat")."</a> ".__(" with the Pro add-on of WP Live Chat Support","wplivechat")." "."<a href='http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=unlimited_agents_tip2' target='_BLANK'>".__("(once off payment).","wplivechat")."</a></p>",
|
702 |
+
"1" => "<p>".__("With the Pro add-on of WP Live Chat Support, you can", "wplivechat")." <a href='http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=initiate_tip' title='".__("see who's online and initiate chats", "wplivechat")."' target=\"_BLANK\">".__("initiate chats", "wplivechat")."</a> ".__("with your online visitors with the click of a button.", "wplivechat")." <br /><br /><a href='http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=initiate_tip2' title='".__("Buy the Pro add-on now (once off payment).", "wplivechat")."' target=\"_BLANK\"><strong>".__("Buy the Pro add-on now (once off payment).", "wplivechat")."</strong></a></p>",
|
703 |
+
"2" => "<p><a href='http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=transfer_tip' title='".__("Transfer Chats", "wplivechat")."' target=\"_BLANK\">".__("Transfer Chats", "wplivechat")."</a> ".__(" with the Pro add-on of WP Live Chat Support","wplivechat")." "."<a href='http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=transfer_tip2' target='_BLANK'>".__("(once off payment).","wplivechat")."</a></p>"
|
704 |
+
);
|
705 |
+
|
706 |
+
$tips_array = apply_filters("wplc_admin_remote_dashboard_localize_tips_array", $tips_array);
|
707 |
+
|
708 |
+
wp_localize_script( 'wplc-admin-js-agent', 'agent_to_agent_chat_upsell', sprintf(__('Chat to other agents with the <a href="%s" target="_BLANK">Pro version</a>.' ,'wplivechat'),'https://wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=a2achat'));
|
709 |
+
|
710 |
+
|
711 |
+
wp_localize_script( 'wplc-admin-js-agent', 'wplc_event_upsell', sprintf( __( 'Get detailed visitor events with the <a target="_BLANK" href="%s">Pro version</a>.', 'wplivechat'), 'https://wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=pro_events' ) );
|
712 |
+
|
713 |
+
wp_localize_script( 'wplc-admin-js-agent', 'wplc_tip_header', $tips_header );
|
714 |
+
wp_localize_script( 'wplc-admin-js-agent', 'wplc_tip_array', $tips_array );
|
715 |
+
|
716 |
+
if (!function_exists("wplc_pro_activate")) {
|
717 |
+
/* identify if the user wants to display the agent to agent chat upsell */
|
718 |
+
$wplc_current_user = get_current_user_id();
|
719 |
+
$check = get_user_meta( $wplc_current_user, "wplc_a2a_upsell" );
|
720 |
+
if ($check) {
|
721 |
+
wp_localize_script( 'wplc-admin-js-agent', 'wplc_upsell_a2a', '1' );
|
722 |
+
}
|
723 |
+
|
724 |
+
}
|
725 |
+
|
726 |
+
|
727 |
+
}
|
728 |
+
|
729 |
/**
|
730 |
+
* Loads remote dashboard styles
|
731 |
*
|
732 |
* @return void
|
733 |
*/
|
734 |
+
function wplc_admin_remote_dashboard_styles(){
|
735 |
+
global $wplc_version;
|
736 |
+
|
737 |
+
$wplc_settings = get_option("WPLC_SETTINGS");
|
738 |
+
|
739 |
+
wp_register_style( 'wplc-admin-style', "https://bleeper.io/app/assets/css/chat_dashboard/admin_style.css", false, $wplc_version );
|
740 |
+
wp_enqueue_style( 'wplc-admin-style' );
|
741 |
+
|
742 |
+
if (!isset($wplc_settings['wplc_show_avatar']) || (isset($wplc_settings['wplc_show_avatar']) && intval($wplc_settings['wplc_show_avatar']) == 0) ) {
|
743 |
+
wp_add_inline_style( 'wplc-admin-style', ".wplc-user-message, .wplc-admin-message { padding-left: 0 !important; }" );
|
744 |
+
|
745 |
+
/*
|
746 |
+
if(!isset($wplc_settings['wplc_show_name']) || (isset($wplc_settings['wplc_show_name']) && intval($wplc_settings['wplc_show_name']) == 0) ){
|
747 |
+
//User is hiding both name and grav - add more inline styles
|
748 |
+
|
749 |
+
$current_agent_info = wp_get_current_user();
|
750 |
+
$current_agent_initial = "A"; //Default
|
751 |
+
|
752 |
+
if(isset($current_agent_info->display_name)){
|
753 |
+
$current_agent_initial = substr($current_agent_info->display_name, 0, 1);
|
754 |
+
}
|
755 |
+
|
756 |
+
|
757 |
+
$inline_identity_css =
|
758 |
+
"
|
759 |
+
.wplc-admin-message .messageBody::before {
|
760 |
+
display:inline-block; width: 15px; height: 15px; background:#333; content:'" . $current_agent_initial . "'; color:#fff; margin-right:10px; position:relative; top:px; text-align:center; font-size: 10px; border-radius:3px;
|
761 |
+
}
|
762 |
+
|
763 |
+
.wplc-user-message .messageBody::before {
|
764 |
+
display:inline-block; width: 15px; height: 15px; background:#2b97d2; content:'U'; color:#fff; margin-right:10px; position:relative; top:px; text-align:center; font-size: 10px; border-radius:3px;
|
765 |
+
}
|
766 |
+
";
|
767 |
+
|
768 |
+
wp_add_inline_style( 'wplc-admin-style', $inline_identity_css );
|
769 |
+
}*/
|
770 |
+
|
771 |
+
|
772 |
+
|
773 |
+
} else if( !isset($wplc_settings['wplc_show_name']) || (isset($wplc_settings['wplc_show_name']) && intval($wplc_settings['wplc_show_name']) == 0) ){
|
774 |
+
//User has enabled the gravatar, but has chosen to hide the user name.
|
775 |
+
//This causes some issues with admin display so let's just add some different styling to get around this
|
776 |
+
$inline_identity_css =
|
777 |
+
"
|
778 |
+
.wplc-admin-message-avatar, .wplc-user-message-avatar {
|
779 |
+
max-width:28px !important;
|
780 |
+
max-height:28px !important;
|
781 |
+
}
|
782 |
+
|
783 |
+
.wplc-admin-message, .wplc-user-message{
|
784 |
+
padding-left:25px !important;
|
785 |
+
}
|
786 |
+
|
787 |
+
.wplc-admin-message::before, .wplc-user-message::before {
|
788 |
+
content: ' ';
|
789 |
+
width: 7px;
|
790 |
+
height: 7px;
|
791 |
+
background:#343434;
|
792 |
+
position: absolute;
|
793 |
+
left: 12px;
|
794 |
+
border-radius: 2px;
|
795 |
+
z-index: 1;
|
796 |
+
}
|
797 |
+
|
798 |
+
.wplc-user-message::before {
|
799 |
+
background:#2b97d2;
|
800 |
+
}
|
801 |
+
";
|
802 |
+
|
803 |
+
wp_add_inline_style( 'wplc-admin-style', $inline_identity_css );
|
804 |
+
}
|
805 |
+
|
806 |
+
wp_register_style( 'wplc-admin-style-bootstrap', "https://bleeper.io/app/assets/css/bootstrap.css", false, $wplc_version );
|
807 |
+
wp_enqueue_style( 'wplc-admin-style-bootstrap' );
|
808 |
+
|
809 |
+
if(empty($wplc_settings['wplc_disable_emojis']))
|
810 |
+
{
|
811 |
+
wp_register_style( 'wplc-admin-style-emoji', "https://bleeper.io/app/assets/wdt-emoji/wdt-emoji-bundle.css", false, $wplc_version );
|
812 |
+
wp_enqueue_style( 'wplc-admin-style-emoji' );
|
813 |
}
|
814 |
+
|
815 |
+
do_action("wplc_admin_remote_dashboard_styles_hook");
|
816 |
+
}
|
817 |
+
|
818 |
+
add_action("wplc_admin_remote_dashboard_above", "wplc_limited_error_output");
|
819 |
+
/*
|
820 |
+
* Outputs an error for limitations due to API key
|
821 |
+
*/
|
822 |
+
function wplc_limited_error_output(){
|
823 |
+
if(function_exists("wplc_pro_activate")){
|
824 |
+
echo "<p id='wplc_limited_container' class='update-nag' style='display:none;'>";
|
825 |
+
echo "<strong>" . __("Dear Pro User,", "wplivechat") . "</strong><br>";
|
826 |
+
echo __("Your API Key could not be validated, some functionality may be limited", "wplivechat");
|
827 |
+
echo "</p>";
|
828 |
+
}
|
829 |
+
|
830 |
+
echo "<p id='wplc_agent_invalid_container' class='update-nag' style='display:none;'>";
|
831 |
+
echo __("You are not a verified agent, chat dashboard has been disabled", "wplivechat");
|
832 |
+
echo "</p>";
|
833 |
+
}
|
834 |
+
|
835 |
+
/*
|
836 |
+
* Add action for notice checks
|
837 |
+
*/
|
838 |
+
if ( ! function_exists( "wplc_active_chat_box_notices" ) ) {
|
839 |
+
if(isset($_GET['page']) && $_GET['page'] === "wplivechat-menu"){
|
840 |
+
add_action( "wplc_admin_remote_dashboard_above", "wplc_active_chat_box_notices" );
|
841 |
+
}
|
842 |
+
}
|
843 |
+
|
844 |
+
add_action("wplc_admin_general_node_compat_check", "wplc_node_compat_version_check");
|
845 |
+
add_action("wplc_admin_remote_dashboard_above", "wplc_node_compat_version_check", 1);
|
846 |
+
/*
|
847 |
+
* Checks if current Pro is compatible with node basic, if not, show notice, and localize scripts needed for conflict free execution
|
848 |
+
*/
|
849 |
+
function wplc_node_compat_version_check(){
|
850 |
+
global $wplc_pro_version;
|
851 |
+
$wplc_ver = str_replace('.', '', $wplc_pro_version);
|
852 |
+
$checker = intval($wplc_ver);
|
853 |
+
if (function_exists("wplc_pro_version_control") && $checker < 8000) {
|
854 |
+
$wpc_ma_js_strings = array(
|
855 |
+
'remove_agent' => __('Remove', 'wplivechat'),
|
856 |
+
'nonce' => wp_create_nonce("wplc"),
|
857 |
+
'user_id' => get_current_user_id(),
|
858 |
+
'typing_string' => __('Typing...', 'wplivechat')
|
859 |
+
|
860 |
+
);
|
861 |
+
wp_localize_script('wplc-admin-js-agent', 'wplc_admin_strings', $wpc_ma_js_strings);
|
862 |
+
|
863 |
+
if(isset($_GET['page']) && $_GET['page'] === "wplivechat-menu"){
|
864 |
+
wp_register_script('wplc-admin-force-offline-js', plugins_url('../js/wplc_node_offline_mode_controller.js', __FILE__), array('jquery'), '', true);
|
865 |
+
wp_enqueue_script('wplc-admin-force-offline-js');
|
866 |
+
}
|
867 |
+
|
868 |
+
$is_dashboard = (isset($_GET['page']) && $_GET['page'] === "wplivechat-menu") ? true : false;
|
869 |
+
?>
|
870 |
+
<div class="<?php echo ($is_dashboard ? "" : "update-nag"); ?>" id="wplc_offline_mode_prompt_container" style='margin-top:5px;margin-bottom:5px;<?php echo ($is_dashboard ? "display:none; " : ""); ?>'>
|
871 |
+
<div style="display: inline-block; width: 80px; position: absolute; padding-top: 1em;">
|
872 |
+
<img src="https://bleeper.io/app/assets/images/wplc_loading.png" />
|
873 |
+
</div>
|
874 |
+
<div style="display: inline-block; margin-left: 80px;">
|
875 |
+
<p style="display: none;"><strong id="wplc_offline_mode_prompt"><?php _e("WP Live Chat Support - Offline Mode", "wplivechat") ?></strong></p>
|
876 |
+
<?php echo wplc_node_compat_pro_update_nag_content(); ?>
|
877 |
+
</div>
|
878 |
+
</div>
|
879 |
+
<?php
|
880 |
+
}
|
881 |
+
}
|
882 |
+
|
883 |
+
/*
|
884 |
+
* Checks if the users Pro API key is expired - this will only be called if pro is active and is less than V8
|
885 |
+
* true -> Show link to my account page
|
886 |
+
* false -> Show link to update page
|
887 |
+
*/
|
888 |
+
function wplc_node_compat_pro_update_nag_content(){
|
889 |
+
$html_out = "<p id='wplc_offline_mode_reason'>";
|
890 |
+
|
891 |
+
$is_pro_valid = wplc_node_compat_pro_api_key_is_valid_post();
|
892 |
+
|
893 |
+
if($is_pro_valid){
|
894 |
+
$html_out .= sprintf(__("Chat is now in offline mode, please <a href='%s' target='_BLANK'>upgrade to Version 8</a> (or above) of the WP Live Chat Support Pro Add-on to ensure all functionality works as expected.", "wplivechat"), "update-core.php");
|
895 |
+
} else {
|
896 |
+
$html_out .= sprintf(__("Chat is now in offline mode, please renew your API key by visiting the <a href='%s' target='_BLANK'>My Account</a> area, and receive updates.", "wplivechat"), "https://wp-livechat.com/my-account");
|
897 |
+
}
|
898 |
+
|
899 |
+
$html_out .= "</p>";
|
900 |
+
|
901 |
+
$html_out .= "<p>";
|
902 |
+
$html_out .= __("Alternatively, please disable the node server option in the Live Chat settings area (Live Chat -> Settings -> Advanced Features)", "wplivechat");
|
903 |
+
$html_out .= "</p>";
|
904 |
+
|
905 |
+
if($is_pro_valid){
|
906 |
+
$html_out .= "<a href='update-core.php' class='button button-primary' target='_BLANK'>" . __("Upgrade", "wplivechat") . "</a>";
|
907 |
+
} else {
|
908 |
+
$html_out .= "<a href='update-core.php' class='button button-primary' target='_BLANK'>" . __("Renew License", "wplivechat") . "</a>";
|
909 |
+
}
|
910 |
+
|
911 |
+
if(!isset($_GET['page']) || $_GET['page'] !== "wplivechat-menu-settings"){
|
912 |
+
$html_out .= " <a href='?page=wplivechat-menu-settings#tabs-beta' class='button' target='_BLANK'>" . __("Settings", "wplivechat") . "</a>";
|
913 |
+
}
|
914 |
+
|
915 |
+
$html_out .= " <a href='?page=wplivechat-menu&action=welcome' class='button' target='_BLANK'>" . __("Whats new in Version 8", "wplivechat") . "</a>";
|
916 |
+
|
917 |
+
return $html_out;
|
918 |
+
|
919 |
+
}
|
920 |
+
|
921 |
+
/*
|
922 |
+
* Checks if the Pro API key is valid or not
|
923 |
+
* Returns true or false
|
924 |
+
*/
|
925 |
+
function wplc_node_compat_pro_api_key_is_valid_post(){
|
926 |
+
$wplc_pro_validation_url = "http://ccplugins.co/api-control/";
|
927 |
+
$wplc_pro_option_key = "wp-live-chat-support-pro_key";
|
928 |
+
$wplc_pro_slug = "wp-live-chat-support-pro";
|
929 |
+
$is_valid = false; //By default it is false
|
930 |
+
if (get_option($wplc_pro_option_key)) {
|
931 |
+
$args = array(
|
932 |
+
'slug' => $wplc_pro_slug,
|
933 |
+
);
|
934 |
+
$data_array = array(
|
935 |
+
'method' => 'POST',
|
936 |
+
'body' => array(
|
937 |
+
'action' => 'api_validation',
|
938 |
+
'd' => get_option('siteurl'),
|
939 |
+
'request' => serialize($args),
|
940 |
+
'api_key' => get_option($wplc_pro_option_key)
|
941 |
+
));
|
942 |
+
$response = wp_remote_post($wplc_pro_validation_url, $data_array);
|
943 |
+
if (is_array($response)) {
|
944 |
+
if ( $response['response']['code'] == "200" ) {
|
945 |
+
$data = $response['body'];
|
946 |
+
$data = unserialize($data);
|
947 |
+
|
948 |
+
if(isset($data['status']) && $data['status'] === "OK"){
|
949 |
+
$is_valid = true;
|
950 |
+
}
|
951 |
+
}
|
952 |
+
}
|
953 |
+
|
954 |
+
}
|
955 |
+
|
956 |
+
return $is_valid;
|
957 |
+
}
|
958 |
+
|
959 |
+
add_filter("wplc_loggedin_filter","wplc_node_compat_version_disable_chat",99,1);
|
960 |
+
/*
|
961 |
+
* Checks if user is using out-date pro with node server, if so, disable chat on front end
|
962 |
+
*/
|
963 |
+
function wplc_node_compat_version_disable_chat($logged_in) {
|
964 |
+
global $wplc_pro_version;
|
965 |
+
$wplc_settings = get_option("WPLC_SETTINGS");
|
966 |
+
if(isset($wplc_settings['wplc_use_node_server']) && $wplc_settings['wplc_use_node_server'] == 1){
|
967 |
+
$wplc_ver = str_replace('.', '', $wplc_pro_version);
|
968 |
+
$checker = intval($wplc_ver);
|
969 |
+
if (function_exists("wplc_pro_version_control") && $checker < 8000) {
|
970 |
+
return false; //Force chat offline
|
971 |
+
}
|
972 |
+
}
|
973 |
+
return $logged_in;
|
974 |
+
}
|
975 |
+
|
976 |
+
add_action("admin_notices", "wplc_node_v8_plus_notice_dismissable");
|
977 |
+
/*
|
978 |
+
* Displays an admin notice (which can be dismissed), to notify any V8+ users of the node option (if not already checked)
|
979 |
+
*/
|
980 |
+
function wplc_node_v8_plus_notice_dismissable(){
|
981 |
+
if(isset($_GET['page']) && strpos($_GET['page'], 'wplivechat') !== FALSE){
|
982 |
+
if(isset($_GET['wplc_dismiss_notice_v8']) && $_GET['wplc_dismiss_notice_v8'] === "true"){
|
983 |
+
update_option("wplc_node_v8_plus_notice_dismissed", 'true');
|
984 |
+
}
|
985 |
+
|
986 |
+
$wplc_settings = get_option("WPLC_SETTINGS");
|
987 |
+
if(isset($wplc_settings['wplc_use_node_server']) && $wplc_settings['wplc_use_node_server'] == 1){
|
988 |
+
//Do Nothing
|
989 |
+
} else {
|
990 |
+
//User is not on node, let's check if they have seen this notice before, if not, let's show a notice
|
991 |
+
$wplc_has_notice_been_dismissed = get_option("wplc_node_v8_plus_notice_dismissed", false);
|
992 |
+
if($wplc_has_notice_been_dismissed === false){
|
993 |
+
//Has not been dismissed
|
994 |
+
$output = "<div class='notice notice-warning' style='border-color: #0180bc;'>";
|
995 |
+
$output .= "<p><strong>" . __( 'Welcome to V8 of WP Live Chat Support', 'wplivechat' ) . "</strong></p>";
|
996 |
+
$output .= "<p>" . __('Did you know, this version features high speed message delivery, agent to agent chat, and a single window layout?', 'wplivechat') . "</p>";
|
997 |
+
$output .= "<p>" . __('To activate this functionality please navigate to Live Chat -> Settings -> Advanced Features -> And enable our Chat Server option.', 'wplivechat') . "</p>";
|
998 |
+
|
999 |
+
$output .= "<p>";
|
1000 |
+
$output .= "<a href='?page=wplivechat-menu-settings#tabs-beta' class='button button-primary'>" . __("Show me!", "wplivechat") . "</a> ";
|
1001 |
+
$output .= "<a href='?page=".$_GET['page']."&wplc_dismiss_notice_v8=true' id='wplc_v8_dismiss_node_notice' class='button'>" . __("Don't Show This Again", "wplivechat") . "</a>";
|
1002 |
+
$output .= "</p>";
|
1003 |
+
|
1004 |
+
$output .= "</div>";
|
1005 |
+
|
1006 |
+
echo $output;
|
1007 |
+
}
|
1008 |
+
}
|
1009 |
+
}
|
1010 |
+
}
|
1011 |
+
|
1012 |
+
add_filter("wplc_activate_default_settings_array", "wplc_node_set_default_settings", 10, 1);
|
1013 |
+
/*
|
1014 |
+
* Adds default node setting to the default settings array
|
1015 |
+
*/
|
1016 |
+
function wplc_node_set_default_settings($wplc_default_settings_array){
|
1017 |
+
if(is_array($wplc_default_settings_array)){
|
1018 |
+
if(!isset($wplc_default_settings_array['wplc_use_node_server'])){
|
1019 |
+
//Is not set already
|
1020 |
+
$wplc_default_settings_array['wplc_use_node_server'] = 1;
|
1021 |
+
}
|
1022 |
+
}
|
1023 |
+
return $wplc_default_settings_array;
|
1024 |
+
}
|
1025 |
+
|
1026 |
+
/**
|
1027 |
+
* Changes the REST URL to include the SSL version if we are using SSL
|
1028 |
+
* See https://core.trac.wordpress.org/ticket/36451
|
1029 |
+
*/
|
1030 |
+
add_filter( 'rest_url', function( $url ) {
|
1031 |
+
if ( is_ssl() ) {
|
1032 |
+
$url = set_url_scheme( $url, 'https' );
|
1033 |
+
return $url;
|
1034 |
+
}
|
1035 |
+
|
1036 |
+
return $url;
|
1037 |
+
});
|
1038 |
+
|
1039 |
+
/**
|
1040 |
+
* Returns an array of pages/posts available on the site
|
1041 |
+
*/
|
1042 |
+
function wplc_node_pages_posts_array(){
|
1043 |
+
$r = array(
|
1044 |
+
'depth' => 0,
|
1045 |
+
'child_of' => 0,
|
1046 |
+
'echo' => false,
|
1047 |
+
'id' => '',
|
1048 |
+
'class' => '',
|
1049 |
+
'show_option_none' => '',
|
1050 |
+
'show_option_no_change' => '',
|
1051 |
+
'option_none_value' => '',
|
1052 |
+
'value_field' => 'ID',
|
1053 |
+
);
|
1054 |
+
|
1055 |
+
$pages = get_pages($r);
|
1056 |
+
$posts = get_posts(array('posts_per_page' => -1));
|
1057 |
+
|
1058 |
+
$posts_pages = array_merge($pages,$posts);
|
1059 |
+
|
1060 |
+
$return_array = array();
|
1061 |
+
|
1062 |
+
foreach ($posts_pages as $key => $value) {
|
1063 |
+
$post_page_id = $value->ID;
|
1064 |
+
$post_page_title = $value->post_title;
|
1065 |
+
|
1066 |
+
$return_array[get_permalink($post_page_id)] = $post_page_title;
|
1067 |
+
}
|
1068 |
+
|
1069 |
+
return $return_array;
|
1070 |
+
}
|
1071 |
+
|
1072 |
+
|
1073 |
+
|
1074 |
+
add_action("init","wplc_node_cloud_server_integration_hook_handler");
|
1075 |
+
/**
|
1076 |
+
* V8 Cloud Action & Filter Handlers
|
1077 |
+
*/
|
1078 |
+
function wplc_node_cloud_server_integration_hook_handler() {
|
1079 |
+
$wplc_settings = get_option("WPLC_SETTINGS");
|
1080 |
+
if(isset($wplc_settings['wplc_use_node_server']) && $wplc_settings['wplc_use_node_server'] == 1){
|
1081 |
+
if(function_exists("wplc_cloud_load_updates")){
|
1082 |
+
remove_action("init","wplc_cloud_load_updates");
|
1083 |
+
remove_action("wplc_hook_chat_dashboard_above","wplc_cloud_1_hook_chat_dashboard_above");
|
1084 |
+
remove_action("wplc_hook_admin_chatbox_javascript","wplc_cloud_hook_control_push_js_to_admin", 10);
|
1085 |
+
remove_action("wplc_hook_push_js_to_front","wplc_cloud_hook_control_push_js_to_front", 10);
|
1086 |
+
remove_action("wplc_hook_chat_history","wplc_cloud_hook_control_chat_history", 1);
|
1087 |
+
remove_action("wplc_hook_chat_missed","wplc_cloud_hook_control_chat_missed", 1);
|
1088 |
+
remove_action("wplc_hook_initiate_check","wplc_cloud_hook_control_intiate_check", 1);
|
1089 |
+
remove_action("wplc_hook_history_draw_area","wplc_cloud_hook_control_history_draw_area", 1);
|
1090 |
+
remove_action("wplc_hook_change_status_on_answer","wplc_cloud_hook_control_change_status_on_answer", 1);
|
1091 |
+
remove_action("wplc_hook_update_agent_id","wplc_cloud_hook_control_update_agent_id", 1);
|
1092 |
+
remove_action('wplc_hook_accept_chat_url' , 'wplc_cloud_hook_control_accept_chat_url', 1);
|
1093 |
+
remove_action("wplc_hook_ma_check_if_answered_by_another_agent","wplc_cloud_hook_check_if_answered_by_another_agent", 1);
|
1094 |
+
remove_action("wplc_hook_settings_page_more_tabs","wplc_cloud_hook_control_settings_page_more_tabs");
|
1095 |
+
remove_action("init","wplc_cloud_first_run_check");
|
1096 |
+
remove_action('wplc_hook_admin_settings_save','wplc_cloud_save_settings');
|
1097 |
+
remove_action("wplc_api_route_hook", "wplc_api_node_routes_cloud", 1);
|
1098 |
+
remove_action('http_api_curl', 'wplc_cloud_http_api_curl', 100);
|
1099 |
+
remove_action("init", "wplc_cloud_additional_hooks", 1);
|
1100 |
+
|
1101 |
+
remove_filter("wplc_filter_get_chat_messages","wplc_cloud_filter_control_chat_messages",10);
|
1102 |
+
remove_filter("wplc_filter_get_chat_data","wplc_cloud_filter_control_chat_data",1);
|
1103 |
+
remove_filter("wplc_filter_chat_area_data","wplc_cloud_filter_control_chat_area_data",10);
|
1104 |
+
remove_filter("wplc_rating_data_filter","wplc_cloud_filter_control_get_rating_data",1);
|
1105 |
+
remove_filter("wplc_filter_admin_javascript","wplc_cloud_filter_control_admin_javascript");
|
1106 |
+
remove_filter("wplc_start_chat_user_form_after_filter", "wplc_start_chat_user_form_after_filter_remove_departments_cloud",2);
|
1107 |
+
remove_filter("wplc_after_chat_visitor_count_hook", "wplc_admin_cloud_remove_departments_chat_area_before_end_chat_button",2);
|
1108 |
+
remove_filter("wplc_admin_chat_area_before_end_chat_button", "wplc_admin_cloud_remove_transfer_button_chat_area_before_end_chat_button",2);
|
1109 |
+
remove_filter("wplc_filter_front_js_extra_data","wplc_cloud_filter_control_front_js_extra_data",10);
|
1110 |
+
remove_filter("wplc_filter_ajax_url","wplc_cloud_filter_control_ajax_url",10);
|
1111 |
+
remove_filter("wplc_filter_setting_tabs","wplc_cloud_filter_control_setting_tabs");
|
1112 |
+
remove_filter("wplc_filter_menu_api","wplc_cloud_filter_control_menu_api",1);
|
1113 |
+
remove_filter('http_request_args', 'wplc_cloud_http_request_args',100);
|
1114 |
+
}
|
1115 |
+
}
|
1116 |
+
}
|
1117 |
+
|
1118 |
+
add_action("init","wplc_node_mobile_integration_hook_handler");
|
1119 |
+
/**
|
1120 |
+
* V8 Mobile/Desktop Extension Action & Filter Handlers
|
1121 |
+
*/
|
1122 |
+
function wplc_node_mobile_integration_hook_handler() {
|
1123 |
+
$wplc_settings = get_option("WPLC_SETTINGS");
|
1124 |
+
if(isset($wplc_settings['wplc_use_node_server']) && $wplc_settings['wplc_use_node_server'] == 1){
|
1125 |
+
if(function_exists("wplc_md_load_updates")){
|
1126 |
+
remove_action("init","wplc_md_load_updates");
|
1127 |
+
remove_action("wplc_hook_settings_page_more_tabs","wplc_mobile_hook_control_settings_page_more_tabs");
|
1128 |
+
remove_action("init","wplc_mobile_first_run_check");
|
1129 |
+
remove_action('wplc_hook_admin_settings_save','wplc_mobile_save_settings');
|
1130 |
+
|
1131 |
+
remove_filter("wplc_filter_is_admin_logged_in","wplc_mobile_check_if_logged_in",10);
|
1132 |
+
remove_filter("wplc_filter_setting_tabs","wplc_mobile_filter_control_setting_tabs");
|
1133 |
+
remove_filter("wplc_filter_menu_api","wplc_mobile_filter_control_menu_api");
|
1134 |
+
}
|
1135 |
+
}
|
1136 |
+
}
|
1137 |
+
|
1138 |
+
|
1139 |
+
add_action("wplc_admin_remoter_dashboard_scripts_localizer", "wplc_admin_remote_dashboard_dynamic_translation_handler");
|
1140 |
+
/*
|
1141 |
+
* Localizes an array of strings and ids in the dashboard which need to be replaced
|
1142 |
+
* Loads the custom JS file responsible for replacing the content dynamically.
|
1143 |
+
*/
|
1144 |
+
function wplc_admin_remote_dashboard_dynamic_translation_handler(){
|
1145 |
+
|
1146 |
+
global $wplc_version;
|
1147 |
+
wp_register_script('wplc-admin-dynamic-translation', plugins_url( 'js/wplc_admin_dynamic_translations.js', __DIR__ ), array("wplc-admin-js-agent", "wplc-admin-js-sockets", "jquery"), $wplc_version, false); //Added this for async storage calls
|
1148 |
+
|
1149 |
+
$wplc_dynamic_translation_array = array(
|
1150 |
+
'nifty_bg_holder_text_inner' => __('Connecting...', 'wplivechat'),
|
1151 |
+
'nifty_admin_chat_prompt_title' => __('Please Confirm', 'wplivechat'),
|
1152 |
+
'nifty_admin_chat_prompt_confirm' => __('Confirm', 'wplivechat'),
|
1153 |
+
'nifty_admin_chat_prompt_cancel' => __('Cancel', 'wplivechat'),
|
1154 |
+
'active_count_string' => __(' Active visitors', 'wplivechat'),
|
1155 |
+
'wplc-agent-info' => __('Agent(s) Online', 'wplivechat'),
|
1156 |
+
'wplc_history_link' => __('Chat History', 'wplivechat'),
|
1157 |
+
'nifty_agent_heading' => __('Agents', 'wplivechat'),
|
1158 |
+
'drag_zone_inner_text' => __('Drag Files Here', 'wplivechat'),
|
1159 |
+
'chatTransferLink' => __('Transfer', 'wplivechat'),
|
1160 |
+
'chatTransferDepLink' => __('Department Transfer', 'wplivechat'),
|
1161 |
+
'chatDirectUserToPageLink' => __('Direct User To Page', 'wplivechat'),
|
1162 |
+
'chatCloseTitle' => __('Leave chat', 'wplivechat'),
|
1163 |
+
'chatEndTitle' => __('End chat', 'wplivechat'),
|
1164 |
+
'chatTransferUps' => __('Transfer', 'wplivechat'),
|
1165 |
+
'chatDirectUserToPageUps' => __('Direct User To Page', 'wplivechat'),
|
1166 |
+
'nifty_event_heading' => __('Events', 'wplivechat'),
|
1167 |
+
'nifty_join_chat_button' => __('Join chat', 'wplivechat'),
|
1168 |
+
'nifty_filter_button' => __('Filters', 'wplivechat'),
|
1169 |
+
'nifty_new_visitor_item' => __('New Visitors (3 Min)', 'wplivechat'),
|
1170 |
+
'nifty_active_chats_item' => __('Active Chats', 'wplivechat'),
|
1171 |
+
'nifty_clear_filters_item' => __('Clear Filters', 'wplivechat'),
|
1172 |
+
'nifty_active_chats_heading' => __('Active visitors', 'wplivechat'),
|
1173 |
+
'nifty_vis_col_heading' => __('Visitor', 'wplivechat'),
|
1174 |
+
'nifty_vis_info_heading' => __('Info', 'wplivechat'),
|
1175 |
+
'nifty_vis_page_heading' => __('Page', 'wplivechat'),
|
1176 |
+
'nifty_vis_status_heading' => __('Chat Status', 'wplivechat'),
|
1177 |
+
'nifty_vis_dep_heading' => __('Department', 'wplivechat'),
|
1178 |
+
'wdt-emoji-search-result-title' => __('Search Results', 'wplivechat'),
|
1179 |
+
'wdt-emoji-no-result' => __('No emoji found', 'wplivechat')
|
1180 |
+
);
|
1181 |
+
|
1182 |
+
apply_filters("wplc_adming_dynamic_translation_filter", $wplc_dynamic_translation_array);
|
1183 |
+
|
1184 |
+
|
1185 |
+
wp_localize_script('wplc-admin-dynamic-translation', 'wplc_dynamic_translation_array', $wplc_dynamic_translation_array);
|
1186 |
+
wp_enqueue_script('wplc-admin-dynamic-translation');
|
1187 |
+
|
1188 |
}
|
modules/node_server_deprecated.php
ADDED
@@ -0,0 +1,370 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* All Dperecated Node Calls - From original beta system
|
5 |
+
*/
|
6 |
+
|
7 |
+
//FUNCTIONS BELOW - REPLACED
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Post to the NODE server - LEGACY - DEPRECATED
|
11 |
+
*
|
12 |
+
* @param string $route Route you would like to use for the node server
|
13 |
+
* @param string $form_data data to send
|
14 |
+
* @return string (or false on fail)
|
15 |
+
*/
|
16 |
+
|
17 |
+
function old_wplc_node_server_post($route, $form_data){
|
18 |
+
$url = "https://wp-livechat.us-2.evennode.com" . "/" . $route;
|
19 |
+
//$url = "http://" . "34.193.164.98:6086" . "/" . $route;
|
20 |
+
if(!isset($form_data['server_token'])){
|
21 |
+
$wplc_node_token = get_option("wplc_node_server_secret_token");
|
22 |
+
if(!$wplc_node_token){
|
23 |
+
if(function_exists("wplc_node_server_token_regenerate")){
|
24 |
+
wplc_node_server_token_regenerate();
|
25 |
+
$wplc_node_token = get_option("wplc_node_server_secret_token");
|
26 |
+
}
|
27 |
+
}
|
28 |
+
|
29 |
+
$form_data['server_token'] = $wplc_node_token; //Add the security token
|
30 |
+
}
|
31 |
+
|
32 |
+
if(!isset($form_data['origin_url'])){
|
33 |
+
$ajax_url = admin_url('admin-ajax.php');
|
34 |
+
$origin_url = str_replace("/wp-admin/admin-ajax.php", "", $ajax_url);
|
35 |
+
$form_data['origin_url'] = $origin_url; //Add the security token
|
36 |
+
}
|
37 |
+
|
38 |
+
$options = array(
|
39 |
+
'http' => array(
|
40 |
+
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
|
41 |
+
'method' => 'POST',
|
42 |
+
'content' => http_build_query($form_data)
|
43 |
+
)
|
44 |
+
);
|
45 |
+
$context = @stream_context_create($options);
|
46 |
+
$result = @file_get_contents($url, false, $context);
|
47 |
+
|
48 |
+
if ($result === FALSE) {
|
49 |
+
return false;
|
50 |
+
} else {
|
51 |
+
return $result;
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Legacy Node Server Function - LEGACY - DEPRECATED
|
57 |
+
* @return void
|
58 |
+
*/
|
59 |
+
function old_wplc_filter_notification_hook_node($type,$cid,$data){
|
60 |
+
$wplc_settings = get_option("WPLC_SETTINGS");
|
61 |
+
if(isset($wplc_settings['wplc_use_node_server']) && intval($wplc_settings['wplc_use_node_server']) == 1) {
|
62 |
+
|
63 |
+
$msg = false;
|
64 |
+
$msg_admin = false;
|
65 |
+
|
66 |
+
|
67 |
+
$other = false;
|
68 |
+
switch($type){
|
69 |
+
case "user_loaded":
|
70 |
+
$msg_admin = sprintf( __("User is browsing <small><a href='%s' target='_BLANK'>%s</a></small>","wplivechat") , $data['uri'] , wplc_shortenurl($data['uri']) );
|
71 |
+
break;
|
72 |
+
case "await_agent":
|
73 |
+
/**
|
74 |
+
* Removed this as it is duplicated on the second loop to the server
|
75 |
+
*/
|
76 |
+
$msg = $data['msg'];
|
77 |
+
break;
|
78 |
+
case "joined":
|
79 |
+
$user_info = get_userdata(intval($data['aid']));
|
80 |
+
$agent = $user_info->display_name;
|
81 |
+
$msg = $agent . " ". __("has joined the chat.","wplivechat");
|
82 |
+
|
83 |
+
$agent_tagline = '';
|
84 |
+
$agent_bio = '';
|
85 |
+
$a_twitter = '';
|
86 |
+
$a_linkedin = '';
|
87 |
+
$a_facebook = '';
|
88 |
+
$a_website = '';
|
89 |
+
$social_links = '';
|
90 |
+
|
91 |
+
$tagline = get_user_meta( intval($data['aid']), 'wplc_user_tagline', true );
|
92 |
+
if( $tagline !== "" ){
|
93 |
+
$agent_tagline = $tagline;
|
94 |
+
$agent_tagline = '<span class="wplc_agent_infosection wplc_agent_tagline wplc-color-2">'.$agent_tagline.'</span>';
|
95 |
+
}
|
96 |
+
$bio = get_user_meta( intval($data['aid']), 'wplc_user_bio', true );
|
97 |
+
if( $bio !== "" ){
|
98 |
+
$agent_bio = $bio;
|
99 |
+
$agent_bio = '<span class="wplc_agent_infosection wplc_agent_bio wplc-color-2">'.$agent_bio.'</span>';
|
100 |
+
}
|
101 |
+
|
102 |
+
$a_twitter = get_user_meta( intval($data['aid']), 'wplc_user_twitter', true );
|
103 |
+
$a_linkedin = get_user_meta( intval($data['aid']), 'wplc_user_linkedin', true );
|
104 |
+
$a_facebook = get_user_meta( intval($data['aid']), 'wplc_user_facebook', true );
|
105 |
+
$a_website = get_user_meta( intval($data['aid']), 'wplc_user_website', true );
|
106 |
+
|
107 |
+
if ($a_twitter === '' && $a_linkedin === '' && $a_facebook === '' && $a_website === '') {
|
108 |
+
$social_links = '';
|
109 |
+
} else {
|
110 |
+
$social_links = '<span class="wplc_agent_infosection wplc_agent_social_links wplc-color-2">';
|
111 |
+
if ($a_twitter !== '') {
|
112 |
+
$social_links .= '<a href="'.$a_twitter.'" title="'.$agent.' - Twitter" border="0" rel="nofollow" target="_BLANK"><img src="'.plugins_url('/images/social/twitter.png',__FILE__).'" title="'.$agent.' - Twitter" border="0" /></a> ';
|
113 |
+
}
|
114 |
+
if ($a_linkedin !== '') {
|
115 |
+
$social_links .= '<a href="'.$a_linkedin.'" title="'.$agent.' - Twitter" border="0" rel="nofollow" target="_BLANK"><img src="'.plugins_url('/images/social/linkedin.png',__FILE__).'" title="'.$agent.' - LinkedIn" border="0" /></a> ';
|
116 |
+
}
|
117 |
+
if ($a_facebook !== '') {
|
118 |
+
$social_links .= '<a href="'.$a_facebook.'" title="'.$agent.' - Twitter" border="0" rel="nofollow" target="_BLANK"><img src="'.plugins_url('/images/social/facebook.png',__FILE__).'" title="'.$agent.' - Facebook" border="0" /></a> ';
|
119 |
+
}
|
120 |
+
if ($a_website !== '') {
|
121 |
+
$social_links .= '<a href="'.$a_website.'" title="'.$agent.' - Twitter" border="0" rel="nofollow" target="_BLANK"><img src="'.plugins_url('/images/social/website.png',__FILE__).'" title="'.$agent.' - Website" border="0" /></a> ';
|
122 |
+
}
|
123 |
+
$social_links .= '</span>';
|
124 |
+
}
|
125 |
+
|
126 |
+
$other = array(
|
127 |
+
'ntype' => 'joined',
|
128 |
+
'email' => md5($user_info->user_email),
|
129 |
+
'name' => $agent,
|
130 |
+
'aid' => $user_info->ID,
|
131 |
+
'agent_tagline' => $agent_tagline,
|
132 |
+
'agent_bio' => $agent_bio,
|
133 |
+
'social_links' => $social_links
|
134 |
+
);
|
135 |
+
break;
|
136 |
+
case "doc_suggestion":
|
137 |
+
$msg = $data['formatted_msg'];
|
138 |
+
$msg_admin = $data['formatted_msg_admin'];
|
139 |
+
break;
|
140 |
+
case "system_dep_transfer":
|
141 |
+
if(function_exists("wplc_filter_control_chat_notification_auto_department_transfer")){
|
142 |
+
$from_department = null;
|
143 |
+
$to_department = null;
|
144 |
+
|
145 |
+
if(isset($data['to_dep_id']) && isset($data['from_dep_id'])){
|
146 |
+
if(function_exists("wplc_get_department")){
|
147 |
+
$from_department = wplc_get_department(intval($data['from_dep_id']));
|
148 |
+
$to_department = wplc_get_department(intval($data['to_dep_id']));
|
149 |
+
}
|
150 |
+
}
|
151 |
+
|
152 |
+
//User
|
153 |
+
$msg = __("No agents available in","wplivechat") . " ";
|
154 |
+
if($from_department === null){
|
155 |
+
$msg .= __("selected department", "wplivechat");
|
156 |
+
} else {
|
157 |
+
$msg .= $from_department[0]->name;
|
158 |
+
}
|
159 |
+
$msg .= ", " . __("automatically transferring you to", "wplivechat") . " ";
|
160 |
+
if($to_department === null){
|
161 |
+
$msg .= __("the next available department", "wplivechat");
|
162 |
+
} else {
|
163 |
+
$msg .= $to_department[0]->name;
|
164 |
+
}
|
165 |
+
$msg .= ".";
|
166 |
+
|
167 |
+
//Admin
|
168 |
+
$msg_admin = __("User has been transfered from ","wplivechat") . " ";
|
169 |
+
if($from_department === null){
|
170 |
+
$msg_admin .= __("department", "wplivechat");
|
171 |
+
} else {
|
172 |
+
$msg_admin .= $from_department[0]->name;
|
173 |
+
}
|
174 |
+
|
175 |
+
if($to_department !== null){
|
176 |
+
$msg_admin .= __(" to ", "wplivechat") . " " . $to_department[0]->name;
|
177 |
+
}
|
178 |
+
$msg_admin .= " " . __("as there were no agents online") . ".";
|
179 |
+
}
|
180 |
+
break;
|
181 |
+
case "transfer":
|
182 |
+
|
183 |
+
$user_info = get_userdata(intval($data['aid']));
|
184 |
+
if( $user_info ){
|
185 |
+
$agent = $user_info->display_name;
|
186 |
+
} else {
|
187 |
+
$agent = "";
|
188 |
+
}
|
189 |
+
|
190 |
+
if(isset($data["auto_transfer"]) && $data["auto_transfer"] == true){
|
191 |
+
if(intval($data['aid']) === 0){
|
192 |
+
//Came from a department originally
|
193 |
+
$msg = __("Department took too long to respond, we are transferring this chat to the next available agent.","wplivechat");
|
194 |
+
} else {
|
195 |
+
$msg = $agent . " " . __("took too long to respond, we are transferring this chat to the next available agent.","wplivechat");
|
196 |
+
}
|
197 |
+
} else {
|
198 |
+
$msg = $agent . " ". __("has transferred the chat.","wplivechat");
|
199 |
+
}
|
200 |
+
|
201 |
+
$msg_admin = "<strong>" . __("User received this message", "wplivechat") . ":</strong> " . $msg;
|
202 |
+
|
203 |
+
break;
|
204 |
+
default:
|
205 |
+
break;
|
206 |
+
}
|
207 |
+
|
208 |
+
if(isset($cid)){
|
209 |
+
$cid = intval($cid);
|
210 |
+
if($msg !== false){
|
211 |
+
$user_message = array(
|
212 |
+
'cid' => $cid,
|
213 |
+
'timestamp' => current_time('mysql'),
|
214 |
+
'msgfrom' => __('System notification',"wplivechat"),
|
215 |
+
'msg' => $msg,
|
216 |
+
'status' => 0,
|
217 |
+
'originates' => '0',
|
218 |
+
'other' => $other
|
219 |
+
);
|
220 |
+
|
221 |
+
$user_request = wplc_node_server_post("system_message", $user_message);
|
222 |
+
|
223 |
+
if($user_request === false){
|
224 |
+
//Something is wrong
|
225 |
+
} else {
|
226 |
+
|
227 |
+
}
|
228 |
+
}
|
229 |
+
|
230 |
+
if($msg_admin !== false){
|
231 |
+
$agent_message = array(
|
232 |
+
'cid' => $cid,
|
233 |
+
'timestamp' => current_time('mysql'),
|
234 |
+
'msgfrom' => __('System notification',"wplivechat"),
|
235 |
+
'msg' => $msg_admin,
|
236 |
+
'status' => 0,
|
237 |
+
'originates' => '3'
|
238 |
+
);
|
239 |
+
|
240 |
+
$agent_request = wplc_node_server_post("system_message", $agent_message);
|
241 |
+
if($agent_request === false){
|
242 |
+
//Something is wrong
|
243 |
+
} else {
|
244 |
+
|
245 |
+
}
|
246 |
+
}
|
247 |
+
|
248 |
+
}
|
249 |
+
}
|
250 |
+
|
251 |
+
return;
|
252 |
+
}
|
253 |
+
|
254 |
+
//FUNCTIONS BELOW - SIMPLY REMOVED
|
255 |
+
|
256 |
+
//add_action("wplc_change_chat_status_hook", "wplc_node_notify_server_of_status_change", 10, 2);
|
257 |
+
/**
|
258 |
+
* Handles notifying the node server that this chat status has been changed by the php server
|
259 |
+
*
|
260 |
+
* @return void
|
261 |
+
*/
|
262 |
+
function wplc_node_notify_server_of_status_change($cid, $status){
|
263 |
+
$wplc_settings = get_option("WPLC_SETTINGS");
|
264 |
+
|
265 |
+
if(isset($wplc_settings['wplc_use_node_server']) && $wplc_settings['wplc_use_node_server'] == 1){
|
266 |
+
$cid = intval($cid);
|
267 |
+
$status = intval($status);
|
268 |
+
if($status === 1){
|
269 |
+
//End - This is most commonly done when the user has not sent a message in a long time.
|
270 |
+
|
271 |
+
//Notify the user and agent of this occurring
|
272 |
+
$msg = __("Chat has been ended.", "wplivechat");
|
273 |
+
|
274 |
+
$system_message = array(
|
275 |
+
'cid' => $cid,
|
276 |
+
'timestamp' => current_time('mysql'),
|
277 |
+
'msgfrom' => __('System notification',"wplivechat"),
|
278 |
+
'system_notice' => $msg,
|
279 |
+
'status' => 0,
|
280 |
+
'originates' => '0',
|
281 |
+
'tripswitch' => true
|
282 |
+
);
|
283 |
+
|
284 |
+
$node_request = wplc_node_server_post("end_chat", $system_message);
|
285 |
+
if($node_request === false){ } else { }
|
286 |
+
} else if ($status === 0){
|
287 |
+
//Notify the user and agent of this occurring
|
288 |
+
$system_message = array(
|
289 |
+
'cid' => $cid,
|
290 |
+
'timestamp' => current_time('mysql'),
|
291 |
+
'msgfrom' => __('System notification',"wplivechat"),
|
292 |
+
'msg' => wplc_return_no_answer_string($cid),
|
293 |
+
'status' => 0,
|
294 |
+
'originates' => '0'
|
295 |
+
);
|
296 |
+
|
297 |
+
|
298 |
+
$node_request = wplc_node_server_post("system_message", $system_message);
|
299 |
+
if($node_request === false){ } else { }
|
300 |
+
|
301 |
+
|
302 |
+
|
303 |
+
}
|
304 |
+
}
|
305 |
+
}
|
306 |
+
|
307 |
+
add_filter("wplc_log_user_on_page_insert_other_data_filter", "wplc_is_client_socket_enabled", 10, 1);
|
308 |
+
/**
|
309 |
+
* Checks if the user is socket enabled (ready to chat via a socket connection)
|
310 |
+
* If so add this to the other_data column of the session
|
311 |
+
*
|
312 |
+
* @return void
|
313 |
+
*/
|
314 |
+
function wplc_is_client_socket_enabled($other_data){
|
315 |
+
if(isset($_POST['socket'])){
|
316 |
+
$other_data['socket'] = true;
|
317 |
+
} else {
|
318 |
+
$other_data['socket'] = false;
|
319 |
+
}
|
320 |
+
return $other_data;
|
321 |
+
}
|
322 |
+
|
323 |
+
add_action('wp_ajax_wplc_node_switch_to_ajax', 'wplc_node_switch_to_ajax');
|
324 |
+
add_action('wp_ajax_nopriv_wplc_node_switch_to_ajax', 'wplc_node_switch_to_ajax');
|
325 |
+
/**
|
326 |
+
* Updates the 'other_data' of the session to reflect the socket fail over
|
327 |
+
*
|
328 |
+
* @return void
|
329 |
+
*/
|
330 |
+
function wplc_node_switch_to_ajax(){
|
331 |
+
global $wpdb;
|
332 |
+
global $wplc_tblname_chats;
|
333 |
+
|
334 |
+
$check = check_ajax_referer( 'wplc', 'security' );
|
335 |
+
if ($check == 1) {
|
336 |
+
if ($_POST['action'] == "wplc_node_switch_to_ajax") {
|
337 |
+
$cid = intval($_POST['cid']);
|
338 |
+
if($cid){
|
339 |
+
if(function_exists("wplc_get_chat_data")){
|
340 |
+
$cdata = wplc_get_chat_data($cid);
|
341 |
+
if($cdata){
|
342 |
+
$other = maybe_unserialize($cdata->other);
|
343 |
+
$other['socket'] = false;
|
344 |
+
|
345 |
+
$query = $wpdb->update(
|
346 |
+
$wplc_tblname_chats,
|
347 |
+
array(
|
348 |
+
'other' => maybe_serialize($other),
|
349 |
+
),
|
350 |
+
array('id' => $cid)
|
351 |
+
);
|
352 |
+
echo "1";
|
353 |
+
die();
|
354 |
+
}
|
355 |
+
}
|
356 |
+
}
|
357 |
+
}
|
358 |
+
}
|
359 |
+
echo "0";
|
360 |
+
die();
|
361 |
+
}
|
362 |
+
|
363 |
+
/**
|
364 |
+
* Adds the agent ID to the POST variables for the dashboard
|
365 |
+
*/
|
366 |
+
add_filter( "wplc_admin_dashboard_layout_node_request_variable_filter", "wplc_admin_filter_control_dashboard_layout_node_request_variable_filter_agent_id", 10, 1);
|
367 |
+
function wplc_admin_filter_control_dashboard_layout_node_request_variable_filter_agent_id( $form_data ) {
|
368 |
+
$form_data['aid'] = get_current_user_id();
|
369 |
+
return $form_data;
|
370 |
+
}
|
modules/offline_messages_custom_fields.php
CHANGED
File without changes
|
modules/webhooks_manager.php
ADDED
@@ -0,0 +1,490 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
global $wplc_webhook_table, $wplc_webhook_events;
|
4 |
+
$wplc_webhook_table = $wpdb->prefix . "wplc_webhooks";
|
5 |
+
|
6 |
+
//Use these when sending a payload
|
7 |
+
$wplc_webhook_events = array (
|
8 |
+
0 => __("Agent Login", "wplivechat"),
|
9 |
+
1 => __("Device Linked", "wplivechat"),
|
10 |
+
2 => __("Device Unlinked (Revoked)", "wplivechat"),
|
11 |
+
3 => __("New Visitor", "wplivechat"),
|
12 |
+
4 => __("Chat Request", "wplivechat"),
|
13 |
+
5 => __("Agent Accept", "wplivechat"),
|
14 |
+
6 => __("Settings Changed", "wplivechat")
|
15 |
+
);
|
16 |
+
|
17 |
+
add_action("wplc_activate_hook", "wplc_webhook_db_setup", 10);
|
18 |
+
add_action("wplc_update_hook", "wplc_webhook_db_setup", 10);
|
19 |
+
/*
|
20 |
+
* Updates/Creates the required tables in order to use devices on node
|
21 |
+
*/
|
22 |
+
function wplc_webhook_db_setup(){
|
23 |
+
global $wplc_webhook_table;
|
24 |
+
|
25 |
+
$wplc_webhooks_sql = "
|
26 |
+
CREATE TABLE " . $wplc_webhook_table . " (
|
27 |
+
id int(11) NOT NULL AUTO_INCREMENT,
|
28 |
+
url varchar(700) NULL,
|
29 |
+
push_to_devices tinyint(1) NULL,
|
30 |
+
action int(11) NULL,
|
31 |
+
method varchar(70) NULL,
|
32 |
+
PRIMARY KEY (id)
|
33 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
34 |
+
";
|
35 |
+
|
36 |
+
dbDelta($wplc_webhooks_sql);
|
37 |
+
}
|
38 |
+
|
39 |
+
add_action("wplc_hook_menu_mid","wplc_webhooks_manager_menu",11,1);
|
40 |
+
/*
|
41 |
+
* Adds a Webhooks menu item to admin menu
|
42 |
+
*/
|
43 |
+
function wplc_webhooks_manager_menu($cap) {
|
44 |
+
$wplc_settings = get_option("WPLC_SETTINGS");
|
45 |
+
if(isset($wplc_settings['wplc_use_node_server']) && $wplc_settings['wplc_use_node_server'] == 1){
|
46 |
+
//Only add this menu item if user is using node.
|
47 |
+
add_submenu_page('wplivechat-menu', __('Webhooks', 'wplivechat'), __('Webhooks', 'edit_posts'), $cap[0], 'wplc-webhooks-page', 'wplc_webhooks_page');
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
/*
|
52 |
+
* Draws the webhooks page
|
53 |
+
*/
|
54 |
+
function wplc_webhooks_page(){
|
55 |
+
wplc_webhook_header_check();
|
56 |
+
|
57 |
+
$add_webhook_btn = isset($_GET["wplc_action"]) && $_GET["wplc_action"] !== "delete_webhook_confirmed" ? "" : "<a href='?page=wplc-webhooks-page&wplc_action=add_webhook' class='button button-secondary'>". __("Add New", 'wp-livechat') ."</a>";
|
58 |
+
|
59 |
+
$content = "<div class='wrap'>";
|
60 |
+
$content .= "<h2>" . __('WP Live Chat Support - Webhooks', 'wplivechat') . " " . $add_webhook_btn . "</h2>";
|
61 |
+
|
62 |
+
if(isset($_GET['wplc_action']) && $_GET['wplc_action'] === 'add_webhook'){
|
63 |
+
$content .= wplc_webhooks_add_form();
|
64 |
+
} else if(isset($_GET['wplc_action']) && $_GET['wplc_action'] === 'edit_webhook'){
|
65 |
+
$content .= wplc_webhooks_add_form(true, $_GET['id']);
|
66 |
+
} else if(isset($_GET['wplc_action']) && $_GET['wplc_action'] === 'delete_webhook'){
|
67 |
+
$content .= wplc_webhooks_confirm_delete_prompt();
|
68 |
+
} else {
|
69 |
+
$content .= wplc_webhooks_table();
|
70 |
+
}
|
71 |
+
|
72 |
+
$content .= "</div>"; //Close Wrap
|
73 |
+
|
74 |
+
|
75 |
+
echo $content;
|
76 |
+
}
|
77 |
+
|
78 |
+
function wplc_webhook_header_check(){
|
79 |
+
if(isset($_POST['add_webhook'])){
|
80 |
+
//User is trying to add a webhook
|
81 |
+
if(wplc_webhook_add_webhook()){
|
82 |
+
echo "<p class='notice notice-success' style='max-width:300px'>" . __("Webhook created", "wplivechat") . "</p>";
|
83 |
+
} else {
|
84 |
+
echo "<p class='notice notice-error' style='max-width:300px'>" . __("Webhook could not be created", "wplivechat") . "</p>";
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
if(isset($_POST['edit_webhook'])){
|
89 |
+
//User is trying to edit a webhook
|
90 |
+
if(wplc_webhook_edit_webhook()){
|
91 |
+
echo "<p class='notice notice-success' style='max-width:300px'>" . __("Webhook edited", "wplivechat") . "</p>";
|
92 |
+
} else {
|
93 |
+
echo "<p class='notice notice-error' style='max-width:300px'>" . __("Webhook could not be edited", "wplivechat") . "</p>";
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
+
if(isset($_GET['wplc_action']) && $_GET['wplc_action'] === 'delete_webhook_confirmed'){
|
98 |
+
$webhook_id = isset($_GET['id']) ? intval($_GET['id']) : false;
|
99 |
+
if($webhook_id !== false){
|
100 |
+
if(wplc_webhook_delete_webhook($webhook_id)){
|
101 |
+
echo "<p class='notice notice-success' style='max-width:300px'>" . __("Webhook deleted", "wplivechat") . "</p>";
|
102 |
+
} else {
|
103 |
+
echo "<p class='notice notice-error' style='max-width:300px'>" . __("Webhook could not be delete", "wplivechat") . "</p>";
|
104 |
+
}
|
105 |
+
}
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
function wplc_webhook_add_webhook(){
|
110 |
+
global $wpdb;
|
111 |
+
global $wplc_webhook_table;
|
112 |
+
|
113 |
+
if(isset($_POST['add_webhook_event'])){
|
114 |
+
$event = intval($_POST['add_webhook_event']);
|
115 |
+
$action_url = esc_attr($_POST['add_webhook_domain']);
|
116 |
+
$push_to_devices = isset($_POST['add_webhook_push']) && intval($_POST['add_webhook_push']) === 1 ? 1 : 0;
|
117 |
+
$method = isset($_POST['add_webhook_method']) ? esc_attr($_POST['add_webhook_method']) : "GET" ;
|
118 |
+
|
119 |
+
$sql = "INSERT INTO $wplc_webhook_table SET `url` = '".$action_url."', `push_to_devices` = '".$push_to_devices."', `action` = '".$event."', `method` = '".$method."' ";
|
120 |
+
$wpdb->query($sql);
|
121 |
+
if ($wpdb->last_error) {
|
122 |
+
return false;
|
123 |
+
} else {
|
124 |
+
return true;
|
125 |
+
}
|
126 |
+
} else {
|
127 |
+
return false;
|
128 |
+
}
|
129 |
+
}
|
130 |
+
|
131 |
+
function wplc_webhook_edit_webhook(){
|
132 |
+
global $wpdb;
|
133 |
+
global $wplc_webhook_table;
|
134 |
+
|
135 |
+
$webhook_id = isset($_POST['edit_webhook_id']) ? intval($_POST['edit_webhook_id']) : false;
|
136 |
+
if(isset($_POST['add_webhook_event']) && $webhook_id !== false){
|
137 |
+
$event = intval($_POST['add_webhook_event']);
|
138 |
+
$action_url = esc_attr($_POST['add_webhook_domain']);
|
139 |
+
$push_to_devices = isset($_POST['add_webhook_push']) && intval($_POST['add_webhook_push']) === 1 ? 1 : 0;
|
140 |
+
$method = isset($_POST['add_webhook_method']) ? esc_attr($_POST['add_webhook_method']) : "GET" ;
|
141 |
+
|
142 |
+
$sql = "UPDATE $wplc_webhook_table SET `url` = '".$action_url."', `push_to_devices` = '".$push_to_devices."', `action` = '".$event."', `method` = '".$method."' WHERE `id` = '" . $webhook_id . "' ";
|
143 |
+
$wpdb->query($sql);
|
144 |
+
if ($wpdb->last_error) {
|
145 |
+
return false;
|
146 |
+
} else {
|
147 |
+
return true;
|
148 |
+
}
|
149 |
+
} else {
|
150 |
+
return false;
|
151 |
+
}
|
152 |
+
}
|
153 |
+
|
154 |
+
function wplc_webhook_delete_webhook($webhook_id = false){
|
155 |
+
global $wpdb;
|
156 |
+
global $wplc_webhook_table;
|
157 |
+
|
158 |
+
if($webhook_id !== false){
|
159 |
+
$sql = "DELETE FROM $wplc_webhook_table WHERE `id` = '".$webhook_id."' ";
|
160 |
+
$wpdb->query($sql);
|
161 |
+
if ($wpdb->last_error) {
|
162 |
+
return false;
|
163 |
+
} else {
|
164 |
+
return true;
|
165 |
+
}
|
166 |
+
} else {
|
167 |
+
return false;
|
168 |
+
}
|
169 |
+
}
|
170 |
+
|
171 |
+
/*
|
172 |
+
* Return all webhooks from database
|
173 |
+
*/
|
174 |
+
function wplc_webhooks_get_all_db($where = false){
|
175 |
+
global $wpdb;
|
176 |
+
global $wplc_webhook_table;
|
177 |
+
|
178 |
+
$where = ($where === false) ? "" : $where;
|
179 |
+
|
180 |
+
$sql = "SELECT * FROM $wplc_webhook_table " . $where;
|
181 |
+
|
182 |
+
$results = $wpdb->get_results($sql);
|
183 |
+
if($wpdb->num_rows){
|
184 |
+
return $results;
|
185 |
+
} else {
|
186 |
+
return false;
|
187 |
+
}
|
188 |
+
}
|
189 |
+
|
190 |
+
/*
|
191 |
+
* Return specific webhook data
|
192 |
+
*/
|
193 |
+
function wplc_webhook_get_data($webhook_id){
|
194 |
+
$results = wplc_webhooks_get_all_db("WHERE `id` = '". intval($webhook_id) ."'");
|
195 |
+
if($results !== false){
|
196 |
+
return $results[0];
|
197 |
+
} else {
|
198 |
+
return false;
|
199 |
+
}
|
200 |
+
}
|
201 |
+
|
202 |
+
/*
|
203 |
+
* Return all matched webhook
|
204 |
+
*/
|
205 |
+
function wplc_webhook_get_matched_hooks($event_code){
|
206 |
+
$results = wplc_webhooks_get_all_db("WHERE `action` = '". intval($event_code) ."'");
|
207 |
+
if($results !== false){
|
208 |
+
return $results;
|
209 |
+
} else {
|
210 |
+
return false;
|
211 |
+
}
|
212 |
+
}
|
213 |
+
|
214 |
+
/*
|
215 |
+
* Renders webhooks table
|
216 |
+
*/
|
217 |
+
function wplc_webhooks_table() {
|
218 |
+
global $wpdb, $wplc_webhook_table, $wplc_webhook_events;
|
219 |
+
$webhooks = wplc_webhooks_get_all_db();
|
220 |
+
|
221 |
+
$content = "";
|
222 |
+
if($webhooks !== false){
|
223 |
+
|
224 |
+
$content .= "<table id='webhooks' class='wp-list-table widefat' cellspacing='0' width='100%'>";
|
225 |
+
$content .= "<thead>";
|
226 |
+
$content .= "<tr>";
|
227 |
+
$content .= "<th scope='col' id='event' style='width:30%;'><span>".__("Event","wplivechat")."</span></th>";
|
228 |
+
$content .= "<th scope='col' id='target' style='width:30%;'><span>".__("Target URL","wplivechat")."</span></th>";
|
229 |
+
$content .= "<th scope='col' id='push' style='width:10%;'><span>".__("Push Devices","wplivechat")."</span></th>";
|
230 |
+
$content .= "<th scope='col' id='method' style='width:10%;'><span>".__("Method","wplivechat")."</span></th>";
|
231 |
+
$content .= "<th scope='col' id='action'><span>".__("Action","wplivechat")."</span></th>";
|
232 |
+
$content .= "</tr>";
|
233 |
+
$content .= "</thead>";
|
234 |
+
$content .= "<tbody>";
|
235 |
+
|
236 |
+
foreach ($webhooks as $key => $webhook) {
|
237 |
+
$content .= "<tr>";
|
238 |
+
$content .= "<td>". $wplc_webhook_events[$webhook->action] ."</td>";
|
239 |
+
$content .= "<td>". $webhook->url ."</td>";
|
240 |
+
$content .= "<td>". (intval($webhook->push_to_devices) === 1 ? "Yes" : "No") ."</td>";
|
241 |
+
$content .= "<td>". $webhook->method ."</td>";
|
242 |
+
$content .= "<td>";
|
243 |
+
$content .= "<a href='?page=wplc-webhooks-page&wplc_action=edit_webhook&id=".$webhook->id."' title='" . __("Edit", "wplivechat") . "' class='button button-secondary'>" . __("Edit", "wplivechat") . "</a> ";
|
244 |
+
$content .= "<a href='?page=wplc-webhooks-page&wplc_action=delete_webhook&id=".$webhook->id."' title='" . __("Delete", "wplivechat") . "' class='button button-secondary'>" . __("Delete", "wplivechat") . "</a>";
|
245 |
+
$content .= "</td>";
|
246 |
+
$content .= "</tr>";
|
247 |
+
}
|
248 |
+
|
249 |
+
$content .= "</tbody>";
|
250 |
+
$content .= "</table>";
|
251 |
+
} else {
|
252 |
+
$content .= "<p class='notice notice-error' style='max-width:300px'>" . __("No Webhooks", "wplivechat") . "</p>";
|
253 |
+
}
|
254 |
+
|
255 |
+
return $content;
|
256 |
+
}
|
257 |
+
|
258 |
+
|
259 |
+
/*
|
260 |
+
* Renders webhooks add webhook form
|
261 |
+
*/
|
262 |
+
function wplc_webhooks_add_form($force_edit = false, $webhook_id = false) {
|
263 |
+
$event_value = 0;
|
264 |
+
$url_value = "";
|
265 |
+
$push_value = 0;
|
266 |
+
$method_value = "GET";
|
267 |
+
|
268 |
+
if($force_edit && $webhook_id !== false){
|
269 |
+
$webhook_id = intval($webhook_id);
|
270 |
+
$webhook_data = wplc_webhook_get_data($webhook_id);
|
271 |
+
if($webhook_data !== false){
|
272 |
+
$event_value = $webhook_data->action;
|
273 |
+
$url_value = $webhook_data->url;
|
274 |
+
$push_value = $webhook_data->push_to_devices;
|
275 |
+
$method_value = $webhook_data->method;
|
276 |
+
}
|
277 |
+
}
|
278 |
+
|
279 |
+
$content = "<form method='POST' action='?page=wplc-webhooks-page'>";
|
280 |
+
$content .= "<table class='wp-list-table widefat striped'>";
|
281 |
+
$content .= "<tr>";
|
282 |
+
$content .= "<td>" . __("Event", "wplivechat") . "</td>";
|
283 |
+
$content .= "<td>" . wplc_webhook_render_event_selection_dropdown("add_webhook_event", $event_value, 'width:200px') . "</td>";
|
284 |
+
$content .= "</tr>";
|
285 |
+
|
286 |
+
$content .= "<tr>";
|
287 |
+
$content .= "<td>" . __("Target URL", "wplivechat") . "</td>";
|
288 |
+
$content .= "<td><input placeholder='http://example.com/webhook_handler' name='add_webhook_domain' value='".$url_value."' type='text' style='width:200px'> <small>" . __("This field can be left empty if you intend on using only push notifications for online agents", "wplivechat") . "</small></td>";
|
289 |
+
$content .= "</tr>";
|
290 |
+
|
291 |
+
$content .= "<tr>";
|
292 |
+
$content .= "<td>" . __("Push to Online Agent Devices", "wplivechat") . "</td>";
|
293 |
+
$content .= "<td>";
|
294 |
+
$content .= "<select id='add_webhook_push' name='add_webhook_push' style='width:200px' value='".$push_value."'>";
|
295 |
+
$content .= "<option value='0' ".(intval($push_value) === 0 ? "selected" : "").">" . __("No", "wplivechat") . "</option>";
|
296 |
+
$content .= "<option value='1' ".(intval($push_value) === 1 ? "selected" : "").">" . __("Yes", "wplivechat") . "</option>";
|
297 |
+
$content .= "</select>";
|
298 |
+
$content .= "</td>";
|
299 |
+
$content .= "</tr>";
|
300 |
+
|
301 |
+
$content .= "<tr>";
|
302 |
+
$content .= "<td>" . __("Method", "wplivechat") . "</td>";
|
303 |
+
$content .= "<td>";
|
304 |
+
$content .= "<select id='add_webhook_method' name='add_webhook_method' style='width:200px' value='".$method_value."'>";
|
305 |
+
$content .= "<option value='GET' ".($method_value === "GET" ? "selected" : "").">" . __("GET", "wplivechat") . "</option>";
|
306 |
+
$content .= "<option value='POST' ".($method_value === "POST" ? "selected" : "").">" . __("POST", "wplivechat") . "</option>";
|
307 |
+
$content .= "</select>";
|
308 |
+
$content .= "</td>";
|
309 |
+
$content .= "</tr>";
|
310 |
+
|
311 |
+
$content .= "<tr>";
|
312 |
+
$content .= "<td><input type='submit' name='".($force_edit ? "edit_webhook" : "add_webhook")."' value='" . ($force_edit ? __("Save Changes", "wplivechat") : __("Add New", "wplivechat") ) . "' class='button button-primary'></td>";
|
313 |
+
$content .= "<td>" . ($force_edit ? "<input type='hidden' name='edit_webhook_id' value='" . $webhook_id . "' >" : "") . "</td>";
|
314 |
+
$content .= "</tr>";
|
315 |
+
|
316 |
+
$content .= "</table>";
|
317 |
+
$content .= "</form>";
|
318 |
+
|
319 |
+
return $content;
|
320 |
+
}
|
321 |
+
|
322 |
+
function wplc_webhooks_confirm_delete_prompt(){
|
323 |
+
$content = "<table class='wp-list-table widefat striped' style='max-width:350px'>";
|
324 |
+
|
325 |
+
$content .= "<tr>";
|
326 |
+
$content .= "<td><strong>" . __("Are you sure you want to delete this webhook?", "wplivechat") . "</strong></td>";
|
327 |
+
$content .= "</tr>";
|
328 |
+
|
329 |
+
$content .= "<tr>";
|
330 |
+
$content .= "<td>";
|
331 |
+
$content .= "<a href='?page=wplc-webhooks-page&wplc_action=delete_webhook_confirmed&id=".$_GET['id']."' title='" . __("Confirm", "wplivechat") . "' class='button button-primary'>" . __("Confirm", "wplivechat") . "</a> ";
|
332 |
+
$content .= "<a href='?page=wplc-webhooks-page' title='" . __("Cancel", "wplivechat") . "' class='button button-secondary'>" . __("Cancel", "wplivechat") . "</a> ";
|
333 |
+
$content .= "</td>";
|
334 |
+
$content .= "</tr>";
|
335 |
+
|
336 |
+
$content .= "</table>";
|
337 |
+
|
338 |
+
return $content;
|
339 |
+
}
|
340 |
+
|
341 |
+
function wplc_webhook_render_event_selection_dropdown($name, $selected = 0, $styles = ''){
|
342 |
+
global $wplc_webhook_events;
|
343 |
+
|
344 |
+
$content = "<select id='$name' name='$name' style='$styles'>";
|
345 |
+
foreach ($wplc_webhook_events as $key => $value) {
|
346 |
+
$content .= "<option value='$key' ".(intval($key) === intval($selected) ? "selected " : "" ).">" . $value . "</option>";
|
347 |
+
}
|
348 |
+
$content .= "</select>";
|
349 |
+
|
350 |
+
return $content;
|
351 |
+
}
|
352 |
+
|
353 |
+
add_action("wplc_fire_webhook", "wplc_webhook_send", 10, 2);
|
354 |
+
/*
|
355 |
+
* Sends the payload to any matched events - Magic
|
356 |
+
*/
|
357 |
+
function wplc_webhook_send($event_code, $payload){
|
358 |
+
global $wplc_webhook_events;
|
359 |
+
if(isset($event_code) && isset($payload)){
|
360 |
+
$event_code = intval($event_code);
|
361 |
+
if(array_key_exists($event_code, $wplc_webhook_events)){
|
362 |
+
$matches = wplc_webhook_get_matched_hooks(intval($event_code));
|
363 |
+
if($matches !== false){
|
364 |
+
//fire off the hooks
|
365 |
+
$error_found = false;
|
366 |
+
foreach ($matches as $webhook) {
|
367 |
+
$target_url = isset($webhook->url) ? $webhook->url : false;
|
368 |
+
$push = intval($webhook->push_to_devices) === 1 ? true : false;
|
369 |
+
$method = isset($webhook->method) && $webhook->method === "GET" ? "GET" : "POST";
|
370 |
+
|
371 |
+
if(!is_array($payload)){
|
372 |
+
//Not an array, no worries we will fix that
|
373 |
+
$payload = array("other" => $payload);
|
374 |
+
}
|
375 |
+
|
376 |
+
$payload = array(
|
377 |
+
"event" => $wplc_webhook_events[intval($event_code)],
|
378 |
+
"data" => json_encode($payload),
|
379 |
+
"time_sent" => time()
|
380 |
+
);
|
381 |
+
|
382 |
+
if($target_url !== false && $target_url !== ""){
|
383 |
+
$result = "";
|
384 |
+
if($method === "POST"){
|
385 |
+
|
386 |
+
$options = array(
|
387 |
+
'http' => array(
|
388 |
+
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
|
389 |
+
'method' => $method,
|
390 |
+
'content' => http_build_query($payload)
|
391 |
+
)
|
392 |
+
);
|
393 |
+
$context = @stream_context_create($options);
|
394 |
+
$result = @file_get_contents($target_url, false, $context);
|
395 |
+
|
396 |
+
if(!$result){
|
397 |
+
//Post failed, we try curly
|
398 |
+
$curl = curl_init();
|
399 |
+
curl_setopt_array($curl, array(
|
400 |
+
CURLOPT_RETURNTRANSFER => 1,
|
401 |
+
CURLOPT_URL => $target_url,
|
402 |
+
CURLOPT_USERAGENT => 'WPLC Request',
|
403 |
+
CURLOPT_POST => 1,
|
404 |
+
CURLOPT_POSTFIELDS => $payload
|
405 |
+
));
|
406 |
+
$result = curl_exec($curl);
|
407 |
+
curl_close($curl);
|
408 |
+
if(!$result){
|
409 |
+
//This has failed twice
|
410 |
+
$error_found = true;
|
411 |
+
$result = "Failed! No Response.";
|
412 |
+
}
|
413 |
+
}
|
414 |
+
} else {
|
415 |
+
$get_data = http_build_query($payload);
|
416 |
+
$result = @file_get_contents($target_url."?".$get_data);
|
417 |
+
if(!$result){
|
418 |
+
//Get request failed with get contents - Gooi a curly
|
419 |
+
$curl = curl_init();
|
420 |
+
curl_setopt_array($curl, array(
|
421 |
+
CURLOPT_RETURNTRANSFER => 1,
|
422 |
+
CURLOPT_URL => $target_url."?".$get_data,
|
423 |
+
CURLOPT_USERAGENT => 'WPLC Request'
|
424 |
+
));
|
425 |
+
$result = curl_exec($curl);
|
426 |
+
curl_close($curl);
|
427 |
+
if(!$result){
|
428 |
+
//This has failed twice
|
429 |
+
$error_found = true;
|
430 |
+
$result = "Failed! No Response.";
|
431 |
+
}
|
432 |
+
}
|
433 |
+
}
|
434 |
+
}
|
435 |
+
|
436 |
+
if($push){
|
437 |
+
//Push to online devices...
|
438 |
+
if(function_exists("wplc_devices_push_notification")){
|
439 |
+
wplc_devices_push_notification(false, __("Event Triggered", "wplivechat") , $wplc_webhook_events[intval($event_code)], false);
|
440 |
+
}
|
441 |
+
}
|
442 |
+
}
|
443 |
+
}
|
444 |
+
}
|
445 |
+
}
|
446 |
+
}
|
447 |
+
|
448 |
+
add_action("wplc_change_chat_status_hook", "wplc_webhook_status_change_monitor", 10, 2);
|
449 |
+
/*
|
450 |
+
* Special delegate function for status changes
|
451 |
+
*/
|
452 |
+
function wplc_webhook_status_change_monitor($cid, $status){
|
453 |
+
switch (intval($status)) {
|
454 |
+
case 2:
|
455 |
+
//Chat Request
|
456 |
+
do_action("wplc_fire_webhook", 4, array("chat_id" => $cid));
|
457 |
+
break;
|
458 |
+
case 3:
|
459 |
+
//Agent Accept
|
460 |
+
do_action("wplc_fire_webhook", 5, array("chat_id" => $cid));
|
461 |
+
break;
|
462 |
+
}
|
463 |
+
}
|
464 |
+
|
465 |
+
add_action("wplc_log_user_on_page_after_hook", "wplc_webhook_new_visitor_monitor", 10, 2);
|
466 |
+
/*
|
467 |
+
* Special Delegate function for new visitor (log user on page)
|
468 |
+
*/
|
469 |
+
function wplc_webhook_new_visitor_monitor($dbid, $wplc_session_data){
|
470 |
+
do_action("wplc_fire_webhook", 3, array("chat_id" => $dbid));
|
471 |
+
}
|
472 |
+
|
473 |
+
add_action("wp_login", "wplc_webhook_login_monitor", 10, 2);
|
474 |
+
/*
|
475 |
+
* Watches all login activity to track when an agent logs in
|
476 |
+
*/
|
477 |
+
function wplc_webhook_login_monitor($user_login, $user){
|
478 |
+
if( get_user_meta( $user->ID, 'wplc_ma_agent', true ) ){
|
479 |
+
//Is an agent
|
480 |
+
do_action("wplc_fire_webhook", 0, array("agent_id" => $user->ID));
|
481 |
+
}
|
482 |
+
}
|
483 |
+
|
484 |
+
add_action("wplc_hook_admin_settings_save", "wplc_webhook_save_settings_monitor");
|
485 |
+
/*
|
486 |
+
* Checks when settings are saved
|
487 |
+
*/
|
488 |
+
function wplc_webhook_save_settings_monitor(){
|
489 |
+
do_action("wplc_fire_webhook", 6, array("user_id" => get_current_user_id()));
|
490 |
+
}
|
readme.txt
CHANGED
@@ -4,6 +4,7 @@ Donate link: http://www.wp-livechat.com
|
|
4 |
Tags: live chat, live support, chat plugin, live help, wordpress live chat, chat, live chat plugin, live support plugin, live chat support plugin, chat plugin, support plugin, live help
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 4.9
|
|
|
7 |
Stable tag: trunk
|
8 |
License: GPLv2
|
9 |
|
@@ -206,6 +207,34 @@ If the live chat box still does not appear on your website, please go through th
|
|
206 |
|
207 |
== Upgrade Notice ==
|
208 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
= 7.1.07 =
|
210 |
It is highly recommended that you upgrade to WP Live Chat Support version 7.1.07 for security reasons.
|
211 |
|
4 |
Tags: live chat, live support, chat plugin, live help, wordpress live chat, chat, live chat plugin, live support plugin, live chat support plugin, chat plugin, support plugin, live help
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 4.9
|
7 |
+
Requires PHP: 5.3
|
8 |
Stable tag: trunk
|
9 |
License: GPLv2
|
10 |
|
207 |
|
208 |
== Upgrade Notice ==
|
209 |
|
210 |
+
= 8.0.01 =
|
211 |
+
* Massive improvements to the performance of the plugin
|
212 |
+
* New, modern dashboard
|
213 |
+
* The dashboard can now be added to all admin pages
|
214 |
+
* Dynamic visitor filtering
|
215 |
+
* Improved REST API Security
|
216 |
+
* OS identification
|
217 |
+
* Better Browser identification
|
218 |
+
* Mobile/desktop identification
|
219 |
+
* Country identification (API)
|
220 |
+
* Inline link handling
|
221 |
+
* Security patches
|
222 |
+
* Gutenberg support
|
223 |
+
* Full WPML Support
|
224 |
+
* Showcase user's timezone
|
225 |
+
* Emoticons added to the chatbox
|
226 |
+
* New API endpoints
|
227 |
+
* Refactor JS code – backend and frontend to make use of events
|
228 |
+
* Store messages using sessionStorage to avoid unnecessary DB calls
|
229 |
+
* Better polling system for visitor tracking
|
230 |
+
* Better history UI
|
231 |
+
* Support for the new iOS app
|
232 |
+
* Support for the new Android App
|
233 |
+
* Support for the new Desktop App
|
234 |
+
|
235 |
+
= 8.0.00 =
|
236 |
+
* Beta release
|
237 |
+
|
238 |
= 7.1.07 =
|
239 |
It is highly recommended that you upgrade to WP Live Chat Support version 7.1.07 for security reasons.
|
240 |
|
ring.wav
CHANGED
File without changes
|
wp-live-chat-support.php
CHANGED
@@ -3,39 +3,51 @@
|
|
3 |
Plugin Name: WP Live Chat Support
|
4 |
Plugin URI: http://www.wp-livechat.com
|
5 |
Description: The easiest to use website live chat plugin. Let your visitors chat with you and increase sales conversion rates with WP Live Chat Support. No third party connection required!
|
6 |
-
Version:
|
7 |
Author: WP-LiveChat
|
8 |
Author URI: http://www.wp-livechat.com
|
9 |
Text Domain: wplivechat
|
10 |
Domain Path: /languages
|
11 |
*/
|
12 |
-
|
13 |
/**
|
14 |
-
* 7.1.08 - 2018-01-04 - Low priority
|
15 |
-
* Added PHP 7 compatibility
|
16 |
-
*
|
17 |
-
* 7.1.07 - 2017-11-06 - High priority
|
18 |
-
* Patched a security exploit found by James @ Pritect, Inc. Thank you James!
|
19 |
-
*
|
20 |
-
* 7.1.06 - 2017-09-27 - Low priority
|
21 |
-
* Fixed a bug that stopped agents from deleting offline messages
|
22 |
-
*
|
23 |
-
* 7.1.05 - 2017-08-01 - High Priority
|
24 |
-
* XSS Vulenrability Fixed - Thank you Omaid Faizyar
|
25 |
*
|
26 |
-
*
|
27 |
-
*
|
28 |
-
*
|
29 |
-
*
|
30 |
-
*
|
31 |
-
*
|
32 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
* Fixed undefined variables when using social profiles, a bio and tag line
|
34 |
* Fixed a bug that caused some messages to not get recorded
|
35 |
-
*
|
36 |
* 7.1.01 - 2017-06-18 - Low priority
|
37 |
* Small bug fix for agent profiles
|
38 |
-
*
|
39 |
* 7.1.00 - 2017-06-18 - Medium priority
|
40 |
* Modernised the live chat box
|
41 |
* Fixed a bug that caused the wrong agent name to show up in the "typing" element after a chat was transferred
|
@@ -50,9 +62,9 @@
|
|
50 |
* Fixed a bug with the listing of all missed chats
|
51 |
* Fixed a bug that sent pings to the node server when it was not necessary, causing an overload of the node server
|
52 |
* Fixed a bug that did not allow you to view the chat history of a missed chat
|
53 |
-
* Fixed a bug that caused the 'display name' and 'display avatar' to behave erratically
|
54 |
* Fixed a bug that caused the time and date display functionality to behave erratically
|
55 |
-
* Fixed a bug that caused a JavaScript error on the admin chat dashboard when a single visitor leaves the site
|
56 |
* Fixed a bug that caused the chat widow to appear before the chat circle when engaged in a chat and moving from page to page
|
57 |
* The visitor can now restart any chat that has been ended by an agent
|
58 |
* You can now customize the text "The chat has been ended by the operator"
|
@@ -63,11 +75,11 @@
|
|
63 |
* Fixed a bug that caused "maximize" notifications to not get sent through to agents when using the Node server
|
64 |
* Fixed a bug that did not allow single missed chats to be deleted
|
65 |
* Fixed a bug that caused the text input field to continually be focused on thereby causing issues
|
66 |
-
*
|
67 |
* 7.0.08 - 2017-05-21 - Low priority
|
68 |
* Fixed the powered by link
|
69 |
* Added supporting code for new extensions
|
70 |
-
*
|
71 |
* 7.0.07 - 2017-05-15 - Medium priority
|
72 |
* You can now change the text of the offline message button
|
73 |
* You can now change the text of the close chat button
|
@@ -83,33 +95,33 @@
|
|
83 |
* Fixed a bug that caused attached images to not display correctly
|
84 |
* Fixed a bug that caused notifications to show up in the front end when the agent is testing a chat with him or herself
|
85 |
* Fixed a bug that caused the visitor count to flash when the visitor count had not changed
|
86 |
-
*
|
87 |
* 7.0.06 -2017-03-13 - Low Priority
|
88 |
* Enhancement: 'Open Chat' button changes to 'Chat Accepted' once a chat is active
|
89 |
* Bug Fix: Compatibility bug fix for decryption in the Pro version
|
90 |
-
*
|
91 |
-
* 7.0.05 - 2017-03-01 - Low priority
|
92 |
-
* Fixed broken links on the plugins page
|
93 |
-
*
|
94 |
* 7.0.04 - 2017-02-15 - Medium Priority
|
95 |
* Fixed a bug that caused messages to be returned encoded after refreshing the page
|
96 |
* Fixed a bug that caused the incorrect agent name to be used in the chat window
|
97 |
* Fixed a bug that caused the 'No Answer' text to not save and show in the chat window
|
98 |
-
*
|
99 |
-
*
|
100 |
* 7.0.03 - 2017-02-06 - Medium Priority
|
101 |
* Fixed a bug that caused the name of the agent to disappear after refreshing the page
|
102 |
* Fixed a bug that caused the agent name to display twice in the chat window
|
103 |
-
*
|
104 |
* 7.0.02 - 2017-01-26 - High priority
|
105 |
* PHPMailer vulnerability patch (removed our version of PHPMailer and are now using WP's built-in version)
|
106 |
* Added the ability for plugin users to subscribe to our mailing list
|
107 |
-
*
|
108 |
* 7.0.01 - 2017-01-03 - Medium priority
|
109 |
* Fixed a bug that caused the chat to disappear after being opened for some users
|
110 |
* Changes made to the language files
|
111 |
* PHPMailer has been updated to the latest version
|
112 |
-
*
|
113 |
* 7.0.00 - 2016-12-14 - Medium priority
|
114 |
* Major performance improvements - 300% reduction in DB calls
|
115 |
* Node Server Integration (Experimental)
|
@@ -131,16 +143,16 @@
|
|
131 |
* Integrated with Contact Form Ready to allow for custom forms to be used for the offline message form
|
132 |
* Google Analytics Integration
|
133 |
* Ability to change the subject of the offline message
|
134 |
-
* Ability to add custom CSS and JavaScript in the settings page
|
135 |
-
*
|
136 |
-
* 6.2.11 - 2016-10-27 - Medium Priority
|
137 |
* Fixed a bug that caused issues with the User JS file when being minified
|
138 |
* Fixed a bug that caused the 'Congratulations' message to never clear when using the Cloud Server
|
139 |
* Fixed a bug that caused new TLD's to return invalid when starting a new chat
|
140 |
* Fixed a variety of strings that were using the incorrect text domain
|
141 |
* Italian translation updated - Thank you Angelo Giammarresi
|
142 |
* HTML is now rendered in the Input replacement field of the Classic chat window
|
143 |
-
*
|
144 |
* 6.2.10 - 2016-10-18 - High priority for IE users
|
145 |
* IE bug fix - fixed the bug that stopped the chat window from opening when clicking on it
|
146 |
* Fixed the bug that caused user messages to not be sent on some websites due to non-unique function names being used in the md5.js file
|
@@ -149,25 +161,25 @@
|
|
149 |
* Estonian translation added - thank you Joonas Kessel
|
150 |
* Chinese translation updated - thank you Wan Kit
|
151 |
* Missing translation strings added in all languages
|
152 |
-
*
|
153 |
* 6.2.09 - 2016-09-15 - High priority for cloud users
|
154 |
* Further cloud server bug fixes
|
155 |
*
|
156 |
* 6.2.08 - 2016-09-15 - High priority for cloud users
|
157 |
* Fixed a bug that caused no visitors to be displayed when using the cloud server
|
158 |
-
*
|
159 |
* 6.2.07 - 2016-09-15 - Medium priority
|
160 |
* Fixed a bug that caused a fatal error on older PHP version
|
161 |
-
*
|
162 |
* 6.2.06 - 2016-09-14 - Medium Priority
|
163 |
-
* Added Rest API functionality (Accept chat, end chat, get messages, send message, get sessions)
|
164 |
-
* Added 'Device' type logging to live chat dashboard area.
|
165 |
* Minified User Side JavaScript
|
166 |
* Added Connection Handling (User), which will now retry to establish connection upon fail
|
167 |
* Added Connection Handling (Admin), which will retry to establish connection upon fail
|
168 |
* Fixed a PHP warning on the feedback page
|
169 |
* Fixed a bug where offline strings weren't translating when localization option was checked
|
170 |
-
*
|
171 |
* 6.2.05 - 2016-08-19 - Medium priority
|
172 |
* Added compatibility for Pro triggers
|
173 |
* Added Classic Theme's Hovercard (Will only show with triggers)
|
@@ -177,25 +189,25 @@
|
|
177 |
* Ability to delete individual Chats from History
|
178 |
* Minor Styling Conflicts Resolved
|
179 |
* Fixed the bug that caused "start chat" to be added to the button in the live chat box when offline
|
180 |
-
* Fixed a bug that showed slashes when apostrophes were used
|
181 |
* Added various filters/actions for use in Pro
|
182 |
* Added ability to open chat box using an elements ID/Class (Click/Hover)
|
183 |
-
*
|
184 |
* 6.2.04 - 2016-08-01 - High priority
|
185 |
* Security patches in the offline message storing function (securify.nl/advisory/SFY20190709/stored_cross_site_scripting_vulnerability_in_wp_live_chat_support_wordpress_plugin.html)
|
186 |
-
*
|
187 |
* 6.2.03 - 2016-07-19 - Low priority
|
188 |
* Italian translation updated - thank you Angelo Giammarresi
|
189 |
* Fixed Danish translation bug
|
190 |
* Minor UI fixes
|
191 |
* Edge browser bug fix when opening chats
|
192 |
-
*
|
193 |
* 6.2.02 - 2016-07-11 - High priority
|
194 |
* XSS Security patch - Thank you Han Sahin!
|
195 |
-
*
|
196 |
* 6.2.01 - 2016-07-07 - Low priority
|
197 |
* Surveys/Polls added - you can now add a survey/poll to your chat box either before or after a chat session
|
198 |
-
*
|
199 |
* 6.2.00 - 2016-06-10 - High priority
|
200 |
* Cloud server bug fix
|
201 |
* Offline messages bug fix
|
@@ -203,11 +215,11 @@
|
|
203 |
* Fixed the bug that stopped email addresses such as "name@domain.tld" from validating
|
204 |
* Advanced options to control the long poll variables
|
205 |
* Support added for many new pro features
|
206 |
-
*
|
207 |
* 6.1.02 - 2016-04-13 - Low Priority
|
208 |
* Tested on WordPress 4.5
|
209 |
* Fixed a bug that sent offline messages to the wrong email address
|
210 |
-
*
|
211 |
* 6.1.01 - 2016-04-07 - Low Priority
|
212 |
* You can now delete inidividual offline messages from your history
|
213 |
* Code improvements done to the way scripts are loaded when displaying the chat
|
@@ -227,7 +239,7 @@
|
|
227 |
* - Danish Updated (Thank you Kasper Jensen)
|
228 |
* - Spanish Updated (Thank you Olivier Gantois)
|
229 |
* - French Updated (Thank you Olivier Gantois)
|
230 |
-
*
|
231 |
* 6.1.00 - 2016-03-18 - Medium priority
|
232 |
* Fixed a bug that caused the chat agent to be nullified if you saved the settings
|
233 |
* NEW: Introduced a new modern theme
|
@@ -241,34 +253,34 @@
|
|
241 |
* Fixed a bug that added slashes to apostrophes in the chat window
|
242 |
* Fixed a bug that caused an error when trying to load the chat box when a banned user visited the site
|
243 |
* Fixed a bug that still displayed the offline message window even if the setting was set to false
|
244 |
-
*
|
245 |
* 6.0.07 - 2016-03-11 - High priority
|
246 |
* Bug fix - agent status was lost when saving settings
|
247 |
-
*
|
248 |
* 6.0.06 - 2016-03-04 - Medium priority
|
249 |
* More stable fix for the menu item bug that has been experienced lately
|
250 |
-
*
|
251 |
* 6.0.05 - 2016-02-23 - Medium priority
|
252 |
* Fixed the bug that caused the menu item to not display for some users
|
253 |
-
*
|
254 |
* 6.0.04 - 2016-02-16 - Low priority
|
255 |
* Offline message bug fix with the cloud server extension
|
256 |
* Choose when online bug fix
|
257 |
* Agent bug fix
|
258 |
* Styling adjustment for viewpots of 481px and below
|
259 |
* All content now loaded and pushed via SSL links
|
260 |
-
*
|
261 |
* 6.0.03 - 2016-02-04 - Low priority
|
262 |
* Fixed a bug that caused a warning if an incorrect IP address was in the banned IP address field
|
263 |
* Offline messaging bug fixed
|
264 |
-
*
|
265 |
* 6.0.02 - 2016-02-03 - Low priority
|
266 |
* Added a new filter to fix a bug with WP Live Chat Support - Advanced Chat Box Control Extension
|
267 |
-
*
|
268 |
* 6.0.01 - 2016-02-02 - High priority
|
269 |
* Crucial bug fix that stopped the live chat from working in some instances
|
270 |
* New filter to fix the bug with the WP Live Chat Choose When Online bug
|
271 |
-
*
|
272 |
* 6.0.00 -2016-01-26 - Freedom of Speech Update - Medium Priority
|
273 |
* New functionality
|
274 |
* Unlimited simultaneous chats now available
|
@@ -278,39 +290,39 @@
|
|
278 |
*
|
279 |
* 5.0.14 - 2016-01-13 - High priority
|
280 |
* Bug fix: When activating WP Live Chat Support, a table is created with a shared MySQL column name which caused issues on some servers. The column name has been changed
|
281 |
-
*
|
282 |
* 5.0.13 - 2016-01-05 - High priority
|
283 |
* UTF8 encoding bug fixed
|
284 |
-
*
|
285 |
* 5.0.12 - 2016-01-04 - Low priority
|
286 |
* Tested with WP 4.4
|
287 |
-
*
|
288 |
* 5.0.11 - 2015-10-14 - Low priority
|
289 |
* Translation string changes
|
290 |
-
*
|
291 |
* 5.0.10 - 2015-10-12 - Low priority
|
292 |
-
* Updates to the extension page
|
293 |
-
*
|
294 |
* 5.0.9
|
295 |
* New hook: wplc_hook_admin_menu_layout - Target the area above the normal menu layout
|
296 |
* Style bug fix with the "DATA" section of the live chat dashboard
|
297 |
-
*
|
298 |
* 5.0.8
|
299 |
* Introduced new hooks:
|
300 |
* wplc_hook_admin_visitor_info_display_before - Allows you to add HTML at the beginning of the vistior details DIV in the live chat window
|
301 |
* wplc_hook_admin_visitor_info_display_after - Allows you to add HTML at the end of the vistior details DIV in the live chat window
|
302 |
* wplc_hook_admin_javascript_chat - Allows you to add Javascript enqueues at the end of the javascript section of the live chat window
|
303 |
* wplc_hook_admin_settings_main_settings_after - Allows you to add more options to the main chat settings table in the settings page, after the first main table
|
304 |
-
* wplc_hook_admin_settings_save - Hook into the save settings head section. i.e. where we handle POST data from the live chat settings page
|
305 |
-
*
|
306 |
* 5.0.7 - 2015-10-06 - Low priority
|
307 |
* Added a live chat extension page
|
308 |
* Corrected internationalization
|
309 |
-
*
|
310 |
* 5.0.6 - 2015-09-17 - Low priority
|
311 |
* You can now choose to disable the sound that is played when a new live chat message is received
|
312 |
* Fixed a bug that caused some live chat settings to revert back to default when updating the plugin
|
313 |
-
*
|
314 |
* 5.0.5 - 2015-09-09 - Low Priority
|
315 |
* Fixed a bug that displayed an error message to update the live chat plugin while using the latest version (Pro)
|
316 |
* Fixed a bug where the mobile detect class would only work if the Pro was enabled
|
@@ -318,24 +330,24 @@
|
|
318 |
* You can now see the visitors IP address on the Live Chat dashboard
|
319 |
* Alert message removed when a user was made a live chat agent on the settings page (Pro)
|
320 |
* Fixed a bug that would prevent the user from typing if they had a previous live chat session (Pro)
|
321 |
-
*
|
322 |
* 5.0.4 - 2015-08-06 - Medium priority
|
323 |
* WP Live Chat Support is now compatible with all caching plugins
|
324 |
* Fixed a bug that set the wrong permissions for the default agent
|
325 |
* Fixed the bug that shows the status of undefined if the user minimized the chat
|
326 |
-
*
|
327 |
-
*
|
328 |
* 5.0.3 - 2015-08-05 - High Priority
|
329 |
* Small bug fix
|
330 |
-
*
|
331 |
* 5.0.2 - 2015-08-05 - High Priority
|
332 |
* Fixed a bug that caused a fatal error
|
333 |
-
*
|
334 |
* 5.0.1 - 2015-08-05 - Medium Priority
|
335 |
* Refactored the code so that the live chat box will show up even if there is a JS error from another plugin or theme
|
336 |
* Live chat box styling fixes: top image padding; centered the "conneting, please be patient" message and added padding
|
337 |
* The live chat long poll connection will not automatically reinitialize if the connection times out or returns a 5xx error
|
338 |
-
*
|
339 |
* 5.0.0 - 2015-07-29 - Doppio update - Medium Priority
|
340 |
* New, modern chat dashboard
|
341 |
* Better user handling (chat long polling)
|
@@ -344,202 +356,202 @@
|
|
344 |
* You are now able to see who is a new visitor and who is a returning visitor
|
345 |
* Bug fixes in the javascript that handles the live chat controls
|
346 |
* Fixed the bug that stopped the chats from timing out after a certain amount of time
|
347 |
-
*
|
348 |
* 4.4.4 - 2015-07-20 - Low Priority
|
349 |
* Bug Fix: Big fixed that would cause the live chat to timeout during a conversation
|
350 |
-
*
|
351 |
* 4.4.3 - 2015-07-16 - Low Priority
|
352 |
* Bug Fix: Ajax URL undefined in some versions of WordPress
|
353 |
* Improvement: Warning messages limited to the Settings page only
|
354 |
-
*
|
355 |
* 4.4.2 - 2015-07-13 - Low Priority
|
356 |
* Improvement: Gravatar images will load on sites using SSL without any issues
|
357 |
* Improvement: Hungarian live chat translation file name fixed
|
358 |
* Improvement: Styling improvements on the live chat dashboard
|
359 |
* New Translations:
|
360 |
* Turkish (Thank you Yavuz Aksu)
|
361 |
-
*
|
362 |
* 4.4.1 - 2015-07-08 - Critical Priority
|
363 |
* Major security update. Please ensure you update to this version to eliminate previous vulnerabilities.
|
364 |
-
*
|
365 |
* 4.3.5 Espresso - 2015-07-03 - Low Priority
|
366 |
* Enhancement: Provision made for live chat encryption in the Pro version (compatibility)
|
367 |
* Updated Translations:
|
368 |
* Hungarian (Thank you Andor Molnar)
|
369 |
-
*
|
370 |
* 4.3.4 Ristretto - 2015-06-26 - Low Priority
|
371 |
* Improvement: 404 errors for images in admin panel fixed
|
372 |
* Translation Fix: Mistakes fixed in German Translation file.
|
373 |
-
*
|
374 |
* 4.3.3 2015-06-11 - Low Priority
|
375 |
* Security enhancements
|
376 |
* New Translations:
|
377 |
* Polish (Thank you Sebastian Kajzer)
|
378 |
-
*
|
379 |
* 4.3.2 2015-05-28 - Medium Priority
|
380 |
* Bug Fix: Fixed PHP error
|
381 |
-
*
|
382 |
* 4.3.1 2015-05-22 - Low Priority
|
383 |
* New Translations:
|
384 |
* Finnish (Thank you Arttu Piipponen)
|
385 |
-
*
|
386 |
* Translations Updated:
|
387 |
* French (Thank you Marcello Cavalucci)
|
388 |
-
* Dutch (Thank you Niek Groot Bleumink)
|
389 |
-
*
|
390 |
* Bug Fix: Exclude Functionality (Pro)
|
391 |
-
*
|
392 |
* 4.3.0 2015-04-13 - Low Priority
|
393 |
* Enhancement: Animations settings have been moved to the 'Styling' tab.
|
394 |
* New Feature: Blocked User functionality has been moved to the Free version
|
395 |
* Enhancement: All descriptions have been put into tooltips for a cleaner page
|
396 |
* New Feature: Functionality added in to handle Chat Experience Ratings (Premium Add-on)
|
397 |
-
*
|
398 |
* 4.2.12 2015-03-24 - Low Priority
|
399 |
-
* Bug Fix: Warning to update showing erroneously
|
400 |
-
*
|
401 |
* 4.2.11 2015-03-23 - Low Priority
|
402 |
* Bug Fix: Bug in the banned user functionality
|
403 |
* Enhancement: Stying improvement on the Live Chat dashboard
|
404 |
* Enhancement: Strings are handled better for localization plugins (Pro)
|
405 |
* Updated Translation Files:
|
406 |
* Spanish (Thank you Ana Ayelen Martinez)
|
407 |
-
*
|
408 |
* 4.2.10 2015-03-16 - Low Priority
|
409 |
* Bug Fix: Mobile Detect class caused Fatal error on some websites
|
410 |
* Bug Fix: PHP Errors when editing user page
|
411 |
* Bug Fix: Including and Excluding the chat window caused issues on some websites
|
412 |
* Bug Fix: Online/Offline Toggle Switch did not work in some browsers (Pro)
|
413 |
* New Feature: You can now Ban visitors from chatting with you based on IP Address (Pro)
|
414 |
-
* New Feature: You can now choose if you want users to make themselves an agent (Pro)
|
415 |
-
* Bug Fix: Chat window would not hide when selecting the option to not accept offline messages (Pro)
|
416 |
-
* Enhancement: Support page added
|
417 |
* Updated Translations:
|
418 |
* French (Thank you Marcello Cavallucci)
|
419 |
* New Translations added:
|
420 |
* Norwegian (Thank you Robert Nilsen)
|
421 |
* Hungarian (Thank you GInception)
|
422 |
* Indonesian (Thank you Andrie Willyanta)
|
423 |
-
*
|
424 |
* 4.2.9 2015-02-18 - Low Priority
|
425 |
* New Feature: You can now choose to record your visitors IP address or not
|
426 |
* New Feature: You can now send an offline message to more than one email address (Pro)
|
427 |
-
* New Feature: You can now specify if you want to be online or not (Pro)
|
428 |
-
*
|
429 |
* 4.2.8 2015-02-12 - Low Priority
|
430 |
* New Feature: You can now apply an animation to the chat window on page load
|
431 |
* New Feature: You can now choose from 5 colour schemes for the chat window
|
432 |
* Enhancement: Aesthetic Improvement to list of agents (Pro)
|
433 |
* Code Improvement: PHP error fixed
|
434 |
* Updated Translations:
|
435 |
-
* German (Thank you Dennis Klinger)
|
436 |
-
*
|
437 |
* 4.2.7 2015-02-10 - Low Priority
|
438 |
* New Live Chat Translation added:
|
439 |
* Greek (Thank you Peter Stavropoulos)
|
440 |
-
*
|
441 |
* 4.2.6 2015-01-29 - Low Priority
|
442 |
* New feature: Live Chat dashboard has a new layout and design
|
443 |
* Code Improvement: jQuery Cookie updated to the latest version
|
444 |
-
* Code Improvement: More Live Chat strings are now translatable
|
445 |
* New Live Chat Translation added:
|
446 |
* Spanish (Thank you Ana Ayel�n Mart�nez)
|
447 |
-
*
|
448 |
-
*
|
449 |
* 4.2.5 2015-01-21 - Low Priority
|
450 |
* New Feature: You can now view any live chats you have missed
|
451 |
* New Pro Feature: You can record offline messages when live chat is not online
|
452 |
* Code Improvements: Labels added to buttons
|
453 |
* Code Improvements: PHP Errors fixed
|
454 |
-
*
|
455 |
* Updated Translations:
|
456 |
* Italian (Thank You Angelo Giammarresi)
|
457 |
-
*
|
458 |
* 4.2.4 2014-12-17 - Low Priority
|
459 |
* New feature: The chat window can be hidden when offline (Pro only)
|
460 |
* New feature: Desktop notifications added
|
461 |
* Bug fix: Email address gave false validation error when not required.
|
462 |
-
*
|
463 |
* Translations Added:
|
464 |
* Dutch (Thank you Elsy Aelvoet)
|
465 |
-
*
|
466 |
-
*
|
467 |
* 4.2.3 2014-12-11 - Low Priority
|
468 |
* Updated Translations:
|
469 |
* French (Thank you Marcello Cavallucci)
|
470 |
* Italian (Thank You Angelo Giammarresi)
|
471 |
-
*
|
472 |
* 4.2.2 2014-12-10 - Low Priority
|
473 |
* New feature: You can now toggle between displaying or hiding the users name in your Live Chat messages
|
474 |
* New feature: You can now choose to display the Live Chat window to all or only registered users
|
475 |
* New feature: A user image will now display in the Live Chat message
|
476 |
* Code Improvement: jQuery UI CSS is loaded from a local source
|
477 |
* Bug Fix: Only Admin users can make users Live Chat agents
|
478 |
-
*
|
479 |
* Translations added:
|
480 |
* Mongolian (Thank you Monica Batuskh)
|
481 |
* Romanian (Thank you Sergiu Balaes)
|
482 |
* Czech (Thank you Pavel Cvejn)
|
483 |
* Danish (Thank you Mikkel Jeppesen Juhl)
|
484 |
-
*
|
485 |
* Updated Translations:
|
486 |
* German (Thank you Dennis Klinger)
|
487 |
-
*
|
488 |
* 4.2.1 2014-11-24 - High Priority
|
489 |
* Bug Fix: PHP Error on agent side in chat window
|
490 |
-
*
|
491 |
-
*
|
492 |
* 4.2.0 2014-11-20 - Medium priority
|
493 |
* Chat UI Improvements
|
494 |
* Small bug fixes
|
495 |
-
*
|
496 |
* 4.1.10 2014-10-29 - Low priority
|
497 |
* Code Improvements: (Checks for DONOTCACHE)
|
498 |
* New Pro Feature: You can now include or exclude the chat window on certain pages
|
499 |
-
*
|
500 |
* 4.1.9 2014-10-10 - Low priority
|
501 |
-
* Bug fix: Mobile Detect class caused an error if it existed in another plugin or theme. A check has been put in place.
|
502 |
-
*
|
503 |
* 4.1.8 2014-10-08 - Low priority
|
504 |
* New feature: There is now an option if you do not require the user to input their name and email address before sending a chat request
|
505 |
* New feature: Logged in users do not have to enter their details prior to sending the chat request.
|
506 |
* New feature: Turn the chat on/off on a mobile device (smart phone and tablets)
|
507 |
-
*
|
508 |
* 4.1.7 2014-10-06 - Low priority
|
509 |
* Bug fix: sound was not played when user received a message from the admin
|
510 |
* Internationalization update
|
511 |
* New WP Live Chat Support Translation added:
|
512 |
* * Swedish (Thank You Tobias Sernhede)
|
513 |
* * French (Thank You Marcello Cavallucci)
|
514 |
-
*
|
515 |
-
*
|
516 |
* 4.1.6
|
517 |
* Code improvements (JavaScript errors fixed in IE)
|
518 |
* New WP Live Chat Support Translations Added:
|
519 |
* * Slovakian (Thank You Dana Kadarova)
|
520 |
* * German (Thank You Dennis Klingr)
|
521 |
* * Hebrew (Thank You David Cohen)
|
522 |
-
*
|
523 |
* 4.1.5
|
524 |
* Code improvements (PHP warnings - set_time_limit caused warnings on some hosts)
|
525 |
-
*
|
526 |
* 4.1.4
|
527 |
* Significant performance improvements
|
528 |
* Brazilian translation added - thank you Gustavo Silva
|
529 |
-
*
|
530 |
* 4.1.3
|
531 |
* Code improvements (PHP warnings)
|
532 |
-
*
|
533 |
* 4.1.2
|
534 |
* DB bug fix
|
535 |
-
*
|
536 |
* 4.1.1
|
537 |
* Significant performance improvements
|
538 |
* Live chat window will now only show in one window (if user has multiple tabs open on your site)
|
539 |
* You can now see the browser of the live chat user
|
540 |
* Improved the UI of the backend
|
541 |
* Bug fixes
|
542 |
-
*
|
543 |
* 4.1.0
|
544 |
* New feature: You can now show the chat box on the left or right
|
545 |
* Vulnerability fix (JS injections). Thank you Patrik @ www.it-securityguard.com
|
@@ -548,7 +560,7 @@
|
|
548 |
* Fixed IE8 bug
|
549 |
* Added option to auto pop up chat window
|
550 |
* Added Italian language files. Thanks to Davide
|
551 |
-
*
|
552 |
*/
|
553 |
|
554 |
//error_reporting(E_ERROR);
|
@@ -571,17 +583,17 @@ global $debug_start;
|
|
571 |
$wplc_tblname_offline_msgs = $wpdb->prefix . "wplc_offline_messages";
|
572 |
$wplc_tblname_chats = $wpdb->prefix . "wplc_chat_sessions";
|
573 |
$wplc_tblname_msgs = $wpdb->prefix . "wplc_chat_msgs";
|
574 |
-
$wplc_version = "
|
575 |
|
576 |
define('WPLC_BASIC_PLUGIN_DIR', dirname(__FILE__));
|
577 |
-
define('WPLC_BASIC_PLUGIN_URL', plugins_url(
|
578 |
global $wplc_basic_plugin_url;
|
579 |
-
$wplc_basic_plugin_url =
|
580 |
|
581 |
|
582 |
global $wplc_pro_version;
|
583 |
$wplc_ver = str_replace('.', '', $wplc_pro_version);
|
584 |
-
$checker = intval($wplc_ver);
|
585 |
if (function_exists("wplc_pro_version_control") && $checker < 6000) { } else {
|
586 |
require_once (plugin_dir_path(__FILE__) . "ajax_new.php");
|
587 |
}
|
@@ -599,6 +611,10 @@ require_once (plugin_dir_path(__FILE__) . "modules/beta_features.php");
|
|
599 |
require_once (plugin_dir_path(__FILE__) . "modules/node_server.php");
|
600 |
require_once (plugin_dir_path(__FILE__) . "modules/module_subscribe.php");
|
601 |
require_once (plugin_dir_path(__FILE__) . 'includes/update_control.class.php');
|
|
|
|
|
|
|
|
|
602 |
|
603 |
add_action( 'wp_ajax_wplc_admin_set_transient', 'wplc_action_callback' );
|
604 |
add_action( 'wp_ajax_wplc_admin_remove_transient', 'wplc_action_callback' );
|
@@ -606,6 +622,7 @@ add_action( 'wp_ajax_wplc_hide_ftt', 'wplc_action_callback' );
|
|
606 |
add_action( 'wp_ajax_nopriv_wplc_user_send_offline_message', 'wplc_action_callback' );
|
607 |
add_action( 'wp_ajax_wplc_user_send_offline_message', 'wplc_action_callback' );
|
608 |
add_action( 'wp_ajax_delete_offline_message', 'wplc_action_callback' );
|
|
|
609 |
add_action( 'init', 'wplc_version_control' );
|
610 |
add_action( "activated_plugin", "wplc_redirect_on_activate" );
|
611 |
add_action( 'wp_footer', 'wplc_display_box' );
|
@@ -637,8 +654,8 @@ function wplc_basic_check() {
|
|
637 |
|
638 |
function wplc_init() {
|
639 |
$plugin_dir = basename(dirname(__FILE__)) . "/languages/";
|
640 |
-
load_plugin_textdomain('wplivechat', false, $plugin_dir);
|
641 |
-
|
642 |
|
643 |
}
|
644 |
|
@@ -650,8 +667,8 @@ function wplc_init() {
|
|
650 |
*/
|
651 |
function wplc_redirect_on_activate( $plugin ) {
|
652 |
if( $plugin == plugin_basename( __FILE__ ) ) {
|
653 |
-
if (get_option("
|
654 |
-
update_option("
|
655 |
// clean the output header and redirect the user
|
656 |
@ob_flush();
|
657 |
@ob_end_flush();
|
@@ -661,6 +678,8 @@ function wplc_redirect_on_activate( $plugin ) {
|
|
661 |
}
|
662 |
}
|
663 |
|
|
|
|
|
664 |
function wplc_version_control() {
|
665 |
|
666 |
global $wplc_version;
|
@@ -669,9 +688,26 @@ function wplc_version_control() {
|
|
669 |
$current_version = get_option("wplc_current_version");
|
670 |
if (!isset($current_version) || $current_version != $wplc_version) {
|
671 |
|
672 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
673 |
$admins = get_role('administrator');
|
674 |
-
if( $admins !== null ) {
|
675 |
$admins->add_cap('wplc_ma_agent');
|
676 |
}
|
677 |
|
@@ -713,8 +749,7 @@ function wplc_version_control() {
|
|
713 |
}
|
714 |
}
|
715 |
}
|
716 |
-
|
717 |
-
$wplc_settings = get_option("WPLC_SETTINGS");
|
718 |
|
719 |
|
720 |
if (!isset($wplc_settings['wplc_pro_na'])) { $wplc_settings["wplc_pro_na"] = __("Chat offline. Leave a message", "wplivechat"); }
|
@@ -740,12 +775,12 @@ function wplc_version_control() {
|
|
740 |
|
741 |
if (!isset($wplc_settings['wplc_powered_by_link'])) { $wplc_settings["wplc_powered_by_link"] = "0"; }
|
742 |
|
743 |
-
|
744 |
|
745 |
/* users who are updating will stay on the existing theme */
|
746 |
-
if (get_option("
|
747 |
if (!isset($wplc_settings['wplc_newtheme'])) { $wplc_settings["wplc_newtheme"] = "theme-2"; }
|
748 |
-
}
|
749 |
|
750 |
|
751 |
if (!isset($wplc_settings['wplc_settings_color1'])) { $wplc_settings["wplc_settings_color1"] = "ED832F"; }
|
@@ -765,14 +800,14 @@ function wplc_version_control() {
|
|
765 |
wplc_handle_db();
|
766 |
update_option("wplc_current_version", $wplc_version);
|
767 |
|
768 |
-
|
769 |
if (!isset($wplc_settings['wplc_require_user_info'])) { $wplc_settings['wplc_require_user_info'] = "1"; }
|
770 |
if (!isset($wplc_settings['wplc_user_default_visitor_name'])) {
|
771 |
$wplc_default_visitor_name = __( "Guest", "wplivechat" );
|
772 |
$wplc_settings['wplc_user_default_visitor_name'] = $wplc_default_visitor_name;
|
773 |
}
|
774 |
if (!isset($wplc_settings['wplc_loggedin_user_info'])) { $wplc_settings['wplc_loggedin_user_info'] = "1"; }
|
775 |
-
if (!isset($wplc_settings['wplc_user_alternative_text'])) {
|
776 |
$wplc_alt_text = __("Please click \'Start Chat\' to initiate a chat with an agent", "wplivechat");
|
777 |
$wplc_settings['wplc_user_alternative_text'] = $wplc_alt_text;
|
778 |
}
|
@@ -782,7 +817,7 @@ function wplc_version_control() {
|
|
782 |
if(!isset($wplc_settings['wplc_enable_font_awesome'])){ $wplc_settings['wplc_enable_font_awesome'] = "1"; }
|
783 |
if(!isset($wplc_settings['wplc_using_localization_plugin'])){ $wplc_settings['wplc_using_localization_plugin'] = 0; }
|
784 |
|
785 |
-
|
786 |
update_option("WPLC_SETTINGS", $wplc_settings);
|
787 |
|
788 |
do_action("wplc_update_hook");
|
@@ -797,13 +832,7 @@ function wplc_hook_control_set_transient() {
|
|
797 |
$should_set_transient = apply_filters("wplc_filter_control_set_transient",true);
|
798 |
if ($should_set_transient) {
|
799 |
set_transient("wplc_is_admin_logged_in", "1", 70);
|
800 |
-
|
801 |
-
|
802 |
}
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
}
|
808 |
|
809 |
add_action("wplc_hook_remove_transient","wplc_hook_control_remove_transient",10);
|
@@ -818,6 +847,11 @@ function wplc_action_callback() {
|
|
818 |
|
819 |
if ($check == 1) {
|
820 |
|
|
|
|
|
|
|
|
|
|
|
821 |
if( $_POST['action'] == 'delete_offline_message' ){
|
822 |
|
823 |
global $wplc_tblname_offline_msgs;
|
@@ -849,11 +883,11 @@ function wplc_action_callback() {
|
|
849 |
}
|
850 |
if ($_POST['action'] == "wplc_admin_set_transient") {
|
851 |
do_action("wplc_hook_set_transient");
|
852 |
-
|
853 |
}
|
854 |
if ($_POST['action'] == "wplc_admin_remove_transient") {
|
855 |
do_action("wplc_hook_remove_transient");
|
856 |
-
|
857 |
}
|
858 |
if ($_POST['action'] == 'wplc_hide_ftt') {
|
859 |
update_option("WPLC_FIRST_TIME_TUTORIAL",true);
|
@@ -890,7 +924,7 @@ function wplc_filter_control_menu_control() {
|
|
890 |
function wplc_admin_menu() {
|
891 |
|
892 |
$cap = apply_filters("wplc_ma_filter_menu_control",array());
|
893 |
-
if (get_option("wplc_seen_surveys")) { $survey_new = ""; } else { $survey_new = ' <span class="update-plugins"><span class="plugin-count">New</span></span>'; }
|
894 |
|
895 |
$wplc_current_user = get_current_user_id();
|
896 |
|
@@ -917,7 +951,7 @@ function wplc_admin_menu() {
|
|
917 |
|
918 |
add_submenu_page('wplivechat-menu', __('History', 'wplivechat'), __('History', 'wplivechat'), $cap[2], 'wplivechat-menu-history', 'wplc_admin_history_layout');
|
919 |
add_submenu_page('wplivechat-menu', __('Missed Chats', 'wplivechat'), __('Missed Chats', 'wplivechat'), $cap[3], 'wplivechat-menu-missed-chats', 'wplc_admin_missed_chats');
|
920 |
-
|
921 |
/* TO DO
|
922 |
Add a hook here so that the other plugins can add to the menu
|
923 |
Also make sure the function below is controled differently as the pro will not longer exist
|
@@ -958,7 +992,7 @@ function wplc_hook_control_menu() {
|
|
958 |
function wplc_api_keys_menu() {
|
959 |
$page_content = "<h1>".__("Premium Extension API Keys","wplivechat")."</h3>";
|
960 |
$page_content .= "<p>".__("To find and manage your premium API keys, please visit your <a target='_BLANK' href='https://wp-livechat.com/my-account/'>my account</a> page.","")."</p>";
|
961 |
-
|
962 |
$page_content .= "<hr />";
|
963 |
$page_content = apply_filters("wplc_filter_api_page",$page_content);
|
964 |
|
@@ -990,7 +1024,7 @@ function wplc_load_user_js () {
|
|
990 |
}
|
991 |
$display_contents = apply_filters("wplc_filter_display_contents",$display_contents);
|
992 |
|
993 |
-
if($display_contents && $user_banned == 0){
|
994 |
|
995 |
/* do not show if pro is outdated */
|
996 |
global $wplc_pro_version;
|
@@ -1012,12 +1046,12 @@ function wplc_load_user_js () {
|
|
1012 |
return;
|
1013 |
}
|
1014 |
|
1015 |
-
if (function_exists("wplc_register_pro_version")) {
|
1016 |
if (function_exists('wplc_basic_hide_chat_when_offline')) {
|
1017 |
$wplc_hide_chat = wplc_basic_hide_chat_when_offline();
|
1018 |
if (!$wplc_hide_chat) {
|
1019 |
if (function_exists("wplc_push_js_to_front_pro")) {
|
1020 |
-
wplc_push_js_to_front_pro();
|
1021 |
}
|
1022 |
}
|
1023 |
} else {
|
@@ -1033,7 +1067,7 @@ function wplc_load_user_js () {
|
|
1033 |
|
1034 |
|
1035 |
|
1036 |
-
|
1037 |
|
1038 |
}
|
1039 |
|
@@ -1052,14 +1086,14 @@ function wplc_push_js_to_front_basic() {
|
|
1052 |
return;
|
1053 |
}
|
1054 |
}
|
1055 |
-
|
1056 |
/* is the chat enabled? */
|
1057 |
if ($wplc_settings["wplc_settings_enabled"] == 2) { return; }
|
1058 |
|
1059 |
wp_register_script('wplc-md5', plugins_url('/js/md5.js', __FILE__),array('wplc-user-script'),$wplc_version);
|
1060 |
wp_enqueue_script('wplc-md5');
|
1061 |
if (isset($wplc_settings['wplc_display_name']) && $wplc_settings['wplc_display_name'] == 1) {
|
1062 |
-
$wplc_display = 'display';
|
1063 |
} else {
|
1064 |
$wplc_display = 'hide';
|
1065 |
}
|
@@ -1072,14 +1106,19 @@ function wplc_push_js_to_front_basic() {
|
|
1072 |
$ajaxurl = admin_url('admin-ajax.php');
|
1073 |
$wplc_ajaxurl = $ajaxurl;
|
1074 |
}
|
1075 |
-
|
1076 |
|
1077 |
wp_register_script('wplc-server-script', plugins_url('/js/wplc_server.js', __FILE__), array('jquery'), $wplc_version);
|
1078 |
wp_enqueue_script('wplc-server-script');
|
1079 |
|
|
|
|
|
|
|
|
|
|
|
1080 |
if(isset($wplc_settings['wplc_use_node_server']) && $wplc_settings['wplc_use_node_server'] == 1){
|
1081 |
wp_localize_script('wplc-server-script', 'wplc_use_node_server', "true");
|
1082 |
-
|
1083 |
$wplc_node_token = get_option("wplc_node_server_secret_token");
|
1084 |
if(!$wplc_node_token){
|
1085 |
if(function_exists("wplc_node_server_token_regenerate")){
|
@@ -1087,14 +1126,70 @@ function wplc_push_js_to_front_basic() {
|
|
1087 |
$wplc_node_token = get_option("wplc_node_server_secret_token");
|
1088 |
}
|
1089 |
}
|
1090 |
-
wp_localize_script('wplc-server-script', '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1091 |
|
|
|
|
|
|
|
1092 |
}
|
1093 |
|
1094 |
|
1095 |
|
1096 |
-
|
1097 |
wp_register_script('wplc-user-script', plugins_url('/js/wplc_u.js', __FILE__),array('jquery', 'wplc-server-script'),$wplc_version);
|
|
|
|
|
1098 |
/**
|
1099 |
* No longer in use as of 6.2.11 as using the minified file causes issues on sites that are minified.
|
1100 |
* @deprecated 6.2.11
|
@@ -1102,6 +1197,7 @@ function wplc_push_js_to_front_basic() {
|
|
1102 |
// wp_register_script('wplc-user-script', plugins_url('/js/wplc_u.min.js', __FILE__),array('jquery'),$wplc_version);
|
1103 |
|
1104 |
wp_enqueue_script('wplc-user-script');
|
|
|
1105 |
|
1106 |
if (isset($wplc_settings['wplc_newtheme'])) { $wplc_newtheme = $wplc_settings['wplc_newtheme']; } else { }
|
1107 |
if (isset($wplc_newtheme)) {
|
@@ -1117,7 +1213,7 @@ function wplc_push_js_to_front_basic() {
|
|
1117 |
}
|
1118 |
} else {
|
1119 |
wp_register_script('wplc-theme-classic', plugins_url('/js/themes/classic.js', __FILE__),array('wplc-user-script'),$wplc_version);
|
1120 |
-
wp_enqueue_script('wplc-theme-classic');
|
1121 |
}
|
1122 |
|
1123 |
|
@@ -1131,54 +1227,61 @@ function wplc_push_js_to_front_basic() {
|
|
1131 |
wp_localize_script('wplc-admin-chat-js', 'wplc_ajaxurl', $wplc_ajax_url);
|
1132 |
wp_localize_script('wplc-ma-js', 'wplc_home_ajaxurl', $home_ajax_url);
|
1133 |
|
|
|
1134 |
if(class_exists("WP_REST_Request")) {
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
|
|
|
|
1140 |
}
|
1141 |
|
1142 |
-
|
1143 |
if (isset($wplc_ga_enabled['wplc_enable_ga']) && $wplc_ga_enabled['wplc_enable_ga'] == '1') {
|
1144 |
-
wp_localize_script('wplc-user-script', 'wplc_enable_ga', '1');
|
1145 |
}
|
1146 |
|
|
|
|
|
|
|
|
|
1147 |
|
1148 |
$wplc_detect_device = new Mobile_Detect;
|
1149 |
$wplc_is_mobile = $wplc_detect_device->isMobile() ? 'true' : 'false';
|
1150 |
wp_localize_script('wplc-user-script', 'wplc_is_mobile', $wplc_is_mobile);
|
1151 |
|
1152 |
-
|
1153 |
wp_localize_script('wplc-user-script', 'wplc_ajaxurl', $wplc_ajax_url);
|
1154 |
wp_localize_script('wplc-user-script', 'wplc_ajaxurl_site', admin_url('admin-ajax.php'));
|
1155 |
wp_localize_script('wplc-user-script', 'wplc_nonce', $ajax_nonce);
|
1156 |
wp_localize_script('wplc-user-script', 'wplc_plugin_url', plugins_url());
|
1157 |
-
|
1158 |
$wplc_display = false;
|
1159 |
|
1160 |
$wplc_images = apply_filters( 'wplc_get_images_to_preload', array(), $wplc_acbc_data );
|
1161 |
wp_localize_script( 'wplc-user-script', 'wplc_preload_images', $wplc_images );
|
1162 |
|
1163 |
-
|
1164 |
-
|
1165 |
|
1166 |
if( isset($wplc_settings['wplc_show_name']) && $wplc_settings['wplc_show_name'] == '1' ){ $wplc_show_name = true; } else { $wplc_show_name = false; }
|
1167 |
if( isset($wplc_settings['wplc_show_avatar']) && $wplc_settings['wplc_show_avatar'] ){ $wplc_show_avatar = true; } else { $wplc_show_avatar = false; }
|
1168 |
if( isset($wplc_settings['wplc_show_date']) && $wplc_settings['wplc_show_date'] == '1' ){ $wplc_show_date = true; } else { $wplc_show_date = false; }
|
1169 |
if( isset($wplc_settings['wplc_show_time']) && $wplc_settings['wplc_show_time'] == '1' ){ $wplc_show_time = true; } else { $wplc_show_time = false; }
|
1170 |
-
|
1171 |
$wplc_chat_detail = array( 'name' => $wplc_show_name, 'avatar' => $wplc_show_avatar, 'date' => $wplc_show_date, 'time' => $wplc_show_time );
|
1172 |
-
|
1173 |
|
1174 |
|
1175 |
-
|
|
|
1176 |
wp_localize_script('wplc-user-script', 'wplc_display_name', $wplc_display);
|
1177 |
} else {
|
1178 |
wp_localize_script( 'wplc-user-script', 'wplc_show_chat_detail', $wplc_chat_detail );
|
1179 |
}
|
1180 |
|
1181 |
-
/**
|
1182 |
* Create a JS object for all Agent ID's and Gravatar MD5's
|
1183 |
*/
|
1184 |
$user_array = get_users(array(
|
@@ -1193,16 +1296,17 @@ function wplc_push_js_to_front_basic() {
|
|
1193 |
$a_array[$user->ID]['md5'] = md5( $user->user_email );
|
1194 |
}
|
1195 |
}
|
1196 |
-
wp_localize_script('wplc-user-script', 'wplc_agent_data', $a_array);
|
1197 |
|
1198 |
-
$wplc_error_messages = array(
|
1199 |
-
'valid_name' => __( "Please enter your name", "wplivechat" ),
|
1200 |
-
'valid_email' => __( "Please enter your email address", "wplivechat" ),
|
1201 |
-
'server_connection_lost' => __("Connection to server lost. Please reload this page. Error: ", "wplivechat"),
|
1202 |
-
'chat_ended_by_operator' => ( empty( $wplc_settings['wplc_text_chat_ended'] ) ) ? __("The chat has been ended by the operator.", "wplivechat") : esc_attr( $wplc_settings['wplc_text_chat_ended'] ) ,
|
1203 |
-
'empty_message' => __( "Please enter a message", "wplivechat" ),
|
1204 |
|
1205 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1206 |
|
1207 |
$wplc_error_messages = apply_filters( "wplc_user_error_messages_filter", $wplc_error_messages );
|
1208 |
|
@@ -1216,42 +1320,47 @@ function wplc_push_js_to_front_basic() {
|
|
1216 |
if (!isset($wplc_settings['wplc_pro_offline2'])) { $wplc_settings["wplc_pro_offline2"] = __("Sending message...", "wplivechat"); }
|
1217 |
if (!isset($wplc_settings['wplc_pro_offline3'])) { $wplc_settings["wplc_pro_offline3"] = __("Thank you for your message. We will be in contact soon.", "wplivechat"); }
|
1218 |
|
1219 |
-
|
1220 |
-
wp_localize_script('wplc-user-script', 'wplc_offline_msg', stripslashes($wplc_settings['wplc_pro_offline2']));
|
1221 |
-
wp_localize_script('wplc-user-script', 'wplc_offline_msg3',stripslashes($wplc_settings['wplc_pro_offline3']));
|
1222 |
-
wp_localize_script('wplc-user-script', 'wplc_welcome_msg',stripslashes($wplc_settings['wplc_welcome_msg']));
|
1223 |
|
1224 |
-
|
|
|
|
|
|
|
|
|
|
|
1225 |
|
1226 |
if( isset( $wplc_acbc_data['wplc_use_wp_name'] ) && $wplc_acbc_data['wplc_use_wp_name'] == '1' ){
|
1227 |
if( isset( $_COOKIE['wplc_cid'] ) ){
|
1228 |
$chat_data = wplc_get_chat_data( $_COOKIE['wplc_cid'] );
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
|
|
|
|
|
|
|
|
1235 |
} else {
|
1236 |
$agent = 'agent';
|
1237 |
}
|
1238 |
-
|
1239 |
} else {
|
1240 |
if (!empty($wplc_acbc_data['wplc_chat_name'])) {
|
1241 |
$agent = $wplc_acbc_data['wplc_chat_name'];
|
1242 |
} else {
|
1243 |
$agent = 'agent';
|
1244 |
}
|
1245 |
-
}
|
1246 |
wp_localize_script('wplc-user-script', 'wplc_localized_string_is_typing', $agent . __(" is typing...","wplivechat"));
|
1247 |
wp_localize_script('wplc-user-script', 'wplc_localized_string_is_typing_single', __(" is typing...","wplivechat"));
|
1248 |
-
|
1249 |
|
1250 |
if( isset( $wplc_settings['wplc_elem_trigger_id'] ) && trim( $wplc_settings['wplc_elem_trigger_id'] ) !== "" ) {
|
1251 |
-
if( isset( $wplc_settings['wplc_elem_trigger_action'] ) ){
|
1252 |
wp_localize_script( 'wplc-user-script', 'wplc_elem_trigger_action', stripslashes( $wplc_settings['wplc_elem_trigger_action'] ) );
|
1253 |
}
|
1254 |
-
if( isset( $wplc_settings['wplc_elem_trigger_type'] ) ){
|
1255 |
wp_localize_script( 'wplc-user-script', 'wplc_elem_trigger_type', stripslashes( $wplc_settings['wplc_elem_trigger_type'] ) );
|
1256 |
}
|
1257 |
wp_localize_script( 'wplc-user-script', 'wplc_elem_trigger_id', stripslashes( $wplc_settings['wplc_elem_trigger_id'] ) );
|
@@ -1266,11 +1375,11 @@ function wplc_push_js_to_front_basic() {
|
|
1266 |
|
1267 |
if ($wplc_user_gravatar != "") { $wplc_grav_image = "<img src='//www.gravatar.com/avatar/$wplc_user_gravatar?s=30' class='wplc-user-message-avatar' />";} else { $wplc_grav_image = "";}
|
1268 |
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
1274 |
|
1275 |
$wplc_hide_chat = "";
|
1276 |
if (get_option('WPLC_HIDE_CHAT') == TRUE) { $wplc_hide_chat = "yes"; } else { $wplc_hide_chat = null; }
|
@@ -1286,7 +1395,7 @@ function wplc_push_js_to_front_basic() {
|
|
1286 |
do_action("wplc_hook_push_js_to_front");
|
1287 |
|
1288 |
}
|
1289 |
-
if (function_exists('wplc_pro_user_top_js')) {
|
1290 |
add_action('wp_head', 'wplc_pro_user_top_js');
|
1291 |
|
1292 |
} else {
|
@@ -1298,7 +1407,7 @@ if (function_exists('wplc_pro_user_top_js')) {
|
|
1298 |
|
1299 |
/**
|
1300 |
* Add to the array to determine which images need to be preloaded via JS on the front end.
|
1301 |
-
*
|
1302 |
* @param array $images Array of images to be preloaded
|
1303 |
* @return array
|
1304 |
*/
|
@@ -1419,20 +1528,20 @@ function wplc_hook_control_banned_users() {
|
|
1419 |
*/
|
1420 |
function wplc_hook_control_check_mobile() {
|
1421 |
$wplc_settings = get_option("WPLC_SETTINGS");
|
1422 |
-
|
1423 |
$draw_box = false;
|
1424 |
|
1425 |
if (!class_exists('Mobile_Detect')) {
|
1426 |
require_once (plugin_dir_path(__FILE__) . 'includes/Mobile_Detect.php');
|
1427 |
}
|
1428 |
-
|
1429 |
$wplc_detect_device = new Mobile_Detect;
|
1430 |
$wplc_is_mobile = $wplc_detect_device->isMobile();
|
1431 |
-
|
1432 |
if ($wplc_is_mobile && !isset($wplc_settings['wplc_enabled_on_mobile']) && $wplc_settings['wplc_enabled_on_mobile'] != 1) {
|
1433 |
return "";
|
1434 |
}
|
1435 |
-
|
1436 |
if (function_exists('wplc_basic_hide_chat_when_offline')) {
|
1437 |
$wplc_hide_chat = wplc_basic_hide_chat_when_offline();
|
1438 |
if (!$wplc_hide_chat) {
|
@@ -1445,7 +1554,7 @@ function wplc_hook_control_check_mobile() {
|
|
1445 |
remove_action("wplc_hook_output_box_body","wplc_hook_control_show_chat_box");
|
1446 |
remove_action("wplc_hook_output_box_footer","wplc_action_control_hook_output_box_footer");
|
1447 |
}
|
1448 |
-
|
1449 |
}
|
1450 |
|
1451 |
|
@@ -1478,16 +1587,16 @@ function wplc_hook_control_show_chat_box($cid) {
|
|
1478 |
global $wplc_pro_version;
|
1479 |
if (intval(str_replace(".","",$wplc_pro_version)) < 5100) {
|
1480 |
|
1481 |
-
echo wplc_output_box_ajax();
|
1482 |
|
1483 |
} else {
|
1484 |
echo wplc_output_box_ajax_new($cid);
|
1485 |
}
|
1486 |
} else {
|
1487 |
echo wplc_output_box_ajax_new($cid);
|
1488 |
-
|
1489 |
}
|
1490 |
-
|
1491 |
}
|
1492 |
|
1493 |
/* basic */
|
@@ -1515,7 +1624,7 @@ function wplc_output_box_5100($cid = null) {
|
|
1515 |
/**
|
1516 |
* Filter to control the top MAIN DIV of the chat box
|
1517 |
* @param array $wplc_settings Live chat settings array
|
1518 |
-
* @return string
|
1519 |
* @since 6.0.00
|
1520 |
* @author Nick Duncan <nick@codecabin.co.za>
|
1521 |
*/
|
@@ -1523,7 +1632,7 @@ function wplc_filter_control_live_chat_box_html_main_div_top($wplc_settings,$log
|
|
1523 |
$ret_msg = "";
|
1524 |
$wplc_class = "";
|
1525 |
// $wplc_settings = get_option("WPLC_SETTINGS");
|
1526 |
-
|
1527 |
if ($wplc_settings["wplc_settings_align"] == 1) {
|
1528 |
$original_pos = "bottom_left";
|
1529 |
} else if ($wplc_settings["wplc_settings_align"] == 2) {
|
@@ -1562,7 +1671,7 @@ function wplc_filter_control_live_chat_box_html_main_div_top($wplc_settings,$log
|
|
1562 |
}
|
1563 |
}
|
1564 |
|
1565 |
-
|
1566 |
$wplc_extra_attr = apply_filters("wplc_filter_chat_header_extra_attr","");
|
1567 |
if (isset($wplc_settings['wplc_newtheme'])) { $wplc_newtheme = $wplc_settings['wplc_newtheme']; } else { }
|
1568 |
if (isset($wplc_newtheme)) {
|
@@ -1609,7 +1718,7 @@ function wplc_filter_control_modern_theme_hovercard_content_left($msg) {
|
|
1609 |
/**
|
1610 |
* Filter to control the top HEADER DIV of the chat box
|
1611 |
* @param array $wplc_settings Live chat settings array
|
1612 |
-
* @return string
|
1613 |
* @since 6.0.00
|
1614 |
* @author Nick Duncan <nick@codecabin.co.za>
|
1615 |
*/
|
@@ -1632,9 +1741,9 @@ add_filter("wplc_filter_chat_header_under","wplc_filter_control_chat_header_unde
|
|
1632 |
function wplc_filter_control_chat_header_under($ret_msg,$wplc_settings) {
|
1633 |
$current_theme = isset($wplc_settings['wplc_newtheme']) ? $wplc_settings['wplc_newtheme'] : "";
|
1634 |
if($current_theme === "theme-2"){
|
1635 |
-
|
1636 |
if (function_exists("wplc_acbc_filter_control_chat_header_under")) {
|
1637 |
-
remove_filter("wplc_filter_chat_header_under","wplc_acbc_filter_control_chat_header_under");
|
1638 |
}
|
1639 |
}
|
1640 |
|
@@ -1647,7 +1756,7 @@ function wplc_filter_control_chat_header_under($ret_msg,$wplc_settings) {
|
|
1647 |
/**
|
1648 |
* Filter to control the user details section - custom fields coming soon
|
1649 |
* @param array $wplc_settings Live chat settings array
|
1650 |
-
* @return string
|
1651 |
* @since 6.0.00
|
1652 |
* @author Nick Duncan <nick@codecabin.co.za>
|
1653 |
*/
|
@@ -1716,12 +1825,12 @@ function wplc_filter_control_live_chat_box_html_ask_user_detail($wplc_settings)
|
|
1716 |
$ret_msg .= apply_filters("wplc_start_chat_user_form_after_filter", "");
|
1717 |
} else {
|
1718 |
//Dont ask the user
|
1719 |
-
|
1720 |
$ret_msg .= "<div style=\"padding: 7px; text-align: center;\">";
|
1721 |
if (isset($wplc_settings['wplc_user_alternative_text'])) {
|
1722 |
$ret_msg .= html_entity_decode( stripslashes($wplc_settings['wplc_user_alternative_text']) );
|
1723 |
}
|
1724 |
-
$ret_msg .= '</div>'
|
1725 |
|
1726 |
$wplc_random_user_number = rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9);
|
1727 |
//$wplc_loggedin_user_email = $wplc_random_user_number."@".$wplc_random_user_number.".com";
|
@@ -1738,7 +1847,7 @@ function wplc_filter_control_live_chat_box_html_ask_user_detail($wplc_settings)
|
|
1738 |
/**
|
1739 |
* Filter to control the start chat button
|
1740 |
* @param array $wplc_settings Live chat settings array
|
1741 |
-
* @return string
|
1742 |
* @since 6.0.00
|
1743 |
* @author Nick Duncan <nick@codecabin.co.za>
|
1744 |
*/
|
@@ -1755,7 +1864,7 @@ function wplc_filter_control_live_chat_box_html_start_chat_button($wplc_settings
|
|
1755 |
/**
|
1756 |
* Filter to control the hover card start chat button
|
1757 |
* @param array $wplc_settings Live chat settings array
|
1758 |
-
* @return string
|
1759 |
* @since 6.1.00
|
1760 |
* @author Nick Duncan <nick@codecabin.co.za>
|
1761 |
*/
|
@@ -1777,14 +1886,14 @@ function wplc_filter_control_live_chat_box_html_hovercard_chat_button($content,$
|
|
1777 |
/**
|
1778 |
* Filter to control the offline message button
|
1779 |
* @param array $wplc_settings Live chat settings array
|
1780 |
-
* @return string
|
1781 |
* @since 6.0.00
|
1782 |
* @author Nick Duncan <nick@codecabin.co.za>
|
1783 |
*/
|
1784 |
function wplc_filter_control_live_chat_box_html_send_offline_message_button($wplc_settings) {
|
1785 |
$wplc_settings = get_option('WPLC_SETTINGS');
|
1786 |
if (isset($wplc_settings['wplc_theme'])) { $wplc_theme = $wplc_settings['wplc_theme']; } else { }
|
1787 |
-
|
1788 |
if (isset($wplc_theme)) {
|
1789 |
if($wplc_theme == 'theme-1') {
|
1790 |
$wplc_settings_fill = "#DB0000";
|
@@ -1846,7 +1955,7 @@ if (isset($wplc_settings['wplc_theme'])) { $wplc_theme = $wplc_settings['wplc_th
|
|
1846 |
* Filter to control the 2nd layer of the chat window (online/offline)
|
1847 |
* @param array $wplc_settings Live chat settings array
|
1848 |
* @param bool $logged_in Is the user logged in or not
|
1849 |
-
* @return string
|
1850 |
* @since 6.0.00
|
1851 |
* @author Nick Duncan <nick@codecabin.co.za>
|
1852 |
*/
|
@@ -1859,10 +1968,10 @@ function wplc_filter_control_live_chat_box_html_2nd_layer($wplc_settings,$logged
|
|
1859 |
|
1860 |
$ret_msg = "<div id=\"wp-live-chat-2-inner\">";
|
1861 |
$ret_msg .= " <div id=\"wp-live-chat-2-info\" class='wplc-color-4'>";
|
1862 |
-
$ret_msg .= $text;
|
1863 |
$ret_msg .= " </div>";
|
1864 |
-
$ret_msg .= apply_filters("wplc_filter_live_chat_box_html_ask_user_details",wplc_filter_control_live_chat_box_html_ask_user_detail($wplc_settings));
|
1865 |
-
$ret_msg .= apply_filters("wplc_filter_live_chat_box_html_start_chat_button",wplc_filter_control_live_chat_box_html_start_chat_button($wplc_settings,$wplc_using_locale ), $cid);
|
1866 |
$ret_msg .= "</div>";
|
1867 |
} else {
|
1868 |
if ( isset( $wplc_settings['wplc_loggedin_user_info'] ) && $wplc_settings['wplc_loggedin_user_info'] == 1 ) {
|
@@ -1910,10 +2019,10 @@ function wplc_filter_control_live_chat_box_html_2nd_layer($wplc_settings,$logged
|
|
1910 |
}
|
1911 |
|
1912 |
if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1) { $offline_ip_address = $ip_address; } else { $offline_ip_address = ""; }
|
1913 |
-
|
1914 |
$ret_msg .= "<input type=\"hidden\" name=\"wplc_ip_address\" id=\"wplc_ip_address\" value=\"".$offline_ip_address."\" />";
|
1915 |
$ret_msg .= "<input type=\"hidden\" name=\"wplc_domain_offline\" id=\"wplc_domain_offline\" value=\"".site_url()."\" />";
|
1916 |
-
$ret_msg .= apply_filters("wplc_filter_live_chat_box_html_send_offline_message_button",wplc_filter_control_live_chat_box_html_send_offline_message_button($wplc_settings));
|
1917 |
$ret_msg .= "</div>";
|
1918 |
|
1919 |
|
@@ -1939,7 +2048,7 @@ function wplc_filter_control_live_chat_box_html_2nd_layer($wplc_settings,$logged
|
|
1939 |
/**
|
1940 |
* Filter to control the 3rd layer of the chat window
|
1941 |
* @param array $wplc_settings live chat settings array
|
1942 |
-
* @return string
|
1943 |
* @since 6.0.00
|
1944 |
* @author Nick Duncan <nick@codecabin.co.za>
|
1945 |
*/
|
@@ -1953,6 +2062,25 @@ function wplc_filter_control_live_chat_box_html_3rd_layer($wplc_settings,$wplc_u
|
|
1953 |
return $ret_msg;
|
1954 |
}
|
1955 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1956 |
|
1957 |
add_filter("wplc_filter_live_chat_box_above_main_div","wplc_filter_control_live_chat_box_above_main_div",10,3);
|
1958 |
function wplc_filter_control_live_chat_box_above_main_div( $msg, $wplc_settings, $cid ) {
|
@@ -1969,46 +2097,52 @@ function wplc_filter_control_live_chat_box_above_main_div( $msg, $wplc_settings,
|
|
1969 |
$a_website = '';
|
1970 |
$social_links = '';
|
1971 |
$agent_string = '';
|
1972 |
-
if ( $cid ) {
|
1973 |
-
$chat_data = wplc_get_chat_data( $cid );
|
1974 |
-
|
1975 |
-
if ( isset( $chat_data->agent_id ) ) {
|
1976 |
-
$agent_id = intval( $chat_data->agent_id );
|
1977 |
-
} else {
|
1978 |
-
$agent_id = get_current_user_id();
|
1979 |
-
}
|
1980 |
|
1981 |
-
|
1982 |
-
|
1983 |
-
|
1984 |
-
|
1985 |
|
|
|
|
|
|
|
|
|
|
|
1986 |
|
1987 |
-
|
1988 |
-
|
1989 |
-
$agent = $user_info->display_name;
|
1990 |
-
} else {
|
1991 |
-
if (!empty($wplc_acbc_data['wplc_chat_name'])) {
|
1992 |
-
$agent = $wplc_acbc_data['wplc_chat_name'];
|
1993 |
-
} else {
|
1994 |
-
$agent = 'Admin';
|
1995 |
-
}
|
1996 |
-
}
|
1997 |
-
$cbox_header_bg = "style='background-image:url(https://www.gravatar.com/avatar/".md5($user_info->user_email)."?s=380); no-repeat; cover;'";
|
1998 |
|
1999 |
-
|
|
|
2000 |
|
2001 |
-
$agent_string = '
|
2002 |
-
<p style="text-align:center;">
|
2003 |
-
<img class="img-thumbnail img-circle wplc_thumb32 wplc_agent_involved" style="max-width:inherit;" id="agent_grav_'.$agent_id.'" title="'.$agent.'" src="http://www.gravatar.com/avatar/'.md5($user_info->user_email).'?s=60" /><br />
|
2004 |
-
<span class="wplc_agent_name wplc-color-2">'.$agent.'</span>
|
2005 |
-
'.$extra.'
|
2006 |
-
</p>';
|
2007 |
|
2008 |
-
|
2009 |
-
}
|
2010 |
|
2011 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012 |
|
2013 |
}
|
2014 |
return $msg;
|
@@ -2017,7 +2151,7 @@ function wplc_filter_control_live_chat_box_above_main_div( $msg, $wplc_settings,
|
|
2017 |
/**
|
2018 |
* Filter to control the 4th layer of the chat window
|
2019 |
* @param array $wplc_settings live chat settings array
|
2020 |
-
* @return string
|
2021 |
* @since 6.0.00
|
2022 |
* @author Nick Duncan <nick@codecabin.co.za>
|
2023 |
*/
|
@@ -2028,18 +2162,18 @@ function wplc_filter_control_live_chat_box_html_4th_layer($wplc_settings,$wplc_u
|
|
2028 |
|
2029 |
$wplc_welcome = __('Welcome. How may I help you?', 'wplivechat');
|
2030 |
if (!isset($wplc_settings['wplc_user_welcome_chat']) || $wplc_settings['wplc_user_welcome_chat'] == "") { $wplc_settings['wplc_user_welcome_chat'] = $wplc_welcome; }
|
2031 |
-
$text2 = ($wplc_using_locale ? $wplc_welcome : stripslashes($wplc_settings['wplc_user_welcome_chat']));
|
|
|
|
|
2032 |
|
2033 |
|
2034 |
-
|
2035 |
-
|
2036 |
|
2037 |
$ret_msg = "";
|
2038 |
if (isset($wplc_settings['wplc_newtheme']) && $wplc_settings['wplc_newtheme'] == 'theme-1') {
|
2039 |
$ret_msg .= apply_filters("wplc_filter_typing_control_div","");
|
2040 |
}
|
2041 |
$ret_msg .= "<div id=\"wplc_sound_update\" style=\"height:0; width:0; display:none; border:0;\"></div>";
|
2042 |
-
|
2043 |
$ret_msg .= apply_filters("wplc_filter_live_chat_box_above_main_div","",$wplc_settings, $cid);
|
2044 |
|
2045 |
|
@@ -2051,6 +2185,7 @@ function wplc_filter_control_live_chat_box_html_4th_layer($wplc_settings,$wplc_u
|
|
2051 |
// $ret_msg .= "<div class='wplc-clear-float-message'></div>";
|
2052 |
$ret_msg .= "</div>";
|
2053 |
|
|
|
2054 |
$ret_msg .= "<div id='wplc_user_message_div'>";
|
2055 |
|
2056 |
$ret_msg .= "<p id='wplc_msg_notice'>".$text."</p>";
|
@@ -2060,7 +2195,7 @@ function wplc_filter_control_live_chat_box_html_4th_layer($wplc_settings,$wplc_u
|
|
2060 |
|
2061 |
$ret_msg .= "<p>";
|
2062 |
$placeholder = __('Type here','wplivechat');
|
2063 |
-
$ret_msg .= "<textarea type=\"text\" name=\"wplc_chatmsg\" id=\"wplc_chatmsg\" placeholder=\"".$placeholder."\" onclick=\"jQuery(this).select();\" ></textarea>";
|
2064 |
if (isset($wplc_settings['wplc_newtheme']) && $wplc_settings['wplc_newtheme'] == 'theme-2') {
|
2065 |
$ret_msg .= apply_filters("wplc_filter_typing_control_div_theme_2","");
|
2066 |
}
|
@@ -2072,6 +2207,8 @@ function wplc_filter_control_live_chat_box_html_4th_layer($wplc_settings,$wplc_u
|
|
2072 |
$ret_msg .= "<input id=\"wplc_send_msg\" type=\"button\" value=\"".__("Send", "wplivechat")."\" style=\"display:none;\" />";
|
2073 |
$ret_msg .= "</p>";
|
2074 |
|
|
|
|
|
2075 |
$current_theme = isset($wplc_settings['wplc_newtheme']) ? $wplc_settings['wplc_newtheme'] : "";
|
2076 |
if($current_theme === "theme-2"){
|
2077 |
$ret_msg .= apply_filters("wplc_filter_chat_4th_layer_below_input","", $wplc_settings); //Ratings/Social Icon Filter
|
@@ -2087,13 +2224,14 @@ function wplc_filter_control_live_chat_box_html_4th_layer($wplc_settings,$wplc_u
|
|
2087 |
* @param array $wplc_settings live chat settings array
|
2088 |
* @param bool $logged_in Is the admin logged in or not
|
2089 |
* @param bool $wplc_using_locale Are they using a localization plugin
|
2090 |
-
* @return string
|
2091 |
* @since 6.0.00
|
2092 |
* @author Nick Duncan <nick@codecabin.co.za>
|
2093 |
*/
|
2094 |
function wplc_filter_control_live_chat_box_html_1st_layer($wplc_settings,$logged_in,$wplc_using_locale, $class_override = false) {
|
2095 |
|
2096 |
$ret_msg = "<div id='wplc_first_message'>";
|
|
|
2097 |
if ($logged_in) {
|
2098 |
$wplc_fst_1 = __('Questions?', 'wplivechat');
|
2099 |
$wplc_fst_2 = __('Chat with us', 'wplivechat');
|
@@ -2112,6 +2250,8 @@ function wplc_filter_control_live_chat_box_html_1st_layer($wplc_settings,$logged
|
|
2112 |
|
2113 |
$ret_msg .= $wplc_tl_msg;
|
2114 |
} else {
|
|
|
|
|
2115 |
$wplc_na = __('Chat offline. Leave a message', 'wplivechat');
|
2116 |
$wplc_tl_msg = "<span class='wplc_offline'>" . ($wplc_using_locale ? $wplc_na : stripslashes($wplc_settings['wplc_pro_na'])) . "</span>";
|
2117 |
$ret_msg .= $wplc_tl_msg;
|
@@ -2144,11 +2284,13 @@ function wplc_initiate_chat_button($actions,$result,$post_data) {
|
|
2144 |
add_filter("wplc_loggedin_filter","wplc_filter_control_loggedin",10,1);
|
2145 |
function wplc_filter_control_loggedin($logged_in) {
|
2146 |
$wplc_is_admin_logged_in = get_transient("wplc_is_admin_logged_in");
|
|
|
2147 |
if (!function_exists("wplc_register_pro_version") && $wplc_is_admin_logged_in != 1) {
|
2148 |
$logged_in = false;
|
2149 |
} else {
|
2150 |
$logged_in = true;
|
2151 |
}
|
|
|
2152 |
$logged_in_checks = apply_filters("wplc_filter_is_admin_logged_in",array());
|
2153 |
/* if we are logged in ANYWHERE, set this to true */
|
2154 |
foreach($logged_in_checks as $key => $val) {
|
@@ -2156,11 +2298,12 @@ function wplc_filter_control_loggedin($logged_in) {
|
|
2156 |
}
|
2157 |
$logged_in_via_app = false;
|
2158 |
if (isset($logged_in_checks['app']) && $logged_in_checks['app'] == true) { $logged_in_via_app = true; }
|
|
|
2159 |
$logged_in = apply_filters("wplc_final_loggedin_control",$logged_in,$logged_in_via_app);
|
|
|
2160 |
/* admin is using the basic version and is logged in */
|
2161 |
if ($wplc_is_admin_logged_in) { $logged_in = true; }
|
2162 |
|
2163 |
-
|
2164 |
return $logged_in;
|
2165 |
}
|
2166 |
|
@@ -2181,91 +2324,97 @@ function wplc_shortenurl($url) {
|
|
2181 |
*/
|
2182 |
function wplc_output_box_ajax_new($cid = null) {
|
2183 |
|
2184 |
-
|
2185 |
$ret_msg = array();
|
2186 |
$logged_in = false;
|
2187 |
|
2188 |
$wplc_settings = get_option("WPLC_SETTINGS");
|
2189 |
|
2190 |
if(isset($wplc_settings['wplc_using_localization_plugin']) && $wplc_settings['wplc_using_localization_plugin'] == 1){ $wplc_using_locale = true; } else { $wplc_using_locale = false; }
|
2191 |
-
|
2192 |
-
|
2193 |
-
$logged_in = apply_filters("wplc_loggedin_filter",false);
|
2194 |
-
|
2195 |
-
|
2196 |
-
|
2197 |
|
2198 |
|
|
|
2199 |
|
2200 |
-
$ret_msg['cbox'] = apply_filters("wplc_theme_control",$wplc_settings,$logged_in,$wplc_using_locale,$cid);
|
2201 |
|
2202 |
$ret_msg['online'] = $logged_in;
|
2203 |
-
|
2204 |
global $wplc_pro_version;
|
2205 |
$wplc_ver = str_replace('.', '', $wplc_pro_version);
|
2206 |
-
$checker = intval($wplc_ver);
|
2207 |
|
2208 |
-
if ($cid !== null) {
|
|
|
2209 |
$chat_data = wplc_get_chat_data( $cid );
|
2210 |
-
|
2211 |
wplc_record_chat_notification('user_loaded',$cid,array('uri' => $_SERVER['HTTP_REFERER'], 'chat_data' => $chat_data ));
|
2212 |
-
|
|
|
|
|
2213 |
if ( !isset($chat_data) || !$chat_data->agent_id ) {
|
2214 |
$ret_msg['type'] = 'new';
|
2215 |
} else {
|
2216 |
$ret_msg['type'] = 'returning';
|
2217 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2218 |
|
2219 |
-
/* build the AGENT DATA array */
|
2220 |
-
$wplc_acbc_data = get_option("WPLC_ACBC_SETTINGS");
|
2221 |
-
$user_info = get_userdata( intval( $chat_data->agent_id ) );
|
2222 |
-
|
2223 |
-
$agent_tagline = '';
|
2224 |
-
$agent_bio = '';
|
2225 |
-
$a_twitter = '';
|
2226 |
-
$a_linkedin = '';
|
2227 |
-
$a_facebook = '';
|
2228 |
-
$a_website = '';
|
2229 |
-
$social_links = '';
|
2230 |
-
|
2231 |
-
if( isset( $wplc_acbc_data['wplc_use_wp_name'] ) && $wplc_acbc_data['wplc_use_wp_name'] == '1' ){
|
2232 |
-
|
2233 |
-
$agent = $user_info->display_name;
|
2234 |
-
} else {
|
2235 |
-
if (!empty($wplc_acbc_data['wplc_chat_name'])) {
|
2236 |
-
$agent = $wplc_acbc_data['wplc_chat_name'];
|
2237 |
-
} else {
|
2238 |
-
$agent = 'Admin';
|
2239 |
-
}
|
2240 |
-
}
|
2241 |
-
|
2242 |
-
if( !isset( $data ) ){ $data = false; }
|
2243 |
-
|
2244 |
-
$agent_tagline = apply_filters( "wplc_filter_agent_data_agent_tagline", $agent_tagline, $cid, $chat_data, $agent, $wplc_acbc_data, $user_info, $data );
|
2245 |
-
$agent_bio = apply_filters( "wplc_filter_agent_data_agent_bio", $agent_bio, $cid, $chat_data, $agent, $wplc_acbc_data, $user_info, $data );
|
2246 |
-
$social_links = apply_filters( "wplc_filter_agent_data_social_links", $social_links, $cid, $chat_data, $agent, $wplc_acbc_data, $user_info, $data);
|
2247 |
-
|
2248 |
-
$ret_msg['agent_data'] = array(
|
2249 |
-
'email' => md5($user_info->user_email),
|
2250 |
-
'name' => $agent,
|
2251 |
-
'aid' => $user_info->ID,
|
2252 |
-
'agent_tagline' => $agent_tagline,
|
2253 |
-
'agent_bio' => $agent_bio,
|
2254 |
-
"social_links" => $social_links
|
2255 |
-
);
|
2256 |
-
|
2257 |
}
|
2258 |
|
2259 |
|
|
|
|
|
2260 |
}
|
2261 |
-
|
2262 |
|
2263 |
if (function_exists("wplc_pro_version_control")) {
|
2264 |
if ($checker < 6000) {
|
2265 |
/* backwards compatibilitty for the old pro version */
|
2266 |
return json_encode($ret_msg['cbox']);
|
2267 |
} else {
|
2268 |
-
return json_encode($ret_msg);
|
2269 |
}
|
2270 |
|
2271 |
} else {
|
@@ -2273,7 +2422,7 @@ function wplc_output_box_ajax_new($cid = null) {
|
|
2273 |
}
|
2274 |
|
2275 |
|
2276 |
-
|
2277 |
|
2278 |
|
2279 |
|
@@ -2285,26 +2434,26 @@ function wplc_return_default_theme($wplc_settings,$logged_in,$wplc_using_locale,
|
|
2285 |
$ret_msg .= " <i id=\"wp-live-chat-minimize\" class=\"fa fa-minus wplc-color-bg-2 wplc-color-1\" style=\"display:none;\"></i>";
|
2286 |
$ret_msg .= " <i id=\"wp-live-chat-close\" class=\"fa fa-times\" style=\"display:none;\" ></i>";
|
2287 |
$ret_msg .= " <div id=\"wp-live-chat-1\" >";
|
2288 |
-
$ret_msg .= apply_filters("wplc_filter_live_chat_box_html_1st_layer",wplc_filter_control_live_chat_box_html_1st_layer($wplc_settings,$logged_in,$wplc_using_locale,'wplc-color-2'));
|
2289 |
$ret_msg .= " </div>";
|
2290 |
$ret_msg .= '<div id="wplc-chat-alert" class="wplc-chat-alert wplc-chat-alert--' . $wplc_settings["wplc_theme"] . '"></div>';
|
2291 |
$ret_msg .= " </div>";
|
2292 |
$ret_msg .= " <div id=\"wp-live-chat-2\" style=\"display:none;\">";
|
2293 |
$ret_msg .= apply_filters("wplc_filter_live_chat_box_survey","");
|
2294 |
-
$ret_msg .= apply_filters("wplc_filter_live_chat_box_html_2nd_layer",wplc_filter_control_live_chat_box_html_2nd_layer($wplc_settings,$logged_in,$wplc_using_locale,$cid), $cid);
|
2295 |
$ret_msg .= " </div>";
|
2296 |
$ret_msg .= " <div id=\"wp-live-chat-3\" style=\"display:none;\">";
|
2297 |
-
$ret_msg .= apply_filters("wplc_filter_live_chat_box_html_3rd_layer",wplc_filter_control_live_chat_box_html_3rd_layer($wplc_settings,$wplc_using_locale));
|
2298 |
$ret_msg .= " </div>";
|
2299 |
$ret_msg .= " <div id=\"wp-live-chat-react\" style=\"display:none;\">";
|
2300 |
$ret_msg .= " <p>".__("Reactivating your previous chat...", "wplivechat")."</p>";
|
2301 |
$ret_msg .= " </div>";
|
2302 |
$ret_msg .= " <div id=\"wplc-extra-div\" style=\"display:none;\">";
|
2303 |
-
$ret_msg .= apply_filters("wplc_filter_wplc_extra_div","",$wplc_settings,$wplc_using_locale);
|
2304 |
$ret_msg .= "</div>";
|
2305 |
$ret_msg .= "</div>";
|
2306 |
$ret_msg .= " <div id=\"wp-live-chat-4\" style=\"display:none;\">";
|
2307 |
-
$ret_msg .= apply_filters("wplc_filter_live_chat_box_html_4th_layer",wplc_filter_control_live_chat_box_html_4th_layer($wplc_settings,$wplc_using_locale, $cid));
|
2308 |
$ret_msg .= "</div>";
|
2309 |
return $ret_msg;
|
2310 |
}
|
@@ -2315,12 +2464,12 @@ function wplc_theme_control_function($wplc_settings,$logged_in,$wplc_using_local
|
|
2315 |
|
2316 |
if (!$wplc_settings) { return ""; }
|
2317 |
if (isset($wplc_settings['wplc_newtheme'])) { $wplc_newtheme = $wplc_settings['wplc_newtheme']; } else { }
|
2318 |
-
|
2319 |
$default_theme = wplc_return_default_theme($wplc_settings,$logged_in,$wplc_using_locale, $cid);
|
2320 |
if (isset($wplc_newtheme)) {
|
2321 |
|
2322 |
|
2323 |
-
|
2324 |
|
2325 |
|
2326 |
|
@@ -2339,37 +2488,37 @@ function wplc_theme_control_function($wplc_settings,$logged_in,$wplc_using_local
|
|
2339 |
$ret_msg .= " <i id=\"wp-live-chat-minimize\" class=\"fa fa-minus wplc-color-bg-2 wplc-color-1\" style=\"display:none;\" ></i>";
|
2340 |
$ret_msg .= " <i id=\"wp-live-chat-close\" class=\"fa fa-times\" style=\"display:none;\" ></i>";
|
2341 |
$ret_msg .= " <div id=\"wplc-extra-div\" style=\"display:none;\">";
|
2342 |
-
$ret_msg .= apply_filters("wplc_filter_wplc_extra_div","",$wplc_settings,$wplc_using_locale);
|
2343 |
$ret_msg .= " </div>";
|
2344 |
$ret_msg .= " <div id='wp-live-chat-inner-container'>";
|
2345 |
$ret_msg .= " <div id='wp-live-chat-inner'>";
|
2346 |
$ret_msg .= " <div id=\"wp-live-chat-1\" class=\"wplc-color-2 wplc-color-bg-1\" >";
|
2347 |
-
$ret_msg .= apply_filters("wplc_filter_live_chat_box_html_1st_layer",wplc_filter_control_live_chat_box_html_1st_layer($wplc_settings,$logged_in,$wplc_using_locale,'wplc-color-2'));
|
2348 |
$ret_msg .= " </div>";
|
2349 |
-
$ret_msg .= apply_filters("wplc_filter_live_chat_box_html_2nd_layer",wplc_filter_control_live_chat_box_html_2nd_layer($wplc_settings,$logged_in,$wplc_using_locale, $cid), $cid);
|
2350 |
$ret_msg .= " </div>";
|
2351 |
$ret_msg .= " <div id=\"wp-live-chat-react\" style=\"display:none;\">";
|
2352 |
$ret_msg .= " <p>".__("Reactivating your previous chat...", "wplivechat")."</p>";
|
2353 |
$ret_msg .= " </div>";
|
2354 |
$ret_msg .= " </div>";
|
2355 |
$ret_msg .= " <div id=\"wp-live-chat-3\" style=\"display:none;\">";
|
2356 |
-
$ret_msg .= apply_filters("wplc_filter_live_chat_box_html_3rd_layer",wplc_filter_control_live_chat_box_html_3rd_layer($wplc_settings,$wplc_using_locale));
|
2357 |
$ret_msg .= " </div>";
|
2358 |
$ret_msg .= " </div>";
|
2359 |
$ret_msg .= " <div id=\"wp-live-chat-4\" style=\"display:none;\">";
|
2360 |
-
$ret_msg .= apply_filters("wplc_filter_live_chat_box_html_4th_layer",wplc_filter_control_live_chat_box_html_4th_layer($wplc_settings,$wplc_using_locale, $cid));
|
2361 |
$ret_msg .= " </div>";
|
2362 |
|
2363 |
-
$ret_msg .= "</div>";
|
2364 |
|
2365 |
} else {
|
2366 |
$ret_msg = $default_theme;
|
2367 |
}
|
2368 |
} else {
|
2369 |
$ret_msg = $default_theme;
|
2370 |
-
}
|
2371 |
|
2372 |
-
return $ret_msg;
|
2373 |
}
|
2374 |
|
2375 |
|
@@ -2383,7 +2532,7 @@ function wplc_display_box() {
|
|
2383 |
global $wplc_pro_version;
|
2384 |
$wplc_ver = str_replace('.', '', $wplc_pro_version);
|
2385 |
$checker = intval($wplc_ver);
|
2386 |
-
|
2387 |
if (function_exists("wplc_pro_version_control") && ($checker <= 501 || $checker == 4410)) {
|
2388 |
/* prior to latest pro version with ajax handling */
|
2389 |
|
@@ -2398,7 +2547,7 @@ function wplc_display_box() {
|
|
2398 |
} else {
|
2399 |
$user_banned = 0;
|
2400 |
}
|
2401 |
-
if($display_contents && $user_banned == 0){
|
2402 |
$wplc_is_admin_logged_in = get_transient("wplc_is_admin_logged_in");
|
2403 |
if ($wplc_is_admin_logged_in != 1) {
|
2404 |
echo "<!-- wplc a-n-c -->";
|
@@ -2452,7 +2601,7 @@ function wplc_display_box_ajax() {
|
|
2452 |
} else {
|
2453 |
$user_banned = 0;
|
2454 |
}
|
2455 |
-
if($display_contents && $user_banned == 0){
|
2456 |
$wplc_is_admin_logged_in = get_transient("wplc_is_admin_logged_in");
|
2457 |
if ($wplc_is_admin_logged_in != 1) {
|
2458 |
return "";
|
@@ -2495,7 +2644,7 @@ function wplc_admin_display_chat($cid) {
|
|
2495 |
global $wpdb;
|
2496 |
global $wplc_tblname_msgs;
|
2497 |
$results = $wpdb->get_results(
|
2498 |
-
|
2499 |
SELECT *
|
2500 |
FROM $wplc_tblname_msgs
|
2501 |
WHERE `chat_sess_id` = '$cid'
|
@@ -2511,7 +2660,7 @@ function wplc_admin_display_chat($cid) {
|
|
2511 |
echo $msg_hist;
|
2512 |
}
|
2513 |
|
2514 |
-
function wplc_admin_accept_chat($cid) {
|
2515 |
$user_ID = get_current_user_id();
|
2516 |
wplc_change_chat_status(sanitize_text_field($cid), 3,$user_ID);
|
2517 |
return true;
|
@@ -2520,7 +2669,8 @@ function wplc_admin_accept_chat($cid) {
|
|
2520 |
add_action('admin_head', 'wplc_update_chat_statuses');
|
2521 |
|
2522 |
|
2523 |
-
add_action("wplc_hook_superadmin_head","wplc_hook_control_superadmin_head",10);
|
|
|
2524 |
function wplc_hook_control_superadmin_head() {
|
2525 |
$wplc_current_user = get_current_user_id();
|
2526 |
|
@@ -2544,71 +2694,89 @@ function wplc_hook_control_superadmin_head() {
|
|
2544 |
|
2545 |
};
|
2546 |
jQuery.post(ajaxurl, data, function (response) {
|
2547 |
-
|
2548 |
});
|
2549 |
}
|
2550 |
|
2551 |
});
|
2552 |
</script>
|
2553 |
-
<?php
|
2554 |
}
|
2555 |
}
|
2556 |
|
2557 |
|
2558 |
function wplc_superadmin_javascript() {
|
2559 |
-
|
2560 |
-
do_action("wplc_hook_superadmin_head");
|
2561 |
|
2562 |
-
|
2563 |
-
/* admin chat box page */
|
2564 |
-
if (function_exists("wplc_register_pro_version")) {
|
2565 |
-
wplc_return_pro_admin_chat_javascript(sanitize_text_field($_GET['cid']));
|
2566 |
-
} else {
|
2567 |
|
2568 |
-
|
2569 |
-
|
2570 |
-
|
|
|
|
|
2571 |
|
2572 |
-
|
2573 |
|
|
|
2574 |
|
|
|
|
|
2575 |
}
|
2576 |
-
|
2577 |
-
|
2578 |
-
/* load this on every other admin page */
|
2579 |
-
if (function_exists("wplc_register_pro_version")) {
|
2580 |
-
wplc_pro_admin_javascript();
|
2581 |
-
} else {
|
2582 |
-
wplc_admin_javascript();
|
2583 |
-
}
|
2584 |
-
do_action("wplc_hook_admin_javascript");
|
2585 |
-
}
|
2586 |
|
|
|
|
|
|
|
|
|
|
|
2587 |
|
2588 |
-
|
2589 |
-
|
2590 |
-
|
2591 |
|
2592 |
-
|
2593 |
-
if (typeof Notification !== 'undefined') {
|
2594 |
-
if (!Notification) {
|
2595 |
-
return;
|
2596 |
-
}
|
2597 |
-
if (Notification.permission !== "granted")
|
2598 |
-
Notification.requestPermission();
|
2599 |
|
2600 |
-
var wplc_desktop_notification = new Notification('<?php _e('New chat received', 'wplivechat'); ?>', {
|
2601 |
-
icon: wplc_notification_icon_url,
|
2602 |
-
body: "<?php _e("A new chat has been received. Please go the 'Live Chat' page to accept the chat", "wplivechat"); ?>"
|
2603 |
-
});
|
2604 |
-
//Notification.close()
|
2605 |
-
}
|
2606 |
-
}
|
2607 |
|
2608 |
-
|
2609 |
-
|
2610 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2611 |
|
|
|
|
|
2612 |
|
2613 |
function old_wplc_superadmin_javascript() {
|
2614 |
|
@@ -2624,7 +2792,7 @@ function old_wplc_superadmin_javascript() {
|
|
2624 |
} // main page
|
2625 |
else if ( isset($_GET['action']) && ( $_GET['action'] != 'welcome' && $_GET['action'] != 'credits' && $_GET['action'] != 'history' ) ) {
|
2626 |
if (function_exists("wplc_register_pro_version")) {
|
2627 |
-
wplc_return_pro_admin_chat_javascript(
|
2628 |
} else {
|
2629 |
|
2630 |
/** set the global chat data here so we dont need to keep getting it from the DB or Cloud server */
|
@@ -2632,19 +2800,19 @@ function old_wplc_superadmin_javascript() {
|
|
2632 |
$admin_chat_data = wplc_get_chat_data( sanitize_text_field( $_GET['cid'] ), __LINE__);
|
2633 |
|
2634 |
wplc_return_admin_chat_javascript( sanitize_text_field( $_GET['cid'] ) );
|
2635 |
-
|
2636 |
|
2637 |
}
|
2638 |
do_action("wplc_hook_admin_javascript_chat");
|
2639 |
}
|
2640 |
}
|
2641 |
|
2642 |
-
|
2643 |
do_action("wplc_hook_superadmin_head");
|
2644 |
|
2645 |
?>
|
2646 |
<script type="text/javascript">
|
2647 |
-
|
2648 |
|
2649 |
function wplc_desktop_notification() {
|
2650 |
if (typeof Notification !== 'undefined') {
|
@@ -2685,21 +2853,21 @@ function wplc_admin_javascript() {
|
|
2685 |
} else {
|
2686 |
/* Only run admin JS on the chat dashboard page */
|
2687 |
if ( isset( $_GET['page'] ) && $_GET['page'] === 'wplivechat-menu' && !isset( $_GET['action'] ) ) {
|
2688 |
-
wplc_admin_output_js();
|
2689 |
}
|
2690 |
}
|
2691 |
|
2692 |
|
2693 |
|
2694 |
-
|
2695 |
|
2696 |
-
|
|
|
2697 |
|
2698 |
}
|
2699 |
|
2700 |
/**
|
2701 |
* Outputs the admin JS on to the relevant pages, controlled by wplc_admin_javascript();
|
2702 |
-
*
|
2703 |
* @return void
|
2704 |
* @since 7.1.00
|
2705 |
* @author Nick Duncan
|
@@ -2710,14 +2878,14 @@ function wplc_admin_output_js() {
|
|
2710 |
|
2711 |
|
2712 |
$ajax_nonce = wp_create_nonce("wplc");
|
2713 |
-
global $wplc_version;
|
2714 |
|
2715 |
$wplc_current_user = get_current_user_id();
|
2716 |
if( get_user_meta( $wplc_current_user, 'wplc_ma_agent', true )) {
|
2717 |
|
2718 |
wp_register_script('wplc-admin-js', plugins_url('js/wplc_u_admin.js', __FILE__), false, $wplc_version, false);
|
2719 |
wp_enqueue_script('wplc-admin-js');
|
2720 |
-
$not_icon = plugins_url('/images/wplc_notification_icon.png', __FILE__);
|
2721 |
|
2722 |
$wplc_wav_file = plugins_url('/ring.wav', __FILE__);
|
2723 |
$wplc_wav_file = apply_filters("wplc_filter_wav_file",$wplc_wav_file);
|
@@ -2738,7 +2906,9 @@ function wplc_admin_output_js() {
|
|
2738 |
$wpc_ma_js_strings = array(
|
2739 |
'remove_agent' => __('Remove', 'wplivechat'),
|
2740 |
'nonce' => wp_create_nonce("wplc"),
|
2741 |
-
'user_id' => get_current_user_id()
|
|
|
|
|
2742 |
);
|
2743 |
wp_localize_script('wplc-admin-js', 'wplc_admin_strings', $wpc_ma_js_strings);
|
2744 |
|
@@ -2747,6 +2917,7 @@ function wplc_admin_output_js() {
|
|
2747 |
}
|
2748 |
|
2749 |
function wplc_admin_menu_layout() {
|
|
|
2750 |
do_action("wplc_hook_admin_menu_layout");
|
2751 |
if (function_exists("wplc_register_pro_version")) {
|
2752 |
global $wplc_pro_version;
|
@@ -2773,7 +2944,7 @@ function wplc_admin_menu_layout() {
|
|
2773 |
<p><?php _e("You are using an outdated version of <strong>WP Live Chat Support Pro</strong>.", "wplivechat") ?></p>
|
2774 |
<p>
|
2775 |
<strong><?php _e("Please update to the latest version of WP Live Chat Support Pro", 'wplivechat'); ?>
|
2776 |
-
<a href="https://wp-livechat.com/get-updated-version/" target=\"_BLANK\"> <?php _e("Version 5.0.1", "wplivechat"); ?></a>
|
2777 |
<?php _e("to ensure everything is working correctly.", "wplivechat"); ?>
|
2778 |
</strong>
|
2779 |
</p>
|
@@ -2783,22 +2954,42 @@ function wplc_admin_menu_layout() {
|
|
2783 |
</div>
|
2784 |
<?php
|
2785 |
}
|
2786 |
-
}
|
2787 |
-
if ( ( get_option("
|
2788 |
include 'includes/welcome_page.php';
|
2789 |
-
update_option('
|
2790 |
-
} else {
|
2791 |
-
|
2792 |
-
|
2793 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2794 |
} else {
|
2795 |
-
|
|
|
|
|
|
|
|
|
2796 |
}
|
2797 |
}
|
2798 |
}
|
|
|
|
|
|
|
2799 |
function wplc_first_time_tutorial() {
|
2800 |
if (!get_option('WPLC_FIRST_TIME_TUTORIAL')) {
|
2801 |
-
|
2802 |
global $wplc_basic_plugin_url;
|
2803 |
?>
|
2804 |
|
@@ -2811,11 +3002,11 @@ function wplc_first_time_tutorial() {
|
|
2811 |
<p><?php _e("Chat notifications will start appearing once visitors send a request.","wplivechat"); ?></p>
|
2812 |
<p><?php _e("You may <a href='?page=wplivechat-menu-settings' target='_BLANK'>modify your chat box settings here.","wplivechat"); ?></a></p>
|
2813 |
<p><?php _e("Experiencing issues?","wplivechat"); ?> <a href="https://wp-livechat.com/documentation/troubleshooting/" target="_BLANK" title=""><?php _e("Visit our troubleshooting section.","wplivechat"); ?></a></p>
|
2814 |
-
|
2815 |
<p><button id="wplc_close_ftt" class="button button-secondary"><?php _e("Hide","wplivechat"); ?></button></p>
|
2816 |
-
|
2817 |
</div>
|
2818 |
-
|
2819 |
<?php }
|
2820 |
}
|
2821 |
|
@@ -2845,12 +3036,12 @@ add_action("wplc_hook_chat_dashboard_bottom","wplc_hook_control_chat_dashboard_b
|
|
2845 |
* @author Nick Duncan <nick@codecabin.co.za>
|
2846 |
*/
|
2847 |
function wplc_hook_control_chat_dashboard_bottom() {
|
2848 |
-
echo "<p>";
|
2849 |
?>
|
2850 |
-
<?php _e("With the Pro add-on of WP Live Chat Support, you can", "wplivechat"); ?>
|
2851 |
<a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=initiate1" title="<?php _e("see who's online and initiate chats", "wplivechat"); ?>" target=\"_BLANK\">
|
2852 |
<?php _e("initiate chats", "wplivechat"); ?>
|
2853 |
-
</a> <?php _e("with your online visitors with the click of a button.", "wplivechat"); ?>
|
2854 |
<a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=initiate2" title="<?php _e("Buy the Pro add-on now.", "wplivechat"); ?>" target=\"_BLANK\">
|
2855 |
<strong>
|
2856 |
<?php _e("Buy the Pro add-on now.", "wplivechat"); ?>
|
@@ -2860,7 +3051,7 @@ function wplc_hook_control_chat_dashboard_bottom() {
|
|
2860 |
echo "</p>";
|
2861 |
|
2862 |
|
2863 |
-
|
2864 |
}
|
2865 |
|
2866 |
|
@@ -2872,7 +3063,7 @@ function wplc_admin_menu_layout_display() {
|
|
2872 |
/*
|
2873 |
-- modified in in 6.0.04 --
|
2874 |
|
2875 |
-
if(current_user_can('wplc_ma_agent') || current_user_can('manage_options')){
|
2876 |
*/
|
2877 |
do_action("wplc_hook_admin_menu_layout_display_top");
|
2878 |
|
@@ -2903,7 +3094,7 @@ function wplc_admin_menu_layout_display() {
|
|
2903 |
<a class="wplc-support-link wplc-rotate" href="?page=wplivechat-menu-support-page"></a>
|
2904 |
</div>
|
2905 |
<div class='wplc_page_title'>
|
2906 |
-
<img src='<?php echo WPLC_BASIC_PLUGIN_URL;
|
2907 |
<?php wplc_first_time_tutorial(); ?>
|
2908 |
<?php do_action("wplc_hook_chat_dashboard_above"); ?>
|
2909 |
|
@@ -2913,11 +3104,11 @@ function wplc_admin_menu_layout_display() {
|
|
2913 |
<?php
|
2914 |
$continue = apply_filters( "wplc_version_check_continue", true );
|
2915 |
if ($continue !== true) {
|
2916 |
-
|
2917 |
echo "<hr />";
|
2918 |
echo "<center>";
|
2919 |
echo "<h1>".$continue."</h1>";
|
2920 |
-
echo "<p>".sprintf( __( 'Need help? <a href="%s" target="_BLANK">contact us</a>.'),'https://wp-livechat.com/contact-us/')."</p>";
|
2921 |
echo "</center>";
|
2922 |
|
2923 |
|
@@ -2925,9 +3116,9 @@ function wplc_admin_menu_layout_display() {
|
|
2925 |
|
2926 |
?>
|
2927 |
|
2928 |
-
|
2929 |
<div id="wplc_sound"></div>
|
2930 |
-
|
2931 |
<div id="wplc_admin_chat_holder">
|
2932 |
<div id='wplc_admin_chat_info_new'>
|
2933 |
<div class='wplc_chat_vis_count_box'>
|
@@ -2938,13 +3129,13 @@ function wplc_admin_menu_layout_display() {
|
|
2938 |
</span>
|
2939 |
<?php echo apply_filters("wplc_filter_chat_dahsboard_visitors_online_bottom",""); ?>
|
2940 |
|
2941 |
-
|
2942 |
</div>
|
2943 |
|
2944 |
<?php do_action("wplc_after_chat_visitor_count_hook"); ?>
|
2945 |
-
|
2946 |
</div>
|
2947 |
-
|
2948 |
<div id="wplc_admin_chat_area_new">
|
2949 |
<div style="display:block;padding:10px;">
|
2950 |
<ul class='wplc_chat_ul_header'>
|
@@ -2960,32 +3151,32 @@ function wplc_admin_menu_layout_display() {
|
|
2960 |
</ul>
|
2961 |
<br />
|
2962 |
<hr />
|
2963 |
-
<?php do_action("wplc_hook_chat_dashboard_bottom"); ?>
|
2964 |
-
|
2965 |
</div>
|
2966 |
|
2967 |
</div>
|
2968 |
</div>
|
2969 |
<?php } ?>
|
2970 |
-
|
2971 |
-
|
2972 |
-
|
2973 |
|
2974 |
<?php
|
2975 |
} else {
|
2976 |
if (isset($_GET['aid'])) { $aid = $_GET['aid']; } else { $aid = null; }
|
2977 |
-
do_action("wplc_hook_admin_menu_layout_display_1",$_GET['action'],
|
2978 |
|
2979 |
if (!is_null($aid)) {
|
2980 |
-
do_action("wplc_hook_update_agent_id",
|
2981 |
}
|
2982 |
|
2983 |
-
do_action("wplc_hook_admin_menu_layout_display_1",$_GET['action'],
|
2984 |
|
2985 |
if ($_GET['action'] == 'ac') {
|
2986 |
do_action('wplc_hook_accept_chat',$_GET,$aid);
|
2987 |
}
|
2988 |
-
do_action("wplc_hook_admin_menu_layout_display",$_GET['action'],
|
2989 |
}
|
2990 |
} else {
|
2991 |
?>
|
@@ -3046,7 +3237,7 @@ function wplc_hook_control_accept_chat($get_data,$aid) {
|
|
3046 |
}
|
3047 |
}
|
3048 |
|
3049 |
-
|
3050 |
|
3051 |
|
3052 |
|
@@ -3070,9 +3261,9 @@ function wplc_hook_control_accept_chat($get_data,$aid) {
|
|
3070 |
* Hook to accept chat
|
3071 |
*
|
3072 |
* @since 7.1.00
|
3073 |
-
* @param
|
3074 |
* @return void
|
3075 |
-
* @author Nick Duncan (nick@codecabin.co.za)
|
3076 |
*
|
3077 |
*/
|
3078 |
add_action( 'wplc_hook_accept_chat_url' , 'wplc_b_hook_control_accept_chat_url', 5, 2);
|
@@ -3082,9 +3273,9 @@ function wplc_b_hook_control_accept_chat_url($get_data, $chat_data = false) {
|
|
3082 |
/* free version */
|
3083 |
wplc_b_update_agent_id(sanitize_text_field($get_data['cid']), get_current_user_id());
|
3084 |
} else {
|
3085 |
-
wplc_b_update_agent_id(sanitize_text_field($get_data['cid']), sanitize_text_field($get_data['agent_id']));
|
3086 |
}
|
3087 |
-
|
3088 |
}
|
3089 |
|
3090 |
/**
|
@@ -3093,16 +3284,16 @@ function wplc_b_hook_control_accept_chat_url($get_data, $chat_data = false) {
|
|
3093 |
* Replaces the same function of a different name in the older pro version
|
3094 |
*
|
3095 |
* @since 7.1.00
|
3096 |
-
* @param
|
3097 |
* @return void
|
3098 |
-
* @author Nick Duncan (nick@codecabin.co.za)
|
3099 |
*
|
3100 |
*/
|
3101 |
function wplc_b_update_agent_id($cid, $aid){
|
3102 |
global $wpdb;
|
3103 |
global $wplc_tblname_chats;
|
3104 |
$sql = "SELECT * FROM `$wplc_tblname_chats` WHERE `id` = '$cid' LIMIT 1";
|
3105 |
-
$result = $wpdb->get_row($sql);
|
3106 |
if ($result) {
|
3107 |
if(intval($result->status) != 3){
|
3108 |
$update = "UPDATE `$wplc_tblname_chats` SET `agent_id` = '$aid' WHERE `id` = '$cid' LIMIT 1";
|
@@ -3160,11 +3351,11 @@ function wplc_draw_chat_area($cid, $chat_data = false) {
|
|
3160 |
display: inline-block;
|
3161 |
float: right;
|
3162 |
}
|
3163 |
-
|
3164 |
.rating-bad {
|
3165 |
background-color: #AF0B0B !important;
|
3166 |
}
|
3167 |
-
|
3168 |
.rating-good {
|
3169 |
background-color: #368437 !important;
|
3170 |
}
|
@@ -3172,10 +3363,10 @@ function wplc_draw_chat_area($cid, $chat_data = false) {
|
|
3172 |
|
3173 |
</style>
|
3174 |
<?php
|
3175 |
-
|
3176 |
$user_data = maybe_unserialize($result->ip);
|
3177 |
-
$user_ip = $user_data['ip'];
|
3178 |
-
$browser = wplc_return_browser_string($user_data['user_agent']);
|
3179 |
$browser_image = wplc_return_browser_image($browser, "16");
|
3180 |
|
3181 |
|
@@ -3204,7 +3395,7 @@ function wplc_draw_chat_area($cid, $chat_data = false) {
|
|
3204 |
do_action("wplc_admin_chat_area_before_end_chat_button", $result);
|
3205 |
|
3206 |
echo "<a href=\"javascript:void(0);\" class=\"wplc_admin_close_chat button\" id=\"wplc_admin_close_chat\">" . __("End chat", "wplivechat") . "</a>";
|
3207 |
-
|
3208 |
do_action("wplc_admin_chat_area_after_end_chat_button", $result);
|
3209 |
|
3210 |
echo "</div>";
|
@@ -3214,13 +3405,13 @@ function wplc_draw_chat_area($cid, $chat_data = false) {
|
|
3214 |
echo "<div id='admin_chat_box'>";
|
3215 |
|
3216 |
$result->continue = true;
|
3217 |
-
|
3218 |
do_action("wplc_hook_wplc_draw_chat_area",$result);
|
3219 |
|
3220 |
if (!$result->continue) { return; }
|
3221 |
|
3222 |
echo"<div class='admin_chat_box'><div class='admin_chat_box_inner' id='admin_chat_box_area_" . $result->id . "'>".apply_filters( "wplc_chat_box_draw_chat_box_inner", "", $cid)."</div><div class='admin_chat_box_inner_bottom'>" . wplc_return_chat_response_box($cid, $result) . "</div>";
|
3223 |
-
|
3224 |
|
3225 |
echo "</div>";
|
3226 |
echo "<div class='admin_visitor_info'>";
|
@@ -3253,17 +3444,20 @@ function wplc_draw_chat_area($cid, $chat_data = false) {
|
|
3253 |
echo (apply_filters("wplc_filter_advanced_info","", $result->id, $result->name, $result));
|
3254 |
|
3255 |
echo " <div id=\"wplc_sound_update\"></div>";
|
3256 |
-
|
|
|
3257 |
echo "<h3>".__("Add-ons","wplivechat")."</h3>";
|
3258 |
do_action("wplc_hook_admin_visitor_info_display_after",$cid);
|
3259 |
echo "<a href='".admin_url('admin.php?page=wplivechat-menu-extensions-page')."' class='button button-primary' target='_BLANK'>".__("Get more add-ons","wplivechat")."</a>";
|
3260 |
echo "</div>";
|
3261 |
|
|
|
|
|
3262 |
if ($result->status != 1) {
|
3263 |
|
3264 |
do_action("wplc_hook_admin_below_chat_box",$result);
|
3265 |
}
|
3266 |
-
|
3267 |
}
|
3268 |
|
3269 |
|
@@ -3285,7 +3479,7 @@ function wplc_return_chat_response_box($cid, $chat_data = false) {
|
|
3285 |
|
3286 |
$ret .= apply_filters("wplc_filter_chat_upload","");
|
3287 |
$ret .= (!function_exists("nifty_text_edit_div") ? apply_filters("wplc_filter_chat_text_editor_upsell","") : apply_filters("wplc_filter_chat_text_editor",""));
|
3288 |
-
|
3289 |
$ret .= "<input id='wplc_admin_cid' type='hidden' value='$cid' />";
|
3290 |
$ret .= "<input id='wplc_admin_send_msg' type='button' value='" . __("Send", "wplivechat") . "' style=\"display:none;\" />";
|
3291 |
$ret .= "</div>";
|
@@ -3293,35 +3487,38 @@ function wplc_return_chat_response_box($cid, $chat_data = false) {
|
|
3293 |
}
|
3294 |
|
3295 |
function wplc_return_admin_chat_javascript($cid) {
|
3296 |
-
|
3297 |
$ajax_nonce = wp_create_nonce("wplc");
|
3298 |
-
|
3299 |
-
global $wplc_version;
|
3300 |
|
3301 |
$wplc_settings = get_option("WPLC_SETTINGS");
|
3302 |
|
3303 |
wp_register_script('wplc-admin-chat-server', plugins_url('js/wplc_server.js', __FILE__), false, $wplc_version, false);
|
3304 |
wp_enqueue_script('wplc-admin-chat-server');
|
3305 |
|
|
|
|
|
|
|
|
|
|
|
3306 |
global $admin_chat_data;
|
3307 |
-
if (!$admin_chat_data) {
|
3308 |
-
$cdata = wplc_get_chat_data($cid, __LINE__);
|
3309 |
} else {
|
3310 |
/* copy the stored admin chat data variable - more efficient */
|
3311 |
$cdata = $admin_chat_data;
|
3312 |
}
|
3313 |
|
3314 |
$other = maybe_unserialize($cdata->other);
|
3315 |
-
|
3316 |
if(isset($wplc_settings['wplc_use_node_server']) && $wplc_settings['wplc_use_node_server'] == 1){
|
3317 |
if (isset($other['socket']) && ($other['socket'] == true || $other['socket'] == "true")) {
|
3318 |
if ( isset( $_GET['action'] ) && $_GET['action'] === 'history') {
|
3319 |
-
wp_localize_script('wplc-admin-chat-server', 'wplc_use_node_server', "false");
|
3320 |
} else {
|
3321 |
wp_localize_script('wplc-admin-chat-server', 'wplc_use_node_server', "true");
|
3322 |
wp_localize_script('wplc-admin-chat-server', 'wplc_localized_string_is_typing_single', __(" is typing...","wplivechat"));
|
3323 |
}
|
3324 |
-
|
3325 |
$wplc_node_token = get_option("wplc_node_server_secret_token");
|
3326 |
if(!$wplc_node_token){
|
3327 |
if(function_exists("wplc_node_server_token_regenerate")){
|
@@ -3329,11 +3526,11 @@ function wplc_return_admin_chat_javascript($cid) {
|
|
3329 |
$wplc_node_token = get_option("wplc_node_server_secret_token");
|
3330 |
}
|
3331 |
}
|
3332 |
-
wp_localize_script('wplc-admin-chat-server', '
|
3333 |
-
}
|
3334 |
}
|
3335 |
|
3336 |
-
/**
|
3337 |
* Create a JS object for all Agent ID's and Gravatar MD5's
|
3338 |
*/
|
3339 |
$user_array = get_users(array(
|
@@ -3369,7 +3566,7 @@ function wplc_return_admin_chat_javascript($cid) {
|
|
3369 |
|
3370 |
global $wplc_pro_version;
|
3371 |
$wplc_ver = str_replace('.', '', $wplc_pro_version);
|
3372 |
-
$checker = intval($wplc_ver);
|
3373 |
if (isset($wplc_settings['wplc_theme'])) { $wplc_theme = $wplc_settings['wplc_theme']; } else { $wplc_theme = "theme-default"; }
|
3374 |
|
3375 |
if ( (isset($wplc_theme) && $checker >= 6000 ) || (! function_exists("wplc_pro_version_control") ) ) {
|
@@ -3407,7 +3604,7 @@ function wplc_return_admin_chat_javascript($cid) {
|
|
3407 |
/* custom */
|
3408 |
/* handled elsewhere */
|
3409 |
|
3410 |
-
|
3411 |
|
3412 |
}
|
3413 |
}
|
@@ -3423,15 +3620,15 @@ function wplc_return_admin_chat_javascript($cid) {
|
|
3423 |
if( isset($wplc_settings['wplc_show_avatar']) && $wplc_settings['wplc_show_avatar'] ){ $wplc_show_avatar = true; } else { $wplc_show_avatar = false; }
|
3424 |
if( isset($wplc_settings['wplc_show_date']) && $wplc_settings['wplc_show_date'] == '1' ){ $wplc_show_date = true; } else { $wplc_show_date = false; }
|
3425 |
if( isset($wplc_settings['wplc_show_time']) && $wplc_settings['wplc_show_time'] == '1' ){ $wplc_show_time = true; } else { $wplc_show_time = false; }
|
3426 |
-
|
3427 |
$wplc_chat_detail = array( 'name' => $wplc_show_name, 'avatar' => $wplc_show_avatar, 'date' => $wplc_show_date, 'time' => $wplc_show_time );
|
3428 |
-
|
3429 |
-
|
3430 |
-
wp_enqueue_script('wplc-admin-chat-js');
|
3431 |
|
3432 |
|
|
|
3433 |
wp_localize_script( 'wplc-admin-chat-js', 'wplc_show_chat_detail', $wplc_chat_detail );
|
3434 |
-
|
|
|
|
|
3435 |
if (!empty( $wplc_agent_data ) ) {
|
3436 |
wp_localize_script( 'wplc-admin-chat-js', 'wplc_agent_name', $wplc_agent_data->display_name );
|
3437 |
wp_localize_script( 'wplc-admin-chat-js', 'wplc_agent_email', md5( $wplc_agent_data->user_email ) );
|
@@ -3442,7 +3639,7 @@ function wplc_return_admin_chat_javascript($cid) {
|
|
3442 |
|
3443 |
wp_localize_script('wplc-admin-chat-js', 'wplc_chat_name', $cdata->name);
|
3444 |
wp_localize_script('wplc-admin-chat-js', 'wplc_chat_email', md5($cdata->email));
|
3445 |
-
|
3446 |
if(class_exists("WP_REST_Request")) {
|
3447 |
wp_localize_script('wplc-admin-chat-js', 'wplc_restapi_enabled', '1');
|
3448 |
wp_localize_script('wplc-admin-chat-js', 'wplc_restapi_token', get_option('wplc_api_secret_token'));
|
@@ -3467,10 +3664,11 @@ function wplc_return_admin_chat_javascript($cid) {
|
|
3467 |
wp_localize_script('wplc-user-script', 'wplc_localized_string_admin_name', apply_filters( 'wplc_filter_admin_name', 'Admin' ) );
|
3468 |
wp_localize_script('wplc-admin-chat-js', 'wplc_ajax_nonce', $ajax_nonce);
|
3469 |
wp_localize_script('wplc-admin-chat-js', 'admin_pic', $admin_pic);
|
|
|
3470 |
$wplc_ding_file = plugins_url('/ding.mp3', __FILE__);
|
|
|
3471 |
wp_localize_script('wplc-admin-chat-js', 'wplc_ding_file', $wplc_ding_file);
|
3472 |
|
3473 |
-
|
3474 |
$extra_data = apply_filters("wplc_filter_admin_javascript",array());
|
3475 |
wp_localize_script('wplc-admin-chat-js', 'wplc_extra_data', $extra_data);
|
3476 |
|
@@ -3490,8 +3688,6 @@ function wplc_return_admin_chat_javascript($cid) {
|
|
3490 |
$wplc_user_email_address = "";
|
3491 |
}
|
3492 |
|
3493 |
-
|
3494 |
-
|
3495 |
wp_localize_script('wplc-admin-chat-js', 'wplc_name', $display_name);
|
3496 |
wp_localize_script('wplc-admin-chat-js', 'wplc_enable_ding', $enable_ding);
|
3497 |
|
@@ -3502,7 +3698,7 @@ function wplc_return_admin_chat_javascript($cid) {
|
|
3502 |
wp_localize_script('wplc-admin-chat-js', 'wplc_ajaxurl', $wplc_ajax_url);
|
3503 |
wp_localize_script('wplc-admin-chat-js', 'wplc_home_ajaxurl', $home_ajax_url);
|
3504 |
|
3505 |
-
|
3506 |
|
3507 |
$wplc_url = admin_url('admin.php?page=wplivechat-menu&action=ac&cid=' . $cid);
|
3508 |
wp_localize_script('wplc-admin-chat-js', 'wplc_url', $wplc_url);
|
@@ -3529,7 +3725,8 @@ function wplc_activate() {
|
|
3529 |
$wplc_alt_text = __("Please click \'Start Chat\' to initiate a chat with an agent", "wplivechat");
|
3530 |
$wplc_default_visitor_name = __( "Guest", "wplivechat" );
|
3531 |
$wplc_admin_email = get_option('admin_email');
|
3532 |
-
|
|
|
3533 |
"wplc_settings_align" => "2",
|
3534 |
"wplc_settings_enabled" => "1",
|
3535 |
"wplc_powered_by_link" => "0",
|
@@ -3570,14 +3767,19 @@ function wplc_activate() {
|
|
3570 |
"wplc_user_welcome_chat" => __("Welcome. How may I help you?", "wplivechat"),
|
3571 |
'wplc_welcome_msg' => __("Please standby for an agent. While you wait for the agent you may type your message.","wplivechat")
|
3572 |
|
3573 |
-
)
|
|
|
|
|
|
|
|
|
|
|
3574 |
}
|
3575 |
|
3576 |
|
3577 |
|
3578 |
|
3579 |
|
3580 |
-
|
3581 |
$admins = get_role('administrator');
|
3582 |
if( $admins !== null ) { $admins->add_cap('wplc_ma_agent'); }
|
3583 |
|
@@ -3587,12 +3789,14 @@ function wplc_activate() {
|
|
3587 |
update_user_meta($uid, "wplc_chat_agent_online", time());
|
3588 |
|
3589 |
add_option("WPLC_HIDE_CHAT", "true");
|
3590 |
-
add_option("
|
3591 |
|
3592 |
|
3593 |
do_action("wplc_activate_hook");
|
3594 |
}
|
3595 |
|
|
|
|
|
3596 |
function wplc_handle_db() {
|
3597 |
global $wpdb;
|
3598 |
global $wplc_version;
|
@@ -3613,6 +3817,7 @@ function wplc_handle_db() {
|
|
3613 |
last_active_timestamp datetime NOT NULL,
|
3614 |
agent_id INT(11) NOT NULL,
|
3615 |
other LONGTEXT NOT NULL,
|
|
|
3616 |
PRIMARY KEY (id)
|
3617 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
3618 |
";
|
@@ -3633,6 +3838,9 @@ function wplc_handle_db() {
|
|
3633 |
status INT(3) NOT NULL,
|
3634 |
originates INT(3) NOT NULL,
|
3635 |
other LONGTEXT NOT NULL,
|
|
|
|
|
|
|
3636 |
PRIMARY KEY (id)
|
3637 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
3638 |
';
|
@@ -3688,8 +3896,8 @@ function wplc_add_user_stylesheet() {
|
|
3688 |
wp_register_style('wplc-style', plugins_url('/css/wplcstyle.css', __FILE__), array(), $wplc_version);
|
3689 |
wp_enqueue_style('wplc-style');
|
3690 |
|
3691 |
-
|
3692 |
-
if( isset( $wplc_settings['wplc_elem_trigger_type'] ) ){
|
3693 |
if ( $wplc_settings['wplc_elem_trigger_type'] === "0" ) {
|
3694 |
/* class */
|
3695 |
$wplc_elem_style_prefix = ".";
|
@@ -3699,11 +3907,9 @@ function wplc_add_user_stylesheet() {
|
|
3699 |
}
|
3700 |
}
|
3701 |
|
3702 |
-
|
3703 |
$wplc_elem_inline_style = $wplc_elem_style_prefix.stripslashes( $wplc_settings['wplc_elem_trigger_id'] ).":hover { cursor:pointer; }";
|
3704 |
wp_add_inline_style( 'wplc-style', stripslashes( $wplc_elem_inline_style ) );
|
3705 |
-
|
3706 |
-
}
|
3707 |
|
3708 |
// Serve the icon up over HTTPS if needs be
|
3709 |
//$icon = plugins_url('images/chaticon.png', __FILE__);
|
@@ -3712,7 +3918,7 @@ function wplc_add_user_stylesheet() {
|
|
3712 |
|
3713 |
|
3714 |
if ( isset( $wplc_settings['wplc_settings_bg'] ) ) {
|
3715 |
-
if ( $wplc_settings['wplc_settings_bg'] == "0" ) { $bg = false; } else { $bg = esc_attr( $wplc_settings['wplc_settings_bg'] ); }
|
3716 |
} else { $bg = "cloudy.jpg"; }
|
3717 |
if ($bg) {
|
3718 |
$bg = plugins_url('images/bg/'.$bg, __FILE__);
|
@@ -3727,13 +3933,13 @@ function wplc_add_user_stylesheet() {
|
|
3727 |
|
3728 |
$wplc_elem_inline_style = "#wp-live-chat-header { background:url('$icon') no-repeat; background-size: cover; } #wp-live-chat-header.active { background:url('$close_icon') no-repeat; background-size: cover; } $bg_string";
|
3729 |
wp_add_inline_style( 'wplc-style', stripslashes( $wplc_elem_inline_style ) );
|
3730 |
-
|
3731 |
|
3732 |
|
3733 |
global $wplc_pro_version;
|
3734 |
$wplc_ver = str_replace('.', '', $wplc_pro_version);
|
3735 |
-
$checker = intval($wplc_ver);
|
3736 |
-
|
3737 |
if (function_exists("wplc_pro_version_control") && $checker < 6000) {
|
3738 |
/* old pro version backwards compatibility */
|
3739 |
wp_register_style('wplc-style-pro', plugins_url('/css/wplcstyle_old.css', __FILE__));
|
@@ -3782,7 +3988,7 @@ function wplc_add_user_stylesheet() {
|
|
3782 |
/* custom */
|
3783 |
/* handled elsewhere */
|
3784 |
|
3785 |
-
|
3786 |
|
3787 |
}
|
3788 |
|
@@ -3820,80 +4026,191 @@ function wplc_add_user_stylesheet() {
|
|
3820 |
wp_register_style('wplc-theme-position', plugins_url('/css/themes/position-bottom-right.css', __FILE__), array(), $wplc_version);
|
3821 |
wp_enqueue_style('wplc-theme-position');
|
3822 |
}
|
3823 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3824 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3825 |
|
|
|
|
|
|
|
3826 |
|
3827 |
|
|
|
|
|
3828 |
|
3829 |
-
|
3830 |
-
|
3831 |
-
|
3832 |
-
|
|
|
|
|
|
|
|
|
|
|
3833 |
}
|
3834 |
}
|
3835 |
-
}
|
3836 |
-
/**
|
3837 |
-
* Loads the admin stylesheets for the chat dashboard and settings pages
|
3838 |
-
* @return void
|
3839 |
-
*/
|
3840 |
-
function wplc_add_admin_stylesheet() {
|
3841 |
-
global $wplc_version;
|
3842 |
-
if (isset($_GET['page']) && ($_GET['page'] == 'wplivechat-menu' || $_GET['page'] == 'wplivechat-menu-api-keys-page' || $_GET['page'] == 'wplivechat-menu-extensions-page' || $_GET['page'] == 'wplivechat-menu-settings' || $_GET['page'] == 'wplivechat-menu-offline-messages' || $_GET['page'] == 'wplivechat-menu-history' || $_GET['page'] == 'wplivechat-menu-missed-chats')) {
|
3843 |
-
wp_register_style( 'wplc-admin-style', plugins_url( '/css/jquery-ui.css', __FILE__ ), false, $wplc_version );
|
3844 |
-
wp_enqueue_style( 'wplc-admin-style' );
|
3845 |
-
wp_register_style( 'wplc-chat-style', plugins_url( '/css/chat-style.css', __FILE__ ), false, $wplc_version );
|
3846 |
-
wp_enqueue_style( 'wplc-chat-style' );
|
3847 |
-
wp_register_style( 'wplc-font-awesome', plugins_url( '/css/font-awesome.min.css', __FILE__ ), false, $wplc_version );
|
3848 |
-
wp_enqueue_style( 'wplc-font-awesome' );
|
3849 |
-
wp_enqueue_script( 'jquery-ui-core' );
|
3850 |
-
wp_enqueue_script( 'jquery-effects-core' );
|
3851 |
-
}
|
3852 |
-
if (isset($_GET['page']) && $_GET['page'] == 'wplivechat-menu' && isset($_GET['action']) && $_GET['action'] == "ac") {
|
3853 |
-
wp_register_style('wplc-admin-chat-box-style', plugins_url('/css/admin-chat-box-style.css', __FILE__ ), false, $wplc_version );
|
3854 |
-
wp_enqueue_style('wplc-admin-chat-box-style');
|
3855 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3856 |
}
|
|
|
3857 |
if (isset($_GET['page']) && $_GET['page'] == "wplivechat-menu-support-page") {
|
3858 |
wp_register_style('fontawesome', plugins_url('css/font-awesome.min.css', __FILE__ ), false, $wplc_version );
|
3859 |
wp_enqueue_style('fontawesome');
|
3860 |
wp_register_style('wplc-support-page-css', plugins_url('css/support-css.css', __FILE__ ), false, $wplc_version );
|
3861 |
wp_enqueue_style('wplc-support-page-css');
|
3862 |
}
|
|
|
|
|
|
|
|
|
|
|
3863 |
}
|
3864 |
|
3865 |
-
if (isset($_GET['page']) && ( $_GET['page'] == 'wplivechat-menu-settings' || $_GET['page'] === 'wplivechat-menu-offline-messages' ) ) {
|
3866 |
add_action('admin_print_scripts', 'wplc_admin_scripts_basic');
|
3867 |
}
|
|
|
3868 |
/**
|
3869 |
* Loads the admin scripts for the chat dashboard and settings pages
|
3870 |
* @return void
|
3871 |
*/
|
3872 |
function wplc_admin_scripts_basic() {
|
3873 |
-
global $wplc_version;
|
3874 |
-
$ajax_nonce = wp_create_nonce("wplc");
|
3875 |
-
$ajaxurl = admin_url('admin-ajax.php');
|
3876 |
-
|
3877 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3878 |
if (isset($_GET['page']) && $_GET['page'] == "wplivechat-menu-settings") {
|
3879 |
wp_enqueue_script('jquery');
|
3880 |
wp_enqueue_script('jquery-ui-core');
|
3881 |
-
wp_enqueue_script('jquery-ui-tooltip');
|
3882 |
wp_register_script('my-wplc-color', plugins_url('js/jscolor.js', __FILE__), false, '1.4.1', false);
|
3883 |
wp_enqueue_script('my-wplc-color');
|
3884 |
wp_enqueue_script('jquery-ui-tabs');
|
3885 |
wp_register_script('my-wplc-tabs', plugins_url('js/wplc_tabs.js', __FILE__), array('jquery-ui-core'), '', true);
|
3886 |
wp_enqueue_script('my-wplc-tabs');
|
|
|
|
|
|
|
|
|
|
|
|
|
3887 |
}
|
|
|
|
|
|
|
|
|
|
|
3888 |
|
3889 |
-
|
3890 |
-
wp_register_script('wplc-admin-offline-js', plugins_url('js/wplc_offline_messages.js', __FILE__), false, $wplc_version, false);
|
3891 |
-
wp_enqueue_script('wplc-admin-offline-js');
|
3892 |
-
wp_localize_script('wplc-admin-offline-js', 'wplc_ajax_nonce', $ajax_nonce);
|
3893 |
-
wp_localize_script('wplc-admin-offline-js', 'wplc_ajaxurl', $ajaxurl);
|
3894 |
-
|
3895 |
-
}
|
3896 |
}
|
|
|
3897 |
/**
|
3898 |
* Loads basic version's settings page
|
3899 |
* @return void
|
@@ -3937,19 +4254,20 @@ add_action( 'wplc_hook_admin_menu_layout_display' , 'wplc_hook_control_history_g
|
|
3937 |
* @author Nick Duncan <nick@codecabin.co.za>
|
3938 |
*/
|
3939 |
function wplc_hook_control_history_get_control($action,$cid,$aid) {
|
3940 |
-
if(!is_user_logged_in() || !get_user_meta(get_current_user_id(), 'wplc_ma_agent', true) ){
|
3941 |
-
return;
|
3942 |
-
}
|
3943 |
-
if ($action == 'history') {
|
3944 |
-
wplc_admin_view_chat_history(sanitize_text_field($cid));
|
3945 |
-
} else if ($action == 'download_history'){
|
3946 |
-
|
3947 |
-
//Moved into the init hook as of version 6.0.01 due to different functionality
|
3948 |
-
|
3949 |
-
//wplc_admin_download_history(sanitize_text_field($_GET['type']), sanitize_text_field($cid));
|
3950 |
-
}
|
3951 |
|
3952 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3953 |
}
|
3954 |
|
3955 |
|
@@ -3970,13 +4288,12 @@ function wplc_hook_control_chat_history() {
|
|
3970 |
//Confirmed - delete
|
3971 |
$delete_sql = "
|
3972 |
DELETE FROM $wplc_tblname_chats
|
3973 |
-
WHERE `id` = '".intval($_GET['cid'])."'
|
3974 |
-
AND (`status` = 1 OR `status` = 8)
|
3975 |
";
|
3976 |
-
|
3977 |
|
3978 |
$wpdb->query($delete_sql);
|
3979 |
-
if ($wpdb->last_error) {
|
3980 |
echo "<div class='update-nag' style='margin-top: 0px;margin-bottom: 5px;'>
|
3981 |
".__("Error: Could not delete chat", "wplivechat")."<br>
|
3982 |
</div>";
|
@@ -3984,7 +4301,7 @@ function wplc_hook_control_chat_history() {
|
|
3984 |
echo "<div class='update-nag' style='margin-top: 0px;margin-bottom: 5px;border-color:#67d552;'>
|
3985 |
".__("Chat Deleted", "wplivechat")."<br>
|
3986 |
</div>";
|
3987 |
-
}
|
3988 |
|
3989 |
} else {
|
3990 |
//Prompt
|
@@ -3997,11 +4314,11 @@ function wplc_hook_control_chat_history() {
|
|
3997 |
}
|
3998 |
|
3999 |
|
4000 |
-
|
4001 |
"
|
4002 |
SELECT *
|
4003 |
FROM $wplc_tblname_chats
|
4004 |
-
WHERE `
|
4005 |
ORDER BY `timestamp` DESC
|
4006 |
"
|
4007 |
);
|
@@ -4061,7 +4378,7 @@ function wplc_hook_control_chat_history() {
|
|
4061 |
function wplc_admin_history_layout() {
|
4062 |
wplc_stats("history");
|
4063 |
echo"<div class=\"wrap\"><div id=\"icon-edit\" class=\"icon32 icon32-posts-post\"><br></div><h2>" . __("WP Live Chat History", "wplivechat") . "</h2>";
|
4064 |
-
|
4065 |
|
4066 |
if(function_exists("wplc_ce_activate")){
|
4067 |
wplc_ce_admin_display_history();
|
@@ -4075,7 +4392,7 @@ function wplc_admin_history_layout() {
|
|
4075 |
|
4076 |
add_action("wplc_hook_chat_missed","wplc_hook_control_missed_chats",10);
|
4077 |
/**
|
4078 |
-
* Loads missed chats contents
|
4079 |
* @return string
|
4080 |
*/
|
4081 |
function wplc_hook_control_missed_chats() {
|
@@ -4089,7 +4406,7 @@ function wplc_hook_control_missed_chats() {
|
|
4089 |
function wplc_admin_missed_chats() {
|
4090 |
wplc_stats("missed");
|
4091 |
echo "<div class=\"wrap\"><div id=\"icon-edit\" class=\"icon32 icon32-posts-post\"><br></div><h2>" . __("WP Live Chat Missed Chats", "wplivechat") . "</h2>";
|
4092 |
-
do_action("wplc_hook_chat_missed");
|
4093 |
}
|
4094 |
|
4095 |
add_action("wplc_hook_offline_messages_display","wplc_hook_control_offline_messages_display",10);
|
@@ -4145,7 +4462,7 @@ function wplc_admin_display_offline_messages_new() {
|
|
4145 |
<tbody id=\"the-list\" class='list:wp_list_text_link'>";
|
4146 |
|
4147 |
$sql = "SELECT * FROM $wplc_tblname_offline_msgs ORDER BY `timestamp` DESC";
|
4148 |
-
|
4149 |
$results = $wpdb->get_results($sql);
|
4150 |
|
4151 |
if (!$results) {
|
@@ -4240,7 +4557,7 @@ add_filter("wplc_filter_chat_header_extra_attr","wplc_filter_control_chat_header
|
|
4240 |
function wplc_filter_control_chat_header_extra_attr($wplc_extra_attr) {
|
4241 |
$wplc_acbc_data = get_option("WPLC_SETTINGS");
|
4242 |
if (isset($wplc_acbc_data['wplc_auto_pop_up'])) { $extr_string = $wplc_acbc_data['wplc_auto_pop_up']; $wplc_extra_attr .= " wplc-auto-pop-up=\"".$extr_string."\""; }
|
4243 |
-
|
4244 |
return $wplc_extra_attr;
|
4245 |
}
|
4246 |
|
@@ -4249,17 +4566,16 @@ function wplc_filter_control_chat_header_extra_attr($wplc_extra_attr) {
|
|
4249 |
* @return string
|
4250 |
*/
|
4251 |
function wplc_head_basic() {
|
4252 |
-
if(!is_user_logged_in() || !get_user_meta(get_current_user_id(), 'wplc_ma_agent', true) ){
|
4253 |
-
|
4254 |
-
|
4255 |
-
|
4256 |
global $wpdb;
|
4257 |
|
4258 |
do_action("wplc_hook_head");
|
4259 |
|
4260 |
|
4261 |
if (isset($_POST['wplc_save_settings'])) {
|
4262 |
-
|
4263 |
do_action("wplc_hook_admin_settings_save");
|
4264 |
if (isset($_POST['wplc_settings_align'])) { $wplc_data['wplc_settings_align'] = esc_attr($_POST['wplc_settings_align']); }
|
4265 |
if (isset($_POST['wplc_settings_bg'])) { $wplc_data['wplc_settings_bg'] = esc_attr($_POST['wplc_settings_bg']); }
|
@@ -4280,12 +4596,14 @@ function wplc_head_basic() {
|
|
4280 |
if (isset($_POST['wplc_loggedin_user_info'])) { $wplc_data['wplc_loggedin_user_info'] = esc_attr($_POST['wplc_loggedin_user_info']); } else { $wplc_data['wplc_loggedin_user_info'] = "0"; }
|
4281 |
if (isset($_POST['wplc_user_alternative_text']) && $_POST['wplc_user_alternative_text'] != '') { $wplc_data['wplc_user_alternative_text'] = esc_attr($_POST['wplc_user_alternative_text']); } else { $wplc_data['wplc_user_alternative_text'] = __("Please click 'Start Chat' to initiate a chat with an agent", "wplivechat"); }
|
4282 |
if (isset($_POST['wplc_enabled_on_mobile'])) { $wplc_data['wplc_enabled_on_mobile'] = esc_attr($_POST['wplc_enabled_on_mobile']); } else { $wplc_data['wplc_enabled_on_mobile'] = "0"; }
|
4283 |
-
if (isset($_POST['wplc_display_name'])) { $wplc_data['wplc_display_name'] = esc_attr($_POST['wplc_display_name']); }
|
4284 |
if (isset($_POST['wplc_display_to_loggedin_only'])) { $wplc_data['wplc_display_to_loggedin_only'] = esc_attr($_POST['wplc_display_to_loggedin_only']); }
|
4285 |
|
4286 |
if (isset($_POST['wplc_redirect_to_thank_you_page'])) { $wplc_data['wplc_redirect_to_thank_you_page'] = esc_attr($_POST['wplc_redirect_to_thank_you_page']); }
|
4287 |
if (isset($_POST['wplc_redirect_thank_you_url'])) { $wplc_data['wplc_redirect_thank_you_url'] = urlencode(str_replace("https:", "", str_replace("http:", "", $_POST['wplc_redirect_thank_you_url']) ) ); }
|
4288 |
-
|
|
|
|
|
4289 |
if(isset($_POST['wplc_record_ip_address'])){ $wplc_data['wplc_record_ip_address'] = esc_attr($_POST['wplc_record_ip_address']); } else { $wplc_data['wplc_record_ip_address'] = "0"; }
|
4290 |
if(isset($_POST['wplc_enable_msg_sound'])){ $wplc_data['wplc_enable_msg_sound'] = esc_attr($_POST['wplc_enable_msg_sound']); } else { $wplc_data['wplc_enable_msg_sound'] = "0"; }
|
4291 |
if(isset($_POST['wplc_enable_font_awesome'])){ $wplc_data['wplc_enable_font_awesome'] = esc_attr($_POST['wplc_enable_font_awesome']); } else { $wplc_data['wplc_enable_font_awesome'] = "0"; }
|
@@ -4312,7 +4630,7 @@ function wplc_head_basic() {
|
|
4312 |
if (isset($_POST['wplc_pro_sst1_survey'])) { $wplc_data['wplc_pro_sst1_survey'] = esc_attr($_POST['wplc_pro_sst1_survey']); }
|
4313 |
if (isset($_POST['wplc_pro_sst1e_survey'])) { $wplc_data['wplc_pro_sst1e_survey'] = esc_attr($_POST['wplc_pro_sst1e_survey']); }
|
4314 |
if (isset($_POST['wplc_pro_sst2'])) { $wplc_data['wplc_pro_sst2'] = esc_attr($_POST['wplc_pro_sst2']); }
|
4315 |
-
if (isset($_POST['wplc_pro_tst1'])) { $wplc_data['wplc_pro_tst1'] = esc_attr($_POST['wplc_pro_tst1']); }
|
4316 |
if (isset($_POST['wplc_pro_intro'])) { $wplc_data['wplc_pro_intro'] = esc_attr($_POST['wplc_pro_intro']); }
|
4317 |
if (isset($_POST['wplc_user_enter'])) { $wplc_data['wplc_user_enter'] = esc_attr($_POST['wplc_user_enter']); }
|
4318 |
if (isset($_POST['wplc_text_chat_ended'])) { $wplc_data['wplc_text_chat_ended'] = esc_attr($_POST['wplc_text_chat_ended']); }
|
@@ -4321,7 +4639,7 @@ function wplc_head_basic() {
|
|
4321 |
if (isset($_POST['wplc_welcome_msg'])) { $wplc_data['wplc_welcome_msg'] = esc_attr($_POST['wplc_welcome_msg']); }
|
4322 |
|
4323 |
|
4324 |
-
if(isset($_POST['wplc_animation'])){ $wplc_data['wplc_animation'] = esc_attr($_POST['wplc_animation']); }
|
4325 |
if(isset($_POST['wplc_theme'])){ $wplc_data['wplc_theme'] = esc_attr($_POST['wplc_theme']); }
|
4326 |
if(isset($_POST['wplc_newtheme'])){ $wplc_data['wplc_newtheme'] = esc_attr($_POST['wplc_newtheme']); }
|
4327 |
|
@@ -4329,7 +4647,7 @@ function wplc_head_basic() {
|
|
4329 |
if(isset($_POST['wplc_elem_trigger_type'])){ $wplc_data['wplc_elem_trigger_type'] = esc_attr($_POST['wplc_elem_trigger_type']); } else { $wplc_data['wplc_elem_trigger_type'] = "0";}
|
4330 |
if(isset($_POST['wplc_elem_trigger_id'])){ $wplc_data['wplc_elem_trigger_id'] = esc_attr($_POST['wplc_elem_trigger_id']); } else { $wplc_data['wplc_elem_trigger_id'] = ""; }
|
4331 |
|
4332 |
-
if(isset($_POST['wplc_agent_select']) && $_POST['wplc_agent_select'] != "") {
|
4333 |
$user_array = get_users(array(
|
4334 |
'meta_key' => 'wplc_ma_agent',
|
4335 |
));
|
@@ -4342,8 +4660,8 @@ function wplc_head_basic() {
|
|
4342 |
delete_user_meta($uid, "wplc_chat_agent_online");
|
4343 |
}
|
4344 |
}
|
4345 |
-
|
4346 |
-
|
4347 |
$uid = intval($_POST['wplc_agent_select']);
|
4348 |
$wplc_ma_user = new WP_User( $uid );
|
4349 |
$wplc_ma_user->add_cap( 'wplc_ma_agent' );
|
@@ -4352,7 +4670,7 @@ function wplc_head_basic() {
|
|
4352 |
|
4353 |
}
|
4354 |
|
4355 |
-
|
4356 |
if(isset($_POST['wplc_ban_users_ip'])){
|
4357 |
$wplc_banned_ip_addresses = explode('<br />', nl2br(sanitize_text_field($_POST['wplc_ban_users_ip'])));
|
4358 |
foreach($wplc_banned_ip_addresses as $key => $value) {
|
@@ -4392,9 +4710,6 @@ function wplc_head_basic() {
|
|
4392 |
update_option('wplc_mail_username', $_POST['wplc_mail_username']);
|
4393 |
update_option('wplc_mail_password', $_POST['wplc_mail_password']);
|
4394 |
|
4395 |
-
|
4396 |
-
|
4397 |
-
|
4398 |
echo "<div class='updated wplc_settings_save_notice' style='display: none;'>";
|
4399 |
_e("Your settings have been saved.", "wplivechat");
|
4400 |
echo "</div>";
|
@@ -4415,7 +4730,7 @@ function wplc_head_basic() {
|
|
4415 |
wp_redirect( admin_url("/admin.php?page=wplivechat-menu&override=1") );
|
4416 |
}
|
4417 |
if( isset( $_GET['override'] ) && $_GET['override'] == '1' ){
|
4418 |
-
update_option( "
|
4419 |
}
|
4420 |
if (isset($_POST['wplc_nl_send_feedback'])) {
|
4421 |
if (wp_mail("nick@wp-livechat.com", "Plugin feedback", "Name: " . $_POST['wplc_nl_feedback_name'] . "\n\r" . "Email: " . $_POST['wplc_nl_feedback_email'] . "\n\r" . "Website: " . $_POST['wplc_nl_feedback_website'] . "\n\r" . "Feedback:" . $_POST['wplc_nl_feedback_feedback'])) {
|
@@ -4476,11 +4791,11 @@ if(isset($_GET['page']) && $_GET['page'] == 'wplivechat-menu-settings'){
|
|
4476 |
if(is_admin()){
|
4477 |
$wplc_error_count = 0;
|
4478 |
$wplc_admin_warnings = "<div class='error'>";
|
4479 |
-
if(!function_exists('set_time_limit')){
|
4480 |
$wplc_admin_warnings .= "
|
4481 |
<p>".__("WPLC: set_time_limit() is not enabled on this server. You may experience issues while using WP Live Chat Support as a result of this. Please get in contact your host to get this function enabled.", "wplivechat")."</p>
|
4482 |
";
|
4483 |
-
$wplc_error_count++;
|
4484 |
}
|
4485 |
if(ini_get('safe_mode')){
|
4486 |
$wplc_admin_warnings .= "
|
@@ -4513,11 +4828,11 @@ function wplc_extensions_menu() {
|
|
4513 |
<h2 class="nav-tab-wrapper">
|
4514 |
<a href="admin.php?page=wplivechat-menu-extensions-page" title="<?php _e("Add-ons","wplivechat"); ?>" class="nav-tab <?php echo $normal; ?>"><?php _e("Add-ons","wplivechat"); ?></a><a href="admin.php?page=wplivechat-menu-extensions-page&type=additional" title="<?php _e("Suggested Plugins","wplivechat"); ?>" class="nav-tab <?php echo $additional; ?>"><?php _e("Suggested Plugins","wplivechat"); ?></a>
|
4515 |
<span style='float: right; bottom:-5px; position: relative;'><img src='<?php echo plugins_url('/images/codecabin.png', __FILE__); ?>' style="height:15px;" /></span>
|
4516 |
-
</h2>
|
4517 |
<div id="tab_container">
|
4518 |
|
4519 |
|
4520 |
-
<?php
|
4521 |
if (isset($_GET['type']) && $_GET['type'] == "additional") {
|
4522 |
?>
|
4523 |
|
@@ -4544,7 +4859,7 @@ function wplc_extensions_menu() {
|
|
4544 |
</div>
|
4545 |
|
4546 |
|
4547 |
-
<?php } else {
|
4548 |
$filter1 = "all";
|
4549 |
$filter2 = "all";
|
4550 |
|
@@ -4587,11 +4902,11 @@ function wplc_extensions_menu() {
|
|
4587 |
|
4588 |
$response = wp_remote_post( "https://ccplugins.co/api-wplc-extensions", array(
|
4589 |
'method' => 'POST',
|
4590 |
-
'body' => array(
|
4591 |
'action' => 'extensions',
|
4592 |
'filter1' => $filter1,
|
4593 |
'filter2' => $filter2
|
4594 |
-
)
|
4595 |
)
|
4596 |
);
|
4597 |
if(is_array($response) && isset($response['body'])){
|
@@ -4627,7 +4942,7 @@ function wplc_extensions_menu() {
|
|
4627 |
}
|
4628 |
?>
|
4629 |
|
4630 |
-
|
4631 |
|
4632 |
<?php } ?>
|
4633 |
|
@@ -4641,7 +4956,7 @@ function wplc_extensions_menu() {
|
|
4641 |
*/
|
4642 |
function wplc_support_menu() {
|
4643 |
wplc_stats("support");
|
4644 |
-
?>
|
4645 |
<h1><?php _e("WP Live Chat Support","wplivechat"); ?></h1>
|
4646 |
<div class="wplc_row">
|
4647 |
<div class='wplc_row_col' style='background-color:#FFF;'>
|
@@ -4653,7 +4968,7 @@ function wplc_support_menu() {
|
|
4653 |
<li><a href='https://wp-livechat.com/documentation/minimum-system-requirements/' target='_BLANK' title='<?php _e("Minimum System Requirements","wplivechat"); ?>'><?php _e("Minimum System Requirements","wplivechat"); ?></a></li>
|
4654 |
<li><a href='https://wp-livechat.com/documentation/do-i-have-to-be-logged-into-the-dashboard-to-chat-with-visitors/' target='_BLANK' title='<?php _e("Do I have to be logged into the dashboard to chat with visitors?","wplivechat"); ?>'><?php _e("Do I have to be logged into the dashboard to chat with visitors?","wplivechat"); ?></a></li>
|
4655 |
<li><a href='https://wp-livechat.com/documentation/what-are-quick-responses/' target='_BLANK' title='<?php _e("What are Quick Responses?","wplivechat"); ?>'><?php _e("What are Quick Responses?","wplivechat"); ?></a></li>
|
4656 |
-
<li><a href='https://wp-livechat.com/documentation/
|
4657 |
<li><a href='https://wp-livechat.com/documentation/how-do-i-disable-apc-object-cache/' target='_BLANK' title='<?php _e("How do I disable APC Object Cache?","wplivechat"); ?>'><?php _e("How do I disable APC Object Cache?","wplivechat"); ?></a></li>
|
4658 |
<li><a href='https://wp-livechat.com/documentation/do-you-have-a-mobile-app/' target='_BLANK' title='<?php _e("Do you have a mobile app?","wplivechat"); ?>'><?php _e("Do you have a mobile app?","wplivechat"); ?></a></li>
|
4659 |
<li><a href='https://wp-livechat.com/documentation/how-do-i-check-for-javascript-errors-on-my-site/' target='_BLANK' title='<?php _e("How do I check for JavaScript errors on my site?","wplivechat"); ?>'><?php _e("How do I check for JavaScript errors on my site?","wplivechat"); ?></a></li>
|
@@ -4694,23 +5009,42 @@ if (!function_exists("wplc_ic_initiate_chat_button")) {
|
|
4694 |
* @return string contents ofthe pointers and their scripts
|
4695 |
*/
|
4696 |
function wp_button_pointers_load_scripts($hook) {
|
4697 |
-
|
4698 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4699 |
|
4700 |
|
4701 |
-
|
4702 |
-
|
4703 |
-
|
4704 |
-
|
4705 |
-
|
4706 |
-
|
4707 |
-
|
4708 |
-
|
4709 |
-
|
4710 |
-
|
4711 |
-
|
4712 |
-
|
4713 |
-
|
|
|
|
|
|
|
|
|
|
|
4714 |
}
|
4715 |
|
4716 |
add_filter( 'admin_footer_text', 'wplc_footer_mod' );
|
@@ -4726,7 +5060,7 @@ function wplc_footer_mod( $footer_text ) {
|
|
4726 |
'https://wordpress.org/support/view/plugin-reviews/wp-live-chat-support?filter=5#postform'
|
4727 |
);
|
4728 |
|
4729 |
-
return str_replace( '</span>', '', $footer_text ) . ' | ' . $footer_text_mod . ' | ' . __('WP Live Chat Support is a product of','wplivechat') . ' <a target="_BLANK" href="http://codecabin.co.za/?utm_source=livechat&utm_medium=link&utm_campaign=footer" border="0"><img src="'.plugins_url('/images/codecabin.png', __FILE__).'" style="height:10px;"/></span>';
|
4730 |
} else {
|
4731 |
return $footer_text;
|
4732 |
}
|
@@ -4760,17 +5094,17 @@ function wplc_filter_control_wplc_admin_long_poll_chat_iteration($array,$post_da
|
|
4760 |
if($new_chat_status != $post_data['chat_status']){
|
4761 |
$array['chat_status'] = $new_chat_status;
|
4762 |
$array['action'] = "wplc_update_chat_status";
|
4763 |
-
}
|
4764 |
$new_chat_message = wplc_return_admin_chat_messages(sanitize_text_field($post_data['cid']));
|
4765 |
-
|
4766 |
if($new_chat_message){
|
4767 |
-
|
4768 |
$array['chat_message'] = $new_chat_message;
|
4769 |
$array['action'] = "wplc_new_chat_message";
|
4770 |
}
|
4771 |
}
|
4772 |
}
|
4773 |
-
|
4774 |
return $array;
|
4775 |
}
|
4776 |
|
@@ -4800,7 +5134,7 @@ function wplc_hook_control_agents_settings() {
|
|
4800 |
$default_agent_id = $user->ID;
|
4801 |
$default_agent_user = $user->display_name;
|
4802 |
$wplc_agents .= "<h3>" . $user->display_name . "</h3>";
|
4803 |
-
|
4804 |
$wplc_agents .= "<small>" . $user->user_email . "</small>";
|
4805 |
|
4806 |
|
@@ -4815,7 +5149,7 @@ function wplc_hook_control_agents_settings() {
|
|
4815 |
$blogusers = get_users( array( 'role' => 'administrator', 'fields' => array( 'display_name','id','user_email' ) ) );
|
4816 |
if ($blogusers) {
|
4817 |
foreach ( $blogusers as $user ) {
|
4818 |
-
$is_agent = get_user_meta(esc_html( $user->id ), 'wplc_ma_agent', true);
|
4819 |
$temp_line2 = '<option id="wplc_selected_agent_'. esc_html( $user->id ) .'" value="' . esc_html( $user->id ) . '">' . esc_html( $user->display_name ) . ' ('.__('Administrator','wplivechat').')</option>';
|
4820 |
if(!$is_agent){ $temp_line .= $temp_line2; }
|
4821 |
}
|
@@ -4824,7 +5158,7 @@ function wplc_hook_control_agents_settings() {
|
|
4824 |
$blogusers = get_users( array( 'role' => 'editor', 'fields' => array( 'display_name','id','user_email' ) ) );
|
4825 |
if ($blogusers) {
|
4826 |
foreach ( $blogusers as $user ) {
|
4827 |
-
$is_agent = get_user_meta(esc_html( $user->id ), 'wplc_ma_agent', true);
|
4828 |
$temp_line2 = '<option id="wplc_selected_agent_'. esc_html( $user->id ) .'" value="' . esc_html( $user->id ) . '">' . esc_html( $user->display_name ) . ' ('.__('Editor','wplivechat').')</option>';
|
4829 |
if(!$is_agent){ $temp_line .= $temp_line2; }
|
4830 |
}
|
@@ -4833,7 +5167,7 @@ function wplc_hook_control_agents_settings() {
|
|
4833 |
$blogusers = get_users( array( 'role' => 'author', 'fields' => array( 'display_name','id','user_email' ) ) );
|
4834 |
if ($blogusers) {
|
4835 |
foreach ( $blogusers as $user ) {
|
4836 |
-
$is_agent = get_user_meta(esc_html( $user->id ), 'wplc_ma_agent', true);
|
4837 |
$temp_line2 = '<option id="wplc_selected_agent_'. esc_html( $user->id ) .'" value="' . esc_html( $user->id ) . '">' . esc_html( $user->display_name ) . ' ('.__('Author','wplivechat').')</option>';
|
4838 |
if(!$is_agent){ $temp_line .= $temp_line2; }
|
4839 |
}
|
@@ -4847,7 +5181,7 @@ function wplc_hook_control_agents_settings() {
|
|
4847 |
<p><i class='fa fa-plus-circle fa-4x' style='color:#ccc;' ></i></p>
|
4848 |
<h3><?php _e("Add New Agent","wplivechat"); ?></h3>
|
4849 |
<p><button class='button button-secondary' id='wplc_add_agent' disabled style=><?php _e("Add Agent","wplivechat"); ?></button></p>
|
4850 |
-
<p style='font-size:0.8em'><?php _e("Add as many agents as you need with the ","wplivechat") ?> <a href="
|
4851 |
</li>
|
4852 |
</ul>
|
4853 |
<?php
|
@@ -4859,7 +5193,7 @@ function wplc_hook_control_agents_settings() {
|
|
4859 |
?>
|
4860 |
|
4861 |
</div>
|
4862 |
-
|
4863 |
<hr/>
|
4864 |
<?php
|
4865 |
}
|
@@ -4877,13 +5211,13 @@ function wplc_get_chat_data($cid,$line = false) {
|
|
4877 |
|
4878 |
add_filter( "wplc_filter_get_chat_data", "wplc_get_local_chat_data", 10, 2 );
|
4879 |
function wplc_get_local_chat_data($result, $cid) {
|
4880 |
-
global $wpdb;
|
4881 |
global $wplc_tblname_chats;
|
4882 |
|
4883 |
$sql = "SELECT * FROM $wplc_tblname_chats WHERE `id` = '".intval($cid)."' LIMIT 1";
|
4884 |
$results = $wpdb->get_results($sql);
|
4885 |
if (isset($results[0])) { $result = $results[0]; } else { $result = null; }
|
4886 |
-
|
4887 |
return $result;
|
4888 |
|
4889 |
}
|
@@ -4894,56 +5228,62 @@ function wplc_get_local_chat_data($result, $cid) {
|
|
4894 |
* @return array Chat messages based on the ID provided
|
4895 |
*/
|
4896 |
function wplc_get_chat_messages($cid, $only_read_messages = false, $wplc_settings = false) {
|
4897 |
-
global $wpdb;
|
4898 |
global $wplc_tblname_msgs;
|
4899 |
|
4900 |
if (!$wplc_settings) {
|
4901 |
-
|
4902 |
}
|
4903 |
|
4904 |
/**
|
4905 |
* Identify if the user is using the node server and if they are, display all messages. Otherwise display read only messages (non-node users)
|
4906 |
*/
|
4907 |
if (isset($wplc_settings['wplc_use_node_server']) && $wplc_settings['wplc_use_node_server'] == '1') {
|
4908 |
-
|
4909 |
-
|
4910 |
-
|
4911 |
-
|
4912 |
-
|
4913 |
-
|
4914 |
-
|
4915 |
-
|
4916 |
-
|
4917 |
-
|
4918 |
-
|
4919 |
-
|
4920 |
-
|
4921 |
-
|
4922 |
-
|
4923 |
-
|
4924 |
-
|
4925 |
-
|
4926 |
-
|
4927 |
-
|
4928 |
-
|
4929 |
-
|
4930 |
-
|
4931 |
-
|
4932 |
-
|
4933 |
-
|
4934 |
-
|
4935 |
-
|
4936 |
-
|
4937 |
-
|
4938 |
-
|
4939 |
-
|
4940 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
4941 |
if (isset($results[0])) { } else { $results = null; }
|
4942 |
$results = apply_filters("wplc_filter_get_chat_messages",$results,$cid);
|
4943 |
-
|
4944 |
if ($results == "null") {
|
4945 |
return false;
|
4946 |
-
} else {
|
4947 |
return $results;
|
4948 |
}
|
4949 |
}
|
@@ -4957,41 +5297,41 @@ function wplc_get_chat_messages($cid, $only_read_messages = false, $wplc_setting
|
|
4957 |
function wplc_build_api_check($page_content, $data) {
|
4958 |
$link = "#";
|
4959 |
$image = "https://ccplugins.co/api-wplc-extensions/images/add-on0.jpg";
|
4960 |
-
if ($data['string'] == "Multiple Agents") {
|
4961 |
$link = "";
|
4962 |
$image = "https://ccplugins.co/api-wplc-extensions/images/Agents-Small.jpg";
|
4963 |
}
|
4964 |
-
if ($data['string'] == "Cloud Server") {
|
4965 |
$link = "";
|
4966 |
$image = "https://ccplugins.co/api-wplc-extensions/images/Cloud-Small.jpg";
|
4967 |
}
|
4968 |
-
if ($data['string'] == "Advanced Chat Box Control") {
|
4969 |
$link = "https://wp-livechat.com/extensions/advanced-chat-control/";
|
4970 |
$image = "https://ccplugins.co/api-wplc-extensions/images/AdvancedChatBox-Small.jpg";
|
4971 |
-
}
|
4972 |
-
if ($data['string'] == "Choose When Online") {
|
4973 |
$link = "";
|
4974 |
$image = "https://ccplugins.co/api-wplc-extensions/images/ChooseOnline-Small.jpg";
|
4975 |
-
}
|
4976 |
-
if ($data['string'] == "Encryption") {
|
4977 |
$link = "";
|
4978 |
$image = "https://ccplugins.co/api-wplc-extensions/images/Encryption-Small.jpg";
|
4979 |
-
}
|
4980 |
-
if ($data['string'] == "Mobile and Desktop App") {
|
4981 |
$link = "";
|
4982 |
$image = "https://ccplugins.co/api-wplc-extensions/images/MobileDesktop-Small.jpg";
|
4983 |
-
}
|
4984 |
-
if ($data['string'] == "Initiate Chats") {
|
4985 |
$link = "";
|
4986 |
$image = "https://ccplugins.co/api-wplc-extensions/images/InitiateChat-Small.jpg";
|
4987 |
-
}
|
4988 |
-
if ($data['string'] == "Include Exclude Pages") {
|
4989 |
$link = "";
|
4990 |
$image = "https://ccplugins.co/api-wplc-extensions/images/IncludeAndExclude-Small.jpg";
|
4991 |
-
}
|
4992 |
|
4993 |
|
4994 |
-
if ($data['string'] == "WP Live Chat Support Pro") {
|
4995 |
$link = "";
|
4996 |
$image = "https://ccplugins.co/api-wplc-extensions/images/add-on0.jpg";
|
4997 |
}
|
@@ -5048,7 +5388,7 @@ add_filter("wplc_filter_relevant_extensions_main","wplc_filter_control_relevant_
|
|
5048 |
*/
|
5049 |
function wplc_filter_control_relevant_extensions_main_proe($text) {
|
5050 |
if (function_exists("wplc_hook_control_intiate_check")) { return $text; }
|
5051 |
-
|
5052 |
$rel_name = __("Pro Add-on","wplivechat");
|
5053 |
$rel_image = "https://ccplugins.co/api-wplc-extensions/images/add-on0.jpg";
|
5054 |
$rel_link = "http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=relevant_pro";
|
@@ -5075,7 +5415,7 @@ add_filter("wplc_filter_relevant_extensions_main","wplc_filter_control_relevant_
|
|
5075 |
*/
|
5076 |
function wplc_filter_control_relevant_extensions_main_mobile($text) {
|
5077 |
if (function_exists("wplc_mobile_check_if_logged_in")) { return $text; }
|
5078 |
-
|
5079 |
$rel_name = __("Mobile & Desktop App","wplivechat");
|
5080 |
$rel_image = "https://ccplugins.co/api-wplc-extensions/images/MobileDesktop-Icon.jpg";
|
5081 |
$rel_link = "https://wp-livechat.com/extensions/mobile-desktop-app-extension/?utm_source=plugin&utm_medium=link&utm_campaign=relevant_mobile";
|
@@ -5093,31 +5433,6 @@ function wplc_filter_control_relevant_extensions_main_mobile($text) {
|
|
5093 |
return $text;
|
5094 |
}
|
5095 |
|
5096 |
-
add_filter("wplc_filter_relevant_extensions_main","wplc_filter_control_relevant_extensions_main_cloud");
|
5097 |
-
/**
|
5098 |
-
* Loads additional extension data for the Cloud Server Extension
|
5099 |
-
* @param string $text Current extensions page content
|
5100 |
-
* @return string Extensions page content with Cloud Server extension data
|
5101 |
-
*/
|
5102 |
-
function wplc_filter_control_relevant_extensions_main_cloud($text) {
|
5103 |
-
if (function_exists("wplc_cloud_filter_control_chat_messages")) { return $text; }
|
5104 |
-
|
5105 |
-
$rel_name = __("Cloud Server","wplivechat");
|
5106 |
-
$rel_image = "https://ccplugins.co/api-wplc-extensions/images/Cloud-Icon.jpg";
|
5107 |
-
$rel_link = "https://wp-livechat.com/extensions/cloud-server-extension/?utm_source=plugin&utm_medium=link&utm_campaign=relevant_cloud";
|
5108 |
-
$text .= '<div class="wplc-extension relevant_extension">';
|
5109 |
-
$text .= '<a href="'.$rel_link.'" title="'.$rel_name.'" target="_BLANK" style="float:left;">';
|
5110 |
-
$text .= '<img src="'.$rel_image.'" class="attachment-showcase wp-post-image" alt="'.$rel_name.'" title="'.$rel_name.'" >';
|
5111 |
-
$text .= '</a>';
|
5112 |
-
$text .= '<div class="float:left; padding-left:10px;">';
|
5113 |
-
$text .= '<h3 class="wplc-extension-title">'.$rel_name.'</h3>';
|
5114 |
-
$text .= '<p>'.__("Reduce the resources required by your server - use our cloud server to host your chats.","wplivechat").'</p>';
|
5115 |
-
$text .= '</div>';
|
5116 |
-
$text .= '<a href="'.$rel_link.'" title="'.$rel_name.'" class="button-secondary" target="_BLANK">'.__("Get this extension","wplivechat").'</a>';
|
5117 |
-
$text .= '</div>';
|
5118 |
-
|
5119 |
-
return $text;
|
5120 |
-
}
|
5121 |
|
5122 |
add_filter("wplc_filter_relevant_extensions_chatbox","wplc_filter_control_relevant_extensions_chatbox_proe");
|
5123 |
/**
|
@@ -5127,7 +5442,7 @@ add_filter("wplc_filter_relevant_extensions_chatbox","wplc_filter_control_releva
|
|
5127 |
*/
|
5128 |
function wplc_filter_control_relevant_extensions_chatbox_proe($text) {
|
5129 |
if (function_exists("wplc_hook_control_intiate_check")) { return $text; }
|
5130 |
-
|
5131 |
$rel_name = __("Pro Add-on","wplivechat");
|
5132 |
$rel_image = "https://ccplugins.co/api-wplc-extensions/images/add-on0.jpg";
|
5133 |
$rel_link = "http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=relevant_pro_chatbox";
|
@@ -5200,7 +5515,7 @@ function wplc_filter_control_hovercard_bottom_before_pro($content) {
|
|
5200 |
$wplc_settings = get_option("WPLC_SETTINGS");
|
5201 |
if(isset($wplc_settings["wplc_powered_by_link"]) && $wplc_settings["wplc_powered_by_link"] == 0){
|
5202 |
|
5203 |
-
} else if(!isset($wplc_settings["wplc_powered_by_link"])) {
|
5204 |
|
5205 |
} else{
|
5206 |
$content .= "<a title='".__("Powered By WP Live Chat Support", "wplivechat")."' target='_blank' rel='nofollow' href='https://wp-livechat.com/?utm_source=poweredby&utm_medium=click&utm_campaign=".esc_html(site_url())."' class='wplc_powered_by_link'>".__("Powered By WP Live Chat Support", "wplivechat")."</a>";
|
@@ -5223,7 +5538,7 @@ function wplc_admin_download_new_chat_history(){
|
|
5223 |
if (isset($_GET['action']) && $_GET['action'] == "download_history") {
|
5224 |
|
5225 |
global $wpdb;
|
5226 |
-
|
5227 |
$chat_id = sanitize_text_field( $_GET['cid'] );
|
5228 |
$fileName = 'live_chat_history_'.$chat_id.'.csv';
|
5229 |
|
@@ -5238,7 +5553,7 @@ function wplc_admin_download_new_chat_history(){
|
|
5238 |
|
5239 |
global $wpdb;
|
5240 |
global $wplc_tblname_msgs;
|
5241 |
-
|
5242 |
$results = $wpdb->get_results(
|
5243 |
"
|
5244 |
SELECT *
|
@@ -5263,7 +5578,7 @@ function wplc_admin_download_new_chat_history(){
|
|
5263 |
} else {
|
5264 |
$user = __('agent', 'wplivechat');
|
5265 |
}
|
5266 |
-
|
5267 |
$fields[] = array(
|
5268 |
'id' => $key->chat_sess_id,
|
5269 |
'msgfrom' => $key->msgfrom,
|
@@ -5271,20 +5586,20 @@ function wplc_admin_download_new_chat_history(){
|
|
5271 |
'time' => $key->timestamp,
|
5272 |
'orig' => $user,
|
5273 |
);
|
5274 |
-
}
|
5275 |
|
5276 |
foreach($fields as $field){
|
5277 |
-
fputcsv($fh, $field, ",", '"');
|
5278 |
}
|
5279 |
// Close the file
|
5280 |
fclose($fh);
|
5281 |
// Make sure nothing else is sent, our file is done
|
5282 |
exit;
|
5283 |
-
|
5284 |
}
|
5285 |
}
|
5286 |
/**
|
5287 |
-
* Retrieves the data to start downloadling the chat history
|
5288 |
* @param string $type Chat history output type
|
5289 |
* @param string $cid Chat ID
|
5290 |
* @return void
|
@@ -5296,7 +5611,7 @@ function wplc_admin_download_history($type, $cid){
|
|
5296 |
|
5297 |
global $wpdb;
|
5298 |
global $wplc_tblname_msgs;
|
5299 |
-
|
5300 |
$results = $wpdb->get_results(
|
5301 |
"
|
5302 |
SELECT *
|
@@ -5321,7 +5636,7 @@ function wplc_admin_download_history($type, $cid){
|
|
5321 |
} else {
|
5322 |
$user = __('agent', 'wplivechat');
|
5323 |
}
|
5324 |
-
|
5325 |
$fields[] = array(
|
5326 |
'id' => $key->chat_sess_id,
|
5327 |
'msgfrom' => $key->msgfrom,
|
@@ -5329,12 +5644,12 @@ function wplc_admin_download_history($type, $cid){
|
|
5329 |
'time' => $key->timestamp,
|
5330 |
'orig' => $user,
|
5331 |
);
|
5332 |
-
}
|
5333 |
-
|
5334 |
ob_end_clean();
|
5335 |
-
|
5336 |
wplc_convert_to_csv_new($fields, 'live_chat_history_'.$cid.'.csv', ',');
|
5337 |
-
|
5338 |
exit();
|
5339 |
}
|
5340 |
|
@@ -5342,11 +5657,11 @@ function wplc_admin_download_history($type, $cid){
|
|
5342 |
* Converts contents into a CSV file
|
5343 |
* @param string $in Contents of file
|
5344 |
* @param string $out Output of file
|
5345 |
-
* @param string $del Delimiter for content
|
5346 |
* @return void
|
5347 |
*/
|
5348 |
function wplc_convert_to_csv_new($in, $out, $del){
|
5349 |
-
|
5350 |
$f = fopen('php://memory', 'w');
|
5351 |
|
5352 |
foreach ($in as $line) {
|
@@ -5356,7 +5671,7 @@ function wplc_convert_to_csv_new($in, $out, $del){
|
|
5356 |
fseek($f, 0);
|
5357 |
|
5358 |
header('Content-Type: application/csv');
|
5359 |
-
|
5360 |
header('Content-Disposition: attachement; filename="' . $out . '";');
|
5361 |
|
5362 |
fpassthru($f);
|
@@ -5383,7 +5698,7 @@ function wplc_fputcsv_eol_new($fp, $array, $del, $eol) {
|
|
5383 |
function wplc_plugin_row_invalid_api() {
|
5384 |
echo '<tr class="active"><td> </td><td colspan="2" style="color:red;">
|
5385 |
'.__('Your API Key is Invalid. You are not eligible for future updates. Please enter your API key <a href="admin.php?page=wplivechat-menu-api-keys-page">here</a>.','wplivechat').'
|
5386 |
-
</td></tr>';
|
5387 |
}
|
5388 |
|
5389 |
/**
|
@@ -5482,7 +5797,7 @@ function nifty_rating_advanced_info_upsell($msg, $cid, $name, $chat_data){
|
|
5482 |
add_filter("wplc_filter_typing_control_div","wplc_basic_filter_control_return_chat_response_box_before",2,1);
|
5483 |
function wplc_basic_filter_control_return_chat_response_box_before($string) {
|
5484 |
remove_filter("wplc_filter_typing_control_div","wplc_pro_filter_control_return_chat_response_box_before");
|
5485 |
-
$string = $string. "<div class='typing_indicator'></div>";
|
5486 |
|
5487 |
return $string;
|
5488 |
}
|
@@ -5530,7 +5845,7 @@ function wplc_hook_control_admin_settings_chat_box_settings_after() {
|
|
5530 |
<option value='2' <?php if (isset($wplc_environment[2])) { echo $wplc_environment[2]; } ?>><?php _e("Shared hosting - normal plan","wplivechat"); ?></option>
|
5531 |
<option value='3' <?php if (isset($wplc_environment[3])) { echo $wplc_environment[3]; } ?>><?php _e("VPS","wplivechat"); ?></option>
|
5532 |
<option value='4' <?php if (isset($wplc_environment[4])) { echo $wplc_environment[4]; } ?>><?php _e("Dedicated server","wplivechat"); ?></option>
|
5533 |
-
</select>
|
5534 |
</td>
|
5535 |
</tr>
|
5536 |
<tr>
|
@@ -5538,7 +5853,7 @@ function wplc_hook_control_admin_settings_chat_box_settings_after() {
|
|
5538 |
<?php _e("Long poll setup","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Only change these if you are an experienced developer or if you have received these figures from the Code Cabin Support team.", "wplivechat") ?>"></i>
|
5539 |
</td>
|
5540 |
<td valign='top'>
|
5541 |
-
<?php
|
5542 |
$wplc_advanced_settings = get_option("wplc_advanced_settings");
|
5543 |
?>
|
5544 |
<table>
|
@@ -5577,14 +5892,14 @@ function wplc_basic_reporting_page(){
|
|
5577 |
$content .= "<td style='vertical-align:top;'>";
|
5578 |
$content .= "<h3>".__('WP Live Chat Support Reporting', 'wp-livechat')."</h3>";
|
5579 |
$content .= "<p>".__('View comprehensive reports regarding your chat and agent activity.', 'wp-livechat')."</p>";
|
5580 |
-
|
5581 |
-
|
5582 |
$content .= "<br><p><strong>".__('Reports', 'wp-livechat').":</strong></p>";
|
5583 |
$content .= "<ul style='list-style: inherit;margin-left: 22px;'>";
|
5584 |
$content .= "<li>".__('Chat statistics', 'wp-livechat')."</li>";
|
5585 |
$content .= "<li>".__('Popular pages', 'wp-livechat')."</li>";
|
5586 |
$content .= "<li>".__('ROI reporting and tracking (identify which agents produce the most sales)', 'wp-livechat')."</li>";
|
5587 |
-
$content .= "<li>".__('User experience ratings (identify which agents produce the happiest customers)', 'wp-livechat')."</li>";
|
5588 |
$content .= "</ul>";
|
5589 |
|
5590 |
if (function_exists("wplc_pro_activate")) {
|
@@ -5642,14 +5957,14 @@ function wplc_basic_triggers_page(){
|
|
5642 |
$content .= "<td style='vertical-align:top;'>";
|
5643 |
$content .= "<h3>".__('WP Live Chat Support Triggers', 'wp-livechat')."</h3>";
|
5644 |
$content .= "<p>".__('Create custom data triggers when users view a certain page, spend a certain amount of time on a page, scroll past a certain point or when their mouse leaves the window.', 'wp-livechat')."</p>";
|
5645 |
-
|
5646 |
-
|
5647 |
$content .= "<br><p><strong>".__('Trigger Types', 'wp-livechat').":</strong></p>";
|
5648 |
$content .= "<ul style='list-style: inherit;margin-left: 22px;'>";
|
5649 |
$content .= "<li>".__('Page Trigger', 'wp-livechat')."</li>";
|
5650 |
$content .= "<li>".__('Time Trigger', 'wp-livechat')."</li>";
|
5651 |
$content .= "<li>".__('Scroll Trigger', 'wp-livechat')."</li>";
|
5652 |
-
$content .= "<li>".__('Page Leave Trigger', 'wp-livechat')."</li>";
|
5653 |
$content .= "</ul>";
|
5654 |
|
5655 |
if (function_exists("wplc_pro_activate")) {
|
@@ -5675,19 +5990,19 @@ function wplc_basic_triggers_page(){
|
|
5675 |
*/
|
5676 |
function wplc_basic_custom_fields_page(){
|
5677 |
$content = "<div class='wrap'>";
|
5678 |
-
$content .= "<h2>".__('WP Live Chat Support Custom Fields', 'wplivechat')."</h2>";
|
5679 |
$content .= "<table class=\"wp-list-table widefat fixed form-table\" cellspacing=\"0\" style='width:98%'>";
|
5680 |
$content .= "<tr>";
|
5681 |
$content .= "<td style='width:35%; vertical-align:top;'>";
|
5682 |
-
$content .= "<img class='trigger_img_main' style='width:99%; height:auto; padding:2px; border:1px lightgray solid;box-shadow: 3px 3px 2px -2px #999;-webkit-box-shadow: 3px 3px 2px -2px #999;-moz-box-shadow: 3px 3px 2px -2px #999;-o-box-shadow: 3px 3px 2px -2px #999;' src='".plugins_url('/images/trigger_sample.jpg', __FILE__)."'>";
|
5683 |
$content .= "</td>";
|
5684 |
$content .= "<td style='vertical-align:top;'>";
|
5685 |
$content .= "<h3>".__('WP Live Chat Support Custom Fields', 'wp-livechat')."</h3>";
|
5686 |
-
$content .= "<p>".__('Create custom fields, allowing your visitors to enter the data you need before starting a chat.', 'wp-livechat')."</p>";
|
5687 |
$content .= "<br><p><strong>".__('Custom Field Types', 'wp-livechat').":</strong></p>";
|
5688 |
$content .= "<ul style='list-style: inherit;margin-left: 22px;'>";
|
5689 |
$content .= "<li>".__('Text Fields', 'wp-livechat')."</li>";
|
5690 |
-
$content .= "<li>".__('Dropdown Fields', 'wp-livechat')."</li>";
|
5691 |
$content .= "</ul>";
|
5692 |
|
5693 |
if (function_exists("wplc_pro_activate")) {
|
@@ -5714,14 +6029,14 @@ add_action('wplc_hook_admin_settings_main_settings_after','wplc_powered_by_link_
|
|
5714 |
*/
|
5715 |
function wplc_powered_by_link_settings_page() {
|
5716 |
$wplc_powered_by = get_option("WPLC_POWERED_BY");
|
5717 |
-
?>
|
5718 |
<table class='form-table wp-list-table widefat fixed striped pages' width='700'>
|
5719 |
<tr>
|
5720 |
-
<td width='
|
5721 |
-
<?php _e("Display a 'Powered by' link in the chat box", "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' caption at the bottom of your chatbox.", 'wplivechat'); ?>"></i>
|
5722 |
-
</td>
|
5723 |
<td>
|
5724 |
-
<input type="checkbox" value="1" name="wplc_powered_by" <?php if ( $wplc_powered_by && $wplc_powered_by == 1 ) { echo "checked"; } ?> />
|
5725 |
</td>
|
5726 |
</tr>
|
5727 |
</table>
|
@@ -5755,13 +6070,13 @@ add_filter( "wplc_start_chat_user_form_after_filter", "wplc_powered_by_link_in_c
|
|
5755 |
* @param int $cid the current chat ID
|
5756 |
* @return string the chat contents, with the 'Powered by' link appended to it
|
5757 |
*/
|
5758 |
-
function wplc_powered_by_link_in_chat( $string ){
|
5759 |
|
5760 |
$show_powered_by = get_option( "WPLC_POWERED_BY" );
|
5761 |
-
|
5762 |
if( $show_powered_by == 1){
|
5763 |
$ret = "<i style='text-align: center; display: block; padding: 5px 0; font-size: 10px;'><a href='https://wp-livechat.com/?utm_source=poweredby&utm_medium=click&utm_campaign=".esc_html(site_url())."'' target='_BLANK' rel='nofollow'>".__("Powered by WP Live Chat Support", "wplivechat")."</a></i>";
|
5764 |
-
|
5765 |
} else {
|
5766 |
|
5767 |
$ret = "";
|
@@ -5781,20 +6096,20 @@ function wplc_custom_scripts_scripts(){
|
|
5781 |
|
5782 |
if( isset( $_GET['page'] ) && $_GET['page'] == 'wplivechat-menu-settings' ){
|
5783 |
|
5784 |
-
wp_enqueue_script( "wplc-custom-script-tab-ace",
|
5785 |
-
|
5786 |
}
|
5787 |
|
5788 |
}
|
5789 |
|
5790 |
add_filter( "wplc_filter_setting_tabs", "wplc_custom_scripts_tab" );
|
5791 |
/**
|
5792 |
-
* Adds a tab for the custom scripts
|
5793 |
* @param array $array current array that is made available to us
|
5794 |
* @return array our tabs array has been added to the array
|
5795 |
*/
|
5796 |
function wplc_custom_scripts_tab( $array ){
|
5797 |
-
|
5798 |
$array['custom-scripts'] = array(
|
5799 |
'href' => '#wplc-custom-scripts',
|
5800 |
'icon' => 'fa fa-pencil',
|
@@ -5809,11 +6124,11 @@ add_action( "wplc_hook_settings_page_more_tabs", "wplc_custom_scripts_content" )
|
|
5809 |
* Adds the tab content to the settings page to allow the user to add custom CSS & JS
|
5810 |
* @return string
|
5811 |
*/
|
5812 |
-
function wplc_custom_scripts_content(){
|
5813 |
|
5814 |
$wplc_custom_css = get_option( "WPLC_CUSTOM_CSS" );
|
5815 |
$wplc_custom_js = get_option( "WPLC_CUSTOM_JS" );
|
5816 |
-
|
5817 |
$content = "";
|
5818 |
|
5819 |
$content .= "<div id='wplc-custom-scripts'>";
|
@@ -5822,13 +6137,13 @@ function wplc_custom_scripts_content(){
|
|
5822 |
$content .= "<table class='form-table'>";
|
5823 |
|
5824 |
$content .= "<tr>";
|
5825 |
-
$content .= "<td width='300'>".__("Custom CSS", "wplivechat")."</td>";
|
5826 |
-
$content .= "<td><textarea name='wplc_custom_css' data-editor='css' rows='12'>".strip_tags( stripslashes( $wplc_custom_css ) )."</textarea></td>";
|
5827 |
$content .= "</tr>";
|
5828 |
|
5829 |
$content .= "<tr>";
|
5830 |
-
$content .= "<td width='300'>".__("Custom JS", "wplivechat")."</td>";
|
5831 |
-
$content .= "<td valign='middle'><textarea name='wplc_custom_js' data-editor='javascript' rows='12'>".strip_tags( stripslashes( $wplc_custom_js ) )."</textarea></td>";
|
5832 |
$content .= "</tr>";
|
5833 |
|
5834 |
$content .= "</table>";
|
@@ -5847,7 +6162,7 @@ add_action( "wplc_hook_head", "wplc_custom_scripts_save" );
|
|
5847 |
function wplc_custom_scripts_save(){
|
5848 |
|
5849 |
if( isset( $_POST['wplc_save_settings'] ) ){
|
5850 |
-
|
5851 |
if( isset( $_POST['wplc_custom_css'] ) ){
|
5852 |
update_option( "WPLC_CUSTOM_CSS", nl2br( $_POST['wplc_custom_css'] ) );
|
5853 |
}
|
@@ -5876,7 +6191,7 @@ function wplc_custom_scripts_frontend(){
|
|
5876 |
echo strip_tags( stripslashes( $wplc_custom_css ) );
|
5877 |
echo "</style>";
|
5878 |
}
|
5879 |
-
|
5880 |
if( $wplc_custom_js ){
|
5881 |
echo "<!-- WPLC Custom JS -->";
|
5882 |
echo "<script>";
|
@@ -5901,7 +6216,7 @@ function wplc_change_offline_message( $subject ){
|
|
5901 |
}
|
5902 |
|
5903 |
return $subject;
|
5904 |
-
|
5905 |
}
|
5906 |
|
5907 |
function wplc_basic_version_departments(){
|
@@ -5921,7 +6236,7 @@ function wplc_basic_version_departments(){
|
|
5921 |
$content .= "</thead>";
|
5922 |
|
5923 |
$content .= "<tr><td>".__("Please update your Pro version to create a department", "wp-livechat")."</td><td></td><td></td></tr>";
|
5924 |
-
|
5925 |
$content .= "</table>";
|
5926 |
|
5927 |
echo $content;
|
@@ -5954,14 +6269,14 @@ if ( ! function_exists( "wplc_active_chat_box_notices" ) ) {
|
|
5954 |
add_filter("wplc_filter_chat_4th_layer_below_input","nifty_chat_ratings_div_backwards_compat",2,2);
|
5955 |
/**
|
5956 |
* This adds backwards compatibility to the new look and feel of the modern chat box
|
5957 |
-
*
|
5958 |
* The ' | ' is removed from the rating icons to fit the new look and feel
|
5959 |
-
*
|
5960 |
*/
|
5961 |
-
function nifty_chat_ratings_div_backwards_compat($msg, $wplc_setting){
|
5962 |
$msg = str_replace(" | ","", $msg);
|
5963 |
return $msg;
|
5964 |
-
|
5965 |
}
|
5966 |
|
5967 |
/**
|
@@ -5970,7 +6285,7 @@ function nifty_chat_ratings_div_backwards_compat($msg, $wplc_setting){
|
|
5970 |
* i.e. This is the part where we force users to upgrade their extensions to make sure everything works correctly.
|
5971 |
*
|
5972 |
* Use with caution and always try add backwards compatibility where necessary
|
5973 |
-
*
|
5974 |
* @param bool $continue
|
5975 |
* @return bool
|
5976 |
* @since 7.1.00
|
@@ -5978,7 +6293,7 @@ function nifty_chat_ratings_div_backwards_compat($msg, $wplc_setting){
|
|
5978 |
*/
|
5979 |
add_filter( "wplc_version_check_continue", "wplc_filter_control_version_check_continue", 10, 1 );
|
5980 |
function wplc_filter_control_version_check_continue( $continue ) {
|
5981 |
-
|
5982 |
/**
|
5983 |
* Check to see that we are on the cloud server 1.3.00 or newer
|
5984 |
*/
|
@@ -5987,10 +6302,125 @@ function wplc_filter_control_version_check_continue( $continue ) {
|
|
5987 |
$float_version = intval( str_replace(".", "", $wplc_cloud_version ) );
|
5988 |
if ($float_version < 2000) {
|
5989 |
return sprintf( "Your chat has been disabled due to a version conflict. Please <a href='%s'>update your cloud extension</a> to 1.3.00 or higher.", admin_url('update-core.php') )."<br />";
|
5990 |
-
|
5991 |
-
}
|
5992 |
}
|
5993 |
|
5994 |
return $continue;
|
5995 |
|
5996 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
Plugin Name: WP Live Chat Support
|
4 |
Plugin URI: http://www.wp-livechat.com
|
5 |
Description: The easiest to use website live chat plugin. Let your visitors chat with you and increase sales conversion rates with WP Live Chat Support. No third party connection required!
|
6 |
+
Version: 8.0.01
|
7 |
Author: WP-LiveChat
|
8 |
Author URI: http://www.wp-livechat.com
|
9 |
Text Domain: wplivechat
|
10 |
Domain Path: /languages
|
11 |
*/
|
12 |
+
|
13 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
*
|
15 |
+
* 8.0.01 - 2018-01-24 - High priority
|
16 |
+
* Massive improvements to the performance of the plugin
|
17 |
+
* New, modern dashboard
|
18 |
+
* The dashboard can now be added to all admin pages
|
19 |
+
* Dynamic visitor filtering
|
20 |
+
* Improved REST API Security
|
21 |
+
* OS identification
|
22 |
+
* Better Browser identification
|
23 |
+
* Mobile/desktop identification
|
24 |
+
* Country identification (API)
|
25 |
+
* Inline link handling
|
26 |
+
* Security patches
|
27 |
+
* Gutenberg support
|
28 |
+
* Full WPML Support
|
29 |
+
* Showcase user's timezone
|
30 |
+
* Emoticons
|
31 |
+
* New API endpoints
|
32 |
+
* Refactor JS code – backend and frontend to make use of events
|
33 |
+
* Store messages using sessionStorage to avoid unnecessary DB calls
|
34 |
+
* Better polling system for visitor tracking
|
35 |
+
* Better history UI
|
36 |
+
* Support for the new iOS app
|
37 |
+
* Support for the new Android App
|
38 |
+
* Support for the new Desktop App
|
39 |
+
*
|
40 |
+
* 8.0.00
|
41 |
+
* Beta version - lots of testing!
|
42 |
+
*
|
43 |
+
* 7.1.02 - 2017-06-21 - Low priority
|
44 |
+
* Fixed a compat issue between pro and basic with regards to the agent social profiles
|
45 |
* Fixed undefined variables when using social profiles, a bio and tag line
|
46 |
* Fixed a bug that caused some messages to not get recorded
|
47 |
+
*
|
48 |
* 7.1.01 - 2017-06-18 - Low priority
|
49 |
* Small bug fix for agent profiles
|
50 |
+
*
|
51 |
* 7.1.00 - 2017-06-18 - Medium priority
|
52 |
* Modernised the live chat box
|
53 |
* Fixed a bug that caused the wrong agent name to show up in the "typing" element after a chat was transferred
|
62 |
* Fixed a bug with the listing of all missed chats
|
63 |
* Fixed a bug that sent pings to the node server when it was not necessary, causing an overload of the node server
|
64 |
* Fixed a bug that did not allow you to view the chat history of a missed chat
|
65 |
+
* Fixed a bug that caused the 'display name' and 'display avatar' to behave erratically
|
66 |
* Fixed a bug that caused the time and date display functionality to behave erratically
|
67 |
+
* Fixed a bug that caused a JavaScript error on the admin chat dashboard when a single visitor leaves the site
|
68 |
* Fixed a bug that caused the chat widow to appear before the chat circle when engaged in a chat and moving from page to page
|
69 |
* The visitor can now restart any chat that has been ended by an agent
|
70 |
* You can now customize the text "The chat has been ended by the operator"
|
75 |
* Fixed a bug that caused "maximize" notifications to not get sent through to agents when using the Node server
|
76 |
* Fixed a bug that did not allow single missed chats to be deleted
|
77 |
* Fixed a bug that caused the text input field to continually be focused on thereby causing issues
|
78 |
+
*
|
79 |
* 7.0.08 - 2017-05-21 - Low priority
|
80 |
* Fixed the powered by link
|
81 |
* Added supporting code for new extensions
|
82 |
+
*
|
83 |
* 7.0.07 - 2017-05-15 - Medium priority
|
84 |
* You can now change the text of the offline message button
|
85 |
* You can now change the text of the close chat button
|
95 |
* Fixed a bug that caused attached images to not display correctly
|
96 |
* Fixed a bug that caused notifications to show up in the front end when the agent is testing a chat with him or herself
|
97 |
* Fixed a bug that caused the visitor count to flash when the visitor count had not changed
|
98 |
+
*
|
99 |
* 7.0.06 -2017-03-13 - Low Priority
|
100 |
* Enhancement: 'Open Chat' button changes to 'Chat Accepted' once a chat is active
|
101 |
* Bug Fix: Compatibility bug fix for decryption in the Pro version
|
102 |
+
*
|
103 |
+
* 7.0.05 - 2017-03-01 - Low priority
|
104 |
+
* Fixed broken links on the plugins page
|
105 |
+
*
|
106 |
* 7.0.04 - 2017-02-15 - Medium Priority
|
107 |
* Fixed a bug that caused messages to be returned encoded after refreshing the page
|
108 |
* Fixed a bug that caused the incorrect agent name to be used in the chat window
|
109 |
* Fixed a bug that caused the 'No Answer' text to not save and show in the chat window
|
110 |
+
*
|
111 |
+
*
|
112 |
* 7.0.03 - 2017-02-06 - Medium Priority
|
113 |
* Fixed a bug that caused the name of the agent to disappear after refreshing the page
|
114 |
* Fixed a bug that caused the agent name to display twice in the chat window
|
115 |
+
*
|
116 |
* 7.0.02 - 2017-01-26 - High priority
|
117 |
* PHPMailer vulnerability patch (removed our version of PHPMailer and are now using WP's built-in version)
|
118 |
* Added the ability for plugin users to subscribe to our mailing list
|
119 |
+
*
|
120 |
* 7.0.01 - 2017-01-03 - Medium priority
|
121 |
* Fixed a bug that caused the chat to disappear after being opened for some users
|
122 |
* Changes made to the language files
|
123 |
* PHPMailer has been updated to the latest version
|
124 |
+
*
|
125 |
* 7.0.00 - 2016-12-14 - Medium priority
|
126 |
* Major performance improvements - 300% reduction in DB calls
|
127 |
* Node Server Integration (Experimental)
|
143 |
* Integrated with Contact Form Ready to allow for custom forms to be used for the offline message form
|
144 |
* Google Analytics Integration
|
145 |
* Ability to change the subject of the offline message
|
146 |
+
* Ability to add custom CSS and JavaScript in the settings page
|
147 |
+
*
|
148 |
+
* 6.2.11 - 2016-10-27 - Medium Priority
|
149 |
* Fixed a bug that caused issues with the User JS file when being minified
|
150 |
* Fixed a bug that caused the 'Congratulations' message to never clear when using the Cloud Server
|
151 |
* Fixed a bug that caused new TLD's to return invalid when starting a new chat
|
152 |
* Fixed a variety of strings that were using the incorrect text domain
|
153 |
* Italian translation updated - Thank you Angelo Giammarresi
|
154 |
* HTML is now rendered in the Input replacement field of the Classic chat window
|
155 |
+
*
|
156 |
* 6.2.10 - 2016-10-18 - High priority for IE users
|
157 |
* IE bug fix - fixed the bug that stopped the chat window from opening when clicking on it
|
158 |
* Fixed the bug that caused user messages to not be sent on some websites due to non-unique function names being used in the md5.js file
|
161 |
* Estonian translation added - thank you Joonas Kessel
|
162 |
* Chinese translation updated - thank you Wan Kit
|
163 |
* Missing translation strings added in all languages
|
164 |
+
*
|
165 |
* 6.2.09 - 2016-09-15 - High priority for cloud users
|
166 |
* Further cloud server bug fixes
|
167 |
*
|
168 |
* 6.2.08 - 2016-09-15 - High priority for cloud users
|
169 |
* Fixed a bug that caused no visitors to be displayed when using the cloud server
|
170 |
+
*
|
171 |
* 6.2.07 - 2016-09-15 - Medium priority
|
172 |
* Fixed a bug that caused a fatal error on older PHP version
|
173 |
+
*
|
174 |
* 6.2.06 - 2016-09-14 - Medium Priority
|
175 |
+
* Added Rest API functionality (Accept chat, end chat, get messages, send message, get sessions)
|
176 |
+
* Added 'Device' type logging to live chat dashboard area.
|
177 |
* Minified User Side JavaScript
|
178 |
* Added Connection Handling (User), which will now retry to establish connection upon fail
|
179 |
* Added Connection Handling (Admin), which will retry to establish connection upon fail
|
180 |
* Fixed a PHP warning on the feedback page
|
181 |
* Fixed a bug where offline strings weren't translating when localization option was checked
|
182 |
+
*
|
183 |
* 6.2.05 - 2016-08-19 - Medium priority
|
184 |
* Added compatibility for Pro triggers
|
185 |
* Added Classic Theme's Hovercard (Will only show with triggers)
|
189 |
* Ability to delete individual Chats from History
|
190 |
* Minor Styling Conflicts Resolved
|
191 |
* Fixed the bug that caused "start chat" to be added to the button in the live chat box when offline
|
192 |
+
* Fixed a bug that showed slashes when apostrophes were used
|
193 |
* Added various filters/actions for use in Pro
|
194 |
* Added ability to open chat box using an elements ID/Class (Click/Hover)
|
195 |
+
*
|
196 |
* 6.2.04 - 2016-08-01 - High priority
|
197 |
* Security patches in the offline message storing function (securify.nl/advisory/SFY20190709/stored_cross_site_scripting_vulnerability_in_wp_live_chat_support_wordpress_plugin.html)
|
198 |
+
*
|
199 |
* 6.2.03 - 2016-07-19 - Low priority
|
200 |
* Italian translation updated - thank you Angelo Giammarresi
|
201 |
* Fixed Danish translation bug
|
202 |
* Minor UI fixes
|
203 |
* Edge browser bug fix when opening chats
|
204 |
+
*
|
205 |
* 6.2.02 - 2016-07-11 - High priority
|
206 |
* XSS Security patch - Thank you Han Sahin!
|
207 |
+
*
|
208 |
* 6.2.01 - 2016-07-07 - Low priority
|
209 |
* Surveys/Polls added - you can now add a survey/poll to your chat box either before or after a chat session
|
210 |
+
*
|
211 |
* 6.2.00 - 2016-06-10 - High priority
|
212 |
* Cloud server bug fix
|
213 |
* Offline messages bug fix
|
215 |
* Fixed the bug that stopped email addresses such as "name@domain.tld" from validating
|
216 |
* Advanced options to control the long poll variables
|
217 |
* Support added for many new pro features
|
218 |
+
*
|
219 |
* 6.1.02 - 2016-04-13 - Low Priority
|
220 |
* Tested on WordPress 4.5
|
221 |
* Fixed a bug that sent offline messages to the wrong email address
|
222 |
+
*
|
223 |
* 6.1.01 - 2016-04-07 - Low Priority
|
224 |
* You can now delete inidividual offline messages from your history
|
225 |
* Code improvements done to the way scripts are loaded when displaying the chat
|
239 |
* - Danish Updated (Thank you Kasper Jensen)
|
240 |
* - Spanish Updated (Thank you Olivier Gantois)
|
241 |
* - French Updated (Thank you Olivier Gantois)
|
242 |
+
*
|
243 |
* 6.1.00 - 2016-03-18 - Medium priority
|
244 |
* Fixed a bug that caused the chat agent to be nullified if you saved the settings
|
245 |
* NEW: Introduced a new modern theme
|
253 |
* Fixed a bug that added slashes to apostrophes in the chat window
|
254 |
* Fixed a bug that caused an error when trying to load the chat box when a banned user visited the site
|
255 |
* Fixed a bug that still displayed the offline message window even if the setting was set to false
|
256 |
+
*
|
257 |
* 6.0.07 - 2016-03-11 - High priority
|
258 |
* Bug fix - agent status was lost when saving settings
|
259 |
+
*
|
260 |
* 6.0.06 - 2016-03-04 - Medium priority
|
261 |
* More stable fix for the menu item bug that has been experienced lately
|
262 |
+
*
|
263 |
* 6.0.05 - 2016-02-23 - Medium priority
|
264 |
* Fixed the bug that caused the menu item to not display for some users
|
265 |
+
*
|
266 |
* 6.0.04 - 2016-02-16 - Low priority
|
267 |
* Offline message bug fix with the cloud server extension
|
268 |
* Choose when online bug fix
|
269 |
* Agent bug fix
|
270 |
* Styling adjustment for viewpots of 481px and below
|
271 |
* All content now loaded and pushed via SSL links
|
272 |
+
*
|
273 |
* 6.0.03 - 2016-02-04 - Low priority
|
274 |
* Fixed a bug that caused a warning if an incorrect IP address was in the banned IP address field
|
275 |
* Offline messaging bug fixed
|
276 |
+
*
|
277 |
* 6.0.02 - 2016-02-03 - Low priority
|
278 |
* Added a new filter to fix a bug with WP Live Chat Support - Advanced Chat Box Control Extension
|
279 |
+
*
|
280 |
* 6.0.01 - 2016-02-02 - High priority
|
281 |
* Crucial bug fix that stopped the live chat from working in some instances
|
282 |
* New filter to fix the bug with the WP Live Chat Choose When Online bug
|
283 |
+
*
|
284 |
* 6.0.00 -2016-01-26 - Freedom of Speech Update - Medium Priority
|
285 |
* New functionality
|
286 |
* Unlimited simultaneous chats now available
|
290 |
*
|
291 |
* 5.0.14 - 2016-01-13 - High priority
|
292 |
* Bug fix: When activating WP Live Chat Support, a table is created with a shared MySQL column name which caused issues on some servers. The column name has been changed
|
293 |
+
*
|
294 |
* 5.0.13 - 2016-01-05 - High priority
|
295 |
* UTF8 encoding bug fixed
|
296 |
+
*
|
297 |
* 5.0.12 - 2016-01-04 - Low priority
|
298 |
* Tested with WP 4.4
|
299 |
+
*
|
300 |
* 5.0.11 - 2015-10-14 - Low priority
|
301 |
* Translation string changes
|
302 |
+
*
|
303 |
* 5.0.10 - 2015-10-12 - Low priority
|
304 |
+
* Updates to the extension page
|
305 |
+
*
|
306 |
* 5.0.9
|
307 |
* New hook: wplc_hook_admin_menu_layout - Target the area above the normal menu layout
|
308 |
* Style bug fix with the "DATA" section of the live chat dashboard
|
309 |
+
*
|
310 |
* 5.0.8
|
311 |
* Introduced new hooks:
|
312 |
* wplc_hook_admin_visitor_info_display_before - Allows you to add HTML at the beginning of the vistior details DIV in the live chat window
|
313 |
* wplc_hook_admin_visitor_info_display_after - Allows you to add HTML at the end of the vistior details DIV in the live chat window
|
314 |
* wplc_hook_admin_javascript_chat - Allows you to add Javascript enqueues at the end of the javascript section of the live chat window
|
315 |
* wplc_hook_admin_settings_main_settings_after - Allows you to add more options to the main chat settings table in the settings page, after the first main table
|
316 |
+
* wplc_hook_admin_settings_save - Hook into the save settings head section. i.e. where we handle POST data from the live chat settings page
|
317 |
+
*
|
318 |
* 5.0.7 - 2015-10-06 - Low priority
|
319 |
* Added a live chat extension page
|
320 |
* Corrected internationalization
|
321 |
+
*
|
322 |
* 5.0.6 - 2015-09-17 - Low priority
|
323 |
* You can now choose to disable the sound that is played when a new live chat message is received
|
324 |
* Fixed a bug that caused some live chat settings to revert back to default when updating the plugin
|
325 |
+
*
|
326 |
* 5.0.5 - 2015-09-09 - Low Priority
|
327 |
* Fixed a bug that displayed an error message to update the live chat plugin while using the latest version (Pro)
|
328 |
* Fixed a bug where the mobile detect class would only work if the Pro was enabled
|
330 |
* You can now see the visitors IP address on the Live Chat dashboard
|
331 |
* Alert message removed when a user was made a live chat agent on the settings page (Pro)
|
332 |
* Fixed a bug that would prevent the user from typing if they had a previous live chat session (Pro)
|
333 |
+
*
|
334 |
* 5.0.4 - 2015-08-06 - Medium priority
|
335 |
* WP Live Chat Support is now compatible with all caching plugins
|
336 |
* Fixed a bug that set the wrong permissions for the default agent
|
337 |
* Fixed the bug that shows the status of undefined if the user minimized the chat
|
338 |
+
*
|
339 |
+
*
|
340 |
* 5.0.3 - 2015-08-05 - High Priority
|
341 |
* Small bug fix
|
342 |
+
*
|
343 |
* 5.0.2 - 2015-08-05 - High Priority
|
344 |
* Fixed a bug that caused a fatal error
|
345 |
+
*
|
346 |
* 5.0.1 - 2015-08-05 - Medium Priority
|
347 |
* Refactored the code so that the live chat box will show up even if there is a JS error from another plugin or theme
|
348 |
* Live chat box styling fixes: top image padding; centered the "conneting, please be patient" message and added padding
|
349 |
* The live chat long poll connection will not automatically reinitialize if the connection times out or returns a 5xx error
|
350 |
+
*
|
351 |
* 5.0.0 - 2015-07-29 - Doppio update - Medium Priority
|
352 |
* New, modern chat dashboard
|
353 |
* Better user handling (chat long polling)
|
356 |
* You are now able to see who is a new visitor and who is a returning visitor
|
357 |
* Bug fixes in the javascript that handles the live chat controls
|
358 |
* Fixed the bug that stopped the chats from timing out after a certain amount of time
|
359 |
+
*
|
360 |
* 4.4.4 - 2015-07-20 - Low Priority
|
361 |
* Bug Fix: Big fixed that would cause the live chat to timeout during a conversation
|
362 |
+
*
|
363 |
* 4.4.3 - 2015-07-16 - Low Priority
|
364 |
* Bug Fix: Ajax URL undefined in some versions of WordPress
|
365 |
* Improvement: Warning messages limited to the Settings page only
|
366 |
+
*
|
367 |
* 4.4.2 - 2015-07-13 - Low Priority
|
368 |
* Improvement: Gravatar images will load on sites using SSL without any issues
|
369 |
* Improvement: Hungarian live chat translation file name fixed
|
370 |
* Improvement: Styling improvements on the live chat dashboard
|
371 |
* New Translations:
|
372 |
* Turkish (Thank you Yavuz Aksu)
|
373 |
+
*
|
374 |
* 4.4.1 - 2015-07-08 - Critical Priority
|
375 |
* Major security update. Please ensure you update to this version to eliminate previous vulnerabilities.
|
376 |
+
*
|
377 |
* 4.3.5 Espresso - 2015-07-03 - Low Priority
|
378 |
* Enhancement: Provision made for live chat encryption in the Pro version (compatibility)
|
379 |
* Updated Translations:
|
380 |
* Hungarian (Thank you Andor Molnar)
|
381 |
+
*
|
382 |
* 4.3.4 Ristretto - 2015-06-26 - Low Priority
|
383 |
* Improvement: 404 errors for images in admin panel fixed
|
384 |
* Translation Fix: Mistakes fixed in German Translation file.
|
385 |
+
*
|
386 |
* 4.3.3 2015-06-11 - Low Priority
|
387 |
* Security enhancements
|
388 |
* New Translations:
|
389 |
* Polish (Thank you Sebastian Kajzer)
|
390 |
+
*
|
391 |
* 4.3.2 2015-05-28 - Medium Priority
|
392 |
* Bug Fix: Fixed PHP error
|
393 |
+
*
|
394 |
* 4.3.1 2015-05-22 - Low Priority
|
395 |
* New Translations:
|
396 |
* Finnish (Thank you Arttu Piipponen)
|
397 |
+
*
|
398 |
* Translations Updated:
|
399 |
* French (Thank you Marcello Cavalucci)
|
400 |
+
* Dutch (Thank you Niek Groot Bleumink)
|
401 |
+
*
|
402 |
* Bug Fix: Exclude Functionality (Pro)
|
403 |
+
*
|
404 |
* 4.3.0 2015-04-13 - Low Priority
|
405 |
* Enhancement: Animations settings have been moved to the 'Styling' tab.
|
406 |
* New Feature: Blocked User functionality has been moved to the Free version
|
407 |
* Enhancement: All descriptions have been put into tooltips for a cleaner page
|
408 |
* New Feature: Functionality added in to handle Chat Experience Ratings (Premium Add-on)
|
409 |
+
*
|
410 |
* 4.2.12 2015-03-24 - Low Priority
|
411 |
+
* Bug Fix: Warning to update showing erroneously
|
412 |
+
*
|
413 |
* 4.2.11 2015-03-23 - Low Priority
|
414 |
* Bug Fix: Bug in the banned user functionality
|
415 |
* Enhancement: Stying improvement on the Live Chat dashboard
|
416 |
* Enhancement: Strings are handled better for localization plugins (Pro)
|
417 |
* Updated Translation Files:
|
418 |
* Spanish (Thank you Ana Ayelen Martinez)
|
419 |
+
*
|
420 |
* 4.2.10 2015-03-16 - Low Priority
|
421 |
* Bug Fix: Mobile Detect class caused Fatal error on some websites
|
422 |
* Bug Fix: PHP Errors when editing user page
|
423 |
* Bug Fix: Including and Excluding the chat window caused issues on some websites
|
424 |
* Bug Fix: Online/Offline Toggle Switch did not work in some browsers (Pro)
|
425 |
* New Feature: You can now Ban visitors from chatting with you based on IP Address (Pro)
|
426 |
+
* New Feature: You can now choose if you want users to make themselves an agent (Pro)
|
427 |
+
* Bug Fix: Chat window would not hide when selecting the option to not accept offline messages (Pro)
|
428 |
+
* Enhancement: Support page added
|
429 |
* Updated Translations:
|
430 |
* French (Thank you Marcello Cavallucci)
|
431 |
* New Translations added:
|
432 |
* Norwegian (Thank you Robert Nilsen)
|
433 |
* Hungarian (Thank you GInception)
|
434 |
* Indonesian (Thank you Andrie Willyanta)
|
435 |
+
*
|
436 |
* 4.2.9 2015-02-18 - Low Priority
|
437 |
* New Feature: You can now choose to record your visitors IP address or not
|
438 |
* New Feature: You can now send an offline message to more than one email address (Pro)
|
439 |
+
* New Feature: You can now specify if you want to be online or not (Pro)
|
440 |
+
*
|
441 |
* 4.2.8 2015-02-12 - Low Priority
|
442 |
* New Feature: You can now apply an animation to the chat window on page load
|
443 |
* New Feature: You can now choose from 5 colour schemes for the chat window
|
444 |
* Enhancement: Aesthetic Improvement to list of agents (Pro)
|
445 |
* Code Improvement: PHP error fixed
|
446 |
* Updated Translations:
|
447 |
+
* German (Thank you Dennis Klinger)
|
448 |
+
*
|
449 |
* 4.2.7 2015-02-10 - Low Priority
|
450 |
* New Live Chat Translation added:
|
451 |
* Greek (Thank you Peter Stavropoulos)
|
452 |
+
*
|
453 |
* 4.2.6 2015-01-29 - Low Priority
|
454 |
* New feature: Live Chat dashboard has a new layout and design
|
455 |
* Code Improvement: jQuery Cookie updated to the latest version
|
456 |
+
* Code Improvement: More Live Chat strings are now translatable
|
457 |
* New Live Chat Translation added:
|
458 |
* Spanish (Thank you Ana Ayel�n Mart�nez)
|
459 |
+
*
|
460 |
+
*
|
461 |
* 4.2.5 2015-01-21 - Low Priority
|
462 |
* New Feature: You can now view any live chats you have missed
|
463 |
* New Pro Feature: You can record offline messages when live chat is not online
|
464 |
* Code Improvements: Labels added to buttons
|
465 |
* Code Improvements: PHP Errors fixed
|
466 |
+
*
|
467 |
* Updated Translations:
|
468 |
* Italian (Thank You Angelo Giammarresi)
|
469 |
+
*
|
470 |
* 4.2.4 2014-12-17 - Low Priority
|
471 |
* New feature: The chat window can be hidden when offline (Pro only)
|
472 |
* New feature: Desktop notifications added
|
473 |
* Bug fix: Email address gave false validation error when not required.
|
474 |
+
*
|
475 |
* Translations Added:
|
476 |
* Dutch (Thank you Elsy Aelvoet)
|
477 |
+
*
|
478 |
+
*
|
479 |
* 4.2.3 2014-12-11 - Low Priority
|
480 |
* Updated Translations:
|
481 |
* French (Thank you Marcello Cavallucci)
|
482 |
* Italian (Thank You Angelo Giammarresi)
|
483 |
+
*
|
484 |
* 4.2.2 2014-12-10 - Low Priority
|
485 |
* New feature: You can now toggle between displaying or hiding the users name in your Live Chat messages
|
486 |
* New feature: You can now choose to display the Live Chat window to all or only registered users
|
487 |
* New feature: A user image will now display in the Live Chat message
|
488 |
* Code Improvement: jQuery UI CSS is loaded from a local source
|
489 |
* Bug Fix: Only Admin users can make users Live Chat agents
|
490 |
+
*
|
491 |
* Translations added:
|
492 |
* Mongolian (Thank you Monica Batuskh)
|
493 |
* Romanian (Thank you Sergiu Balaes)
|
494 |
* Czech (Thank you Pavel Cvejn)
|
495 |
* Danish (Thank you Mikkel Jeppesen Juhl)
|
496 |
+
*
|
497 |
* Updated Translations:
|
498 |
* German (Thank you Dennis Klinger)
|
499 |
+
*
|
500 |
* 4.2.1 2014-11-24 - High Priority
|
501 |
* Bug Fix: PHP Error on agent side in chat window
|
502 |
+
*
|
503 |
+
*
|
504 |
* 4.2.0 2014-11-20 - Medium priority
|
505 |
* Chat UI Improvements
|
506 |
* Small bug fixes
|
507 |
+
*
|
508 |
* 4.1.10 2014-10-29 - Low priority
|
509 |
* Code Improvements: (Checks for DONOTCACHE)
|
510 |
* New Pro Feature: You can now include or exclude the chat window on certain pages
|
511 |
+
*
|
512 |
* 4.1.9 2014-10-10 - Low priority
|
513 |
+
* Bug fix: Mobile Detect class caused an error if it existed in another plugin or theme. A check has been put in place.
|
514 |
+
*
|
515 |
* 4.1.8 2014-10-08 - Low priority
|
516 |
* New feature: There is now an option if you do not require the user to input their name and email address before sending a chat request
|
517 |
* New feature: Logged in users do not have to enter their details prior to sending the chat request.
|
518 |
* New feature: Turn the chat on/off on a mobile device (smart phone and tablets)
|
519 |
+
*
|
520 |
* 4.1.7 2014-10-06 - Low priority
|
521 |
* Bug fix: sound was not played when user received a message from the admin
|
522 |
* Internationalization update
|
523 |
* New WP Live Chat Support Translation added:
|
524 |
* * Swedish (Thank You Tobias Sernhede)
|
525 |
* * French (Thank You Marcello Cavallucci)
|
526 |
+
*
|
527 |
+
*
|
528 |
* 4.1.6
|
529 |
* Code improvements (JavaScript errors fixed in IE)
|
530 |
* New WP Live Chat Support Translations Added:
|
531 |
* * Slovakian (Thank You Dana Kadarova)
|
532 |
* * German (Thank You Dennis Klingr)
|
533 |
* * Hebrew (Thank You David Cohen)
|
534 |
+
*
|
535 |
* 4.1.5
|
536 |
* Code improvements (PHP warnings - set_time_limit caused warnings on some hosts)
|
537 |
+
*
|
538 |
* 4.1.4
|
539 |
* Significant performance improvements
|
540 |
* Brazilian translation added - thank you Gustavo Silva
|
541 |
+
*
|
542 |
* 4.1.3
|
543 |
* Code improvements (PHP warnings)
|
544 |
+
*
|
545 |
* 4.1.2
|
546 |
* DB bug fix
|
547 |
+
*
|
548 |
* 4.1.1
|
549 |
* Significant performance improvements
|
550 |
* Live chat window will now only show in one window (if user has multiple tabs open on your site)
|
551 |
* You can now see the browser of the live chat user
|
552 |
* Improved the UI of the backend
|
553 |
* Bug fixes
|
554 |
+
*
|
555 |
* 4.1.0
|
556 |
* New feature: You can now show the chat box on the left or right
|
557 |
* Vulnerability fix (JS injections). Thank you Patrik @ www.it-securityguard.com
|
560 |
* Fixed IE8 bug
|
561 |
* Added option to auto pop up chat window
|
562 |
* Added Italian language files. Thanks to Davide
|
563 |
+
*
|
564 |
*/
|
565 |
|
566 |
//error_reporting(E_ERROR);
|
583 |
$wplc_tblname_offline_msgs = $wpdb->prefix . "wplc_offline_messages";
|
584 |
$wplc_tblname_chats = $wpdb->prefix . "wplc_chat_sessions";
|
585 |
$wplc_tblname_msgs = $wpdb->prefix . "wplc_chat_msgs";
|
586 |
+
$wplc_version = "8.0.01";
|
587 |
|
588 |
define('WPLC_BASIC_PLUGIN_DIR', dirname(__FILE__));
|
589 |
+
define('WPLC_BASIC_PLUGIN_URL', plugins_url( '/', __FILE__ ) );
|
590 |
global $wplc_basic_plugin_url;
|
591 |
+
$wplc_basic_plugin_url = WPLC_BASIC_PLUGIN_URL;
|
592 |
|
593 |
|
594 |
global $wplc_pro_version;
|
595 |
$wplc_ver = str_replace('.', '', $wplc_pro_version);
|
596 |
+
$checker = intval($wplc_ver);
|
597 |
if (function_exists("wplc_pro_version_control") && $checker < 6000) { } else {
|
598 |
require_once (plugin_dir_path(__FILE__) . "ajax_new.php");
|
599 |
}
|
611 |
require_once (plugin_dir_path(__FILE__) . "modules/node_server.php");
|
612 |
require_once (plugin_dir_path(__FILE__) . "modules/module_subscribe.php");
|
613 |
require_once (plugin_dir_path(__FILE__) . 'includes/update_control.class.php');
|
614 |
+
require_once (plugin_dir_path(__FILE__) . "modules/webhooks_manager.php");
|
615 |
+
|
616 |
+
// Gutenberg Block
|
617 |
+
include "includes/blocks/wplc-chat-box/index.php";
|
618 |
|
619 |
add_action( 'wp_ajax_wplc_admin_set_transient', 'wplc_action_callback' );
|
620 |
add_action( 'wp_ajax_wplc_admin_remove_transient', 'wplc_action_callback' );
|
622 |
add_action( 'wp_ajax_nopriv_wplc_user_send_offline_message', 'wplc_action_callback' );
|
623 |
add_action( 'wp_ajax_wplc_user_send_offline_message', 'wplc_action_callback' );
|
624 |
add_action( 'wp_ajax_delete_offline_message', 'wplc_action_callback' );
|
625 |
+
add_action( 'wp_ajax_wplc_a2a_dismiss', 'wplc_action_callback' );
|
626 |
add_action( 'init', 'wplc_version_control' );
|
627 |
add_action( "activated_plugin", "wplc_redirect_on_activate" );
|
628 |
add_action( 'wp_footer', 'wplc_display_box' );
|
654 |
|
655 |
function wplc_init() {
|
656 |
$plugin_dir = basename(dirname(__FILE__)) . "/languages/";
|
657 |
+
load_plugin_textdomain('wplivechat', false, $plugin_dir);
|
658 |
+
|
659 |
|
660 |
}
|
661 |
|
667 |
*/
|
668 |
function wplc_redirect_on_activate( $plugin ) {
|
669 |
if( $plugin == plugin_basename( __FILE__ ) ) {
|
670 |
+
if (get_option("WPLC_V8_FIRST_TIME") == true) {
|
671 |
+
update_option("WPLC_V8_FIRST_TIME",false);
|
672 |
// clean the output header and redirect the user
|
673 |
@ob_flush();
|
674 |
@ob_end_flush();
|
678 |
}
|
679 |
}
|
680 |
|
681 |
+
add_action( "admin_init", "wplc_redirect_on_activate" );
|
682 |
+
|
683 |
function wplc_version_control() {
|
684 |
|
685 |
global $wplc_version;
|
688 |
$current_version = get_option("wplc_current_version");
|
689 |
if (!isset($current_version) || $current_version != $wplc_version) {
|
690 |
|
691 |
+
$wplc_settings = get_option( 'WPLC_SETTINGS' );
|
692 |
+
|
693 |
+
/**
|
694 |
+
* Are we updating from a version before version 8?
|
695 |
+
* If yes, set NODE to enabled
|
696 |
+
*/
|
697 |
+
if ( isset( $current_version ) ) {
|
698 |
+
$main_ver = intval( $current_version[0] );
|
699 |
+
if ( $main_ver < 8 ) {
|
700 |
+
if ( $wplc_settings ) {
|
701 |
+
$wplc_settings['wplc_use_node_server'] = 1;
|
702 |
+
update_option( "WPLC_V8_FIRST_TIME", true );
|
703 |
+
}
|
704 |
+
}
|
705 |
+
|
706 |
+
}
|
707 |
+
|
708 |
+
|
709 |
$admins = get_role('administrator');
|
710 |
+
if( $admins !== null ) {
|
711 |
$admins->add_cap('wplc_ma_agent');
|
712 |
}
|
713 |
|
749 |
}
|
750 |
}
|
751 |
}
|
752 |
+
|
|
|
753 |
|
754 |
|
755 |
if (!isset($wplc_settings['wplc_pro_na'])) { $wplc_settings["wplc_pro_na"] = __("Chat offline. Leave a message", "wplivechat"); }
|
775 |
|
776 |
if (!isset($wplc_settings['wplc_powered_by_link'])) { $wplc_settings["wplc_powered_by_link"] = "0"; }
|
777 |
|
778 |
+
|
779 |
|
780 |
/* users who are updating will stay on the existing theme */
|
781 |
+
if (get_option("WPLC_V8_FIRST_TIME")) {} else {
|
782 |
if (!isset($wplc_settings['wplc_newtheme'])) { $wplc_settings["wplc_newtheme"] = "theme-2"; }
|
783 |
+
}
|
784 |
|
785 |
|
786 |
if (!isset($wplc_settings['wplc_settings_color1'])) { $wplc_settings["wplc_settings_color1"] = "ED832F"; }
|
800 |
wplc_handle_db();
|
801 |
update_option("wplc_current_version", $wplc_version);
|
802 |
|
803 |
+
|
804 |
if (!isset($wplc_settings['wplc_require_user_info'])) { $wplc_settings['wplc_require_user_info'] = "1"; }
|
805 |
if (!isset($wplc_settings['wplc_user_default_visitor_name'])) {
|
806 |
$wplc_default_visitor_name = __( "Guest", "wplivechat" );
|
807 |
$wplc_settings['wplc_user_default_visitor_name'] = $wplc_default_visitor_name;
|
808 |
}
|
809 |
if (!isset($wplc_settings['wplc_loggedin_user_info'])) { $wplc_settings['wplc_loggedin_user_info'] = "1"; }
|
810 |
+
if (!isset($wplc_settings['wplc_user_alternative_text'])) {
|
811 |
$wplc_alt_text = __("Please click \'Start Chat\' to initiate a chat with an agent", "wplivechat");
|
812 |
$wplc_settings['wplc_user_alternative_text'] = $wplc_alt_text;
|
813 |
}
|
817 |
if(!isset($wplc_settings['wplc_enable_font_awesome'])){ $wplc_settings['wplc_enable_font_awesome'] = "1"; }
|
818 |
if(!isset($wplc_settings['wplc_using_localization_plugin'])){ $wplc_settings['wplc_using_localization_plugin'] = 0; }
|
819 |
|
820 |
+
|
821 |
update_option("WPLC_SETTINGS", $wplc_settings);
|
822 |
|
823 |
do_action("wplc_update_hook");
|
832 |
$should_set_transient = apply_filters("wplc_filter_control_set_transient",true);
|
833 |
if ($should_set_transient) {
|
834 |
set_transient("wplc_is_admin_logged_in", "1", 70);
|
|
|
|
|
835 |
}
|
|
|
|
|
|
|
|
|
836 |
}
|
837 |
|
838 |
add_action("wplc_hook_remove_transient","wplc_hook_control_remove_transient",10);
|
847 |
|
848 |
if ($check == 1) {
|
849 |
|
850 |
+
if( $_POST['action'] == 'wplc_a2a_dismiss' ){
|
851 |
+
$uid = get_current_user_id();
|
852 |
+
update_user_meta($uid, 'wplc_a2a_upsell', 1);
|
853 |
+
}
|
854 |
+
|
855 |
if( $_POST['action'] == 'delete_offline_message' ){
|
856 |
|
857 |
global $wplc_tblname_offline_msgs;
|
883 |
}
|
884 |
if ($_POST['action'] == "wplc_admin_set_transient") {
|
885 |
do_action("wplc_hook_set_transient");
|
886 |
+
|
887 |
}
|
888 |
if ($_POST['action'] == "wplc_admin_remove_transient") {
|
889 |
do_action("wplc_hook_remove_transient");
|
890 |
+
|
891 |
}
|
892 |
if ($_POST['action'] == 'wplc_hide_ftt') {
|
893 |
update_option("WPLC_FIRST_TIME_TUTORIAL",true);
|
924 |
function wplc_admin_menu() {
|
925 |
|
926 |
$cap = apply_filters("wplc_ma_filter_menu_control",array());
|
927 |
+
if ( get_option("wplc_seen_surveys") ) { $survey_new = ""; } else { $survey_new = ' <span class="update-plugins"><span class="plugin-count">New</span></span>'; }
|
928 |
|
929 |
$wplc_current_user = get_current_user_id();
|
930 |
|
951 |
|
952 |
add_submenu_page('wplivechat-menu', __('History', 'wplivechat'), __('History', 'wplivechat'), $cap[2], 'wplivechat-menu-history', 'wplc_admin_history_layout');
|
953 |
add_submenu_page('wplivechat-menu', __('Missed Chats', 'wplivechat'), __('Missed Chats', 'wplivechat'), $cap[3], 'wplivechat-menu-missed-chats', 'wplc_admin_missed_chats');
|
954 |
+
|
955 |
/* TO DO
|
956 |
Add a hook here so that the other plugins can add to the menu
|
957 |
Also make sure the function below is controled differently as the pro will not longer exist
|
992 |
function wplc_api_keys_menu() {
|
993 |
$page_content = "<h1>".__("Premium Extension API Keys","wplivechat")."</h3>";
|
994 |
$page_content .= "<p>".__("To find and manage your premium API keys, please visit your <a target='_BLANK' href='https://wp-livechat.com/my-account/'>my account</a> page.","")."</p>";
|
995 |
+
|
996 |
$page_content .= "<hr />";
|
997 |
$page_content = apply_filters("wplc_filter_api_page",$page_content);
|
998 |
|
1024 |
}
|
1025 |
$display_contents = apply_filters("wplc_filter_display_contents",$display_contents);
|
1026 |
|
1027 |
+
if($display_contents && $user_banned == 0){
|
1028 |
|
1029 |
/* do not show if pro is outdated */
|
1030 |
global $wplc_pro_version;
|
1046 |
return;
|
1047 |
}
|
1048 |
|
1049 |
+
if (function_exists("wplc_register_pro_version")) {
|
1050 |
if (function_exists('wplc_basic_hide_chat_when_offline')) {
|
1051 |
$wplc_hide_chat = wplc_basic_hide_chat_when_offline();
|
1052 |
if (!$wplc_hide_chat) {
|
1053 |
if (function_exists("wplc_push_js_to_front_pro")) {
|
1054 |
+
wplc_push_js_to_front_pro();
|
1055 |
}
|
1056 |
}
|
1057 |
} else {
|
1067 |
|
1068 |
|
1069 |
|
1070 |
+
|
1071 |
|
1072 |
}
|
1073 |
|
1086 |
return;
|
1087 |
}
|
1088 |
}
|
1089 |
+
|
1090 |
/* is the chat enabled? */
|
1091 |
if ($wplc_settings["wplc_settings_enabled"] == 2) { return; }
|
1092 |
|
1093 |
wp_register_script('wplc-md5', plugins_url('/js/md5.js', __FILE__),array('wplc-user-script'),$wplc_version);
|
1094 |
wp_enqueue_script('wplc-md5');
|
1095 |
if (isset($wplc_settings['wplc_display_name']) && $wplc_settings['wplc_display_name'] == 1) {
|
1096 |
+
$wplc_display = 'display';
|
1097 |
} else {
|
1098 |
$wplc_display = 'hide';
|
1099 |
}
|
1106 |
$ajaxurl = admin_url('admin-ajax.php');
|
1107 |
$wplc_ajaxurl = $ajaxurl;
|
1108 |
}
|
1109 |
+
|
1110 |
|
1111 |
wp_register_script('wplc-server-script', plugins_url('/js/wplc_server.js', __FILE__), array('jquery'), $wplc_version);
|
1112 |
wp_enqueue_script('wplc-server-script');
|
1113 |
|
1114 |
+
wp_localize_script( 'wplc-server-script', 'wplc_datetime_format', array(
|
1115 |
+
'date_format' => get_option( 'date_format' ),
|
1116 |
+
'time_format' => get_option( 'time_format' ),
|
1117 |
+
) );
|
1118 |
+
|
1119 |
if(isset($wplc_settings['wplc_use_node_server']) && $wplc_settings['wplc_use_node_server'] == 1){
|
1120 |
wp_localize_script('wplc-server-script', 'wplc_use_node_server', "true");
|
1121 |
+
|
1122 |
$wplc_node_token = get_option("wplc_node_server_secret_token");
|
1123 |
if(!$wplc_node_token){
|
1124 |
if(function_exists("wplc_node_server_token_regenerate")){
|
1126 |
$wplc_node_token = get_option("wplc_node_server_secret_token");
|
1127 |
}
|
1128 |
}
|
1129 |
+
wp_localize_script('wplc-server-script', 'bleeper_api_key', $wplc_node_token);
|
1130 |
+
|
1131 |
+
|
1132 |
+
|
1133 |
+
$wplc_end_point_override = get_option("wplc_end_point_override");
|
1134 |
+
if($wplc_end_point_override !== false && $wplc_end_point_override !== ""){
|
1135 |
+
$bleeper_url = $wplc_end_point_override; //Use the override URL
|
1136 |
+
} else {
|
1137 |
+
$bleeper_url = BLEEPER_NODE_SERVER_URL;
|
1138 |
+
}
|
1139 |
+
wp_register_script('wplc-node-server-script', trailingslashit( $bleeper_url ) . "socket.io/socket.io.js", array('jquery'), $wplc_version);
|
1140 |
+
|
1141 |
+
|
1142 |
+
//wp_register_script('wplc-node-server-script', 'http://localhost:3000/socket.io/socket.io.js', array('jquery'), $wplc_version);
|
1143 |
+
wp_enqueue_script('wplc-node-server-script');
|
1144 |
+
wp_register_script('wplc-user-events-script', plugins_url('/js/wplc_u_node_events.js', __FILE__),array('jquery', 'wplc-server-script'),$wplc_version);
|
1145 |
+
|
1146 |
+
wp_localize_script('wplc-server-script', 'bleeper_override_upload_url', rest_url( 'wp_live_chat_support/v1/remote_upload' ) );
|
1147 |
+
|
1148 |
+
if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1) {
|
1149 |
+
$ip_address = false;
|
1150 |
+
if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') { $ip_address = $_SERVER['HTTP_X_FORWARDED_FOR']; } else { $ip_address = $_SERVER['REMOTE_ADDR']; }
|
1151 |
+
|
1152 |
+
if($ip_address !== false){
|
1153 |
+
wp_localize_script('wplc-server-script', 'bleeper_user_ip_address', $ip_address);
|
1154 |
+
}
|
1155 |
+
}
|
1156 |
+
|
1157 |
+
$wplc_end_point_override = get_option("wplc_end_point_override");
|
1158 |
+
if($wplc_end_point_override !== false && $wplc_end_point_override !== ""){
|
1159 |
+
wp_localize_script( 'wplc-server-script', 'bleeper_end_point_override', $wplc_end_point_override );
|
1160 |
+
}
|
1161 |
+
//For node verification
|
1162 |
+
if(function_exists("wplc_pro_activate")){
|
1163 |
+
wp_localize_script('wplc-server-script', 'bleeper_pro_auth', get_option('wp-live-chat-support-pro_key', "false"));
|
1164 |
+
} else {
|
1165 |
+
wp_localize_script('wplc-server-script', 'bleeper_pro_auth', 'false');
|
1166 |
+
}
|
1167 |
+
|
1168 |
+
|
1169 |
+
|
1170 |
+
//Emoji Libs
|
1171 |
+
if(empty($wplc_settings['wplc_disable_emojis']))
|
1172 |
+
{
|
1173 |
+
wp_register_script('wplc-user-js-emoji', "https://bleeper.io/app/assets/wdt-emoji/emoji.min.js", array("wplc-server-script", "wplc-server-script"), $wplc_version, false);
|
1174 |
+
wp_enqueue_script('wplc-user-js-emoji');
|
1175 |
+
wp_register_script('wplc-user-js-emoji-bundle', "https://bleeper.io/app/assets/wdt-emoji/wdt-emoji-bundle.min.js", array("wplc-server-script", "wplc-server-script", "wplc-user-js-emoji"), $wplc_version, false);
|
1176 |
+
wp_enqueue_script('wplc-user-js-emoji-bundle');
|
1177 |
+
|
1178 |
+
wp_register_style( 'wplc-admin-style-emoji', "https://bleeper.io/app/assets/wdt-emoji/wdt-emoji-bundle.css", false, $wplc_version );
|
1179 |
+
wp_enqueue_style( 'wplc-admin-style-emoji' );
|
1180 |
+
}
|
1181 |
|
1182 |
+
} else {
|
1183 |
+
/* not using the node server, load traditional event handler JS */
|
1184 |
+
wp_register_script('wplc-user-events-script', plugins_url('/js/wplc_u_events.js', __FILE__),array('jquery', 'wplc-server-script'),$wplc_version);
|
1185 |
}
|
1186 |
|
1187 |
|
1188 |
|
1189 |
+
|
1190 |
wp_register_script('wplc-user-script', plugins_url('/js/wplc_u.js', __FILE__),array('jquery', 'wplc-server-script'),$wplc_version);
|
1191 |
+
|
1192 |
+
|
1193 |
/**
|
1194 |
* No longer in use as of 6.2.11 as using the minified file causes issues on sites that are minified.
|
1195 |
* @deprecated 6.2.11
|
1197 |
// wp_register_script('wplc-user-script', plugins_url('/js/wplc_u.min.js', __FILE__),array('jquery'),$wplc_version);
|
1198 |
|
1199 |
wp_enqueue_script('wplc-user-script');
|
1200 |
+
wp_enqueue_script('wplc-user-events-script');
|
1201 |
|
1202 |
if (isset($wplc_settings['wplc_newtheme'])) { $wplc_newtheme = $wplc_settings['wplc_newtheme']; } else { }
|
1203 |
if (isset($wplc_newtheme)) {
|
1213 |
}
|
1214 |
} else {
|
1215 |
wp_register_script('wplc-theme-classic', plugins_url('/js/themes/classic.js', __FILE__),array('wplc-user-script'),$wplc_version);
|
1216 |
+
wp_enqueue_script('wplc-theme-classic');
|
1217 |
}
|
1218 |
|
1219 |
|
1227 |
wp_localize_script('wplc-admin-chat-js', 'wplc_ajaxurl', $wplc_ajax_url);
|
1228 |
wp_localize_script('wplc-ma-js', 'wplc_home_ajaxurl', $home_ajax_url);
|
1229 |
|
1230 |
+
//Added rest security nonces
|
1231 |
if(class_exists("WP_REST_Request")) {
|
1232 |
+
wp_localize_script('wplc-user-script', 'wplc_restapi_enabled', '1');
|
1233 |
+
wp_localize_script('wplc-user-script', 'wplc_restapi_token', get_option('wplc_api_secret_token'));
|
1234 |
+
wp_localize_script('wplc-user-script', 'wplc_restapi_endpoint', site_url().'/wp-json/wp_live_chat_support/v1');
|
1235 |
+
wp_localize_script('wplc-user-script', 'wplc_restapi_nonce', wp_create_nonce( 'wp_rest' ));
|
1236 |
+
} else {
|
1237 |
+
wp_localize_script('wplc-user-script', 'wplc_restapi_enabled', '0');
|
1238 |
+
wp_localize_script('wplc-user-script', 'wplc_restapi_nonce', "false");
|
1239 |
}
|
1240 |
|
1241 |
+
|
1242 |
if (isset($wplc_ga_enabled['wplc_enable_ga']) && $wplc_ga_enabled['wplc_enable_ga'] == '1') {
|
1243 |
+
wp_localize_script('wplc-user-script', 'wplc_enable_ga', '1');
|
1244 |
}
|
1245 |
|
1246 |
+
$wplc_ding_file = apply_filters( 'wplc_filter_message_sound', '' );
|
1247 |
+
if ( ! empty( $wplc_ding_file ) ) {
|
1248 |
+
wp_localize_script( 'wplc-user-script', 'bleeper_message_override', $wplc_ding_file );
|
1249 |
+
}
|
1250 |
|
1251 |
$wplc_detect_device = new Mobile_Detect;
|
1252 |
$wplc_is_mobile = $wplc_detect_device->isMobile() ? 'true' : 'false';
|
1253 |
wp_localize_script('wplc-user-script', 'wplc_is_mobile', $wplc_is_mobile);
|
1254 |
|
1255 |
+
|
1256 |
wp_localize_script('wplc-user-script', 'wplc_ajaxurl', $wplc_ajax_url);
|
1257 |
wp_localize_script('wplc-user-script', 'wplc_ajaxurl_site', admin_url('admin-ajax.php'));
|
1258 |
wp_localize_script('wplc-user-script', 'wplc_nonce', $ajax_nonce);
|
1259 |
wp_localize_script('wplc-user-script', 'wplc_plugin_url', plugins_url());
|
1260 |
+
|
1261 |
$wplc_display = false;
|
1262 |
|
1263 |
$wplc_images = apply_filters( 'wplc_get_images_to_preload', array(), $wplc_acbc_data );
|
1264 |
wp_localize_script( 'wplc-user-script', 'wplc_preload_images', $wplc_images );
|
1265 |
|
1266 |
+
|
1267 |
+
|
1268 |
|
1269 |
if( isset($wplc_settings['wplc_show_name']) && $wplc_settings['wplc_show_name'] == '1' ){ $wplc_show_name = true; } else { $wplc_show_name = false; }
|
1270 |
if( isset($wplc_settings['wplc_show_avatar']) && $wplc_settings['wplc_show_avatar'] ){ $wplc_show_avatar = true; } else { $wplc_show_avatar = false; }
|
1271 |
if( isset($wplc_settings['wplc_show_date']) && $wplc_settings['wplc_show_date'] == '1' ){ $wplc_show_date = true; } else { $wplc_show_date = false; }
|
1272 |
if( isset($wplc_settings['wplc_show_time']) && $wplc_settings['wplc_show_time'] == '1' ){ $wplc_show_time = true; } else { $wplc_show_time = false; }
|
1273 |
+
|
1274 |
$wplc_chat_detail = array( 'name' => $wplc_show_name, 'avatar' => $wplc_show_avatar, 'date' => $wplc_show_date, 'time' => $wplc_show_time );
|
|
|
1275 |
|
1276 |
|
1277 |
+
|
1278 |
+
if( $wplc_display !== FALSE && $wplc_display !== 'hide' ){
|
1279 |
wp_localize_script('wplc-user-script', 'wplc_display_name', $wplc_display);
|
1280 |
} else {
|
1281 |
wp_localize_script( 'wplc-user-script', 'wplc_show_chat_detail', $wplc_chat_detail );
|
1282 |
}
|
1283 |
|
1284 |
+
/**
|
1285 |
* Create a JS object for all Agent ID's and Gravatar MD5's
|
1286 |
*/
|
1287 |
$user_array = get_users(array(
|
1296 |
$a_array[$user->ID]['md5'] = md5( $user->user_email );
|
1297 |
}
|
1298 |
}
|
1299 |
+
wp_localize_script('wplc-user-script', 'wplc_agent_data', $a_array);
|
1300 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1301 |
|
1302 |
+
$wplc_error_messages = array(
|
1303 |
+
'valid_name' => __( "Please enter your name", "wplivechat" ),
|
1304 |
+
'valid_email' => __( "Please enter your email address", "wplivechat" ),
|
1305 |
+
'server_connection_lost' => __("Connection to server lost. Please reload this page. Error: ", "wplivechat"),
|
1306 |
+
'chat_ended_by_operator' => ( empty( $wplc_settings['wplc_text_chat_ended'] ) ) ? __("The chat has been ended by the operator.", "wplivechat") : esc_attr( $wplc_settings['wplc_text_chat_ended'] ) ,
|
1307 |
+
'empty_message' => __( "Please enter a message", "wplivechat" ),
|
1308 |
+
'disconnected_message' => __("You have been disconnected", "wplivechat"),
|
1309 |
+
);
|
1310 |
|
1311 |
$wplc_error_messages = apply_filters( "wplc_user_error_messages_filter", $wplc_error_messages );
|
1312 |
|
1320 |
if (!isset($wplc_settings['wplc_pro_offline2'])) { $wplc_settings["wplc_pro_offline2"] = __("Sending message...", "wplivechat"); }
|
1321 |
if (!isset($wplc_settings['wplc_pro_offline3'])) { $wplc_settings["wplc_pro_offline3"] = __("Thank you for your message. We will be in contact soon.", "wplivechat"); }
|
1322 |
|
|
|
|
|
|
|
|
|
1323 |
|
1324 |
+
wp_localize_script('wplc-user-script', 'wplc_offline_msg', __(stripslashes($wplc_settings['wplc_pro_offline2']), 'wplivechat'));
|
1325 |
+
wp_localize_script('wplc-user-script', 'wplc_offline_msg3',__(stripslashes($wplc_settings['wplc_pro_offline3']), 'wplivechat'));
|
1326 |
+
wp_localize_script('wplc-user-script', 'wplc_welcome_msg', __(stripslashes($wplc_settings['wplc_welcome_msg']), 'wplivechat'));
|
1327 |
+
wp_localize_script('wplc-user-script', 'wplc_pro_sst1', __(stripslashes($wplc_settings['wplc_pro_sst1']), 'wplivechat') );
|
1328 |
+
wp_localize_script('wplc-user-script', 'wplc_pro_offline_btn_send', __(stripslashes($wplc_settings['wplc_pro_offline_btn_send']), 'wplivechat') );
|
1329 |
+
wp_localize_script('wplc-user-script', 'wplc_user_default_visitor_name', __(stripslashes($wplc_settings['wplc_user_default_visitor_name']), 'wplivechat') );
|
1330 |
|
1331 |
if( isset( $wplc_acbc_data['wplc_use_wp_name'] ) && $wplc_acbc_data['wplc_use_wp_name'] == '1' ){
|
1332 |
if( isset( $_COOKIE['wplc_cid'] ) ){
|
1333 |
$chat_data = wplc_get_chat_data( $_COOKIE['wplc_cid'] );
|
1334 |
+
if ( isset($chat_data->agent_id ) ) {
|
1335 |
+
$user_info = get_userdata( intval( $chat_data->agent_id ) );
|
1336 |
+
if( $user_info ){
|
1337 |
+
$agent = $user_info->display_name;
|
1338 |
+
} else {
|
1339 |
+
$agent = "agent";
|
1340 |
+
}
|
1341 |
+
} else {
|
1342 |
+
$agent = 'agent';
|
1343 |
+
}
|
1344 |
} else {
|
1345 |
$agent = 'agent';
|
1346 |
}
|
1347 |
+
|
1348 |
} else {
|
1349 |
if (!empty($wplc_acbc_data['wplc_chat_name'])) {
|
1350 |
$agent = $wplc_acbc_data['wplc_chat_name'];
|
1351 |
} else {
|
1352 |
$agent = 'agent';
|
1353 |
}
|
1354 |
+
}
|
1355 |
wp_localize_script('wplc-user-script', 'wplc_localized_string_is_typing', $agent . __(" is typing...","wplivechat"));
|
1356 |
wp_localize_script('wplc-user-script', 'wplc_localized_string_is_typing_single', __(" is typing...","wplivechat"));
|
1357 |
+
|
1358 |
|
1359 |
if( isset( $wplc_settings['wplc_elem_trigger_id'] ) && trim( $wplc_settings['wplc_elem_trigger_id'] ) !== "" ) {
|
1360 |
+
if( isset( $wplc_settings['wplc_elem_trigger_action'] ) ){
|
1361 |
wp_localize_script( 'wplc-user-script', 'wplc_elem_trigger_action', stripslashes( $wplc_settings['wplc_elem_trigger_action'] ) );
|
1362 |
}
|
1363 |
+
if( isset( $wplc_settings['wplc_elem_trigger_type'] ) ){
|
1364 |
wp_localize_script( 'wplc-user-script', 'wplc_elem_trigger_type', stripslashes( $wplc_settings['wplc_elem_trigger_type'] ) );
|
1365 |
}
|
1366 |
wp_localize_script( 'wplc-user-script', 'wplc_elem_trigger_id', stripslashes( $wplc_settings['wplc_elem_trigger_id'] ) );
|
1375 |
|
1376 |
if ($wplc_user_gravatar != "") { $wplc_grav_image = "<img src='//www.gravatar.com/avatar/$wplc_user_gravatar?s=30' class='wplc-user-message-avatar' />";} else { $wplc_grav_image = "";}
|
1377 |
|
1378 |
+
if ( ! empty($wpcl_grav_image ) ) {
|
1379 |
+
wp_localize_script( 'wplc-user-script', 'wplc_gravatar_image', $wplc_grav_image );
|
1380 |
+
} else {
|
1381 |
+
wp_localize_script( 'wplc-user-script', 'wplc_gravatar_image', ' ' );
|
1382 |
+
}
|
1383 |
|
1384 |
$wplc_hide_chat = "";
|
1385 |
if (get_option('WPLC_HIDE_CHAT') == TRUE) { $wplc_hide_chat = "yes"; } else { $wplc_hide_chat = null; }
|
1395 |
do_action("wplc_hook_push_js_to_front");
|
1396 |
|
1397 |
}
|
1398 |
+
if (function_exists('wplc_pro_user_top_js')) {
|
1399 |
add_action('wp_head', 'wplc_pro_user_top_js');
|
1400 |
|
1401 |
} else {
|
1407 |
|
1408 |
/**
|
1409 |
* Add to the array to determine which images need to be preloaded via JS on the front end.
|
1410 |
+
*
|
1411 |
* @param array $images Array of images to be preloaded
|
1412 |
* @return array
|
1413 |
*/
|
1528 |
*/
|
1529 |
function wplc_hook_control_check_mobile() {
|
1530 |
$wplc_settings = get_option("WPLC_SETTINGS");
|
1531 |
+
|
1532 |
$draw_box = false;
|
1533 |
|
1534 |
if (!class_exists('Mobile_Detect')) {
|
1535 |
require_once (plugin_dir_path(__FILE__) . 'includes/Mobile_Detect.php');
|
1536 |
}
|
1537 |
+
|
1538 |
$wplc_detect_device = new Mobile_Detect;
|
1539 |
$wplc_is_mobile = $wplc_detect_device->isMobile();
|
1540 |
+
|
1541 |
if ($wplc_is_mobile && !isset($wplc_settings['wplc_enabled_on_mobile']) && $wplc_settings['wplc_enabled_on_mobile'] != 1) {
|
1542 |
return "";
|
1543 |
}
|
1544 |
+
|
1545 |
if (function_exists('wplc_basic_hide_chat_when_offline')) {
|
1546 |
$wplc_hide_chat = wplc_basic_hide_chat_when_offline();
|
1547 |
if (!$wplc_hide_chat) {
|
1554 |
remove_action("wplc_hook_output_box_body","wplc_hook_control_show_chat_box");
|
1555 |
remove_action("wplc_hook_output_box_footer","wplc_action_control_hook_output_box_footer");
|
1556 |
}
|
1557 |
+
|
1558 |
}
|
1559 |
|
1560 |
|
1587 |
global $wplc_pro_version;
|
1588 |
if (intval(str_replace(".","",$wplc_pro_version)) < 5100) {
|
1589 |
|
1590 |
+
echo wplc_output_box_ajax();
|
1591 |
|
1592 |
} else {
|
1593 |
echo wplc_output_box_ajax_new($cid);
|
1594 |
}
|
1595 |
} else {
|
1596 |
echo wplc_output_box_ajax_new($cid);
|
1597 |
+
|
1598 |
}
|
1599 |
+
|
1600 |
}
|
1601 |
|
1602 |
/* basic */
|
1624 |
/**
|
1625 |
* Filter to control the top MAIN DIV of the chat box
|
1626 |
* @param array $wplc_settings Live chat settings array
|
1627 |
+
* @return string
|
1628 |
* @since 6.0.00
|
1629 |
* @author Nick Duncan <nick@codecabin.co.za>
|
1630 |
*/
|
1632 |
$ret_msg = "";
|
1633 |
$wplc_class = "";
|
1634 |
// $wplc_settings = get_option("WPLC_SETTINGS");
|
1635 |
+
|
1636 |
if ($wplc_settings["wplc_settings_align"] == 1) {
|
1637 |
$original_pos = "bottom_left";
|
1638 |
} else if ($wplc_settings["wplc_settings_align"] == 2) {
|
1671 |
}
|
1672 |
}
|
1673 |
|
1674 |
+
|
1675 |
$wplc_extra_attr = apply_filters("wplc_filter_chat_header_extra_attr","");
|
1676 |
if (isset($wplc_settings['wplc_newtheme'])) { $wplc_newtheme = $wplc_settings['wplc_newtheme']; } else { }
|
1677 |
if (isset($wplc_newtheme)) {
|
1718 |
/**
|
1719 |
* Filter to control the top HEADER DIV of the chat box
|
1720 |
* @param array $wplc_settings Live chat settings array
|
1721 |
+
* @return string
|
1722 |
* @since 6.0.00
|
1723 |
* @author Nick Duncan <nick@codecabin.co.za>
|
1724 |
*/
|
1741 |
function wplc_filter_control_chat_header_under($ret_msg,$wplc_settings) {
|
1742 |
$current_theme = isset($wplc_settings['wplc_newtheme']) ? $wplc_settings['wplc_newtheme'] : "";
|
1743 |
if($current_theme === "theme-2"){
|
1744 |
+
|
1745 |
if (function_exists("wplc_acbc_filter_control_chat_header_under")) {
|
1746 |
+
remove_filter("wplc_filter_chat_header_under","wplc_acbc_filter_control_chat_header_under");
|
1747 |
}
|
1748 |
}
|
1749 |
|
1756 |
/**
|
1757 |
* Filter to control the user details section - custom fields coming soon
|
1758 |
* @param array $wplc_settings Live chat settings array
|
1759 |
+
* @return string
|
1760 |
* @since 6.0.00
|
1761 |
* @author Nick Duncan <nick@codecabin.co.za>
|
1762 |
*/
|
1825 |
$ret_msg .= apply_filters("wplc_start_chat_user_form_after_filter", "");
|
1826 |
} else {
|
1827 |
//Dont ask the user
|
1828 |
+
|
1829 |
$ret_msg .= "<div style=\"padding: 7px; text-align: center;\">";
|
1830 |
if (isset($wplc_settings['wplc_user_alternative_text'])) {
|
1831 |
$ret_msg .= html_entity_decode( stripslashes($wplc_settings['wplc_user_alternative_text']) );
|
1832 |
}
|
1833 |
+
$ret_msg .= '</div>';
|
1834 |
|
1835 |
$wplc_random_user_number = rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9);
|
1836 |
//$wplc_loggedin_user_email = $wplc_random_user_number."@".$wplc_random_user_number.".com";
|
1847 |
/**
|
1848 |
* Filter to control the start chat button
|
1849 |
* @param array $wplc_settings Live chat settings array
|
1850 |
+
* @return string
|
1851 |
* @since 6.0.00
|
1852 |
* @author Nick Duncan <nick@codecabin.co.za>
|
1853 |
*/
|
1864 |
/**
|
1865 |
* Filter to control the hover card start chat button
|
1866 |
* @param array $wplc_settings Live chat settings array
|
1867 |
+
* @return string
|
1868 |
* @since 6.1.00
|
1869 |
* @author Nick Duncan <nick@codecabin.co.za>
|
1870 |
*/
|
1886 |
/**
|
1887 |
* Filter to control the offline message button
|
1888 |
* @param array $wplc_settings Live chat settings array
|
1889 |
+
* @return string
|
1890 |
* @since 6.0.00
|
1891 |
* @author Nick Duncan <nick@codecabin.co.za>
|
1892 |
*/
|
1893 |
function wplc_filter_control_live_chat_box_html_send_offline_message_button($wplc_settings) {
|
1894 |
$wplc_settings = get_option('WPLC_SETTINGS');
|
1895 |
if (isset($wplc_settings['wplc_theme'])) { $wplc_theme = $wplc_settings['wplc_theme']; } else { }
|
1896 |
+
|
1897 |
if (isset($wplc_theme)) {
|
1898 |
if($wplc_theme == 'theme-1') {
|
1899 |
$wplc_settings_fill = "#DB0000";
|
1955 |
* Filter to control the 2nd layer of the chat window (online/offline)
|
1956 |
* @param array $wplc_settings Live chat settings array
|
1957 |
* @param bool $logged_in Is the user logged in or not
|
1958 |
+
* @return string
|
1959 |
* @since 6.0.00
|
1960 |
* @author Nick Duncan <nick@codecabin.co.za>
|
1961 |
*/
|
1968 |
|
1969 |
$ret_msg = "<div id=\"wp-live-chat-2-inner\">";
|
1970 |
$ret_msg .= " <div id=\"wp-live-chat-2-info\" class='wplc-color-4'>";
|
1971 |
+
$ret_msg .= apply_filters("wplc_filter_intro_text_heading", $text, $wplc_settings);
|
1972 |
$ret_msg .= " </div>";
|
1973 |
+
$ret_msg .= apply_filters("wplc_filter_live_chat_box_html_ask_user_details",wplc_filter_control_live_chat_box_html_ask_user_detail($wplc_settings));
|
1974 |
+
$ret_msg .= apply_filters("wplc_filter_live_chat_box_html_start_chat_button",wplc_filter_control_live_chat_box_html_start_chat_button($wplc_settings,$wplc_using_locale ), $cid);
|
1975 |
$ret_msg .= "</div>";
|
1976 |
} else {
|
1977 |
if ( isset( $wplc_settings['wplc_loggedin_user_info'] ) && $wplc_settings['wplc_loggedin_user_info'] == 1 ) {
|
2019 |
}
|
2020 |
|
2021 |
if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1) { $offline_ip_address = $ip_address; } else { $offline_ip_address = ""; }
|
2022 |
+
|
2023 |
$ret_msg .= "<input type=\"hidden\" name=\"wplc_ip_address\" id=\"wplc_ip_address\" value=\"".$offline_ip_address."\" />";
|
2024 |
$ret_msg .= "<input type=\"hidden\" name=\"wplc_domain_offline\" id=\"wplc_domain_offline\" value=\"".site_url()."\" />";
|
2025 |
+
$ret_msg .= apply_filters("wplc_filter_live_chat_box_html_send_offline_message_button",wplc_filter_control_live_chat_box_html_send_offline_message_button($wplc_settings));
|
2026 |
$ret_msg .= "</div>";
|
2027 |
|
2028 |
|
2048 |
/**
|
2049 |
* Filter to control the 3rd layer of the chat window
|
2050 |
* @param array $wplc_settings live chat settings array
|
2051 |
+
* @return string
|
2052 |
* @since 6.0.00
|
2053 |
* @author Nick Duncan <nick@codecabin.co.za>
|
2054 |
*/
|
2062 |
return $ret_msg;
|
2063 |
}
|
2064 |
|
2065 |
+
add_filter("wplc_filter_intro_text_heading", "wplc_filter_control_intro_text_heading", 10, 2);
|
2066 |
+
/**
|
2067 |
+
* Filters intro text
|
2068 |
+
*/
|
2069 |
+
function wplc_filter_control_intro_text_heading($content, $wplc_settings){
|
2070 |
+
|
2071 |
+
if (isset($wplc_settings['wplc_require_user_info']) && $wplc_settings['wplc_require_user_info'] == 1) {
|
2072 |
+
|
2073 |
+
} elseif (isset($wplc_settings['wplc_require_user_info']) && $wplc_settings['wplc_require_user_info'] == 'email') {
|
2074 |
+
|
2075 |
+
} elseif (isset($wplc_settings['wplc_require_user_info']) && $wplc_settings['wplc_require_user_info'] == 'name') {
|
2076 |
+
|
2077 |
+
} else {
|
2078 |
+
$content = "";
|
2079 |
+
}
|
2080 |
+
|
2081 |
+
return $content;
|
2082 |
+
}
|
2083 |
+
|
2084 |
|
2085 |
add_filter("wplc_filter_live_chat_box_above_main_div","wplc_filter_control_live_chat_box_above_main_div",10,3);
|
2086 |
function wplc_filter_control_live_chat_box_above_main_div( $msg, $wplc_settings, $cid ) {
|
2097 |
$a_website = '';
|
2098 |
$social_links = '';
|
2099 |
$agent_string = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2100 |
|
2101 |
+
if(isset($wplc_settings['wplc_use_node_server']) && intval($wplc_settings['wplc_use_node_server']) == 1) {} else {
|
2102 |
+
if ( $cid ) {
|
2103 |
+
$cid = wplc_return_chat_id_by_rel($cid);
|
2104 |
+
$chat_data = wplc_get_chat_data( $cid );
|
2105 |
|
2106 |
+
if ( isset( $chat_data->agent_id ) ) {
|
2107 |
+
$agent_id = intval( $chat_data->agent_id );
|
2108 |
+
} else {
|
2109 |
+
$agent_id = get_current_user_id();
|
2110 |
+
}
|
2111 |
|
2112 |
+
if ( $agent_id ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2113 |
|
2114 |
+
$wplc_acbc_data = get_option("WPLC_ACBC_SETTINGS");
|
2115 |
+
$user_info = get_userdata( $agent_id );
|
2116 |
|
|
|
|
|
|
|
|
|
|
|
|
|
2117 |
|
2118 |
+
if( isset( $wplc_acbc_data['wplc_use_wp_name'] ) && $wplc_acbc_data['wplc_use_wp_name'] == '1' ){
|
|
|
2119 |
|
2120 |
+
$agent = $user_info->display_name;
|
2121 |
+
} else {
|
2122 |
+
if (!empty($wplc_acbc_data['wplc_chat_name'])) {
|
2123 |
+
$agent = $wplc_acbc_data['wplc_chat_name'];
|
2124 |
+
} else {
|
2125 |
+
$agent = 'Admin';
|
2126 |
+
}
|
2127 |
+
}
|
2128 |
+
$cbox_header_bg = "style='background-image:url(https://www.gravatar.com/avatar/".md5($user_info->user_email)."?s=380); no-repeat; cover;'";
|
2129 |
+
|
2130 |
+
$extra = apply_filters( "wplc_filter_further_live_chat_box_above_main_div", '', $wplc_settings, $cid, $chat_data, $agent );
|
2131 |
+
|
2132 |
+
$agent_string = '
|
2133 |
+
<p style="text-align:center;">
|
2134 |
+
<img class="img-thumbnail img-circle wplc_thumb32 wplc_agent_involved" style="max-width:inherit;" id="agent_grav_'.$agent_id.'" title="'.$agent.'" src="https://www.gravatar.com/avatar/'.md5($user_info->user_email).'?s=60" /><br />
|
2135 |
+
<span class="wplc_agent_name wplc-color-2">'.$agent.'</span>
|
2136 |
+
'.$extra.'
|
2137 |
+
<span class="bleeper_pullup down"><i class="fa fa-angle-up"></i></span>
|
2138 |
+
</p>';
|
2139 |
+
|
2140 |
+
}
|
2141 |
+
}
|
2142 |
+
|
2143 |
+
}
|
2144 |
+
|
2145 |
+
$msg .= "<div id='wplc_chatbox_header_bg' ".$cbox_header_bg."><div id='wplc_chatbox_header' class='wplc-color-bg-1 wplc-color-4'><div class='wplc_agent_info'>".$agent_string."</div></div></div>";
|
2146 |
|
2147 |
}
|
2148 |
return $msg;
|
2151 |
/**
|
2152 |
* Filter to control the 4th layer of the chat window
|
2153 |
* @param array $wplc_settings live chat settings array
|
2154 |
+
* @return string
|
2155 |
* @since 6.0.00
|
2156 |
* @author Nick Duncan <nick@codecabin.co.za>
|
2157 |
*/
|
2162 |
|
2163 |
$wplc_welcome = __('Welcome. How may I help you?', 'wplivechat');
|
2164 |
if (!isset($wplc_settings['wplc_user_welcome_chat']) || $wplc_settings['wplc_user_welcome_chat'] == "") { $wplc_settings['wplc_user_welcome_chat'] = $wplc_welcome; }
|
2165 |
+
$text2 = ($wplc_using_locale ? $wplc_welcome : stripslashes($wplc_settings['wplc_user_welcome_chat']));
|
2166 |
+
|
2167 |
+
|
2168 |
|
2169 |
|
|
|
|
|
2170 |
|
2171 |
$ret_msg = "";
|
2172 |
if (isset($wplc_settings['wplc_newtheme']) && $wplc_settings['wplc_newtheme'] == 'theme-1') {
|
2173 |
$ret_msg .= apply_filters("wplc_filter_typing_control_div","");
|
2174 |
}
|
2175 |
$ret_msg .= "<div id=\"wplc_sound_update\" style=\"height:0; width:0; display:none; border:0;\"></div>";
|
2176 |
+
|
2177 |
$ret_msg .= apply_filters("wplc_filter_live_chat_box_above_main_div","",$wplc_settings, $cid);
|
2178 |
|
2179 |
|
2185 |
// $ret_msg .= "<div class='wplc-clear-float-message'></div>";
|
2186 |
$ret_msg .= "</div>";
|
2187 |
|
2188 |
+
$ret_msg .= "<div id='bleeper_chat_ended' style='display:none;'></div>";
|
2189 |
$ret_msg .= "<div id='wplc_user_message_div'>";
|
2190 |
|
2191 |
$ret_msg .= "<p id='wplc_msg_notice'>".$text."</p>";
|
2195 |
|
2196 |
$ret_msg .= "<p>";
|
2197 |
$placeholder = __('Type here','wplivechat');
|
2198 |
+
$ret_msg .= "<textarea type=\"text\" name=\"wplc_chatmsg\" id=\"wplc_chatmsg\" placeholder=\"".$placeholder."\" onclick=\"jQuery(this).select();\" class='wdt-emoji-bundle-enabled'></textarea>";
|
2199 |
if (isset($wplc_settings['wplc_newtheme']) && $wplc_settings['wplc_newtheme'] == 'theme-2') {
|
2200 |
$ret_msg .= apply_filters("wplc_filter_typing_control_div_theme_2","");
|
2201 |
}
|
2207 |
$ret_msg .= "<input id=\"wplc_send_msg\" type=\"button\" value=\"".__("Send", "wplivechat")."\" style=\"display:none;\" />";
|
2208 |
$ret_msg .= "</p>";
|
2209 |
|
2210 |
+
$ret_msg .= function_exists("wplc_emoji_selector_div") ? wplc_emoji_selector_div() : "";
|
2211 |
+
|
2212 |
$current_theme = isset($wplc_settings['wplc_newtheme']) ? $wplc_settings['wplc_newtheme'] : "";
|
2213 |
if($current_theme === "theme-2"){
|
2214 |
$ret_msg .= apply_filters("wplc_filter_chat_4th_layer_below_input","", $wplc_settings); //Ratings/Social Icon Filter
|
2224 |
* @param array $wplc_settings live chat settings array
|
2225 |
* @param bool $logged_in Is the admin logged in or not
|
2226 |
* @param bool $wplc_using_locale Are they using a localization plugin
|
2227 |
+
* @return string
|
2228 |
* @since 6.0.00
|
2229 |
* @author Nick Duncan <nick@codecabin.co.za>
|
2230 |
*/
|
2231 |
function wplc_filter_control_live_chat_box_html_1st_layer($wplc_settings,$logged_in,$wplc_using_locale, $class_override = false) {
|
2232 |
|
2233 |
$ret_msg = "<div id='wplc_first_message'>";
|
2234 |
+
|
2235 |
if ($logged_in) {
|
2236 |
$wplc_fst_1 = __('Questions?', 'wplivechat');
|
2237 |
$wplc_fst_2 = __('Chat with us', 'wplivechat');
|
2250 |
|
2251 |
$ret_msg .= $wplc_tl_msg;
|
2252 |
} else {
|
2253 |
+
|
2254 |
+
|
2255 |
$wplc_na = __('Chat offline. Leave a message', 'wplivechat');
|
2256 |
$wplc_tl_msg = "<span class='wplc_offline'>" . ($wplc_using_locale ? $wplc_na : stripslashes($wplc_settings['wplc_pro_na'])) . "</span>";
|
2257 |
$ret_msg .= $wplc_tl_msg;
|
2284 |
add_filter("wplc_loggedin_filter","wplc_filter_control_loggedin",10,1);
|
2285 |
function wplc_filter_control_loggedin($logged_in) {
|
2286 |
$wplc_is_admin_logged_in = get_transient("wplc_is_admin_logged_in");
|
2287 |
+
|
2288 |
if (!function_exists("wplc_register_pro_version") && $wplc_is_admin_logged_in != 1) {
|
2289 |
$logged_in = false;
|
2290 |
} else {
|
2291 |
$logged_in = true;
|
2292 |
}
|
2293 |
+
|
2294 |
$logged_in_checks = apply_filters("wplc_filter_is_admin_logged_in",array());
|
2295 |
/* if we are logged in ANYWHERE, set this to true */
|
2296 |
foreach($logged_in_checks as $key => $val) {
|
2298 |
}
|
2299 |
$logged_in_via_app = false;
|
2300 |
if (isset($logged_in_checks['app']) && $logged_in_checks['app'] == true) { $logged_in_via_app = true; }
|
2301 |
+
|
2302 |
$logged_in = apply_filters("wplc_final_loggedin_control",$logged_in,$logged_in_via_app);
|
2303 |
+
|
2304 |
/* admin is using the basic version and is logged in */
|
2305 |
if ($wplc_is_admin_logged_in) { $logged_in = true; }
|
2306 |
|
|
|
2307 |
return $logged_in;
|
2308 |
}
|
2309 |
|
2324 |
*/
|
2325 |
function wplc_output_box_ajax_new($cid = null) {
|
2326 |
|
2327 |
+
|
2328 |
$ret_msg = array();
|
2329 |
$logged_in = false;
|
2330 |
|
2331 |
$wplc_settings = get_option("WPLC_SETTINGS");
|
2332 |
|
2333 |
if(isset($wplc_settings['wplc_using_localization_plugin']) && $wplc_settings['wplc_using_localization_plugin'] == 1){ $wplc_using_locale = true; } else { $wplc_using_locale = false; }
|
|
|
|
|
|
|
|
|
|
|
|
|
2334 |
|
2335 |
|
2336 |
+
$logged_in = apply_filters("wplc_loggedin_filter",false);
|
2337 |
|
2338 |
+
$ret_msg['cbox'] = apply_filters("wplc_theme_control",$wplc_settings,$logged_in,$wplc_using_locale,$cid);
|
2339 |
|
2340 |
$ret_msg['online'] = $logged_in;
|
2341 |
+
|
2342 |
global $wplc_pro_version;
|
2343 |
$wplc_ver = str_replace('.', '', $wplc_pro_version);
|
2344 |
+
$checker = intval($wplc_ver);
|
2345 |
|
2346 |
+
if ($cid !== null && $cid !== '') {
|
2347 |
+
$ret_msg['cid'] = $cid;
|
2348 |
$chat_data = wplc_get_chat_data( $cid );
|
|
|
2349 |
wplc_record_chat_notification('user_loaded',$cid,array('uri' => $_SERVER['HTTP_REFERER'], 'chat_data' => $chat_data ));
|
2350 |
+
|
2351 |
+
|
2352 |
+
|
2353 |
if ( !isset($chat_data) || !$chat_data->agent_id ) {
|
2354 |
$ret_msg['type'] = 'new';
|
2355 |
} else {
|
2356 |
$ret_msg['type'] = 'returning';
|
2357 |
|
2358 |
+
if(isset($wplc_settings['wplc_use_node_server']) && intval($wplc_settings['wplc_use_node_server']) == 1) {
|
2359 |
+
//This is using node, we shouldn't generate the header data as part of the chat box.
|
2360 |
+
//We will do this dynamically on the front end
|
2361 |
+
|
2362 |
+
|
2363 |
+
|
2364 |
+
} else {
|
2365 |
+
/* build the AGENT DATA array */
|
2366 |
+
$wplc_acbc_data = get_option("WPLC_ACBC_SETTINGS");
|
2367 |
+
$user_info = get_userdata( intval( $chat_data->agent_id ) );
|
2368 |
+
|
2369 |
+
$agent_tagline = '';
|
2370 |
+
$agent_bio = '';
|
2371 |
+
$a_twitter = '';
|
2372 |
+
$a_linkedin = '';
|
2373 |
+
$a_facebook = '';
|
2374 |
+
$a_website = '';
|
2375 |
+
$social_links = '';
|
2376 |
+
|
2377 |
+
if( isset( $wplc_acbc_data['wplc_use_wp_name'] ) && $wplc_acbc_data['wplc_use_wp_name'] == '1' ){
|
2378 |
+
|
2379 |
+
$agent = $user_info->display_name;
|
2380 |
+
} else {
|
2381 |
+
if (!empty($wplc_acbc_data['wplc_chat_name'])) {
|
2382 |
+
$agent = $wplc_acbc_data['wplc_chat_name'];
|
2383 |
+
} else {
|
2384 |
+
$agent = 'Admin';
|
2385 |
+
}
|
2386 |
+
}
|
2387 |
+
|
2388 |
+
if( !isset( $data ) ){ $data = false; }
|
2389 |
+
|
2390 |
+
$agent_tagline = apply_filters( "wplc_filter_agent_data_agent_tagline", $agent_tagline, $cid, $chat_data, $agent, $wplc_acbc_data, $user_info, $data );
|
2391 |
+
$agent_bio = apply_filters( "wplc_filter_agent_data_agent_bio", $agent_bio, $cid, $chat_data, $agent, $wplc_acbc_data, $user_info, $data );
|
2392 |
+
$social_links = apply_filters( "wplc_filter_agent_data_social_links", $social_links, $cid, $chat_data, $agent, $wplc_acbc_data, $user_info, $data);
|
2393 |
+
|
2394 |
+
$ret_msg['agent_data'] = array(
|
2395 |
+
'email' => md5($user_info->user_email),
|
2396 |
+
'name' => $agent,
|
2397 |
+
'aid' => $user_info->ID,
|
2398 |
+
'agent_tagline' => $agent_tagline,
|
2399 |
+
'agent_bio' => $agent_bio,
|
2400 |
+
"social_links" => $social_links
|
2401 |
+
);
|
2402 |
+
}
|
2403 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2404 |
}
|
2405 |
|
2406 |
|
2407 |
+
} else {
|
2408 |
+
$ret_msg['type'] = 'new';
|
2409 |
}
|
2410 |
+
|
2411 |
|
2412 |
if (function_exists("wplc_pro_version_control")) {
|
2413 |
if ($checker < 6000) {
|
2414 |
/* backwards compatibilitty for the old pro version */
|
2415 |
return json_encode($ret_msg['cbox']);
|
2416 |
} else {
|
2417 |
+
return json_encode($ret_msg);
|
2418 |
}
|
2419 |
|
2420 |
} else {
|
2422 |
}
|
2423 |
|
2424 |
|
2425 |
+
|
2426 |
|
2427 |
|
2428 |
|
2434 |
$ret_msg .= " <i id=\"wp-live-chat-minimize\" class=\"fa fa-minus wplc-color-bg-2 wplc-color-1\" style=\"display:none;\"></i>";
|
2435 |
$ret_msg .= " <i id=\"wp-live-chat-close\" class=\"fa fa-times\" style=\"display:none;\" ></i>";
|
2436 |
$ret_msg .= " <div id=\"wp-live-chat-1\" >";
|
2437 |
+
$ret_msg .= apply_filters("wplc_filter_live_chat_box_html_1st_layer",wplc_filter_control_live_chat_box_html_1st_layer($wplc_settings,$logged_in,$wplc_using_locale,'wplc-color-2'));
|
2438 |
$ret_msg .= " </div>";
|
2439 |
$ret_msg .= '<div id="wplc-chat-alert" class="wplc-chat-alert wplc-chat-alert--' . $wplc_settings["wplc_theme"] . '"></div>';
|
2440 |
$ret_msg .= " </div>";
|
2441 |
$ret_msg .= " <div id=\"wp-live-chat-2\" style=\"display:none;\">";
|
2442 |
$ret_msg .= apply_filters("wplc_filter_live_chat_box_survey","");
|
2443 |
+
$ret_msg .= apply_filters("wplc_filter_live_chat_box_html_2nd_layer",wplc_filter_control_live_chat_box_html_2nd_layer($wplc_settings,$logged_in,$wplc_using_locale,$cid), $cid);
|
2444 |
$ret_msg .= " </div>";
|
2445 |
$ret_msg .= " <div id=\"wp-live-chat-3\" style=\"display:none;\">";
|
2446 |
+
$ret_msg .= apply_filters("wplc_filter_live_chat_box_html_3rd_layer",wplc_filter_control_live_chat_box_html_3rd_layer($wplc_settings,$wplc_using_locale));
|
2447 |
$ret_msg .= " </div>";
|
2448 |
$ret_msg .= " <div id=\"wp-live-chat-react\" style=\"display:none;\">";
|
2449 |
$ret_msg .= " <p>".__("Reactivating your previous chat...", "wplivechat")."</p>";
|
2450 |
$ret_msg .= " </div>";
|
2451 |
$ret_msg .= " <div id=\"wplc-extra-div\" style=\"display:none;\">";
|
2452 |
+
$ret_msg .= apply_filters("wplc_filter_wplc_extra_div","",$wplc_settings,$wplc_using_locale);
|
2453 |
$ret_msg .= "</div>";
|
2454 |
$ret_msg .= "</div>";
|
2455 |
$ret_msg .= " <div id=\"wp-live-chat-4\" style=\"display:none;\">";
|
2456 |
+
$ret_msg .= apply_filters("wplc_filter_live_chat_box_html_4th_layer",wplc_filter_control_live_chat_box_html_4th_layer($wplc_settings,$wplc_using_locale, $cid));
|
2457 |
$ret_msg .= "</div>";
|
2458 |
return $ret_msg;
|
2459 |
}
|
2464 |
|
2465 |
if (!$wplc_settings) { return ""; }
|
2466 |
if (isset($wplc_settings['wplc_newtheme'])) { $wplc_newtheme = $wplc_settings['wplc_newtheme']; } else { }
|
2467 |
+
|
2468 |
$default_theme = wplc_return_default_theme($wplc_settings,$logged_in,$wplc_using_locale, $cid);
|
2469 |
if (isset($wplc_newtheme)) {
|
2470 |
|
2471 |
|
2472 |
+
|
2473 |
|
2474 |
|
2475 |
|
2488 |
$ret_msg .= " <i id=\"wp-live-chat-minimize\" class=\"fa fa-minus wplc-color-bg-2 wplc-color-1\" style=\"display:none;\" ></i>";
|
2489 |
$ret_msg .= " <i id=\"wp-live-chat-close\" class=\"fa fa-times\" style=\"display:none;\" ></i>";
|
2490 |
$ret_msg .= " <div id=\"wplc-extra-div\" style=\"display:none;\">";
|
2491 |
+
$ret_msg .= apply_filters("wplc_filter_wplc_extra_div","",$wplc_settings,$wplc_using_locale);
|
2492 |
$ret_msg .= " </div>";
|
2493 |
$ret_msg .= " <div id='wp-live-chat-inner-container'>";
|
2494 |
$ret_msg .= " <div id='wp-live-chat-inner'>";
|
2495 |
$ret_msg .= " <div id=\"wp-live-chat-1\" class=\"wplc-color-2 wplc-color-bg-1\" >";
|
2496 |
+
$ret_msg .= apply_filters("wplc_filter_live_chat_box_html_1st_layer",wplc_filter_control_live_chat_box_html_1st_layer($wplc_settings,$logged_in,$wplc_using_locale,'wplc-color-2'));
|
2497 |
$ret_msg .= " </div>";
|
2498 |
+
$ret_msg .= apply_filters("wplc_filter_live_chat_box_html_2nd_layer",wplc_filter_control_live_chat_box_html_2nd_layer($wplc_settings,$logged_in,$wplc_using_locale, $cid), $cid);
|
2499 |
$ret_msg .= " </div>";
|
2500 |
$ret_msg .= " <div id=\"wp-live-chat-react\" style=\"display:none;\">";
|
2501 |
$ret_msg .= " <p>".__("Reactivating your previous chat...", "wplivechat")."</p>";
|
2502 |
$ret_msg .= " </div>";
|
2503 |
$ret_msg .= " </div>";
|
2504 |
$ret_msg .= " <div id=\"wp-live-chat-3\" style=\"display:none;\">";
|
2505 |
+
$ret_msg .= apply_filters("wplc_filter_live_chat_box_html_3rd_layer",wplc_filter_control_live_chat_box_html_3rd_layer($wplc_settings,$wplc_using_locale));
|
2506 |
$ret_msg .= " </div>";
|
2507 |
$ret_msg .= " </div>";
|
2508 |
$ret_msg .= " <div id=\"wp-live-chat-4\" style=\"display:none;\">";
|
2509 |
+
$ret_msg .= apply_filters("wplc_filter_live_chat_box_html_4th_layer",wplc_filter_control_live_chat_box_html_4th_layer($wplc_settings,$wplc_using_locale, $cid));
|
2510 |
$ret_msg .= " </div>";
|
2511 |
|
2512 |
+
$ret_msg .= "</div>";
|
2513 |
|
2514 |
} else {
|
2515 |
$ret_msg = $default_theme;
|
2516 |
}
|
2517 |
} else {
|
2518 |
$ret_msg = $default_theme;
|
2519 |
+
}
|
2520 |
|
2521 |
+
return $ret_msg;
|
2522 |
}
|
2523 |
|
2524 |
|
2532 |
global $wplc_pro_version;
|
2533 |
$wplc_ver = str_replace('.', '', $wplc_pro_version);
|
2534 |
$checker = intval($wplc_ver);
|
2535 |
+
|
2536 |
if (function_exists("wplc_pro_version_control") && ($checker <= 501 || $checker == 4410)) {
|
2537 |
/* prior to latest pro version with ajax handling */
|
2538 |
|
2547 |
} else {
|
2548 |
$user_banned = 0;
|
2549 |
}
|
2550 |
+
if($display_contents && $user_banned == 0){
|
2551 |
$wplc_is_admin_logged_in = get_transient("wplc_is_admin_logged_in");
|
2552 |
if ($wplc_is_admin_logged_in != 1) {
|
2553 |
echo "<!-- wplc a-n-c -->";
|
2601 |
} else {
|
2602 |
$user_banned = 0;
|
2603 |
}
|
2604 |
+
if($display_contents && $user_banned == 0){
|
2605 |
$wplc_is_admin_logged_in = get_transient("wplc_is_admin_logged_in");
|
2606 |
if ($wplc_is_admin_logged_in != 1) {
|
2607 |
return "";
|
2644 |
global $wpdb;
|
2645 |
global $wplc_tblname_msgs;
|
2646 |
$results = $wpdb->get_results(
|
2647 |
+
"
|
2648 |
SELECT *
|
2649 |
FROM $wplc_tblname_msgs
|
2650 |
WHERE `chat_sess_id` = '$cid'
|
2660 |
echo $msg_hist;
|
2661 |
}
|
2662 |
|
2663 |
+
function wplc_admin_accept_chat($cid) {
|
2664 |
$user_ID = get_current_user_id();
|
2665 |
wplc_change_chat_status(sanitize_text_field($cid), 3,$user_ID);
|
2666 |
return true;
|
2669 |
add_action('admin_head', 'wplc_update_chat_statuses');
|
2670 |
|
2671 |
|
2672 |
+
//add_action("wplc_hook_superadmin_head","wplc_hook_control_superadmin_head",10);
|
2673 |
+
// Deprecated as this as now been added to wplc_heartbeat.js
|
2674 |
function wplc_hook_control_superadmin_head() {
|
2675 |
$wplc_current_user = get_current_user_id();
|
2676 |
|
2694 |
|
2695 |
};
|
2696 |
jQuery.post(ajaxurl, data, function (response) {
|
2697 |
+
|
2698 |
});
|
2699 |
}
|
2700 |
|
2701 |
});
|
2702 |
</script>
|
2703 |
+
<?php
|
2704 |
}
|
2705 |
}
|
2706 |
|
2707 |
|
2708 |
function wplc_superadmin_javascript() {
|
2709 |
+
$wplc_settings = get_option("WPLC_SETTINGS");
|
|
|
2710 |
|
2711 |
+
if(isset($wplc_settings['wplc_use_node_server']) && $wplc_settings['wplc_use_node_server'] == 1 && (!isset($_GET['action']) || $_GET['action'] !== "history") ){
|
|
|
|
|
|
|
|
|
2712 |
|
2713 |
+
//Using node, remote scripts please
|
2714 |
+
//if ( isset( $_GET['page'] ) && $_GET['page'] == "wplivechat-menu" ) {
|
2715 |
+
/**
|
2716 |
+
* Load the relevant scripts for the Node server
|
2717 |
+
*/
|
2718 |
|
2719 |
+
wplc_admin_remote_dashboard_scripts($wplc_settings);
|
2720 |
|
2721 |
+
//}
|
2722 |
|
2723 |
+
if( isset( $_GET['page'] ) && $_GET['page'] === "wplivechat-menu-offline-messages"){
|
2724 |
+
wplc_admin_output_js();
|
2725 |
}
|
2726 |
+
} else {
|
2727 |
+
do_action("wplc_hook_superadmin_head");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2728 |
|
2729 |
+
if ( isset( $_GET['page'] ) && isset( $_GET['action'] ) && $_GET['page'] == "wplivechat-menu" && ( $_GET['action'] != 'welcome' && $_GET['action'] != 'credits' ) ) {
|
2730 |
+
/* admin chat box page */
|
2731 |
+
if (function_exists("wplc_register_pro_version")) {
|
2732 |
+
wplc_return_pro_admin_chat_javascript(sanitize_text_field($_GET['cid']));
|
2733 |
+
} else {
|
2734 |
|
2735 |
+
/** set the global chat data here so we dont need to keep getting it from the DB or Cloud server */
|
2736 |
+
global $admin_chat_data;
|
2737 |
+
$admin_chat_data = wplc_get_chat_data( sanitize_text_field( $_GET['cid'] ), __LINE__ );
|
2738 |
|
2739 |
+
wplc_return_admin_chat_javascript( sanitize_text_field( $_GET['cid'] ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
2740 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2741 |
|
2742 |
+
}
|
2743 |
+
do_action("wplc_hook_admin_javascript_chat");
|
2744 |
+
} else {
|
2745 |
+
/* load this on every other admin page */
|
2746 |
+
if (function_exists("wplc_register_pro_version")) {
|
2747 |
+
wplc_pro_admin_javascript();
|
2748 |
+
} else {
|
2749 |
+
wplc_admin_javascript();
|
2750 |
+
}
|
2751 |
+
do_action("wplc_hook_admin_javascript");
|
2752 |
+
}
|
2753 |
+
|
2754 |
+
|
2755 |
+
?>
|
2756 |
+
<script type="text/javascript">
|
2757 |
+
|
2758 |
+
|
2759 |
+
function wplc_desktop_notification() {
|
2760 |
+
if (typeof Notification !== 'undefined') {
|
2761 |
+
if (!Notification) {
|
2762 |
+
return;
|
2763 |
+
}
|
2764 |
+
if (Notification.permission !== "granted")
|
2765 |
+
Notification.requestPermission();
|
2766 |
+
|
2767 |
+
var wplc_desktop_notification = new Notification('<?php _e('New chat received', 'wplivechat'); ?>', {
|
2768 |
+
icon: wplc_notification_icon_url,
|
2769 |
+
body: "<?php _e("A new chat has been received. Please go the 'Live Chat' page to accept the chat", "wplivechat"); ?>"
|
2770 |
+
});
|
2771 |
+
//Notification.close()
|
2772 |
+
}
|
2773 |
+
}
|
2774 |
+
|
2775 |
+
</script>
|
2776 |
+
<?php
|
2777 |
|
2778 |
+
}
|
2779 |
+
}
|
2780 |
|
2781 |
function old_wplc_superadmin_javascript() {
|
2782 |
|
2792 |
} // main page
|
2793 |
else if ( isset($_GET['action']) && ( $_GET['action'] != 'welcome' && $_GET['action'] != 'credits' && $_GET['action'] != 'history' ) ) {
|
2794 |
if (function_exists("wplc_register_pro_version")) {
|
2795 |
+
wplc_return_pro_admin_chat_javascript(sanitize_text_field($_GET['cid']));
|
2796 |
} else {
|
2797 |
|
2798 |
/** set the global chat data here so we dont need to keep getting it from the DB or Cloud server */
|
2800 |
$admin_chat_data = wplc_get_chat_data( sanitize_text_field( $_GET['cid'] ), __LINE__);
|
2801 |
|
2802 |
wplc_return_admin_chat_javascript( sanitize_text_field( $_GET['cid'] ) );
|
2803 |
+
|
2804 |
|
2805 |
}
|
2806 |
do_action("wplc_hook_admin_javascript_chat");
|
2807 |
}
|
2808 |
}
|
2809 |
|
2810 |
+
|
2811 |
do_action("wplc_hook_superadmin_head");
|
2812 |
|
2813 |
?>
|
2814 |
<script type="text/javascript">
|
2815 |
+
|
2816 |
|
2817 |
function wplc_desktop_notification() {
|
2818 |
if (typeof Notification !== 'undefined') {
|
2853 |
} else {
|
2854 |
/* Only run admin JS on the chat dashboard page */
|
2855 |
if ( isset( $_GET['page'] ) && $_GET['page'] === 'wplivechat-menu' && !isset( $_GET['action'] ) ) {
|
2856 |
+
wplc_admin_output_js();
|
2857 |
}
|
2858 |
}
|
2859 |
|
2860 |
|
2861 |
|
|
|
2862 |
|
2863 |
+
|
2864 |
+
|
2865 |
|
2866 |
}
|
2867 |
|
2868 |
/**
|
2869 |
* Outputs the admin JS on to the relevant pages, controlled by wplc_admin_javascript();
|
2870 |
+
*
|
2871 |
* @return void
|
2872 |
* @since 7.1.00
|
2873 |
* @author Nick Duncan
|
2878 |
|
2879 |
|
2880 |
$ajax_nonce = wp_create_nonce("wplc");
|
2881 |
+
global $wplc_version;
|
2882 |
|
2883 |
$wplc_current_user = get_current_user_id();
|
2884 |
if( get_user_meta( $wplc_current_user, 'wplc_ma_agent', true )) {
|
2885 |
|
2886 |
wp_register_script('wplc-admin-js', plugins_url('js/wplc_u_admin.js', __FILE__), false, $wplc_version, false);
|
2887 |
wp_enqueue_script('wplc-admin-js');
|
2888 |
+
$not_icon = plugins_url('/images/wplc_notification_icon.png', __FILE__);
|
2889 |
|
2890 |
$wplc_wav_file = plugins_url('/ring.wav', __FILE__);
|
2891 |
$wplc_wav_file = apply_filters("wplc_filter_wav_file",$wplc_wav_file);
|
2906 |
$wpc_ma_js_strings = array(
|
2907 |
'remove_agent' => __('Remove', 'wplivechat'),
|
2908 |
'nonce' => wp_create_nonce("wplc"),
|
2909 |
+
'user_id' => get_current_user_id(),
|
2910 |
+
'typing_string' => __('Typing...', 'wplivechat')
|
2911 |
+
|
2912 |
);
|
2913 |
wp_localize_script('wplc-admin-js', 'wplc_admin_strings', $wpc_ma_js_strings);
|
2914 |
|
2917 |
}
|
2918 |
|
2919 |
function wplc_admin_menu_layout() {
|
2920 |
+
|
2921 |
do_action("wplc_hook_admin_menu_layout");
|
2922 |
if (function_exists("wplc_register_pro_version")) {
|
2923 |
global $wplc_pro_version;
|
2944 |
<p><?php _e("You are using an outdated version of <strong>WP Live Chat Support Pro</strong>.", "wplivechat") ?></p>
|
2945 |
<p>
|
2946 |
<strong><?php _e("Please update to the latest version of WP Live Chat Support Pro", 'wplivechat'); ?>
|
2947 |
+
<a href="https://wp-livechat.com/get-updated-version/" target=\"_BLANK\"> <?php _e("Version 5.0.1", "wplivechat"); ?></a>
|
2948 |
<?php _e("to ensure everything is working correctly.", "wplivechat"); ?>
|
2949 |
</strong>
|
2950 |
</p>
|
2954 |
</div>
|
2955 |
<?php
|
2956 |
}
|
2957 |
+
}
|
2958 |
+
if ( ( get_option("WPLC_V8_FIRST_TIME") == true && !class_exists("APC_Object_Cache") ) || ( isset( $_GET['action'] ) && ( $_GET['action'] == 'welcome' || $_GET['action'] == 'credits' ) ) ){
|
2959 |
include 'includes/welcome_page.php';
|
2960 |
+
update_option('WPLC_V8_FIRST_TIME', false);
|
2961 |
+
} else {
|
2962 |
+
|
2963 |
+
update_option('WPLC_V8_FIRST_TIME', false);
|
2964 |
+
$wplc_settings = get_option("WPLC_SETTINGS");
|
2965 |
+
if ( isset( $wplc_settings['wplc_use_node_server'] ) && $wplc_settings['wplc_use_node_server'] == 1 ) {
|
2966 |
+
//Node in use, load remote dashboard
|
2967 |
+
if ( $_GET['page'] === 'wplivechat-menu') {
|
2968 |
+
wplc_admin_dashboard_layout_node('dashboard');
|
2969 |
+
|
2970 |
+
if( isset($_GET['action']) ){
|
2971 |
+
wplc_admin_menu_layout_display();
|
2972 |
+
}
|
2973 |
+
} else {
|
2974 |
+
// we'll control this in admin_footer
|
2975 |
+
//wplc_admin_dashboard_layout_node('other');
|
2976 |
+
}
|
2977 |
+
|
2978 |
} else {
|
2979 |
+
if (function_exists("wplc_register_pro_version")) {
|
2980 |
+
wplc_pro_admin_menu_layout_display();
|
2981 |
+
} else {
|
2982 |
+
wplc_admin_menu_layout_display();
|
2983 |
+
}
|
2984 |
}
|
2985 |
}
|
2986 |
}
|
2987 |
+
|
2988 |
+
|
2989 |
+
|
2990 |
function wplc_first_time_tutorial() {
|
2991 |
if (!get_option('WPLC_FIRST_TIME_TUTORIAL')) {
|
2992 |
+
|
2993 |
global $wplc_basic_plugin_url;
|
2994 |
?>
|
2995 |
|
3002 |
<p><?php _e("Chat notifications will start appearing once visitors send a request.","wplivechat"); ?></p>
|
3003 |
<p><?php _e("You may <a href='?page=wplivechat-menu-settings' target='_BLANK'>modify your chat box settings here.","wplivechat"); ?></a></p>
|
3004 |
<p><?php _e("Experiencing issues?","wplivechat"); ?> <a href="https://wp-livechat.com/documentation/troubleshooting/" target="_BLANK" title=""><?php _e("Visit our troubleshooting section.","wplivechat"); ?></a></p>
|
3005 |
+
|
3006 |
<p><button id="wplc_close_ftt" class="button button-secondary"><?php _e("Hide","wplivechat"); ?></button></p>
|
3007 |
+
|
3008 |
</div>
|
3009 |
+
|
3010 |
<?php }
|
3011 |
}
|
3012 |
|
3036 |
* @author Nick Duncan <nick@codecabin.co.za>
|
3037 |
*/
|
3038 |
function wplc_hook_control_chat_dashboard_bottom() {
|
3039 |
+
echo "<p id='wplc_footer_message' style='display:none;'>";
|
3040 |
?>
|
3041 |
+
<?php _e("With the Pro add-on of WP Live Chat Support, you can", "wplivechat"); ?>
|
3042 |
<a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=initiate1" title="<?php _e("see who's online and initiate chats", "wplivechat"); ?>" target=\"_BLANK\">
|
3043 |
<?php _e("initiate chats", "wplivechat"); ?>
|
3044 |
+
</a> <?php _e("with your online visitors with the click of a button.", "wplivechat"); ?>
|
3045 |
<a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=initiate2" title="<?php _e("Buy the Pro add-on now.", "wplivechat"); ?>" target=\"_BLANK\">
|
3046 |
<strong>
|
3047 |
<?php _e("Buy the Pro add-on now.", "wplivechat"); ?>
|
3051 |
echo "</p>";
|
3052 |
|
3053 |
|
3054 |
+
|
3055 |
}
|
3056 |
|
3057 |
|
3063 |
/*
|
3064 |
-- modified in in 6.0.04 --
|
3065 |
|
3066 |
+
if(current_user_can('wplc_ma_agent') || current_user_can('manage_options')){
|
3067 |
*/
|
3068 |
do_action("wplc_hook_admin_menu_layout_display_top");
|
3069 |
|
3094 |
<a class="wplc-support-link wplc-rotate" href="?page=wplivechat-menu-support-page"></a>
|
3095 |
</div>
|
3096 |
<div class='wplc_page_title'>
|
3097 |
+
<img src='<?php echo WPLC_BASIC_PLUGIN_URL; ?>images/wplc-logo.png' class='wplc-logo' />
|
3098 |
<?php wplc_first_time_tutorial(); ?>
|
3099 |
<?php do_action("wplc_hook_chat_dashboard_above"); ?>
|
3100 |
|
3104 |
<?php
|
3105 |
$continue = apply_filters( "wplc_version_check_continue", true );
|
3106 |
if ($continue !== true) {
|
3107 |
+
|
3108 |
echo "<hr />";
|
3109 |
echo "<center>";
|
3110 |
echo "<h1>".$continue."</h1>";
|
3111 |
+
echo "<p>".sprintf( __( 'Need help? <a href="%s" target="_BLANK">contact us</a>.', 'wplivechat'),'https://wp-livechat.com/contact-us/')."</p>";
|
3112 |
echo "</center>";
|
3113 |
|
3114 |
|
3116 |
|
3117 |
?>
|
3118 |
|
3119 |
+
|
3120 |
<div id="wplc_sound"></div>
|
3121 |
+
|
3122 |
<div id="wplc_admin_chat_holder">
|
3123 |
<div id='wplc_admin_chat_info_new'>
|
3124 |
<div class='wplc_chat_vis_count_box'>
|
3129 |
</span>
|
3130 |
<?php echo apply_filters("wplc_filter_chat_dahsboard_visitors_online_bottom",""); ?>
|
3131 |
|
3132 |
+
|
3133 |
</div>
|
3134 |
|
3135 |
<?php do_action("wplc_after_chat_visitor_count_hook"); ?>
|
3136 |
+
|
3137 |
</div>
|
3138 |
+
|
3139 |
<div id="wplc_admin_chat_area_new">
|
3140 |
<div style="display:block;padding:10px;">
|
3141 |
<ul class='wplc_chat_ul_header'>
|
3151 |
</ul>
|
3152 |
<br />
|
3153 |
<hr />
|
3154 |
+
<?php do_action("wplc_hook_chat_dashboard_bottom"); ?>
|
3155 |
+
|
3156 |
</div>
|
3157 |
|
3158 |
</div>
|
3159 |
</div>
|
3160 |
<?php } ?>
|
3161 |
+
|
3162 |
+
|
3163 |
+
|
3164 |
|
3165 |
<?php
|
3166 |
} else {
|
3167 |
if (isset($_GET['aid'])) { $aid = $_GET['aid']; } else { $aid = null; }
|
3168 |
+
do_action("wplc_hook_admin_menu_layout_display_1",$_GET['action'],sanitize_text_field( $_GET['cid'] ),$aid);
|
3169 |
|
3170 |
if (!is_null($aid)) {
|
3171 |
+
do_action("wplc_hook_update_agent_id",intval( sanitize_text_field( $_GET['cid'] ) ),$aid);
|
3172 |
}
|
3173 |
|
3174 |
+
do_action("wplc_hook_admin_menu_layout_display_1",$_GET['action'],sanitize_text_field( $_GET['cid'] ),$aid);
|
3175 |
|
3176 |
if ($_GET['action'] == 'ac') {
|
3177 |
do_action('wplc_hook_accept_chat',$_GET,$aid);
|
3178 |
}
|
3179 |
+
do_action("wplc_hook_admin_menu_layout_display",$_GET['action'],sanitize_text_field( $_GET['cid'] ),$aid);
|
3180 |
}
|
3181 |
} else {
|
3182 |
?>
|
3237 |
}
|
3238 |
}
|
3239 |
|
3240 |
+
|
3241 |
|
3242 |
|
3243 |
|
3261 |
* Hook to accept chat
|
3262 |
*
|
3263 |
* @since 7.1.00
|
3264 |
+
* @param
|
3265 |
* @return void
|
3266 |
+
* @author Nick Duncan (nick@codecabin.co.za)
|
3267 |
*
|
3268 |
*/
|
3269 |
add_action( 'wplc_hook_accept_chat_url' , 'wplc_b_hook_control_accept_chat_url', 5, 2);
|
3273 |
/* free version */
|
3274 |
wplc_b_update_agent_id(sanitize_text_field($get_data['cid']), get_current_user_id());
|
3275 |
} else {
|
3276 |
+
wplc_b_update_agent_id(sanitize_text_field($get_data['cid']), sanitize_text_field($get_data['agent_id']));
|
3277 |
}
|
3278 |
+
|
3279 |
}
|
3280 |
|
3281 |
/**
|
3284 |
* Replaces the same function of a different name in the older pro version
|
3285 |
*
|
3286 |
* @since 7.1.00
|
3287 |
+
* @param
|
3288 |
* @return void
|
3289 |
+
* @author Nick Duncan (nick@codecabin.co.za)
|
3290 |
*
|
3291 |
*/
|
3292 |
function wplc_b_update_agent_id($cid, $aid){
|
3293 |
global $wpdb;
|
3294 |
global $wplc_tblname_chats;
|
3295 |
$sql = "SELECT * FROM `$wplc_tblname_chats` WHERE `id` = '$cid' LIMIT 1";
|
3296 |
+
$result = $wpdb->get_row($sql);
|
3297 |
if ($result) {
|
3298 |
if(intval($result->status) != 3){
|
3299 |
$update = "UPDATE `$wplc_tblname_chats` SET `agent_id` = '$aid' WHERE `id` = '$cid' LIMIT 1";
|
3351 |
display: inline-block;
|
3352 |
float: right;
|
3353 |
}
|
3354 |
+
|
3355 |
.rating-bad {
|
3356 |
background-color: #AF0B0B !important;
|
3357 |
}
|
3358 |
+
|
3359 |
.rating-good {
|
3360 |
background-color: #368437 !important;
|
3361 |
}
|
3363 |
|
3364 |
</style>
|
3365 |
<?php
|
3366 |
+
|
3367 |
$user_data = maybe_unserialize($result->ip);
|
3368 |
+
$user_ip = isset($user_data['ip']) ? $user_data['ip'] : 'Unknown';
|
3369 |
+
$browser = isset($user_data['user_agent']) ? wplc_return_browser_string($user_data['user_agent']) : "Unknown";
|
3370 |
$browser_image = wplc_return_browser_image($browser, "16");
|
3371 |
|
3372 |
|
3395 |
do_action("wplc_admin_chat_area_before_end_chat_button", $result);
|
3396 |
|
3397 |
echo "<a href=\"javascript:void(0);\" class=\"wplc_admin_close_chat button\" id=\"wplc_admin_close_chat\">" . __("End chat", "wplivechat") . "</a>";
|
3398 |
+
|
3399 |
do_action("wplc_admin_chat_area_after_end_chat_button", $result);
|
3400 |
|
3401 |
echo "</div>";
|
3405 |
echo "<div id='admin_chat_box'>";
|
3406 |
|
3407 |
$result->continue = true;
|
3408 |
+
|
3409 |
do_action("wplc_hook_wplc_draw_chat_area",$result);
|
3410 |
|
3411 |
if (!$result->continue) { return; }
|
3412 |
|
3413 |
echo"<div class='admin_chat_box'><div class='admin_chat_box_inner' id='admin_chat_box_area_" . $result->id . "'>".apply_filters( "wplc_chat_box_draw_chat_box_inner", "", $cid)."</div><div class='admin_chat_box_inner_bottom'>" . wplc_return_chat_response_box($cid, $result) . "</div>";
|
3414 |
+
|
3415 |
|
3416 |
echo "</div>";
|
3417 |
echo "<div class='admin_visitor_info'>";
|
3444 |
echo (apply_filters("wplc_filter_advanced_info","", $result->id, $result->name, $result));
|
3445 |
|
3446 |
echo " <div id=\"wplc_sound_update\"></div>";
|
3447 |
+
|
3448 |
+
echo "<div class='wplc_bottom_chat_info_container'>";
|
3449 |
echo "<h3>".__("Add-ons","wplivechat")."</h3>";
|
3450 |
do_action("wplc_hook_admin_visitor_info_display_after",$cid);
|
3451 |
echo "<a href='".admin_url('admin.php?page=wplivechat-menu-extensions-page')."' class='button button-primary' target='_BLANK'>".__("Get more add-ons","wplivechat")."</a>";
|
3452 |
echo "</div>";
|
3453 |
|
3454 |
+
echo "</div>";
|
3455 |
+
|
3456 |
if ($result->status != 1) {
|
3457 |
|
3458 |
do_action("wplc_hook_admin_below_chat_box",$result);
|
3459 |
}
|
3460 |
+
|
3461 |
}
|
3462 |
|
3463 |
|
3479 |
|
3480 |
$ret .= apply_filters("wplc_filter_chat_upload","");
|
3481 |
$ret .= (!function_exists("nifty_text_edit_div") ? apply_filters("wplc_filter_chat_text_editor_upsell","") : apply_filters("wplc_filter_chat_text_editor",""));
|
3482 |
+
|
3483 |
$ret .= "<input id='wplc_admin_cid' type='hidden' value='$cid' />";
|
3484 |
$ret .= "<input id='wplc_admin_send_msg' type='button' value='" . __("Send", "wplivechat") . "' style=\"display:none;\" />";
|
3485 |
$ret .= "</div>";
|
3487 |
}
|
3488 |
|
3489 |
function wplc_return_admin_chat_javascript($cid) {
|
|
|
3490 |
$ajax_nonce = wp_create_nonce("wplc");
|
3491 |
+
global $wplc_version;
|
|
|
3492 |
|
3493 |
$wplc_settings = get_option("WPLC_SETTINGS");
|
3494 |
|
3495 |
wp_register_script('wplc-admin-chat-server', plugins_url('js/wplc_server.js', __FILE__), false, $wplc_version, false);
|
3496 |
wp_enqueue_script('wplc-admin-chat-server');
|
3497 |
|
3498 |
+
wp_localize_script( 'wplc-admin-chat-server', 'wplc_datetime_format', array(
|
3499 |
+
'date_format' => get_option( 'date_format' ),
|
3500 |
+
'time_format' => get_option( 'time_format' ),
|
3501 |
+
) );
|
3502 |
+
|
3503 |
global $admin_chat_data;
|
3504 |
+
if (!$admin_chat_data) {
|
3505 |
+
$cdata = wplc_get_chat_data($cid, __LINE__);
|
3506 |
} else {
|
3507 |
/* copy the stored admin chat data variable - more efficient */
|
3508 |
$cdata = $admin_chat_data;
|
3509 |
}
|
3510 |
|
3511 |
$other = maybe_unserialize($cdata->other);
|
3512 |
+
|
3513 |
if(isset($wplc_settings['wplc_use_node_server']) && $wplc_settings['wplc_use_node_server'] == 1){
|
3514 |
if (isset($other['socket']) && ($other['socket'] == true || $other['socket'] == "true")) {
|
3515 |
if ( isset( $_GET['action'] ) && $_GET['action'] === 'history') {
|
3516 |
+
wp_localize_script('wplc-admin-chat-server', 'wplc_use_node_server', "false");
|
3517 |
} else {
|
3518 |
wp_localize_script('wplc-admin-chat-server', 'wplc_use_node_server', "true");
|
3519 |
wp_localize_script('wplc-admin-chat-server', 'wplc_localized_string_is_typing_single', __(" is typing...","wplivechat"));
|
3520 |
}
|
3521 |
+
|
3522 |
$wplc_node_token = get_option("wplc_node_server_secret_token");
|
3523 |
if(!$wplc_node_token){
|
3524 |
if(function_exists("wplc_node_server_token_regenerate")){
|
3526 |
$wplc_node_token = get_option("wplc_node_server_secret_token");
|
3527 |
}
|
3528 |
}
|
3529 |
+
wp_localize_script('wplc-admin-chat-server', 'bleeper_api_key', $wplc_node_token);
|
3530 |
+
}
|
3531 |
}
|
3532 |
|
3533 |
+
/**
|
3534 |
* Create a JS object for all Agent ID's and Gravatar MD5's
|
3535 |
*/
|
3536 |
$user_array = get_users(array(
|
3566 |
|
3567 |
global $wplc_pro_version;
|
3568 |
$wplc_ver = str_replace('.', '', $wplc_pro_version);
|
3569 |
+
$checker = intval($wplc_ver);
|
3570 |
if (isset($wplc_settings['wplc_theme'])) { $wplc_theme = $wplc_settings['wplc_theme']; } else { $wplc_theme = "theme-default"; }
|
3571 |
|
3572 |
if ( (isset($wplc_theme) && $checker >= 6000 ) || (! function_exists("wplc_pro_version_control") ) ) {
|
3604 |
/* custom */
|
3605 |
/* handled elsewhere */
|
3606 |
|
3607 |
+
|
3608 |
|
3609 |
}
|
3610 |
}
|
3620 |
if( isset($wplc_settings['wplc_show_avatar']) && $wplc_settings['wplc_show_avatar'] ){ $wplc_show_avatar = true; } else { $wplc_show_avatar = false; }
|
3621 |
if( isset($wplc_settings['wplc_show_date']) && $wplc_settings['wplc_show_date'] == '1' ){ $wplc_show_date = true; } else { $wplc_show_date = false; }
|
3622 |
if( isset($wplc_settings['wplc_show_time']) && $wplc_settings['wplc_show_time'] == '1' ){ $wplc_show_time = true; } else { $wplc_show_time = false; }
|
3623 |
+
|
3624 |
$wplc_chat_detail = array( 'name' => $wplc_show_name, 'avatar' => $wplc_show_avatar, 'date' => $wplc_show_date, 'time' => $wplc_show_time );
|
|
|
|
|
|
|
3625 |
|
3626 |
|
3627 |
+
wp_enqueue_script('wplc-admin-chat-js');
|
3628 |
wp_localize_script( 'wplc-admin-chat-js', 'wplc_show_chat_detail', $wplc_chat_detail );
|
3629 |
+
|
3630 |
+
|
3631 |
+
|
3632 |
if (!empty( $wplc_agent_data ) ) {
|
3633 |
wp_localize_script( 'wplc-admin-chat-js', 'wplc_agent_name', $wplc_agent_data->display_name );
|
3634 |
wp_localize_script( 'wplc-admin-chat-js', 'wplc_agent_email', md5( $wplc_agent_data->user_email ) );
|
3639 |
|
3640 |
wp_localize_script('wplc-admin-chat-js', 'wplc_chat_name', $cdata->name);
|
3641 |
wp_localize_script('wplc-admin-chat-js', 'wplc_chat_email', md5($cdata->email));
|
3642 |
+
|
3643 |
if(class_exists("WP_REST_Request")) {
|
3644 |
wp_localize_script('wplc-admin-chat-js', 'wplc_restapi_enabled', '1');
|
3645 |
wp_localize_script('wplc-admin-chat-js', 'wplc_restapi_token', get_option('wplc_api_secret_token'));
|
3664 |
wp_localize_script('wplc-user-script', 'wplc_localized_string_admin_name', apply_filters( 'wplc_filter_admin_name', 'Admin' ) );
|
3665 |
wp_localize_script('wplc-admin-chat-js', 'wplc_ajax_nonce', $ajax_nonce);
|
3666 |
wp_localize_script('wplc-admin-chat-js', 'admin_pic', $admin_pic);
|
3667 |
+
|
3668 |
$wplc_ding_file = plugins_url('/ding.mp3', __FILE__);
|
3669 |
+
$wplc_ding_file = apply_filters( 'wplc_filter_message_sound', $wplc_ding_file );
|
3670 |
wp_localize_script('wplc-admin-chat-js', 'wplc_ding_file', $wplc_ding_file);
|
3671 |
|
|
|
3672 |
$extra_data = apply_filters("wplc_filter_admin_javascript",array());
|
3673 |
wp_localize_script('wplc-admin-chat-js', 'wplc_extra_data', $extra_data);
|
3674 |
|
3688 |
$wplc_user_email_address = "";
|
3689 |
}
|
3690 |
|
|
|
|
|
3691 |
wp_localize_script('wplc-admin-chat-js', 'wplc_name', $display_name);
|
3692 |
wp_localize_script('wplc-admin-chat-js', 'wplc_enable_ding', $enable_ding);
|
3693 |
|
3698 |
wp_localize_script('wplc-admin-chat-js', 'wplc_ajaxurl', $wplc_ajax_url);
|
3699 |
wp_localize_script('wplc-admin-chat-js', 'wplc_home_ajaxurl', $home_ajax_url);
|
3700 |
|
3701 |
+
|
3702 |
|
3703 |
$wplc_url = admin_url('admin.php?page=wplivechat-menu&action=ac&cid=' . $cid);
|
3704 |
wp_localize_script('wplc-admin-chat-js', 'wplc_url', $wplc_url);
|
3725 |
$wplc_alt_text = __("Please click \'Start Chat\' to initiate a chat with an agent", "wplivechat");
|
3726 |
$wplc_default_visitor_name = __( "Guest", "wplivechat" );
|
3727 |
$wplc_admin_email = get_option('admin_email');
|
3728 |
+
|
3729 |
+
$wplc_default_settings_array = array(
|
3730 |
"wplc_settings_align" => "2",
|
3731 |
"wplc_settings_enabled" => "1",
|
3732 |
"wplc_powered_by_link" => "0",
|
3767 |
"wplc_user_welcome_chat" => __("Welcome. How may I help you?", "wplivechat"),
|
3768 |
'wplc_welcome_msg' => __("Please standby for an agent. While you wait for the agent you may type your message.","wplivechat")
|
3769 |
|
3770 |
+
);
|
3771 |
+
|
3772 |
+
//Added V8: Default Settings array filter
|
3773 |
+
$wplc_default_settings_array = apply_filters("wplc_activate_default_settings_array", $wplc_default_settings_array);
|
3774 |
+
|
3775 |
+
add_option('WPLC_SETTINGS', $wplc_default_settings_array);
|
3776 |
}
|
3777 |
|
3778 |
|
3779 |
|
3780 |
|
3781 |
|
3782 |
+
|
3783 |
$admins = get_role('administrator');
|
3784 |
if( $admins !== null ) { $admins->add_cap('wplc_ma_agent'); }
|
3785 |
|
3789 |
update_user_meta($uid, "wplc_chat_agent_online", time());
|
3790 |
|
3791 |
add_option("WPLC_HIDE_CHAT", "true");
|
3792 |
+
add_option("WPLC_V8_FIRST_TIME", true);
|
3793 |
|
3794 |
|
3795 |
do_action("wplc_activate_hook");
|
3796 |
}
|
3797 |
|
3798 |
+
|
3799 |
+
|
3800 |
function wplc_handle_db() {
|
3801 |
global $wpdb;
|
3802 |
global $wplc_version;
|
3817 |
last_active_timestamp datetime NOT NULL,
|
3818 |
agent_id INT(11) NOT NULL,
|
3819 |
other LONGTEXT NOT NULL,
|
3820 |
+
rel varchar(40) NOT NULL,
|
3821 |
PRIMARY KEY (id)
|
3822 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
3823 |
";
|
3838 |
status INT(3) NOT NULL,
|
3839 |
originates INT(3) NOT NULL,
|
3840 |
other LONGTEXT NOT NULL,
|
3841 |
+
rel varchar(40) NOT NULL,
|
3842 |
+
afrom INT(10) NOT NULL,
|
3843 |
+
ato INT(10) NOT NULL,
|
3844 |
PRIMARY KEY (id)
|
3845 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
3846 |
';
|
3896 |
wp_register_style('wplc-style', plugins_url('/css/wplcstyle.css', __FILE__), array(), $wplc_version);
|
3897 |
wp_enqueue_style('wplc-style');
|
3898 |
|
3899 |
+
if( isset( $wplc_settings['wplc_elem_trigger_id'] ) && trim( $wplc_settings['wplc_elem_trigger_id'] ) !== "" ) {
|
3900 |
+
if( isset( $wplc_settings['wplc_elem_trigger_type'] ) ){
|
3901 |
if ( $wplc_settings['wplc_elem_trigger_type'] === "0" ) {
|
3902 |
/* class */
|
3903 |
$wplc_elem_style_prefix = ".";
|
3907 |
}
|
3908 |
}
|
3909 |
|
|
|
3910 |
$wplc_elem_inline_style = $wplc_elem_style_prefix.stripslashes( $wplc_settings['wplc_elem_trigger_id'] ).":hover { cursor:pointer; }";
|
3911 |
wp_add_inline_style( 'wplc-style', stripslashes( $wplc_elem_inline_style ) );
|
3912 |
+
}
|
|
|
3913 |
|
3914 |
// Serve the icon up over HTTPS if needs be
|
3915 |
//$icon = plugins_url('images/chaticon.png', __FILE__);
|
3918 |
|
3919 |
|
3920 |
if ( isset( $wplc_settings['wplc_settings_bg'] ) ) {
|
3921 |
+
if ( $wplc_settings['wplc_settings_bg'] == "0" ) { $bg = false; } else { $bg = esc_attr( $wplc_settings['wplc_settings_bg'] ); }
|
3922 |
} else { $bg = "cloudy.jpg"; }
|
3923 |
if ($bg) {
|
3924 |
$bg = plugins_url('images/bg/'.$bg, __FILE__);
|
3933 |
|
3934 |
$wplc_elem_inline_style = "#wp-live-chat-header { background:url('$icon') no-repeat; background-size: cover; } #wp-live-chat-header.active { background:url('$close_icon') no-repeat; background-size: cover; } $bg_string";
|
3935 |
wp_add_inline_style( 'wplc-style', stripslashes( $wplc_elem_inline_style ) );
|
3936 |
+
|
3937 |
|
3938 |
|
3939 |
global $wplc_pro_version;
|
3940 |
$wplc_ver = str_replace('.', '', $wplc_pro_version);
|
3941 |
+
$checker = intval($wplc_ver);
|
3942 |
+
|
3943 |
if (function_exists("wplc_pro_version_control") && $checker < 6000) {
|
3944 |
/* old pro version backwards compatibility */
|
3945 |
wp_register_style('wplc-style-pro', plugins_url('/css/wplcstyle_old.css', __FILE__));
|
3988 |
/* custom */
|
3989 |
/* handled elsewhere */
|
3990 |
|
3991 |
+
|
3992 |
|
3993 |
}
|
3994 |
|
4026 |
wp_register_style('wplc-theme-position', plugins_url('/css/themes/position-bottom-right.css', __FILE__), array(), $wplc_version);
|
4027 |
wp_enqueue_style('wplc-theme-position');
|
4028 |
}
|
4029 |
+
|
4030 |
+
}
|
4031 |
+
|
4032 |
+
// Gutenberg template styles - user
|
4033 |
+
wp_register_style( 'wplc-gutenberg-template-styles-user', plugins_url( '/includes/blocks/wplc-chat-box/wplc_gutenberg_template_styles.css', __FILE__ ) );
|
4034 |
+
wp_enqueue_style( 'wplc-gutenberg-template-styles-user' );
|
4035 |
+
|
4036 |
+
|
4037 |
+
}
|
4038 |
+
if(function_exists('wplc_ce_activate')){
|
4039 |
+
if(function_exists('wplc_ce_load_user_styles')){
|
4040 |
+
wplc_ce_load_user_styles();
|
4041 |
}
|
4042 |
+
}
|
4043 |
+
}
|
4044 |
+
|
4045 |
+
|
4046 |
+
add_action( 'init', 'wplc_online_check_script', 10 );
|
4047 |
+
/**
|
4048 |
+
* Load the JS that allows us to integrate into the WP Heartbeat
|
4049 |
+
* @return void
|
4050 |
+
*/
|
4051 |
+
function wplc_online_check_script() {
|
4052 |
+
global $wplc_version;
|
4053 |
+
if (esc_attr( get_the_author_meta( 'wplc_ma_agent', get_current_user_id() ) ) == "1"){
|
4054 |
+
$ajax_nonce = wp_create_nonce("wplc");
|
4055 |
+
wp_register_script( 'wplc-heartbeat', plugins_url( 'js/wplc_heartbeat.js', __FILE__ ), array( 'jquery' ), $wplc_version, true );
|
4056 |
+
wp_enqueue_script( 'wplc-heartbeat' );
|
4057 |
+
wp_localize_script( 'wplc-heartbeat', 'wplc_transient_nonce', $ajax_nonce );
|
4058 |
+
|
4059 |
+
$wplc_ajax_url = apply_filters("wplc_filter_ajax_url", admin_url('admin-ajax.php'));
|
4060 |
+
wp_localize_script('wplc-heartbeat', 'wplc_ajaxurl', $wplc_ajax_url);
|
4061 |
+
}
|
4062 |
+
}
|
4063 |
+
|
4064 |
+
/**
|
4065 |
+
* Heartbeat integrations
|
4066 |
+
*
|
4067 |
+
*/
|
4068 |
+
add_filter( 'heartbeat_received', 'wplc_heartbeat_receive', 10, 2 );
|
4069 |
+
add_filter( 'heartbeat_nopriv_received', 'wplc_heartbeat_receive', 10, 2 );
|
4070 |
+
function wplc_heartbeat_receive( $response, $data ) {
|
4071 |
+
if ( $data['client'] == 'wplc_heartbeat' ) {
|
4072 |
+
if (esc_attr( get_the_author_meta( 'wplc_ma_agent', get_current_user_id() ) ) == "1"){
|
4073 |
+
update_user_meta(get_current_user_id(), "wplc_chat_agent_online", time());
|
4074 |
+
wplc_hook_control_set_transient();
|
4075 |
+
}
|
4076 |
+
}
|
4077 |
+
return $response;
|
4078 |
+
}
|
4079 |
+
|
4080 |
+
|
4081 |
+
|
4082 |
+
/**
|
4083 |
+
* Loads the admin stylesheets for the chat dashboard and settings pages
|
4084 |
+
* @return void
|
4085 |
+
*/
|
4086 |
+
function wplc_add_admin_stylesheet() {
|
4087 |
+
global $wplc_version;
|
4088 |
+
|
4089 |
+
wp_register_style( 'wplc-ace-styles', plugins_url( '/css/ace.css', __FILE__ ) );
|
4090 |
+
wp_enqueue_style( 'wplc-ace-styles' );
|
4091 |
+
|
4092 |
+
wp_register_style( 'wplc-fontawesome-iconpicker', plugins_url( '/css/fontawesome-iconpicker.css', __FILE__ ) );
|
4093 |
+
wp_enqueue_style( 'wplc-fontawesome-iconpicker' );
|
4094 |
+
|
4095 |
+
$wplc_settings = get_option("WPLC_SETTINGS");
|
4096 |
+
if(isset($wplc_settings['wplc_use_node_server']) && $wplc_settings['wplc_use_node_server'] == 1 && (!isset($_GET['action']) || $_GET['action'] !== "history") ){
|
4097 |
+
//if(isset($_GET['page']) && $_GET['page'] == 'wplivechat-menu'){
|
4098 |
+
//Using node, remote styles please
|
4099 |
+
wplc_admin_remote_dashboard_styles();
|
4100 |
+
|
4101 |
+
wp_register_style( 'wplc-admin-remote-addition-styles', plugins_url( '/css/remote_dash_styles.css', __FILE__ ), array(), $wplc_version );
|
4102 |
+
wp_enqueue_style( 'wplc-admin-remote-addition-styles' );
|
4103 |
+
|
4104 |
+
//}
|
4105 |
+
}
|
4106 |
+
//Special new check to see if we need to add the node history styling
|
4107 |
+
if(isset($wplc_settings['wplc_use_node_server']) && $wplc_settings['wplc_use_node_server'] == 1 && isset($_GET['action']) && $_GET['action'] == 'history'){
|
4108 |
+
wp_register_style( 'wplc-admin-node-history-styles', plugins_url( '/css/node_history_styles.css', __FILE__ ) );
|
4109 |
+
wp_enqueue_style( 'wplc-admin-node-history-styles' );
|
4110 |
+
}
|
4111 |
+
|
4112 |
+
if (isset($_GET['page']) && $_GET['page'] == 'wplivechat-menu' && isset($_GET['action']) && ($_GET['action'] == "ac" || $_GET['action'] == "history" ) ) {
|
4113 |
+
wp_register_style('wplc-admin-chat-box-style', plugins_url('/css/admin-chat-box-style.css', __FILE__ ), false, $wplc_version );
|
4114 |
+
wp_enqueue_style('wplc-admin-chat-box-style');
|
4115 |
+
}
|
4116 |
+
|
4117 |
+
wp_register_style( 'wplc-font-awesome', plugins_url( '/css/font-awesome.min.css', __FILE__ ), false, $wplc_version );
|
4118 |
+
wp_enqueue_style( 'wplc-font-awesome' );
|
4119 |
+
|
4120 |
+
if (isset($_GET['page']) && ($_GET['page'] == 'wplivechat-menu' || $_GET['page'] == 'wplivechat-menu-api-keys-page' || $_GET['page'] == 'wplivechat-menu-extensions-page' || $_GET['page'] == 'wplivechat-menu-settings' || $_GET['page'] == 'wplivechat-menu-offline-messages' || $_GET['page'] == 'wplivechat-menu-history' || $_GET['page'] == 'wplivechat-menu-missed-chats')) {
|
4121 |
+
wp_register_style( 'wplc-jquery-ui', plugins_url( '/css/jquery-ui.css', __FILE__ ), false, $wplc_version );
|
4122 |
+
wp_enqueue_style( 'wplc-jquery-ui' );
|
4123 |
+
|
4124 |
+
wp_enqueue_script( 'jquery-ui-core' );
|
4125 |
+
wp_enqueue_script( 'jquery-effects-core' );
|
4126 |
|
4127 |
+
// Gutenberg template styles - admin
|
4128 |
+
wp_register_style( 'wplc-gutenberg-template-styles', plugins_url( '/includes/blocks/wplc-chat-box/wplc_gutenberg_template_styles.css', __FILE__ ) );
|
4129 |
+
wp_enqueue_style( 'wplc-gutenberg-template-styles' );
|
4130 |
|
4131 |
|
4132 |
+
wp_register_style( 'wplc-admin-styles', plugins_url( '/css/admin_styles.css', __FILE__ ), false, $wplc_version );
|
4133 |
+
wp_enqueue_style( 'wplc-admin-styles' );
|
4134 |
|
4135 |
+
// Old admin chat style
|
4136 |
+
if ((!isset($wplc_settings['wplc_use_node_server'])) || ($wplc_settings['wplc_use_node_server'] != 1)) {
|
4137 |
+
wp_register_style( 'wplc-chat-style', plugins_url( '/css/chat-style.css', __FILE__ ), false, $wplc_version );
|
4138 |
+
wp_enqueue_style( 'wplc-chat-style' );
|
4139 |
+
|
4140 |
+
// New admin chat style
|
4141 |
+
} else if (isset($wplc_settings['wplc_use_node_server']) && ($wplc_settings['wplc_use_node_server'] == 1)) {
|
4142 |
+
wp_register_style( 'wplc-admin-chat-style', plugins_url( '/css/admin-chat-style.css', __FILE__ ), false, $wplc_version );
|
4143 |
+
wp_enqueue_style( 'wplc-admin-chat-style' );
|
4144 |
}
|
4145 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4146 |
|
4147 |
+
|
4148 |
+
// This loads the chat styling on all admin pages as we are using the popout dashboard
|
4149 |
+
if ( isset( $wplc_settings['wplc_use_node_server'] ) && ( $wplc_settings['wplc_use_node_server'] == 1 ) && ( isset( $wplc_settings['wplc_enable_all_admin_pages'] ) && $wplc_settings['wplc_enable_all_admin_pages'] === '1') ) {
|
4150 |
+
|
4151 |
+
wp_register_style( 'wplc-admin-chat-style', plugins_url( '/css/admin-chat-style.css', __FILE__ ), false, $wplc_version );
|
4152 |
+
wp_enqueue_style( 'wplc-admin-chat-style' );
|
4153 |
}
|
4154 |
+
|
4155 |
if (isset($_GET['page']) && $_GET['page'] == "wplivechat-menu-support-page") {
|
4156 |
wp_register_style('fontawesome', plugins_url('css/font-awesome.min.css', __FILE__ ), false, $wplc_version );
|
4157 |
wp_enqueue_style('fontawesome');
|
4158 |
wp_register_style('wplc-support-page-css', plugins_url('css/support-css.css', __FILE__ ), false, $wplc_version );
|
4159 |
wp_enqueue_style('wplc-support-page-css');
|
4160 |
}
|
4161 |
+
|
4162 |
+
|
4163 |
+
if(isset($_GET['immersive_mode'])){
|
4164 |
+
wp_add_inline_style( 'wplc-admin-style', "#wpcontent { margin-left: 0px !important;} #wpadminbar, #wpfooter, #adminmenumain {display: none !important;}" );
|
4165 |
+
}
|
4166 |
}
|
4167 |
|
4168 |
+
if ( isset($_GET['page']) && ( $_GET['page'] == 'wplivechat-menu-settings' || $_GET['page'] === 'wplivechat-menu-offline-messages' ) ) {
|
4169 |
add_action('admin_print_scripts', 'wplc_admin_scripts_basic');
|
4170 |
}
|
4171 |
+
|
4172 |
/**
|
4173 |
* Loads the admin scripts for the chat dashboard and settings pages
|
4174 |
* @return void
|
4175 |
*/
|
4176 |
function wplc_admin_scripts_basic() {
|
|
|
|
|
|
|
|
|
4177 |
|
4178 |
+
global $wplc_version;
|
4179 |
+
$ajax_nonce = wp_create_nonce("wplc");
|
4180 |
+
$ajaxurl = admin_url('admin-ajax.php');
|
4181 |
+
|
4182 |
+
$gutenberg_default_html = '<!-- Default HTML -->
|
4183 |
+
<div class="wplc_block">
|
4184 |
+
<span class="wplc_block_logo">{wplc_logo}</span>
|
4185 |
+
<span class="wplc_block_text">{wplc_text}</span>
|
4186 |
+
<span class="wplc_block_icon">{wplc_icon}</span>
|
4187 |
+
</div>';
|
4188 |
+
|
4189 |
if (isset($_GET['page']) && $_GET['page'] == "wplivechat-menu-settings") {
|
4190 |
wp_enqueue_script('jquery');
|
4191 |
wp_enqueue_script('jquery-ui-core');
|
4192 |
+
wp_enqueue_script('jquery-ui-tooltip');
|
4193 |
wp_register_script('my-wplc-color', plugins_url('js/jscolor.js', __FILE__), false, '1.4.1', false);
|
4194 |
wp_enqueue_script('my-wplc-color');
|
4195 |
wp_enqueue_script('jquery-ui-tabs');
|
4196 |
wp_register_script('my-wplc-tabs', plugins_url('js/wplc_tabs.js', __FILE__), array('jquery-ui-core'), '', true);
|
4197 |
wp_enqueue_script('my-wplc-tabs');
|
4198 |
+
wp_enqueue_media();
|
4199 |
+
wp_register_script('wplc-fontawesome-iconpicker', plugins_url('js/fontawesome-iconpicker.js', __FILE__), array('jquery'), '', true);
|
4200 |
+
wp_enqueue_script('wplc-fontawesome-iconpicker');
|
4201 |
+
wp_register_script('wplc-gutenberg', plugins_url('js/wplc_gutenberg.js', __FILE__), array('jquery'), '', true);
|
4202 |
+
wp_enqueue_script('wplc-gutenberg');
|
4203 |
+
wp_localize_script( 'wplc-gutenberg', 'default_html', $gutenberg_default_html );
|
4204 |
}
|
4205 |
+
if ( isset( $_GET['page'] ) && $_GET['page'] === 'wplivechat-menu-offline-messages' ) {
|
4206 |
+
wp_register_script('wplc-admin-offline-js', plugins_url('js/wplc_offline_messages.js', __FILE__), false, $wplc_version, false);
|
4207 |
+
wp_enqueue_script('wplc-admin-offline-js');
|
4208 |
+
wp_localize_script('wplc-admin-offline-js', 'wplc_ajax_nonce', $ajax_nonce);
|
4209 |
+
wp_localize_script('wplc-admin-offline-js', 'wplc_ajaxurl', $ajaxurl);
|
4210 |
|
4211 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
4212 |
}
|
4213 |
+
|
4214 |
/**
|
4215 |
* Loads basic version's settings page
|
4216 |
* @return void
|
4254 |
* @author Nick Duncan <nick@codecabin.co.za>
|
4255 |
*/
|
4256 |
function wplc_hook_control_history_get_control($action,$cid,$aid) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4257 |
|
4258 |
+
if(!is_user_logged_in() || !get_user_meta(get_current_user_id(), 'wplc_ma_agent', true) ){
|
4259 |
+
return;
|
4260 |
+
}
|
4261 |
+
if ($action == 'history') {
|
4262 |
+
wplc_admin_view_chat_history(sanitize_text_field($cid));
|
4263 |
+
} else if ($action == 'download_history'){
|
4264 |
+
|
4265 |
+
//Moved into the init hook as of version 6.0.01 due to different functionality
|
4266 |
+
|
4267 |
+
//wplc_admin_download_history(sanitize_text_field($_GET['type']), sanitize_text_field($cid));
|
4268 |
+
}
|
4269 |
+
|
4270 |
+
|
4271 |
}
|
4272 |
|
4273 |
|
4288 |
//Confirmed - delete
|
4289 |
$delete_sql = "
|
4290 |
DELETE FROM $wplc_tblname_chats
|
4291 |
+
WHERE `id` = '".intval($_GET['cid'])."'
|
|
|
4292 |
";
|
4293 |
+
|
4294 |
|
4295 |
$wpdb->query($delete_sql);
|
4296 |
+
if ($wpdb->last_error) {
|
4297 |
echo "<div class='update-nag' style='margin-top: 0px;margin-bottom: 5px;'>
|
4298 |
".__("Error: Could not delete chat", "wplivechat")."<br>
|
4299 |
</div>";
|
4301 |
echo "<div class='update-nag' style='margin-top: 0px;margin-bottom: 5px;border-color:#67d552;'>
|
4302 |
".__("Chat Deleted", "wplivechat")."<br>
|
4303 |
</div>";
|
4304 |
+
}
|
4305 |
|
4306 |
} else {
|
4307 |
//Prompt
|
4314 |
}
|
4315 |
|
4316 |
|
4317 |
+
$results = $wpdb->get_results(
|
4318 |
"
|
4319 |
SELECT *
|
4320 |
FROM $wplc_tblname_chats
|
4321 |
+
WHERE `name` NOT LIKE 'agent-to-agent chat'
|
4322 |
ORDER BY `timestamp` DESC
|
4323 |
"
|
4324 |
);
|
4378 |
function wplc_admin_history_layout() {
|
4379 |
wplc_stats("history");
|
4380 |
echo"<div class=\"wrap\"><div id=\"icon-edit\" class=\"icon32 icon32-posts-post\"><br></div><h2>" . __("WP Live Chat History", "wplivechat") . "</h2>";
|
4381 |
+
|
4382 |
|
4383 |
if(function_exists("wplc_ce_activate")){
|
4384 |
wplc_ce_admin_display_history();
|
4392 |
|
4393 |
add_action("wplc_hook_chat_missed","wplc_hook_control_missed_chats",10);
|
4394 |
/**
|
4395 |
+
* Loads missed chats contents
|
4396 |
* @return string
|
4397 |
*/
|
4398 |
function wplc_hook_control_missed_chats() {
|
4406 |
function wplc_admin_missed_chats() {
|
4407 |
wplc_stats("missed");
|
4408 |
echo "<div class=\"wrap\"><div id=\"icon-edit\" class=\"icon32 icon32-posts-post\"><br></div><h2>" . __("WP Live Chat Missed Chats", "wplivechat") . "</h2>";
|
4409 |
+
do_action("wplc_hook_chat_missed");
|
4410 |
}
|
4411 |
|
4412 |
add_action("wplc_hook_offline_messages_display","wplc_hook_control_offline_messages_display",10);
|
4462 |
<tbody id=\"the-list\" class='list:wp_list_text_link'>";
|
4463 |
|
4464 |
$sql = "SELECT * FROM $wplc_tblname_offline_msgs ORDER BY `timestamp` DESC";
|
4465 |
+
|
4466 |
$results = $wpdb->get_results($sql);
|
4467 |
|
4468 |
if (!$results) {
|
4557 |
function wplc_filter_control_chat_header_extra_attr($wplc_extra_attr) {
|
4558 |
$wplc_acbc_data = get_option("WPLC_SETTINGS");
|
4559 |
if (isset($wplc_acbc_data['wplc_auto_pop_up'])) { $extr_string = $wplc_acbc_data['wplc_auto_pop_up']; $wplc_extra_attr .= " wplc-auto-pop-up=\"".$extr_string."\""; }
|
4560 |
+
|
4561 |
return $wplc_extra_attr;
|
4562 |
}
|
4563 |
|
4566 |
* @return string
|
4567 |
*/
|
4568 |
function wplc_head_basic() {
|
4569 |
+
if(!is_user_logged_in() || !get_user_meta(get_current_user_id(), 'wplc_ma_agent', true) ){
|
4570 |
+
return;
|
4571 |
+
}
|
|
|
4572 |
global $wpdb;
|
4573 |
|
4574 |
do_action("wplc_hook_head");
|
4575 |
|
4576 |
|
4577 |
if (isset($_POST['wplc_save_settings'])) {
|
4578 |
+
|
4579 |
do_action("wplc_hook_admin_settings_save");
|
4580 |
if (isset($_POST['wplc_settings_align'])) { $wplc_data['wplc_settings_align'] = esc_attr($_POST['wplc_settings_align']); }
|
4581 |
if (isset($_POST['wplc_settings_bg'])) { $wplc_data['wplc_settings_bg'] = esc_attr($_POST['wplc_settings_bg']); }
|
4596 |
if (isset($_POST['wplc_loggedin_user_info'])) { $wplc_data['wplc_loggedin_user_info'] = esc_attr($_POST['wplc_loggedin_user_info']); } else { $wplc_data['wplc_loggedin_user_info'] = "0"; }
|
4597 |
if (isset($_POST['wplc_user_alternative_text']) && $_POST['wplc_user_alternative_text'] != '') { $wplc_data['wplc_user_alternative_text'] = esc_attr($_POST['wplc_user_alternative_text']); } else { $wplc_data['wplc_user_alternative_text'] = __("Please click 'Start Chat' to initiate a chat with an agent", "wplivechat"); }
|
4598 |
if (isset($_POST['wplc_enabled_on_mobile'])) { $wplc_data['wplc_enabled_on_mobile'] = esc_attr($_POST['wplc_enabled_on_mobile']); } else { $wplc_data['wplc_enabled_on_mobile'] = "0"; }
|
4599 |
+
if (isset($_POST['wplc_display_name'])) { $wplc_data['wplc_display_name'] = esc_attr($_POST['wplc_display_name']); }
|
4600 |
if (isset($_POST['wplc_display_to_loggedin_only'])) { $wplc_data['wplc_display_to_loggedin_only'] = esc_attr($_POST['wplc_display_to_loggedin_only']); }
|
4601 |
|
4602 |
if (isset($_POST['wplc_redirect_to_thank_you_page'])) { $wplc_data['wplc_redirect_to_thank_you_page'] = esc_attr($_POST['wplc_redirect_to_thank_you_page']); }
|
4603 |
if (isset($_POST['wplc_redirect_thank_you_url'])) { $wplc_data['wplc_redirect_thank_you_url'] = urlencode(str_replace("https:", "", str_replace("http:", "", $_POST['wplc_redirect_thank_you_url']) ) ); }
|
4604 |
+
|
4605 |
+
$wplc_data['wplc_disable_emojis'] = !empty($_POST['wplc_disable_emojis']);
|
4606 |
+
|
4607 |
if(isset($_POST['wplc_record_ip_address'])){ $wplc_data['wplc_record_ip_address'] = esc_attr($_POST['wplc_record_ip_address']); } else { $wplc_data['wplc_record_ip_address'] = "0"; }
|
4608 |
if(isset($_POST['wplc_enable_msg_sound'])){ $wplc_data['wplc_enable_msg_sound'] = esc_attr($_POST['wplc_enable_msg_sound']); } else { $wplc_data['wplc_enable_msg_sound'] = "0"; }
|
4609 |
if(isset($_POST['wplc_enable_font_awesome'])){ $wplc_data['wplc_enable_font_awesome'] = esc_attr($_POST['wplc_enable_font_awesome']); } else { $wplc_data['wplc_enable_font_awesome'] = "0"; }
|
4630 |
if (isset($_POST['wplc_pro_sst1_survey'])) { $wplc_data['wplc_pro_sst1_survey'] = esc_attr($_POST['wplc_pro_sst1_survey']); }
|
4631 |
if (isset($_POST['wplc_pro_sst1e_survey'])) { $wplc_data['wplc_pro_sst1e_survey'] = esc_attr($_POST['wplc_pro_sst1e_survey']); }
|
4632 |
if (isset($_POST['wplc_pro_sst2'])) { $wplc_data['wplc_pro_sst2'] = esc_attr($_POST['wplc_pro_sst2']); }
|
4633 |
+
if (isset($_POST['wplc_pro_tst1'])) { $wplc_data['wplc_pro_tst1'] = esc_attr($_POST['wplc_pro_tst1']); }
|
4634 |
if (isset($_POST['wplc_pro_intro'])) { $wplc_data['wplc_pro_intro'] = esc_attr($_POST['wplc_pro_intro']); }
|
4635 |
if (isset($_POST['wplc_user_enter'])) { $wplc_data['wplc_user_enter'] = esc_attr($_POST['wplc_user_enter']); }
|
4636 |
if (isset($_POST['wplc_text_chat_ended'])) { $wplc_data['wplc_text_chat_ended'] = esc_attr($_POST['wplc_text_chat_ended']); }
|
4639 |
if (isset($_POST['wplc_welcome_msg'])) { $wplc_data['wplc_welcome_msg'] = esc_attr($_POST['wplc_welcome_msg']); }
|
4640 |
|
4641 |
|
4642 |
+
if(isset($_POST['wplc_animation'])){ $wplc_data['wplc_animation'] = esc_attr($_POST['wplc_animation']); }
|
4643 |
if(isset($_POST['wplc_theme'])){ $wplc_data['wplc_theme'] = esc_attr($_POST['wplc_theme']); }
|
4644 |
if(isset($_POST['wplc_newtheme'])){ $wplc_data['wplc_newtheme'] = esc_attr($_POST['wplc_newtheme']); }
|
4645 |
|
4647 |
if(isset($_POST['wplc_elem_trigger_type'])){ $wplc_data['wplc_elem_trigger_type'] = esc_attr($_POST['wplc_elem_trigger_type']); } else { $wplc_data['wplc_elem_trigger_type'] = "0";}
|
4648 |
if(isset($_POST['wplc_elem_trigger_id'])){ $wplc_data['wplc_elem_trigger_id'] = esc_attr($_POST['wplc_elem_trigger_id']); } else { $wplc_data['wplc_elem_trigger_id'] = ""; }
|
4649 |
|
4650 |
+
if(isset($_POST['wplc_agent_select']) && $_POST['wplc_agent_select'] != "") {
|
4651 |
$user_array = get_users(array(
|
4652 |
'meta_key' => 'wplc_ma_agent',
|
4653 |
));
|
4660 |
delete_user_meta($uid, "wplc_chat_agent_online");
|
4661 |
}
|
4662 |
}
|
4663 |
+
|
4664 |
+
|
4665 |
$uid = intval($_POST['wplc_agent_select']);
|
4666 |
$wplc_ma_user = new WP_User( $uid );
|
4667 |
$wplc_ma_user->add_cap( 'wplc_ma_agent' );
|
4670 |
|
4671 |
}
|
4672 |
|
4673 |
+
|
4674 |
if(isset($_POST['wplc_ban_users_ip'])){
|
4675 |
$wplc_banned_ip_addresses = explode('<br />', nl2br(sanitize_text_field($_POST['wplc_ban_users_ip'])));
|
4676 |
foreach($wplc_banned_ip_addresses as $key => $value) {
|
4710 |
update_option('wplc_mail_username', $_POST['wplc_mail_username']);
|
4711 |
update_option('wplc_mail_password', $_POST['wplc_mail_password']);
|
4712 |
|
|
|
|
|
|
|
4713 |
echo "<div class='updated wplc_settings_save_notice' style='display: none;'>";
|
4714 |
_e("Your settings have been saved.", "wplivechat");
|
4715 |
echo "</div>";
|
4730 |
wp_redirect( admin_url("/admin.php?page=wplivechat-menu&override=1") );
|
4731 |
}
|
4732 |
if( isset( $_GET['override'] ) && $_GET['override'] == '1' ){
|
4733 |
+
update_option( "WPLC_V8_FIRST_TIME", false);
|
4734 |
}
|
4735 |
if (isset($_POST['wplc_nl_send_feedback'])) {
|
4736 |
if (wp_mail("nick@wp-livechat.com", "Plugin feedback", "Name: " . $_POST['wplc_nl_feedback_name'] . "\n\r" . "Email: " . $_POST['wplc_nl_feedback_email'] . "\n\r" . "Website: " . $_POST['wplc_nl_feedback_website'] . "\n\r" . "Feedback:" . $_POST['wplc_nl_feedback_feedback'])) {
|
4791 |
if(is_admin()){
|
4792 |
$wplc_error_count = 0;
|
4793 |
$wplc_admin_warnings = "<div class='error'>";
|
4794 |
+
if(!function_exists('set_time_limit')){
|
4795 |
$wplc_admin_warnings .= "
|
4796 |
<p>".__("WPLC: set_time_limit() is not enabled on this server. You may experience issues while using WP Live Chat Support as a result of this. Please get in contact your host to get this function enabled.", "wplivechat")."</p>
|
4797 |
";
|
4798 |
+
$wplc_error_count++;
|
4799 |
}
|
4800 |
if(ini_get('safe_mode')){
|
4801 |
$wplc_admin_warnings .= "
|
4828 |
<h2 class="nav-tab-wrapper">
|
4829 |
<a href="admin.php?page=wplivechat-menu-extensions-page" title="<?php _e("Add-ons","wplivechat"); ?>" class="nav-tab <?php echo $normal; ?>"><?php _e("Add-ons","wplivechat"); ?></a><a href="admin.php?page=wplivechat-menu-extensions-page&type=additional" title="<?php _e("Suggested Plugins","wplivechat"); ?>" class="nav-tab <?php echo $additional; ?>"><?php _e("Suggested Plugins","wplivechat"); ?></a>
|
4830 |
<span style='float: right; bottom:-5px; position: relative;'><img src='<?php echo plugins_url('/images/codecabin.png', __FILE__); ?>' style="height:15px;" /></span>
|
4831 |
+
</h2>
|
4832 |
<div id="tab_container">
|
4833 |
|
4834 |
|
4835 |
+
<?php
|
4836 |
if (isset($_GET['type']) && $_GET['type'] == "additional") {
|
4837 |
?>
|
4838 |
|
4859 |
</div>
|
4860 |
|
4861 |
|
4862 |
+
<?php } else {
|
4863 |
$filter1 = "all";
|
4864 |
$filter2 = "all";
|
4865 |
|
4902 |
|
4903 |
$response = wp_remote_post( "https://ccplugins.co/api-wplc-extensions", array(
|
4904 |
'method' => 'POST',
|
4905 |
+
'body' => array(
|
4906 |
'action' => 'extensions',
|
4907 |
'filter1' => $filter1,
|
4908 |
'filter2' => $filter2
|
4909 |
+
)
|
4910 |
)
|
4911 |
);
|
4912 |
if(is_array($response) && isset($response['body'])){
|
4942 |
}
|
4943 |
?>
|
4944 |
|
4945 |
+
|
4946 |
|
4947 |
<?php } ?>
|
4948 |
|
4956 |
*/
|
4957 |
function wplc_support_menu() {
|
4958 |
wplc_stats("support");
|
4959 |
+
?>
|
4960 |
<h1><?php _e("WP Live Chat Support","wplivechat"); ?></h1>
|
4961 |
<div class="wplc_row">
|
4962 |
<div class='wplc_row_col' style='background-color:#FFF;'>
|
4968 |
<li><a href='https://wp-livechat.com/documentation/minimum-system-requirements/' target='_BLANK' title='<?php _e("Minimum System Requirements","wplivechat"); ?>'><?php _e("Minimum System Requirements","wplivechat"); ?></a></li>
|
4969 |
<li><a href='https://wp-livechat.com/documentation/do-i-have-to-be-logged-into-the-dashboard-to-chat-with-visitors/' target='_BLANK' title='<?php _e("Do I have to be logged into the dashboard to chat with visitors?","wplivechat"); ?>'><?php _e("Do I have to be logged into the dashboard to chat with visitors?","wplivechat"); ?></a></li>
|
4970 |
<li><a href='https://wp-livechat.com/documentation/what-are-quick-responses/' target='_BLANK' title='<?php _e("What are Quick Responses?","wplivechat"); ?>'><?php _e("What are Quick Responses?","wplivechat"); ?></a></li>
|
4971 |
+
<li><a href='https://wp-livechat.com/documentation/can-i-use-this-plugin-on-my-multi-site/' target='_BLANK' title='<?php _e("Can I use this plugin on my multi-site?","wplivechat"); ?>'><?php _e("Can I use this plugin on my multi-site?","wplivechat"); ?></a></li>
|
4972 |
<li><a href='https://wp-livechat.com/documentation/how-do-i-disable-apc-object-cache/' target='_BLANK' title='<?php _e("How do I disable APC Object Cache?","wplivechat"); ?>'><?php _e("How do I disable APC Object Cache?","wplivechat"); ?></a></li>
|
4973 |
<li><a href='https://wp-livechat.com/documentation/do-you-have-a-mobile-app/' target='_BLANK' title='<?php _e("Do you have a mobile app?","wplivechat"); ?>'><?php _e("Do you have a mobile app?","wplivechat"); ?></a></li>
|
4974 |
<li><a href='https://wp-livechat.com/documentation/how-do-i-check-for-javascript-errors-on-my-site/' target='_BLANK' title='<?php _e("How do I check for JavaScript errors on my site?","wplivechat"); ?>'><?php _e("How do I check for JavaScript errors on my site?","wplivechat"); ?></a></li>
|
5009 |
* @return string contents ofthe pointers and their scripts
|
5010 |
*/
|
5011 |
function wp_button_pointers_load_scripts($hook) {
|
5012 |
+
$wplcrun = false;
|
5013 |
+
global $wplc_version;
|
5014 |
+
|
5015 |
+
$wplc_settings = get_option("WPLC_SETTINGS");
|
5016 |
+
if ( isset( $wplc_settings['wplc_enable_all_admin_pages'] ) && $wplc_settings['wplc_enable_all_admin_pages'] === '1' ) {
|
5017 |
+
/* Run admin JS on all admin pages */
|
5018 |
+
$wplcrun = true;
|
5019 |
+
|
5020 |
+
|
5021 |
+
} else {
|
5022 |
+
|
5023 |
+
if( $hook === 'toplevel_page_wplivechat-menu') { $wplcrun = true; } // stop if we are not on the right page
|
5024 |
+
}
|
5025 |
+
|
5026 |
+
|
5027 |
+
if ( $wplcrun ) {
|
5028 |
|
5029 |
|
5030 |
+
|
5031 |
+
|
5032 |
+
$pointer_localize_strings = array(
|
5033 |
+
"initiate" => "<h3>".__("Initiate Chats","wplivechat")."</h3><p>".__("With the Pro add-on of WP Live Chat Support, you can", "wplivechat")." <a href='http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=initiate1_pointer' title='".__("see who's online and initiate chats", "wplivechat")."' target=\"_BLANK\">".__("initiate chats", "wplivechat")."</a> ".__("with your online visitors with the click of a button.", "wplivechat")." <br /><br /><a href='http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=initiate2_pointer' title='".__("Buy the Pro add-on now (once off payment).", "wplivechat")."' target=\"_BLANK\"><strong>".__("Buy the Pro add-on now (once off payment).", "wplivechat")."</strong></a></p>",
|
5034 |
+
"chats" => "<h3>".__("Multiple Chats","wplivechat")."</h3><p>".__("With the Pro add-on of WP Live Chat Support, you can", "wplivechat")." <a href='http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=morechats1_pointer' title='".__("accept and handle multiple chats.", "wplivechat")."' target=\"_BLANK\">".__("accept and handle multiple chats.", "wplivechat")."</a><br /><br /><a href='http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=morechats2_pointer' title='".__("Buy the Pro add-on now (once off payment).", "wplivechat")."' target=\"_BLANK\"><strong>".__("Buy the Pro add-on now (once off payment).", "wplivechat")."</strong></a></p>",
|
5035 |
+
"agent_info" => "<h3>".__("Add unlimited agents","wplivechat")."</h3><p><a href='http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=unlimited_agents1_pointer' title='".__("Add unlimited agents", "wplivechat")."' target=\"_BLANK\">".__("Add unlimited agents", "wplivechat")."</a> ".__(" with the Pro add-on of WP Live Chat Support","wplivechat")." "."<a href='http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=unlimited_agents2_pointer' target='_BLANK'>".__("(once off payment).","wplivechat")."</a></p>",
|
5036 |
+
"transfer" => "<h3>".__("Transfer Chats","wplivechat")."</h3><p><a href='http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=transfer1_pointer' title='".__("Transfer Chats", "wplivechat")."' target=\"_BLANK\">".__("Transfer Chats", "wplivechat")."</a> ".__(" with the Pro add-on of WP Live Chat Support","wplivechat")." "."<a href='http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=transfer2_pointer' target='_BLANK'>".__("(once off payment).","wplivechat")."</a></p>",
|
5037 |
+
"direct_to_page" => "<h3>".__("Direct User To Page","wplivechat")."</h3><p><a href='http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=direct_to_page_1' title='".__("Transfer Chats", "wplivechat")."' target=\"_BLANK\">".__("Direct User To Page", "wplivechat")."</a> ".__(" with the Pro add-on of WP Live Chat Support","wplivechat")." "."<a href='http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=direct_to_page_2' target='_BLANK'>".__("(once off payment).","wplivechat")."</a></p>"
|
5038 |
+
);
|
5039 |
+
|
5040 |
+
|
5041 |
+
wp_enqueue_style( 'wp-pointer' );
|
5042 |
+
wp_enqueue_script( 'wp-pointer' );
|
5043 |
+
wp_register_script('wplc-user-admin-pointer', plugins_url('/js/wplc-admin-pointers.js', __FILE__), array('wp-pointer'), $wplc_version);
|
5044 |
+
wp_enqueue_script('wplc-user-admin-pointer');
|
5045 |
+
wp_localize_script('wplc-user-admin-pointer', 'pointer_localize_strings', $pointer_localize_strings);
|
5046 |
+
}
|
5047 |
+
|
5048 |
}
|
5049 |
|
5050 |
add_filter( 'admin_footer_text', 'wplc_footer_mod' );
|
5060 |
'https://wordpress.org/support/view/plugin-reviews/wp-live-chat-support?filter=5#postform'
|
5061 |
);
|
5062 |
|
5063 |
+
return str_replace( '</span>', '', $footer_text ) . ' | ' . $footer_text_mod . ' | ' . __('WP Live Chat Support is a product of','wplivechat') . ' <a target="_BLANK" href="http://codecabin.co.za/?utm_source=livechat&utm_medium=link&utm_campaign=footer" border="0"><img src="'.plugins_url('/images/codecabin.png', __FILE__).'" style="height:10px;"/></span></a>';
|
5064 |
} else {
|
5065 |
return $footer_text;
|
5066 |
}
|
5094 |
if($new_chat_status != $post_data['chat_status']){
|
5095 |
$array['chat_status'] = $new_chat_status;
|
5096 |
$array['action'] = "wplc_update_chat_status";
|
5097 |
+
}
|
5098 |
$new_chat_message = wplc_return_admin_chat_messages(sanitize_text_field($post_data['cid']));
|
5099 |
+
|
5100 |
if($new_chat_message){
|
5101 |
+
|
5102 |
$array['chat_message'] = $new_chat_message;
|
5103 |
$array['action'] = "wplc_new_chat_message";
|
5104 |
}
|
5105 |
}
|
5106 |
}
|
5107 |
+
|
5108 |
return $array;
|
5109 |
}
|
5110 |
|
5134 |
$default_agent_id = $user->ID;
|
5135 |
$default_agent_user = $user->display_name;
|
5136 |
$wplc_agents .= "<h3>" . $user->display_name . "</h3>";
|
5137 |
+
|
5138 |
$wplc_agents .= "<small>" . $user->user_email . "</small>";
|
5139 |
|
5140 |
|
5149 |
$blogusers = get_users( array( 'role' => 'administrator', 'fields' => array( 'display_name','id','user_email' ) ) );
|
5150 |
if ($blogusers) {
|
5151 |
foreach ( $blogusers as $user ) {
|
5152 |
+
$is_agent = get_user_meta(esc_html( $user->id ), 'wplc_ma_agent', true);
|
5153 |
$temp_line2 = '<option id="wplc_selected_agent_'. esc_html( $user->id ) .'" value="' . esc_html( $user->id ) . '">' . esc_html( $user->display_name ) . ' ('.__('Administrator','wplivechat').')</option>';
|
5154 |
if(!$is_agent){ $temp_line .= $temp_line2; }
|
5155 |
}
|
5158 |
$blogusers = get_users( array( 'role' => 'editor', 'fields' => array( 'display_name','id','user_email' ) ) );
|
5159 |
if ($blogusers) {
|
5160 |
foreach ( $blogusers as $user ) {
|
5161 |
+
$is_agent = get_user_meta(esc_html( $user->id ), 'wplc_ma_agent', true);
|
5162 |
$temp_line2 = '<option id="wplc_selected_agent_'. esc_html( $user->id ) .'" value="' . esc_html( $user->id ) . '">' . esc_html( $user->display_name ) . ' ('.__('Editor','wplivechat').')</option>';
|
5163 |
if(!$is_agent){ $temp_line .= $temp_line2; }
|
5164 |
}
|
5167 |
$blogusers = get_users( array( 'role' => 'author', 'fields' => array( 'display_name','id','user_email' ) ) );
|
5168 |
if ($blogusers) {
|
5169 |
foreach ( $blogusers as $user ) {
|
5170 |
+
$is_agent = get_user_meta(esc_html( $user->id ), 'wplc_ma_agent', true);
|
5171 |
$temp_line2 = '<option id="wplc_selected_agent_'. esc_html( $user->id ) .'" value="' . esc_html( $user->id ) . '">' . esc_html( $user->display_name ) . ' ('.__('Author','wplivechat').')</option>';
|
5172 |
if(!$is_agent){ $temp_line .= $temp_line2; }
|
5173 |
}
|
5181 |
<p><i class='fa fa-plus-circle fa-4x' style='color:#ccc;' ></i></p>
|
5182 |
<h3><?php _e("Add New Agent","wplivechat"); ?></h3>
|
5183 |
<p><button class='button button-secondary' id='wplc_add_agent' disabled style=><?php _e("Add Agent","wplivechat"); ?></button></p>
|
5184 |
+
<p style='font-size:0.8em'><?php _e("Add as many agents as you need with the ","wplivechat") ?> <a href="https://wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=multipleAgents" target="_BLANK"><?php _e("Pro version.", "wplivechat") ?></a></p>
|
5185 |
</li>
|
5186 |
</ul>
|
5187 |
<?php
|
5193 |
?>
|
5194 |
|
5195 |
</div>
|
5196 |
+
|
5197 |
<hr/>
|
5198 |
<?php
|
5199 |
}
|
5211 |
|
5212 |
add_filter( "wplc_filter_get_chat_data", "wplc_get_local_chat_data", 10, 2 );
|
5213 |
function wplc_get_local_chat_data($result, $cid) {
|
5214 |
+
global $wpdb;
|
5215 |
global $wplc_tblname_chats;
|
5216 |
|
5217 |
$sql = "SELECT * FROM $wplc_tblname_chats WHERE `id` = '".intval($cid)."' LIMIT 1";
|
5218 |
$results = $wpdb->get_results($sql);
|
5219 |
if (isset($results[0])) { $result = $results[0]; } else { $result = null; }
|
5220 |
+
|
5221 |
return $result;
|
5222 |
|
5223 |
}
|
5228 |
* @return array Chat messages based on the ID provided
|
5229 |
*/
|
5230 |
function wplc_get_chat_messages($cid, $only_read_messages = false, $wplc_settings = false) {
|
5231 |
+
global $wpdb;
|
5232 |
global $wplc_tblname_msgs;
|
5233 |
|
5234 |
if (!$wplc_settings) {
|
5235 |
+
$wplc_settings = get_option("WPLC_SETTINGS");
|
5236 |
}
|
5237 |
|
5238 |
/**
|
5239 |
* Identify if the user is using the node server and if they are, display all messages. Otherwise display read only messages (non-node users)
|
5240 |
*/
|
5241 |
if (isset($wplc_settings['wplc_use_node_server']) && $wplc_settings['wplc_use_node_server'] == '1') {
|
5242 |
+
|
5243 |
+
$sql = "
|
5244 |
+
SELECT * FROM (
|
5245 |
+
SELECT *
|
5246 |
+
FROM $wplc_tblname_msgs
|
5247 |
+
WHERE `chat_sess_id` = '$cid'
|
5248 |
+
ORDER BY `timestamp` DESC LIMIT 100
|
5249 |
+
) sub
|
5250 |
+
ORDER BY `timestamp` ASC
|
5251 |
+
";
|
5252 |
+
} else {
|
5253 |
+
if ($only_read_messages) {
|
5254 |
+
// only show read messages
|
5255 |
+
$sql =
|
5256 |
+
"
|
5257 |
+
SELECT * FROM (
|
5258 |
+
SELECT *
|
5259 |
+
FROM $wplc_tblname_msgs
|
5260 |
+
WHERE `chat_sess_id` = '$cid' AND `status` = 1
|
5261 |
+
ORDER BY `timestamp` DESC LIMIT 100
|
5262 |
+
) sub
|
5263 |
+
ORDER BY `timestamp` ASC
|
5264 |
+
";
|
5265 |
+
} else {
|
5266 |
+
$sql =
|
5267 |
+
"
|
5268 |
+
SELECT * FROM (
|
5269 |
+
SELECT *
|
5270 |
+
FROM $wplc_tblname_msgs
|
5271 |
+
WHERE `chat_sess_id` = '$cid'
|
5272 |
+
ORDER BY `timestamp` DESC LIMIT 100
|
5273 |
+
) sub
|
5274 |
+
ORDER BY `timestamp` ASC
|
5275 |
+
";
|
5276 |
+
}
|
5277 |
+
|
5278 |
+
}
|
5279 |
+
$results = $wpdb->get_results($sql);
|
5280 |
+
|
5281 |
if (isset($results[0])) { } else { $results = null; }
|
5282 |
$results = apply_filters("wplc_filter_get_chat_messages",$results,$cid);
|
5283 |
+
|
5284 |
if ($results == "null") {
|
5285 |
return false;
|
5286 |
+
} else {
|
5287 |
return $results;
|
5288 |
}
|
5289 |
}
|
5297 |
function wplc_build_api_check($page_content, $data) {
|
5298 |
$link = "#";
|
5299 |
$image = "https://ccplugins.co/api-wplc-extensions/images/add-on0.jpg";
|
5300 |
+
if ($data['string'] == "Multiple Agents") {
|
5301 |
$link = "";
|
5302 |
$image = "https://ccplugins.co/api-wplc-extensions/images/Agents-Small.jpg";
|
5303 |
}
|
5304 |
+
if ($data['string'] == "Cloud Server") {
|
5305 |
$link = "";
|
5306 |
$image = "https://ccplugins.co/api-wplc-extensions/images/Cloud-Small.jpg";
|
5307 |
}
|
5308 |
+
if ($data['string'] == "Advanced Chat Box Control") {
|
5309 |
$link = "https://wp-livechat.com/extensions/advanced-chat-control/";
|
5310 |
$image = "https://ccplugins.co/api-wplc-extensions/images/AdvancedChatBox-Small.jpg";
|
5311 |
+
}
|
5312 |
+
if ($data['string'] == "Choose When Online") {
|
5313 |
$link = "";
|
5314 |
$image = "https://ccplugins.co/api-wplc-extensions/images/ChooseOnline-Small.jpg";
|
5315 |
+
}
|
5316 |
+
if ($data['string'] == "Encryption") {
|
5317 |
$link = "";
|
5318 |
$image = "https://ccplugins.co/api-wplc-extensions/images/Encryption-Small.jpg";
|
5319 |
+
}
|
5320 |
+
if ($data['string'] == "Mobile and Desktop App") {
|
5321 |
$link = "";
|
5322 |
$image = "https://ccplugins.co/api-wplc-extensions/images/MobileDesktop-Small.jpg";
|
5323 |
+
}
|
5324 |
+
if ($data['string'] == "Initiate Chats") {
|
5325 |
$link = "";
|
5326 |
$image = "https://ccplugins.co/api-wplc-extensions/images/InitiateChat-Small.jpg";
|
5327 |
+
}
|
5328 |
+
if ($data['string'] == "Include Exclude Pages") {
|
5329 |
$link = "";
|
5330 |
$image = "https://ccplugins.co/api-wplc-extensions/images/IncludeAndExclude-Small.jpg";
|
5331 |
+
}
|
5332 |
|
5333 |
|
5334 |
+
if ($data['string'] == "WP Live Chat Support Pro") {
|
5335 |
$link = "";
|
5336 |
$image = "https://ccplugins.co/api-wplc-extensions/images/add-on0.jpg";
|
5337 |
}
|
5388 |
*/
|
5389 |
function wplc_filter_control_relevant_extensions_main_proe($text) {
|
5390 |
if (function_exists("wplc_hook_control_intiate_check")) { return $text; }
|
5391 |
+
|
5392 |
$rel_name = __("Pro Add-on","wplivechat");
|
5393 |
$rel_image = "https://ccplugins.co/api-wplc-extensions/images/add-on0.jpg";
|
5394 |
$rel_link = "http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=relevant_pro";
|
5415 |
*/
|
5416 |
function wplc_filter_control_relevant_extensions_main_mobile($text) {
|
5417 |
if (function_exists("wplc_mobile_check_if_logged_in")) { return $text; }
|
5418 |
+
|
5419 |
$rel_name = __("Mobile & Desktop App","wplivechat");
|
5420 |
$rel_image = "https://ccplugins.co/api-wplc-extensions/images/MobileDesktop-Icon.jpg";
|
5421 |
$rel_link = "https://wp-livechat.com/extensions/mobile-desktop-app-extension/?utm_source=plugin&utm_medium=link&utm_campaign=relevant_mobile";
|
5433 |
return $text;
|
5434 |
}
|
5435 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5436 |
|
5437 |
add_filter("wplc_filter_relevant_extensions_chatbox","wplc_filter_control_relevant_extensions_chatbox_proe");
|
5438 |
/**
|
5442 |
*/
|
5443 |
function wplc_filter_control_relevant_extensions_chatbox_proe($text) {
|
5444 |
if (function_exists("wplc_hook_control_intiate_check")) { return $text; }
|
5445 |
+
|
5446 |
$rel_name = __("Pro Add-on","wplivechat");
|
5447 |
$rel_image = "https://ccplugins.co/api-wplc-extensions/images/add-on0.jpg";
|
5448 |
$rel_link = "http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=relevant_pro_chatbox";
|
5515 |
$wplc_settings = get_option("WPLC_SETTINGS");
|
5516 |
if(isset($wplc_settings["wplc_powered_by_link"]) && $wplc_settings["wplc_powered_by_link"] == 0){
|
5517 |
|
5518 |
+
} else if(!isset($wplc_settings["wplc_powered_by_link"])) {
|
5519 |
|
5520 |
} else{
|
5521 |
$content .= "<a title='".__("Powered By WP Live Chat Support", "wplivechat")."' target='_blank' rel='nofollow' href='https://wp-livechat.com/?utm_source=poweredby&utm_medium=click&utm_campaign=".esc_html(site_url())."' class='wplc_powered_by_link'>".__("Powered By WP Live Chat Support", "wplivechat")."</a>";
|
5538 |
if (isset($_GET['action']) && $_GET['action'] == "download_history") {
|
5539 |
|
5540 |
global $wpdb;
|
5541 |
+
|
5542 |
$chat_id = sanitize_text_field( $_GET['cid'] );
|
5543 |
$fileName = 'live_chat_history_'.$chat_id.'.csv';
|
5544 |
|
5553 |
|
5554 |
global $wpdb;
|
5555 |
global $wplc_tblname_msgs;
|
5556 |
+
|
5557 |
$results = $wpdb->get_results(
|
5558 |
"
|
5559 |
SELECT *
|
5578 |
} else {
|
5579 |
$user = __('agent', 'wplivechat');
|
5580 |
}
|
5581 |
+
|
5582 |
$fields[] = array(
|
5583 |
'id' => $key->chat_sess_id,
|
5584 |
'msgfrom' => $key->msgfrom,
|
5586 |
'time' => $key->timestamp,
|
5587 |
'orig' => $user,
|
5588 |
);
|
5589 |
+
}
|
5590 |
|
5591 |
foreach($fields as $field){
|
5592 |
+
fputcsv($fh, $field, ",", '"');
|
5593 |
}
|
5594 |
// Close the file
|
5595 |
fclose($fh);
|
5596 |
// Make sure nothing else is sent, our file is done
|
5597 |
exit;
|
5598 |
+
|
5599 |
}
|
5600 |
}
|
5601 |
/**
|
5602 |
+
* Retrieves the data to start downloadling the chat history
|
5603 |
* @param string $type Chat history output type
|
5604 |
* @param string $cid Chat ID
|
5605 |
* @return void
|
5611 |
|
5612 |
global $wpdb;
|
5613 |
global $wplc_tblname_msgs;
|
5614 |
+
|
5615 |
$results = $wpdb->get_results(
|
5616 |
"
|
5617 |
SELECT *
|
5636 |
} else {
|
5637 |
$user = __('agent', 'wplivechat');
|
5638 |
}
|
5639 |
+
|
5640 |
$fields[] = array(
|
5641 |
'id' => $key->chat_sess_id,
|
5642 |
'msgfrom' => $key->msgfrom,
|
5644 |
'time' => $key->timestamp,
|
5645 |
'orig' => $user,
|
5646 |
);
|
5647 |
+
}
|
5648 |
+
|
5649 |
ob_end_clean();
|
5650 |
+
|
5651 |
wplc_convert_to_csv_new($fields, 'live_chat_history_'.$cid.'.csv', ',');
|
5652 |
+
|
5653 |
exit();
|
5654 |
}
|
5655 |
|
5657 |
* Converts contents into a CSV file
|
5658 |
* @param string $in Contents of file
|
5659 |
* @param string $out Output of file
|
5660 |
+
* @param string $del Delimiter for content
|
5661 |
* @return void
|
5662 |
*/
|
5663 |
function wplc_convert_to_csv_new($in, $out, $del){
|
5664 |
+
|
5665 |
$f = fopen('php://memory', 'w');
|
5666 |
|
5667 |
foreach ($in as $line) {
|
5671 |
fseek($f, 0);
|
5672 |
|
5673 |
header('Content-Type: application/csv');
|
5674 |
+
|
5675 |
header('Content-Disposition: attachement; filename="' . $out . '";');
|
5676 |
|
5677 |
fpassthru($f);
|
5698 |
function wplc_plugin_row_invalid_api() {
|
5699 |
echo '<tr class="active"><td> </td><td colspan="2" style="color:red;">
|
5700 |
'.__('Your API Key is Invalid. You are not eligible for future updates. Please enter your API key <a href="admin.php?page=wplivechat-menu-api-keys-page">here</a>.','wplivechat').'
|
5701 |
+
</td></tr>';
|
5702 |
}
|
5703 |
|
5704 |
/**
|
5797 |
add_filter("wplc_filter_typing_control_div","wplc_basic_filter_control_return_chat_response_box_before",2,1);
|
5798 |
function wplc_basic_filter_control_return_chat_response_box_before($string) {
|
5799 |
remove_filter("wplc_filter_typing_control_div","wplc_pro_filter_control_return_chat_response_box_before");
|
5800 |
+
$string = $string. "<div class='typing_indicator wplc-color-2 wplc-color-bg-1'></div>";
|
5801 |
|
5802 |
return $string;
|
5803 |
}
|
5845 |
<option value='2' <?php if (isset($wplc_environment[2])) { echo $wplc_environment[2]; } ?>><?php _e("Shared hosting - normal plan","wplivechat"); ?></option>
|
5846 |
<option value='3' <?php if (isset($wplc_environment[3])) { echo $wplc_environment[3]; } ?>><?php _e("VPS","wplivechat"); ?></option>
|
5847 |
<option value='4' <?php if (isset($wplc_environment[4])) { echo $wplc_environment[4]; } ?>><?php _e("Dedicated server","wplivechat"); ?></option>
|
5848 |
+
</select>
|
5849 |
</td>
|
5850 |
</tr>
|
5851 |
<tr>
|
5853 |
<?php _e("Long poll setup","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Only change these if you are an experienced developer or if you have received these figures from the Code Cabin Support team.", "wplivechat") ?>"></i>
|
5854 |
</td>
|
5855 |
<td valign='top'>
|
5856 |
+
<?php
|
5857 |
$wplc_advanced_settings = get_option("wplc_advanced_settings");
|
5858 |
?>
|
5859 |
<table>
|
5892 |
$content .= "<td style='vertical-align:top;'>";
|
5893 |
$content .= "<h3>".__('WP Live Chat Support Reporting', 'wp-livechat')."</h3>";
|
5894 |
$content .= "<p>".__('View comprehensive reports regarding your chat and agent activity.', 'wp-livechat')."</p>";
|
5895 |
+
|
5896 |
+
|
5897 |
$content .= "<br><p><strong>".__('Reports', 'wp-livechat').":</strong></p>";
|
5898 |
$content .= "<ul style='list-style: inherit;margin-left: 22px;'>";
|
5899 |
$content .= "<li>".__('Chat statistics', 'wp-livechat')."</li>";
|
5900 |
$content .= "<li>".__('Popular pages', 'wp-livechat')."</li>";
|
5901 |
$content .= "<li>".__('ROI reporting and tracking (identify which agents produce the most sales)', 'wp-livechat')."</li>";
|
5902 |
+
$content .= "<li>".__('User experience ratings (identify which agents produce the happiest customers)', 'wp-livechat')."</li>";
|
5903 |
$content .= "</ul>";
|
5904 |
|
5905 |
if (function_exists("wplc_pro_activate")) {
|
5957 |
$content .= "<td style='vertical-align:top;'>";
|
5958 |
$content .= "<h3>".__('WP Live Chat Support Triggers', 'wp-livechat')."</h3>";
|
5959 |
$content .= "<p>".__('Create custom data triggers when users view a certain page, spend a certain amount of time on a page, scroll past a certain point or when their mouse leaves the window.', 'wp-livechat')."</p>";
|
5960 |
+
|
5961 |
+
|
5962 |
$content .= "<br><p><strong>".__('Trigger Types', 'wp-livechat').":</strong></p>";
|
5963 |
$content .= "<ul style='list-style: inherit;margin-left: 22px;'>";
|
5964 |
$content .= "<li>".__('Page Trigger', 'wp-livechat')."</li>";
|
5965 |
$content .= "<li>".__('Time Trigger', 'wp-livechat')."</li>";
|
5966 |
$content .= "<li>".__('Scroll Trigger', 'wp-livechat')."</li>";
|
5967 |
+
$content .= "<li>".__('Page Leave Trigger', 'wp-livechat')."</li>";
|
5968 |
$content .= "</ul>";
|
5969 |
|
5970 |
if (function_exists("wplc_pro_activate")) {
|
5990 |
*/
|
5991 |
function wplc_basic_custom_fields_page(){
|
5992 |
$content = "<div class='wrap'>";
|
5993 |
+
$content .= "<h2>".__('WP Live Chat Support Custom Fields', 'wplivechat')."</h2>";
|
5994 |
$content .= "<table class=\"wp-list-table widefat fixed form-table\" cellspacing=\"0\" style='width:98%'>";
|
5995 |
$content .= "<tr>";
|
5996 |
$content .= "<td style='width:35%; vertical-align:top;'>";
|
5997 |
+
$content .= "<img class='trigger_img_main' style='width:99%; height:auto; padding:2px; border:1px lightgray solid;box-shadow: 3px 3px 2px -2px #999;-webkit-box-shadow: 3px 3px 2px -2px #999;-moz-box-shadow: 3px 3px 2px -2px #999;-o-box-shadow: 3px 3px 2px -2px #999;' src='".plugins_url('/images/trigger_sample.jpg', __FILE__)."'>";
|
5998 |
$content .= "</td>";
|
5999 |
$content .= "<td style='vertical-align:top;'>";
|
6000 |
$content .= "<h3>".__('WP Live Chat Support Custom Fields', 'wp-livechat')."</h3>";
|
6001 |
+
$content .= "<p>".__('Create custom fields, allowing your visitors to enter the data you need before starting a chat.', 'wp-livechat')."</p>";
|
6002 |
$content .= "<br><p><strong>".__('Custom Field Types', 'wp-livechat').":</strong></p>";
|
6003 |
$content .= "<ul style='list-style: inherit;margin-left: 22px;'>";
|
6004 |
$content .= "<li>".__('Text Fields', 'wp-livechat')."</li>";
|
6005 |
+
$content .= "<li>".__('Dropdown Fields', 'wp-livechat')."</li>";
|
6006 |
$content .= "</ul>";
|
6007 |
|
6008 |
if (function_exists("wplc_pro_activate")) {
|
6029 |
*/
|
6030 |
function wplc_powered_by_link_settings_page() {
|
6031 |
$wplc_powered_by = get_option("WPLC_POWERED_BY");
|
6032 |
+
?>
|
6033 |
<table class='form-table wp-list-table widefat fixed striped pages' width='700'>
|
6034 |
<tr>
|
6035 |
+
<td width='350' valign='top'>
|
6036 |
+
<?php _e("Display a 'Powered by' link in the chat box", "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' caption at the bottom of your chatbox.", 'wplivechat'); ?>"></i>
|
6037 |
+
</td>
|
6038 |
<td>
|
6039 |
+
<input type="checkbox" value="1" name="wplc_powered_by" <?php if ( $wplc_powered_by && $wplc_powered_by == 1 ) { echo "checked"; } ?> />
|
6040 |
</td>
|
6041 |
</tr>
|
6042 |
</table>
|
6070 |
* @param int $cid the current chat ID
|
6071 |
* @return string the chat contents, with the 'Powered by' link appended to it
|
6072 |
*/
|
6073 |
+
function wplc_powered_by_link_in_chat( $string ){
|
6074 |
|
6075 |
$show_powered_by = get_option( "WPLC_POWERED_BY" );
|
6076 |
+
|
6077 |
if( $show_powered_by == 1){
|
6078 |
$ret = "<i style='text-align: center; display: block; padding: 5px 0; font-size: 10px;'><a href='https://wp-livechat.com/?utm_source=poweredby&utm_medium=click&utm_campaign=".esc_html(site_url())."'' target='_BLANK' rel='nofollow'>".__("Powered by WP Live Chat Support", "wplivechat")."</a></i>";
|
6079 |
+
|
6080 |
} else {
|
6081 |
|
6082 |
$ret = "";
|
6096 |
|
6097 |
if( isset( $_GET['page'] ) && $_GET['page'] == 'wplivechat-menu-settings' ){
|
6098 |
|
6099 |
+
wp_enqueue_script( "wplc-custom-script-tab-ace",'//cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js', array('jquery') );
|
6100 |
+
|
6101 |
}
|
6102 |
|
6103 |
}
|
6104 |
|
6105 |
add_filter( "wplc_filter_setting_tabs", "wplc_custom_scripts_tab" );
|
6106 |
/**
|
6107 |
+
* Adds a tab for the custom scripts
|
6108 |
* @param array $array current array that is made available to us
|
6109 |
* @return array our tabs array has been added to the array
|
6110 |
*/
|
6111 |
function wplc_custom_scripts_tab( $array ){
|
6112 |
+
|
6113 |
$array['custom-scripts'] = array(
|
6114 |
'href' => '#wplc-custom-scripts',
|
6115 |
'icon' => 'fa fa-pencil',
|
6124 |
* Adds the tab content to the settings page to allow the user to add custom CSS & JS
|
6125 |
* @return string
|
6126 |
*/
|
6127 |
+
function wplc_custom_scripts_content(){
|
6128 |
|
6129 |
$wplc_custom_css = get_option( "WPLC_CUSTOM_CSS" );
|
6130 |
$wplc_custom_js = get_option( "WPLC_CUSTOM_JS" );
|
6131 |
+
|
6132 |
$content = "";
|
6133 |
|
6134 |
$content .= "<div id='wplc-custom-scripts'>";
|
6137 |
$content .= "<table class='form-table'>";
|
6138 |
|
6139 |
$content .= "<tr>";
|
6140 |
+
$content .= "<td width='300'>".__("Custom CSS", "wplivechat")."</td>";
|
6141 |
+
$content .= "<td><div id='wplc_custom_css_editor'></div><textarea name='wplc_custom_css' id='wplc_custom_css' style='display: none;' data-editor='css' rows='12'>".strip_tags( stripslashes( $wplc_custom_css ) )."</textarea></td>";
|
6142 |
$content .= "</tr>";
|
6143 |
|
6144 |
$content .= "<tr>";
|
6145 |
+
$content .= "<td width='300'>".__("Custom JS", "wplivechat")."</td>";
|
6146 |
+
$content .= "<td valign='middle'><div id='wplc_custom_js_editor'></div><textarea name='wplc_custom_js' id='wplc_custom_js' style='display: none;' data-editor='javascript' rows='12'>".strip_tags( stripslashes( $wplc_custom_js ) )."</textarea></td>";
|
6147 |
$content .= "</tr>";
|
6148 |
|
6149 |
$content .= "</table>";
|
6162 |
function wplc_custom_scripts_save(){
|
6163 |
|
6164 |
if( isset( $_POST['wplc_save_settings'] ) ){
|
6165 |
+
|
6166 |
if( isset( $_POST['wplc_custom_css'] ) ){
|
6167 |
update_option( "WPLC_CUSTOM_CSS", nl2br( $_POST['wplc_custom_css'] ) );
|
6168 |
}
|
6191 |
echo strip_tags( stripslashes( $wplc_custom_css ) );
|
6192 |
echo "</style>";
|
6193 |
}
|
6194 |
+
|
6195 |
if( $wplc_custom_js ){
|
6196 |
echo "<!-- WPLC Custom JS -->";
|
6197 |
echo "<script>";
|
6216 |
}
|
6217 |
|
6218 |
return $subject;
|
6219 |
+
|
6220 |
}
|
6221 |
|
6222 |
function wplc_basic_version_departments(){
|
6236 |
$content .= "</thead>";
|
6237 |
|
6238 |
$content .= "<tr><td>".__("Please update your Pro version to create a department", "wp-livechat")."</td><td></td><td></td></tr>";
|
6239 |
+
|
6240 |
$content .= "</table>";
|
6241 |
|
6242 |
echo $content;
|
6269 |
add_filter("wplc_filter_chat_4th_layer_below_input","nifty_chat_ratings_div_backwards_compat",2,2);
|
6270 |
/**
|
6271 |
* This adds backwards compatibility to the new look and feel of the modern chat box
|
6272 |
+
*
|
6273 |
* The ' | ' is removed from the rating icons to fit the new look and feel
|
6274 |
+
*
|
6275 |
*/
|
6276 |
+
function nifty_chat_ratings_div_backwards_compat($msg, $wplc_setting){
|
6277 |
$msg = str_replace(" | ","", $msg);
|
6278 |
return $msg;
|
6279 |
+
|
6280 |
}
|
6281 |
|
6282 |
/**
|
6285 |
* i.e. This is the part where we force users to upgrade their extensions to make sure everything works correctly.
|
6286 |
*
|
6287 |
* Use with caution and always try add backwards compatibility where necessary
|
6288 |
+
*
|
6289 |
* @param bool $continue
|
6290 |
* @return bool
|
6291 |
* @since 7.1.00
|
6293 |
*/
|
6294 |
add_filter( "wplc_version_check_continue", "wplc_filter_control_version_check_continue", 10, 1 );
|
6295 |
function wplc_filter_control_version_check_continue( $continue ) {
|
6296 |
+
|
6297 |
/**
|
6298 |
* Check to see that we are on the cloud server 1.3.00 or newer
|
6299 |
*/
|
6302 |
$float_version = intval( str_replace(".", "", $wplc_cloud_version ) );
|
6303 |
if ($float_version < 2000) {
|
6304 |
return sprintf( "Your chat has been disabled due to a version conflict. Please <a href='%s'>update your cloud extension</a> to 1.3.00 or higher.", admin_url('update-core.php') )."<br />";
|
6305 |
+
|
6306 |
+
}
|
6307 |
}
|
6308 |
|
6309 |
return $continue;
|
6310 |
|
6311 |
+
}
|
6312 |
+
|
6313 |
+
/*
|
6314 |
+
* Returns the WDT emoji selector
|
6315 |
+
*/
|
6316 |
+
function wplc_emoji_selector_div(){
|
6317 |
+
$wplc_settings = get_option("WPLC_SETTINGS");
|
6318 |
+
|
6319 |
+
// NB: This causes Failed to initVars ReferenceError: wplc_show_date is not defined when uncommented and enabled
|
6320 |
+
if(!empty($wplc_settings['wplc_disable_emojis']))
|
6321 |
+
return;
|
6322 |
+
|
6323 |
+
$emoji_container = "";
|
6324 |
+
if(isset($wplc_settings['wplc_use_node_server']) && $wplc_settings['wplc_use_node_server'] == 1){
|
6325 |
+
$emoji_container = '<div class="wdt-emoji-popup">
|
6326 |
+
<a href="#" class="wdt-emoji-popup-mobile-closer"> × </a>
|
6327 |
+
<div class="wdt-emoji-menu-content">
|
6328 |
+
<div id="wdt-emoji-menu-header">
|
6329 |
+
<a class="wdt-emoji-tab" data-group-name="People"></a>
|
6330 |
+
<a class="wdt-emoji-tab" data-group-name="Nature"></a>
|
6331 |
+
<a class="wdt-emoji-tab" data-group-name="Foods"></a>
|
6332 |
+
<a class="wdt-emoji-tab" data-group-name="Activity"></a>
|
6333 |
+
<a class="wdt-emoji-tab" data-group-name="Places"></a>
|
6334 |
+
<a class="wdt-emoji-tab" data-group-name="Objects"></a>
|
6335 |
+
<a class="wdt-emoji-tab" data-group-name="Symbols"></a>
|
6336 |
+
<a class="wdt-emoji-tab" data-group-name="Flags"></a>
|
6337 |
+
</div>
|
6338 |
+
<div class="wdt-emoji-scroll-wrapper">
|
6339 |
+
<div id="wdt-emoji-menu-items">
|
6340 |
+
<input id="wdt-emoji-search" type="text" placeholder="Search">
|
6341 |
+
<h3 id="wdt-emoji-search-result-title">Search Results</h3>
|
6342 |
+
<div class="wdt-emoji-sections"></div>
|
6343 |
+
<div id="wdt-emoji-no-result">No emoji found</div>
|
6344 |
+
</div>
|
6345 |
+
</div>
|
6346 |
+
<div id="wdt-emoji-footer">
|
6347 |
+
<div id="wdt-emoji-preview">
|
6348 |
+
<span id="wdt-emoji-preview-img"></span>
|
6349 |
+
<div id="wdt-emoji-preview-text">
|
6350 |
+
<span id="wdt-emoji-preview-name"></span><br>
|
6351 |
+
<span id="wdt-emoji-preview-aliases"></span>
|
6352 |
+
</div>
|
6353 |
+
</div>
|
6354 |
+
<div id="wdt-emoji-preview-bundle">
|
6355 |
+
<span></span>
|
6356 |
+
</div>
|
6357 |
+
<span class="wdt-credit">WDT Emoji Bundle</span>
|
6358 |
+
</div>
|
6359 |
+
</div>
|
6360 |
+
</div>';
|
6361 |
+
}
|
6362 |
+
|
6363 |
+
return $emoji_container;
|
6364 |
+
|
6365 |
+
}
|
6366 |
+
|
6367 |
+
add_action("wplc_hook_chat_missed","wplc_missed_chats_deprecation_notice",5);
|
6368 |
+
/**
|
6369 |
+
* Displays a notice to the user that Missed Chats is being deprecated
|
6370 |
+
*/
|
6371 |
+
function wplc_missed_chats_deprecation_notice() {
|
6372 |
+
$output = "<div class='update-nag' style='margin-top: 0px;margin-bottom: 5px;'>";
|
6373 |
+
$output .= "<strong>" . __("Deprecation Notice", "wplivechat") . "</strong><br>";
|
6374 |
+
$output .= "<p>" . __("Please note, missed chat functionality is being deprecated as we will be moving to a customer oriented system in the near future. ", "wplivechat") . "</p>";
|
6375 |
+
$output .= "<p>" . __("The new system will offer more insight into your user base while enhancing your experience when retrieving statistics and information. ", "wplivechat") . "</p>";
|
6376 |
+
$output .= "<p>" . __("This area will remain active for the time being, however it is recommended that you prepare for this change in the near future. ", "wplivechat") . "</p>";
|
6377 |
+
$output .= "</div>";
|
6378 |
+
|
6379 |
+
echo $output;
|
6380 |
+
}
|
6381 |
+
|
6382 |
+
add_action( 'admin_notices', 'wplc_browser_notifications_admin_warning' );
|
6383 |
+
/**
|
6384 |
+
* Displays browser notifications warning.
|
6385 |
+
*
|
6386 |
+
* Only displays if site is insecure (no SSL).
|
6387 |
+
*/
|
6388 |
+
function wplc_browser_notifications_admin_warning() {
|
6389 |
+
|
6390 |
+
if ( ! is_ssl() && isset( $_GET['page'] ) && strpos( $_GET['page'], 'wplivechat' ) !== false ) {
|
6391 |
+
|
6392 |
+
if ( isset( $_GET['wplc_dismiss_notice_bn'] ) && 'true' === $_GET['wplc_dismiss_notice_bn'] ) {
|
6393 |
+
|
6394 |
+
update_option( 'wplc_dismiss_notice_bn', 'true' );
|
6395 |
+
|
6396 |
+
}
|
6397 |
+
|
6398 |
+
if ( get_option( 'wplc_dismiss_notice_bn') !== 'true' ) {
|
6399 |
+
|
6400 |
+
?>
|
6401 |
+
<div class="notice notice-warning is-dismissible">
|
6402 |
+
<p><img src="<?php echo esc_attr( plugins_url( 'images/wplc-logo.png', __FILE__ ) ); ?>" style="width:260px;height:auto;max-width:100%;"></p>
|
6403 |
+
<p><strong><?php esc_html_e( 'Browser notifications will no longer function on insecure (non-SSL) sites.', 'wplivechat' ); ?></strong></p>
|
6404 |
+
<p><?php esc_html_e( 'Please add an SSL certificate to your site to continue receiving chat notifications in your browser.', 'wplivechat' ); ?></p>
|
6405 |
+
<p><a href="?page=<?php echo esc_attr( $_GET['page'] ); ?>&wplc_dismiss_notice_bn=true" id="wplc_dismiss_notice_bn" class="button"><?php esc_html_e( "Don't Show This Again", 'wplivechat' ); ?></a></p>
|
6406 |
+
</div>
|
6407 |
+
<?php
|
6408 |
+
|
6409 |
+
}
|
6410 |
+
}
|
6411 |
+
}
|
6412 |
+
|
6413 |
+
require_once(plugin_dir_path(__FILE__) . 'lib/codecabin/plugin-deactivation-survey/deactivate-feedback-form.php');
|
6414 |
+
|
6415 |
+
function wplc_register_plugin_for_deactivation_feedback_form($plugins) {
|
6416 |
+
global $wplc_version;
|
6417 |
+
$plugins[] = (object)array(
|
6418 |
+
'slug' => 'wp-live-chat-support',
|
6419 |
+
'version' => $wplc_version
|
6420 |
+
);
|
6421 |
+
|
6422 |
+
return $plugins;
|
6423 |
+
}
|
6424 |
+
|
6425 |
+
add_filter('codecabin_deactivate_feedback_form_plugins', 'wplc_register_plugin_for_deactivation_feedback_form');
|
6426 |
+
|