RichText/Archived/Rooster/Rooster.gcomp/Support/node_modules/roosterjs/dist/rooster-amd.js
/**
 * Converter for dark mode that runs all child elements of a node through the content transform function.
 * @param node The node containing HTML elements to convert.
 * @param skipRootElement Optional parameter to skip the root element of the Node passed in, if applicable.
 */
Converter for dark mode that runs all child elements of a node through the content transform function.
@param node The node containing HTML elements to convert.
@param skipRootElement Optional parameter to skip the root element of the Node passed in, if applicable.
Converter for dark mode that runs all child elements of a node through the content transform function . @param node The node containing HTML elements to convert . @param skipRootElement Optional parameter to skip the root element of the Node passed in if applicable .
function convertContentToDarkMode(node, onExternalContentTransform, skipRootElement) {
    var childElements = [];
    if (node instanceof HTMLElement) {
        childElements = Array.prototype.slice.call(node.getElementsByTagName('*'));
        if (!skipRootElement) {
            childElements.unshift(node);
        }
    }
    else if (node instanceof DocumentFragment) {
        childElements = Array.prototype.slice.call(node.querySelectorAll('*'));
    }
    return childElements.length > 0
        ? function () {
            childElements.forEach(function (element) {
                if (onExternalContentTransform) {
                    onExternalContentTransform(element);
                }
                else {
                    element.style.color = null;
                    element.style.backgroundColor = null;
                }
            });
        }
        : null;
}
function convertContentToDarkMode ( node , onExternalContentTransform , skipRootElement ) { var childElements = [ ] ; if ( node instanceof HTMLElement ) { childElements = Array . prototype . slice . call ( node . getElementsByTagName ( '*' ) ) ; if ( ! skipRootElement ) { childElements . unshift ( node ) ; } } else if ( node instanceof DocumentFragment ) { childElements = Array . prototype . slice . call ( node . querySelectorAll ( '*' ) ) ; } return childElements . length > 0 ? function ( ) { childElements . forEach ( function ( element ) { if ( onExternalContentTransform ) { onExternalContentTransform ( element ) ; } else { element . style . color = null ; element . style . backgroundColor = null ; } } ) ; } : null ; }
Converter for dark mode that runs all child elements of a node through the content transform function.
Converter for dark mode that runs all child elements of a node through the content transform function .
// Get a list of all the decendents of a node. // querySelectorAll doesn't return a live list when called on an HTMLElement // So we use getElementsByTagName instead for HTMLElement types.