Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Commit

Permalink
Added Base64 support in the button object
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelmayer-dev committed Mar 10, 2022
1 parent 4c73499 commit 81289ca
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions js/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var supportButtonReleaseLongPress = false;
var buttonsGenerated = false;

var apiVersion = 20;
var version = "2.2.0";
var version = "2.3.0";

function back() {
disconnect();
Expand Down Expand Up @@ -206,8 +206,8 @@ function connect(url) {
for (var i = 0; i < this.buttons.length; i++) {
var button = document.getElementById(this.buttons[i].Position_Y + "_" + this.buttons[i].Position_X);

if (button) {
if (this.buttons[i] && this.buttons[i].Icon) {
if (button && this.buttons[i]) {
if (this.buttons[i].Icon) {
var iconPack;
var icon;

Expand Down Expand Up @@ -235,7 +235,10 @@ function connect(url) {
}
}
button.style.backgroundImage = 'url(data:image/gif;base64,' + icon.IconBase64 + ')';
} else if (this.buttons[i].IconBase64) {
button.style.backgroundImage = 'url(data:image/gif;base64,' + this.buttons[i].IconBase64 + ')';
}

}

var label = document.getElementById("label_" + this.buttons[i].Position_Y + "_" + this.buttons[i].Position_X);
Expand Down Expand Up @@ -280,6 +283,8 @@ function connect(url) {
}
}
button.style.backgroundImage = 'url(data:image/gif;base64,' + icon.IconBase64 + ')';
} else if (obj.Buttons[0].IconBase64) {
button.style.backgroundImage = 'url(data:image/gif;base64,' + obj.Buttons[0].IconBase64 + ')';
} else {
button.style.backgroundImage = '';
}
Expand Down

0 comments on commit 81289ca

Please sign in to comment.