import lodash (#3257)

This commit is contained in:
Tom MacWright
2016-07-19 12:04:16 -04:00
committed by Bryan Housel
parent 3856b1ff2f
commit 604d1e2719
108 changed files with 104 additions and 7681 deletions
-1
View File
@@ -52,7 +52,6 @@
"globals": {
"d3": false,
"_": false,
"t": false,
"bootstrap": false,
"Diff3": false,
-4
View File
@@ -61,7 +61,6 @@ dist/iD.js: \
js/lib/d3.trigger.js \
js/lib/d3.curtain.js \
js/lib/d3.value.js \
js/lib/lodash.js \
$(MODULE_TARGETS) \
js/lib/locale.js \
data/introGraph.js
@@ -120,8 +119,5 @@ d3:
node_modules/.bin/smash $(D3_FILES) > js/lib/d3.v3.js
@echo 'd3 rebuilt. Please reapply 7e2485d, 4da529f, 223974d and 71a3d3e'
lodash:
node_modules/.bin/lodash --development --output js/lib/lodash.js include="includes,toPairs,assign,bind,chunk,clone,compact,debounce,difference,each,every,extend,filter,find,first,forEach,forOwn,groupBy,indexOf,intersection,isEmpty,isEqual,isFunction,keys,last,map,omit,reject,some,throttle,union,uniq,values,without,flatten,value,chain,cloneDeep,merge,pick,reduce" exports="global,node"
clean:
rm -f $(BUILDJS_TARGETS) $(MODULE_TARGETS) data/feature-icons.json dist/iD*.js dist/iD.css dist/img/*.svg
+1 -1
View File
@@ -2,7 +2,7 @@ var fs = require('fs'),
path = require('path'),
glob = require('glob'),
YAML = require('js-yaml'),
_ = require('./js/lib/lodash'),
_ = require('lodash'),
jsonschema = require('jsonschema'),
fieldSchema = require('./data/presets/schema/field.json'),
presetSchema = require('./data/presets/schema/preset.json'),
+1 -1
View File
@@ -3,7 +3,7 @@
var request = require('request').defaults({maxSockets: 1}),
yaml = require('js-yaml'),
fs = require('fs'),
_ = require('../js/lib/lodash.js');
_ = require('lodash');
var resources = ['core', 'presets'];
var outdir = './dist/locales/';
-1
View File
@@ -12,7 +12,6 @@
<meta name='apple-mobile-web-app-capable' content='yes' />
<meta name='apple-mobile-web-app-status-bar-style' content='black-translucent' />
<script src='js/lib/lodash.js'></script>
<script src='js/lib/d3.v3.js'></script>
<script src='js/lib/d3.combobox.js'></script>
<script src='js/lib/d3.geo.tile.js'></script>
-7663
View File
File diff suppressed because it is too large Load Diff
+1 -6
View File
@@ -7,12 +7,7 @@
"plugin:import/errors"
],
rules: {
"no-invalid-this": 0,
"sort-imports": ["error", {
"ignoreCase": false,
"ignoreMemberSort": false,
"memberSyntaxSortOrder": ["none", "all", "multiple", "single"]
}]
"no-invalid-this": 0
},
globals: {
"iD": false,
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { edgeEqual } from '../geo/index';
export function AddMidpoint(midpoint, node) {
return function(graph) {
+1
View File
@@ -1,5 +1,6 @@
import { euclideanDistance, interp } from '../geo/index';
import { Node } from '../core/index';
import _ from 'lodash';
export function Circularize(wayId
, projection, maxAngle) {
+1
View File
@@ -1,4 +1,5 @@
import { DeleteNode } from './delete_node';
import _ from 'lodash';
// Connect the ways at the given nodes.
//
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { DeleteMultiple } from './delete_multiple';
// https://github.com/openstreetmap/potlatch2/blob/master/net/systemeD/halcyon/connection/actions/DeleteRelationAction.as
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { DeleteRelation } from './delete_relation';
// https://github.com/openstreetmap/potlatch2/blob/master/net/systemeD/halcyon/connection/actions/DeleteWayAction.as
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
export function DeprecateTags(entityId) {
return function(graph) {
var entity = graph.entity(entityId),
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
export function DiscardTags(difference) {
return function(graph) {
function discardTags(entity) {
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
// Join ways at the end node they share.
//
// This is the inverse of `iD.actions.Split`.
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
export function Merge(ids) {
function groupEntitiesByGeometry(graph) {
var entities = ids.map(function(id) { return graph.entity(id); });
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { joinWays, polygonContainsPolygon } from '../geo/index';
import { Relation } from '../core/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { DeleteMultiple } from './delete_multiple';
import { Entity } from '../core/index';
import { diff3_merge } from '../util/diff3';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
// https://github.com/openstreetmap/josm/blob/mirror/src/org/openstreetmap/josm/command/MoveCommand.java
// https://github.com/openstreetmap/potlatch2/blob/master/net/systemeD/halcyon/connection/actions/MoveNodeAction.as
import {
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { DeleteNode } from './delete_node';
import { euclideanDistance } from '../geo/index';
/*
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
export function RotateWay(wayId, pivot, angle, projection) {
return function(graph) {
return graph.update(function(graph) {
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Relation, Way } from '../core/index';
import { isSimpleMultipolygonOuterMember, sphericalDistance } from '../geo/index';
import { AddMember } from './add_member';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
export function Breathe(){
var duration = 800,
selector = '.selected.shadow, .selected .shadow',
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { cmd } from '../ui/index';
export function Copy(context) {
var keybinding = d3.keybinding('copy');
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { AddEntity, AddMidpoint, AddVertex, MoveNode } from '../actions/index';
import { Browse, Select } from '../modes/index';
import { Node, Way } from '../core/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { qsString, stringQs } from '../util/index';
export function Hash(context) {
var s0 = null, // cached location.hash
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Extent, pointInPolygon } from '../geo/index';
import { Select } from '../modes/index';
import { Lasso as uiLasso } from '../ui/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { ChangeTags, CopyEntities, Move as MoveAction} from '../actions/index';
import { Extent, pointInPolygon } from '../geo/index';
import { Move as MoveMode } from '../modes/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Browse, Select as SelectMode } from '../modes/index';
import { Entity } from '../core/index';
export function Select(context) {
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Detect } from '../util/detect';
import { Entity } from './entity';
import { Extent } from '../geo/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Background } from '../renderer/background';
import { Connection } from './connection';
import { Detect } from '../util/detect';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
/*
iD.Difference represents the difference between two graphs.
It knows how to calculate the set of entities that were
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { interestingTag } from './tags';
export function Entity(attrs) {
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { getPrototypeOf } from '../util/index';
export function Graph(other, mutable) {
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import * as Validations from '../validations/index';
import { Difference } from './difference';
import { Entity } from './entity';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
// iD.Node = iD.Entity.node;
import { Entity } from './entity';
import { Extent } from '../geo/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Extent, joinWays, polygonContainsPolygon, polygonIntersectsPolygon } from '../geo/index';
import { Entity } from './entity';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Difference } from './difference';
import rbush from 'rbush';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Extent, cross } from '../geo/index';
import { Entity } from './entity';
import { oneWayTags } from './tags';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { metersToLat, metersToLon } from './index';
export function Extent(min, max) {
if (!(this instanceof Extent)) return new Extent(min, max);
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
export { Extent } from './extent.js';
export {
Intersection,
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Way } from '../core/index';
import { angle as getAngle } from './index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Reverse } from '../actions/reverse';
// For fixing up rendering of multipolygons with tags on the outer member.
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { AddMidpoint, Connect, MoveNode, Noop } from '../actions/index';
import { Browse, Select } from './index';
import { Edit, Hover, drag } from '../behavior/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Browse, Select } from './index';
import { Noop, RotateWay as RotateWayAction } from '../actions/index';
import { Edit } from '../behavior/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Commit, Conflicts, Loading, Success } from '../ui/index';
import { DiscardTags, MergeRemoteChanges, Noop, Revert } from '../actions/index';
import { displayName, displayType } from '../util/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import * as Operations from '../operations/index';
import { Breathe, Copy, Hover, Lasso, Paste, Select as SelectBehavior } from '../behavior/index';
import { Extent, chooseEdge, pointInPolygon } from '../geo/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Circularize as CircularizeAction } from '../actions/index';
export function Circularize(selectedIDs, context) {
var entityId = selectedIDs[0],
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { DrawLine } from '../modes/index';
export function Continue(selectedIDs, context) {
var graph = context.graph(),
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Browse, Select } from '../modes/index';
import { DeleteMultiple } from '../actions/index';
import { cmd } from '../ui/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Disconnect as DisconnectAction } from '../actions/index';
export function Disconnect(selectedIDs, context) {
var vertices = _.filter(selectedIDs, function vertex(entityId) {
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Extent } from '../geo/index';
import { Move as MoveAction } from '../actions/index';
import { Move as MoveMode } from '../modes/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Orthogonalize as OrthogonalizeAction } from '../actions/index';
export function Orthogonalize(selectedIDs, context) {
var entityId = selectedIDs[0],
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Select } from '../modes/index';
import { Split as SplitAction } from '../actions/index';
export function Split(selectedIDs, context) {
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Straighten as StraightenAction } from '../actions/index';
export function Straighten(selectedIDs, context) {
var entityId = selectedIDs[0],
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Collection } from './collection';
export function Category(id, category, all) {
category = _.clone(category);
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { editDistance } from '../util/index';
export function Collection(collection) {
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
export function Field(id, field) {
field = _.clone(field);
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
export function Preset(id, preset, fields) {
preset = _.clone(preset);
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Category } from './category';
import { Collection } from './collection';
import { Field } from './field';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Extent, metersToOffset, offsetToMeters} from '../geo/index';
import { qsString, stringQs } from '../util/index';
import { BackgroundSource } from './background_source';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Extent, polygonIntersectsPolygon } from '../geo/index';
export function BackgroundSource(data) {
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Entity } from '../core/index';
export function Features(context) {
var traffic_roads = {
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Areas, Labels, Layers, Lines, Midpoints, Points, Vertices } from '../svg/index';
import { Extent, interp } from '../geo/index';
import { fastMouse, setTransform } from '../util/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Detect } from '../util/detect';
import { Extent } from '../geo/index';
import { Icon } from '../svg/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { qsString } from '../util/index';
var taginfo = {},
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Path, TagClasses } from './index';
import { Entity } from '../core/index';
import { isSimpleMultipolygonOuterMember } from '../geo/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Extent, polygonIntersectsPolygon } from '../geo/index';
import { Detect } from '../util/detect';
import toGeoJSON from 'togeojson';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { displayName, getStyle } from '../util/index';
import { Entity } from '../core/index';
import { pathLength } from '../geo/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Debug } from './debug';
import { Gpx } from './gpx';
import { MapillaryImages } from './mapillary_images';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { OneWaySegments, Path, RelationMemberTags, TagClasses } from './index';
import { Detect } from '../util/detect';
import { Entity } from '../core/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { PointTransform } from './point_transform';
export function MapillaryImages(projection, context, dispatch) {
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { PointTransform } from './point_transform';
export function MapillarySigns(projection, context, dispatch) {
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { PointTransform, TagClasses } from './index';
import { angle, euclideanDistance, interp, lineIntersection } from '../geo/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { PointTransform, TagClasses } from './index';
import { Entity } from '../core/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
export function RelationMemberTags(graph) {
return function(entity) {
var tags = entity.tags;
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
export function Attribution(context) {
var selection;
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { metersToOffset, offsetToMeters } from '../geo/index';
import { BackgroundSource } from '../renderer/index';
import { Detect } from '../util/detect';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { displayName, entityOrMemberSelector } from '../util/index';
import { Icon } from '../svg/index';
import { Select } from '../modes/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Icon } from '../svg/index';
export function Contributors(context) {
var debouncedUpdate = _.debounce(function() { update(); }, 1000),
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Browse } from '../modes/index';
import { ChangeTags } from '../actions/index';
import { Icon } from '../svg/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { tooltipHtml } from './tooltipHtml';
export function FeatureInfo(context) {
function update(selection) {
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
export function access(field) {
var dispatch = d3.dispatch('change'),
items;
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Extent, chooseEdge, sphericalDistance } from '../../geo/index';
export function address(field, context) {
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
export {
combo as typeCombo,
combo as multiCombo
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Detect } from '../../util/detect';
import { Icon } from '../../svg/index';
import { SuggestNames } from '../../util/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { pointInPolygon } from '../../geo/index';
export function maxspeed(field, context) {
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { ChangeTags } from '../../actions/index';
import { Detect } from '../../util/detect';
import { Icon } from '../../svg/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Detect } from '../util/detect';
import { Extent } from '../geo/index';
import { cmd } from './cmd';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { icon, pad } from './helper';
import { DeleteMultiple } from '../../actions/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { icon, pointBox } from './helper';
export function navigation(context, reveal) {
+1
View File
@@ -1,5 +1,6 @@
import { Icon } from '../svg/index';
import { tooltipHtml } from './tooltipHtml';
import _ from 'lodash';
export function MapData(context) {
var key = 'F',
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { AddArea, AddLine, AddPoint, Browse } from '../modes/index';
import { Icon } from '../svg/index';
import { tooltipHtml } from './tooltipHtml';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Icon } from '../svg/index';
export function Notice(context) {
return function(selection) {
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Browse } from '../modes/index';
import { Disclosure } from './disclosure';
import { Icon } from '../svg/index';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { AddEntity, AddMember, ChangeMember, DeleteMember } from '../actions/index';
import { Entity, Relation } from '../core/index';
import { Disclosure } from './disclosure';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { FeatureList } from './feature_list';
import { Inspector } from './inspector';
import { Notice } from './notice';
+1
View File
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Detect } from '../util/detect';
import { Icon } from '../svg/index';
+1
View File
@@ -1,6 +1,7 @@
import { Icon } from '../svg/index';
import { cmd } from './cmd';
import { tooltipHtml } from './tooltipHtml';
import _ from 'lodash';
export function Zoom(context) {
var zooms = [{
+1
View File
@@ -1,5 +1,6 @@
import { Detect } from './detect';
import { remove as removeDiacritics } from 'diacritics';
import _ from 'lodash';
export function tagText(entity) {
return d3.entries(entity.tags).map(function(e) {

Some files were not shown because too many files have changed in this diff Show More