LiveChat – WP live chat plugin for WordPress - Version 2.1.3

Version Description

  • Added timezone detection when creating new license
Download this release

Release Info

Developer livechat
Plugin Icon 128x128 LiveChat – WP live chat plugin for WordPress
Version 2.1.3
Comparing to
See all releases

Code changes from version 2.1.2 to 2.1.3

livechat.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Live Chat Software for Wordpress
4
  Plugin URI: http://www.livechatinc.com
5
  Description: Live chat software for live help, online sales and customer support. This plugin allows to quickly install the live chat button and monitoring code on any WordPress website.
6
  Author: LIVECHAT Software
7
- Version: 2.1.2
8
  Author URI: http://www.livechatinc.com
9
  */
10
 
4
  Plugin URI: http://www.livechatinc.com
5
  Description: Live chat software for live help, online sales and customer support. This plugin allows to quickly install the live chat button and monitoring code on any WordPress website.
6
  Author: LIVECHAT Software
7
+ Version: 2.1.3
8
  Author URI: http://www.livechatinc.com
9
  */
10
 
plugin_files/js/signup.js CHANGED
@@ -1,5 +1,124 @@
1
  $(document).ready(function()
2
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  var validate = function(use_alert)
4
  {
5
  if ($('#livechat_account_first_name').val().length < 1)
@@ -40,6 +159,7 @@ $(document).ready(function()
40
  url += '&account_company='+encodeURIComponent($('#livechat_account_company').val());
41
  url += '&account_phone='+encodeURIComponent($('#livechat_account_phone').val());
42
  url += '&account_website='+encodeURIComponent($('#livechat_account_website').val());
 
43
  url += '&action=wordpress_signup';
44
  url += '&recaptcha_ip='+$('input[name=recaptcha_ip]').val();
45
  url += '&recaptcha_challenge_field='+$('input[name=recaptcha_challenge_field]').val();
@@ -50,13 +170,13 @@ $(document).ready(function()
50
  function(data)
51
  {
52
  data = parseInt(data.response);
53
- if (data == '-1')
54
  {
55
  // Wrong captcha
56
  $('#ajax_message').html('Confirmation code is incorrect. Please try again.').addClass('message').removeClass('wait');
57
  return false;
58
  }
59
- if (data == '0')
60
  {
61
  $('#ajax_message').html('Could not create licence. Please try again later.').addClass('message').removeClass('wait');
62
  return false;
1
  $(document).ready(function()
2
  {
3
+ var timezones = {
4
+ 'Pacific/Kwajalein': '(GMT-12:00) International Date Line West',
5
+ 'Pacific/Samoa': '(GMT-11:00) Midway Island, Samoa',
6
+ 'US/Hawaii': '(GMT-10:00) Hawaii',
7
+ 'US/Alaska': '(GMT-09:00) Alaska',
8
+ 'US/Pacific': '(GMT-08:00) Pacific Time (US & Canada)',
9
+ 'America/Tijuana': '(GMT-08:00) Tijuana, Baja California',
10
+ 'US/Arizona': '(GMT-07:00) Arizona',
11
+ 'America/Chihuahua': '(GMT-07:00) Chihuahua, La Paz, Mazatlan',
12
+ 'US/Mountain': '(GMT-07:00) Mountain Time (US & Canada)',
13
+ 'America/Chicago': '(GMT-06:00) Central America',
14
+ 'US/Central': '(GMT-06:00) Central Time (US & Canada)',
15
+ 'America/Mexico_City': '(GMT-06:00) Guadalajara, Mexico City, Monterrey',
16
+ 'Canada/Saskatchewan': '(GMT-06:00) Saskatchewan',
17
+ 'America/Bogota': '(GMT-05:00) Bogota, Lima, Quito, Rio Branco',
18
+ 'US/Eastern': '(GMT-05:00) Eastern Time (US & Canada)',
19
+ 'US/East-Indiana': '(GMT-05:00) Indiana (East)',
20
+ 'America/Caracas': '(GMT-04:30) Caracas',
21
+ 'Canada/Atlantic': '(GMT-04:00) Atlantic Time (Canada)',
22
+ 'America/La_Paz': '(GMT-04:00) La Paz',
23
+ 'America/Manaus': '(GMT-04:00) Manaus',
24
+ 'America/Santiago': '(GMT-04:00) Santiago',
25
+ 'Canada/Newfoundland': '(GMT-03:30) Newfoundland',
26
+ 'America/Sao_Paulo': '(GMT-03:00) Brasilia',
27
+ 'America/Buenos_Aires': '(GMT-03:00) Buenos Aires',
28
+ 'America/Buenos_Aires': '(GMT-03:00) Georgetown',
29
+ 'America/Godthab': '(GMT-03:00) Greenland',
30
+ 'America/Montevideo': '(GMT-03:00) Montevideo',
31
+ 'Atlantic/South_Georgia': '(GMT-02:00) Mid-Atlantic',
32
+ 'Atlantic/Azores': '(GMT-01:00) Azores',
33
+ 'Atlantic/Cape_Verde': '(GMT-01:00) Cape Verde Is.',
34
+ 'Europe/London': '(GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London',
35
+ 'Africa/Casablanca': '(GMT) Casablanca',
36
+ 'Atlantic/Reykjavik': '(GMT) Monrovia, Reykjavik',
37
+ 'Europe/Berlin': '(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna',
38
+ 'Europe/Prague': '(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague',
39
+ 'Europe/Paris': '(GMT+01:00) Brussels, Copenhagen, Madrid, Paris',
40
+ 'Europe/Warsaw': '(GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb',
41
+ 'Africa/Lagos': '(GMT+01:00) West Central Africa',
42
+ 'Asia/Amman': '(GMT+02:00) Amman',
43
+ 'Europe/Athens': '(GMT+02:00) Athens, Bucharest, Istanbul',
44
+ 'Asia/Beirut': '(GMT+02:00) Beirut',
45
+ 'Africa/Cairo': '(GMT+02:00) Cairo',
46
+ 'Africa/Harare': '(GMT+02:00) Harare, Pretoria',
47
+ 'Europe/Helsinki': '(GMT+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius',
48
+ 'Asia/Jerusalem': '(GMT+02:00) Jerusalem',
49
+ 'Europe/Minsk': '(GMT+02:00) Minsk',
50
+ 'Africa/Windhoek': '(GMT+02:00) Windhoek',
51
+ 'Asia/Baghdad': '(GMT+03:00) Baghdad',
52
+ 'Asia/Kuwait': '(GMT+03:00) Kuwait, Riyadh',
53
+ 'Europe/Moscow': '(GMT+03:00) Moscow, St. Petersburg, Volgograd',
54
+ 'Africa/Nairobi': '(GMT+03:00) Nairobi',
55
+ 'Asia/Tbilisi': '(GMT+03:00) Tbilisi',
56
+ 'Asia/Tehran': '(GMT+03:30) Tehran',
57
+ 'Asia/Muscat': '(GMT+04:00) Abu Dhabi, Muscat',
58
+ 'Asia/Baku': '(GMT+04:00) Baku',
59
+ 'Indian/Mauritius': '(GMT+04:00) Port Louis',
60
+ 'Asia/Yerevan': '(GMT+04:00) Yerevan',
61
+ 'Asia/Kabul': '(GMT+04:30) Kabul',
62
+ 'Asia/Yekaterinburg': '(GMT+05:00) Ekaterinburg',
63
+ 'Asia/Karachi': '(GMT+05:00) Islamabad, Karachi',
64
+ 'Asia/Tashkent': '(GMT+05:00) Tashkent',
65
+ 'Asia/Calcutta': '(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi',
66
+ 'Asia/Calcutta': '(GMT+05:30) Sri Jayawardenepura',
67
+ 'Asia/Katmandu': '(GMT+05:45) Kathmandu',
68
+ 'Asia/Novosibirsk': '(GMT+06:00) Almaty, Novosibirsk',
69
+ 'Asia/Dhaka': '(GMT+06:00) Astana, Dhaka',
70
+ 'Asia/Rangoon': '(GMT+06:30) Yangon (Rangoon)',
71
+ 'Asia/Bangkok': '(GMT+07:00) Bangkok, Hanoi, Jakarta',
72
+ 'Asia/Krasnoyarsk': '(GMT+07:00) Krasnoyarsk',
73
+ 'Asia/Hong_Kong': '(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi',
74
+ 'Asia/Irkutsk': '(GMT+08:00) Irkutsk, Ulaan Bataar',
75
+ 'Asia/Kuala_Lumpur': '(GMT+08:00) Kuala Lumpur, Singapore',
76
+ 'Australia/Perth': '(GMT+08:00) Perth',
77
+ 'Asia/Taipei': '(GMT+08:00) Taipei',
78
+ 'Asia/Tokyo': '(GMT+09:00) Osaka, Sapporo, Tokyo',
79
+ 'Asia/Seoul': '(GMT+09:00) Seoul',
80
+ 'Asia/Yakutsk': '(GMT+09:00) Yakutsk',
81
+ 'Australia/Adelaide': '(GMT+09:30) Adelaide',
82
+ 'Australia/Darwin': '(GMT+09:30) Darwin',
83
+ 'Australia/Brisbane': '(GMT+10:00) Brisbane',
84
+ 'Australia/Canberra': '(GMT+10:00) Canberra, Melbourne, Sydney',
85
+ 'Pacific/Guam': '(GMT+10:00) Guam, Port Moresby',
86
+ 'Australia/Hobart': '(GMT+10:00) Hobart',
87
+ 'Asia/Vladivostok': '(GMT+10:00) Vladivostok',
88
+ 'Asia/Magadan': '(GMT+11:00) Magadan, Solomon Is., New Caledonia',
89
+ 'Pacific/Auckland': '(GMT+12:00) Auckland, Wellington',
90
+ 'Pacific/Fiji': '(GMT+12:00) Fiji, Kamchatka, Marshall Is.',
91
+ 'Pacific/Tongatapu': '(GMT+13:00) Nuku\'alofa'
92
+ };
93
+
94
+ var date = new Date((new Date()).getFullYear(), 0, 1, 0, 0, 0, 0);
95
+ var dateGMTString = date.toGMTString();
96
+ var date2 = new Date(dateGMTString.substring(0, dateGMTString.lastIndexOf(" ")-1));
97
+ var GMT = ((date - date2) / (1000 * 60 * 60)).toString();
98
+
99
+ // Add leading 0
100
+ if (/^\-?(\d)$/.test(GMT)) GMT = GMT.replace(/\d/, function(match, value) { return '0'+match; });
101
+
102
+ // Select timezone based on GMT
103
+ var re;
104
+
105
+ if (GMT == '00') {
106
+ re = new RegExp('\(GMT'+GMT+':00\)');
107
+ } else if (parseInt(GMT) > 0) {
108
+ re = new RegExp('\(GMT\\+'+GMT+':00\)');
109
+ } else {
110
+ re = new RegExp('\(GMT'+GMT+':00\)');
111
+ }
112
+
113
+ for (var i in timezones)
114
+ {
115
+ if (re.exec(timezones[i]))
116
+ {
117
+ $('input[name=livechat_account_timezone]').val(i);
118
+ break;
119
+ }
120
+ };
121
+
122
  var validate = function(use_alert)
123
  {
124
  if ($('#livechat_account_first_name').val().length < 1)
159
  url += '&account_company='+encodeURIComponent($('#livechat_account_company').val());
160
  url += '&account_phone='+encodeURIComponent($('#livechat_account_phone').val());
161
  url += '&account_website='+encodeURIComponent($('#livechat_account_website').val());
162
+ url += '&account_timezone='+encodeURIComponent($('#livechat_account_timezone').val());
163
  url += '&action=wordpress_signup';
164
  url += '&recaptcha_ip='+$('input[name=recaptcha_ip]').val();
165
  url += '&recaptcha_challenge_field='+$('input[name=recaptcha_challenge_field]').val();
170
  function(data)
171
  {
172
  data = parseInt(data.response);
173
+ if (data == -1)
174
  {
175
  // Wrong captcha
176
  $('#ajax_message').html('Confirmation code is incorrect. Please try again.').addClass('message').removeClass('wait');
177
  return false;
178
  }
179
+ if (data == 0)
180
  {
181
  $('#ajax_message').html('Could not create licence. Please try again later.').addClass('message').removeClass('wait');
182
  return false;
plugin_files/settings.php CHANGED
@@ -195,6 +195,7 @@ else
195
  <table class="form-table">
196
  <tr>
197
  <td class="submit">
 
198
  <input type="submit" value="Create account" id="submit" class="button-primary">
199
  </td>
200
  </tr>
195
  <table class="form-table">
196
  <tr>
197
  <td class="submit">
198
+ <input type="hidden" name="livechat_account_timezone" value="US/Pacific" id="livechat_account_timezone">
199
  <input type="submit" value="Create account" id="submit" class="button-primary">
200
  </td>
201
  </tr>
readme.txt CHANGED
@@ -216,6 +216,9 @@ This add-on allows agents to use Skype account to call back the customers in the
216
 
217
  == Changelog ==
218
 
 
 
 
219
  = 2.1.2 =
220
  * Added "Company", "Phone" and "Website" fields in license registration form
221
  * Fixed license registration bug
216
 
217
  == Changelog ==
218
 
219
+ = 2.1.3 =
220
+ * Added timezone detection when creating new license
221
+
222
  = 2.1.2 =
223
  * Added "Company", "Phone" and "Website" fields in license registration form
224
  * Fixed license registration bug