use of elemental2.dom.HTMLMetaElement in project nalu by NaluKit.
the class NaluPluginElemento method updateMetaPropertyContent.
@Override
public void updateMetaPropertyContent(String property, String content) {
NodeList<Element> metaTagList = DomGlobal.document.getElementsByTagName("meta");
for (int i = 0; i < metaTagList.length; i++) {
if (metaTagList.item(i) instanceof HTMLMetaElement) {
HTMLMetaElement nodeListElement = (HTMLMetaElement) metaTagList.item(i);
if (!Objects.isNull(nodeListElement.getAttribute("property"))) {
if (nodeListElement.getAttribute("property").equals(property)) {
nodeListElement.remove();
break;
}
}
}
}
HTMLMetaElement metaElement = (HTMLMetaElement) DomGlobal.document.createElement("meta");
metaElement.setAttribute("property", property);
metaElement.content = content;
DomGlobal.document.head.appendChild(metaElement);
}
use of elemental2.dom.HTMLMetaElement in project nalu by NaluKit.
the class NaluPluginElemental2 method updateMetaPropertyContent.
@Override
public void updateMetaPropertyContent(String property, String content) {
NodeList<Element> metaTagList = DomGlobal.document.getElementsByTagName("meta");
for (int i = 0; i < metaTagList.length; i++) {
if (metaTagList.item(i) instanceof HTMLMetaElement) {
HTMLMetaElement nodeListElement = (HTMLMetaElement) metaTagList.item(i);
if (!Objects.isNull(nodeListElement.getAttribute("property"))) {
if (nodeListElement.getAttribute("property").equals(property)) {
nodeListElement.remove();
break;
}
}
}
}
HTMLMetaElement metaElement = (HTMLMetaElement) DomGlobal.document.createElement("meta");
metaElement.setAttribute("property", property);
metaElement.content = content;
DomGlobal.document.head.appendChild(metaElement);
}
use of elemental2.dom.HTMLMetaElement in project nalu by NaluKit.
the class NaluPluginElemental2 method updateMetaNameContent.
@Override
public void updateMetaNameContent(String name, String content) {
NodeList<Element> metaTagList = DomGlobal.document.getElementsByTagName("meta");
for (int i = 0; i < metaTagList.length; i++) {
if (metaTagList.item(i) instanceof HTMLMetaElement) {
HTMLMetaElement nodeListElement = (HTMLMetaElement) metaTagList.item(i);
if (!Objects.isNull(nodeListElement.name)) {
if (nodeListElement.name.equals(name)) {
nodeListElement.remove();
break;
}
}
}
}
HTMLMetaElement metaTagElement = (HTMLMetaElement) DomGlobal.document.createElement("meta");
metaTagElement.name = name;
metaTagElement.content = content;
DomGlobal.document.head.appendChild(metaTagElement);
}
use of elemental2.dom.HTMLMetaElement in project nalu by NaluKit.
the class NaluPluginElemento method updateMetaNameContent.
@Override
public void updateMetaNameContent(String name, String content) {
NodeList<Element> metaTagList = DomGlobal.document.getElementsByTagName("meta");
for (int i = 0; i < metaTagList.length; i++) {
if (metaTagList.item(i) instanceof HTMLMetaElement) {
HTMLMetaElement nodeListElement = (HTMLMetaElement) metaTagList.item(i);
if (!Objects.isNull(nodeListElement.name)) {
if (nodeListElement.name.equals(name)) {
nodeListElement.remove();
break;
}
}
}
}
HTMLMetaElement metaTagElement = (HTMLMetaElement) DomGlobal.document.createElement("meta");
metaTagElement.name = name;
metaTagElement.content = content;
DomGlobal.document.head.appendChild(metaTagElement);
}
Aggregations