summaryrefslogtreecommitdiffstats
path: root/js/vendor/js-url
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2015-09-26 11:43:36 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2015-09-26 11:43:36 +0200
commitc6ecb54be7a99b7f3ad9d601100f89151380d3b7 (patch)
tree8fd8e7cd26d907e03aad90003d07b00bf6b5ceb1 /js/vendor/js-url
parent847d9da9226383e69ff02c20bebf46a597e7f7d7 (diff)
update js deps
Diffstat (limited to 'js/vendor/js-url')
-rw-r--r--js/vendor/js-url/.bower.json8
-rw-r--r--js/vendor/js-url/README.md9
-rw-r--r--js/vendor/js-url/tests.js5
-rw-r--r--js/vendor/js-url/url.js11
-rw-r--r--js/vendor/js-url/url.min.js2
5 files changed, 24 insertions, 11 deletions
diff --git a/js/vendor/js-url/.bower.json b/js/vendor/js-url/.bower.json
index a54d6c1a6..1a1e6ead0 100644
--- a/js/vendor/js-url/.bower.json
+++ b/js/vendor/js-url/.bower.json
@@ -1,12 +1,12 @@
{
"name": "js-url",
"homepage": "https://github.com/websanova/js-url",
- "version": "1.8.6",
- "_release": "1.8.6",
+ "version": "1.8.8",
+ "_release": "1.8.8",
"_resolution": {
"type": "version",
- "tag": "v1.8.6",
- "commit": "ccc5961533b9d0e145dfe352c9c1707dfd2180e1"
+ "tag": "v1.8.8",
+ "commit": "8bf3b91598ac153192675f4bc5060dd357f8f3ba"
},
"_source": "git://github.com/websanova/js-url.git",
"_target": "~1.8.*",
diff --git a/js/vendor/js-url/README.md b/js/vendor/js-url/README.md
index 0be785102..b33154369 100644
--- a/js/vendor/js-url/README.md
+++ b/js/vendor/js-url/README.md
@@ -3,7 +3,11 @@
A simple, lightweight url parser for JavaScript (~1.6 Kb minified, ~0.6Kb gzipped).
* [View the url demo](http://url.websanova.com)
-* [Download the lastest version of url](https://github.com/websanova/url/tags)
+* [Download the lastest version of url](https://github.com/websanova/js-url/tags)
+
+Also available for Node.js.
+
+* [Download the lastest version of node-url](https://github.com/websanova/node-url/tags)
## Notes
@@ -77,7 +81,6 @@ If you want to use Grunt you will need to install the required plugins locally u
## Resources
* [More jQuery plugins by Websanova](http://websanova.com/plugins)
-* [Websanova JavaScript Extensions Project](http://websanova.com/extensions)
* [jQuery Plugin Development Boilerplate](http://wboiler.websanova.com)
* [The Ultimate Guide to Writing jQuery Plugins](http://www.websanova.com/blog/jquery/the-ultimate-guide-to-writing-jquery-plugins)
@@ -86,4 +89,4 @@ If you want to use Grunt you will need to install the required plugins locally u
MIT licensed
-Copyright (C) 2011-2012 Websanova http://www.websanova.com \ No newline at end of file
+Copyright (C) 2011-2012 Websanova http://www.websanova.com
diff --git a/js/vendor/js-url/tests.js b/js/vendor/js-url/tests.js
index 6c44d6d52..4e630e04e 100644
--- a/js/vendor/js-url/tests.js
+++ b/js/vendor/js-url/tests.js
@@ -109,6 +109,11 @@ test('query string', function() {
deepEqual( window.url( '?poo', 'http://domain.com?poo' ), '' );
deepEqual( window.url( '?poo', 'http://domain.com?' ), null );
deepEqual( window.url( '?poo', 'http://domain.com' ), null );
+
+ deepEqual( window.url( '?poo', 'http://domain.com?poo=a+b' ), 'a b' );
+ deepEqual( window.url( '?poo', 'http://domain.com?poo=javascript%20decode%20uri%20%2B%20sign%20to%20space' ), 'javascript decode uri + sign to space' );
+
+ deepEqual( window.url( '?key', 'http://domain.com?key=value=va?key2=value' ), 'value=va');
});
test('url fragment', function() {
diff --git a/js/vendor/js-url/url.js b/js/vendor/js-url/url.js
index e1a26c08c..169f86334 100644
--- a/js/vendor/js-url/url.js
+++ b/js/vendor/js-url/url.js
@@ -2,6 +2,10 @@ window.url = (function() {
function isNumeric(arg) {
return !isNaN(parseFloat(arg)) && isFinite(arg);
}
+
+ function decode(str) {
+ return decodeURIComponent(str.replace(/\+/g, ' '));
+ }
return function(arg, url) {
var _ls = url || window.location.toString();
@@ -56,15 +60,16 @@ window.url = (function() {
if(arg.charAt(0) === '?') { params = (params.split('?')[1] || '').split('#')[0]; }
else if(arg.charAt(0) === '#') { params = (params.split('#')[1] || ''); }
- if(!arg.charAt(1)) { return params; }
+ if(!arg.charAt(1)) { return (params ? decode(params) : params); }
arg = arg.substring(1);
params = params.split('&');
for(var i=0,ii=params.length; i<ii; i++)
{
- param = params[i].split('=');
- if(param[0] === arg) { return param[1] || ''; }
+ param = params[i].split(/(.*?)=(.*)/).filter(Boolean);
+
+ if(param[0] === arg) { return (param[1] ? decode(param[1]) : param[1]) || ''; }
}
return null;
diff --git a/js/vendor/js-url/url.min.js b/js/vendor/js-url/url.min.js
index 8057e0aa0..e7854ce59 100644
--- a/js/vendor/js-url/url.min.js
+++ b/js/vendor/js-url/url.min.js
@@ -1 +1 @@
-/*! url - v1.8.6 - 2013-11-22 */window.url=function(){function a(a){return!isNaN(parseFloat(a))&&isFinite(a)}return function(b,c){var d=c||window.location.toString();if(!b)return d;b=b.toString(),"//"===d.substring(0,2)?d="http:"+d:1===d.split("://").length&&(d="http://"+d),c=d.split("/");var e={auth:""},f=c[2].split("@");1===f.length?f=f[0].split(":"):(e.auth=f[0],f=f[1].split(":")),e.protocol=c[0],e.hostname=f[0],e.port=f[1]||("https"===e.protocol.split(":")[0].toLowerCase()?"443":"80"),e.pathname=(c.length>3?"/":"")+c.slice(3,c.length).join("/").split("?")[0].split("#")[0];var g=e.pathname;"/"===g.charAt(g.length-1)&&(g=g.substring(0,g.length-1));var h=e.hostname,i=h.split("."),j=g.split("/");if("hostname"===b)return h;if("domain"===b)return/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/.test(h)?h:i.slice(-2).join(".");if("sub"===b)return i.slice(0,i.length-2).join(".");if("port"===b)return e.port;if("protocol"===b)return e.protocol.split(":")[0];if("auth"===b)return e.auth;if("user"===b)return e.auth.split(":")[0];if("pass"===b)return e.auth.split(":")[1]||"";if("path"===b)return e.pathname;if("."===b.charAt(0)){if(b=b.substring(1),a(b))return b=parseInt(b,10),i[0>b?i.length+b:b-1]||""}else{if(a(b))return b=parseInt(b,10),j[0>b?j.length+b:b]||"";if("file"===b)return j.slice(-1)[0];if("filename"===b)return j.slice(-1)[0].split(".")[0];if("fileext"===b)return j.slice(-1)[0].split(".")[1]||"";if("?"===b.charAt(0)||"#"===b.charAt(0)){var k=d,l=null;if("?"===b.charAt(0)?k=(k.split("?")[1]||"").split("#")[0]:"#"===b.charAt(0)&&(k=k.split("#")[1]||""),!b.charAt(1))return k;b=b.substring(1),k=k.split("&");for(var m=0,n=k.length;n>m;m++)if(l=k[m].split("="),l[0]===b)return l[1]||"";return null}}return""}}(),"undefined"!=typeof jQuery&&jQuery.extend({url:function(a,b){return window.url(a,b)}}); \ No newline at end of file
+/*! url - v1.8.6 - 2015-08-21 */window.url=function(){function a(a){return!isNaN(parseFloat(a))&&isFinite(a)}function b(a){return decodeURIComponent(a.replace(/\+/g," "))}return function(c,d){var e=d||window.location.toString();if(!c)return e;c=c.toString(),"//"===e.substring(0,2)?e="http:"+e:1===e.split("://").length&&(e="http://"+e),d=e.split("/");var f={auth:""},g=d[2].split("@");1===g.length?g=g[0].split(":"):(f.auth=g[0],g=g[1].split(":")),f.protocol=d[0],f.hostname=g[0],f.port=g[1]||("https"===f.protocol.split(":")[0].toLowerCase()?"443":"80"),f.pathname=(d.length>3?"/":"")+d.slice(3,d.length).join("/").split("?")[0].split("#")[0];var h=f.pathname;"/"===h.charAt(h.length-1)&&(h=h.substring(0,h.length-1));var i=f.hostname,j=i.split("."),k=h.split("/");if("hostname"===c)return i;if("domain"===c)return/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/.test(i)?i:j.slice(-2).join(".");if("sub"===c)return j.slice(0,j.length-2).join(".");if("port"===c)return f.port;if("protocol"===c)return f.protocol.split(":")[0];if("auth"===c)return f.auth;if("user"===c)return f.auth.split(":")[0];if("pass"===c)return f.auth.split(":")[1]||"";if("path"===c)return f.pathname;if("."===c.charAt(0)){if(c=c.substring(1),a(c))return c=parseInt(c,10),j[0>c?j.length+c:c-1]||""}else{if(a(c))return c=parseInt(c,10),k[0>c?k.length+c:c]||"";if("file"===c)return k.slice(-1)[0];if("filename"===c)return k.slice(-1)[0].split(".")[0];if("fileext"===c)return k.slice(-1)[0].split(".")[1]||"";if("?"===c.charAt(0)||"#"===c.charAt(0)){var l=e,m=null;if("?"===c.charAt(0)?l=(l.split("?")[1]||"").split("#")[0]:"#"===c.charAt(0)&&(l=l.split("#")[1]||""),!c.charAt(1))return l?b(l):l;c=c.substring(1),l=l.split("&");for(var n=0,o=l.length;o>n;n++)if(m=l[n].split(/(.*?)=(.*)/).filter(Boolean),m[0]===c)return(m[1]?b(m[1]):m[1])||"";return null}}return""}}(),"undefined"!=typeof jQuery&&jQuery.extend({url:function(a,b){return window.url(a,b)}}); \ No newline at end of file