This commit prepares the frontend code to be consumed by webpack.
It is a hack: In theory, modules should be declaring and importing the
modules they depend on and the globals they expose directly.
However, that requires significant per-module work, which we don't
really want to block moving our toolchain to webpack on.
So we expose the modules by setting window.varName = varName; as
needed in the js files.
This is preparation for enabling an eslint indentation configuration.
90% of these changes are just fixes for indentation errors that have
snuck into the codebase over the years; the others are more
significant reformatting to make eslint happy (that are not otherwise
actually improvements).
The one area that we do not attempt to work on here is the
"switch/case" indentation.
When a `data-sort` is clicked in the body, it will trigger an attempt
to find the closest `list_render` instance, retrieve it from memory,
and then sort by the particular method specified.
This allows for someone to specify a generic sorting function which
accepts a prop to sort by, a sorting function which runs with just a
function on the whole object, and the ability to remove the sorting
function in play.
This adds perfectScrollbar to the default streams table
because it currently is inside another perfectScrollbar which
actually makes it impossible to scroll the table normally without
enabling the perfectScrollbar library on this.
Fixes: #6391.
Using weird characters when filtering options items in these various
settings pages would throw exceptions whenever they didn't form a
valid regular expression.