Skip to content

Commit

Permalink
v7.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
boehlerlukas committed May 31, 2022
1 parent ff8e99d commit ebb5c7d
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 40 deletions.
2 changes: 1 addition & 1 deletion build/index.js

Large diffs are not rendered by default.

27 changes: 6 additions & 21 deletions demo/main.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
const Gleap = window.Gleap;

Gleap.initialize("DUPaIr7s689BBblcFI4pc5aBgYJTm7Sc");

/*Gleap.identify("123338", {
email: "[email protected]",
name: "Lukas",
}, "232310140176f44725d35f8191b51bd8821f41dba9b4c3cfab409721feadb4fb");*/
Gleap.setApiUrl("http://localhost:9000");
Gleap.initialize("ogWhNhuiZcGWrva5nlDS8l7a78OfaLlV");

Gleap.attachCustomData({
mission: "Unicorn",
Expand All @@ -16,11 +12,13 @@ Gleap.attachCustomData({
},
});

// Register custom action.
Gleap.registerCustomAction((customAction) => {
console.log("MAGIC??");
console.log("Custom action called:");
console.log(customAction);
});

// Network logs test.
setTimeout(() => {
console.log("Loading place infos");

Expand All @@ -37,17 +35,4 @@ setTimeout(() => {
xmlhttp.send();

Gleap.preFillForm("bqfp3v", "DIES IST EIN TEST");
}, 1000);

setTimeout(() => {
console.warn("Demo warning :)");
console.log("Data will be loaded soon.");

// xxx();
}, 4000);

const files = [
"https://biblephrasesm31p70v.blob.core.windows.net/phrases-v2/CD17C8A4CF4FA179C864FA4EFA561BBC405EF06304B1E239EE1A3A781A8905A0.mpga",
"https://biblephrasesm31p70v.blob.core.windows.net/phrases-v2/CD17C8A4CF4FA179C864FA4EFA561BBC405EF06304B1E239EE1A3A781A8905A0.mpga",
"https://reqres.in/api/products/3",
];
}, 1000);
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export namespace Gleap {
function clearCustomData(): void;
function isOpened(): boolean;
function setApiUrl(apiUrl: string): void;
function setWidgetUrl(widgetUrl: string): void;
function setFrameUrl(frameUrl: string): void;
function registerCustomAction(
customAction: (action: { name: string }) => void
): void;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gleap",
"version": "7.0.8",
"version": "7.0.9",
"main": "build/index.js",
"scripts": {
"start": "webpack serve",
Expand Down
1 change: 1 addition & 0 deletions published/7.0.9/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion published/latest/index.js

Large diffs are not rendered by default.

15 changes: 5 additions & 10 deletions src/Gleap.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,11 @@ class Gleap {
}

/**
* Set a custom widget api url.
* @param {string} widgetUrl
* Set a custom frame api url.
* @param {string} frameUrl
*/
static setWidgetUrl(widgetUrl) {
GleapSession.getInstance().widgetUrl = widgetUrl;
static setFrameUrl(frameUrl) {
GleapFrameManager.getInstance().frameUrl = frameUrl;
}

/**
Expand Down Expand Up @@ -369,13 +369,8 @@ class Gleap {
newFormData.reportedBy = sessionInstance.session.email;
}

GleapEventManager.notifyEvent("sending-silent-report");
const feedback = new GleapFeedback("CRASH", priority, newFormData, true, excludeData ? excludeData : {});
feedback.sendFeedback().then(() => {
GleapEventManager.notifyEvent("silent-report-sent");
}).catch((error) => {
GleapEventManager.notifyEvent("failed-sending-silent-report");
});
feedback.sendFeedback().then(() => { }).catch((error) => { });
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/GleapConfigManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default class GleapConfigManager {
const http = new XMLHttpRequest();
http.open(
"GET",
session.widgetUrl + "/widget/" + session.sdkKey + "/config"
session.apiUrl + "/config/" + session.sdkKey
);
http.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
session.injectSession(http);
Expand Down
6 changes: 3 additions & 3 deletions src/GleapFrameManager.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { GleapStreamedEvent, GleapCustomActionManager, GleapEventManager, GleapMarkerManager, GleapFeedback, GleapFeedbackButtonManager, GleapTranslationManager, GleapSession, GleapConfigManager } from "./Gleap";

export default class GleapFrameManager {
frameUrl = "https://frame.gleap.io";
gleapFrameContainer = null;
gleapFrame = null;
injectedFrame = false;
widgetOpened = false;
listeners = [];
frameURL = "https://frame.gleap.io";
markerManager = undefined;
escListener = undefined;
frameHeight = 0;
Expand Down Expand Up @@ -57,7 +57,7 @@ export default class GleapFrameManager {

var elem = document.createElement("div");
elem.className = "gleap-frame-container gleap-frame-container--hidden gleap-hidden";
elem.innerHTML = `<div class="gleap-frame-container-inner"><iframe src="${this.frameURL}" class="gleap-frame" scrolling="yes" title="Gleap Widget Window" allow="autoplay; encrypted-media; fullscreen;" frameborder="0"></iframe></div>`;
elem.innerHTML = `<div class="gleap-frame-container-inner"><iframe src="${this.frameUrl}" class="gleap-frame" scrolling="yes" title="Gleap Widget Window" allow="autoplay; encrypted-media; fullscreen;" frameborder="0"></iframe></div>`;
document.body.appendChild(elem);

this.gleapFrameContainer = elem;
Expand Down Expand Up @@ -262,7 +262,7 @@ export default class GleapFrameManager {

// Add window message listener.
window.addEventListener("message", (event) => {
if (event.origin !== this.frameURL) {
if (event.origin !== this.frameUrl) {
return;
}

Expand Down
1 change: 0 additions & 1 deletion src/GleapSession.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { loadFromGleapCache, saveToGleapCache } from "./GleapHelper";

export default class GleapSession {
apiUrl = "https://api.gleap.io";
widgetUrl = "https://widget.gleap.io";
sdkKey = null;
session = {
gleapId: null,
Expand Down

0 comments on commit ebb5c7d

Please sign in to comment.