oojs/oojs-ui
Provides library of common widgets, layouts, and windows.
Requires
- mediawiki/at-ease: 1.1.0
- php: >=5.5.9
Requires (Dev)
- jakub-onderka/php-parallel-lint: 0.9.2
- mediawiki/mediawiki-codesniffer: 0.6.0
- phpunit/phpunit: 4.8.21
- dev-master
- v0.17.6
- v0.17.5
- v0.17.4
- v0.17.3
- v0.17.2
- v0.17.1
- v0.17.0
- v0.16.6
- v0.16.5
- v0.16.4
- v0.16.3
- v0.16.2
- v0.16.1
- v0.16.0
- v0.15.4
- v0.15.3
- v0.15.2
- v0.15.1
- v0.15.0
- v0.14.1
- v0.14.0
- v0.13.3
- v0.13.2
- v0.13.1
- v0.13.0
- v0.12.12
- v0.12.11
- v0.12.10
- v0.12.9
- 0.12.8.x-dev
- v0.12.8.1
- v0.12.8
- v0.12.7
- v0.12.6
- v0.12.5
- v0.12.4
- v0.12.3
- v0.12.2
- v0.12.1
- v0.12.0
- v0.11.8
- v0.11.7
- v0.11.6
- v0.11.5
- v0.11.4
- v0.11.3
- v0.11.2
- v0.11.1
- v0.11.0
- v0.10.1
- v0.10.0
- v0.9.8
- v0.9.7
- v0.9.6
- v0.9.5
- v0.9.4
- v0.9.3
- v0.9.2
- v0.9.1
- v0.9.0
- v0.8.3
- v0.8.2
- v0.8.1
- v0.8.0
- v0.7.0
- v0.6.6
- v0.6.5
- v0.6.4
- v0.6.3
- v0.6.2
- v0.6.1
- v0.6.0
- v0.5.0
- v0.4.0
- v0.3.0
- v0.2.4
- v0.2.3
- v0.2.2
- v0.2.1
- v0.2.0
README
OOjs UI is a modern JavaScript UI toolkit for browsers. It provides a library of common widgets, layouts and windows that are ready to use, as well as many foundational classes for constructing custom user interfaces. The library was originally created for use by VisualEditor, which uses it for its entire user interface, and is now completely independent, and more useful and convenient for other use cases.
Quick start
This library is available as an npm package! Install it right away:
npm install oojs-ui
If you don't want to use npm, you can:
Clone the repo and move into it,
$ git clone https://phabricator.wikimedia.org/diffusion/GOJU/oojs-ui.git oojs-ui && cd oojs-ui.Install Grunt command-line utility:
$ npm install -g grunt-cliInstall composer and make sure running
composerwill execute it (e.g. add it to$PATHin POSIX environments).Install dev dependencies:
$ npm installBuild the library (you can alternatively use
grunt quick-buildif you don't need to rebuild the PNGs):$ grunt buildYou can now copy the distribution files from the dist directory into your project.
You can see a suite of demos in
/demosby executing:$ npm run-script demos
Loading the library
While the distribution directory is chock-full of files, you will normally only need to load three:
oojs-ui.js, containing the full library- One of
oojs-ui-apex.cssoroojs-ui-mediawiki.css, containing theme-specific styles - One of
oojs-ui-apex.jsoroojs-ui-mediawiki.js, containing theme-specific code
You can load additional icon packs from files named oojs-ui-apex-icons-*.css or oojs-ui-mediawiki-icons-*.css.
The remaining files make it possible to load only parts of the whole library.
Furthermore, every CSS file has a right-to-left (RTL) version available, to be used on pages using right-to-left languages if your environment doesn't automatically flip them as needed.
Versioning
We use the Semantic Versioning guidelines as much as possible.
Releases will be numbered in the following format:
<major>.<minor>.<patch>
For more information on SemVer, please visit http://semver.org/.
Issue tracker
Found a bug or missing feature? Please report it in the issue tracker!
Contributing
We are always delighted when people contribute patches. We recommend a few things to make it quicker and easier for you to contribute:
- You will need a wikitech account which you can use to login to gerrit, our code review system.
- You will need a Wikimedia account, which you can use to login to Phabricator.
- You should create a Phabricator ticket describing the issue you wish to change.
- We automatically lint and style-check changes to JavaScript, PHP, CSS, Ruby and JSON files. You can test these yourself with
npm testandcomposer testlocally before pushing changes. SVG files should be squashed in advance of committing with SVGO usingsvgo --pretty --disable=removeXMLProcInst --disable=cleanupIDs <filename>. - To submit your patch, follow the "getting started" quick-guide. You should expect to get code review within a day or two.
- A new version of the library is cut and released most weeks on Tuesdays.
Release
Release process:
$ cd path/to/oojs-ui/
$ git remote update
$ git checkout -B release -t origin/master
# Ensure tests pass
$ npm install && composer update && npm test && composer test
# Avoid using "npm version patch" because that creates
# both a commit and a tag, and we shouldn't tag until after
# the commit is merged.
# Update release notes
# Copy the resulting list into a new section at the top of History.md and edit
# into five sub-sections, in order:
# * Breaking changes
# * Deprecations
# * Features
# * Styles
# * Code
$ git log --format='* %s (%aN)' --no-merges --reverse v$(node -e 'console.log(require("./package.json").version);')...HEAD | grep -v "Localisation updates from" | sort
$ edit History.md
# Update the version number
$ edit package.json
$ git add -p
$ git commit -m "Tag vX.X.X"
$ git review
# After merging:
$ git remote update
$ git checkout origin/master
$ git tag "vX.X.X"
$ npm run publish-build && git push --tags
$ npm publish