@textback/notification-widget 2.0.0 → 2.0.1-102913
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc.js +291 -291
- package/build/index.js +12 -0
- package/build/sdk.js +9 -0
- package/package.json +70 -68
- package/promote_tag.sh +1 -1
- package/readme.md +569 -490
- package/server.js +8 -4
- package/src/libraries/ai.1.0.11.js +4088 -4088
- package/src/libraries/localization/locales/cs.js +14 -12
- package/src/libraries/localization/locales/en.js +14 -12
- package/src/libraries/localization/locales/index.js +8 -8
- package/src/libraries/localization/locales/pl.js +14 -12
- package/src/libraries/localization/locales/ro.js +14 -12
- package/src/libraries/localization/locales/ru.js +13 -12
- package/src/libraries/localization/locales/uk.js +14 -12
- package/src/libraries/localization/text.js +9 -9
- package/src/libraries/t.js +82 -82
- package/src/sdk/channels/channel.js +30 -30
- package/src/sdk/channels/facebook.js +13 -13
- package/src/sdk/channels/factory.js +3 -3
- package/src/sdk/channels/skype.js +12 -12
- package/src/sdk/channels/telegram.js +18 -18
- package/src/sdk/channels/viber.js +12 -12
- package/src/sdk/channels/vk-modal/vk-modal.html +17 -17
- package/src/sdk/channels/vk-modal/vk-modal.js +25 -25
- package/src/sdk/channels/vk-modal/vk-modal.scss +116 -116
- package/src/sdk/channels/vk.js +195 -184
- package/src/sdk/channels/whatsapp.js +16 -10
- package/src/sdk/channels/whatsappb.js +27 -0
- package/src/sdk/events/observer.js +46 -46
- package/src/sdk/index.js +5 -5
- package/src/sdk/sdk.js +67 -30
- package/src/sdk/utils/apiErrorHandler.js +11 -11
- package/src/sdk/utils/appInsights.js +88 -88
- package/src/sdk/utils/browserInfo.js +8 -8
- package/src/sdk/utils/constants.js +17 -17
- package/src/sdk/utils/cookies.js +67 -50
- package/src/sdk/utils/find.js +7 -7
- package/src/sdk/utils/loadConfig.js +20 -20
- package/src/sdk/utils/loadDeepLink.js +48 -21
- package/src/sdk/utils/loadScript.js +25 -25
- package/src/sdk/utils/loadSubscriptions.js +6 -6
- package/src/sdk/utils/parseQueryString.js +33 -33
- package/src/sdk/utils/windowHelper.js +25 -25
- package/src/sdk/widget/widget.js +192 -140
- package/src/widget/components/index.js +6 -2
- package/src/widget/components/tb-notification-button/facebook.js +9 -2
- package/src/widget/components/tb-notification-button/index.js +34 -34
- package/src/widget/components/tb-notification-button/styles.scss +657 -433
- package/src/widget/components/tb-notification-button/telegram.js +9 -2
- package/src/widget/components/tb-notification-button/viber.js +9 -2
- package/src/widget/components/tb-notification-button/vk.js +59 -50
- package/src/widget/components/tb-notification-button/whatsapp.js +15 -8
- package/src/widget/components/tb-notification-button/whatsappb.js +58 -0
- package/src/widget/components/tb-notification-widget/index.js +589 -384
- package/src/widget/components/tb-notification-widget/normalize.scss +395 -394
- package/src/widget/components/tb-notification-widget/styles.scss +502 -139
- package/src/widget/components/tb-nw-wahunter/index.js +259 -0
- package/src/widget/components/tb-nw-wahunter/styles.scss +471 -0
- package/src/widget/config.js +5 -5
- package/src/widget/icons/icon_chat_window.svg +1 -0
- package/src/widget/icons/icon_close.svg +1 -0
- package/src/widget/icons/icon_facebook.svg +7 -7
- package/src/widget/icons/icon_facebook_circle.svg +7 -9
- package/src/widget/icons/icon_instagram_circle.svg +95 -95
- package/src/widget/icons/icon_skype.svg +44 -44
- package/src/widget/icons/icon_skype_circle.svg +46 -46
- package/src/widget/icons/icon_skype_new.svg +113 -113
- package/src/widget/icons/icon_tg.svg +25 -25
- package/src/widget/icons/icon_tg_circle.svg +17 -27
- package/src/widget/icons/icon_viber.svg +75 -75
- package/src/widget/icons/icon_viber_circle.svg +67 -77
- package/src/widget/icons/icon_viber_new.svg +102 -102
- package/src/widget/icons/icon_vk.svg +14 -14
- package/src/widget/icons/icon_vk_circle.svg +16 -16
- package/src/widget/icons/icon_whatsapp.svg +147 -147
- package/src/widget/icons/icon_whatsapp_circle.svg +3 -3
- package/src/widget/icons/icon_whatsapp_hollow.svg +128 -0
- package/src/widget/icons/icon_whatsapp_new.svg +127 -127
- package/src/widget/icons/icon_whatsappb.svg +147 -0
- package/src/widget/icons/icon_whatsappb_circle.svg +4 -0
- package/src/widget/icons/icon_whatsappb_new.svg +127 -0
- package/src/widget/icons/paper-plane-arrow.svg +3 -0
- package/src/widget/icons/tb-logo.svg +21 -0
- package/src/widget/index.js +28 -28
- package/src/widget/locales/cs.js +42 -0
- package/src/widget/locales/en.js +42 -20
- package/src/widget/locales/index.js +2 -2
- package/src/widget/locales/pl.js +41 -19
- package/src/widget/locales/ro.js +41 -20
- package/src/widget/locales/ru.js +40 -19
- package/src/widget/locales/uk.js +40 -19
- package/src/widget/utils/cookiesEx.js +41 -41
- package/src/widget/utils/getLocale.js +4 -2
- package/src/widget/utils/stringifyAttributes.js +19 -19
- package/src/widget/utils/text.js +2 -1
- package/src/widget/utils/widgetsStorage.js +28 -28
- package/src/widget/widget.entry.js +3 -4
- package/tests/gf.html +35 -35
- package/tests/gf.js +21 -21
- package/tests/index.js +61 -61
- package/views/examples.ejs +7 -3
- package/views/sdk.html +274 -256
- package/webpack.common.js +72 -72
- package/webpack.dev.js +15 -15
- package/webpack.prod.js +10 -10
- package/src/widget/components/tb-notification-button/skype.js +0 -47
- package/src/widget/icons/text-back-badge.png +0 -0
- package/src/widget/locales/cz.js +0 -20
@@ -0,0 +1,42 @@
|
|
1
|
+
module.exports = {
|
2
|
+
|
3
|
+
//пояснения к переводу смотри в en.js
|
4
|
+
|
5
|
+
|
6
|
+
//виджет подписок
|
7
|
+
facebook: "Facebook",
|
8
|
+
facebookExtended: "Přihlaste se k Facebook",
|
9
|
+
telegram: "Telegram",
|
10
|
+
telegramExtended: "Přihlásit se k Telegram",
|
11
|
+
viber: "Viber",
|
12
|
+
viberExtended: "Přihlásit se k Viber",
|
13
|
+
vkontakte: "VK",
|
14
|
+
vkontakteExtended: "Přihlásit se k VK",
|
15
|
+
whatsapp: "WhatsApp",
|
16
|
+
whatsappExtended: "Přihlásit se k WhatsApp",
|
17
|
+
whatsappb: "WhatsApp",
|
18
|
+
whatsappbExtended: "Přihlásit se k WhatsApp",
|
19
|
+
|
20
|
+
vkontakteLogin: "VK Login",
|
21
|
+
singVK: "Poslat přes VK",
|
22
|
+
|
23
|
+
//double check в рассылке
|
24
|
+
facebookTip: "Tap <strong>Get started</strong><br/>in Messenger",
|
25
|
+
telegramTip: "Tap <strong>Start</strong></br>in Telegram",
|
26
|
+
viberTip: "<strong>Viber Desktop App</strong></br>should be installed on your PC",
|
27
|
+
vkontakteTip: "Press <strong>Allow messages</strong><br/>in a popup window",
|
28
|
+
whatsappTip: "<strong>Send generated text</strong><br/>to WhatsApp",
|
29
|
+
|
30
|
+
//WhatsApp Hunter
|
31
|
+
getAnswer: "Získejte odpověď na ",
|
32
|
+
enterNumber: "Zadejte své číslo",
|
33
|
+
sendMessage: "Odesíláme zprávu za 3-2-1 s",
|
34
|
+
answerSuccessful: "Odpověděli jsme vám na WhatsApp.<br>Zkontrolujte telefon",
|
35
|
+
numberNotFound: "V WhatsApp není takové číslo.<br>Jste z Marsu?🤔",
|
36
|
+
tryAgain: "Zadejte jiné číslo",
|
37
|
+
somethingWentWrong: "Jejda! Něco se pokazilo",
|
38
|
+
errorTryAgain: "Zkus to znovu",
|
39
|
+
|
40
|
+
//логотип
|
41
|
+
worksFor: "Works on"
|
42
|
+
};
|
package/src/widget/locales/en.js
CHANGED
@@ -1,20 +1,42 @@
|
|
1
|
-
module.exports = {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
telegram:
|
7
|
-
|
8
|
-
viber:
|
9
|
-
|
10
|
-
vkontakte:
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
1
|
+
module.exports = {
|
2
|
+
|
3
|
+
//виджет подписок
|
4
|
+
facebook: "Facebook", //для всех кнопок, кроме варианта показа "Прямоугольные кнопки" или "Всплывающее окно"
|
5
|
+
facebookExtended: "Subscribe to Facebook", //если выбран вариант показа "Прямоугольные кнопки" или "Всплывающее окно"
|
6
|
+
telegram: "Telegram", //для всех кнопок, кроме варианта показа "Прямоугольные кнопки" или "Всплывающее окно"
|
7
|
+
telegramExtended: "Subscribe to Telegram", //если выбран вариант показа "Прямоугольные кнопки" или "Всплывающее окно"
|
8
|
+
viber: "Viber", //для всех кнопок, кроме варианта показа "Прямоугольные кнопки" или "Всплывающее окно"
|
9
|
+
viberExtended: "Subscribe to Viber", //если выбран вариант показа "Прямоугольные кнопки" или "Всплывающее окно"
|
10
|
+
vkontakte: "VK", //для всех кнопок, кроме варианта показа "Прямоугольные кнопки" и "попап".
|
11
|
+
vkontakteExtended: "Subscribe to VK", //если выбран лендинг ВК и вариант показа "Прямоугольные кнопки" или "Всплывающее окно"
|
12
|
+
whatsapp: "WhatsApp", //для всех кнопок, кроме варианта показа "Прямоугольные кнопки" или "Всплывающее окно"
|
13
|
+
whatsappExtended: "Subscribe to WhatsApp", //если выбран вариант показа "Прямоугольные кнопки" или "Всплывающее окно"
|
14
|
+
whatsappb: "WhatsApp", //для всех кнопок, кроме варианта показа "Прямоугольные кнопки" или "Всплывающее окно"
|
15
|
+
whatsappbExtended: "Subscribe to WhatsApp", //если выбран вариант показа "Прямоугольные кнопки" или "Всплывающее окно"
|
16
|
+
|
17
|
+
//NB: если не использовать лендинг ВК, то при выборе прямоугольных кнопок или попапа используется нативная кнопка, перевод которой пока не реализован
|
18
|
+
|
19
|
+
//эти переводы временно не используются
|
20
|
+
vkontakteLogin: "VK Sing In",
|
21
|
+
singVK: "Send to VK",
|
22
|
+
|
23
|
+
//double check в рассылке - это обычный виджет с вариантом показа "Скругленные кнопки"
|
24
|
+
facebookTip: "Tap <strong>Get started</strong><br/>in Messenger",
|
25
|
+
telegramTip: "Tap <strong>Start</strong></br>in Telegram",
|
26
|
+
viberTip: "<strong>Viber Desktop App</strong></br>should be installed on your PC",
|
27
|
+
vkontakteTip: "Press <strong>Allow messages</strong><br/>in a popup window",
|
28
|
+
whatsappTip: "<strong>Send generated text</strong><br/>to WhatsApp",
|
29
|
+
|
30
|
+
//WhatsApp Hunter
|
31
|
+
getAnswer: "Get an answer in ", //согласие на получение сообщений
|
32
|
+
enterNumber: "Enter your phone number", //placeholder в инпуте
|
33
|
+
sendMessage: "We'll send a message in 3-2-1 sec", //В процессе отправки сообщения
|
34
|
+
answerSuccessful: "We've answered you in WhatsApp. <br> Check your phone", //После успешной отправки
|
35
|
+
numberNotFound: "There is no such user in WhatsApp. <br> Are you from Mars?🤔", //Ошибка, формат номера некорректный
|
36
|
+
tryAgain: "Try another number", //Повтор ввода, если номер не найден
|
37
|
+
somethingWentWrong: "Oops! Something went wrong", //на 500 при отправке сообщения (например, канал не подключен)
|
38
|
+
errorTryAgain: "Try again", //Повтор ввода при ошибки 500
|
39
|
+
|
40
|
+
//логотип
|
41
|
+
worksFor: "Works on",
|
42
|
+
};
|
package/src/widget/locales/pl.js
CHANGED
@@ -1,20 +1,42 @@
|
|
1
1
|
module.exports = {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
2
|
+
|
3
|
+
//пояснения к переводу смотри в en.js
|
4
|
+
|
5
|
+
//Виджет подписок
|
6
|
+
facebook: "Facebook",
|
7
|
+
facebookExtended: "Subskrybuj Facebook",
|
8
|
+
telegram: "Telegram",
|
9
|
+
telegramExtended: "Subskrybuj Telegram",
|
10
|
+
viber: "Viber",
|
11
|
+
viberExtended: "Subskrybuj Viber",
|
12
|
+
vkontakte: "VK",
|
13
|
+
vkontakteExtended: "Subskrybuj VK",
|
14
|
+
whatsapp: "WhatsApp",
|
15
|
+
whatsappExtended: "Subskrybuj WhatsApp",
|
16
|
+
whatsappb: "WhatsApp",
|
17
|
+
whatsappbExtended: "Subskrybuj WhatsApp",
|
18
|
+
|
19
|
+
|
20
|
+
vkontakteLogin: "VK Login",
|
21
|
+
singVK: "Zapisz się VK",
|
22
|
+
|
23
|
+
//double check в рассылке
|
24
|
+
facebookTip: "Tap <strong>Get started</strong><br/>in Messenger",
|
25
|
+
telegramTip: "Tap <strong>Start</strong></br>in Telegram",
|
26
|
+
viberTip: "<strong>Viber Desktop App</strong></br>should be installed on your PC",
|
27
|
+
vkontakteTip: "Press <strong>Allow messages</strong><br/>in a popup window",
|
28
|
+
whatsappTip: "<strong>Send generated text</strong><br/>to WhatsApp",
|
29
|
+
|
30
|
+
//WhatsApp Hunter
|
31
|
+
getAnswer: "Uzyskaj odpowiedź na ",
|
32
|
+
enterNumber: "Wprowadź swój numer",
|
33
|
+
sendMessage: "Wysyłamy wiadomość w 3-2-1 sek",
|
34
|
+
answerSuccessful: "Odpowiedzieliśmy na WhatsApp.<br>Sprawdź swój telefon",
|
35
|
+
numberNotFound: "W WhatsApp nie ma takiego numeru.<br>Jesteś z Marsa?🤔",
|
36
|
+
tryAgain: "Wpisz inną liczbę",
|
37
|
+
somethingWentWrong: "Ups! Coś poszło nie tak",
|
38
|
+
errorTryAgain: "Spróbować jeszcze raz",
|
39
|
+
|
40
|
+
//логотип
|
41
|
+
worksFor: "Works on"
|
42
|
+
};
|
package/src/widget/locales/ro.js
CHANGED
@@ -1,20 +1,41 @@
|
|
1
|
-
module.exports = {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
1
|
+
module.exports = {
|
2
|
+
|
3
|
+
//пояснения к переводу смотри в en.js
|
4
|
+
|
5
|
+
//виджет подписок
|
6
|
+
facebook: "Facebook",
|
7
|
+
facebookExtended: "Abonați-vă la Facebook",
|
8
|
+
telegram: "Telegram",
|
9
|
+
telegramExtended: "Abonați-vă la Telegram",
|
10
|
+
viber: "Viber",
|
11
|
+
viberExtended: "Abonați-vă la Viber",
|
12
|
+
vkontakte: "VK",
|
13
|
+
vkontakteExtended: "Abonați-vă la VK",
|
14
|
+
whatsapp: "WhatsApp",
|
15
|
+
whatsappExtended: "Abonați-vă la WhatsApp",
|
16
|
+
whatsappb: "WhatsApp",
|
17
|
+
whatsappbExtended: "Abonați-vă la WhatsApp",
|
18
|
+
|
19
|
+
vkontakteLogin: "VK Login",
|
20
|
+
singVK: "Abonează-te VK",
|
21
|
+
|
22
|
+
//double check в рассылке
|
23
|
+
facebookTip: "Tap <strong>Get started</strong><br/>in Messenger",
|
24
|
+
telegramTip: "Tap <strong>Start</strong></br>in Telegram",
|
25
|
+
viberTip: "<strong>Viber Desktop App</strong></br>should be installed on your PC",
|
26
|
+
vkontakteTip: "Press <strong>Allow messages</strong><br/>in a popup window",
|
27
|
+
whatsappTip: "<strong>Send generated text</strong><br/>to WhatsApp",
|
28
|
+
|
29
|
+
//WhatsApp Hunter
|
30
|
+
getAnswer: "Primește răspuns în ",
|
31
|
+
enterNumber: "Introdu numarul tau",
|
32
|
+
sendMessage: "Trimitem un mesaj în 3-2-1 sec",
|
33
|
+
answerSuccessful: "V-am răspuns pe WhatsApp.<br>Verifică-ți telefonul",
|
34
|
+
numberNotFound: "Nu există un astfel de număr în WhatsApp.<br>Sunteți de pe Marte?🤔",
|
35
|
+
tryAgain: "Specificați un alt număr",
|
36
|
+
somethingWentWrong: "Hopa! Ceva n-a mers bine",
|
37
|
+
errorTryAgain: "Să mai încerc o dată",
|
38
|
+
|
39
|
+
//логотип
|
40
|
+
worksFor: "Works on"
|
41
|
+
};
|
package/src/widget/locales/ru.js
CHANGED
@@ -1,20 +1,41 @@
|
|
1
1
|
module.exports = {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
2
|
+
|
3
|
+
//пояснения к переводу смотри в en.js
|
4
|
+
|
5
|
+
//виджет подписок
|
6
|
+
facebook: "Facebook",
|
7
|
+
facebookExtended: "Подписаться в Facebook",
|
8
|
+
telegram: "Telegram",
|
9
|
+
telegramExtended: "Подписаться в Telegram",
|
10
|
+
viber: "Viber",
|
11
|
+
viberExtended: "Подписаться в Viber",
|
12
|
+
vkontakte: "ВКонтакте",
|
13
|
+
vkontakteExtended: "Подписаться ВКонтакте",
|
14
|
+
whatsapp: "WhatsApp",
|
15
|
+
whatsappExtended: "Подписаться в WhatsApp",
|
16
|
+
whatsappb: "WhatsApp",
|
17
|
+
whatsappbExtended: "Подписаться в WhatsApp",
|
18
|
+
|
19
|
+
vkontakteLogin: "VK Login",
|
20
|
+
singVK: "Подписаться ВКонтакте",
|
21
|
+
|
22
|
+
//double check в рассылке
|
23
|
+
telegramTip: "Нажмите <strong>Запустить</strong></br>в приложении Telegram",
|
24
|
+
facebookTip: "Нажмите <strong>Начать</strong><br/>в Messenger",
|
25
|
+
viberTip: "У вас должно быть установлено<br/><strong>Viber Desktop приложение</strong>",
|
26
|
+
vkontakteTip: "Нажмите <strong>Разрешить</strong><br/>во всплывающем окне",
|
27
|
+
whatsappTip: "Отправьте <strong>предзаполненный текст</strong><br/>в WhatsApp без изменений",
|
28
|
+
|
29
|
+
//WhatsApp Hunter
|
30
|
+
getAnswer: "Получить ответ в ",
|
31
|
+
enterNumber: "Введите ваш номер",
|
32
|
+
sendMessage: "Отправляем сообщение через 3-2-1 сек",
|
33
|
+
answerSuccessful: "Ответили вам в WhatsApp.<br>Проверьте телефон",
|
34
|
+
numberNotFound: "Такого номера нет в WhatsApp.<br>Вы что, с Марса?🤔",
|
35
|
+
tryAgain: "Указать другой номер",
|
36
|
+
somethingWentWrong: "Упс! Что-то пошло не так",
|
37
|
+
errorTryAgain: "Попробовать еще раз",
|
38
|
+
|
39
|
+
//логотип
|
40
|
+
worksFor: "Работает на",
|
41
|
+
};
|
package/src/widget/locales/uk.js
CHANGED
@@ -1,20 +1,41 @@
|
|
1
1
|
module.exports = {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
2
|
+
|
3
|
+
//пояснения к переводу смотри в en.js
|
4
|
+
|
5
|
+
//виджет подписок
|
6
|
+
facebook: "Facebook",
|
7
|
+
facebookExtended: "Підписатися в Facebook",
|
8
|
+
telegram: "Telegram",
|
9
|
+
telegramExtended: "Підписатися в Telegram",
|
10
|
+
viber: "Viber",
|
11
|
+
viberExtended: "Підписатися в Viber",
|
12
|
+
vkontakte: "ВКонтакте",
|
13
|
+
vkontakteExtended: "Підписатися ВКонтакте",
|
14
|
+
whatsapp: "WhatsApp",
|
15
|
+
whatsappExtended: "Підписатися в WhatsApp",
|
16
|
+
whatsappb: "WhatsApp",
|
17
|
+
whatsappbExtended: "Підписатися в WhatsApp",
|
18
|
+
|
19
|
+
vkontakteLogin: "VK Login",
|
20
|
+
singVK: "Підписатися на VK",
|
21
|
+
|
22
|
+
//double check в рассылке
|
23
|
+
facebookTip: "Tap <strong>Get started</strong><br/>in Messenger",
|
24
|
+
telegramTip: "Tap <strong>Start</strong></br>in Telegram",
|
25
|
+
viberTip: "<strong>Viber Desktop App</strong></br>should be installed on your PC",
|
26
|
+
vkontakteTip: "Press <strong>Allow messages</strong><br/>in a popup window",
|
27
|
+
whatsappTip: "<strong>Send generated text</strong><br/>to WhatsApp",
|
28
|
+
|
29
|
+
//WhatsApp Hunter
|
30
|
+
getAnswer: "Отримати відповідь в ",
|
31
|
+
enterNumber: "Введіть ваш номер",
|
32
|
+
sendMessage: "Відправляємо повідомлення через 3-2-1 сек",
|
33
|
+
answerSuccessful: "Відповіли вам в WhatsApp. <br> Перевірте телефон",
|
34
|
+
numberNotFound: "Такого номера немає в WhatsApp.<br>Ви що, з Марса?🤔",
|
35
|
+
tryAgain: "Вказати інший номер",
|
36
|
+
somethingWentWrong: "Упс! Щось пішло не так",
|
37
|
+
errorTryAgain: "Спробувати ще раз",
|
38
|
+
|
39
|
+
//логотип
|
40
|
+
worksFor: "Works on"
|
41
|
+
};
|
@@ -1,41 +1,41 @@
|
|
1
|
-
// const cookies = require('./cookies');
|
2
|
-
import cookies from '../../sdk/utils/cookies.js';
|
3
|
-
|
4
|
-
/**
|
5
|
-
*
|
6
|
-
* @extends cookies
|
7
|
-
*/
|
8
|
-
const cookiesEx = Object.create(cookies);
|
9
|
-
|
10
|
-
/**
|
11
|
-
*
|
12
|
-
* @param name {string}
|
13
|
-
* @returns {Number}
|
14
|
-
*/
|
15
|
-
cookiesEx.getIntCookie = function (name) {
|
16
|
-
return parseInt(this.getCookie(name));
|
17
|
-
};
|
18
|
-
|
19
|
-
/**
|
20
|
-
*
|
21
|
-
* @param name {string}
|
22
|
-
* @returns {boolean}
|
23
|
-
*/
|
24
|
-
cookiesEx.getBoolCookie = function (name) {
|
25
|
-
return (this.getCookie(name)) === 'true';
|
26
|
-
};
|
27
|
-
/**
|
28
|
-
*
|
29
|
-
* @param name {string}
|
30
|
-
* @param timeToLive {number}
|
31
|
-
* @returns {number}
|
32
|
-
*/
|
33
|
-
cookiesEx.incrementIntCookie = function (name, timeToLive) {
|
34
|
-
let val = this.getIntCookie(name) || 0;
|
35
|
-
val++;
|
36
|
-
this.setCookie(name, val, timeToLive);
|
37
|
-
|
38
|
-
return val;
|
39
|
-
};
|
40
|
-
|
41
|
-
export default cookiesEx;
|
1
|
+
// const cookies = require('./cookies');
|
2
|
+
import cookies from '../../sdk/utils/cookies.js';
|
3
|
+
|
4
|
+
/**
|
5
|
+
*
|
6
|
+
* @extends cookies
|
7
|
+
*/
|
8
|
+
const cookiesEx = Object.create(cookies);
|
9
|
+
|
10
|
+
/**
|
11
|
+
*
|
12
|
+
* @param name {string}
|
13
|
+
* @returns {Number}
|
14
|
+
*/
|
15
|
+
cookiesEx.getIntCookie = function (name) {
|
16
|
+
return parseInt(this.getCookie(name));
|
17
|
+
};
|
18
|
+
|
19
|
+
/**
|
20
|
+
*
|
21
|
+
* @param name {string}
|
22
|
+
* @returns {boolean}
|
23
|
+
*/
|
24
|
+
cookiesEx.getBoolCookie = function (name) {
|
25
|
+
return (this.getCookie(name)) === 'true';
|
26
|
+
};
|
27
|
+
/**
|
28
|
+
*
|
29
|
+
* @param name {string}
|
30
|
+
* @param timeToLive {number}
|
31
|
+
* @returns {number}
|
32
|
+
*/
|
33
|
+
cookiesEx.incrementIntCookie = function (name, timeToLive) {
|
34
|
+
let val = this.getIntCookie(name) || 0;
|
35
|
+
val++;
|
36
|
+
this.setCookie(name, val, timeToLive);
|
37
|
+
|
38
|
+
return val;
|
39
|
+
};
|
40
|
+
|
41
|
+
export default cookiesEx;
|
@@ -1,11 +1,13 @@
|
|
1
|
+
const locales = require('../locales');
|
2
|
+
|
1
3
|
function getLocale() {
|
2
4
|
let locale = 'main';
|
3
5
|
|
4
6
|
if (document) {
|
5
|
-
locale = document.querySelector('html').getAttribute('lang')
|
7
|
+
locale = document.querySelector('html').getAttribute('lang');
|
6
8
|
}
|
7
9
|
|
8
|
-
if (!locale && navigator) {
|
10
|
+
if (!locales[locale] && navigator) {
|
9
11
|
locale = navigator.language;
|
10
12
|
}
|
11
13
|
|
@@ -1,19 +1,19 @@
|
|
1
|
-
function stringifyAttributes(attributesMap = {}) {
|
2
|
-
return Object.keys(attributesMap)
|
3
|
-
.map(key => {
|
4
|
-
let value = attributesMap[key]
|
5
|
-
|
6
|
-
if (value === null || typeof value === 'undefined') {
|
7
|
-
return ''
|
8
|
-
}
|
9
|
-
|
10
|
-
if (typeof value === 'object') {
|
11
|
-
value = JSON.stringify(value)
|
12
|
-
}
|
13
|
-
|
14
|
-
return `${key}='${value}'`
|
15
|
-
})
|
16
|
-
.join(' ');
|
17
|
-
}
|
18
|
-
|
19
|
-
export default stringifyAttributes;
|
1
|
+
function stringifyAttributes(attributesMap = {}) {
|
2
|
+
return Object.keys(attributesMap)
|
3
|
+
.map(key => {
|
4
|
+
let value = attributesMap[key];
|
5
|
+
|
6
|
+
if (value === null || typeof value === 'undefined') {
|
7
|
+
return ''
|
8
|
+
}
|
9
|
+
|
10
|
+
if (typeof value === 'object') {
|
11
|
+
value = JSON.stringify(value)
|
12
|
+
}
|
13
|
+
|
14
|
+
return `${key}='${value}'`
|
15
|
+
})
|
16
|
+
.join(' ');
|
17
|
+
}
|
18
|
+
|
19
|
+
export default stringifyAttributes;
|
package/src/widget/utils/text.js
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
const locales = require('../locales');
|
2
|
+
import getLocale from './getLocale'
|
2
3
|
|
3
4
|
function text(string, locale) {
|
4
|
-
const dictionary = locales[locale] || locales[locale.split('-')[0]] || locales.main;
|
5
|
+
const dictionary = locales[locale] || locales[locale.split('-')[0]] || locales[getLocale()] || locales[getLocale().split('-')[0]] ||locales.main;
|
5
6
|
|
6
7
|
return dictionary[string] || locales.main[string] || string;
|
7
8
|
}
|
@@ -1,28 +1,28 @@
|
|
1
|
-
const storage = {};
|
2
|
-
|
3
|
-
function setWidget(widgetId, widgetPromise) {
|
4
|
-
storage[widgetId] = storage[widgetId] || {};
|
5
|
-
storage[widgetId].promise = widgetPromise;
|
6
|
-
}
|
7
|
-
|
8
|
-
function getWidget(widgetId) {
|
9
|
-
return storage[widgetId] ? storage[widgetId].promise : null;
|
10
|
-
}
|
11
|
-
|
12
|
-
function setVkHandler(widgetId, handler) {
|
13
|
-
storage[widgetId] = storage[widgetId] || {};
|
14
|
-
storage[widgetId].vkHandler = handler;
|
15
|
-
}
|
16
|
-
|
17
|
-
function getVkHandler(widgetId) {
|
18
|
-
return storage[widgetId] ? storage[widgetId].vkHandler : null;
|
19
|
-
}
|
20
|
-
|
21
|
-
const widgetsStorage = {
|
22
|
-
setWidget,
|
23
|
-
getWidget,
|
24
|
-
setVkHandler,
|
25
|
-
getVkHandler,
|
26
|
-
};
|
27
|
-
|
28
|
-
export default widgetsStorage;
|
1
|
+
const storage = {};
|
2
|
+
|
3
|
+
function setWidget(widgetId, widgetPromise) {
|
4
|
+
storage[widgetId] = storage[widgetId] || {};
|
5
|
+
storage[widgetId].promise = widgetPromise;
|
6
|
+
}
|
7
|
+
|
8
|
+
function getWidget(widgetId) {
|
9
|
+
return storage[widgetId] ? storage[widgetId].promise : null;
|
10
|
+
}
|
11
|
+
|
12
|
+
function setVkHandler(widgetId, handler) {
|
13
|
+
storage[widgetId] = storage[widgetId] || {};
|
14
|
+
storage[widgetId].vkHandler = handler;
|
15
|
+
}
|
16
|
+
|
17
|
+
function getVkHandler(widgetId) {
|
18
|
+
return storage[widgetId] ? storage[widgetId].vkHandler : null;
|
19
|
+
}
|
20
|
+
|
21
|
+
const widgetsStorage = {
|
22
|
+
setWidget,
|
23
|
+
getWidget,
|
24
|
+
setVkHandler,
|
25
|
+
getVkHandler,
|
26
|
+
};
|
27
|
+
|
28
|
+
export default widgetsStorage;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import
|
2
|
-
|
3
|
-
|
4
|
-
window.TextBack.NotificationWidget = window.TextBack.NotificationWidget || NotificationWidget;
|
1
|
+
import NotificationWidget from './index.js';
|
2
|
+
|
3
|
+
window.TextBack.NotificationWidget = window.TextBack.NotificationWidget || NotificationWidget;
|