mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-12 16:52:50 +00:00
Use conditional comments for IE handling. Fixes #1167
This commit is contained in:
15
index.html
15
index.html
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
10
js/id/id.js
10
js/id/id.js
@@ -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';
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user