* Remove use of undocumented 'this' inside promise callback,
use the promise variable instead.
* Remove needless expectCount.
Change-Id: I3a698207440d8085a502fa54da8bb5feddfa1dcb
Create target classes with get/setWikitext methods.
Also refactor some of the window manager code.
Bug: T152230
Change-Id: I7dcc137d79e029b69467ca282d8c52683e022598
Thanks to Thiemo Mättig for the suggestion and specification at
Wikimania 2016 in Esino Lario.
This is an extended version of Thiemo's original specification. This
version also allows specification of "own line" properties for
templates; that is, whether the template should be preceded/followed
by a newline, as requested by James Forrester.
Bug: T138492
Bug: T135667
Change-Id: Idc6b2680330e6bf5caec2bf6fc86a705d25bc649
This gives it more visual indicators that it'll take you somewhere. Its
previous frameless-button appearance made it non-obvious that it was behaving
as a link.
Bug: T142484
Change-Id: I7732bf6db7ac63121d6ed1377c654ae8700895d1
If the user tried to rename a parameter to "asd", but "asd" already existed,
we'd append "asd0", and the user would get "asdasd0". But what we actually
wanted to do was change it to "asd0".
Change-Id: I7fa05ed6fca54bc941e1843ebe6872a87383effb
Otherwise the second keystroke made while changing parameter names will cause
an error. I think this code previously assumed the change only happened once,
rather than on-keystroke.
Bug: T142889
Change-Id: I0e9c096a053667c51bbce74ee3ce1bd573ae7d49
Also make getNewValidParameterKey actually return (probably not necessary for
this commit but I discovered it in the process).
Bug: T138800
Change-Id: I94ec6729b98c126b609b747fe4ce04a5fc02f616
Reuses some messages, renaming them in the process.
Changes undefined on the client to unknown.
Bug: T61745
Change-Id: I2cf5c25acbe1c854c33b2eb3f23dc74393a456d4
Don't enforce 'inline' as the default format if none is specified.
Instead preserve the unspecified value as 'null'. This allows
third-party tools to provide a better default experience when changing
existing content (e.g. by using smart detection to follow the format
already used).
Bug: T128337
Change-Id: I911c7999e3731c0125fc058118f8d7287d8f88f4
It looks like this is how the code was originally intended,
but 'name' and 'key' are the same thing.
Move the key to the 'alias' list where CSS already exists to
colour it differently.
Change-Id: Ieade122633cec14203f7959121e9cd7250bb9f7a
Not having two lists of all the parameters seems like a good idea.
Depends-On: I30d1f7f56230d73eb47ccbf9881c0b952b15bd89
Change-Id: I5b2ba39fb7b98fc50816f63bc4fbfc9fe25e02a5
The current way surprisingly mostly works, but you're supposed to use
the matching class. This fixes some styling inconsistencies.
Change-Id: I3f8ce19b1f96cc051b7ac987fa211d1b5ee9cc71
Depends on Ieaf19fe4485b679e0ee21d16f8f2e0693808f386 to take effect with the
escape key. Otherwise only handles the visible 'Cancel' button.
Bug: T106382
Change-Id: Ibc55727fd6a5becfe10b4e74cae5e573d110575d
Adding format data, which defines the preferred source format
to use when using templates.
Possible formats:
* Inline - all parameters in a single line
* Block - each parameter is in its own line
Bug: T64147
Change-Id: Id856c4a38890526060d0619432f06174d66f7792
The message allows per-wiki configuration. The default target is better
for normal users of TemplateData than the previous hard-coded one and
has already been translated in some languages from when it was used
previously.
This also moves the messages dependencies from `ext.templateData` to
`ext.templateDataGenerator.ui`, which is the only module that uses
them: the correct strings were displayed only by inheritance.
Bug: T112011
Change-Id: I81ab684bb0ed9b0767df75635284c51129ac7000
Add a sourceHandler that deals with all source-related actions
like fetching template source and validating the existing
TemplateData string.
Also add a MessageDialog warning the user in case the TemplateData
is invalid. In this case, the user will be given the option either
to correct the JSON by hand or to start the editor to replace the
existing TemplateData with a new one.
Bug: T91730
Bug: T91325
Change-Id: I4e6d04f02565a02d8dcf5c70a575ab6433caa27f
A dependent and dependee properties should only update one another
once in the model, and the UI should be responsible for resetting
the input when it is toggled.
Bug: T92558
Change-Id: I944aaf9c44d0f305a34458f0b8009a98c9570661
The deprecated property allows for either a boolean or text, so we
should allow the user to insert guidance text in case that property
is true. To achieve that, the model also defines 'textValue' for
boolean properties with text representation so an internal property can
be set to hold that value and inputs can be automatically built from the
property structure.
Bug: T90734
Change-Id: Iadc6abdcc0cf2721a311cf43847b306cb269b5e8
The code would call .setDisabled( true ), fire off an API request, and
then always call .setDisabled( false ) when the request finished,
regardless of the response.
Bug: T91324
Change-Id: Iee440a1fca966e0c66669ee5e78b6f5ab8f7f8d6
On the edit page, we show the user a message if a related page
(parent of /doc page, or vice versa) already has templatedata.
This check was wrongly detecting that the parent page has templatedata
when editing '/doc'. The check shouldn't use the 'templatedata' API
since that also includes transcluded templatedata.
Look in the wikitext content instead.
Change-Id: I9788e2beb0809ac3e676a90cd0dfe519c005afc9
For values like 'deprecated', 'suggested' and 'required' make sure
that if they are marked as 'false' they are deleted from the result
string. If the original TemplateData already had either one of
those parameters marked as false don't delete so to avoid dirty
diffs.
Bug: T90283
Change-Id: I34c81d45e3967ce5398691d97d1a15908b8a2e57
Due to a bug, new parameters could not be added unless they were
previously deleted. This commit fixes that bug.
Change-Id: I3784d1b3d650893f26abb63994d13c08b148075b
Check if there already is a TemplateData block in a related
page and warn the user if that is the case. Related pages are
either the /doc page or, if we are already in a /doc page, its
immediate parent.
Bug: T74062
Change-Id: I83212f14ecd2dcc18970d21ad0d833b461405390
Make sure that every time the dialog is open, the paramOrder
widget is emptied so it can be refilled fresh from the model.
Bug: T88126
Change-Id: I628c66710cb1f2f77385b16c627585350f357c45
Change the current hacky layout to the proper ActionFieldLayout,
and also make sure that when the user adds a language, the new
language is selected.
Change-Id: I737a1dcfc08bd47829661daf3c08e2e480670842
If a user adds a parameter that was previously deleted, the
parameter properties will be completely emptied, and the parameter
will be added as if it is new.
Bug: T86916
Change-Id: Ib739ee09229750f94314636d4290dbe6662b4c0f
The type in the templatedata editor didn't update because the events
were attached to the previous ooui SelectWidget, and should be
adjusted to use the new methods.
Bug: T86922
Change-Id: I619d1cc69f672d2d03d7dafa97ba3d950de9d89d
Make sure that aliases get trimmed and are not getting extra spaces
when saving a parameter.
NOTE: To prevent dirty diffs, only parameters that are 'touched'
(viewed or edited directly in the editor) will be trimmed. The editor
will keep all other "wrong" values that have trailing or preceding
whitespaces as-is.
Bug: T85330
Change-Id: I64ecb88a7d736fa36b5e6debf2e94b0d37152020