Commit graph

92 commits

Author SHA1 Message Date
Fomafix e19cb1d9db Use MediaWiki\ResourceLoader\ImageModule instead of ResourceLoaderImageModule
ResourceLoaderImageModule is deprecated since 1.39.

Change-Id: I536c4ae981aac43d7cdefc3176b766c303aab22e
2024-01-13 20:29:41 +00:00
Thiemo Kreuz b2574932e9 Turn deprecated/required/suggested checkboxes into select widget
* deprecated means "please do not use this".
* required means "you must use this".
* suggested means "it's a good idea to use this".
* optional means "you typically don't need this".

There is no combination that makes any sense. They are really
exclusive to each other.

Still we have to keep the three checkboxes for backwards
compatibility reasons. It was always possible (and will probably
continue to be possible) to have more than one of the three fields
enabled. While users like VisualEditor will make a good guess (e.g.
ignore the rest when "deprecated" is checked) I really think we
should not attempt to hide (and auto-fix) it in this dialog. That's
why the proposed code continues to show the old checkboxes when
more than one is checked.

Bug: T202851
Change-Id: I994268d658602761b180f489bedb50b91fe0c419
2023-11-16 14:06:06 +01:00
Bartosz Dziewoński f150c176e4 TemplateData editor: Use built-in 'allowLinebreaks' option
New in OOUI v0.48.2.

Unlike the old version, this also prevents inserting line breaks by
copy-paste and other methods.

Change-Id: I2fe1b7cfe70ebb6b66a9dfdf012522b574f6e774
2023-10-25 08:27:57 -04:00
Sam Wilson ab3a80555b Inject MainConfig service to TemplateData hooks
Removes the global config variable.

Change-Id: I67c266a3f5189365de506230d1a7064a7427bff6
2023-09-25 10:40:05 +08:00
thiemowmde f302f65dbb Use correct BCP 47 language codes in lang="…" attributes
A small mistake made in I7a82143. This is only relevant for very few
(but critical) language codes. For example, the dialog allows to add
the MediaWiki code "zh-classical". This needs to be translated to
"lzh", but only when we use it directly in HTML.

Bug: T238329
Change-Id: Ifcbb877fb6a348937e85a82459e924548f5ca856
2023-09-21 17:33:41 +02:00
thiemowmde 9eb2e46f37 Remove two messages that are unused since 2014
The "uneditablefield" was added in 2014 via I9b13e2f, apparently
as a temporary workaround. It was apparently not possible to edit
multi-lingual language object back then.

All code related to that was removed about 5 months later via
I985ea03. The patch made it possible to edit such fields. They just
forgot to remove the message.

The "actions" message was added via I863a819. Apparently used for
an "action" table column where parameters could be deleted. This
also got lost in the same big rewrite in I985ea03.

Change-Id: I57329bef8de10ee19e1904d33605d2102fd22741
2023-09-14 18:01:35 +02:00
James D. Forrester 661528f8c9 build: Update MediaWiki requirement to 1.41
All extensions in the MediaWiki tarball are expected to track MediaWiki's release directly.

Change-Id: I2c7de2ce136d110704190b3dc288138a29d01933
2023-08-19 14:08:49 +08:00
Umherirrender 8bd3dbc58c Use HookHandlers for core hooks
The use of "HookHandlers" attribute in extension.json makes it possible
to inject services into hook handler classes in a future patch.

Bug: T271031
Depends-On: Ic2d188d2c332ab8afeb5454fb5a956c8ba5670ae
Change-Id: Idf4cf94a0e4fae31a5c1f6c3dbf319c0d6913cd7
2023-08-15 13:03:15 +02:00
gerritbot 2d16a7c72f Update moved class EditPage
See T321882. Moved in Ibefc44eb64aed

Bug: T321681
Change-Id: I9de606e32ac58ddbf68ee00587ee9b7f0f9f157d
2023-05-06 21:20:32 +00:00
Sam Smith 0f4d04e83f Use EventLogging::submit() to submit analytics events
EventLogging::logEvent() was marked as deprecated at the beginning of
2021 in I0cfd07295d4b51ca4805c79a28a9a4bd64ff7cc9.

Bug: T318263
Change-Id: I2d89784cc249e97954c9be05169f3060fd69945f
2023-01-30 18:20:16 +00:00
thiemowmde e222666e1f Rename message not specific to suggestedvalues
This fixes a FIXME in the code.

