Changes:
- introduced PopupsGadgetsIntegration class handles all checks
- show help message on Preferences page when NavPopups is enabled
- unit test everything
Bug: T151058
Change-Id: Ia474b1b30378efe84dedf3ad47c1f833e88d69b5
Changes:
- removed onExtensionRegistration and related TODOs
- introduced onUserGetDefaultOptions hook
Change-Id: I6648802c19d90df36a211d6494033aca30c078ca
Per #Design's mocks, the "Reading preferences" section should appear
immediately beneath the Skin section, if it's present.
Changes:
- onGetPreferences will try to inject PagePreviews option after
skin section or on the end of section when skin select is not available
- unit tests for new behaviour
Bug: T146889
Change-Id: Id14c0774aee917b7e949ab3ba5968a038b3ca933
Changes:
- added missing unit tests
- introduced PopupsContextTestWrapper, removed all unit-tests logic
from Hooks/Context classes
- removed getModule() from Popups.hooks.php, it's hooks responsibility
to keep single context instance
- removed class_exists calls, use ExtensionRegistry instead
- pass ExtensionRegistry as a dependency so it's easy to mock
- reach 100% code coverage
- introduce PoupsContext::isBetaOn() as it was used in many places
Change-Id: Id014efe72edf24628539c76968e53eb3e06709f4
This changes introduces new option on Special:Preferences page that
allows users to enable/disable Page Previews feature.
By default feature is disabled. Temporarily option in Preferences
page is smoke and mirrors as switching logic is still WIP.
Bug: T146889
Change-Id: Ifdd17ce265d2d4c7583433ed4991443c563f1fe3
Move all of the change listeners into
resources/ext.popups/changeListeners and remove the ChangeListener
suffix. Also, do the above for the associated tests.
Bug: T152225
Change-Id: I90ada465ea291d601f8f1c5c6e775148a2100319
Changes:
* Extract the various shapes of stub user object into the shared
mw.popups.tests.stubs#createStubUser factory method.
* Register the ext.popups.tests.stubs module in
PopupsHooks#onResourceLoaderTestModules and make the test suite depend
on it.
Bug: T152225
Change-Id: I893b11461d8484bcaabfd950c2fa0dc672454a9d
Supporting changes:
* Automatically register JavaScript files in the
tests/qunit/ext.popups/ directory.
Additional changes:
* Fix a grammatical error in the docblock for
mw.popups.createExperiment.
Change-Id: Ieb00709e353f0b960375fdaa0ca0dcdf950f2eb9
Changes:
* Make grunt:qunit run all QUnit tests in those modules whose names
being with "ext.popups".
* Add ext.popups/index.js, which initialises the mw.popups namespace.
* Add ext.popups/userSettings.js, which contains the code that deals
with interacting with the User Agent's storage.
* Add ext.popups/experiment.js, which contains the code that that
decides whether or not the user is in the experiment condition.
* Add tests for both units, converting existing tests where appropriate.
* Remove the associated code from ext.popups.core/ext.popups.core.js.
* Finally, dispatch the BOOT action against the store in
ext.popups/boot.js.
Change-Id: I697207677304bd49c7cfe1d37bb0a4af7810f387
We should endeavour to define Resource Loader modules in one place,
extension.json. Adding them to the output, however...
Changes:
* Remove ResourceLoaderRegisterModules hook handler.
* Move all dependencies, messages, templates, and styles into "empty" RL
module definitions in extension.json so that they don't have to be
looked up later.
Change-Id: I7ec963e3296de8f411e90079ab13b97c6eba4916
You can use `grunt watch` now!
Changes:
* Re-enable QUnit (but ignore legacy tests)
* Add a sample QUnit test
* Add ability to run QUnit via `grunt watch` or `grunt test`
* Move linting to `grunt lint` task
* Add Redux to globals in linter
Change-Id: Ie4a65a8a66773d6472b3d73257267d18027ff3c3
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