Port IE bugfix to latest (was 0.6.3)

This commit is contained in:
Kegan Myers 2014-04-17 23:34:22 -05:00
parent b84f10b88f
commit 0a0645518c
7 changed files with 13 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "Typertext", "name": "Typertext",
"version": "0.7.1", "version": "0.7.2",
"homepage": "https://github.com/terribleplan/Typertext", "homepage": "https://github.com/terribleplan/Typertext",
"authors": [ "authors": [
"Kegan Myers <kegan@keganmyers.com>" "Kegan Myers <kegan@keganmyers.com>"

View File

@ -206,6 +206,9 @@ var Typertext;
HttpUrl.FromUrl = function (location) { HttpUrl.FromUrl = function (location) {
var l = document.createElement("a"); var l = document.createElement("a");
l.href = location; l.href = location;
if (!l.hostname || !l.protocol || !l.pathname || !l.search || !l.port) {
l.href = l.href;
}
return new HttpUrl(l.hostname, Typertext.Http.HttpProtocol[l.protocol.slice(0, -1)], l.pathname, HttpUrl.DecodeQueryString(l.search), parseInt(l.port)); return new HttpUrl(l.hostname, Typertext.Http.HttpProtocol[l.protocol.slice(0, -1)], l.pathname, HttpUrl.DecodeQueryString(l.search), parseInt(l.port));
}; };

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -35,6 +35,11 @@ module Typertext.Http {
public static FromUrl(location:string):HttpUrl { public static FromUrl(location:string):HttpUrl {
var l = document.createElement("a"); var l = document.createElement("a");
l.href = location; l.href = location;
if (!l.hostname || !l.protocol || !l.pathname || !l.search || !l.port) {
//This may seem silly, but it is serious business for IE and relative URLs
//noinspection SillyAssignmentJS
l.href = l.href;
}
return new HttpUrl(l.hostname, HttpProtocol[l.protocol.slice(0,-1)], l.pathname, HttpUrl.DecodeQueryString(l.search), parseInt(l.port)) return new HttpUrl(l.hostname, HttpProtocol[l.protocol.slice(0,-1)], l.pathname, HttpUrl.DecodeQueryString(l.search), parseInt(l.port))
} }

View File

@ -5,7 +5,7 @@
"type": "git", "type": "git",
"url": "https://github.com/terribleplan/Typertext.git" "url": "https://github.com/terribleplan/Typertext.git"
}, },
"version": "0.7.1", "version": "0.7.2",
"devDependencies": { "devDependencies": {
"grunt": "~0.4.2", "grunt": "~0.4.2",
"grunt-cli": "~0.1.13", "grunt-cli": "~0.1.13",