From 07fdef7a63d137b80d63de4e825612a3392ce0c2 Mon Sep 17 00:00:00 2001
From: Jason <38664452+uchks@users.noreply.github.com>
Date: Sat, 5 Oct 2024 22:25:49 -0500
Subject: [PATCH] fix bundleid not being defined
---
depictions/web/js/content-blocks-index.js | 21 +++++++++++++------
.../web/js/content-blocks-screenshots.js | 10 +++++++--
2 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/depictions/web/js/content-blocks-index.js b/depictions/web/js/content-blocks-index.js
index 496452c1..c64cfa34 100644
--- a/depictions/web/js/content-blocks-index.js
+++ b/depictions/web/js/content-blocks-index.js
@@ -1,3 +1,9 @@
+let bundleid = "";
+
+function setBundleId(id) {
+ bundleid = id;
+}
+
function getContentBlocks() {
return {
"#packageName": {
@@ -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",
@@ -103,22 +112,22 @@ function getContentBlocks() {
source: "package>links>link",
paragraphElement: "
",
render: (element, source) => {
- if ($(source).lenght === 0) {
+ if ($(source).length === 0) {
$("#externalLinksContainer").remove();
+ return;
}
$.each(source, (index, data) => {
const a = $("");
a.attr("href", $(data).find("url").text());
- if ($(data).find("iconclass")) {
+ if ($(data).find("iconclass").length) {
const i = $("");
i.attr("class", $(data).find("iconclass").text());
- console.log(i);
$(a).append(i);
}
$(a).append($(data).find("name").text());
$(element).append(a);
- }); //each
+ });
},
},
};
@@ -139,5 +148,5 @@ function populateContentBlocks(data, blocks, error, success) {
$("#packageInformation").hide();
error(textStatus);
},
- }); //ajax
+ });
}
diff --git a/depictions/web/js/content-blocks-screenshots.js b/depictions/web/js/content-blocks-screenshots.js
index 4da89f2e..be3f9fd0 100644
--- a/depictions/web/js/content-blocks-screenshots.js
+++ b/depictions/web/js/content-blocks-screenshots.js
@@ -1,3 +1,9 @@
+let bundleid = "";
+
+function setBundleId(id) {
+ bundleid = id;
+}
+
function getContentBlocks() {
return {
"#screenshotsList": {
@@ -7,7 +13,7 @@ function getContentBlocks() {
if ($(source).length === 0) {
$(element).append(
$(
- "The aren't any screenshots for this package
"
+ "There aren't any screenshots for this package
"
)
);
return;
@@ -43,5 +49,5 @@ function populateContentBlocks(data, blocks, error, success) {
$("#packageInformation").hide();
error(textStatus);
},
- }); //ajax
+ });
}