Skip to content

Commit

Permalink
fix bundleid not being defined
Browse files Browse the repository at this point in the history
  • Loading branch information
uchks committed Oct 6, 2024
1 parent 472a0c3 commit 07fdef7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
21 changes: 15 additions & 6 deletions depictions/web/js/content-blocks-index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
let bundleid = "";

function setBundleId(id) {
bundleid = id;
}

function getContentBlocks() {
return {
"#packageName": {
Expand Down Expand Up @@ -64,7 +70,10 @@ function getContentBlocks() {
);
},
},
"#versionBadge": { type: "text", source: "package>version" },
"#versionBadge": {
type: "text",
source: "package>version",
},
"#changesList": {
type: "list",
source: "package>changelog>change",
Expand Down Expand Up @@ -103,22 +112,22 @@ function getContentBlocks() {
source: "package>links>link",
paragraphElement: "<li class='list-group-item'>",
render: (element, source) => {
if ($(source).lenght === 0) {
if ($(source).length === 0) {
$("#externalLinksContainer").remove();
return;
}

$.each(source, (index, data) => {
const a = $("<a class='link-item list-group-item'>");
a.attr("href", $(data).find("url").text());
if ($(data).find("iconclass")) {
if ($(data).find("iconclass").length) {
const i = $("<span>");
i.attr("class", $(data).find("iconclass").text());
console.log(i);
$(a).append(i);
}
$(a).append($(data).find("name").text());
$(element).append(a);
}); //each
});
},
},
};
Expand All @@ -139,5 +148,5 @@ function populateContentBlocks(data, blocks, error, success) {
$("#packageInformation").hide();
error(textStatus);
},
}); //ajax
});
}
10 changes: 8 additions & 2 deletions depictions/web/js/content-blocks-screenshots.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
let bundleid = "";

function setBundleId(id) {
bundleid = id;
}

function getContentBlocks() {
return {
"#screenshotsList": {
Expand All @@ -7,7 +13,7 @@ function getContentBlocks() {
if ($(source).length === 0) {
$(element).append(
$(
"<div class='alert alert-danger'>The aren't any screenshots for this package</div>"
"<div class='alert alert-danger'>There aren't any screenshots for this package</div>"
)
);
return;
Expand Down Expand Up @@ -43,5 +49,5 @@ function populateContentBlocks(data, blocks, error, success) {
$("#packageInformation").hide();
error(textStatus);
},
}); //ajax
});
}

0 comments on commit 07fdef7

Please sign in to comment.