Skip to content

Commit 1ad7193

Browse files
committed
v8.3.0
1 parent 481a5ac commit 1ad7193

File tree

10 files changed

+90
-19
lines changed

10 files changed

+90
-19
lines changed

build/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ <h2 class="sub-headline">
189189
rentals worldwide. This is the prototype for the pre-engineered system
190190
known as the IT House.
191191
<br /><br />
192-
<div class="buttonlink" onclick="window.history.pushState('games', 'Games', '/games');">
192+
<div class="buttonlink" onclick='console.error("Failt to book...");'>
193193
Book now
194194
</div>
195195
<br /><br />

demo/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const Gleap = window.Gleap;
22

33
Gleap.setFrameUrl("http://0.0.0.0:3001");
44
Gleap.setApiUrl("http://0.0.0.0:9000");
5-
Gleap.initialize("gDHGltEcKRLVaVt47QrbfrrbN4SFkYV8");
5+
Gleap.initialize("ek98ANmHary9PQNG5EIl6TQd3SzqstZA");
66
//Gleap.setEnvironment("dev");
77

88
Gleap.attachCustomData({

index.d.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,12 @@ export namespace Gleap {
7474
userHash?: string
7575
): void;
7676
function open(): void;
77-
function openNews(): void;
78-
function openFeatureRequests(): void;
77+
function openNews(showBackButton?: boolean): void;
78+
function openNewsArticle(collectionId: string, articleId?: string, showBackButton?: boolean): void;
79+
function openHelpCenter(showBackButton?: boolean): void;
80+
function openHelpArticle(id: string, showBackButton?: boolean): void;
81+
function searchHelpCenter(term: string, showBackButton?: boolean): void;
82+
function openFeatureRequests(showBackButton?: boolean): void;
7983
function close(): void;
8084
function hide(): void;
8185
function setEnvironment(environment: "dev" | "staging" | "prod"): void;

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": "8.2.6",
3+
"version": "8.3.0",
44
"main": "build/index.js",
55
"scripts": {
66
"start": "webpack serve",

published/8.3.0/index.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

published/latest/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Gleap.js

Lines changed: 69 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,10 +554,69 @@ class Gleap {
554554
GleapFrameManager.getInstance().showWidget();
555555
}
556556

557+
/**
558+
* Opens a help article
559+
*/
560+
static openHelpArticle(collectionId, articleId, showBackButton = true) {
561+
if (!collectionId) {
562+
return;
563+
}
564+
565+
GleapFrameManager.getInstance().setAppMode("widget");
566+
567+
GleapFrameManager.getInstance().sendMessage({
568+
name: "open-help-article",
569+
data: {
570+
collectionId,
571+
articleId,
572+
hideBackButton: !showBackButton,
573+
}
574+
}, true);
575+
576+
GleapFrameManager.getInstance().showWidget();
577+
}
578+
579+
/**
580+
* Opens the help center.
581+
*/
582+
static openHelpCenter(showBackButton = true) {
583+
GleapFrameManager.getInstance().setAppMode("widget");
584+
585+
GleapFrameManager.getInstance().sendMessage({
586+
name: "open-helpcenter",
587+
data: {
588+
hideBackButton: !showBackButton,
589+
},
590+
}, true);
591+
592+
GleapFrameManager.getInstance().showWidget();
593+
}
594+
595+
/**
596+
* Search for news articles in the help center
597+
*/
598+
static searchHelpCenter(term, showBackButton = true) {
599+
if (!id) {
600+
return;
601+
}
602+
603+
GleapFrameManager.getInstance().setAppMode("widget");
604+
605+
GleapFrameManager.getInstance().sendMessage({
606+
name: "open-helpcenter-search",
607+
data: {
608+
term,
609+
hideBackButton: !showBackButton,
610+
}
611+
}, true);
612+
613+
GleapFrameManager.getInstance().showWidget();
614+
}
615+
557616
/**
558617
* Opens a news article
559618
*/
560-
static openNewsArticle(id) {
619+
static openNewsArticle(id, showBackButton = true) {
561620
if (!id) {
562621
return;
563622
}
@@ -568,6 +627,7 @@ class Gleap {
568627
name: "open-news-article",
569628
data: {
570629
id,
630+
hideBackButton: !showBackButton,
571631
}
572632
}, true);
573633

@@ -577,11 +637,14 @@ class Gleap {
577637
/**
578638
* Opens the news overview.
579639
*/
580-
static openNews() {
640+
static openNews(showBackButton = true) {
581641
GleapFrameManager.getInstance().setAppMode("widget");
582642

583643
GleapFrameManager.getInstance().sendMessage({
584644
name: "open-news",
645+
data: {
646+
hideBackButton: !showBackButton,
647+
},
585648
}, true);
586649

587650
GleapFrameManager.getInstance().showWidget();
@@ -590,11 +653,14 @@ class Gleap {
590653
/**
591654
* Opens the feature requests overview.
592655
*/
593-
static openFeatureRequests() {
656+
static openFeatureRequests(showBackButton = true) {
594657
GleapFrameManager.getInstance().setAppMode("widget");
595658

596659
GleapFrameManager.getInstance().sendMessage({
597660
name: "open-feature-requests",
661+
data: {
662+
hideBackButton: !showBackButton,
663+
},
598664
}, true);
599665

600666
GleapFrameManager.getInstance().showWidget();

src/GleapFrameManager.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ export default class GleapFrameManager {
118118
}
119119

120120
const surveyStyle = "gleap-frame-container--survey";
121-
const newsdetailsStyle = "gleap-frame-container--news";
121+
const extendedStyle = "gleap-frame-container--extended";
122122
const surveyFullStyle = "gleap-frame-container--survey-full";
123123
const classicStyle = "gleap-frame-container--classic";
124124
const classicStyleLeft = "gleap-frame-container--classic-left";
125125
const modernStyleLeft = "gleap-frame-container--modern-left";
126126
const noButtonStyleLeft = "gleap-frame-container--no-button";
127-
const allStyles = [classicStyle, classicStyleLeft, newsdetailsStyle, modernStyleLeft, noButtonStyleLeft, surveyStyle, surveyFullStyle];
127+
const allStyles = [classicStyle, classicStyleLeft, extendedStyle, modernStyleLeft, noButtonStyleLeft, surveyStyle, surveyFullStyle];
128128
for (let i = 0; i < allStyles.length; i++) {
129129
this.gleapFrameContainer.classList.remove(allStyles[i]);
130130
}
@@ -160,8 +160,8 @@ export default class GleapFrameManager {
160160
if (this.appMode === "survey_full") {
161161
this.gleapFrameContainer.classList.add(surveyFullStyle);
162162
}
163-
if (this.appMode === "newsdetails") {
164-
this.gleapFrameContainer.classList.add(newsdetailsStyle);
163+
if (this.appMode === "extended") {
164+
this.gleapFrameContainer.classList.add(extendedStyle);
165165
}
166166

167167
this.gleapFrameContainer.setAttribute("dir", GleapTranslationManager.getInstance().isRTLLayout ? "rtl" : "ltr");
@@ -335,10 +335,10 @@ export default class GleapFrameManager {
335335
}
336336

337337
if (data.name === "page-changed") {
338-
if (data.data && data.data.name === "newsdetails") {
339-
this.setAppMode("newsdetails");
338+
if (data.data && (data.data.name === "newsdetails" || data.data.name === "appextended")) {
339+
this.setAppMode("extended");
340340
} else {
341-
if (this.appMode === "newsdetails") {
341+
if (this.appMode === "extended") {
342342
this.setAppMode("widget");
343343
}
344344
}

src/UI.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const injectStyledCSS = (
6767
right: ${buttonX}px;
6868
bottom: ${75 + buttonY}px;
6969
width: calc(100% - 40px);
70-
max-width: 390px;
70+
max-width: 400px;
7171
position: fixed;
7272
z-index: ${zIndexBase + 31};
7373
visibility: visible;
@@ -137,7 +137,7 @@ export const injectStyledCSS = (
137137
bottom: ${buttonY}px !important;
138138
}
139139
140-
.gleap-frame-container--news {
140+
.gleap-frame-container--extended {
141141
max-width: 690px !important;
142142
}
143143

0 commit comments

Comments
 (0)