Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function HSMount(domNode) {
this._key = ++VRenderableN;
// this.version = 0;
this.vnode = new VText(""); // currently rendered vdom tree
this.pending = []; // pending patches, not yet applied
this.node = document.createTextNode("");
this.parentNode = domNode;
}
$img = doc.createElement('img')
if (info) {
$img.title = info.title + ' (on ' + platforms[pid] + ')'
$img.alt = emoji
$img.src = './image/' + pid + '/' + info.id + '.png'
$dd.appendChild($img)
} else {
console.log('else:', info, emoji)
}
lastIndex = regex.lastIndex
}
if (lastIndex !== value.length) {
$dd.appendChild(doc.createTextNode(value.slice(lastIndex)))
}
$output.appendChild(doc.createElement('dt')).textContent = platforms[pid]
$output.appendChild($dd)
regex.lastIndex = 0
}
for (var i = 0; i < childs.length; i++) {
var node = childs[i];
if (Array.isArray(node)) {
yoyoifyAppendChild(el, node);
continue;
}
if (typeof node === 'number' || typeof node === 'boolean' || node instanceof Date || node instanceof RegExp) {
node = node.toString();
}
if (typeof node === 'string') {
if (/^[\n\r\s]+$/.test(node)) continue;
if (el.lastChild && el.lastChild.nodeName === '#text') {
el.lastChild.nodeValue += node;
continue;
}
node = document.createTextNode(node);
}
if (node && node.nodeType) {
el.appendChild(node);
}
}
};
}, {}] }, {}, [3]);
}
if (typeof node === 'number' ||
typeof node === 'boolean' ||
typeof node === 'function' ||
node instanceof Date ||
node instanceof RegExp) {
node = node.toString()
}
if (typeof node === 'string') {
if (el.lastChild && el.lastChild.nodeName === '#text') {
el.lastChild.nodeValue += node
continue
}
node = document.createTextNode(node)
}
if (node && node.nodeType) {
el.appendChild(node)
}
}
}
appendChild(children)
HSComponent.prototype.init = function() {
var n = document.createTextNode('');
if(this.vnode !== this.initialVnode) {
var thunks = [];
var p = diff(this.initialVnode, this.vnode, thunks);
if(thunks.length !== 0) {
throw new Error("HSComponent vnode contains unevaluated thunks");
}
n = vdomPatch(n, p);
}
var m = new HSComponentMount(n);
n._key = m._key;
n._widget = this;
this.mounts[m._key] = m;
if(this.hsMount) {
h$vdomMountComponentCallback(this.hsMount, m._key, this);
}
return n;
return fontFaces.resolveAll().then((cssText) => {
const styleNode = document.createElement('style');
node.appendChild(styleNode);
styleNode.appendChild(document.createTextNode(cssText));
return node;
});
}
function renderObserv(jsonml) {
jsonml = normalize(jsonml)
if (jsonml === null) {
return null
} else if (typeof jsonml === "string") {
return document.createTextNode(jsonml)
} else if (!!jsonml && typeof jsonml.raw === "string") {
return element(jsonml.raw)
} else if (!!jsonml && Array.isArray(jsonml.fragment)) {
var frag = document.createDocumentFragment()
jsonml.fragment.forEach(function (child) {
frag.appendChild(renderObserv(child))
})
return frag
} else if (typeof jsonml === "function") {
var elem = renderObserv(jsonml())
var elems = []
if (elem === null) {
elem = placeholder()
}
function placeholder() {
return document.createTextNode("")
}
button.style.padding = '6px 10px';
button.style.cursor = 'pointer';
button.style.borderRadius = '3px';
button.style.boxShadow = 'rgba(255, 255, 255, 0.2) 4px 3px 1px inset, rgba(0, 0, 0, 0.4) 2px 2px 3px';
button.style.fontWeight = 'bold';
button.style.fontSize = '42px';
button.style.color = '#FFF';
button.style.textShadow = '0 -1px 0px #000';
button.style.background = '#995CA3';
button.style.position = 'absolute';
button.style.left = '25%';
button.style.top = '30%';
button.style.width = '50%';
button.style.height = '40%';
var buttonText = document.createTextNode('Open Tungsten.js Debugger');
button.appendChild(buttonText);
overlay.appendChild(button);
document.body.appendChild(overlay);
utils.addEventListener(button, 'click', function() {
launchDebugger();
});
utils.addEventListener(overlay, 'click', function() {
document.body.removeChild(overlay);
});
}
};