Commit graph

13 commits

Author SHA1 Message Date
James D. Forrester edf85c08e7 Use QUnitTestModule instead of deprecated ResourceLoaderTestModules
Bug: T232875
Change-Id: I5612a9be65f4d4adf4912645856540dbb04d2b34
2020-05-11 19:45:10 +00:00
C. Scott Ananian e3c95c281f Improve directionality settings for TemplateDataBlob rendering
The <templatedata> extension tag wants to render itself into HTML
before an OutputPage has been set up.  Unfortunately, this meant that
we needed to hack in a call to OutputPage::setupOOUI() with default
theme and directionality, regardless of whether those were correct.

Slightly improve matters by using the directionality of the user
language object, but this codepath really needs to be rethought.

Follow up to Ie3f37b8b972dc6e89e3cd334672954d3632c1b20; see also
the discussion in T101666.

Change-Id: I6ae99ea6bd8b6ee21b8ed8b06dc4e9e324050ab7
2020-04-09 11:45:24 -07:00
C. Scott Ananian 4dcda73ef7 Remove deprecated Parser::enableOOUI(), take 2
This adds a missing call to OutputPage::setupOOUI(), to fix a code path
where `<templatedata>` is expanded via API call (eg, during Parsoid
rendering) and an OOUI theme has not been set up.  This hacky workaround
is pretty bogus, since the output will not have the proper user skin
or directionality, but it avoids a crash (and duplicates the previous
behavior, without using the deprecated method).

Change-Id: Ie3f37b8b972dc6e89e3cd334672954d3632c1b20
2020-04-08 16:10:33 -04:00
C. Scott Ananian 3f270b9ad7 Don't use deprecated Parser::enableOOUI() hook
Follow up to I71be19c1d735fef5b781c68ef7ba47cafc37595d.

Bug: T236809
Change-Id: Ib75f530506bfc9692137b0538f66eb5b511637f0
2020-04-08 13:47:08 -04:00
Timo Tijhof 6f362c6d8a Minor clean up in new ParsoidFetchTemplateData hook
Follows-up 956367fb90.

* Fix typo.
* Remove <del>footgun</del><ins>dangerous return value</ins>
  from this unabortable hook.
* Document the weird PageProps workaround.
  This should be fixed in core.

Change-Id: I6b22e9c2112039e5703e6a62252f1909b15c8887
2020-01-28 19:14:12 +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
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
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
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
Ed Sanders 9a8c807f51 eslint: Introduce wikimedia/qunit ruleset
Change-Id: I3972918c00e69d325c5cb2055d4996a8c07b1034
2018-11-15 23:21:32 +00:00
Timo Tijhof 326558fc77 Don't store templatedata pageprop on doc-subpage
This resolves two issues:
* Database inefficiency (T52512).
* Doc pages showing on Special:PageWithProp.

It also makes progress on (but doesn't fully resolve) T54448,
by not outputting encouraging accidental use of "/doc" by
displaying descriptions and parameter documentations for them
below the suggestions in VisualEditor.

Bug: T52512
Bug: T54448
Change-Id: I99323d7adc5fc072a85ff1d3595f805f537bbb43
2018-10-09 17:46:21 +00:00
Saint Johann c608d204c1 Fix problems with MediaWiki messages and non-displaying icons
Bug: T160252
Change-Id: I997bc0f8c7d99f73c1cc6b4ce46f6bcdc1eee410
2018-09-03 17:14:16 +02:00
Kunal Mehta de96754626 Move PHP classes to includes/
Change-Id: I7f46b6da2995687b3ec1ed95cf6f35c2a40d4f1e
2018-04-24 16:50:31 -07:00
Renamed from TemplateDataHooks.php (Browse further)