Merge branch 'extensionstore' of https://github.com/sirjonasxx/G-Earth into extensionstore

This commit is contained in:
sirjonasxx 2021-08-20 21:15:00 +02:00
commit 4e3fdda5a9
2 changed files with 6 additions and 4 deletions

View File

@ -51,7 +51,7 @@ public class StoreExtensionItem implements ContentItem {
.append("<div class=\"overview_item ").append(displayColor(i)).append(" content_item\">") .append("<div class=\"overview_item ").append(displayColor(i)).append(" content_item\">")
.append("<div class=\"overview_item_logo\">") .append("<div class=\"overview_item_logo\">")
.append("<img src=\"").append(repository.getResourceUrl("store", "extensions", storeExtension.getTitle(), "icon.png")).append("\" alt=\"\">") .append("<img src=\"").append(repository.getResourceUrl("store", "extensions", storeExtension.getTitle(), "icon.png")).append("\" alt=\"\" onerror=\"this.src=").append(repository.getResourceUrl("assets", "icons", "placeholder.png")).append("\">")
.append("</div>") .append("</div>")
.append("<div class=\"overview_item_info\">") .append("<div class=\"overview_item_info\">")

View File

@ -65,8 +65,10 @@ public class StoreExtensionDetailsItem implements ContentItem {
contentBuilder.append("Warning: this extension has been marked unstable!\n\n"); contentBuilder.append("Warning: this extension has been marked unstable!\n\n");
} }
contentBuilder.append("\n*Screenshot: *").append("\n") contentBuilder.append("<div>"
.append("--img:").append(gExtensionStore.getRepository().getResourceUrl("store", "extensions", storeExtension.getTitle(), "screenshot.png")); .append("\n*Screenshot: *").append("\n")
.append("--img:").append(gExtensionStore.getRepository().getResourceUrl("store", "extensions", storeExtension.getTitle(), "screenshot.png"))
.append("</div>");
return contentBuilder.toString(); return contentBuilder.toString();
} }
@ -106,7 +108,7 @@ public class StoreExtensionDetailsItem implements ContentItem {
line = line.replaceAll("\\*([^*]*)\\*", "<b>$1</b>") line = line.replaceAll("\\*([^*]*)\\*", "<b>$1</b>")
.replaceAll("_([^_<>]*)_", "<i>$1</i>") .replaceAll("_([^_<>]*)_", "<i>$1</i>")
.replaceAll("(^| |>)@([^ <>]*)($| |<)", "$1<u>$2</u>$3") .replaceAll("(^| |>)@([^ <>]*)($| |<)", "$1<u>$2</u>$3")
.replaceAll("--img:([^ ]*)", "<img src=\"$1\" alt=\"extension screenshot\">") .replaceAll("--img:([^ ]*)", "<img src=\"$1\" alt=\"extension screenshot\" onerror=\"this.parentNode.remove()\">")
.replaceAll("--url:([^-]*)-(https?:[^ ]*)", .replaceAll("--url:([^-]*)-(https?:[^ ]*)",
String.format("<a href=\"#\" onClick=\"%s.openUrl(&quot;$2&quot;)\">$1</a>", id)); String.format("<a href=\"#\" onClick=\"%s.openUrl(&quot;$2&quot;)\">$1</a>", id));
// .replaceAll("([^\";])(https?:[^ ]*)", // .replaceAll("([^\";])(https?:[^ ]*)",