# Random Notes

## WebUI

The WebUI is built on a 'single page application' framework called [Ext JS](https://www.sencha.com/products/extjs/).  The version used appears to be 3.4.1.1 which, is considerably outdated (released circa 2009-2011).

A link to the Ext JS documentation can be found here: <https://cdn.sencha.com/ext/gpl/3.4.1.1/docs/>

The WebUI appears to be heavily dependent upon the internal `idnode` structures that not only supply the data to the WebUI via JSON, but also data type and formatting information.  See the [JSON Documentation](/documentation/development/json-api.md) for more details.

Each page or group of pages in the WebUI has its own JavaScript file, however, these normally contain just some setup and housekeeping functions specific to that area, all of the heaving lifting is done in `idnode.js` and  `tvheadend.js` based on the idnode(s) in question.

## Red Black Trees

Internally, TVH stores many objects in Red-Black tree structures rather than arrays.  There are a number of preprocessor macros to support this.  All of these macros are named `RB_fn`, for example, `RB_FOREACH`.\
\
<https://github.com/tvheadend/tvheadend/blob/master/src/redblack.h>\
<https://en.wikipedia.org/wiki/Red%E2%80%93black_tree>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tvheadend.org/documentation/development/random-notes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
