@textback/notification-widget 2.0.3 → 2.0.4-110501
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +12 -0
- package/{release/builds/textback/notificationwidget/build → build}/sdk.js +2 -2
- package/package.json +2 -2
- package/src/widget/components/tb-notification-widget/index.js +22 -6
- package/src/widget/components/tb-nw-wahunter/index.js +4 -2
- package/src/widget/icons/tb-logo-dark-en.svg +17 -0
- package/src/widget/icons/tb-logo-dark-ru.svg +17 -0
- package/src/widget/icons/tb-logo-dark.svg +16 -0
- package/src/widget/icons/tb-logo-light-en.svg +17 -0
- package/src/widget/icons/tb-logo-light-ru.svg +17 -0
- package/src/widget/icons/tb-logo-white.svg +16 -0
- package/src/widget/icons/tb-logo.svg +15 -20
- package/release/builds/textback/notificationwidget/.eslintrc.js +0 -291
- package/release/builds/textback/notificationwidget/.gitlab-ci.yml +0 -34
- package/release/builds/textback/notificationwidget/build/index.js +0 -12
- package/release/builds/textback/notificationwidget/package-lock.json +0 -9985
- package/release/builds/textback/notificationwidget/package.json +0 -70
- package/release/builds/textback/notificationwidget/promote_tag.sh +0 -2
- package/release/builds/textback/notificationwidget/readme.md +0 -569
- package/release/builds/textback/notificationwidget/server.js +0 -224
- package/release/builds/textback/notificationwidget/src/libraries/ai.1.0.11.js +0 -4089
- package/release/builds/textback/notificationwidget/src/libraries/localization/getLocale.js +0 -17
- package/release/builds/textback/notificationwidget/src/libraries/localization/locales/.tern-port +0 -1
- package/release/builds/textback/notificationwidget/src/libraries/localization/locales/cs.js +0 -23
- package/release/builds/textback/notificationwidget/src/libraries/localization/locales/en.js +0 -23
- package/release/builds/textback/notificationwidget/src/libraries/localization/locales/index.js +0 -9
- package/release/builds/textback/notificationwidget/src/libraries/localization/locales/pl.js +0 -23
- package/release/builds/textback/notificationwidget/src/libraries/localization/locales/ro.js +0 -23
- package/release/builds/textback/notificationwidget/src/libraries/localization/locales/ru.js +0 -22
- package/release/builds/textback/notificationwidget/src/libraries/localization/locales/uk.js +0 -23
- package/release/builds/textback/notificationwidget/src/libraries/localization/text.js +0 -9
- package/release/builds/textback/notificationwidget/src/libraries/t.js +0 -82
- package/release/builds/textback/notificationwidget/src/sdk/channels/channel.js +0 -31
- package/release/builds/textback/notificationwidget/src/sdk/channels/facebook.js +0 -13
- package/release/builds/textback/notificationwidget/src/sdk/channels/factory.js +0 -34
- package/release/builds/textback/notificationwidget/src/sdk/channels/skype.js +0 -13
- package/release/builds/textback/notificationwidget/src/sdk/channels/telegram.js +0 -18
- package/release/builds/textback/notificationwidget/src/sdk/channels/viber.js +0 -13
- package/release/builds/textback/notificationwidget/src/sdk/channels/vk-modal/vk-modal.html +0 -17
- package/release/builds/textback/notificationwidget/src/sdk/channels/vk-modal/vk-modal.js +0 -25
- package/release/builds/textback/notificationwidget/src/sdk/channels/vk-modal/vk-modal.scss +0 -116
- package/release/builds/textback/notificationwidget/src/sdk/channels/vk.js +0 -195
- package/release/builds/textback/notificationwidget/src/sdk/channels/whatsapp.js +0 -27
- package/release/builds/textback/notificationwidget/src/sdk/channels/whatsappb.js +0 -27
- package/release/builds/textback/notificationwidget/src/sdk/events/observer.js +0 -46
- package/release/builds/textback/notificationwidget/src/sdk/index.js +0 -6
- package/release/builds/textback/notificationwidget/src/sdk/sdk.entry.js +0 -1
- package/release/builds/textback/notificationwidget/src/sdk/sdk.js +0 -67
- package/release/builds/textback/notificationwidget/src/sdk/utils/apiErrorHandler.js +0 -12
- package/release/builds/textback/notificationwidget/src/sdk/utils/appInsights.js +0 -88
- package/release/builds/textback/notificationwidget/src/sdk/utils/browserInfo.js +0 -9
- package/release/builds/textback/notificationwidget/src/sdk/utils/constants.js +0 -18
- package/release/builds/textback/notificationwidget/src/sdk/utils/cookies.js +0 -67
- package/release/builds/textback/notificationwidget/src/sdk/utils/find.js +0 -8
- package/release/builds/textback/notificationwidget/src/sdk/utils/loadConfig.js +0 -21
- package/release/builds/textback/notificationwidget/src/sdk/utils/loadDeepLink.js +0 -48
- package/release/builds/textback/notificationwidget/src/sdk/utils/loadScript.js +0 -26
- package/release/builds/textback/notificationwidget/src/sdk/utils/loadSubscriptions.js +0 -6
- package/release/builds/textback/notificationwidget/src/sdk/utils/parseQueryString.js +0 -34
- package/release/builds/textback/notificationwidget/src/sdk/utils/windowHelper.js +0 -25
- package/release/builds/textback/notificationwidget/src/sdk/widget/widget.js +0 -192
- package/release/builds/textback/notificationwidget/src/widget/components/index.js +0 -52
- package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-button/facebook.js +0 -55
- package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-button/index.js +0 -35
- package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-button/styles.scss +0 -657
- package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-button/telegram.js +0 -55
- package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-button/viber.js +0 -57
- package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-button/vk.js +0 -92
- package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-button/whatsapp.js +0 -58
- package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-button/whatsappb.js +0 -58
- package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-widget/index.js +0 -678
- package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-widget/normalize.scss +0 -395
- package/release/builds/textback/notificationwidget/src/widget/components/tb-notification-widget/styles.scss +0 -543
- package/release/builds/textback/notificationwidget/src/widget/components/tb-nw-wahunter/index.js +0 -259
- package/release/builds/textback/notificationwidget/src/widget/components/tb-nw-wahunter/styles.scss +0 -471
- package/release/builds/textback/notificationwidget/src/widget/config.js +0 -5
- package/release/builds/textback/notificationwidget/src/widget/icons/bell-icon.png +0 -0
- package/release/builds/textback/notificationwidget/src/widget/icons/broadcast-icon.png +0 -0
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_chat_window.svg +0 -1
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_close.svg +0 -1
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_facebook.svg +0 -7
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_facebook_circle.svg +0 -7
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_instagram_circle.svg +0 -96
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_skype.svg +0 -44
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_skype_circle.svg +0 -46
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_skype_new.svg +0 -114
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_tg.svg +0 -25
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_tg_circle.svg +0 -17
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_viber.svg +0 -75
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_viber_circle.svg +0 -67
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_viber_new.svg +0 -102
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_vk.svg +0 -14
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_vk_circle.svg +0 -16
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_whatsapp.svg +0 -147
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_whatsapp_circle.svg +0 -4
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_whatsapp_hollow.svg +0 -128
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_whatsapp_new.svg +0 -127
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_whatsappb.svg +0 -147
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_whatsappb_circle.svg +0 -4
- package/release/builds/textback/notificationwidget/src/widget/icons/icon_whatsappb_new.svg +0 -127
- package/release/builds/textback/notificationwidget/src/widget/icons/paper-plane-arrow.svg +0 -3
- package/release/builds/textback/notificationwidget/src/widget/icons/paper-plane-icon.png +0 -0
- package/release/builds/textback/notificationwidget/src/widget/icons/tb-logo.svg +0 -21
- package/release/builds/textback/notificationwidget/src/widget/index.js +0 -29
- package/release/builds/textback/notificationwidget/src/widget/locales/cs.js +0 -42
- package/release/builds/textback/notificationwidget/src/widget/locales/en.js +0 -42
- package/release/builds/textback/notificationwidget/src/widget/locales/index.js +0 -9
- package/release/builds/textback/notificationwidget/src/widget/locales/pl.js +0 -42
- package/release/builds/textback/notificationwidget/src/widget/locales/ro.js +0 -41
- package/release/builds/textback/notificationwidget/src/widget/locales/ru.js +0 -41
- package/release/builds/textback/notificationwidget/src/widget/locales/uk.js +0 -41
- package/release/builds/textback/notificationwidget/src/widget/utils/cookiesEx.js +0 -41
- package/release/builds/textback/notificationwidget/src/widget/utils/getLocale.js +0 -17
- package/release/builds/textback/notificationwidget/src/widget/utils/stringifyAttributes.js +0 -19
- package/release/builds/textback/notificationwidget/src/widget/utils/text.js +0 -10
- package/release/builds/textback/notificationwidget/src/widget/utils/widgetsStorage.js +0 -28
- package/release/builds/textback/notificationwidget/src/widget/widget.entry.js +0 -3
- package/release/builds/textback/notificationwidget/tests/gf.html +0 -35
- package/release/builds/textback/notificationwidget/tests/gf.js +0 -22
- package/release/builds/textback/notificationwidget/tests/index.js +0 -62
- package/release/builds/textback/notificationwidget/views/examples.ejs +0 -51
- package/release/builds/textback/notificationwidget/views/sdk.html +0 -274
- package/release/builds/textback/notificationwidget/webpack.common.js +0 -72
- package/release/builds/textback/notificationwidget/webpack.dev.js +0 -15
- package/release/builds/textback/notificationwidget/webpack.prod.js +0 -10
- package/widget.tar.gz +0 -0
@@ -1,62 +0,0 @@
|
|
1
|
-
const {Selector} = require('testcafe');
|
2
|
-
const querystring = require('querystring');
|
3
|
-
|
4
|
-
const query = querystring.stringify({
|
5
|
-
widgetPath: '/build/index.js',
|
6
|
-
apiPath: '/api',
|
7
|
-
widgetId: 'a'
|
8
|
-
});
|
9
|
-
|
10
|
-
fixture `Notification widget base tests`
|
11
|
-
.page `http://localhost:3000/examples?${query}`;
|
12
|
-
|
13
|
-
test('Telegram button', async t => {
|
14
|
-
const button = Selector('tb-notification-button[channel="tg"]');
|
15
|
-
const link = button.find('a');
|
16
|
-
const text = await button.innerText;
|
17
|
-
const href = await link.getAttribute('href');
|
18
|
-
|
19
|
-
await t.expect(text).contains('Telegram');
|
20
|
-
await t.expect(href).contains('https://telegram.me/rb_dev_3_bot?start=subscribe_');
|
21
|
-
});
|
22
|
-
|
23
|
-
test('VK button', async t => {
|
24
|
-
const button = Selector('tb-notification-button[channel="vk"]');
|
25
|
-
const text = await button.innerText;
|
26
|
-
|
27
|
-
await t.expect(text).contains('VKontakte');
|
28
|
-
});
|
29
|
-
|
30
|
-
test('Facebook button', async t => {
|
31
|
-
const button = Selector('tb-notification-button[channel="facebook"]');
|
32
|
-
const link = button.find('a');
|
33
|
-
const text = await button.innerText;
|
34
|
-
const href = await link.getAttribute('href');
|
35
|
-
|
36
|
-
await t.expect(text).contains('Facebook');
|
37
|
-
await t.expect(href).contains('https://m.me/323049074708312?ref=subscribe_');
|
38
|
-
});
|
39
|
-
|
40
|
-
test('Viber button', async t => {
|
41
|
-
const button = Selector('tb-notification-button[channel="viber"]');
|
42
|
-
const link = button.find('a');
|
43
|
-
const text = await button.innerText;
|
44
|
-
const href = await link.getAttribute('href');
|
45
|
-
|
46
|
-
await t.expect(text).contains('Viber');
|
47
|
-
await t.expect(href).contains('viber://pa?chatURI=dev_&context=subscribe_');
|
48
|
-
});
|
49
|
-
|
50
|
-
test('deeplink request', async t => {
|
51
|
-
const requests = await t.eval(() => window.fetch.calls);
|
52
|
-
|
53
|
-
const deeplinkRequests = requests.filter(call => {
|
54
|
-
return call.url === '/api/endUserNotifications/deepLinks'
|
55
|
-
});
|
56
|
-
|
57
|
-
await t.expect(JSON.parse(deeplinkRequests[0].options.body)).eql({
|
58
|
-
"accountId": "99bffda5-5bd1-49b1-b4f2-658854797c01",
|
59
|
-
"insecureContext": {"orderId": "insecureOrderID"},
|
60
|
-
"secureContextToken": null
|
61
|
-
});
|
62
|
-
});
|
@@ -1,51 +0,0 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<meta charset="UTF-8">
|
4
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
5
|
-
<title>example</title>
|
6
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui-css/semantic.min.css">
|
7
|
-
<!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">-->
|
8
|
-
<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
|
9
|
-
<script src="https://cdn.jsdelivr.net/npm/semantic-ui-css/semantic.min.js"></script>
|
10
|
-
<!-- <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=default,fetch,Promise"></script> -->
|
11
|
-
|
12
|
-
</head>
|
13
|
-
<body>
|
14
|
-
<div class="ui stackable two column grid padded">
|
15
|
-
<div class="column">
|
16
|
-
<form class="ui form">
|
17
|
-
<div class="field">
|
18
|
-
<label>widgetPath</label>
|
19
|
-
<input type="text" name="widgetPath" value="<%- query.widgetPath %>" placeholder="widgetPath">
|
20
|
-
</div>
|
21
|
-
<div class="field">
|
22
|
-
<label>apiPath</label>
|
23
|
-
<input type="text" name="apiPath" value="<%- query.apiPath %>" placeholder="apiPath">
|
24
|
-
</div>
|
25
|
-
<div class="field">
|
26
|
-
<label>widgetId</label>
|
27
|
-
<input type="text" name="widgetId" value="<%- query.widgetId %>" placeholder="widgetId">
|
28
|
-
</div>
|
29
|
-
<div class="field">
|
30
|
-
<label>lang</label>
|
31
|
-
<input type="text" name="lang" value="<%- query.lang %>" placeholder="lang">
|
32
|
-
</div>
|
33
|
-
<div class="field">
|
34
|
-
<label>data</label>
|
35
|
-
<input type="text" name="data" value=<%- `${query.data}` %> placeholder="data">
|
36
|
-
</div>
|
37
|
-
<button class="ui button primary" type="submit">Render</button>
|
38
|
-
<a href="/examples" class="ui button">Defaults</a>
|
39
|
-
</form>
|
40
|
-
</div>
|
41
|
-
<div class="column">
|
42
|
-
<%- widgetCode %>
|
43
|
-
|
44
|
-
<div class="ui segment">
|
45
|
-
<pre style="padding-bottom: 20px; margin: 0 0 -20px;"><%= widgetCode %></pre>
|
46
|
-
</div>
|
47
|
-
</div>
|
48
|
-
</div>
|
49
|
-
</div>
|
50
|
-
</body>
|
51
|
-
</html>
|
@@ -1,274 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="UTF-8">
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
-
<title>SDK Test</title>
|
7
|
-
|
8
|
-
<style>
|
9
|
-
button {
|
10
|
-
margin-right: 10px;
|
11
|
-
}
|
12
|
-
|
13
|
-
.tb-buttons,
|
14
|
-
.tb-btn-wrapper,
|
15
|
-
.tb-btn {
|
16
|
-
box-sizing: border-box;
|
17
|
-
text-align: center;
|
18
|
-
}
|
19
|
-
|
20
|
-
.tb-btn-wrapper {
|
21
|
-
position: relative;
|
22
|
-
display: inline-block;
|
23
|
-
}
|
24
|
-
|
25
|
-
.tb-btn-tooltip {
|
26
|
-
position: absolute;
|
27
|
-
opacity: 0;
|
28
|
-
visibility: hidden;
|
29
|
-
|
30
|
-
background-color: rgba(255, 255, 255, 0.9);
|
31
|
-
padding: 5px 7px;
|
32
|
-
border-radius: 3px;
|
33
|
-
color: #6f7b8a;
|
34
|
-
font-size: 10px;
|
35
|
-
z-index: 10;
|
36
|
-
top: 52px;
|
37
|
-
box-shadow: 0 2px 4px 1px rgba(0, 0, 0, 0.2);
|
38
|
-
transition: opacity 0.4s;
|
39
|
-
}
|
40
|
-
|
41
|
-
.tb-btn-tooltip:before, .tb-btn-tooltip:after {
|
42
|
-
content: ' ';
|
43
|
-
height: 0;
|
44
|
-
position: absolute;
|
45
|
-
width: 0;
|
46
|
-
border: 10px solid transparent;
|
47
|
-
}
|
48
|
-
|
49
|
-
.tb-btn-tooltip:before {
|
50
|
-
position: absolute;
|
51
|
-
top: -19px;
|
52
|
-
left: 70px;
|
53
|
-
z-index: 2;
|
54
|
-
border-bottom-color: #fff;
|
55
|
-
}
|
56
|
-
|
57
|
-
.tb-btn-tooltip:after {
|
58
|
-
position: absolute;
|
59
|
-
top: -25px;
|
60
|
-
left: 67px;
|
61
|
-
z-index: 1;
|
62
|
-
border: 13px solid transparent;
|
63
|
-
border-bottom-color: rgba(0, 0, 0, 0.05);
|
64
|
-
}
|
65
|
-
|
66
|
-
.tb-btn {
|
67
|
-
text-decoration: none;
|
68
|
-
display: inline-block;
|
69
|
-
width: 150px;
|
70
|
-
padding: 10px 25px;
|
71
|
-
margin-top: 5px;
|
72
|
-
margin-bottom: 5px;
|
73
|
-
border-radius: 25px;
|
74
|
-
color: #fff !important;
|
75
|
-
font-size: 15px;
|
76
|
-
font-family: 'Open Sans', 'Droid Sans', Arial, sans-serif;
|
77
|
-
line-height: 17px;
|
78
|
-
transition: box-shadow 0.4s;
|
79
|
-
}
|
80
|
-
|
81
|
-
.tb-btn img {
|
82
|
-
width: 30px;
|
83
|
-
height: 30px;
|
84
|
-
display: inline-block;
|
85
|
-
margin: -10px 0px -10px -15px;
|
86
|
-
}
|
87
|
-
|
88
|
-
.tb-btn:hover {
|
89
|
-
box-shadow: 0 2px 4px 1px rgba(0, 0, 0, 0.4);
|
90
|
-
}
|
91
|
-
|
92
|
-
.tb-btn:hover + .tb-btn-tooltip {
|
93
|
-
opacity: 1;
|
94
|
-
visibility: visible;
|
95
|
-
}
|
96
|
-
|
97
|
-
.tb-btn.tb-vk {
|
98
|
-
background-color: #45668e;
|
99
|
-
}
|
100
|
-
.tb-btn.tb-tg {
|
101
|
-
background-color: #1E96C8;
|
102
|
-
}
|
103
|
-
.tb-btn.tb-facebook {
|
104
|
-
background-color: #3b5998;
|
105
|
-
}
|
106
|
-
.tb-btn.tb-viber {
|
107
|
-
background-color: #59267c;
|
108
|
-
}
|
109
|
-
.tb-btn.tb-whatsapp {
|
110
|
-
background-color: #189d0e;
|
111
|
-
}
|
112
|
-
.tb-btn.tb-whatsappb {
|
113
|
-
background-color: #189d0e;
|
114
|
-
}
|
115
|
-
</style>
|
116
|
-
|
117
|
-
<!-- <link rel="stylesheet" href="/views/tilda.css"> -->
|
118
|
-
</head>
|
119
|
-
<body>
|
120
|
-
<div class="container-fluid">
|
121
|
-
<div class="row-fluid">
|
122
|
-
<div class="col-lg-12">
|
123
|
-
<!-- <h1>Buttons</h1>
|
124
|
-
<div>
|
125
|
-
<button type="button" id="sign_tg" class="btn btn-primary">Telegram</button>
|
126
|
-
<button type="button" id="sign_vk" class="btn btn-small btn-white">VKontakte</button>
|
127
|
-
<button type="button" id="sign_fb">Facebook</button>
|
128
|
-
<button type="button" id="sign_viber">Viber</button>
|
129
|
-
<button type="button" id="sign_wa" class="btn btn-success">WhatsApp</button>
|
130
|
-
</div>
|
131
|
-
|
132
|
-
<h1>Random</h1>
|
133
|
-
<div>
|
134
|
-
<button type="button" id="sign_random" class="btn btn-lg btn-white"><i class="fa fa-refresh"></i> Subscribe to random messenger</button>
|
135
|
-
</div> -->
|
136
|
-
<div class="tb-buttons">
|
137
|
-
<div class="tb-btn-wrapper" id="tb-link">
|
138
|
-
<a href="#" id="sign_tg" class="tb-btn tb-tg">
|
139
|
-
<img src="//cdn.jsdelivr.net/npm/@textback/notification-widget@latest/src/widget/icons/icon_tg.svg" alt="">
|
140
|
-
Telegram
|
141
|
-
</a>
|
142
|
-
<div class="tb-btn-tooltip">
|
143
|
-
Нажмите "<strong>Start</strong>" в приложении Telegram
|
144
|
-
</div>
|
145
|
-
</div>
|
146
|
-
<div class="tb-btn-wrapper" id="tb-link">
|
147
|
-
<a href="#" id="sign_vk" class="tb-btn tb-vk">
|
148
|
-
<img src="//cdn.jsdelivr.net/npm/@textback/notification-widget@latest/src/widget/icons/icon_vk.svg" alt="">
|
149
|
-
VK
|
150
|
-
</a>
|
151
|
-
<div class="tb-btn-tooltip">
|
152
|
-
Нажмите "<strong>Разрешить</strong>" во всплывающем окне
|
153
|
-
</div>
|
154
|
-
</div>
|
155
|
-
<div class="tb-btn-wrapper" id="tb-link">
|
156
|
-
<a href="#" id="sign_fb" class="tb-btn tb-facebook">
|
157
|
-
<img src="//cdn.jsdelivr.net/npm/@textback/notification-widget@latest/src/widget/icons/icon_facebook.svg" alt="">
|
158
|
-
Facebook
|
159
|
-
</a>
|
160
|
-
<div class="tb-btn-tooltip">
|
161
|
-
Нажмите "<strong>Начать</strong>" в Facebook Messenger
|
162
|
-
</div>
|
163
|
-
</div>
|
164
|
-
<div class="tb-btn-wrapper" id="tb-link">
|
165
|
-
<a href="#" id="sign_viber" class="tb-btn tb-viber">
|
166
|
-
<img src="//cdn.jsdelivr.net/npm/@textback/notification-widget@latest/src/widget/icons/icon_viber.svg" alt="">
|
167
|
-
Viber
|
168
|
-
</a>
|
169
|
-
<div class="tb-btn-tooltip">
|
170
|
-
У вас должно быть установлено <strong>Viber Desktop приложение</strong>
|
171
|
-
</div>
|
172
|
-
</div>
|
173
|
-
<div class="tb-btn-wrapper" id="tb-link">
|
174
|
-
<a href="#" id="sign_wa" class="tb-btn tb-whatsapp">
|
175
|
-
<img src="//cdn.jsdelivr.net/npm/@textback/notification-widget@latest/src/widget/icons/icon_whatsapp.svg" alt="">
|
176
|
-
WhatsApp
|
177
|
-
</a>
|
178
|
-
<div class="tb-btn-tooltip">
|
179
|
-
Отправьте <strong>предзаполненный текст</strong> в WhatsApp без изменений
|
180
|
-
</div>
|
181
|
-
</div>
|
182
|
-
<div class="tb-btn-wrapper" id="tb-link">
|
183
|
-
<a href="#" id="sign_wab" class="tb-btn tb-whatsapp">
|
184
|
-
<img src="//cdn.jsdelivr.net/npm/@textback/notification-widget@latest/src/widget/icons/icon_whatsappb.svg" alt="">
|
185
|
-
WhatsApp
|
186
|
-
</a>
|
187
|
-
<div class="tb-btn-tooltip">
|
188
|
-
Отправьте <strong>предзаполненный текст</strong> в WhatsApp без изменений
|
189
|
-
</div>
|
190
|
-
</div>
|
191
|
-
</div>
|
192
|
-
|
193
|
-
<!-- <script src="https://zapier.com/zapbook/embed/widget.js?services=TextBack&container=true&limit=10"></script> -->
|
194
|
-
</div>
|
195
|
-
</div>
|
196
|
-
</div>
|
197
|
-
|
198
|
-
<script>
|
199
|
-
var TextBack = {
|
200
|
-
someProp: 123,
|
201
|
-
};
|
202
|
-
</script>
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
<script src="//cdn.jsdelivr.net/npm/@textback/notification-widget@latest/build/sdk.js"></script>
|
207
|
-
<!-- <script src="/build/sdk.js"></script> -->
|
208
|
-
|
209
|
-
<script type="text/javascript">
|
210
|
-
var config = {
|
211
|
-
widgetId: 'a74bf35b-bbef-482d-b4aa-0c6795021806',
|
212
|
-
apiPath: 'https://tb-apisrv-dev.textback.io/api',
|
213
|
-
};
|
214
|
-
|
215
|
-
var off = TextBack.SDK.on('widget.init', function(event) {
|
216
|
-
console.log(`First widget has been initialized. ${event.widgetId}`);
|
217
|
-
off();
|
218
|
-
});
|
219
|
-
|
220
|
-
TextBack.SDK.on('subscription.start', function(event) {
|
221
|
-
console.log('subscription.start', event);
|
222
|
-
});
|
223
|
-
|
224
|
-
TextBack.SDK.initWidget(config).then( function(widget) {
|
225
|
-
// Facebook
|
226
|
-
document.getElementById('sign_fb').addEventListener('click', function(event) {
|
227
|
-
event.preventDefault();
|
228
|
-
widget.subscribe('fb');
|
229
|
-
});
|
230
|
-
|
231
|
-
// Telegram
|
232
|
-
document.getElementById('sign_tg').addEventListener('click', function(event) {
|
233
|
-
event.preventDefault();
|
234
|
-
widget.subscribe('tg');
|
235
|
-
});
|
236
|
-
|
237
|
-
// VKontakte
|
238
|
-
document.getElementById('sign_vk').addEventListener('click', function(event) {
|
239
|
-
event.preventDefault();
|
240
|
-
widget.subscribe('vk');
|
241
|
-
});
|
242
|
-
|
243
|
-
// Viber
|
244
|
-
document.getElementById('sign_viber').addEventListener('click', function(event) {
|
245
|
-
event.preventDefault();
|
246
|
-
widget.subscribe('viber');
|
247
|
-
});
|
248
|
-
|
249
|
-
// WhatsApp
|
250
|
-
document.getElementById('sign_wa').addEventListener('click', function(event) {
|
251
|
-
event.preventDefault();
|
252
|
-
widget.subscribe('whatsapp');
|
253
|
-
});
|
254
|
-
|
255
|
-
// WhatsApp Business
|
256
|
-
document.getElementById('sign_wab').addEventListener('click', function(event) {
|
257
|
-
event.preventDefault();
|
258
|
-
widget.subscribe('whatsappb');
|
259
|
-
});
|
260
|
-
}, function(err) {
|
261
|
-
console.log('error', err)
|
262
|
-
});
|
263
|
-
|
264
|
-
// TextBack.SDK.getWidget(config.widgetId).then(function(widget){
|
265
|
-
// // Random
|
266
|
-
// document.getElementById('sign_random').addEventListener('click', function(event) {
|
267
|
-
// var channels = widget.getEnabledChannels();
|
268
|
-
// var channelIndexToSubscribe = Math.floor(Math.random() * channels.length);
|
269
|
-
// widget.subscribe(channels[channelIndexToSubscribe].channel);
|
270
|
-
// });
|
271
|
-
// });
|
272
|
-
</script>
|
273
|
-
</body>
|
274
|
-
</html>
|
@@ -1,72 +0,0 @@
|
|
1
|
-
const webpack = require('webpack');
|
2
|
-
const CleanWebpackPlugin = require('clean-webpack-plugin');
|
3
|
-
|
4
|
-
const fs = require('fs');
|
5
|
-
|
6
|
-
function getPackageVersion() {
|
7
|
-
const json = require('./package.json');
|
8
|
-
const buildNumber = process.env.BUILD_BUILDNUMBER;
|
9
|
-
let version = json.version;
|
10
|
-
|
11
|
-
if (typeof buildNumber !== 'undefined') {
|
12
|
-
version = `${json.version}-${buildNumber}`
|
13
|
-
json.version = version;
|
14
|
-
fs.writeFileSync('package.json', JSON.stringify(json, null, 2));
|
15
|
-
}
|
16
|
-
return version;
|
17
|
-
}
|
18
|
-
|
19
|
-
|
20
|
-
const webpackConfig = {
|
21
|
-
entry: {
|
22
|
-
sdk: './src/sdk/sdk.entry.js',
|
23
|
-
index: './src/widget/widget.entry.js',
|
24
|
-
},
|
25
|
-
output: {
|
26
|
-
path: __dirname + '/build',
|
27
|
-
filename: '[name].js',
|
28
|
-
},
|
29
|
-
module: {
|
30
|
-
rules: [{
|
31
|
-
test: /\.scss$/,
|
32
|
-
use: [
|
33
|
-
{loader: 'style-loader'},
|
34
|
-
{loader: 'css-loader'},
|
35
|
-
{loader: 'sass-loader'}
|
36
|
-
]
|
37
|
-
}, {
|
38
|
-
test: /\.svg/,
|
39
|
-
use: [{
|
40
|
-
loader: 'svg-inline-loader',
|
41
|
-
options: {
|
42
|
-
// classPrefix: 'tb-notification-widget',
|
43
|
-
// idPrefix: 'tb-notification-widget',
|
44
|
-
},
|
45
|
-
}]
|
46
|
-
}, {
|
47
|
-
test: /\.png/,
|
48
|
-
use: 'base64-image-loader'
|
49
|
-
}, {
|
50
|
-
test: /\.html/,
|
51
|
-
use: 'html-loader',
|
52
|
-
}, {
|
53
|
-
test: /\.js$/,
|
54
|
-
exclude: [/node_modules/],
|
55
|
-
use: [{
|
56
|
-
loader: 'babel-loader',
|
57
|
-
options: {
|
58
|
-
presets: ['env'],
|
59
|
-
},
|
60
|
-
}],
|
61
|
-
}],
|
62
|
-
},
|
63
|
-
|
64
|
-
plugins: [
|
65
|
-
new CleanWebpackPlugin(['build']),
|
66
|
-
new webpack.DefinePlugin({
|
67
|
-
VERSION: JSON.stringify(getPackageVersion())
|
68
|
-
}),
|
69
|
-
],
|
70
|
-
};
|
71
|
-
|
72
|
-
module.exports = webpackConfig;
|
@@ -1,15 +0,0 @@
|
|
1
|
-
const merge = require('webpack-merge');
|
2
|
-
const common = require('./webpack.common.js');
|
3
|
-
|
4
|
-
module.exports = merge(common, {
|
5
|
-
devtool: 'eval-source-map',
|
6
|
-
watch: true,
|
7
|
-
/*devServer: {
|
8
|
-
contentBase: './build',
|
9
|
-
port: 8081,
|
10
|
-
watchOptions: {
|
11
|
-
aggregateTimeout: 300,
|
12
|
-
poll: 1000
|
13
|
-
},
|
14
|
-
}*/
|
15
|
-
});
|
@@ -1,10 +0,0 @@
|
|
1
|
-
const merge = require('webpack-merge');
|
2
|
-
const common = require('./webpack.common.js');
|
3
|
-
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
|
4
|
-
|
5
|
-
module.exports = merge(common, {
|
6
|
-
mode: 'production',
|
7
|
-
optimization: {
|
8
|
-
minimizer: [new UglifyJSPlugin()]
|
9
|
-
}
|
10
|
-
});
|
package/widget.tar.gz
DELETED
Binary file
|