The same functionality is available using the 'Cite → Re-use' tool
on the toolbar (T214991).
We want to use the same location for a new 'Replace reference' button,
to be implemented in the Citoid extension (T208981).
Bug: T208981
Bug: T214991
Change-Id: I511e3c27a7d2175bdc2b6bdb648f04ac96cd1e0b
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