Skip to content

Commit 895f709

Browse files
committed
v11.0.0
1 parent 4d78a41 commit 895f709

File tree

5 files changed

+43
-20
lines changed

5 files changed

+43
-20
lines changed

demo/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Gleap.setApiUrl("http://0.0.0.0:9000");
55

66
Gleap.setLanguage("de");
77

8-
Gleap.initialize("zhkMPoY1k41yhOus4BRwVKE7Qas5zbyA");
8+
Gleap.initialize("ogWhNhuiZcGWrva5nlDS8l7a78OfaLlV");
99
//Gleap.setEnvironment("dev");
1010

1111
/*Gleap.setUrlHandler((url, newTab) => {
@@ -27,14 +27,14 @@ Gleap.attachCustomData({
2727
},
2828
});
2929

30-
Gleap.identify("@testinglukasaa", {
30+
/*Gleap.identify("@testinglukasaa", {
3131
name: "Max Doe",
3232
email: "lukas+atestaaa@gleap.io",
3333
value: 1234,
3434
phone: "+49123456789",
3535
testing: { "fun": 1123 },
3636
luki: 19283
37-
});
37+
});*/
3838

3939
Gleap.log("Test log");
4040
Gleap.log("Test log info", "INFO");

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gleap",
3-
"version": "10.5.0",
3+
"version": "11.0.0",
44
"main": "build/index.js",
55
"scripts": {
66
"start": "webpack serve",

src/GleapFrameManager.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { widgetMaxHeight } from "./UI";
2020
import { runFunctionWhenDomIsReady } from "./GleapHelper";
2121

2222
export default class GleapFrameManager {
23-
frameUrl = "https://messenger.gleap.io";
23+
frameUrl = "https://messenger-app.gleap.io";
2424
gleapFrameContainer = null;
2525
gleapFrame = null;
2626
injectedFrame = false;
@@ -116,7 +116,7 @@ export default class GleapFrameManager {
116116

117117
autoWhiteListCookieManager = () => {
118118
if (window && window.cmp_block_ignoredomains) {
119-
window.cmp_block_ignoredomains.concat(["messenger.gleap.io"]);
119+
window.cmp_block_ignoredomains.concat(["messenger-app.gleap.io"]);
120120
}
121121
};
122122

src/GleapNotificationManager.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,20 +145,28 @@ export default class GleapNotificationManager {
145145
};
146146

147147
if (notification.data.news) {
148+
const renderDescription = () => {
149+
if (notification.data.previewText && notification.data.previewText.length > 0) {
150+
return `<div class="gleap-notification-item-news-preview">${notification.data.previewText}</div>`;
151+
}
152+
153+
return `${notification.data.sender ? `
154+
<div class="gleap-notification-item-news-sender">
155+
${notification.data.sender.profileImageUrl &&
156+
`<img src="${notification.data.sender.profileImageUrl}" />`
157+
} ${notification.data.sender.name}</div>`
158+
: ""
159+
}`;
160+
};
161+
148162
// News preview
149163
elem.className = "gleap-notification-item-news";
150164
elem.innerHTML = `
151165
<div class="gleap-notification-item-news-container">
152-
${notification.data.coverImageUrl ? `<img class="gleap-notification-item-news-image" src="${notification.data.coverImageUrl}" />` : ''}
166+
${notification.data.coverImageUrl && notification.data.coverImageUrl !== "" && !notification.data.coverImageUrl.includes("NewsImagePlaceholder") ? `<img class="gleap-notification-item-news-image" src="${notification.data.coverImageUrl}" />` : ''}
153167
<div class="gleap-notification-item-news-content">
154168
<div class="gleap-notification-item-news-content-title">${content}</div>
155-
${notification.data.sender ? `
156-
<div class="gleap-notification-item-news-sender">
157-
${notification.data.sender.profileImageUrl &&
158-
`<img src="${notification.data.sender.profileImageUrl}" />`
159-
} ${notification.data.sender.name}</div>`
160-
: ""
161-
}
169+
${renderDescription()}
162170
</div>
163171
</div>`;
164172
} else {

src/UI.js

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -340,24 +340,39 @@ export const injectStyledCSS = (
340340
padding: 15px;
341341
}
342342
343+
.gleap-notification-item-news-preview {
344+
color: ${subTextColor};
345+
font-size: 15px;
346+
line-height: 21px;
347+
font-weight: 400;
348+
overflow-wrap: break-word;
349+
word-break: break-word;
350+
display: block;
351+
display: -webkit-box;
352+
-webkit-line-clamp: 2;
353+
-webkit-box-orient: vertical;
354+
overflow: hidden;
355+
}
356+
343357
.gleap-notification-item-news-sender {
344358
display: flex;
345359
align-items: center;
346360
color: ${subTextColor};
347-
font-size: 14px;
361+
font-size: 15px;
362+
line-height: 21px;
348363
font-weight: 400;
349364
}
350365
351366
.gleap-notification-item-news-content-title {
352-
font-size: 14px;
367+
color: ${contrastBackgroundColor};
368+
font-size: 15px;
353369
font-weight: 500;
354-
line-height: 18px;
370+
line-height: 21px;
355371
margin-bottom: 6px;
356372
max-width: 100%;
373+
-webkit-line-clamp: 3;
374+
-webkit-box-orient: vertical;
357375
overflow: hidden;
358-
text-overflow: ellipsis;
359-
white-space: nowrap;
360-
color: ${contrastBackgroundColor};
361376
}
362377
363378
.gleap-notification-item-news-sender img {

0 commit comments

Comments
 (0)