Allows us to remove action lists identical to the parent,
and also the default this.actions.setMode call.
Rename #canApply to #isModified for consistency.
Change-Id: I026feb291cd64474557d1f9df30604a7bbbb0bd2
There are multiple formats for these IDs:
cite_ref-1, cite_ref-2, and so on for anonymous <ref>s without a name.
cite_ref-name_1-0 for named references, where "name" is the custom name,
and "_1" is the sequential number for the reference (same number as above).
The final "-0" is counting the usages. If a named <ref> is only used once,
there is no cite_ref-name_1-1 anywhere on the page.
The later was already checked by the code. But we forgot about unnamed
references! As a consequence IDs like the cite_ref-1 above got misdetected
as reused references.
This patch tries hard to extract code into named functions, so it becomes
much more clear what they do, and why.
Bug: T215317
Change-Id: Iedb5b0c3dffae19bad7df9a43ed2d4512b3921ec
As far as I can tell the effect of this is almost zero, because in both
cases the unescaped ID ends in double quotes. Within these double quotes
not many characters must be escaped, essentially only double quotes and
backslashes. Neither can appear in an ID (more precisely: neither should).
Proper escaping is "the right thing to do" anyway.
Change-Id: I21934f7cb54e2d68013a994150a92c76ef1b61d7
We generate stub MWCitationDialog sub-classes for each citation
type, e.g. cite-web, cite-news. The only override these sub-classes
provide is for the dialog title, providing "Website" instead of
"Cite web", however because of code in MWTemplateDialog, this override
isn't even used.
1. Make the 'citation' dialog (now 'cite') concrete by registering
it, and allow a 'title' argument to be passed it.
2. Actually override the title, using the passed in argument.
3. Remove the stub generated citation dialogs.
This will also fix our tracking data. Current we are getting
window-open actions with the argument being a localised citation
type name, e.g. cite-Literatur, cite-אתר.
These will now all be tracked as 'cite' as we use the parent dialog.
Bug: T216248
Depends-On: I355e7fe4c2ea965f2ca91f0ab0430cfb95e56e0a
Change-Id: I661707b5f9d3d810e9391ad63bef546d4fcb29e4
* Show the warning in the context menu (on desktop only) in addition
to the reference dialog.
* Add more details to the warning in reference dialog, and adjust
spacing around it to make it more noticeable.
Bug: T208981
Bug: T212609
Depends-On: I6ca605ddd580d6259952c8799ecdca08da07474a
Change-Id: I23cc02f651c15b3276613d32a0c2537032f731c2
This ensures that each repository's "npm test" command is fully
independent of wherever it might be in the filesystem.
Bug: T206485
Change-Id: I54d052bed4ceed175a938896154fd6ad5c89f964
We can resolve this bug by either replacing the bogus "return false"
with the intended "return [ false, … ]". Or rely on the code a few
lines below that also bails out with a "return [ false, … ]" when to
many parameters ($cnt is not 0 then) are present. The tests prove both
solutions are equally valid.
Bug: T211576
Change-Id: Iadd55c134dede7042cfd152c69bc8f27b59d8912
The biggest issue with this code was that it was tracking the exact
same state in two ways: Processed array elements got removed from the
$argv array, *and* the $cnt was decremented the same time. This is not
necessary and a potential source of confusion and errors.
I carefully transformed the code. I'm sure it still does exactly what
it did before. The tests should prove this.
Change-Id: I642d38e7944aa3e2239179fa58e1e231b4698263