Move the code that generates these wrapper nodes and attributes
from postprocessReplyTool() (only called when reply tool is enabled)
to addDiscussionToolsInternal (always called).
This undoes some changes from 31c57d594a and 980b2c38bc.
Bug: T314707
Change-Id: I07ed210375d494047670015410430c087d67f21a
It turns out that using the "enableSectionEditLinks" post-cache
transform option was not a good idea, as it is also set when viewing
old revisions and in some other cases.
However, in the pre-cache parsing, we have access to getIsPreview(),
which is exactly what we want. I think we can safely do this there.
We were already using that prior to 2bc76dabd7.
Bug: T314260
Change-Id: I7f769db48eff9fa434483902a4b5ac2f5fc96b3d
We might want to delete the code that defines it in the future.
The core message is the same in most translations, and available in
100+ more languages.
Change-Id: I230e051940fdd7b89989453eccbffac804a7ddea
Rather than setting it on both the reply link and the reply button,
set it on their parent element.
Update ReplyLinksController to handle this.
Change-Id: I650e9c0ebd354a82b8f66a63c5b4c02b2e29b105
This improves the behavior when replying to these comments
and the message snippets shown in notifications.
Bug: T313097
Change-Id: Ia10400472c9e999fa526c7437a03b72461c37b74
Add the redirect check to shouldShowNewSectionTab.
Try to run cheaper checks before more expensive ones.
Depends-On: I5755863243d8ad336ad20626f439d70eb3b31f32
Bug: T312599
Change-Id: I6848e529a2537d4058613db0c3b900bc9f4f59f8
Othercontent would often contain the opening tag of the next heading /
section. By looking for the closest node with a previousSibling we can
more-reliably escape the heading.
Also, only add the initial placeholder if there's content before the
first heading. We do this by testing for any siblings before the
startContainer of the first heading -- if there are any, assume this
means there's some sort of content. (This can still result in a
placeholder with `othercontent:""` if there's only whitespace before
the first heading.)
Bug: T313850
Change-Id: I080205b74413c46d3cf3442e79276145aaa9439c
We had different logic for the empty state on pages that exist and
those that don't. For the second case, we relied on the new topic tool
becoming unavailable in some cases, but that could cause complications
elsewhere (e.g. if the page also had a custom button to add a new
section).
The new topic tool is now available regardless of the page. Instead,
the empty state is controlled separately, by the same method in both
cases.
As far as I can tell, the effect is exactly the same as before.
Change-Id: I5b36e6f027cf76dd0e3a8ee3cb5156fe1eaac8a8
Remove hacks marked as 'TEMPORARY' now that we consider the
HTML to be stable enough.
This will avoid issues with HTML/CSS being out of sync in future deployments.
Bug: T313560
Change-Id: Ie00ff38a422f241add19d500adaf22dfeee10e8c
* clock, userAvatar, speechBubble were dropped before topic
containers was merged
* Load ellipsis & edit icons on mobile only
* Load bell & bellOutline for topic subscriptions button
Change-Id: I77d1336627b564be756e3ec50b4686b8f9ac72dc
We remove the [reply] and [subscribe] links when they should not be
visible (controlled by 'enableSectionEditLinks' option, which is
disabled when previewing).
Bug: T309423
Change-Id: Ie0d3fba2c4d166daac3ea2e117a246c9584284ca
Rename ThreadItem to ContentThreadItem, then create a new ThreadItem
interface containing only the methods that we'll be able to implement
using only the persistently stored data (no parsing), then create a
DatabaseThreadItem. Do the same for CommentItem and HeadingItem.
ThreadItemSet gets a similar treatment, but it's basically only for
Phan's type checking. (This is sad.)
Change-Id: I1633049befe8ec169753b82eb876459af1f63fe8
name and id are supposed to never be null. Calling getName() or
getId() on this object would cause an exception.
Change-Id: I5f95b7d9e4ce4550b550ee758fc86f032b676731