resources: Update OOjs-Router from v0.1.0 to v0.2.0
authorJames D. Forrester <jforrester@wikimedia.org>
Wed, 6 Feb 2019 20:22:03 +0000 (12:22 -0800)
committerJames D. Forrester <jforrester@wikimedia.org>
Wed, 6 Feb 2019 21:31:04 +0000 (13:31 -0800)
Change-Id: Ib6847f7328f28f31141f3ae59f0f9a0f49dbf508

RELEASE-NOTES-1.33
maintenance/resources/foreign-resources.yaml
resources/lib/oojs-router/AUTHORS.txt
resources/lib/oojs-router/History.md [new file with mode: 0644]
resources/lib/oojs-router/oojs-router.js

index 0ce2380..027aacd 100644 (file)
@@ -53,6 +53,7 @@ production.
 
 ==== 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.
index cf8ed78..ee74bb3 100644 (file)
@@ -112,11 +112,13 @@ oojs:
 
 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
index 5390c84..a406b57 100644 (file)
@@ -1 +1,7 @@
+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>
diff --git a/resources/lib/oojs-router/History.md b/resources/lib/oojs-router/History.md
new file mode 100644 (file)
index 0000000..c3889cf
--- /dev/null
@@ -0,0 +1,23 @@
+# 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)
index 03aeeb2..111d0e8 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * 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 ( $ ) {
 
@@ -142,15 +142,32 @@ OO.Router.prototype.route = OO.Router.prototype.addRoute;
 /**
  * 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 );