Skip to content

Commit b9af37e

Browse files
committed
Build 0.33.0
1 parent 19b1396 commit b9af37e

File tree

6 files changed

+88
-40
lines changed

6 files changed

+88
-40
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tincan",
3-
"version": "0.32.0",
3+
"version": "0.33.0",
44
"homepage": "http://rusticisoftware.github.com/TinCanJS/",
55
"authors": [
66
"Brian J. Miller <brian.miller@scorm.com>"

build/tincan-min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/tincan-min.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/tincan-node.js

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"0.32.0";
1+
"0.33.0";
22
/*
33
CryptoJS v3.0.2
44
code.google.com/p/crypto-js
@@ -1640,26 +1640,50 @@ TinCan client library
16401640
@private
16411641
*/
16421642
parseURL: function (url) {
1643-
var parts = String(url).split("?"),
1644-
pairs,
1645-
pair,
1646-
i,
1647-
params = {}
1648-
;
1649-
if (parts.length === 2) {
1650-
pairs = parts[1].split("&");
1651-
for (i = 0; i < pairs.length; i += 1) {
1652-
pair = pairs[i].split("=");
1653-
if (pair.length === 2 && pair[0]) {
1654-
params[pair[0]] = decodeURIComponent(pair[1]);
1655-
}
1643+
//
1644+
// see http://stackoverflow.com/a/21553982
1645+
// and http://stackoverflow.com/a/2880929
1646+
//
1647+
var reURLInformation,
1648+
match,
1649+
result,
1650+
paramMatch,
1651+
pl = /\+/g, // Regex for replacing addition symbol with a space
1652+
search = /([^&=]+)=?([^&]*)/g,
1653+
decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); };
1654+
1655+
reURLInformation = new RegExp(
1656+
[
1657+
"^(https?:)//", // protocol
1658+
"(([^:/?#]*)(?::([0-9]+))?)", // host (hostname and port)
1659+
"(/[^?#]*)", // pathname
1660+
"(\\?[^#]*|)", // search
1661+
"(#.*|)$" // hash
1662+
].join("")
1663+
);
1664+
match = url.match(reURLInformation);
1665+
result = {
1666+
protocol: match[1],
1667+
host: match[2],
1668+
hostname: match[3],
1669+
port: match[4],
1670+
pathname: match[5],
1671+
search: match[6],
1672+
hash: match[7],
1673+
params: {}
1674+
};
1675+
1676+
// 'path' is for backwards compatibility
1677+
result.path = result.protocol + "//" + result.host + result.pathname;
1678+
1679+
if (result.search !== "") {
1680+
// extra parens to let jshint know this is an expression
1681+
while ((paramMatch = search.exec(result.search.substring(1)))) {
1682+
result.params[decode(paramMatch[1])] = decode(paramMatch[2]);
16561683
}
16571684
}
16581685

1659-
return {
1660-
path: parts[0],
1661-
params: params
1662-
};
1686+
return result;
16631687
},
16641688

16651689
/**

build/tincan.js

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"0.32.0";
1+
"0.33.0";
22
/*
33
CryptoJS v3.0.2
44
code.google.com/p/crypto-js
@@ -1640,26 +1640,50 @@ TinCan client library
16401640
@private
16411641
*/
16421642
parseURL: function (url) {
1643-
var parts = String(url).split("?"),
1644-
pairs,
1645-
pair,
1646-
i,
1647-
params = {}
1648-
;
1649-
if (parts.length === 2) {
1650-
pairs = parts[1].split("&");
1651-
for (i = 0; i < pairs.length; i += 1) {
1652-
pair = pairs[i].split("=");
1653-
if (pair.length === 2 && pair[0]) {
1654-
params[pair[0]] = decodeURIComponent(pair[1]);
1655-
}
1643+
//
1644+
// see http://stackoverflow.com/a/21553982
1645+
// and http://stackoverflow.com/a/2880929
1646+
//
1647+
var reURLInformation,
1648+
match,
1649+
result,
1650+
paramMatch,
1651+
pl = /\+/g, // Regex for replacing addition symbol with a space
1652+
search = /([^&=]+)=?([^&]*)/g,
1653+
decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); };
1654+
1655+
reURLInformation = new RegExp(
1656+
[
1657+
"^(https?:)//", // protocol
1658+
"(([^:/?#]*)(?::([0-9]+))?)", // host (hostname and port)
1659+
"(/[^?#]*)", // pathname
1660+
"(\\?[^#]*|)", // search
1661+
"(#.*|)$" // hash
1662+
].join("")
1663+
);
1664+
match = url.match(reURLInformation);
1665+
result = {
1666+
protocol: match[1],
1667+
host: match[2],
1668+
hostname: match[3],
1669+
port: match[4],
1670+
pathname: match[5],
1671+
search: match[6],
1672+
hash: match[7],
1673+
params: {}
1674+
};
1675+
1676+
// 'path' is for backwards compatibility
1677+
result.path = result.protocol + "//" + result.host + result.pathname;
1678+
1679+
if (result.search !== "") {
1680+
// extra parens to let jshint know this is an expression
1681+
while ((paramMatch = search.exec(result.search.substring(1)))) {
1682+
result.params[decode(paramMatch[1])] = decode(paramMatch[2]);
16561683
}
16571684
}
16581685

1659-
return {
1660-
path: parts[0],
1661-
params: params
1662-
};
1686+
return result;
16631687
},
16641688

16651689
/**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "tincanjs",
33
"description": "Tin Can API Library",
4-
"version": "0.32.0",
4+
"version": "0.33.0",
55
"private": false,
66
"main": "build/tincan-node.js",
77
"directories": {

0 commit comments

Comments
 (0)