1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-17 03:20:53 +00:00

The In-Line Actions Update

* Add extensible actions system.
* Add extensive UI for configuring the actions system.
* Add setting to disable channel hosting.
* Fix the stupid Rooms thing popping up every time you open a channel.
* Fix how we grab chat types from React.
* Refactor how we handle incoming chat messages.
* Add a hook for outgoing chat messages.
* Fix emoji appearing squished with baseline emote alignment.
* Display arrows on balloons.
* Fix an issue generating emoji URLs.
* Do not use the default values for settings with merge strategies if profiles have those settings, just empty.
* Display a message in the chat settings menu if we tried opening FFZ's settings and failed.
* Wait a bit for webpack's loader if it's not immediately there for some reason.
* Probably other stuff.
* Not mod cards. Yet.
This commit is contained in:
SirStendec 2018-04-28 17:56:03 -04:00
parent e9214bb46a
commit fdde05030f
67 changed files with 7689 additions and 226 deletions

View file

@ -91,14 +91,25 @@ export function createElement(tag, props, ...children) {
return el;
}
export function setChildren(el, children, no_sanitize) {
export function setChildren(el, children, no_sanitize, no_empty) {
if ( typeof children === 'string' ) {
if ( no_sanitize )
el.innerHTML = children;
else
el.textContent = children;
if ( no_empty ) {
el.appendChild(no_sanitize ?
range.createContextualFragment(children) :
document.createTextNode(children)
)
} else {
if ( no_sanitize )
el.innerHTML = children;
else
el.textContent = children;
}
} else if ( Array.isArray(children) ) {
if ( ! no_empty )
el.innerHTML = '';
for(const child of children)
if ( typeof child === 'string' )
el.appendChild(no_sanitize ?
@ -106,11 +117,18 @@ export function setChildren(el, children, no_sanitize) {
document.createTextNode(child)
);
else if ( Array.isArray(child) )
setChildren(el, child, no_sanitize, true);
else if ( child )
el.appendChild(child);
} else if ( children )
} else if ( children ) {
if ( ! no_empty )
el.innerHTML = '';
el.appendChild(children);
}
}