mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
format: run prettify
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import stringToHTML from "../stringToHTML"
|
||||
import stringToHTML from "../stringToHTML";
|
||||
|
||||
export function CreateCustomShortcutDiv(element: any) {
|
||||
// Creates the stucture and element information for each seperate shortcut
|
||||
var shortcut = document.createElement("a")
|
||||
shortcut.setAttribute("href", element.url)
|
||||
shortcut.setAttribute("target", "_blank")
|
||||
var shortcutdiv = document.createElement("div")
|
||||
shortcutdiv.classList.add("shortcut")
|
||||
shortcutdiv.classList.add("customshortcut")
|
||||
var shortcut = document.createElement("a");
|
||||
shortcut.setAttribute("href", element.url);
|
||||
shortcut.setAttribute("target", "_blank");
|
||||
var shortcutdiv = document.createElement("div");
|
||||
shortcutdiv.classList.add("shortcut");
|
||||
shortcutdiv.classList.add("customshortcut");
|
||||
|
||||
let image = stringToHTML(
|
||||
`
|
||||
@@ -25,13 +25,13 @@ export function CreateCustomShortcutDiv(element: any) {
|
||||
</text>
|
||||
</svg>
|
||||
`,
|
||||
).firstChild
|
||||
;(image as HTMLElement).classList.add("shortcuticondiv")
|
||||
var text = document.createElement("p")
|
||||
text.textContent = element.name
|
||||
shortcutdiv.append(image!)
|
||||
shortcutdiv.append(text)
|
||||
shortcut.append(shortcutdiv)
|
||||
).firstChild;
|
||||
(image as HTMLElement).classList.add("shortcuticondiv");
|
||||
var text = document.createElement("p");
|
||||
text.textContent = element.name;
|
||||
shortcutdiv.append(image!);
|
||||
shortcutdiv.append(text);
|
||||
shortcut.append(shortcutdiv);
|
||||
|
||||
document.getElementById("shortcuts")!.append(shortcut)
|
||||
}
|
||||
document.getElementById("shortcuts")!.append(shortcut);
|
||||
}
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
export function CreateElement(
|
||||
type: string,
|
||||
class_?: any,
|
||||
id?: any,
|
||||
innerText?: string,
|
||||
innerHTML?: string,
|
||||
style?: string,
|
||||
) {
|
||||
let element = document.createElement(type)
|
||||
if (class_ !== undefined) {
|
||||
element.classList.add(class_)
|
||||
}
|
||||
if (id !== undefined) {
|
||||
element.id = id
|
||||
}
|
||||
if (innerText !== undefined) {
|
||||
element.innerText = innerText
|
||||
}
|
||||
if (innerHTML !== undefined) {
|
||||
element.innerHTML = innerHTML
|
||||
}
|
||||
if (style !== undefined) {
|
||||
element.style.cssText = style
|
||||
}
|
||||
return element
|
||||
}
|
||||
type: string,
|
||||
class_?: any,
|
||||
id?: any,
|
||||
innerText?: string,
|
||||
innerHTML?: string,
|
||||
style?: string,
|
||||
) {
|
||||
let element = document.createElement(type);
|
||||
if (class_ !== undefined) {
|
||||
element.classList.add(class_);
|
||||
}
|
||||
if (id !== undefined) {
|
||||
element.id = id;
|
||||
}
|
||||
if (innerText !== undefined) {
|
||||
element.innerText = innerText;
|
||||
}
|
||||
if (innerHTML !== undefined) {
|
||||
element.innerHTML = innerHTML;
|
||||
}
|
||||
if (style !== undefined) {
|
||||
element.style.cssText = style;
|
||||
}
|
||||
return element;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user