==== Changed external libraries ====
* Updated OOUI from v0.29.2 to v0.30.2.
+* Updated OOjs Router from pre-release to v0.2.0.
* Updated wikimedia/xmp-reader from 0.6.0 to 0.6.1.
* Updated wikimedia/scoped-callback from 2.0.0 to 3.0.0.
* Updated wikimedia/ip-set from 1.2.0 to 2.0.0.
oojs-router:
type: tar
- src: https://registry.npmjs.org/oojs-router/-/oojs-router-0.1.0.tgz
- integrity: sha384-h5D3oeG4TeizHhgXY8Z9ghnas3BcNQI7keiUrwS06Zu4zSCiU6ht+Tu8eRbWuqhs
+ src: https://registry.npmjs.org/oojs-router/-/oojs-router-0.2.0.tgz
+ integrity: sha384-VngYqdQ3vTDMXbm4e4FUZCCGos7fB0Jkr9V+kBL5MElprK1h0yQZOzBNnMHtSJS/
dest:
package/dist/oojs-router.js:
package/LICENSE:
+ package/AUTHORS.txt:
+ package/History.md:
ooui:
type: tar
+Ed Sanders <esanders@wikimedia.org>
+James D. Forrester <jforrester@wikimedia.org>
Jon Robson <jdlrobson@gmail.com>
+Kunal Mehta <legoktm@member.fsf.org>
+MarcoAurelio <maurelio@tools.wmflabs.org>
+Prateek Saxena <prtksxna@gmail.com>
+Timo Tijhof <krinklemail@gmail.com>
--- /dev/null
+# OOjs Router Release History
+## v0.2.0 / 2019-02-06
+* build: Misc clean up (Timo Tijhof)
+* Code style fixes and refactoring (Ed Sanders)
+* build: Switch to ESLint (Timo Tijhof)
+* Unit tests (Jon Robson)
+* Add .gitreview (Christian Aistleitner)
+* Remove .arcconfig & .arclint (MarcoAurelio)
+* Add jsduck config (Prateek Saxena)
+* build: Update devDependencies (Ed Sanders)
+* Use standard coverage reporting configuration (Kunal Mehta)
+* Update eslint-config-wikimedia to 0.9.0 (Ed Sanders)
+* build: Update devDependencies (Ed Sanders)
+* build: Structure updates (Timo Tijhof)
+* OOjs Router method to provide access to replaceState (Jon Robson)
+* build: Switch from prepublish to prepare for modern npm (James D. Forrester)
+* build: Bump package-lock.json for npm audit (James D. Forrester)
+* build: Add AUTHORS.txt to package manifest (James D. Forrester)
+* AUTHORS.txt: Add everyone from `git shortlog` (James D. Forrester)
+
+## v0.1.0 / 2016-05-05
+* Initial commit (Jon Robson)
+* Add build, CI infrastructure (James D. Forrester)
/*!
- * OOjs Router v0.1.0
+ * OOjs Router v0.2.0
* https://www.mediawiki.org/wiki/OOjs_Router
*
* Copyright 2011-2019 OOjs Team and other contributors.
* Released under the MIT license
* http://oojs.mit-license.org
*
- * Date: 2019-01-11T03:40:55Z
+ * Date: 2019-02-06T21:26:01Z
*/
( function ( $ ) {
/**
* Navigate to a specific route.
*
+ * @param {string} title of new page
+ * @param {Object} options
+ * @param {string} options.path e.g. '/path/' or '/path/#foo'
+ * @param {boolean} options.useReplaceState Set replaceStateState to use pushState when you want to
+ * avoid long history queues.
+ */
+OO.Router.prototype.navigateTo = function ( title, options ) {
+ if ( options.useReplaceState ) {
+ history.replaceState( null, title, options.path );
+ } else {
+ history.pushState( null, title, options.path );
+ }
+};
+
+/**
+ * Navigate to a specific ''hash fragment'' route.
+ *
* @param {string} path String with a route (hash without #).
+ * @deprecated use navigateTo instead
*/
OO.Router.prototype.navigate = function ( path ) {
- var history = window.history;
// Take advantage of `pushState` when available, to clear the hash and
// not leave `#` in the history. An entry with `#` in the history has
// the side-effect of resetting the scroll position when navigating the
// history.
- if ( path === '' && history && history.pushState ) {
+ if ( path === '' ) {
// To clear the hash we need to cut the hash from the URL.
path = window.location.href.replace( /#.*$/, '' );
history.pushState( null, document.title, path );