GitHub mirror of MediaWiki extension Popups - our actual code is hosted with Gerrit (please see https://www.mediawiki.org/wiki/Developer_access for contributing
OTHER License
See https://www.mediawiki.org/wiki/Extension:Popups for more information about what it does.
Popups uses an asset bundler so when developing for the extension you'll need to run a script to assemble the frontend assets.
You can find the frontend source files in src/
, the compiled sources in
resources/dist/
, and other frontend assets managed by resource loader in
resources/*
.
After an npm install
:
npm start
Will run the bundler in watch mode, re-assembling the files onnpm run build
Will compile the assets just once, ready for deployment. Younpm test
To run the linting tools and the tests.
tests/qunit/
tests/node-qunit/
, which younpm run test:unit
nodemon
to watch sources andnpm install -g nodemon
nodemon -w src/ --exec "grunt lint:all && npm run test:unit"
npm run coverage
coverage/
folderDevelopers are likely to work with local MediaWiki instances that do not have content to test with. To reduce this pain, you can create a single page with a list of links that point to an existing and external wiki by using the following config flag:
$wgPopupsGateway = 'restbaseHTML';
$wgPopupsRestGatewayEndpoint = 'https://en.wikipedia.org/api/rest_v1/page/summary/';
Popups works with a local copy of the Mobile Content Service too:
$wgPopupsGateway = 'restbaseHTML';
$wgPopupsRestGatewayEndpoint = 'http://localhost:6927/en.wikipedia.org/v1/page/summary/';
$($0).trigger('mouseenter')
.npm start
enables Redux DevToolsdebug=true
query. E.g.,https://en.wikipedia.org/wiki/Popup?debug=true
.| tap-mocha-reporter dot
.The root of the repository contains a .storybook directory. This folder contains a separate NPM project using the Storybook.js UI framework. This framework provides an environment that showcases all possible permutations of popups, without the state-management constraints of having only one popup per page.
This framework requires Node 8 (because of the spread ...
operator) and is therefore
separated from the main package.json until CI upgrades from Node 6. NVM can be used to
manage multiple Node versions to run the Storybook app (cd .storybook && nvm use
).
See the .storybook/README.md for details.
Execute npm -s run doc
.
<ref>
, the terms are used synonymously.