Given we currently have modules defined in extension.json and in hooks
it can be really confusing understanding how the code fits together.
This change hopefully makes this a little clearer by using folder names
that are named after the resource loader modules - this is also consistent
with how we do things in our other extensions.
A images folder is added to the route so that it is clearer that the images
are not used in ResourceLoader module definitions and are only used to illustrate
the beta feature.
Change-Id: Ia650ec03e3a6d3069165441ddfa069d390be4d10
ext.popups.experiment depends on .core as it initialized the mw.popups
namespace and .core depends on .experiments for
mw.popups#getEnabledState.
By merging the experiment module into core, we can eliminate any
circular dependencies.
Changes:
* Move ext.popups.experiment.js code into ext.popups.core.js
* Remove mw.popups.experiment module and any references to it
Note: ext.popups.experiment.test.js was left in its own file for cleaner
QUnit module setups and easier removal later. I'm not entirely happy
with doing it this way, but I'm not sure changing the mw.config within
the mw.popups.core QUnit module is worth merging the files.
Bug: T146035
Change-Id: I1f024567010acaa61c1d613c6e59c998198a5976
Improving Hovercards' settings dialog to fulfill design specification.
Also fixing HTML structure by removing invalid `radiogroup` element and
adding missing `</div>` element, fixing related QUnit test.
Changes:
* Add close icon instead of using text
* Style header as a table for alignment
* Remove redundant "OK" button and have it replace "Save" instead
* Update text of "OK" button to "Done"
* Fix description for translation of "Done" button
* Fix qunit and selenium tests
* Remove unnecessary markup and less
* Add mediawiki-ui-button and mediawiki-ui-icon dependencies
* Shrink dialog width some per design spec
* Fix dialog horizontal position calculation to remove hard-coded value
Bug: T138612
Change-Id: I7395e3438836149becdd576942bdaf6f21b4163f
* Change labels in English for settings options
* Update description for enable option
* Remove description for disable option
Bug: T138233
Change-Id: Id23dcc7b7e655f7939bb2e455b8680ed5a2c6331
Changes:
* Disable the desktop target by default
* If the user is in the experiment condition, then enable the desktop
target
* Add PopupsExperiment config var, which, if set to true, causes: the
experiment config to be added to the output as config vars, as well as
the ext.popups.desktop Resource Loader module
Bug: T132604
Change-Id: Ia71ca924c3e2ec2ee0b0191ea2573fa7ff5e8a7e
Breaks EventLogging as the old schema is not compatible with these
new properties. We will reapply the patch later when in a better state.
My bad for merging.
This reverts commit ca20031a0e.
Change-Id: Ia961e0f99339f9045af9d0a4653599a48518cc95
Changes:
* Add the ext.popups.experiment module
* Add the mw.popups.experiment.isUserInCondition function, which
returns a promise that resolves with true if the user is in the
experimental condition, otherwise false
* If the experiment isn't configured, i.e. wgPopupsExperimentConfig is
null or undefined, then the user isn't entered into the experiment,
providing a kill switch
Bug: T132604
Change-Id: I49597494273e3862711a32e4951c8598e6c8bf59
This change is an intermediate step in our transition
to logging a variety of events easily.
Also:
* Some events may need sendBeacon support and may not be
logged if the navigator does not support sendBeacon.
* Do not load schema code if EventLogging is not available.
Bug: T131315
Change-Id: Iff939577f65f1c6c71701dd6967939445385fb70
Popups currently makes use of a render cache. Using a cache in this
way without protection causes problems (I will look at cleaning this up)
The hack below it
`mw.popups.$popup.html( mw.popups.$popup.html() );`
will lead to the html of the cached object being wiped out on IE9 meaning
future loads will show an empty popup.
Add a unit test (which previously would fail in IE9) to protect against this
in future.
Bug: T68496
Change-Id: Icef784fb389b0ab1856e2ba7464c9423ebcd62ab
Test pieces that make sense, everything else is already
covered in cucumber tests. See the following commit for more
info: I55f311b6b8845e6ebf4cc5698758afd1f9042a45.
Bug: T133025
Change-Id: I474c1569494601ae5865dcfba22ea728220ff8df
Linkpreview will try to fetch a text extract using the api and, if this
doesn't fail, show the extract as a drawer with a button "Continue to
article". If the query fails, it will redirect the user to the article
directly.
Bug: T113243
Depends-On: I6d8c5b80e70c3d8d1a92a70cc91e1b90d598cb0f
Change-Id: Idbaae9fe2decd89b73e623a25fbd39464c316fb2
For the work on T113243, the Popups extension should be structured in a
more flexible way. This is achieved with this change.
Following has changed:
* The main/core logic of Popups now lives in ext.popups.core to be shareable
between implementations
* The desktop specific logic lives in ext.popups.desktop now, the frontend init
code in ext.popups.desktopTarget and the desktop renderer in
ext.popups.renderer.desktopRenderer
This change doesn't change the functionality of Popups.
Change-Id: I72121e0a1e4b2952f85dc1bc8cf59d06b8d22f47
Replace $.escapeRE from 'jquery.mwExtension' by
mw.RegExp.escape from 'mediawiki.RegExp'.
Bug: T103610
Change-Id: I1d23e4c02d92828291b98a52b4e8050fbebc06d9
Add a configuration key, 'PopupsBetaFeature'. If true, Popups will act as a
beta-feature, and will depend on the BetaFeatures extension. Set to false by
default.
Bug: T88917
Bug: T88164
Change-Id: Ie4cc455fa6379dbc8ef700e4773bedfb49fcf813
This is needed for wikis that use LanguageConverter, since the title
attribute is converted to the user's variant, and the canonical title is
needed for the API unless converttitles is specified.
For filtering, instead of comparing linkHref and expectedHref, filter
out links that have other query parameters or aren't in content
namespaces.
Bug: T93605
Change-Id: I5534753307ed5e1d4b27c52c616fd143b2a397e1
Use proven technology to create and compare URLs.
This will display popups also on anchored links again.
Change-Id: Ic010ca027017435f666782e709e641cf3bbb8767
Let EventLogging register the schema.Popups module, just pass it
the information via a hook.
Also move the ResourceLoaderRegisterModules hook into the hooks
file instead of a global closure.
Change-Id: I74a1db0e6ca38ca3a341a99fcaa6009c8dc18b6d
This is the first patch using the new format of
rtl/ltr icons, which was made possible in
I1c72aaa3f847b1b7679113f2b88cbb92adf0f936
Change-Id: Ieca7cfc5efaf1494b80d554c476a4d61958b0661
It's not a feature flag because it disables whole extension as opposed to a
particular feature. It would result in weird situations where the extension is
present in Special:Version but does not work for no obvious reason. If an
extension needs to be disabled on WMF, its registration file should not be included,
as opposed to "feature flags". This, however, does not mean that I'm opposed to
real feature flags:)
Change-Id: I09bae50241057f727881f33d6f97f69cec7c0a10