The compositionstart trigger in ContentEditableEntry#replaceTextAtSelection
causes ve.ce.Surface#handleInsertion to run, and this appears to be all the
VisualEditor integration we need. But if we later decide we need custom
TextEntry class, see the earlier revision at
https://gerrit.wikimedia.org/r/#/c/264577/3 .
Change-Id: Iad6a6eccccdf2ec9822cf7df0f0ace7a95b6bea8
This may be causing a problem for the translate extension using
composer.json to run php code sniffer.
And not needed since we use extension.json if we use mediawiki 1.25+.
I traced back to the extension since translate extension in composer
requires this extension and seems to have that message.
Change-Id: I6c119c8f4744623e8756ce8da1869dfd66a3c026
This allows other extensions to use this too, without needing a hack to detect
ULS's existence and work around it by not loading their copies of j/i18n code.
Preserves backwards-compatibility for archaïc versions of MediaWiki.
Bug: T95666
Change-Id: I25b33437ceddb60570322b9aa51844acc42a3e32
Retaining the UniversalLanguageSelector.php and Resources.php
to avoid breaking support for old MW versions. At some point,
we can validate how many old MW versions we need to support.
Bug: T87987
Change-Id: I006e968b70298b54013177aa792a4dfdf5b6aae2
This change is for compatibility with Iee61e5b527 in MediaWiki.
This patch updates version info due to said requirement.
Change-Id: Ic63e617f51702c27104e123d4bed91983a726b7f
With the introduction of table editing support, ULS is now activating
on table cells, which have contentEditable=true, but do not have
the ve-ce-documentNode class. So instead, expand the blacklist to
include all descendants of .ve-ce-surface.
Bug: 72824
Change-Id: I974d7ab2726bbe15606f43d7713627eed623435e
This commit allows to log tofu detection always,
even if the rest of the webfonts library is not loaded.
By default this is disabled.
To enable it, set the variable $wgULSTofuLoggingChance
to a number between 0 and 100, indicating the chance of it
getting logged. The idea of the lottery is that even a partial
sample can be useful.
Change-Id: Ia08fe0de348b7eebfa95498a6be58ae41608ba3b
Add new $wgULSCompactLinks feature flag, defaulting to false (as is standard
for Beta Features). Only allow enabling of the feature if ULS position is
'interlanguage'.
Change-Id: Ia268c3a49b5aa14b6a00e33c7f01a61eba48e776
This patch restores the enableWebfonts preference, stored inside
the uls-preferences blob. It existed as 'enable-webfonts' in
the past and was removed in
If735a733717596fae03042c5e277bd538bd8501f
Each wiki can be configured to load the fonts by default
using the new global variable $wgULSWebfontsEnabled.
Its default value is true (to load fonts).
This also removes the preference 'uls-enable', recently added in
I71b70d8ee7c3cad7f49b32e5dc494ef4fc1bdb2f
The initialization of ext.uls.webfonts.js is changed as well,
so that minimal webfonts JS library code is loaded,
and the rest is loaded only if a user requests it.
Bug: 60304
Change-Id: I49e812eae32266f165591c75fd67b86ca06b13f0
Adds an option, 'enable-uls' for users to enable ULS. By default
it is enabled. Wikis can use $wgHiddenPrefs to prevent users from
disabling ULS.
Bug: 46306
Change-Id: I71b70d8ee7c3cad7f49b32e5dc494ef4fc1bdb2f
To detect whether the client can render a given string,
use a tofu detection algorithm.
If the user has an explicit font preference, do not override it.
If the user has no preference and there is a default font for a
language, see if that language can be rendered at the user's browser
using tofu detection.
If tofu is detected, apply the font.
If the element has 'autonym' class, apply Autonym font only when
that language has tofu.
Change-Id: Ib9ee9497e6bcfa7eb86f7d264e0980d8880d6b70
$wgULSNoWebfontsSelectors had default value as '#p-lang li > a'
-the interlanguage links. It does not make sense after the class
'autonym' was added to such links. That 'autonym' css class has
fontfamily definition as Autonym, sans-serif
ie, Autonym font is applied to the interlanguage links.
So, now it make sense to have default value as .autonym to
exclude from parsing.
This also fixes the problems like Bug 58374 where in random cases
the default font for the language get applied even if it has 'autonym' class.
This issue was because the js get executed before the css for .autonym class is
ready and applied. The jquery.webfonts parser will miss to detect the explicit
fontfamily 'Autonym, sans-serif' and the default font is applied.
Bug: 58374
Change-Id: I7478a58583d3b029ae8e2d63e118917499c29c30
Written in pair-programming with Ryan Kaldari.
This adds a version of webfonts initialization that is stripped
of any smart features. It only loads the basic jquery.webfonts
library and the fonts repository in a way that is usable
with the MobileFronted extension.
It is completely disabled by default.
It can be enabled by setting
$wgULSMobileWebfontsEnabled = true;
and even then it will only be enabled for users
who opted in for the mobile beta mode.
Change-Id: I488e411232a1192bbf46ae5675c701366bda9a3e
* Rename JsonMessageLoader to ULSJsonMessageLoader
* Correct the return type of mw.uls.loadLocalization
Follow up: Ic39dec1c484982fb07edd167e83794c0b5f470ee
Change-Id: I13c64a5e89ac75be8a95d951658018a78534f466