Change-Id: I3302352d000d865f074ddafe479d3f1afa62e93d
2022-12-19 07:39:17 +00:00
Ed Sanders 678d95251b Add an "Edit template data" button to the TemplateData output
This button, similar to an edit-section link, will launch the editor
and immediately open the TemplateDataGenerator UI.

Bug: T316759
Depends-On: Idb5e3c51a22361e0d9916d3c31444daeff310ed2
Change-Id: Ieb575c499c16d87c28972a55662ef0bd9cb72c06
2022-11-08 13:36:38 +00:00
thiemowmde 393abe846d Add missing dependency on mediawiki.user
The Metrics.js script needs this, but the dependency is not specified
anywhere. This "accidentially" works because it's rather common that
the module is required by some other code on the page. I just found a
combination where this is not the case (a blank MediaWiki installation
with nothing but TemplateData, not even the WikiEditor).

Change-Id: I97a7c1d227316a222d7ca54adb400aa8dd769047
2022-09-23 21:43:02 +02:00
Thiemo Kreuz f92fed31c7 Turn all TemplateData .css files into .less files
This patch intentionally doesn't do anything else. Later patches will
make use of LESS features.

Change-Id: I7ce7fdba12aa9f5fb49a752706b83f831632bed6
2022-08-08 15:29:03 +02:00
WMDE-Fisch d1ffdc2b95 Remove $wgTemplateDataSuggestedValues feature flag
Feature is always enabled now.

Bug: T307188
Bug: T310684
Change-Id: Ic99c594ceec0020a6c9d20f0a4f10285b74ea9a8
2022-06-27 12:14:02 +02:00
Thiemo Kreuz ff7470e316 Add placeholder to avoid wikitext editor jumping down
Bug: T279869
Change-Id: Ic8f9bf7c95b42422dc4b477f9c752f5e89b20dc7
2022-04-25 08:42:59 +00:00
Reedy 166812da07 Namespace extension
Change-Id: I779e97e512ec0c4f74fb6a4b706772fb1428e40f
2021-11-25 22:53:34 +00:00
C. Scott Ananian 6e1e698873 Rename deprecated usage of ParserOutput::{get,set}Property()
Bug: T287216
Depends-On: Ie963eea5aa0f0e984ced7c4dfa0fd65d57313cfa
Change-Id: I1633f6fa00193df6ea1d6633de07bc8d2b269cbf
2021-10-08 10:29:01 -04:00
TChin 457476611f Replace deprecated onPageContentSave hook
Bug: T291001
Change-Id: I5ac84af28a4687337bb21eafb907ac7224e67b5b
2021-09-29 13:49:10 -04:00
Adam Wight 7b32bcefb4 Add suggested values parameter
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
2021-04-09 12:05:37 +02:00
Adam Wight d63a375fac Finalize event platform migration
Bug: T275011
Bug: T275012
Change-Id: I51a3c3b6b3943db651807fbb2c0eb17c8c51440f
2021-02-24 16:52:55 +01:00
WMDE-Fisch 43e3043bab Allow input fields for parameter values to expand
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
2021-02-17 17:27:54 +01:00
Andrew Kostka d81226fdf7 Bucket the user's edit count before logging an event
Bug: T272569
Change-Id: I5313a3808b266bb60644b40bdb192db77208774a
2021-01-21 13:52:28 +01:00
WMDE-Fisch b8b1df894f Add tracking for template data presence
This will give results whenever template data is requested e.g. by
VisualEditor or the TemplateWizard.

Bug: T259705
Change-Id: I2a9e864b94b6f8f49ca3adaa46502627ab6b3322
2020-12-16 12:50:44 +01:00
WMDE-Fisch ae0dd0e094 Get WikiPageFactory and LanguageNameUtils from services
The bump to 1.36 was overdue because the PageProps are used from
services already.

Change-Id: Ic4b42f58290e15123b281d48be396e8b7e8eeab0
2020-12-15 14:15:47 +01:00
Thiemo Kreuz d08a6448e9 Track when (relevant) changes are made to <templatedata> tags
Bug: T267926
Change-Id: I55f72500b7bad7e648238560b516e870bc9130c8
2020-12-07 15:34:13 +01:00
Adam Wight d8e418671d Send metrics when opening the dialog
Distinguish between create and edit.

Bug: T260343
Change-Id: I5cd29dff0c4db7e024395a9090c465a01527f079
2020-12-04 18:43:23 +00:00
Adam Wight b7fee749ab Migrate to package files: ext.templateDataGenerator.editTemplatePage
Change-Id: Ie03284701c1870b06116b7ce6a8ca1759c28d03b
2020-12-04 19:41:50 +01:00
Adam Wight bda6215309 Migrate to package files: ext.templateDataGenerator.data
Bug: T260343
Change-Id: Ifd171b40de704bff8c063da46b711a384238a0f5
2020-12-04 19:41:30 +01:00
Adam Wight 479a5a4f12 Migrate to package files: ext.templateDataGenerator.editPage
This is trivial, only I'm splitting into its own patch to bisect a
test failure.

