Merge pull request #2571 from openstreetmap/ie10

Support Internet Explorer 11
This commit is contained in:
Bryan Housel
2015-12-01 14:31:24 -05:00
8 changed files with 31 additions and 15 deletions
+4
View File
@@ -206,6 +206,10 @@ table.tags, table.tags td, table.tags th {
padding: 4px;
}
::-ms-clear {
display: none;
}
/* Grid
------------------------------------------------------- */
+1 -6
View File
@@ -24,7 +24,7 @@ img.tile-removing {
use { pointer-events: none; }
/* base styles */
.layer path { fill: none; }
.layer path:not(.oneway) { fill: none; }
.layer use path { fill: #333; } /* FF svg icons */
g.point .shadow,
@@ -1290,11 +1290,6 @@ text {
fill: #002F35;
}
marker#oneway-marker path {
fill:#000;
opacity: .5;
}
path.oneway {
stroke-width: 6px;
}
+2 -3
View File
@@ -1,7 +1,6 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />
<meta charset='utf-8'>
<title>iD</title>
<link rel='stylesheet' href='iD.css'>
@@ -36,8 +35,8 @@
a.src=document.location.protocol+"//dnn506yrbagrg.cloudfront.net/pages/scripts/0013/6714.js?"+Math.floor(new Date().getTime()/3600000);
a.async=true;a.type="text/javascript";b.parentNode.insertBefore(a,b)}, 1);
if (typeof iD == 'undefined') {
document.getElementById('id-container').innerHTML = 'Sorry, Internet Explorer is not currently supported. Please use Potlatch 2 to edit the map.';
if (typeof iD == 'undefined' || !iD.detect().support) {
document.getElementById('id-container').innerHTML = 'Sorry, your browser is not currently supported. Please use Potlatch 2 to edit the map.';
document.getElementById('id-container').className = 'unsupported';
} else {
var id = iD()
Symlink
+1
View File
@@ -0,0 +1 @@
dist/img
-1
View File
@@ -1,7 +1,6 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />
<meta charset='utf-8'>
<title>iD</title>
<link rel='stylesheet' href='css/reset.css'>
+13 -4
View File
@@ -341,10 +341,17 @@ iD.version = '1.8.0';
var ua = navigator.userAgent,
m = null;
m = ua.match(/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/i); // IE11+
m = ua.match(/(edge)\/?\s*(\.?\d+(\.\d+)*)/i); // Edge
if (m !== null) {
detected.browser = 'msie';
detected.version = m[1];
detected.browser = m[1];
detected.version = m[2];
}
if (!detected.browser) {
m = ua.match(/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/i); // IE11
if (m !== null) {
detected.browser = 'msie';
detected.version = m[1];
}
}
if (!detected.browser) {
m = ua.match(/(opr)\/?\s*(\.?\d+(\.\d+)*)/i); // Opera 15+
@@ -371,9 +378,11 @@ iD.version = '1.8.0';
detected.version = detected.version.split(/\W/).slice(0,2).join('.');
if (detected.browser.toLowerCase() === 'msie') {
detected.ie = true;
detected.browser = 'Internet Explorer';
detected.support = parseFloat(detected.version) > 9;
detected.support = parseFloat(detected.version) >= 11;
} else {
detected.ie = false;
detected.support = true;
}
+6 -1
View File
@@ -27,10 +27,15 @@ iD.svg.Defs = function(context) {
refX: 5,
markerWidth: 2,
markerHeight: 2,
markerUnits: 'strokeWidth',
orient: 'auto'
})
.append('path')
.attr('d', 'M 5 3 L 0 3 L 0 2 L 5 2 L 5 0 L 10 2.5 L 5 5 z');
.attr('class', 'oneway')
.attr('d', 'M 5 3 L 0 3 L 0 2 L 5 2 L 5 0 L 10 2.5 L 5 5 z')
.attr('stroke', 'none')
.attr('fill', '#000')
.attr('opacity', '0.5');
// patterns
var patterns = defs.selectAll('pattern')
+4
View File
@@ -117,6 +117,10 @@ iD.svg.Lines = function(projection) {
oneways
.attr('d', function(d) { return d.d; });
if (iD.detect().ie) {
oneways.each(function() { this.parentNode.insertBefore(this, this); });
}
oneways.exit()
.remove();