use directories for structure
This commit is contained in:
30
node_modules/page/page.js
generated
vendored
30
node_modules/page/page.js
generated
vendored
@@ -406,7 +406,7 @@ pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Short-cuts for global-object checks
|
||||
@@ -885,7 +885,6 @@ pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
|
||||
* @param {string} href
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Page.prototype.sameOrigin = function(href) {
|
||||
if(!href || !isLocation) return false;
|
||||
|
||||
@@ -895,13 +894,16 @@ pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
|
||||
var loc = window.location;
|
||||
|
||||
/*
|
||||
when the port is the default http port 80, internet explorer 11
|
||||
returns an empty string for loc.port, so we need to compare loc.port
|
||||
with an empty string if url.port is the default port 80.
|
||||
When the port is the default http port 80 for http, or 443 for
|
||||
https, internet explorer 11 returns an empty string for loc.port,
|
||||
so we need to compare loc.port with an empty string if url.port
|
||||
is the default port 80 or 443.
|
||||
Also the comparition with `port` is changed from `===` to `==` because
|
||||
`port` can be a string sometimes. This only applies to ie11.
|
||||
*/
|
||||
return loc.protocol === url.protocol &&
|
||||
loc.hostname === url.hostname &&
|
||||
(loc.port === url.port || loc.port === '' && url.port === 80);
|
||||
(loc.port === url.port || loc.port === '' && (url.port == 80 || url.port == 443)); // jshint ignore:line
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1126,11 +1128,8 @@ pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
|
||||
Context.prototype.save = function() {
|
||||
var page = this.page;
|
||||
if (hasHistory) {
|
||||
var pathWithoutQuerystring = this.path.replace('?' + this.querystring, '');
|
||||
pathWithoutQuerystring = pathWithoutQuerystring === '' ? '/' : pathWithoutQuerystring;
|
||||
|
||||
page._window.history.replaceState(this.state, this.title,
|
||||
page._hashbang && pathWithoutQuerystring !== '/' || this.querystring !== '' ? page._window.location.pathname + '#!' + this.path : this.canonicalPath);
|
||||
page._window.history.replaceState(this.state, this.title,
|
||||
page._hashbang && this.path !== '/' ? '#!' + this.path : this.canonicalPath);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1152,7 +1151,7 @@ pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
|
||||
function Route(path, options, page) {
|
||||
var _page = this.page = page || globalPage;
|
||||
var opts = options || {};
|
||||
opts.strict = opts.strict || page._strict;
|
||||
opts.strict = opts.strict || _page._strict;
|
||||
this.path = (path === '*') ? '(.*)' : path;
|
||||
this.method = 'GET';
|
||||
this.regexp = pathToRegexp_1(this.path, this.keys = [], opts);
|
||||
@@ -1170,7 +1169,10 @@ pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
|
||||
Route.prototype.middleware = function(fn) {
|
||||
var self = this;
|
||||
return function(ctx, next) {
|
||||
if (self.match(ctx.path, ctx.params)) return fn(ctx, next);
|
||||
if (self.match(ctx.path, ctx.params)) {
|
||||
ctx.routePath = self.path;
|
||||
return fn(ctx, next);
|
||||
}
|
||||
next();
|
||||
};
|
||||
};
|
||||
@@ -1193,7 +1195,7 @@ pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
|
||||
|
||||
if (!m) return false;
|
||||
|
||||
delete params[0]
|
||||
delete params[0];
|
||||
|
||||
for (var i = 1, len = m.length; i < len; ++i) {
|
||||
var key = keys[i - 1];
|
||||
|
Reference in New Issue
Block a user