Bug: T260343
Change-Id: Ia6d581a0278b21cbfdcfdad0d6193fb965f35814
2020-12-04 17:00:37 +00:00
Ed Sanders 91214f0a6f Use OutlineSelectWidget/OutlineOptionWidget for maps editing
Change-Id: I90ab11c9a0941e8a487a7253d69f0a6cb1dc8dc5
2020-10-05 21:04:44 +00:00
Thiemo Kreuz 0323e78308 Add missing ResourceLoader module for the trash icon
Without this, there is no guarantee the icon is there.

Bug: T258820
Change-Id: Ibe16db80ba8aec53477c48553c8f9c244d9f9a3b
2020-09-18 15:53:40 +02:00
Khatean 76cf63dad2 Allow different maps to be edited separately
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
2020-08-28 20:18:27 +02:00
adham-khatean e719555d30 Create initial UI for maps panel in TemplateData GUI
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
2020-07-09 19:13:29 +02:00
jenkins-bot 8f96ba6c5e Merge "Convert to manifest_version 2" 2020-05-12 16:35:52 +00:00
Reedy 69cfb3bd1b Convert to manifest_version 2
Bug: T252470
Change-Id: I1c48a7d6e355783accd1a5ff19b9a1e4876388dd
2020-05-12 01:33:49 +00:00
James D. Forrester a644018c57 extension.json: Fix name of QUnitTestModule
Change-Id: I0d94c300001d89ad1155e59f5734dcb05c4ce272
2020-05-11 14:43:36 -07:00
James D. Forrester edf85c08e7 Use QUnitTestModule instead of deprecated ResourceLoaderTestModules
Bug: T232875
Change-Id: I5612a9be65f4d4adf4912645856540dbb04d2b34
2020-05-11 19:45:10 +00:00
Timo Tijhof 53f4783ffd Organise resource files in directories after their module bundles
* 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
2020-03-15 15:21:39 +00:00
Timo Tijhof 2034c95f17 build: Remove redundant arrays around "Hooks" in extension.json
Change-Id: I4111beae5504565af7c12278ce6696ab3ab3d960
2020-03-12 18:04:02 +00:00
Subramanya Sastry 956367fb90 Implement ParsoidFetchTemplateData hook for Parsoid/PHP
* 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
2019-11-25 11:09:13 -06:00
jenkins-bot 2aeec4610d Merge "Do not always store template data compressed" 2019-09-30 23:56:21 +00:00
saper ce13175017 Do not always store template data compressed
Only MySQL can handle blobs in page_props.pp_value

Bug: T203850
Change-Id: Ie20d412d89855e451d48f7656d97fb305b1c4c55
2019-09-30 14:24:39 +02:00
Timo Tijhof b87d37f482 Merge 'ext.templateDataGenerator.ui.images' into 'ext.templateData.images'
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
2019-09-13 03:12:42 +01:00
Timo Tijhof 8f35430bd7 Merge 'ext.templateDataGenerator.ui' into 'ext.templateDataGenerator.editTemplatePage'
Change-Id: I3357618f95f4baeb27013b9d753a3f99cba3847e
2019-09-12 23:20:22 +01:00
Fomafix 962a84ed82 Preload tablesorter styles by module 'jquery.tablesorter.styles'
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
2019-06-12 07:37:10 +02:00
zoranzoki21 ac59e27411 Move all apihelp translatable messages to separate files
Bug: T189982
Change-Id: I0614e26ad8205209f3efd5c480248740eee92aed
2018-12-03 20:41:20 +00:00
Ed Sanders 822d0cd345 Rename module editPage→editTemplatePage, create minimal new editPage module
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
2018-11-24 00:14:03 +00:00
Kunal Mehta 28e0ad4993 Don't use deprecated mediawiki.api.messages
It was merged into `mediawiki.api`.

Bug: T196802
Change-Id: Ib89340e31163dea6ba5b5d4c4ba2613727504332
2018-06-10 13:15:28 -07:00
Kunal Mehta de96754626 Move PHP classes to includes/
Change-Id: I7f46b6da2995687b3ec1ed95cf6f35c2a40d4f1e
2018-04-24 16:50:31 -07:00