From b9bbc051f2b67cddff1f22a43f4eefbc3d7518c3 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 30 Mar 2015 22:14:54 -0400 Subject: [PATCH 1/5] Hide IE clear field icon https://github.com/openstreetmap/iD/issues/1431#issuecomment-87894373 --- css/app.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/css/app.css b/css/app.css index 7a8269395..247fab1b5 100644 --- a/css/app.css +++ b/css/app.css @@ -206,6 +206,10 @@ table.tags, table.tags td, table.tags th { padding: 4px; } +::-ms-clear { + display: none; +} + /* Grid ------------------------------------------------------- */ From 9d8eba6e1d49c624fdf0d5ce5da72bedcce607f2 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 30 Mar 2015 22:40:49 -0400 Subject: [PATCH 2/5] add symbolic link to img so IE can find cursors https://github.com/openstreetmap/iD/issues/1431#issuecomment-87899497 --- img | 1 + 1 file changed, 1 insertion(+) create mode 120000 img diff --git a/img b/img new file mode 120000 index 000000000..aab814b92 --- /dev/null +++ b/img @@ -0,0 +1 @@ +dist/img \ No newline at end of file From 16ca10708b2c3f6d61c0ec1b05f57533be7ba925 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Thu, 26 Nov 2015 01:11:46 -0500 Subject: [PATCH 3/5] Fix oneway markers in IE --- css/map.css | 7 +------ js/id/id.js | 2 ++ js/id/svg/defs.js | 7 ++++++- js/id/svg/lines.js | 4 ++++ 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/css/map.css b/css/map.css index 4a371b7a9..4f27b635a 100644 --- a/css/map.css +++ b/css/map.css @@ -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; } diff --git a/js/id/id.js b/js/id/id.js index bcc7f96e2..b04565e5a 100644 --- a/js/id/id.js +++ b/js/id/id.js @@ -371,9 +371,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; } else { + detected.ie = false detected.support = true; } diff --git a/js/id/svg/defs.js b/js/id/svg/defs.js index a9a5660f3..03054e377 100644 --- a/js/id/svg/defs.js +++ b/js/id/svg/defs.js @@ -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') diff --git a/js/id/svg/lines.js b/js/id/svg/lines.js index 30a6aaf7b..474057fd1 100644 --- a/js/id/svg/lines.js +++ b/js/id/svg/lines.js @@ -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(); From a117862e3f11327426f4722c314a88b1a4cb7df6 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Thu, 26 Nov 2015 01:52:47 -0500 Subject: [PATCH 4/5] Detect Edge useragent --- js/id/id.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/js/id/id.js b/js/id/id.js index b04565e5a..401a2e3ee 100644 --- a/js/id/id.js +++ b/js/id/id.js @@ -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+ @@ -373,9 +380,9 @@ iD.version = '1.8.0'; 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.ie = false; detected.support = true; } From 949935d8464d9e188725f90202ac52ab21452302 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Tue, 1 Dec 2015 14:25:32 -0500 Subject: [PATCH 5/5] Check iD.detect().support instead of relying on conditional IE comment --- dist/index.html | 5 ++--- index.html | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dist/index.html b/dist/index.html index a00ac7b06..b3e7c19e3 100644 --- a/dist/index.html +++ b/dist/index.html @@ -1,7 +1,6 @@ - iD @@ -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() diff --git a/index.html b/index.html index 24410198f..42522a2bf 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,6 @@ - iD