mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Merge branch 'master' of https://github.com/openstreetmap/iD
This commit is contained in:
Vendored
+2
-18
@@ -18,28 +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);
|
||||
})();
|
||||
|
||||
// crazyegg
|
||||
setTimeout(function(){var a=document.createElement('script');
|
||||
var b=document.getElementsByTagName('script')[0];
|
||||
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' || !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));
|
||||
|
||||
@@ -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
@@ -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');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user