Remove unnecessary window parameter to Context

This commit is contained in:
Bryan Housel
2016-11-10 15:19:03 -05:00
parent e606f4713f
commit f800e5afbc
25 changed files with 32 additions and 32 deletions
+3 -3
View File
@@ -147,7 +147,7 @@ iD can use external presets exclusively or along with the default OpenStreetMap
```js
var id = iD.Context(window)
var id = iD.Context()
.presets(customPresets)
.imagery(iD.dataImagery);
@@ -161,7 +161,7 @@ Just like Presets, Imagery can be configured using the `context.imagery` accesso
```js
var id = iD.Context(window)
var id = iD.Context()
.presets(customPresets)
.imagery(customImagery);
@@ -176,7 +176,7 @@ The minimum zoom at which iD enters the edit mode is configured using the `conte
```js
var id = iD.Context(window).
var id = iD.Context()
.minEditableZoom(zoom_level)
```
+1 -1
View File
@@ -236,7 +236,7 @@ iD supports deployments which use a custom set of presets. You can supply preset
the `presets` accessor:
```js
var id = iD.Context(window).presets({
var id = iD.Context().presets({
presets: { ... },
fields: { ... },
defaults: { ... },
+1 -1
View File
@@ -17,7 +17,7 @@
<body>
<div id='id-container'></div>
<script>
id = iD.Context(window)
id = iD.Context()
.presets(iD.dataPresets)
.imagery(iD.dataImagery)
.assetPath('dist/');
+1 -1
View File
@@ -1,7 +1,7 @@
describe('iD.actionSplit', function () {
beforeEach(function () {
iD.areaKeys = iD.Context(window)
iD.areaKeys = iD.Context()
.presets(iD.dataPresets).presets().areaKeys();
});
+1 -1
View File
@@ -4,7 +4,7 @@ describe('iD.behaviorHash', function () {
var hash, context;
beforeEach(function () {
context = iD.Context(window);
context = iD.Context();
context.container(d3.select(document.createElement('div')));
// Neuter connection
+1 -1
View File
@@ -2,7 +2,7 @@ describe('iD.behaviorLasso', function () {
var lasso, context;
beforeEach(function () {
context = iD.Context(window).imagery(iD.dataImagery);
context = iD.Context().imagery(iD.dataImagery);
context.container(d3.select(document.createElement('div')));
// Neuter connection
+1 -1
View File
@@ -3,7 +3,7 @@ describe('iD.behaviorSelect', function() {
beforeEach(function() {
container = d3.select('body').append('div');
context = iD.Context(window).imagery(iD.dataImagery).container(container);
context = iD.Context().imagery(iD.dataImagery).container(container);
a = iD.Node({loc: [0, 0]});
b = iD.Node({loc: [0, 0]});
+6 -6
View File
@@ -5,7 +5,7 @@ describe('iD.Context', function() {
describe('#assetPath', function() {
it('sets and gets assetPath', function() {
var context = iD.Context(window);
var context = iD.Context();
expect(context.assetPath()).to.eql('');
context.assetPath('iD/');
@@ -15,7 +15,7 @@ describe('iD.Context', function() {
describe('#assetMap', function() {
it('sets and gets assetMap', function() {
var context = iD.Context(window);
var context = iD.Context();
expect(context.assetMap()).to.eql({});
context.assetMap(assets);
@@ -26,7 +26,7 @@ describe('iD.Context', function() {
describe('#asset', function() {
var context;
beforeEach(function() {
context = iD.Context(window).assetPath('iD/').assetMap(assets);
context = iD.Context().assetPath('iD/').assetMap(assets);
});
it('looks first in assetMap', function() {
@@ -40,7 +40,7 @@ describe('iD.Context', function() {
describe('#imagePath', function() {
var context;
beforeEach(function() {
context = iD.Context(window).assetPath('iD/').assetMap(assets);
context = iD.Context().assetPath('iD/').assetMap(assets);
});
it('looks first in assetMap', function() {
@@ -91,7 +91,7 @@ describe('iD.Context', function() {
}
};
var context = iD.Context(window).presets(presetsCollection),
var context = iD.Context().presets(presetsCollection),
way = iD.Way({tags: {concession: 'mining', area: 'yes'}}),
graph = iD.Graph([way]);
@@ -101,7 +101,7 @@ describe('iD.Context', function() {
describe('#debug', function() {
it('sets and gets debug flags', function() {
var context = iD.Context(window),
var context = iD.Context(),
flags = {
tile: false,
collision: false,
+1 -1
View File
@@ -3,7 +3,7 @@ describe('iD.History', function () {
action = function() { return iD.Graph(); };
beforeEach(function () {
context = iD.Context(window);
context = iD.Context();
history = context.history();
spy = sinon.spy();
// clear lock
+1 -1
View File
@@ -4,7 +4,7 @@ describe.skip('iD.modeAddPoint', function() {
beforeEach(function() {
var container = d3.select(document.createElement('div'));
context = iD.Context(window)
context = iD.Context()
.presets(iD.dataPresets)
.imagery([])
.container(container);
+1 -1
View File
@@ -318,7 +318,7 @@ describe('iD.osmWay', function() {
describe('#isArea', function() {
before(function() {
iD.Context(window).presets(iD.dataPresets);
iD.Context().presets(iD.dataPresets);
});
it('returns false when the way has no tags', function() {
+1 -1
View File
@@ -4,7 +4,7 @@ describe('iD.Features', function() {
features;
beforeEach(function() {
context = iD.Context(window);
context = iD.Context();
context.map().zoom(16);
features = iD.Features(context);
});
+1 -1
View File
@@ -2,7 +2,7 @@ describe('iD.Map', function() {
var context, map;
beforeEach(function() {
context = iD.Context(window).imagery(iD.dataImagery);
context = iD.Context().imagery(iD.dataImagery);
context.container(d3.select(document.createElement('div')));
map = context.map();
d3.select(document.createElement('div'))
+1 -1
View File
@@ -2,7 +2,7 @@ describe('iD.TileLayer', function() {
var context, d, c;
beforeEach(function() {
context = iD.Context(window);
context = iD.Context();
d = d3.select(document.createElement('div'));
c = iD.TileLayer(context).projection(d3.geoMercator());
});
+1 -1
View File
@@ -7,7 +7,7 @@ describe('iD.serviceMapillary', function() {
beforeEach(function() {
context = iD.Context(window).assetPath('../dist/');
context = iD.Context().assetPath('../dist/');
context.projection
.scale(667544.214430109) // z14
.translate([-116508, 0]) // 10,0
+1 -1
View File
@@ -18,7 +18,7 @@ describe('iD.serviceOsm', function () {
}
beforeEach(function () {
context = iD.Context(window);
context = iD.Context();
connection = context.connection();
connection.switch({ urlroot: 'http://www.openstreetmap.org' });
connection.reset();
+1 -1
View File
@@ -8,7 +8,7 @@ describe('iD.svgAreas', function () {
none = function() { return false; };
beforeEach(function () {
context = iD.Context(window);
context = iD.Context();
d3.select(document.createElement('div'))
.attr('id', 'map')
.call(context.map());
+1 -1
View File
@@ -6,7 +6,7 @@ describe('iD.svgLayers', function () {
.clipExtent([[0, 0], [Infinity, Infinity]]);
beforeEach(function () {
context = iD.Context(window);
context = iD.Context();
container = d3.select(document.createElement('div'));
});
+1 -1
View File
@@ -8,7 +8,7 @@ describe('iD.svgLines', function () {
none = function() { return false; };
beforeEach(function () {
context = iD.Context(window);
context = iD.Context();
d3.select(document.createElement('div'))
.attr('id', 'map')
.call(context.map());
+1 -1
View File
@@ -7,7 +7,7 @@ describe('iD.svgMidpoints', function () {
filter = function() { return true; };
beforeEach(function () {
context = iD.Context(window);
context = iD.Context();
d3.select(document.createElement('div'))
.attr('id', 'map')
.call(context.map());
+1 -1
View File
@@ -6,7 +6,7 @@ describe('iD.svgPoints', function () {
.clipExtent([[0, 0], [Infinity, Infinity]]);
beforeEach(function () {
context = iD.Context(window);
context = iD.Context();
d3.select(document.createElement('div'))
.attr('id', 'map')
.call(context.map());
+1 -1
View File
@@ -6,7 +6,7 @@ describe('iD.svgVertices', function () {
.clipExtent([[0, 0], [Infinity, Infinity]]);
beforeEach(function () {
context = iD.Context(window);
context = iD.Context();
d3.select(document.createElement('div'))
.attr('id', 'map')
.call(context.map());
+1 -1
View File
@@ -2,7 +2,7 @@ describe('iD.uiFieldAccess', function() {
var selection, field;
beforeEach(function() {
selection = d3.select(document.createElement('div'));
field = iD.Context(window)
field = iD.Context()
.presets(iD.dataPresets).presets().field('access');
});
+1 -1
View File
@@ -11,7 +11,7 @@ describe('iD.uiFieldWikipedia', function() {
beforeEach(function() {
entity = iD.Node({id: 'n12345'});
selectedId = entity.id;
context = iD.Context(window);
context = iD.Context();
context.history().merge([entity]);
selection = d3.select(document.createElement('div'));
field = context.presets(iD.dataPresets).presets().field('wikipedia');
+1 -1
View File
@@ -15,7 +15,7 @@ describe('iD.uiRawTagEditor', function() {
beforeEach(function () {
entity = iD.Node({id: 'n12345'});
context = iD.Context(window);
context = iD.Context();
context.history().merge([entity]);
render({highway: 'residential'});
});