fixes for R5 redirector

This commit is contained in:
Grahame Grieve 2023-05-07 07:14:44 -05:00
parent d35b881cf1
commit c5f5689714
2 changed files with 30 additions and 1 deletions

View File

@ -580,7 +580,7 @@ public class NpmPackage {
for (NpmPackageFolder folder : folders.values()) {
if (folder.index != null) {
for (JsonObject fi : folder.index.getJsonObjects("files")) {
if (Utilities.existsInList(fi.asString("resourceType"), types)) {
if (Utilities.existsInList(fi.asString("resourceType"), types) || types.isEmpty()) {
res.add(new PackageResourceInformation(folder.folder == null ? "@"+folder.getName() : folder.folder.getAbsolutePath(), fi));
}
}

View File

@ -837,4 +837,33 @@ public class XhtmlNode extends XhtmlFluent implements IBaseXhtml {
return false;
}
public XhtmlNode getElementById(String id) {
if (id.equals(getAttribute("id"))) {
return this;
}
if (childNodes != null) {
for (XhtmlNode x : childNodes) {
XhtmlNode r = x.getElementById(id);
if (r != null) {
return r;
}
}
}
return null;
}
public List<XhtmlNode> getChildren(String name) {
List<XhtmlNode> res = new ArrayList<>();
XhtmlNode x = getFirstElement();
while (x != null) {
if (name.equals(x.getName())) {
res.add(x);
}
x = getNextElement(x);
}
return res;
}
}