Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
rodneyrehm committed Sep 8, 2014
2 parents 44033ee + 1bd6835 commit d3eba41
Show file tree
Hide file tree
Showing 17 changed files with 292 additions and 110 deletions.
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2011 Rodney Rehm

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,17 @@ If you don't like URI.js, you may like one of the following libraries. (If yours

## License ##

URI.js is published under the [MIT license](http://www.opensource.org/licenses/mit-license) and [GPL v3](http://opensource.org/licenses/GPL-3.0).
URI.js is published under the [MIT license](http://www.opensource.org/licenses/mit-license). Until version 1.13.2 URI.js was also published under the [GPL v3](http://opensource.org/licenses/GPL-3.0) license - but as this dual-licensing causes more questions than helps anyone, it was dropped with version 1.14.0.


## Changelog ##

### master branch ###
### 1.14.0 (September 8th 2014) ###

* adding Hungarian second level domains - ([Issue #159](https://github.com/medialize/URI.js/issues/159))
* adding `<audio src="…">` and `<video src="…">` to supported DOM attributes - ([Issue #160](https://github.com/medialize/URI.js/issues/160)), ([Issue #161](https://github.com/medialize/URI.js/issues/161))
* fixing `file://hostname/path` parsing - ([Issue #158](https://github.com/medialize/URI.js/issues/158))
* fixing `.decodePathSegment()` to not throw malformed URI error - ([Issue #163](https://github.com/medialize/URI.js/issues/163))

### 1.13.2 (May 29th 2014) ###

Expand Down
2 changes: 1 addition & 1 deletion URI.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"URI-manipulation",
"URL-manipulation"
],
"version": "1.13.2",
"version": "1.14.0",
"author": {
"name": "Rodney Rehm",
"url": "http://rodneyrehm.de/en/"
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "URIjs",
"version": "1.13.2",
"version": "1.14.0",
"main": [
"src/URI.js",
"src/IPv6.js",
Expand Down
2 changes: 1 addition & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function build(files) {
output_format: "text",
output_info: "compiled_code"
}, function(data) {
var code = "/*! URI.js v1.13.2 http://medialize.github.io/URI.js/ */\n/* build contains: " + files.join(', ') + " */\n" + data;
var code = "/*! URI.js v1.14.0 http://medialize.github.io/URI.js/ */\n/* build contains: " + files.join(', ') + " */\n" + data;
$progress.hide();
$out.val(code).parent().show();
$out.prev().find('a').remove();
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "URIjs",
"description": "URI.js is a Javascript library for working with URLs.",
"version": "1.13.2",
"version": "1.14.0",
"repo": "medialize/URI.js",
"scripts": [
"src/URI.js",
Expand Down
2 changes: 1 addition & 1 deletion docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ <h3 id="static-withinString">URI.withinString()</h3>
var uri = new URI(url);
uri.normalize();
return "&lt;a href="" + escapeHtml(uri) + ""&gt;"
+ escapeHtml(url.<a href="#readable">readable</a>()) + "&lt;/a&gt;";
+ escapeHtml(uri.<a href="#readable">readable</a>()) + "&lt;/a&gt;";
});
</pre>
<p>As of URI.js 1.12.0 withinString accepts the following parameters:</p>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "URIjs",
"version": "1.13.2",
"version": "1.14.0",
"title": "URI.js - Mutating URLs",
"author": {
"name": "Rodney Rehm",
Expand Down
2 changes: 1 addition & 1 deletion src/IPv6.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* URI.js - Mutating URLs
* IPv6 Support
*
* Version: 1.13.2
* Version: 1.14.0
*
* Author: Rodney Rehm
* Web: http://medialize.github.io/URI.js/
Expand Down
3 changes: 2 additions & 1 deletion src/SecondLevelDomains.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* URI.js - Mutating URLs
* Second Level Domain (SLD) Support
*
* Version: 1.13.2
* Version: 1.14.0
*
* Author: Rodney Rehm
* Web: http://medialize.github.io/URI.js/
Expand Down Expand Up @@ -80,6 +80,7 @@
'gt':' com edu gob ind mil net org ',
'gu':' com edu gov net org ',
'hk':' com edu gov idv net org ',
'hu':' 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ',
'id':' ac co go mil net or sch web ',
'il':' ac co gov idf k12 muni net org ',
'in':' ac co edu ernet firm gen gov i ind mil net nic org res ',
Expand Down
31 changes: 17 additions & 14 deletions src/URI.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* URI.js - Mutating URLs
*
* Version: 1.13.2
* Version: 1.14.0
*
* Author: Rodney Rehm
* Web: http://medialize.github.io/URI.js/
Expand Down Expand Up @@ -57,7 +57,7 @@
return this;
}

URI.version = '1.13.2';
URI.version = '1.14.0';

var p = URI.prototype;
var hasOwn = Object.prototype.hasOwnProperty;
Expand Down Expand Up @@ -225,7 +225,9 @@
'embed': 'src',
'source': 'src',
'track': 'src',
'input': 'src' // but only if type="image"
'input': 'src', // but only if type="image"
'audio': 'src',
'video': 'src'
};
URI.getDomAttribute = function(node) {
if (!node || !node.nodeName) {
Expand Down Expand Up @@ -365,9 +367,17 @@
var _part;
var generateAccessor = function(_group, _part) {
return function(string) {
return URI[_part](string + '').replace(URI.characters[_group][_part].expression, function(c) {
return URI.characters[_group][_part].map[c];
});
try {
return URI[_part](string + '').replace(URI.characters[_group][_part].expression, function(c) {
return URI.characters[_group][_part].map[c];
});
} catch (e) {
// we're not going to mess with weird encodings,
// give up and return the undecoded original string
// see https://github.com/medialize/URI.js/issues/87
// see https://github.com/medialize/URI.js/issues/92
return string;
}
};
};

Expand Down Expand Up @@ -414,9 +424,6 @@
if (parts.protocol && !parts.protocol.match(URI.protocol_expression)) {
// : may be within the path
parts.protocol = undefined;
} else if (parts.protocol === 'file') {
// the file scheme: does not contain an authority
string = string.substring(pos + 3);
} else if (string.substring(pos + 1, pos + 3) === '//') {
string = string.substring(pos + 3);

Expand Down Expand Up @@ -480,11 +487,7 @@
URI.parseUserinfo = function(string, parts) {
// extract username:password
var firstSlash = string.indexOf('/');
/*jshint laxbreak: true */
var pos = firstSlash > -1
? string.lastIndexOf('@', firstSlash)
: string.indexOf('@');
/*jshint laxbreak: false */
var pos = string.lastIndexOf('@', firstSlash > -1 ? firstSlash : string.length - 1);
var t;

// authority@ must come before /path
Expand Down
Loading

0 comments on commit d3eba41

Please sign in to comment.