Comparing version 1.9.0 to 1.9.1
{ | ||
"name": "URIjs", | ||
"version": "1.9.0", | ||
"version": "1.9.1", | ||
"title": "URI.js - Mutating URLs", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -210,2 +210,7 @@ # URI.js # | ||
### 1.9.1 (February 12th 2013) ### | ||
* fixing IE9 compatibility with location import: `URI(location)` | ||
* fixing string character access for IE7 - ([Issue #67](https://github.com/medialize/URI.js/issues/67)), ([Issue #68](https://github.com/medialize/URI.js/issues/68)) | ||
### 1.9.0 (February 11th 2013) ### | ||
@@ -212,0 +217,0 @@ |
@@ -5,3 +5,3 @@ /*! | ||
* | ||
* Version: 1.9.0 | ||
* Version: 1.9.1 | ||
* | ||
@@ -8,0 +8,0 @@ * Author: Rodney Rehm |
@@ -5,3 +5,3 @@ /*! | ||
* | ||
* Version: 1.9.0 | ||
* Version: 1.9.1 | ||
* | ||
@@ -8,0 +8,0 @@ * Author: Rodney Rehm |
@@ -5,3 +5,3 @@ /*! | ||
* | ||
* Version: 1.9.0 | ||
* Version: 1.9.1 | ||
* | ||
@@ -8,0 +8,0 @@ * Author: Rodney Rehm |
/*! | ||
* URI.js - Mutating URLs | ||
* | ||
* Version: 1.9.0 | ||
* Version: 1.9.1 | ||
* | ||
@@ -114,3 +114,3 @@ * Author: Rodney Rehm | ||
// specification: http://www.ietf.org/rfc/rfc4291.txt | ||
URI.ip6_expression = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){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{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/; | ||
// gruber revised expression - http://rodneyrehm.de/t/url-regex.html | ||
@@ -313,3 +313,3 @@ URI.find_uri_expression = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig; | ||
if (string[0] === "[") { | ||
if (string.charAt(0) === "[") { | ||
// IPv6 host - http://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-04#section-6 | ||
@@ -332,3 +332,3 @@ // I claim most client software breaks on IPv6 anyways. To simplify things, URI only accepts | ||
if (parts.hostname && string.substring(pos)[0] !== '/') { | ||
if (parts.hostname && string.substring(pos).charAt(0) !== '/') { | ||
pos++; | ||
@@ -415,3 +415,3 @@ string = "/" + string; | ||
if (typeof parts.path === "string") { | ||
if (parts.path[0] !== '/' && typeof parts.hostname === "string") { | ||
if (parts.path.charAt(0) !== '/' && typeof parts.hostname === "string") { | ||
t += '/'; | ||
@@ -565,3 +565,3 @@ } | ||
for (pos = 0; pos < length; pos++) { | ||
if (one[pos] !== two[pos]) { | ||
if (one.charAt(pos) !== two.charAt(pos)) { | ||
pos--; | ||
@@ -573,7 +573,7 @@ break; | ||
if (pos < 1) { | ||
return one[0] === two[0] && one[0] === '/' ? '/' : ''; | ||
return one.charAt(0) === two.charAt(0) && one.charAt(0) === '/' ? '/' : ''; | ||
} | ||
// revert to last / | ||
if (one[pos] !== '/') { | ||
if (one.charAt(pos) !== '/') { | ||
pos = one.substring(0, pos).lastIndexOf('/'); | ||
@@ -656,3 +656,3 @@ } | ||
v = v + ""; | ||
if (v[0] === _key) { | ||
if (v.charAt(0) === _key) { | ||
v = v.substring(1); | ||
@@ -718,3 +718,3 @@ } | ||
// (for location, not for everything...) | ||
if (!_URI && _object && Object.prototype.toString.call(href) !== "[object Object]") { | ||
if (!_URI && _object && href.pathname !== undefined) { | ||
href = href.toString(); | ||
@@ -837,3 +837,3 @@ } | ||
v += ""; | ||
if (v[0] === ":") { | ||
if (v.charAt(0) === ":") { | ||
v = v.substring(1); | ||
@@ -946,3 +946,3 @@ } | ||
if (v && v[v.length - 1] !== '.') { | ||
if (v && v.charAt(v.length - 1) !== '.') { | ||
v += "."; | ||
@@ -1081,3 +1081,3 @@ } | ||
if (v[0] !== '/') { | ||
if (v.charAt(0) !== '/') { | ||
v = "/" + v; | ||
@@ -1088,3 +1088,3 @@ } | ||
// directories always end with a slash | ||
if (v && v[v.length - 1] !== '/') { | ||
if (v && v.charAt(v.length - 1) !== '/') { | ||
v += '/'; | ||
@@ -1116,3 +1116,3 @@ } | ||
if (v[0] === '/') { | ||
if (v.charAt(0) === '/') { | ||
v = v.substring(1); | ||
@@ -1161,3 +1161,3 @@ } | ||
} else { | ||
if (v[0] === '.') { | ||
if (v.charAt(0) === '.') { | ||
v = v.substring(1); | ||
@@ -1379,4 +1379,4 @@ } | ||
// handle relative paths | ||
if (_path[0] !== '/') { | ||
if (_path[0] === '.') { | ||
if (_path.charAt(0) !== '/') { | ||
if (_path.charAt(0) === '.') { | ||
_was_relative_prefix = _path.substring(0, _path.indexOf('/')); | ||
@@ -1492,3 +1492,3 @@ } | ||
if (uri._parts.hostname && uri._parts.path && uri._parts.path[0] !== '/') { | ||
if (uri._parts.hostname && uri._parts.path && uri._parts.path.charAt(0) !== '/') { | ||
t += '/'; | ||
@@ -1546,3 +1546,3 @@ } | ||
if (resolved.path()[0] !== '/') { | ||
if (resolved.path().charAt(0) !== '/') { | ||
basedir = base.directory(); | ||
@@ -1569,3 +1569,3 @@ resolved._parts.path = (basedir ? (basedir + '/') : '') + resolved._parts.path; | ||
if (this.path()[0] !== '/' || base.path()[0] !== '/') { | ||
if (this.path().charAt(0) !== '/' || base.path().charAt(0) !== '/') { | ||
throw new Error('Cannot calculate common path from non-relative URLs'); | ||
@@ -1576,3 +1576,3 @@ } | ||
common = URI.commonPath(relative.path(), base.path()); | ||
// no relation if there's nothing in common | ||
@@ -1590,3 +1590,3 @@ if (!common || common === '/') { | ||
_this = this.directory(); | ||
// base and this are on the same level | ||
@@ -1593,0 +1593,0 @@ if (_base === _this) { |
@@ -5,3 +5,3 @@ /*! | ||
* | ||
* Version: 1.9.0 | ||
* Version: 1.9.1 | ||
* | ||
@@ -8,0 +8,0 @@ * Author: Rodney Rehm |
120643
362