There's a lot of things going on here, so a quick summary:
* Moved the warning outside sitenotice to avoid reflows and all
kinds of other issues, including those with dismissable notices.
* Placed the warning on the bottom of the page, on all skins, for
consistency and to avoid obstructing vital UI elements such as
site name, user tools, search box.
* Changed the UI to use OOUI for, again, consistency and to avoid
reinventing the wheel with button styling.
* Removed the cookie emoji as it was only taking up valuable space
on mobile and making designing a sensible layout much harder.
* Merged the mobile and desktop RL modules into a single, responsive
one. The warning will work correctly for any skin and screen width.
* The integration tests are truly horrible, I tried to at least
make them work. They deserve a proper rewrite, but that should be
done after the extension switches to the new hook system.
I will post screenshots of this in action in the first of the linked
tasks.
Bug: T271047
Bug: T173335
Change-Id: I6e2a3d7aeccc0d4df1b3238e52c67e72099d27d8
The service was shutdown in 2018 and is not reachable anymore. Having a
default value in the extension to a service that doesn't exist anymore
seems awkward.
Bug: T201752
Change-Id: I998926f17a462909773f7121771deaa4b4b1c2c7
The change 4649d2110f requires 1.32+
because it depends on I0afdc8ab50bc1354bb5099bf39923c07eab0b665 from
core included in 1.32.
Change-Id: Ia2582b6598024dd229df615df50b7d1a9eb9116b
This should make the code a bit more structured and easier to navigate
through. It also removes some lines from extension.json as the autoload
classes list is replaced by an autoload namespaces property.
This also changes the minimum requirement of MediaWiki to 1.31 for this
extension to work.
Change-Id: I249ccc3035297c99202a5f83fcc8d3fda68b682c
This cleans up the hook file a lot and movesthe logic to seperate services
provided by MediaWikiServices. This also removes some setters and passed-
around variables and stuff. Also fixes the unit tests by not querying
external services anymore.
Change-Id: I0c3c0b7f2f5bd68aaad624e8e2dcad9bdcf97770
With this change, CookieWarning gets two new ways to limit the warning
bar to users of specific (configurable) regions. Based on the geo location
service (which can be configured, too, defaults to freegeoip.net), the
extension will try to get the region of the user (based on the IP address)
and checks it against the configured regions.
With the configuration variable $wgCookieWarningGeoIPLookup, the wiki sysadmin
can configure, if the lookup should be done with PHP (the timeout for the
request is hardcoded to 2 sedonds max), which will save the paylod sent to
the user, or with JavaScript, which will be asynchronous.
Deactivating this feature is easily done by simply setting the configured regions
to false, instead of an object.
Bug: T145780
Change-Id: I4d9371b8608ef270c11c42bdb3a773675977ab3a
This commit change sthe "OK"-link to dismiss the cookiewarning bar
from a link to a POST-based form, so that non-JS users are able to
click it, too. If clicked, the dismiss is saved int he user prefs
(if the user is logged in) or in a cookie.
The JS version still works without reloading the page.
Bug: T145647
Change-Id: I711413abcbc131aaba34e8b285630ef1a1c9bda1
de i18n message now represents the en translation. The mobile opacity
is now 1, instead of 0.85 from desktop (it covers text in mobile, which
makes it harder to read with the opacity).
The URL isn't hardcoded anymore, it now can be configured with a config
option.
Change-Id: I9a4e3eb40675496e9467ecee4307298d0542633e
Enable the CookieWarning to be visible on a mobile device (bottom, instead of top).
Instead of only rely on cookies to save, that a user accepted that we use cookies,
save it as a user preference, too.
Change-Id: Ib03d5eafd4392d14315115c158b547b9e26a173c