Version Description
- Moved screenshots to assets directory
Download this release
Release Info
Developer | livechat |
Plugin | LiveChat – WP live chat plugin for WordPress |
Version | 3.2.11 |
Comparing to | |
See all releases |
Code changes from version 3.2.10 to 3.2.11
- readme.txt +16 -13
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
- screenshot-4.png +0 -0
- screenshot-5.png +0 -0
- screenshot-6.png +0 -0
- screenshot-7.png +0 -0
- screenshot-8.png +0 -0
- trunk/livechat.php +21 -0
- trunk/plugin_files/LiveChat.class.php +158 -0
- trunk/plugin_files/LiveChatAdmin.class.php +176 -0
- trunk/plugin_files/css/livechat.css +133 -0
- trunk/plugin_files/helpers/ChangesSavedHelper.class.php +16 -0
- trunk/plugin_files/helpers/LiveChatHelper.class.php +6 -0
- trunk/plugin_files/helpers/SettingsHelper.class.php +156 -0
- trunk/plugin_files/helpers/TrackingCodeHelper.class.php +31 -0
- trunk/plugin_files/helpers/TrackingCodeInfoHelper.class.php +16 -0
- trunk/plugin_files/images/ajax_loader.gif +0 -0
- trunk/plugin_files/images/button_placement.png +0 -0
- trunk/plugin_files/images/favicon.png +0 -0
- trunk/plugin_files/images/logo.png +0 -0
- trunk/plugin_files/images/plusminus.png +0 -0
- trunk/plugin_files/js/livechat.js +275 -0
- trunk/readme.txt +135 -0
readme.txt
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
=== LiveChat - WP live chat software for Wordpress ===
|
2 |
Contributors: LiveChat
|
3 |
-
Tags: live support, live chat, live chat software, help desk, help desk software, online ticketing system, ticketing system, online support, ecommerce chat, sales, customer help, customer support, livechat, live support, customer service software, chat plugin, chat, customer service chat, live chat button, live chat plugin, live chat support, live chat tool, live chat widget, live support, live support button, live chat solution
|
4 |
|
5 |
-
Stable tag: 3.2.
|
6 |
Requires at least: 2.8
|
7 |
Tested up to: 4.2.2
|
8 |
|
9 |
-
Live chat and help desk software plugin for Wordpress. Add LiveChat (live chat and help desk software) to your Wordpress.
|
10 |
|
11 |
== Description ==
|
12 |
|
@@ -18,7 +18,7 @@ Take a tour to see why you need live chat software on your website: http://www.l
|
|
18 |
|
19 |
——-
|
20 |
|
21 |
-
Product requires active LiveChat subscription after 30 days of free trial.
|
22 |
|
23 |
|
24 |
== Installation ==
|
@@ -31,19 +31,22 @@ Product requires active LiveChat subscription after 30 days of free trial.
|
|
31 |
== Screenshots ==
|
32 |
|
33 |
1. LiveChat Applications are available for web browser, Windows Mac and iPhone, iPad and Android devices.
|
34 |
-
2. LiveChat is designed specifically for real-time customer service using chats and help desk tickets.
|
35 |
-
3. Visitors list and client details display valuable information useful during chats with customers.
|
36 |
-
4. Dashboard - a real-time glimpse of your customer service to display on a big screen.
|
37 |
-
5. Chat window can be customized. Social media icons can be added for social engagement.
|
38 |
-
6. LiveChat offers plenty of reports and customer service analytics.
|
39 |
-
7. Additional information from pre-chat and post-chat surveys serves as extra knowledge about customers.
|
40 |
-
8. Help desk software in LiveChat allows collecting tickets from chats, emails and ticket forms.
|
41 |
|
42 |
|
43 |
== Changelog ==
|
44 |
-
|
|
|
|
|
|
|
45 |
= 3.2.10 =
|
46 |
-
* Updated readme.txt file, updated screenshots
|
47 |
|
48 |
= 3.2.9 =
|
49 |
* Updated readme.txt file, checked compatibility to Wordpress 4.2.2
|
1 |
=== LiveChat - WP live chat software for Wordpress ===
|
2 |
Contributors: LiveChat
|
3 |
+
Tags: live support, live chat, live chat software, help desk, help desk software, online ticketing system, ticketing system, online support, ecommerce chat, sales, customer help, customer support, livechat, live support, customer service software, chat plugin, chat, customer service chat, live chat button, live chat plugin, live chat support, live chat tool, live chat widget, live support, live support button, live chat solution
|
4 |
|
5 |
+
Stable tag: 3.2.11
|
6 |
Requires at least: 2.8
|
7 |
Tested up to: 4.2.2
|
8 |
|
9 |
+
Live chat and help desk software plugin for Wordpress. Add LiveChat (live chat and help desk software) to your Wordpress.
|
10 |
|
11 |
== Description ==
|
12 |
|
18 |
|
19 |
——-
|
20 |
|
21 |
+
Product requires active LiveChat subscription after 30 days of free trial.
|
22 |
|
23 |
|
24 |
== Installation ==
|
31 |
== Screenshots ==
|
32 |
|
33 |
1. LiveChat Applications are available for web browser, Windows Mac and iPhone, iPad and Android devices.
|
34 |
+
2. LiveChat is designed specifically for real-time customer service using chats and help desk tickets.
|
35 |
+
3. Visitors list and client details display valuable information useful during chats with customers.
|
36 |
+
4. Dashboard - a real-time glimpse of your customer service to display on a big screen.
|
37 |
+
5. Chat window can be customized. Social media icons can be added for social engagement.
|
38 |
+
6. LiveChat offers plenty of reports and customer service analytics.
|
39 |
+
7. Additional information from pre-chat and post-chat surveys serves as extra knowledge about customers.
|
40 |
+
8. Help desk software in LiveChat allows collecting tickets from chats, emails and ticket forms.
|
41 |
|
42 |
|
43 |
== Changelog ==
|
44 |
+
|
45 |
+
= 3.2.11 =
|
46 |
+
* Moved screenshots to assets directory
|
47 |
+
|
48 |
= 3.2.10 =
|
49 |
+
* Updated readme.txt file, updated screenshots
|
50 |
|
51 |
= 3.2.9 =
|
52 |
* Updated readme.txt file, checked compatibility to Wordpress 4.2.2
|
screenshot-1.png
DELETED
Binary file
|
screenshot-2.png
DELETED
Binary file
|
screenshot-3.png
DELETED
Binary file
|
screenshot-4.png
DELETED
Binary file
|
screenshot-5.png
DELETED
Binary file
|
screenshot-6.png
DELETED
Binary file
|
screenshot-7.png
DELETED
Binary file
|
screenshot-8.png
DELETED
Binary file
|
trunk/livechat.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: LiveChat
|
4 |
+
Plugin URI: http://www.livechatinc.com/addons/wordpress/
|
5 |
+
Description: Live chat software for live help, online sales and customer support. This plugin allows to quickly install LiveChat on any WordPress website.
|
6 |
+
Author: LiveChat
|
7 |
+
Author URI: http://www.livechatinc.com
|
8 |
+
Version: 3.2.7
|
9 |
+
*/
|
10 |
+
|
11 |
+
if (is_admin())
|
12 |
+
{
|
13 |
+
require_once(dirname(__FILE__).'/plugin_files/LiveChatAdmin.class.php');
|
14 |
+
LiveChatAdmin::get_instance();
|
15 |
+
}
|
16 |
+
else
|
17 |
+
{
|
18 |
+
require_once(dirname(__FILE__).'/plugin_files/LiveChat.class.php');
|
19 |
+
LiveChat::get_instance();
|
20 |
+
}
|
21 |
+
|
trunk/plugin_files/LiveChat.class.php
ADDED
@@ -0,0 +1,158 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class LiveChat
|
4 |
+
{
|
5 |
+
// singleton pattern
|
6 |
+
protected static $instance;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Absolute path to plugin files
|
10 |
+
*/
|
11 |
+
protected $plugin_url = null;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* LiveChat license parameters
|
15 |
+
*/
|
16 |
+
protected $login = null;
|
17 |
+
protected $license_number = null;
|
18 |
+
protected $skill = null;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Remembers if LiveChat license number is set
|
22 |
+
*/
|
23 |
+
protected static $license_installed = false;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Starts the plugin
|
27 |
+
*/
|
28 |
+
protected function __construct()
|
29 |
+
{
|
30 |
+
add_action ('wp_head', array($this, 'tracking_code'));
|
31 |
+
}
|
32 |
+
|
33 |
+
public static function get_instance()
|
34 |
+
{
|
35 |
+
if (!isset(self::$instance))
|
36 |
+
{
|
37 |
+
$c = __CLASS__;
|
38 |
+
self::$instance = new $c;
|
39 |
+
}
|
40 |
+
|
41 |
+
return self::$instance;
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Returns plugin files absolute path
|
46 |
+
*
|
47 |
+
* @return string
|
48 |
+
*/
|
49 |
+
public function get_plugin_url()
|
50 |
+
{
|
51 |
+
if (is_null($this->plugin_url))
|
52 |
+
{
|
53 |
+
$this->plugin_url = WP_PLUGIN_URL.'/wp-live-chat-software-for-wordpress/plugin_files';
|
54 |
+
}
|
55 |
+
|
56 |
+
return $this->plugin_url;
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Returns true if LiveChat license is set properly,
|
61 |
+
* false otherwise
|
62 |
+
*
|
63 |
+
* @return bool
|
64 |
+
*/
|
65 |
+
public function is_installed()
|
66 |
+
{
|
67 |
+
return ($this->get_license_number() > 0);
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Returns LiveChat license number
|
72 |
+
*
|
73 |
+
* @return int
|
74 |
+
*/
|
75 |
+
public function get_license_number()
|
76 |
+
{
|
77 |
+
if (is_null($this->license_number))
|
78 |
+
{
|
79 |
+
$this->license_number = get_option('livechat_license_number');
|
80 |
+
}
|
81 |
+
|
82 |
+
// license_number must be >= 0
|
83 |
+
// also, this prevents from NaN values
|
84 |
+
$this->license_number = max(0, $this->license_number);
|
85 |
+
|
86 |
+
return $this->license_number;
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Returns LiveChat login
|
91 |
+
*/
|
92 |
+
public function get_login()
|
93 |
+
{
|
94 |
+
if (is_null($this->login))
|
95 |
+
{
|
96 |
+
$this->login = get_option('login');
|
97 |
+
}
|
98 |
+
|
99 |
+
return $this->login;
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Returns LiveChat skill number
|
104 |
+
*
|
105 |
+
* @return int
|
106 |
+
*/
|
107 |
+
public function get_skill()
|
108 |
+
{
|
109 |
+
if (is_null($this->skill))
|
110 |
+
{
|
111 |
+
$this->skill = (int)get_option('livechat_groups');
|
112 |
+
}
|
113 |
+
|
114 |
+
// skill must be >= 0
|
115 |
+
$this->skill = max(0, $this->skill);
|
116 |
+
|
117 |
+
return $this->skill;
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Injects tracking code
|
122 |
+
*/
|
123 |
+
public function tracking_code()
|
124 |
+
{
|
125 |
+
$this->get_helper('TrackingCode');
|
126 |
+
}
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Echoes given helper
|
130 |
+
*/
|
131 |
+
public static function get_helper($class, $echo=true)
|
132 |
+
{
|
133 |
+
$class .= 'Helper';
|
134 |
+
|
135 |
+
if (class_exists($class) == false)
|
136 |
+
{
|
137 |
+
$path = dirname(__FILE__).'/helpers/'.$class.'.class.php';
|
138 |
+
if (file_exists($path) !== true)
|
139 |
+
{
|
140 |
+
return false;
|
141 |
+
}
|
142 |
+
|
143 |
+
require_once($path);
|
144 |
+
}
|
145 |
+
|
146 |
+
$c = new $class;
|
147 |
+
|
148 |
+
if ($echo)
|
149 |
+
{
|
150 |
+
echo $c->render();
|
151 |
+
return true;
|
152 |
+
}
|
153 |
+
else
|
154 |
+
{
|
155 |
+
return $c->render();
|
156 |
+
}
|
157 |
+
}
|
158 |
+
}
|
trunk/plugin_files/LiveChatAdmin.class.php
ADDED
@@ -0,0 +1,176 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once('LiveChat.class.php');
|
4 |
+
|
5 |
+
final class LiveChatAdmin extends LiveChat
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Plugin's version
|
9 |
+
*/
|
10 |
+
protected $plugin_version = null;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Returns true if "Advanced settings" form has just been submitted,
|
14 |
+
* false otherwise
|
15 |
+
*
|
16 |
+
* @return bool
|
17 |
+
*/
|
18 |
+
protected $changes_saved = false;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Starts the plugin
|
22 |
+
*/
|
23 |
+
protected function __construct()
|
24 |
+
{
|
25 |
+
parent::__construct();
|
26 |
+
|
27 |
+
add_action('init', array($this, 'load_scripts'));
|
28 |
+
add_action('admin_menu', array($this, 'admin_menu'));
|
29 |
+
|
30 |
+
// tricky error reporting
|
31 |
+
if (defined('WP_DEBUG') && WP_DEBUG == true)
|
32 |
+
{
|
33 |
+
add_action('init', array($this, 'error_reporting'));
|
34 |
+
}
|
35 |
+
|
36 |
+
if (isset($_GET['reset']) && $_GET['reset'] == '1')
|
37 |
+
{
|
38 |
+
$this->reset_options();
|
39 |
+
}
|
40 |
+
elseif ($_SERVER['REQUEST_METHOD'] == 'POST')
|
41 |
+
{
|
42 |
+
$this->update_options($_POST);
|
43 |
+
}
|
44 |
+
}
|
45 |
+
|
46 |
+
public static function get_instance()
|
47 |
+
{
|
48 |
+
if (!isset(self::$instance))
|
49 |
+
{
|
50 |
+
$c = __CLASS__;
|
51 |
+
self::$instance = new $c;
|
52 |
+
}
|
53 |
+
|
54 |
+
return self::$instance;
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Set error reporting for debugging purposes
|
59 |
+
*/
|
60 |
+
public function error_reporting()
|
61 |
+
{
|
62 |
+
error_reporting(E_ALL & ~E_USER_NOTICE);
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Returns this plugin's version
|
67 |
+
*
|
68 |
+
* @return string
|
69 |
+
*/
|
70 |
+
public function get_plugin_version()
|
71 |
+
{
|
72 |
+
if (is_null($this->plugin_version))
|
73 |
+
{
|
74 |
+
if (!function_exists('get_plugins'))
|
75 |
+
{
|
76 |
+
require_once(ABSPATH.'wp-admin/includes/plugin.php');
|
77 |
+
}
|
78 |
+
|
79 |
+
$plugin_folder = get_plugins('/'.plugin_basename(dirname(__FILE__).'/..'));
|
80 |
+
$this->plugin_version = $plugin_folder['livechat.php']['Version'];
|
81 |
+
}
|
82 |
+
|
83 |
+
return $this->plugin_version;
|
84 |
+
}
|
85 |
+
|
86 |
+
public function load_scripts()
|
87 |
+
{
|
88 |
+
wp_enqueue_script('livechat', $this->get_plugin_url().'/js/livechat.js', 'jquery', $this->get_plugin_version(), true);
|
89 |
+
wp_enqueue_style('livechat', $this->get_plugin_url().'/css/livechat.css', false, $this->get_plugin_version());
|
90 |
+
}
|
91 |
+
|
92 |
+
public function admin_menu()
|
93 |
+
{
|
94 |
+
add_menu_page(
|
95 |
+
'LiveChat',
|
96 |
+
'LiveChat',
|
97 |
+
'administrator',
|
98 |
+
'livechat',
|
99 |
+
array($this, 'livechat_settings_page'),
|
100 |
+
$this->get_plugin_url().'/images/favicon.png'
|
101 |
+
);
|
102 |
+
|
103 |
+
add_submenu_page(
|
104 |
+
'livechat',
|
105 |
+
'Settings',
|
106 |
+
'Settings',
|
107 |
+
'administrator',
|
108 |
+
'livechat_settings',
|
109 |
+
array($this, 'livechat_settings_page')
|
110 |
+
);
|
111 |
+
|
112 |
+
// remove the submenu that is automatically added
|
113 |
+
if (function_exists('remove_submenu_page'))
|
114 |
+
{
|
115 |
+
remove_submenu_page('livechat', 'livechat');
|
116 |
+
}
|
117 |
+
|
118 |
+
// Settings link
|
119 |
+
add_filter('plugin_action_links', array($this, 'livechat_settings_link'), 10, 2);
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Displays settings page
|
124 |
+
*/
|
125 |
+
public function livechat_settings_page()
|
126 |
+
{
|
127 |
+
$this->get_helper('Settings');
|
128 |
+
}
|
129 |
+
|
130 |
+
public function changes_saved()
|
131 |
+
{
|
132 |
+
return $this->changes_saved;
|
133 |
+
}
|
134 |
+
|
135 |
+
public function livechat_settings_link($links, $file)
|
136 |
+
{
|
137 |
+
if (basename($file) !== 'livechat.php')
|
138 |
+
{
|
139 |
+
return $links;
|
140 |
+
}
|
141 |
+
|
142 |
+
$settings_link = sprintf('<a href="admin.php?page=livechat_settings">%s</a>', __('Settings'));
|
143 |
+
array_unshift ($links, $settings_link);
|
144 |
+
return $links;
|
145 |
+
}
|
146 |
+
|
147 |
+
protected function reset_options()
|
148 |
+
{
|
149 |
+
delete_option('livechat_license_number');
|
150 |
+
delete_option('livechat_groups');
|
151 |
+
}
|
152 |
+
|
153 |
+
protected function update_options($data)
|
154 |
+
{
|
155 |
+
// check if we are handling LiveChat settings form
|
156 |
+
if (isset($data['settings_form']) == false && isset($data['new_license_form']) == false)
|
157 |
+
{
|
158 |
+
return false;
|
159 |
+
}
|
160 |
+
|
161 |
+
$license_number = isset($data['license_number']) ? (int)$data['license_number'] : 0;
|
162 |
+
$skill = isset($data['skill']) ? (int)$data['skill'] : 0;
|
163 |
+
|
164 |
+
// skill must be >= 0
|
165 |
+
$skill = max(0, $skill);
|
166 |
+
|
167 |
+
|
168 |
+
update_option('livechat_license_number', $license_number);
|
169 |
+
update_option('livechat_groups', $skill);
|
170 |
+
|
171 |
+
if (isset($data['changes_saved']) && $data['changes_saved'] == '1')
|
172 |
+
{
|
173 |
+
$this->changes_saved = true;
|
174 |
+
}
|
175 |
+
}
|
176 |
+
}
|
trunk/plugin_files/css/livechat.css
ADDED
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#livechat {
|
2 |
+
padding-top: 20px;
|
3 |
+
}
|
4 |
+
#lc_logo {
|
5 |
+
float: left;
|
6 |
+
width: 100%;
|
7 |
+
height: 120px;
|
8 |
+
}
|
9 |
+
#lc_logo img {
|
10 |
+
display: block;
|
11 |
+
float: left;
|
12 |
+
}
|
13 |
+
#lc_logo span {
|
14 |
+
display: block;
|
15 |
+
margin-left: 200px;
|
16 |
+
|
17 |
+
/**
|
18 |
+
* inheriting "h2" element styles
|
19 |
+
* - could not use actual <h2> element
|
20 |
+
* due to some problems with "updated" divs
|
21 |
+
*/
|
22 |
+
color: #464646;
|
23 |
+
font: italic normal normal 24px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
|
24 |
+
line-height: 80px;
|
25 |
+
text-shadow: rgba(255, 255, 255, 1) 0 1px 0;
|
26 |
+
}
|
27 |
+
|
28 |
+
.clear {
|
29 |
+
clear: both;
|
30 |
+
}
|
31 |
+
|
32 |
+
#livechat div.installed_ok { background-color: #e1fdc5; border-color: #6ac611; }
|
33 |
+
.postbox h3 { cursor: default; }
|
34 |
+
.postbox_content { padding: 0 10px; }
|
35 |
+
.postbox_content ul { margin-top: 5px; }
|
36 |
+
.postbox label { line-height: 1.5em; }
|
37 |
+
.postbox .asterisk { color: red; }
|
38 |
+
.explanation { color: #999; padding-left: 5px; }
|
39 |
+
a.help,
|
40 |
+
span.help a { color: #999; }
|
41 |
+
#wpbody-content a.help:hover,
|
42 |
+
#wpbody-content .help a:hover { color: #222; }
|
43 |
+
.installed_ok a.help,
|
44 |
+
.installed_ok .help a,
|
45 |
+
.info a.help,
|
46 |
+
.info .help a { color: #666; }
|
47 |
+
.installed_ok a.help,
|
48 |
+
.info a.help,
|
49 |
+
.installed_ok span.help,
|
50 |
+
.info span.help { font-weight: normal; color: #666; font-size: 85%; }
|
51 |
+
h3.no-radius { -moz-border-radius: 0; }
|
52 |
+
hr.livechat { margin-bottom: 1em; height: 1px; border: 0; color: #999; background: #ccc; }
|
53 |
+
|
54 |
+
.ajax_message { display: none; background: url(../images/ajax_loader.gif) no-repeat 5px 60%; font-size: 85%; padding: 0; }
|
55 |
+
.ajax_message.wait,
|
56 |
+
.ajax_message.message { display: block; }
|
57 |
+
.ajax_message.wait { text-indent: 28px; }
|
58 |
+
.ajax_message.message { background-image: none; text-indent: 0px; }
|
59 |
+
|
60 |
+
#control_panel { width: 99%; border: 0; }
|
61 |
+
|
62 |
+
#reset_settings {
|
63 |
+
font-size: 85%;
|
64 |
+
}
|
65 |
+
#reset_settings, #reset_settings a {
|
66 |
+
color: #999;
|
67 |
+
}
|
68 |
+
|
69 |
+
|
70 |
+
#livechat .back {
|
71 |
+
margin-top: 20px;
|
72 |
+
}
|
73 |
+
|
74 |
+
p.img {
|
75 |
+
}
|
76 |
+
p.img img {
|
77 |
+
padding: 1px;
|
78 |
+
background: white;
|
79 |
+
border: 1px solid #bbb;
|
80 |
+
|
81 |
+
-moz-border-radius: 5px;
|
82 |
+
-webkit-border-radius: 5px;
|
83 |
+
border-radius: 5px;
|
84 |
+
}
|
85 |
+
|
86 |
+
.btn a {
|
87 |
+
display: inline-block;
|
88 |
+
padding: 3px 10px;
|
89 |
+
color: white;
|
90 |
+
|
91 |
+
text-decoration: none;
|
92 |
+
font-weight: normal;
|
93 |
+
-moz-border-radius: 3px;
|
94 |
+
-webkit-border-radius: 3px;
|
95 |
+
border-radius: 3px;
|
96 |
+
|
97 |
+
text-shadow: 1px 1px 0 #06a;
|
98 |
+
border-top: 1px solid #4bf;
|
99 |
+
border-bottom: 1px solid #39f;
|
100 |
+
|
101 |
+
-moz-box-shadow: 0 1px 0 #39d, 0 -1px 0 #39d, 1px 0 0 #39d, -1px 0 0 #39d;
|
102 |
+
-webkit-box-shadow: 0 1px 0 #39d, 0 -1px 0 #39d, 1px 0 0 #39d, -1px 0 0 #39d;
|
103 |
+
box-shadow: 0 1px 0 #39d, 0 -1px 0 #39d, 1px 0 0 #39d, -1px 0 0 #39d;
|
104 |
+
|
105 |
+
background: #4ae;
|
106 |
+
background: -moz-linear-gradient(top, #4ae, #28d);
|
107 |
+
background: -webkit-gradient(linear, left top, left bottom, from(#4ae), to(#28d));
|
108 |
+
|
109 |
+
}
|
110 |
+
.btn a:hover {
|
111 |
+
text-decoration: none;
|
112 |
+
border-top-color: #5cf;
|
113 |
+
border-bottom-color: #3af;
|
114 |
+
color: white;
|
115 |
+
|
116 |
+
-moz-box-shadow: 0 1px 0 #4ae, 0 -1px 0 #4ae, 1px 0 0 #4ae, -1px 0 0 #4ae;
|
117 |
+
-webkit-box-shadow: 0 1px 0 #4ae, 0 -1px 0 #4ae, 1px 0 0 #4ae, -1px 0 0 #4ae;
|
118 |
+
box-shadow: 0 1px 0 #4ae, 0 -1px 0 #4ae, 1px 0 0 #4ae, -1px 0 0 #4ae;
|
119 |
+
|
120 |
+
background: #4bf;
|
121 |
+
background: -moz-linear-gradient(top, #4bf, #39d);
|
122 |
+
background: -webkit-gradient(linear, left top, left bottom, from(#4bf), to(#39d));
|
123 |
+
}
|
124 |
+
.btn a:active,
|
125 |
+
.btn a:focus {
|
126 |
+
/* margin-top: 1px did not work as intended under Chrome */
|
127 |
+
position: relative;
|
128 |
+
top: 1px;
|
129 |
+
}
|
130 |
+
|
131 |
+
#advanced {
|
132 |
+
margin-bottom: 0;
|
133 |
+
}
|
trunk/plugin_files/helpers/ChangesSavedHelper.class.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once('LiveChatHelper.class.php');
|
4 |
+
|
5 |
+
class ChangesSavedHelper extends LiveChatHelper
|
6 |
+
{
|
7 |
+
public function render()
|
8 |
+
{
|
9 |
+
if (LiveChat::get_instance()->changes_saved())
|
10 |
+
{
|
11 |
+
return '<div id="changes_saved_info" class="updated installed_ok"><p>Advanced settings saved successfully.</p></div>';
|
12 |
+
}
|
13 |
+
|
14 |
+
return '';
|
15 |
+
}
|
16 |
+
}
|
trunk/plugin_files/helpers/LiveChatHelper.class.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
abstract class LiveChatHelper
|
4 |
+
{
|
5 |
+
abstract public function render();
|
6 |
+
}
|
trunk/plugin_files/helpers/SettingsHelper.class.php
ADDED
@@ -0,0 +1,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once('LiveChatHelper.class.php');
|
4 |
+
|
5 |
+
class SettingsHelper extends LiveChatHelper
|
6 |
+
{
|
7 |
+
public function render()
|
8 |
+
{
|
9 |
+
?>
|
10 |
+
<div id="livechat">
|
11 |
+
<div class="wrap">
|
12 |
+
|
13 |
+
<div id="lc_logo">
|
14 |
+
<img src="<?php echo LiveChat::get_instance()->get_plugin_url(); ?>/images/logo.png" />
|
15 |
+
<span>for Wordpress</span>
|
16 |
+
</div>
|
17 |
+
<div class="clear"></div>
|
18 |
+
|
19 |
+
<?php
|
20 |
+
LiveChat::get_instance()->get_helper('ChangesSaved');
|
21 |
+
LiveChat::get_instance()->get_helper('TrackingCodeInfo');
|
22 |
+
?>
|
23 |
+
|
24 |
+
<?php if (LiveChat::get_instance()->is_installed() == false) { ?>
|
25 |
+
<div class="metabox-holder">
|
26 |
+
<div class="postbox">
|
27 |
+
<h3>Do you already have a LiveChat account?</h3>
|
28 |
+
<div class="postbox_content">
|
29 |
+
<ul id="choice_account">
|
30 |
+
<li><input type="radio" name="choice_account" id="choice_account_1" checked="checked"> <label for="choice_account_1">Yes, I already have a LiveChat account</label></li>
|
31 |
+
<li><input type="radio" name="choice_account" id="choice_account_0"> <label for="choice_account_0">No, I want to create one</label></li>
|
32 |
+
</ul>
|
33 |
+
</div>
|
34 |
+
</div>
|
35 |
+
</div>
|
36 |
+
<?php } ?>
|
37 |
+
|
38 |
+
<!-- Already have an account -->
|
39 |
+
<div class="metabox-holder" id="livechat_already_have" style="display:none">
|
40 |
+
|
41 |
+
<?php if (LiveChat::get_instance()->is_installed()): ?>
|
42 |
+
<div class="postbox">
|
43 |
+
<h3><?php echo _e('Sign in to LiveChat'); ?></h3>
|
44 |
+
<div class="postbox_content">
|
45 |
+
<p><?php echo _e('Sign in to LiveChat and start chatting with your customers!'); ?></p>
|
46 |
+
<p><span class="btn"><a href="https://my.livechatinc.com/" target="_blank"><?php _e('Sign in to web application'); ?></a></span> or <a href="http://www.livechatinc.com/product/" target="_blank"><?php _e('download desktop app'); ?></a></p>
|
47 |
+
</div>
|
48 |
+
</div>
|
49 |
+
<?php endif; ?>
|
50 |
+
|
51 |
+
<?php if (LiveChat::get_instance()->is_installed() == false) { ?>
|
52 |
+
<div class="postbox">
|
53 |
+
<form method="post" action="?page=livechat_settings">
|
54 |
+
<h3>LiveChat account</h3>
|
55 |
+
<div class="postbox_content">
|
56 |
+
<table class="form-table">
|
57 |
+
<tr>
|
58 |
+
<th scope="row"><label for="livechat_login">My LiveChat login is:</label></th>
|
59 |
+
<td><input type="text" name="login" id="livechat_login" value="<?php echo LiveChat::get_instance()->get_login(); ?>" size="40" /></td>
|
60 |
+
</tr>
|
61 |
+
</table>
|
62 |
+
|
63 |
+
<p class="ajax_message"></p>
|
64 |
+
<p class="submit">
|
65 |
+
<input type="hidden" name="license_number" value="<?php echo LiveChat::get_instance()->get_license_number(); ?>" id="license_number">
|
66 |
+
<input type="hidden" name="settings_form" value="1">
|
67 |
+
<input type="submit" class="button-primary" value="<?php _e('Save changes') ?>" />
|
68 |
+
</p>
|
69 |
+
</div>
|
70 |
+
</form>
|
71 |
+
</div>
|
72 |
+
|
73 |
+
<?php } else { ?>
|
74 |
+
|
75 |
+
<div id="advanced" class="postbox" style="display:none">
|
76 |
+
<form method="post" action="?page=livechat_settings">
|
77 |
+
<h3>Advanced settings</h3>
|
78 |
+
<div class="postbox_content">
|
79 |
+
<table class="form-table">
|
80 |
+
<tr>
|
81 |
+
<th scope="row"><label for="skill">Group:</label></th>
|
82 |
+
<td><input type="text" name="skill" id="skill" value="<?php echo LiveChat::get_instance()->get_skill(); ?>" /> <span class="explanation">Used for dividing chat agents into groups (<a href="http://www.livechatinc.com/kb/dividing-live-chat-by-group/" target="_blank">read more</a>). Enter <strong>0</strong> for default group (recommended).</span></td>
|
83 |
+
</tr>
|
84 |
+
</table>
|
85 |
+
<p class="submit">
|
86 |
+
<input type="hidden" name="license_number" value="<?php echo LiveChat::get_instance()->get_license_number(); ?>" id="license_number">
|
87 |
+
<input type="hidden" name="changes_saved" value="1">
|
88 |
+
<input type="hidden" name="settings_form" value="1">
|
89 |
+
<input type="submit" class="button-primary" value="<?php _e('Save changes') ?>" />
|
90 |
+
</p>
|
91 |
+
</div>
|
92 |
+
</form>
|
93 |
+
</div>
|
94 |
+
<p id="advanced-link"><a href="">Show advanced settings…</a></p>
|
95 |
+
<?php } ?>
|
96 |
+
|
97 |
+
<?php if (LiveChat::get_instance()->is_installed()) { ?>
|
98 |
+
<p id="reset_settings">Something went wrong? <a href="?page=livechat_settings&reset=1">Reset your settings</a>.</p>
|
99 |
+
<?php } ?>
|
100 |
+
</div>
|
101 |
+
|
102 |
+
<!-- New account form -->
|
103 |
+
<div class="metabox-holder" id="livechat_new_account" style="display:none">
|
104 |
+
<div class="postbox">
|
105 |
+
<form method="post" action="?page=livechat_settings">
|
106 |
+
<h3>Create new LiveChat account</h3>
|
107 |
+
<div class="postbox_content">
|
108 |
+
|
109 |
+
<?php
|
110 |
+
global $current_user;
|
111 |
+
get_currentuserinfo();
|
112 |
+
|
113 |
+
$fullname = $current_user->user_firstname.' '.$current_user->user_lastname;
|
114 |
+
$fullname = trim($fullname);
|
115 |
+
?>
|
116 |
+
<table class="form-table">
|
117 |
+
<tr>
|
118 |
+
<th scope="row"><label for="name">Full name:</label></th>
|
119 |
+
<td><input type="text" name="name" id="name" maxlength="60" value="<?php echo $fullname; ?>" size="40" /></td>
|
120 |
+
</tr>
|
121 |
+
<tr>
|
122 |
+
<th scope="row"><label for="email">E-mail:</label></th>
|
123 |
+
<td><input type="text" name="email" id="email" maxlength="100" value="<?php echo $current_user->user_email; ?>" size="40" /></td>
|
124 |
+
</tr>
|
125 |
+
<tr>
|
126 |
+
<th scope="row"><label for="password">Password:</label></th>
|
127 |
+
<td><input type="password" name="password" id="password" maxlength="100" value="" size="40" /></td>
|
128 |
+
</tr>
|
129 |
+
<tr>
|
130 |
+
<th scope="row"><label for="password_retype">Retype password:</label></th>
|
131 |
+
<td><input type="password" name="password_retype" id="password_retype" maxlength="100" value="" size="40" /></td>
|
132 |
+
</tr>
|
133 |
+
</table>
|
134 |
+
|
135 |
+
<p class="ajax_message"></p>
|
136 |
+
<p class="submit">
|
137 |
+
<input type="hidden" name="website" value="<?php echo bloginfo('url'); ?>">
|
138 |
+
<input type="submit" value="Create account" id="submit" class="button-primary">
|
139 |
+
</p>
|
140 |
+
</div>
|
141 |
+
</form>
|
142 |
+
|
143 |
+
<form method="post" action="?page=livechat_settings" id="save_new_license">
|
144 |
+
<p>
|
145 |
+
<input type="hidden" name="new_license_form" value="1">
|
146 |
+
<input type="hidden" name="skill" value="0">
|
147 |
+
<input type="hidden" name="license_number" value="0" id="new_license_number">
|
148 |
+
</p>
|
149 |
+
</form>
|
150 |
+
</div>
|
151 |
+
</div>
|
152 |
+
</div>
|
153 |
+
</div>
|
154 |
+
<?php
|
155 |
+
}
|
156 |
+
}
|
trunk/plugin_files/helpers/TrackingCodeHelper.class.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once('LiveChatHelper.class.php');
|
4 |
+
|
5 |
+
class TrackingCodeHelper extends LiveChatHelper
|
6 |
+
{
|
7 |
+
public function render()
|
8 |
+
{
|
9 |
+
if (LiveChat::get_instance()->is_installed())
|
10 |
+
{
|
11 |
+
$skill = LiveChat::get_instance()->get_skill();
|
12 |
+
$license_number = LiveChat::get_instance()->get_license_number();
|
13 |
+
|
14 |
+
return <<<HTML
|
15 |
+
<script type="text/javascript">
|
16 |
+
var __lc = {};
|
17 |
+
__lc.license = {$license_number};
|
18 |
+
__lc.group = {$skill};
|
19 |
+
|
20 |
+
(function() {
|
21 |
+
var lc = document.createElement('script'); lc.type = 'text/javascript'; lc.async = true;
|
22 |
+
lc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.livechatinc.com/tracking.js';
|
23 |
+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(lc, s);
|
24 |
+
})();
|
25 |
+
</script>
|
26 |
+
HTML;
|
27 |
+
}
|
28 |
+
|
29 |
+
return '';
|
30 |
+
}
|
31 |
+
}
|
trunk/plugin_files/helpers/TrackingCodeInfoHelper.class.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once('LiveChatHelper.class.php');
|
4 |
+
|
5 |
+
class TrackingCodeInfoHelper extends LiveChatHelper
|
6 |
+
{
|
7 |
+
public function render()
|
8 |
+
{
|
9 |
+
if (LiveChat::get_instance()->is_installed())
|
10 |
+
{
|
11 |
+
return '<div class="updated installed_ok"><p>LiveChat is installed properly. Woohoo!</p></div>';
|
12 |
+
}
|
13 |
+
|
14 |
+
return '';
|
15 |
+
}
|
16 |
+
}
|
trunk/plugin_files/images/ajax_loader.gif
ADDED
Binary file
|
trunk/plugin_files/images/button_placement.png
ADDED
Binary file
|
trunk/plugin_files/images/favicon.png
ADDED
Binary file
|
trunk/plugin_files/images/logo.png
ADDED
Binary file
|
trunk/plugin_files/images/plusminus.png
ADDED
Binary file
|
trunk/plugin_files/js/livechat.js
ADDED
@@ -0,0 +1,275 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function($)
|
2 |
+
{
|
3 |
+
var LiveChat =
|
4 |
+
{
|
5 |
+
init: function()
|
6 |
+
{
|
7 |
+
this.externalLinks();
|
8 |
+
this.resetLink();
|
9 |
+
this.toggleForms();
|
10 |
+
this.alreadyHaveAccountForm();
|
11 |
+
this.newLicenseForm();
|
12 |
+
this.controlPanelIframe();
|
13 |
+
this.fadeChangesSaved();
|
14 |
+
this.showAdvancedSettings();
|
15 |
+
},
|
16 |
+
|
17 |
+
externalLinks: function()
|
18 |
+
{
|
19 |
+
$('a.help').attr('target', '_blank');
|
20 |
+
},
|
21 |
+
|
22 |
+
resetLink: function()
|
23 |
+
{
|
24 |
+
$('#reset_settings a').click(function()
|
25 |
+
{
|
26 |
+
return confirm('This will reset your LiveChat plugin settings. Continue?');
|
27 |
+
})
|
28 |
+
},
|
29 |
+
|
30 |
+
toggleForms: function()
|
31 |
+
{
|
32 |
+
var toggleForms = function()
|
33 |
+
{
|
34 |
+
// display account details page if license number is already known
|
35 |
+
if ($('#choice_account').length == 0 || $('#choice_account_1').is(':checked'))
|
36 |
+
{
|
37 |
+
$('#livechat_new_account').hide();
|
38 |
+
$('#livechat_already_have').show();
|
39 |
+
$('#livechat_login').focus();
|
40 |
+
}
|
41 |
+
else if ($('#choice_account_0').is(':checked'))
|
42 |
+
{
|
43 |
+
$('#livechat_already_have').hide();
|
44 |
+
$('#livechat_new_account').show();
|
45 |
+
|
46 |
+
if ($.trim($('#name').val()).length == 0)
|
47 |
+
{
|
48 |
+
$('#name').focus();
|
49 |
+
}
|
50 |
+
else
|
51 |
+
{
|
52 |
+
$('#password').focus();
|
53 |
+
}
|
54 |
+
}
|
55 |
+
};
|
56 |
+
|
57 |
+
toggleForms();
|
58 |
+
$('#choice_account input').click(toggleForms);
|
59 |
+
},
|
60 |
+
|
61 |
+
alreadyHaveAccountForm: function()
|
62 |
+
{
|
63 |
+
$('#livechat_already_have form').submit(function()
|
64 |
+
{
|
65 |
+
if (parseInt($('#license_number').val()) == 0)
|
66 |
+
{
|
67 |
+
var login = $.trim($('#livechat_login').val());
|
68 |
+
if (!login.length)
|
69 |
+
{
|
70 |
+
$('#livechat_login').focus();
|
71 |
+
return false;
|
72 |
+
}
|
73 |
+
|
74 |
+
$('#livechat_already_have .ajax_message').removeClass('message').addClass('wait').html('Please wait…');
|
75 |
+
|
76 |
+
$.ajax({
|
77 |
+
url: 'https://api.livechatinc.com/licence/operator/'+login+'?callback=?',
|
78 |
+
type: "GET",
|
79 |
+
dataType: 'jsonp',
|
80 |
+
cache: false,
|
81 |
+
success: function (data, status, error) {
|
82 |
+
if (data.error)
|
83 |
+
{
|
84 |
+
$('#livechat_already_have .ajax_message').removeClass('wait').addClass('message').html('Incorrect LiveChat login.');
|
85 |
+
$('#livechat_login').focus();
|
86 |
+
return false;
|
87 |
+
}
|
88 |
+
else
|
89 |
+
{
|
90 |
+
$('#license_number').val(data.number);
|
91 |
+
$('#livechat_already_have form').submit();
|
92 |
+
}
|
93 |
+
},
|
94 |
+
error: function (data, status, error) {
|
95 |
+
$('#livechat_already_have .ajax_message').removeClass('wait').addClass('message').html('Try again.');
|
96 |
+
$('#livechat_login').focus();
|
97 |
+
}
|
98 |
+
});
|
99 |
+
return false;
|
100 |
+
}
|
101 |
+
});
|
102 |
+
},
|
103 |
+
|
104 |
+
newLicenseForm: function()
|
105 |
+
{
|
106 |
+
$('#livechat_new_account form').submit(function()
|
107 |
+
{
|
108 |
+
if (parseInt($('#new_license_number').val()) > 0)
|
109 |
+
{
|
110 |
+
return true;
|
111 |
+
}
|
112 |
+
|
113 |
+
if (LiveChat.validateNewLicenseForm())
|
114 |
+
{
|
115 |
+
$('#livechat_new_account .ajax_message').removeClass('message').addClass('wait').html('Please wait…');
|
116 |
+
|
117 |
+
// Check if email address is available
|
118 |
+
$.getJSON('http://www.livechatinc.com/php/licence_info.php?email='+$('#email').val()+'&jsoncallback=?',
|
119 |
+
function(response)
|
120 |
+
{
|
121 |
+
if (response.response == 'true')
|
122 |
+
{
|
123 |
+
LiveChat.createLicense();
|
124 |
+
}
|
125 |
+
else if (response.response == 'false')
|
126 |
+
{
|
127 |
+
$('#livechat_new_account .ajax_message').removeClass('wait').addClass('message').html('This email address is already in use. Please choose another e-mail address.');
|
128 |
+
}
|
129 |
+
else
|
130 |
+
{
|
131 |
+
$('#livechat_new_account .ajax_message').removeClass('wait').addClass('message').html('Could not create account. Please try again later.');
|
132 |
+
}
|
133 |
+
});
|
134 |
+
}
|
135 |
+
|
136 |
+
return false;
|
137 |
+
});
|
138 |
+
},
|
139 |
+
|
140 |
+
createLicense: function()
|
141 |
+
{
|
142 |
+
var url;
|
143 |
+
|
144 |
+
$('#livechat_new_account .ajax_message').removeClass('message').addClass('wait').html('Creating new account…');
|
145 |
+
|
146 |
+
url = 'https://www.livechatinc.com/signup/';
|
147 |
+
url += '?name='+encodeURIComponent($('#name').val());
|
148 |
+
url += '&email='+encodeURIComponent($('#email').val());
|
149 |
+
url += '&password='+encodeURIComponent($('#password').val());
|
150 |
+
url += '&website='+encodeURIComponent($('#website').val());
|
151 |
+
url += '&timezone_gmt='+encodeURIComponent(this.calculateGMT());
|
152 |
+
url += '&action=wordpress_signup';
|
153 |
+
url += '&jsoncallback=?';
|
154 |
+
|
155 |
+
$.getJSON(url, function(data)
|
156 |
+
{
|
157 |
+
data = parseInt(data.response);
|
158 |
+
if (data == 0)
|
159 |
+
{
|
160 |
+
$('#livechat_new_account .ajax_message').html('Could not create account. Please try again later.').addClass('message').removeClass('wait');
|
161 |
+
return false;
|
162 |
+
}
|
163 |
+
|
164 |
+
// save new licence number
|
165 |
+
$('#new_license_number').val(data);
|
166 |
+
$('#save_new_license').submit();
|
167 |
+
});
|
168 |
+
},
|
169 |
+
|
170 |
+
validateNewLicenseForm: function()
|
171 |
+
{
|
172 |
+
if ($('#name').val().length < 1)
|
173 |
+
{
|
174 |
+
alert ('Please enter your name.');
|
175 |
+
$('#name').focus();
|
176 |
+
return false;
|
177 |
+
}
|
178 |
+
|
179 |
+
if (/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}$/i.test($('#email').val()) == false)
|
180 |
+
{
|
181 |
+
alert ('Please enter a valid email address.');
|
182 |
+
$('#email').focus();
|
183 |
+
return false;
|
184 |
+
}
|
185 |
+
|
186 |
+
if ($.trim($('#password').val()).length < 6)
|
187 |
+
{
|
188 |
+
alert('Password must be at least 6 characters long');
|
189 |
+
$('#password').focus();
|
190 |
+
return false;
|
191 |
+
}
|
192 |
+
|
193 |
+
if ($('#password').val() !== $('#password_retype').val())
|
194 |
+
{
|
195 |
+
alert('Both passwords do not match.');
|
196 |
+
$('#password').val('');
|
197 |
+
$('#password_retype').val('');
|
198 |
+
$('#password').focus();
|
199 |
+
return false;
|
200 |
+
}
|
201 |
+
|
202 |
+
return true;
|
203 |
+
},
|
204 |
+
|
205 |
+
calculateGMT: function()
|
206 |
+
{
|
207 |
+
var date, dateGMTString, date2, gmt;
|
208 |
+
|
209 |
+
date = new Date((new Date()).getFullYear(), 0, 1, 0, 0, 0, 0);
|
210 |
+
dateGMTString = date.toGMTString();
|
211 |
+
date2 = new Date(dateGMTString.substring(0, dateGMTString.lastIndexOf(" ")-1));
|
212 |
+
gmt = ((date - date2) / (1000 * 60 * 60)).toString();
|
213 |
+
|
214 |
+
return gmt;
|
215 |
+
},
|
216 |
+
|
217 |
+
controlPanelIframe: function()
|
218 |
+
{
|
219 |
+
var cp = $('#control_panel');
|
220 |
+
if (cp.length)
|
221 |
+
{
|
222 |
+
var cp_resize = function()
|
223 |
+
{
|
224 |
+
var cp_height = window.innerHeight ? window.innerHeight : $(window).height();
|
225 |
+
cp_height -= $('#wphead').height();
|
226 |
+
cp_height -= $('#updated-nag').height();
|
227 |
+
cp_height -= $('#control_panel + p').height();
|
228 |
+
cp_height -= $('#footer').height();
|
229 |
+
cp_height -= 70;
|
230 |
+
|
231 |
+
cp.attr('height', cp_height);
|
232 |
+
}
|
233 |
+
cp_resize();
|
234 |
+
$(window).resize(cp_resize);
|
235 |
+
}
|
236 |
+
},
|
237 |
+
|
238 |
+
fadeChangesSaved: function()
|
239 |
+
{
|
240 |
+
$cs = $('#changes_saved_info');
|
241 |
+
|
242 |
+
if ($cs.length)
|
243 |
+
{
|
244 |
+
setTimeout(function()
|
245 |
+
{
|
246 |
+
$cs.slideUp();
|
247 |
+
}, 1000);
|
248 |
+
}
|
249 |
+
},
|
250 |
+
|
251 |
+
showAdvancedSettings: function()
|
252 |
+
{
|
253 |
+
$('#advanced-link a').click(function()
|
254 |
+
{
|
255 |
+
if ($('#advanced').is(':visible'))
|
256 |
+
{
|
257 |
+
$(this).html('Show advanced settings…');
|
258 |
+
$('#advanced').slideUp();
|
259 |
+
}
|
260 |
+
else
|
261 |
+
{
|
262 |
+
$(this).html('Hide advanced settings…');
|
263 |
+
$('#advanced').slideDown();
|
264 |
+
}
|
265 |
+
|
266 |
+
return false;
|
267 |
+
})
|
268 |
+
}
|
269 |
+
};
|
270 |
+
|
271 |
+
$(document).ready(function()
|
272 |
+
{
|
273 |
+
LiveChat.init();
|
274 |
+
});
|
275 |
+
})(jQuery);
|
trunk/readme.txt
ADDED
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== LiveChat - WP live chat software for Wordpress ===
|
2 |
+
Contributors: LiveChat
|
3 |
+
Tags: live support, live chat, live chat software, help desk, help desk software, online ticketing system, ticketing system, online support, ecommerce chat, sales, customer help, customer support, livechat, live support, customer service software, chat plugin, chat, customer service chat, live chat button, live chat plugin, live chat support, live chat tool, live chat widget, live support, live support button, live chat solution
|
4 |
+
|
5 |
+
Stable tag: 3.2.11
|
6 |
+
Requires at least: 2.8
|
7 |
+
Tested up to: 4.3
|
8 |
+
|
9 |
+
Live chat and help desk software plugin for Wordpress. Add LiveChat (live chat and help desk software) to your Wordpress.
|
10 |
+
|
11 |
+
== Description ==
|
12 |
+
|
13 |
+
LiveChat - live chat software and help desk software for customer service. Live chat allows website visitors to contact you in real-time. Help desk software is used to online visitors find what they need before they leave your site.
|
14 |
+
|
15 |
+
Try LiveChat free for 30 days! Sign up for our live chat here: https://www.livechatinc.com/signup/
|
16 |
+
|
17 |
+
Take a tour to see why you need live chat software on your website: http://www.livechatinc.com/why-livechat/
|
18 |
+
|
19 |
+
——-
|
20 |
+
|
21 |
+
Product requires active LiveChat subscription after 30 days of free trial.
|
22 |
+
|
23 |
+
|
24 |
+
== Installation ==
|
25 |
+
|
26 |
+
1. Upload `wp-live-chat-software-for-wordpress` directory to Wordpress plugins directory (`/wp-content/plugins/`)
|
27 |
+
2. Activate the plugin through the 'Plugins' menu in WordPress
|
28 |
+
3. Click the 'LiveChat' menu on the left.
|
29 |
+
4. Follow the instructions.
|
30 |
+
|
31 |
+
== Screenshots ==
|
32 |
+
|
33 |
+
1. LiveChat Applications are available for web browser, Windows Mac and iPhone, iPad and Android devices.
|
34 |
+
2. LiveChat is designed specifically for real-time customer service using chats and help desk tickets.
|
35 |
+
3. Visitors list and client details display valuable information useful during chats with customers.
|
36 |
+
4. Dashboard - a real-time glimpse of your customer service to display on a big screen.
|
37 |
+
5. Chat window can be customized. Social media icons can be added for social engagement.
|
38 |
+
6. LiveChat offers plenty of reports and customer service analytics.
|
39 |
+
7. Additional information from pre-chat and post-chat surveys serves as extra knowledge about customers.
|
40 |
+
8. Help desk software in LiveChat allows collecting tickets from chats, emails and ticket forms.
|
41 |
+
|
42 |
+
|
43 |
+
== Changelog ==
|
44 |
+
|
45 |
+
= 3.2.12 =
|
46 |
+
* Updated readme.txt file, checked compatibility to Wordpress 4.3
|
47 |
+
|
48 |
+
= 3.2.11 =
|
49 |
+
* Moved screenshots to assets directory
|
50 |
+
|
51 |
+
= 3.2.10 =
|
52 |
+
* Updated readme.txt file, updated screenshots
|
53 |
+
|
54 |
+
= 3.2.9 =
|
55 |
+
* Updated readme.txt file, checked compatibility to Wordpress 4.2.2
|
56 |
+
|
57 |
+
= 3.2.8 =
|
58 |
+
* Plugin fully supports the newest version of Wordpress.
|
59 |
+
|
60 |
+
= 3.2.7 =
|
61 |
+
* Plugin compatible with the newest LiveChat version
|
62 |
+
|
63 |
+
= 3.2.5 =
|
64 |
+
* Updated trunk
|
65 |
+
|
66 |
+
= 3.2.4 =
|
67 |
+
* Updated url for licence number
|
68 |
+
|
69 |
+
= 3.2.3 =
|
70 |
+
* Romoved language parameter from Tracking Code
|
71 |
+
|
72 |
+
= 3.2.2 =
|
73 |
+
* Fixed CSS styles conflicts with other plugins
|
74 |
+
|
75 |
+
= 3.2.1 =
|
76 |
+
* Fixed plugin "Settings" link
|
77 |
+
* Changed message after successful installation
|
78 |
+
|
79 |
+
= 3.2.0 =
|
80 |
+
* Compatibility with new chat window
|
81 |
+
* Removed "click-to-chat button" configurator (no longer used)
|
82 |
+
|
83 |
+
= 3.1.0 =
|
84 |
+
* Major update in the Tracking Code
|
85 |
+
|
86 |
+
= 3.0.0 =
|
87 |
+
* Rewritten whole plugin code
|
88 |
+
* Fixed creating licenses
|
89 |
+
* Improved look and feel
|
90 |
+
|
91 |
+
= 2.1.8 =
|
92 |
+
* Updated desktop application download link
|
93 |
+
|
94 |
+
= 2.1.7 =
|
95 |
+
* Fixed `Skill` parameter
|
96 |
+
* Updated monitoring and chat button codes (for improved performance)
|
97 |
+
* Updated skills tutorial link
|
98 |
+
|
99 |
+
= 2.1.6 =
|
100 |
+
* Added LiveChat icon in menu bar
|
101 |
+
|
102 |
+
= 2.1.5 =
|
103 |
+
* Fixed creating new licences
|
104 |
+
* Rebranded LIVECHAT Contact Center to LiveChat
|
105 |
+
* Updated application download link
|
106 |
+
* Renamed "Groups" to "Skills"
|
107 |
+
|
108 |
+
= 2.1.4 =
|
109 |
+
* Fixed readme.txt file causing the `The plugin does not have a valid header.` problem
|
110 |
+
|
111 |
+
= 2.1.3 =
|
112 |
+
* Added timezone detection when creating new license
|
113 |
+
|
114 |
+
= 2.1.2 =
|
115 |
+
* Added "Company", "Phone" and "Website" fields in license registration form
|
116 |
+
* Fixed license registration bug
|
117 |
+
* Updated Control Panel URL
|
118 |
+
|
119 |
+
= 2.1.1 =
|
120 |
+
* Fixed monitoring and chat button code installation
|
121 |
+
|
122 |
+
= 2.1.0 =
|
123 |
+
* Added "Settings" link to plugin settings page
|
124 |
+
* Added "Download application" button
|
125 |
+
* Added Control Panel
|
126 |
+
* Added Chat button installation help for themes with no widgets support
|
127 |
+
|
128 |
+
= 2.0.0 =
|
129 |
+
* Rewritten whole plugin from scratch
|
130 |
+
* Ability to create new license from Wordpress plugin settings
|
131 |
+
* Updated monitoring code speed
|
132 |
+
* Added notification messages
|
133 |
+
|
134 |
+
= 1.0.0 =
|
135 |
+
* First plugin version
|