@vivocha/public-entities
Advanced tools
Comparing version 5.9.17 to 5.9.18
@@ -36,1 +36,2 @@ import { Asset, WidgetManifest, WidgetSettings, WidgetInstance } from '../widget'; | ||
} | ||
export declare function innerScript(container: HTMLElement): void; |
@@ -138,2 +138,23 @@ "use strict"; | ||
exports.WidgetInstanceWrapper = WidgetInstanceWrapper; | ||
function innerScript(container) { | ||
let scripts = []; | ||
for (let i = 0; i < container.childNodes.length; i++) { | ||
let elem = container.childNodes[i]; | ||
if (elem.nodeName && elem.nodeName.toLowerCase() === "script" && (!elem.type || elem.type.toLowerCase() === "text/javascript")) { | ||
scripts.push(elem); | ||
} | ||
} | ||
for (let i = 0; i < scripts.length; i++) { | ||
let elem = scripts[i]; | ||
const script = document.createElement('script'); | ||
let attrs = elem.attributes; | ||
for (let j = 0; j < attrs.length; j++) { | ||
script.setAttribute(attrs[j].name, attrs[j].value); | ||
} | ||
script.appendChild(document.createTextNode(elem.text || elem.textContent || elem.innerHTML || "")); | ||
container.insertBefore(script, elem); | ||
container.removeChild(elem); | ||
} | ||
} | ||
exports.innerScript = innerScript; | ||
//# sourceMappingURL=widget.js.map |
{ | ||
"name": "@vivocha/public-entities", | ||
"version": "5.9.17", | ||
"version": "5.9.18", | ||
"description": "Vivocha public entities and types", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22475
655