hgweb: rename linerangelog.js as followlines.js
So that the file name matches both the feature name and user facing vocabulary
(e.g. the revset function).
hgweb: rely on a specific class to change cursor type in followlines UI
The previous CSS rule would also apply in pages where followlines UI was not
available (e.g. "changeset" view at /rev/<node>/). We insert a
"followlines-select" class in JavaScript on actually selectable lines and
restrict the CSS selector to use it.
hgweb: use a function expression for the install listener of followlines UI
We define the listener of document's "DOMContentLoaded" inline in registration
and use a function expression (anonymous) with everything inside. This makes
it clearer that this file is not a library of JavaScript functions but rather
an executable script.
(Most of changes consists of reindenting the "followlinesBox" function, so
mostly white space changes.)
formatter: use templatefilters.json()
Now _jsonifyobj() is identical to templatefilters.json(paranoid=False).
templatefilters: use list comprehension in json()
Not important, but the code slightly looks better.
templatefilters: unroll handling of None/False/True
It doesn't make sense to use a dict here.
templatefilters: drop callable support from json()
This backs out
ae5447de4c11. A callable should be evaluated beforehand
by templater.runsymbol().
ui: use bytes IO and convert EOL manually in ui.editor()
Text IO sucks on Python 3 as it must be a unicode stream. We could introduce
a wrapper that converts unicode back to bytes, but it wouldn't be simple to
handle offsets transparently from/to underlying IOBase API.
Fortunately, we don't need to process huge text files, so let's stick to
bytes IO and convert EOL in memory.
util: add helper to convert between LF and native EOL
See the next patch for why.