Remove Google Analytics, also actually export iD.utilDetect

This commit is contained in:
Bryan Housel
2019-05-02 19:12:14 -04:00
parent 70b57d1e15
commit ff1eea43a8
3 changed files with 11 additions and 20 deletions
+2 -12
View File
@@ -18,22 +18,12 @@
<body>
<div id='id-container'></div>
<script>
// google analytics
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-38039653-2']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
if (typeof iD == 'undefined' || !iD.Detect().support) {
if (typeof iD == 'undefined' || !iD.utilDetect().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.Context();
var id = iD.coreContext();
// disable boundaries (unless we have an explicit disable_features list)
var q = iD.utilStringQs(window.location.hash.substring(1));
+1
View File
@@ -10,6 +10,7 @@ export { utilArrayUniqBy } from './array';
export { utilAsyncMap } from './util';
export { utilCallWhenIdle } from './idle';
export { utilCleanTags } from './clean_tags';
export { utilDetect } from './detect';
export { utilDisplayName } from './util';
export { utilDisplayNameForPath } from './util';
export { utilDisplayType } from './util';
+8 -8
View File
@@ -1,8 +1,8 @@
describe('iD.uiCmd', function () {
var orig,
ua = navigator.userAgent,
isPhantom = (navigator.userAgent.match(/PhantomJS/) !== null),
uaMock = function () { return ua; };
var orig;
var ua = navigator.userAgent;
var isPhantom = (navigator.userAgent.match(/PhantomJS/) !== null);
var uaMock = function () { return ua; };
beforeEach(function() {
/* eslint-disable no-global-assign */
@@ -28,13 +28,13 @@ describe('iD.uiCmd', function () {
it('does not overwrite mac keybindings', function () {
ua = 'Mac';
iD.Detect(true); // force redetection
iD.utilDetect(true); // force redetection
expect(iD.uiCmd('⌘A')).to.eql('⌘A');
});
it('changes keys to linux versions', function () {
ua = 'Linux';
iD.Detect(true); // force redetection
iD.utilDetect(true); // force redetection
expect(iD.uiCmd('⌘⌫')).to.eql('Ctrl+Backspace');
expect(iD.uiCmd('⌘A')).to.eql('Ctrl+A');
expect(iD.uiCmd('⇧A')).to.eql('Shift+A');
@@ -44,7 +44,7 @@ describe('iD.uiCmd', function () {
it('changes keys to win versions', function () {
ua = 'Win';
iD.Detect(true); // force redetection
iD.utilDetect(true); // force redetection
expect(iD.uiCmd('⌘⌫')).to.eql('Ctrl+Backspace');
expect(iD.uiCmd('⌘A')).to.eql('Ctrl+A');
expect(iD.uiCmd('⇧A')).to.eql('Shift+A');
@@ -54,7 +54,7 @@ describe('iD.uiCmd', function () {
it('handles multi-character keys', function () {
ua = 'Win';
iD.Detect(true); // force redetection
iD.utilDetect(true); // force redetection
expect(iD.uiCmd('f11')).to.eql('f11');
expect(iD.uiCmd('⌘plus')).to.eql('Ctrl+plus');
});