After recent changes (I101c1e84739a2ac1f562f2f7bdc4b8f53d9f3b23 and
Ifbde590ccb6bf3203a2f664cb0d8a73b8d507b78) these methods became
basically the same.
Change-Id: Iedc201e798a5a34713296b20b97ae6cc8b991b66
ApiDiscussionToolsPageInfo and ApiDiscussionToolsCompare in direct parsoid
or VRS modes tries to fetch HTML using VisualEditor thus stashing the
HTML gotten which we don't want, we only need it for viewing in these cases.
This seems like something that was/is already happening in RESTBase. So for
APIs in DiscussionTools that need the HTML for viewing, just get it from
parser cache and not stash it.
Bug: T323357
Change-Id: I101c1e84739a2ac1f562f2f7bdc4b8f53d9f3b23
Ideally this would just not run the hook for any interface messages, but
that condition isn't obviously available.
Bug: T316175
Change-Id: Ibd354eb7a0fb7a316dcbf09e64b80f2d9b4008c8
(Also fix some related CSS that was accidentally moved in
Ie5198e902ec3fa7a7eba56cef6c6f0ef71ef7314)
Bug: T323241
Change-Id: I1fa67965a1b6b827c500a9de63f5b5295bee840d
When a comment almost exactly matches the range of an
accidental complex transclusion consisting only of
pages from the 'Template' namespace and wikitext fragments,
I think we can safely allow replying to the comment.
Even if this turns out to be incorrect in some cases,
the failure will be more graceful after the changes in T313100:
instead of potentially duplicating contents from a template,
the worst case now is that the reply will appear in the wrong
place (at the end of the transclusion).
Bug: T313093
Change-Id: Ie8da09d74a652d893fd8c3e2435ef6cb70fad64a
We wrap a `<div>` tag around the `<h2>`, and move some elements there.
The markup is inspired by and compatible with my proposal for T13555.
The "ext-discussiontools-init-section" class is moved to the `<div>`.
A small patch is needed in MobileFrontend to preserve the section
collapsing functionality: I11bff21e81046898ca63f3f432797129fa70ad88.
The following elements are now outside of `<h2>`:
* Metadata bar
* Subscribe button
* Ellipsis menu (only shown on mobile)
The following elements are sadly still inside of `<h2>`:
* Subscribe links (only shown on desktop)
* Section edit links from MediaWiki core
Trying to move them mucks up the CSS too much. I hope we can resolve
this later as a part of the work on T13555.
Depends-On: I11bff21e81046898ca63f3f432797129fa70ad88
Bug: T314714
Change-Id: I0bbdcfa02c334858737855349d7a35746de1d8f2
Use revision IDs to break the tie, consistently with MediaWiki (see
RevisionStore::getRelativeRevision) instead of assuming that the
revision we're processing now is somehow both older *and* newer than
the other one (the mind boggles how that ever made sense to me).
Change-Id: I9f1a07124301a36be68578d908353b72f0442c00
isFeatureEnabledForOutput already checks if the mobile flag is enabled,
but it also respects the dtenable=1 override.
Change-Id: I95035281bf301b22c1a9ef4c06ec54cdd0cbc85c
We originally used 'templates' because it seemed like an obvious
choice for HTML files, and because 'packageFiles' requires extra code
to include anything that isn't a .js or .json file.
However, the templates are expected to be HTML fragments rather than
whole documents, and they are parsed in a particular way that takes a
lot of code to clean up (which we needed to do, because we use the
same test files for testing PHP code).
I tried doing it in the 'packageFiles' way, and the extra code doesn't
seem that bad in comparison after all. Moreover, the 'templates'
mechanism (when used the intended way) feels vaguely deprecated in
favor of Vue.js, and I'd rather move away from it.
This makes the tests faster too (probably mostly thanks to the removal
of the clean up code) – on my machine they go from 1800ms to 1500ms.
(Simplify linearWalk tests, as we no longer need to do weird things
with document fragments to get consistent outputs in PHP and JS.)
Change-Id: I39f9b994ce5636d70fea2e935a7c87c7d56dcb26
Part of my secret plan to delete ApiParsoidTrait.
* Inject RevisionLookup into ApiVisualEditor
* Use RevisionLookup::getRevisionById instead of ApiParsoidTrait::getValidRevision
* Use RevisionLookup::getRevisionByTitle instead of ApiParsoidTrait::getLatestRevision
* Use standard MediaWiki error messages
Change-Id: I7244ee4916fb011fad5faa1d9f837e83f6ac2dc1
Follow-up to I8cf8b6960533718646189263acabc852ea976416, where the ...
was unintendedly removed.
Also switch to a suppression, because the type should be documented in
ParsoidClient, rather than enforced in callers. We will remove the
suppression once the documentation is updated.
Change-Id: I3ee2534959c8375d29f43e8391894f0a2002ae1c
Follow-up to d0126ce6de which made them
default-on for all mobile. These two taken together mean that the
mobile visual enhancement features now *only* depend on this config,
rather than on whether the individual features are enabled on desktop.
Bug: T318871
Change-Id: If767753e6d33f19bbc540d4e74273e478198388c
The GlobalPreferences extension would remove disabled fields from
the form, avoid referring to it in the disable-if param.
Bug: T317526
Change-Id: I6ec177a1f20855c90eb4ea17bb6625c75e5b9617
We can't use these is class method function signatures, but we
can use within the functions themselves.
Change-Id: Ic24e47d6647226172a3bfacd81398d26143d98e4
Will fallback to MainConfig gotten from services in VisualEditor.
VE will remove this complete soon.
Depends-On: I787c0afb227308aab56770d14d62e08eb0084a6c
Change-Id: I4b9e7362a1bf1b4f224c8c652d40851a18c19824
* Make "X comments" appear on a new line deliberately
* Remove parentheses around "X comments"
Bug: T309463
Change-Id: I803eee9db59c633f129f15e436242a12bcc627f0
getVal/getText can be expensive because they do Unicode normalization.
We can skip this when we know we aren't going to do anything meaningful
with the value anyway.
Change-Id: I9d939a44df6b67bcd8429096d89600ce1566ca39
The config is currently unused in some classes, but this is okay since
it might be used in the future.
Change-Id: Ie25fc52cc5d3476c9445e182975d229991316bd3
The implementation in Parser doesn't descend into sub-thread.
Re-use the getThreadSummary method in ThreadItem and traverse
the thread properly.
Bug: T298617
Change-Id: I318d9012eb83f37ccbe463923524ef2e9f995ced
This changes a vast number of test expected-outputs because it affects
the order of the keys when serialized.
Bug: T315400
Change-Id: I6ad2cded6ba7cb2cc5e5ba37ea60f4b18ecc26be