added html and css editors
This commit is contained in:
@@ -67,6 +67,22 @@ export class BaseElement extends HTMLElement {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
findVisible(tagName: string) {
|
||||
var result = [];
|
||||
|
||||
var elements = document.getElementsByTagName(tagName);
|
||||
|
||||
for (let i = 0; i < elements.length; i++) {
|
||||
const element = <HTMLElement>elements[i];
|
||||
|
||||
if (element.style.display !== "none") {
|
||||
result.push(element);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
hasChild(element: Element, startsWidth: boolean = false): boolean {
|
||||
var ele = this;
|
||||
|
||||
@@ -8,4 +8,18 @@ export function createScript(value: string) {
|
||||
document.body.appendChild(script);
|
||||
|
||||
executeDrawQueue();
|
||||
}
|
||||
|
||||
export function createHtml(value: string) {
|
||||
var div: HTMLDivElement = document.createElement("div");
|
||||
div.innerHTML = value;
|
||||
|
||||
document.body.appendChild(div);
|
||||
}
|
||||
|
||||
export function createCss(value: string) {
|
||||
var style: HTMLStyleElement = document.createElement("style");
|
||||
style.innerHTML = value;
|
||||
|
||||
document.body.appendChild(style);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
export function messageListener(fn: (type: 'script' | 'log' | 'info' | 'warn' | 'error' | 'syntax-error' | 'time' | 'response', value: string, id: number) => void): Function {
|
||||
export function messageListener(fn: (type: 'script' | 'log' | 'info' | 'warn' | 'error' | 'syntax-error' | 'time' | 'response' | string, value: string, id: number) => void): Function {
|
||||
|
||||
var evt = function(e: any) {
|
||||
if (!e.data || e.data === '' || e.data.type === 'webpackOk') {
|
||||
|
||||
Reference in New Issue
Block a user