Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

oojs-router

Package Overview
Dependencies
Maintainers
24
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oojs-router - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

6

dist/oojs-router.js
/*!
* OOjs Router v0.2.0
* OOjs Router v0.3.0
* https://www.mediawiki.org/wiki/OOjs_Router
*
* Copyright 2011-2019 OOjs Team and other contributors.
* Copyright 2011-2021 OOjs Team and other contributors.
* Released under the MIT license
* http://oojs.mit-license.org
*
* Date: 2019-02-06T21:26:01Z
* Date: 2021-09-09T23:45:47Z
*/

@@ -11,0 +11,0 @@ ( function ( $ ) {

@@ -1,3 +0,3 @@

/*! OOjs Router v0.2.0 | http://oojs.mit-license.org */
/*! OOjs Router v0.3.0 | http://oojs.mit-license.org */
!function(i){"use strict";OO.Router=function(){var e=this;OO.Router.parent.call(this),this.enabled=!0,this.oldHash=this.getPath(),i(window).on("popstate",function(){e.emit("popstate")}),i(window).on("hashchange",function(){e.emit("hashchange")}),this.on("hashchange",function(){var t;e.enabled?(t=i.Event("route",{path:e.getPath()}),e.emit("route",t),t.isDefaultPrevented()?(e.enabled=!1,e.navigate(e.oldHash)):e.checkRoute()):e.enabled=!0,e.oldHash=e.getPath()})},OO.inheritClass(OO.Router,OO.Registry),OO.Router.static.isSupported=function(){return"onhashchange"in window},OO.Router.prototype.checkRoute=function(){var t,e,o,i=this.getPath();for(t in this.registry)if(e=this.registry[t],o=i.match(e.path))return void e.callback.apply(this,o.slice(1))},OO.Router.prototype.addRoute=function(t,e){var o={path:"string"==typeof t?new RegExp("^"+t.replace(/[\\^$*+?.()|[\]{}]/g,"\\$&")+"$"):t,callback:e};this.register(o.path.toString(),o)},OO.Router.prototype.route=OO.Router.prototype.addRoute,OO.Router.prototype.navigateTo=function(t,e){e.useReplaceState?history.replaceState(null,t,e.path):history.pushState(null,t,e.path)},OO.Router.prototype.navigate=function(t){""===t?(t=window.location.href.replace(/#.*$/,""),history.pushState(null,document.title,t),this.checkRoute()):window.location.hash=t},OO.Router.prototype.back=function(){var t,e=this,o=i.Deferred();return this.once("popstate",function(){clearTimeout(t),o.resolve()}),window.history.back(),t=setTimeout(function(){e.off("popstate"),o.resolve()},50),o.promise()},OO.Router.prototype.getPath=function(){return window.location.hash.slice(1)},OO.Router.prototype.isSupported=OO.Router.static.isSupported,"undefined"!=typeof module&&module.exports&&(module.exports=OO.Router)}(jQuery);
//# sourceMappingURL=oojs-router.min.js.map
# OOjs Router Release History
## v0.3.0 / 2021-09-09
* [BREAKING CHANGE] Require OOjs v6.0.0, up from v2.0.0 (James D. Forrester)
* [BREAKING CHANGE] Require jQuery v3.6.0, up from v3.3.1 (James D. Forrester)
## 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)
* Add OO.Router `navigateTo()` method for accessing replaceState (Jon Robson)
* build: Add AUTHORS.txt to package manifest (James D. Forrester)
* AUTHORS.txt: Add everyone from `git shortlog` (James D. Forrester)

@@ -21,0 +11,0 @@ ## v0.1.0 / 2016-05-05

{
"name": "oojs-router",
"version": "0.2.0",
"description": "Object-oriented navigation routing library built on top of OOjs.",
"keywords": [
"oojs-plugin",
"routing",
"library"
],
"repository": {
"type": "git",
"url": "https://phabricator.wikimedia.org/diffusion/GOJR/oojs-router.git"
},
"license": "MIT",
"main": "./dist/oojs-router.js",
"files": [
"dist/",
"AUTHORS.txt",
"History.md"
],
"scripts": {
"test": "grunt test",
"doc": "jsduck",
"prepare": "grunt build"
},
"dependencies": {
"oojs": "^2.0.0",
"jquery": "3.3.1"
},
"devDependencies": {
"eslint-config-wikimedia": "0.10.0",
"grunt": "1.0.3",
"grunt-contrib-clean": "2.0.0",
"grunt-contrib-concat": "1.0.1",
"grunt-contrib-uglify": "4.0.0",
"grunt-eslint": "21.0.0",
"grunt-karma": "3.0.1",
"karma": "3.1.4",
"karma-chrome-launcher": "2.2.0",
"karma-coverage": "1.1.2",
"karma-firefox-launcher": "1.1.0",
"karma-qunit": "2.1.0",
"qunit": "2.9.1",
"sinon": "7.2.2"
}
"name": "oojs-router",
"version": "0.3.0",
"description": "Object-oriented navigation routing library built on top of OOjs.",
"keywords": [
"oojs-plugin",
"routing",
"library"
],
"repository": {
"type": "git",
"url": "https://phabricator.wikimedia.org/diffusion/GOJR/oojs-router.git"
},
"license": "MIT",
"main": "./dist/oojs-router.js",
"files": [
"dist/",
"AUTHORS.txt",
"History.md"
],
"scripts": {
"test": "grunt test",
"doc": "jsduck",
"prepare": "grunt build"
},
"dependencies": {
"oojs": "6.0.0",
"jquery": "3.6.0"
},
"devDependencies": {
"eslint-config-wikimedia": "0.20.0",
"grunt": "1.4.0",
"grunt-contrib-clean": "2.0.0",
"grunt-contrib-concat": "1.0.1",
"grunt-contrib-uglify": "4.0.1",
"grunt-eslint": "23.0.0",
"grunt-karma": "4.0.0",
"karma": "6.3.2",
"karma-chrome-launcher": "3.1.0",
"karma-coverage": "2.0.3",
"karma-firefox-launcher": "2.1.0",
"karma-qunit": "4.1.2",
"qunit": "2.16.0",
"sinon": "9.0.2"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc