Parameters may include a `suggestedvalues` property, which is rendered
in the UI for some parameter types.
TemplateData editor UI elements are implemented behind the
TemplateDataSuggestedValuesEditor feature flag.
Bug: T271897
Change-Id: I14012c79b3fa0d48c58fd8999584cc03ec03575e
Adding a new widget that inherits from MultilineTextInputWidget but
is initialized with only one row and prevents using the return key
to add new lines.
Bug: T263533
Change-Id: I5423f5f04075d21abd7acf09b622fd6444feeeb2
This will give results whenever template data is requested e.g. by
VisualEditor or the TemplateWizard.
Bug: T259705
Change-Id: I2a9e864b94b6f8f49ca3adaa46502627ab6b3322
Seperate different maps of maps-object into different panels that
contains text-area to edit the map, delete button to delete the map, and
can be navigated through using a side-bar, that also have "Add new map"
button at the top to add a new map.
Bug: T258820
Change-Id: Ib53a73203f6010b3fd8a5cd78c74c904be2340f2
Adding maps object to TemplateData GUI. By adding mapPanelButton to the
main panel and creating the map panel which contains multiline input
widget to show and insert the map info.
Bug: T254478
Change-Id: Iacff86812cbc448fcdbae24e7eeffb0384781dd5
* I've moved the one remaining file in resources/ to modules/.
The repo had both resources/ and modules/.
* Class files are named after their class.
* Files with init logic on a page are named init.js.
* Files that only export re-usable classes for another module,
are named index.js.
Bug: T193826
Depends-On: If661c68bea069e99cfff35711efdde7805a12851
Change-Id: Ic8975d7ba349ba50f9039545d2eb8d912ccdce26
* This hook supports functionality that Parsoid/JS used the MW API for.
Parsoid's html2wt code requests templatedata for titles one
at a time currently and so this hook also supports lookups one
title at a time.
This initial implementation is good enough for initial Parsoid/PHP
deployment.
* As part of later performance optimization, we should figure out if
we want to fetch templatedata for all templates in batch mode and
work out the details (selser doesn't touch all templates, for one).
The hook does accept an array of titles, but it looks them up
serially in a simple for-loop.
Separately, we need to resolve if this is better architected as
a lookup service vs. a hook as it is now (see discussion on gerrit).
* Tested locally on my local wiki.
Bug: T238954
Change-Id: I01fb6a9f334ca37a703be497524180f87fb8bbf7
Only ever used together as dependencies for module
'ext.templateDataGenerator.editTemplatePage'.
In the UI, they provide icons for the same dialog.
The 'ext.templateData.images' module is also used in one other place,
via addModuleStyles() on NS_TEMPLATE pages that use <templatedata>.
The 'template-format-block' and 'template-format-inline' icons
are used by the Parser output HTML for the documentation block.
Having one unused icon there, preloaded for editing templatedata,
seems acceptable given it's so tiny and basically was already being
paid for on page views with the mere existence of the module taking
up about as much space as the icon itself.
Change-Id: If839100feca51d67bba7151878dfddd1bcbc372b
This change avoids the flash of missing sorting buttons while loading,
but only with I0b446d18f47428d8c0c4aed78b75de16fe106218 in MediaWiki
core included in MediaWiki 1.33 or higher.
Depends-On: I0b446d18f47428d8c0c4aed78b75de16fe106218
Change-Id: I2c3eeb3a83822798ae0c46fcfea071df706798d7
VisualEditorPluginModules loads whenever VE loads, so create a minimal
loader page to check if we are in the template namespace before loading
the rest of the TemplateData init code.
Bug: T208765
Change-Id: Id127eb4a2472a6ce9da7672f9237b182cf6be2eb
SPDX released version 3 of their license list (<https://spdx.org/licenses/>),
which changed the FSF licenses to explicitly end in -only or -or-later
instead of relying on an easy to miss + symbol.
Bug: T183858
Change-Id: Idae56d8787c5843790c1ecd1b1b64ef58702b823
Previous behavior was to silently append a number to the name, which was hard
to notice. New parameters with duplicate names were already blocked.
Also, fix the disabling of the done button when there are errors.
Bug: T166520
Change-Id: I1d0c51a2aa8b8158874c98ac48fe257baeb1aee1
This avoids the exclusion of the rule
MediaWiki.Files.ClassMatchesFilename.NotMatch in .phpcs.xml.
Change-Id: Ifd7f5f59097c6dedc19f031baaef538023a33336
modules/widgets/ext.templateDataGenerator.paramWidget.js
* Add 'layout' as it uses 'menu'
modules/ext.templateDataGenerator.ui.tdDialog.js
* Add 'interactions' as it uses 'advanced'
Bug: T166730
Change-Id: I5b09f629ec274a89f96030de8af64cfe5d659143
Only contains a stylesheet and has a dependency. Module is only
loaded via addModuleStyles, which means the dependency is ignored.
It triggers the warning because it has a dependency, which means
it's not a pure styles-only module (despite being used as such)
> Unexpected general module "ext.templateData" in styles queue.
Aside from the addModuleStyles() load, it is also specified as
a dependency for "ext.templateDataGenerator.ui".
Dependencies on style modules from JS modules are supported since
T87871 was resolved, however the indirect dependency still doens't
make sense.
Move the dependency on ext.templateData.images, which wasn't needed
or triggered by "ext.templateData" styles anyway, to the UI module
directly.
This also fixes the fact that the "ext.templateData" css is loaded
twice (once as blocking stylesheet without dependency, and then
again as async module via "ext.templateDataGenerator.ui" with dependency).
Bug: T92459
Change-Id: I4c3bb44c135fccb85a26ad901ec9660d647dfe86