Refactor Entity, Node, Relation, Tags, Way from core to osm

This commit is contained in:
Bryan Housel
2016-10-11 22:41:24 -04:00
parent fd742518c6
commit 07fa5fcc34
52 changed files with 215 additions and 239 deletions
+6 -6
View File
@@ -28,8 +28,6 @@
<script src='spec/spec_helpers.js'></script>
<!-- include spec files below... -->
<script src='spec/id.js'></script>
<script src='spec/actions/add_entity.js'></script>
<script src='spec/actions/add_member.js'></script>
<script src='spec/actions/add_midpoint.js'></script>
@@ -67,14 +65,11 @@
<script src='spec/behavior/lasso.js'></script>
<script src='spec/core/connection.js'></script>
<script src='spec/core/context.js'></script>
<script src='spec/core/difference.js'></script>
<script src='spec/core/entity.js'></script>
<script src='spec/core/graph.js'></script>
<script src='spec/core/history.js'></script>
<script src='spec/core/node.js'></script>
<script src='spec/core/relation.js'></script>
<script src='spec/core/tree.js'></script>
<script src='spec/core/way.js'></script>
<script src='spec/geo/extent.js'></script>
<script src='spec/geo/geo.js'></script>
@@ -88,6 +83,11 @@
<script src='spec/modes/add_point.js'></script>
<script src='spec/osm/entity.js'></script>
<script src='spec/osm/node.js'></script>
<script src='spec/osm/relation.js'></script>
<script src='spec/osm/way.js'></script>
<script src='spec/presets/category.js'></script>
<script src='spec/presets/collection.js'></script>
<script src='spec/presets/init.js'></script>
+5 -4
View File
@@ -15,12 +15,13 @@
<script src='../js/lib/id/svg.js'></script>
<script src='../js/lib/id/util.js'></script>
<script src='../js/id/core/entity.js'></script>
<script src='../js/id/core/graph.js'></script>
<script src='../js/id/core/history.js'></script>
<script src='../js/id/core/node.js'></script>
<script src='../js/id/core/relation.js'></script>
<script src='../js/id/core/way.js'></script>
<script src='../js/id/osm/entity.js'></script>
<script src='../js/id/osm/node.js'></script>
<script src='../js/id/osm/relation.js'></script>
<script src='../js/id/osm/way.js'></script>
<form style='position: fixed; right: 10px; bottom: 10px'>
<input id='background-color' type='range' min='0' max='255' value='255'>
+2 -31
View File
@@ -1,5 +1,3 @@
/* global locale: true */
/* eslint no-console: 0 */
describe('iD.actionMergeRemoteChanges', function () {
var base = iD.Graph([
iD.Node({id: 'a', loc: [1, 1], version: '1', tags: {foo: 'foo'}}),
@@ -55,36 +53,8 @@ describe('iD.actionMergeRemoteChanges', function () {
nodes: ['s1', 's2', 's3', 's4', 's1'],
version: '1',
tags: {foo: 'foo_new', area: 'yes'}
}),
});
saved, error;
// setup mock locale object..
beforeEach(function() {
saved = locale;
error = console.error;
console.error = function () {};
locale = {
_current: 'en',
en: {
'merge_remote_changes': {
'annotation': 'Merged remote changes from server.',
'conflict': {
'deleted': 'This object has been deleted by {user}.',
'location': 'This object was moved by both you and {user}.',
'nodelist': 'Nodes were changed by both you and {user}.',
'memberlist': 'Relation members were changed by both you and {user}.',
'tags': 'You changed the <b>{tag}</b> tag to \"{local}\" and {user} changed it to \"{remote}\".'
}
}
}
};
});
afterEach(function() {
locale = saved;
console.error = error;
});
function makeGraph(entities) {
return _.reduce(entities, function(graph, entity) {
@@ -92,6 +62,7 @@ describe('iD.actionMergeRemoteChanges', function () {
}, iD.Graph(base));
}
describe('non-destuctive merging', function () {
describe('tags', function() {
it('doesn\'t merge tags if conflict (local change, remote change)', function () {
@@ -1,4 +1,4 @@
describe('iD', function() {
describe('iD.Context', function() {
var assets = {
'iD/img/loader.gif': '/assets/iD/img/loader-b66184b5c4afbccc25f.gif'
};
+1 -1
View File
@@ -1,6 +1,6 @@
/* globals chai:false */
// iD.debug = true;
iD.debug = true;
mocha.setup({
ui: 'bdd',