1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-30 10:42:41 +01:00
phorge-phorge/webroot/rsrc/js/application
epriestley e8126fa958 Don't mangle inline comments with tables in them in Differential
Summary:
Fixes T3814. Broadly, remarkup tables in inline comments did not work properly. I ran into several messes here and cleaned up some of them:

  - Some of this code is doing `JX.$N('div', {}, JX.$H(response.markup))`, to turn an HTML response into a node, passing that around, and then doing junk with it. This is super old and gross.
    - The slightly more modern pattern is `JX.$H(response.markup).getFragment().firstChild`, but this is kind of yuck too and not as safe as it could be.
    - Introduce `JX.$H(response.markup).getNode()`, which actually expresses intent here. We have a bunch of `getFragment().firstChild` callsites which should switch to this, but I didn't clean those up yet because I don't want to test them all.
    - Switch the `JX.$N('div', {}, JX.$H(response.markup))`-style callsites to `JX.$H(response.markup).getNode()`.
  - `copyRows()` is too aggressive in finding `<tr />` tags. This actually causes the bug in T3814. We only want to find these tags at top level, not all tags. Don't copy `<tr />` tags which belong to some deeper table.
  - Once this is fixed, there's another bug with mousing over the cells in tables in inline comments. We select the nearest `<td />`, but that's the cell in the remarkup table. Instead, select the correct `<td />`.
  - At this point, these last two callsites were looking ugly. I provided `findAbove()` to clean them up.

Test Plan: Created, edited, deleted, moused over, and reloaded a revision with inline comments including remarkup tables. Used "Show more context" links.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3814

Differential Revision: https://secure.phabricator.com/D6924
2013-09-10 15:31:32 -07:00
..
aphlict Allow only one global top menu to be open at a time 2013-08-13 14:57:52 -07:00
config Allow custom fields to be reordered and disabled from Config 2013-07-09 08:27:19 -07:00
conpherence Conpherence - fix some ajax bugs 2013-06-11 15:07:53 -10:00
countdown Modernize Countdown somewhat 2013-07-23 06:16:19 -07:00
differential Don't mangle inline comments with tables in them in Differential 2013-09-10 15:31:32 -07:00
diffusion Line highlighting for pastes 2013-08-04 12:12:37 -07:00
doorkeeper Add remarkup support for Asana URIs 2013-06-24 15:55:08 -07:00
herald Update form styles, implement in many places 2013-05-07 14:07:06 -07:00
maniphest Move PhabricatorObjectItem to PHUIObjectItem, add 'plain' setting for lists. 2013-09-09 14:14:34 -07:00
owners Allow excluding paths from package 2012-12-07 16:33:16 -08:00
phame Use JsShrink if jsxmin is not available 2013-05-18 17:04:22 -07:00
pholio Pholio - back end for image re-ordering 2013-08-12 13:09:07 -07:00
phortune Allow PhortuneTestProvider to add payment methods 2013-04-25 09:50:08 -07:00
ponder Use PHUIRemarkupPreviewPanel in Ponder 2013-08-05 10:47:06 -07:00
projects Allow commits to be associated with projects and associated goodies 2012-08-08 10:03:41 -07:00
releeph Use JsShrink if jsxmin is not available 2013-05-18 17:04:22 -07:00
repository Removed getElementsByClassName in repositor-crossreference.js 2013-05-12 06:54:15 -07:00
search Simplify drag-and-drop list implementations 2013-06-05 17:36:33 -07:00
slowvote Use JsShrink if jsxmin is not available 2013-05-18 17:04:22 -07:00
transactions Transactions - make the details stuff generic and ajaxy 2013-08-22 16:45:14 -07:00
uiexample Fix more JavelinView example stuff 2013-07-16 13:46:49 -07:00