Commit graph

61 commits

Author SHA1 Message Date
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
Sam Wilson 59a92c521c Require MediaWiki version >=1.30 due to MultilineTextInputWidget
Change-Id: I636003cd376d92a52d51c4050b01a7002b543849
2018-04-06 11:16:55 +08:00
Kunal Mehta f24b411235 Use SPDX 3.0 license identifier
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
2018-03-04 05:07:52 +00:00
Ed Sanders 313a261f7c Make '/doc' subpage an MW message for local overrides
Bug: T125222
Change-Id: I48c666a1e313a56fd3be98d28edc24d200a35309
2018-02-16 18:16:33 +00:00
jenkins-bot f162c748aa Merge "Block duplicate parameter names when editing existing parameters" 2018-02-08 16:37:20 +00:00
David Lynch f75b144129 Block duplicate parameter names when editing existing parameters
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
2018-02-07 11:09:47 -06:00
zoranzoki21 3538fb022d Removed deprecated position statements from resource loader module
Bug: T184257
Change-Id: I2cbd47182a275be366282de60027092ca798caa8
2018-02-03 16:30:02 +01:00
Ed Sanders b1d7ad8bc8 Use textSelection API to modify textarea
Bug: T73363
Change-Id: I411027236cbb3b349372a64ecbf670062758cfab
2018-01-26 10:32:03 -08:00
Brian Wolff d45f29bb8f Bump version for security release of extension
Change-Id: I382b095ab78de2286b77d14daf0ce94df4230d22
2017-12-18 20:58:39 +00:00
Fomafix 84ef237bde Rename PHP files to match class names
This avoids the exclusion of the rule
MediaWiki.Files.ClassMatchesFilename.NotMatch in .phpcs.xml.

Change-Id: Ifd7f5f59097c6dedc19f031baaef538023a33336
2017-12-15 23:58:46 +01:00
Bartosz Dziewoński e094a5c11d Add appropriate OOjs UI icon pack dependencies
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
2017-06-03 12:49:41 +02:00
Timo Tijhof d7069bcc7f Fix styles queue violation for "ext.templateData"
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
2017-05-10 02:48:40 +01:00
jenkins-bot a31aaedb88 Merge "Extend 'format' spec to include custom format strings." 2016-12-13 21:52:45 +00:00
jenkins-bot 48f9d52a5f Merge "Move icons to RL and generate inverted variants" 2016-12-06 20:53:09 +00:00
Ed Sanders e21a2563ce Move icons to RL and generate inverted variants
Also remove unused parameter icon.

Change-Id: I0ce10a50a0738ba111cfd63bc9cc5de03fae8c8d
2016-12-06 11:53:52 +00:00
Ed Sanders 94d0e73a6b Move all init code over to target
Change-Id: I9ba06bb3a57a7683e246461341c67462cab465d0
2016-12-05 17:02:38 +00:00
Ed Sanders a586d54e93 Abstract out editor manipulation form UI
Create target classes with get/setWikitext methods.

Also refactor some of the window manager code.

Bug: T152230
Change-Id: I7dcc137d79e029b69467ca282d8c52683e022598
2016-12-05 17:01:15 +00:00
jenkins-bot 9f109b8d63 Merge "Don't pull in oojs-ui-toolbars, it's big and we don't use it" 2016-09-01 21:38:24 +00:00
C. Scott Ananian 5812413f11 Extend 'format' spec to include custom format strings.
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
2016-09-01 14:14:47 -07:00
James D. Forrester 4b85bdcb62 Don't pull in oojs-ui-toolbars, it's big and we don't use it
Change-Id: Id95bf98362f06d6b4db7426d2fdcacba2291d57b
2016-09-01 14:14:47 -07:00
Kunal Mehta f033cdcdd0 Bump MediaWiki requirement to 1.26+
Parser::enableOOUI() was introduced in 1.26.

Change-Id: I718ce9350b4f75585cdc7b4e8a7c39f0c22f3d12
2016-08-31 17:29:07 +00:00
jenkins-bot 9e56136c0e Merge "Warn editors when they're adding blank TemplateData" 2016-08-17 16:47:11 +00:00
Reedy 080aa0cfe7 Remove 'UnitTestList' hook
No longer needed now that extension unittests are autodiscovered.

Bug: T142120
Bug: T142121
Change-Id: I1e6718113af00c1bfc1ca0adff7abb36c3982b8a
2016-08-05 17:42:24 +01:00
Alex Monk 1de010108e Warn editors when they're adding blank TemplateData
Bug: T123207
Change-Id: I512ce01a0c7221e7636d26e546d1cbac5395b76b
2016-07-14 03:01:38 +01:00
Alex Monk 84b1ddf44c Localise names of types in HTML rendering
Reuses some messages, renaming them in the process.
Changes undefined on the client to unknown.

Bug: T61745
Change-Id: I2cf5c25acbe1c854c33b2eb3f23dc74393a456d4
2016-04-06 19:00:58 +00:00
Bartosz Dziewoński 8e55adab59 [BREAKING CHANGE] Change default format to null instead of 'inline'
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
2016-03-01 22:53:27 +00:00
Ed Sanders beaea898c2 Make main template param select widget drag/drop re-orderable
Not having two lists of all the parameters seems like a good idea.

Depends-On: I30d1f7f56230d73eb47ccbf9881c0b952b15bd89
Change-Id: I5b2ba39fb7b98fc50816f63bc4fbfc9fe25e02a5
2016-02-21 02:43:48 +00:00
Alex Monk d723905034 Don't show warning about already-known parameters that weren't imported
Bug: T124223
Change-Id: Id102799b925ebaec6a1d819f1d2294982c24e407
2016-01-20 22:29:45 +00:00
jenkins-bot a9a56605ba Merge "Make ext.templateDataGenerator.ui depend on ext.templateData" 2016-01-13 17:43:47 +00:00
Alex Monk 68423b1a69 Make ext.templateDataGenerator.ui depend on ext.templateData
To get the correct styles... Alternatively, I suppose we could split the
style file?

Bug: T119361
Change-Id: Idc2d35cd929b239448c9c317c89d70f174a4eb05
2016-01-13 05:06:46 +00:00
Alex Monk cc6487498b Prompt user to confirm closing modified TemplateData edit dialog
Depends on Ieaf19fe4485b679e0ee21d16f8f2e0693808f386 to take effect with the
escape key. Otherwise only handles the visible 'Cancel' button.

Bug: T106382
Change-Id: Ibc55727fd6a5becfe10b4e74cae5e573d110575d
2016-01-12 17:43:50 +00:00
jenkins-bot 0ca4dc4621 Merge "Introduce new 'format' template property" 2015-11-11 23:56:03 +00:00