Commit graph

7 commits

Author SHA1 Message Date
Bartosz Dziewoński 3896babde3 Improve comment ruler drawing in debug mode when indentation is weird
Ignore the horizontal position of the comments' bounding boxes entirely.
It can be crazy because of de-indentation in the middle of the comment,
and even just text formatting with padding/margins (e.g. `<code>`) can
make it look weird. Just draw the rulers based on detected indentation.

Change-Id: Id4e5edf076d44bdedfb45958260d797daea29ed1
2020-02-11 02:32:32 +01:00
Bartosz Dziewoński a491e3aaac Rename the lines denoting child comments in debug mode to "rulers"
I got tired of typing "relationship".

Change-Id: I318bdd1c049d7ab7fdeb1512a083cf8f4121d598
2020-02-10 22:14:38 +01:00
Bartosz Dziewoński e5e6fdd3af Stop using native Range objects, they're too annoying
Native Range objects are automatically updated when the DOM elements
they refer to are affected (e.g. detached from the DOM, or their offset
changes because of siblings being added/removed).

This seemed harmless or maybe even slightly useful, but it turns out
it conflicts with VisualEditor, which has to wrap the entire page in a
new DOM node when it opens (and unwrap it when it closes), effectively
temporarily detaching it from the DOM, which destroys all our ranges.

Just use a plain object that stores the same data as a Range. And when
we need to use Range's API, we can simply construct a temporary one.

Bug: T241861
Change-Id: Iee64aa3d667877265ef8a59293c202e6478d7fb6
2020-02-05 19:42:03 +01:00
Bartosz Dziewoński e29b8173bf Handle comments before first section heading
The loop in parser.js assumed that there was always a heading before
any comments (not counting the page title, only section headings).

Bug: T243869
Change-Id: I3a0bb06716e75d4a17e25c40748673a071ee5f30
2020-01-30 00:14:46 -08:00
Bartosz Dziewoński 37c9f49cff Re-add debug highlighter
We removed it in c40c112514 when we added
a more practical use for the parser, but I keep wishing I had it to
experiment with the parser code.

Now it's off by default and can be used by adding &dtdebug=1 to the URL.

Change-Id: I6a92bfe7f55af0949b391606b04c3cfa0f996f2a
2019-10-24 23:21:40 +02:00
Ed Sanders c40c112514 Create simple reply widget demo
Change-Id: I03a98495364babf1b80bf64121efb09097ebe85a
2019-10-20 16:51:07 +00:00
Bartosz Dziewoński b105bf7ded Detect and parse timestamps, signatures, comments and threads
Bug: T232780
Bug: T234404
Change-Id: Ie9c80121089742cfc7cd7c04d694c2e0fe8d6a98
2019-10-18 13:59:07 +02:00