Use conditional comments for IE handling. Fixes #1167

This commit is contained in:
Tom MacWright
2013-03-28 13:47:41 -04:00
parent 92ceae911c
commit fc497f16d8
3 changed files with 15 additions and 26 deletions

View File

@@ -191,16 +191,11 @@
<body>
<div id='iD'></div>
<script>
var div = document.getElementById('iD');
if (!iD.detect().support) {
iD.unsupported(div);
} else {
iD.data.load(function() {
id = iD();
d3.select(div)
.call(id.ui());
})
}
iD.data.load(function() {
id = iD();
d3.select("#iD")
.call(id.ui());
});
</script>
</body>
</html>

View File

@@ -19,10 +19,12 @@
Raven.config('https://af8ce79129b24fa28d91ede59302369c@app.getsentry.com/6009').install();
</script>
<script src='iD.js'></script>
<!--[if !IE || gte IE 9]><!-->
<script src='iD.js'></script>
<!-- <![endif]-->
</head>
<body>
<div id='iD'></div>
<div id='id-container'></div>
<script>
// google analytics
var _gaq = _gaq || [];
@@ -40,12 +42,14 @@
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);
var div = document.getElementById('iD');
if (!iD.detect().support) {
iD.unsupported(div);
if (typeof iD == 'undefined') {
document.getElementById('id-container').innerHTML = 'This editor is supported ' +
'in Firefox, Chrome, Safari, Opera, and Internet Explorer 9 and above. ' +
'Please upgrade your browser or use Potlatch 2 to edit the map.';
document.getElementById('id-container').className = 'unsupported';
} else {
var id = iD();
d3.select(div)
d3.select('#id-container')
.call(id.ui());
}
</script>

View File

@@ -184,13 +184,3 @@ iD.detect = function() {
return browser;
};
iD.unsupported = function(div) {
try {
div.innerHTML = t('browser_notice');
} catch(e) {
div.innerHTML = 'This editor is supported in Firefox, Chrome, Safari, Opera, and Internet Explorer 9 and above. ' +
'Please upgrade your browser or use Potlatch 2 to edit the map.';
}
div.className = 'unsupported';
};