From e1d5a0cb0324ae5334e6973bb959c56ad8137a79 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 1 Feb 2013 15:45:45 -0500 Subject: [PATCH] Unjoin -> Disconnect --- combobox.html | 2 +- css/app.css | 2 +- index.html | 4 ++-- .../actions/{unjoin_node.js => disconnect.js} | 4 ++-- js/id/operations/disconnect.js | 24 +++++++++++++++++++ js/id/operations/unjoin.js | 24 ------------------- locale/en.js | 12 +++++----- test/index.html | 6 ++--- test/index_packaged.html | 2 +- .../actions/{unjoin_node.js => disconnect.js} | 10 ++++---- 10 files changed, 45 insertions(+), 45 deletions(-) rename js/id/actions/{unjoin_node.js => disconnect.js} (92%) create mode 100644 js/id/operations/disconnect.js delete mode 100644 js/id/operations/unjoin.js rename test/spec/actions/{unjoin_node.js => disconnect.js} (89%) diff --git a/combobox.html b/combobox.html index 0d97698b0..469e73823 100644 --- a/combobox.html +++ b/combobox.html @@ -79,13 +79,13 @@ + - diff --git a/css/app.css b/css/app.css index 1a880ad02..7a0751d02 100644 --- a/css/app.css +++ b/css/app.css @@ -476,7 +476,7 @@ button[disabled] .icon.nearby { background-position: -340px -40px;} .icon-operation-circularize { background-position: -20px -140px;} .icon-operation-straighten { background-position: -40px -140px;} .icon-operation-split { background-position: -60px -140px;} -.icon-operation-unjoin { background-position: -80px -140px;} +.icon-operation-disconnect { background-position: -80px -140px;} .icon-operation-reverse { background-position: -100px -140px;} .icon-operation-move { background-position: -120px -140px;} .icon-operation-merge { background-position: -140px -140px;} diff --git a/index.html b/index.html index f94a11019..3ef8abad5 100644 --- a/index.html +++ b/index.html @@ -80,13 +80,13 @@ + - @@ -112,10 +112,10 @@ + - diff --git a/js/id/actions/unjoin_node.js b/js/id/actions/disconnect.js similarity index 92% rename from js/id/actions/unjoin_node.js rename to js/id/actions/disconnect.js index 39e05a9cf..8645c436b 100644 --- a/js/id/actions/unjoin_node.js +++ b/js/id/actions/disconnect.js @@ -1,4 +1,4 @@ -// Unjoin the ways at the given node. +// Disconect the ways at the given node. // // For testing convenience, accepts an ID to assign to the (first) new node. // Normally, this will be undefined and the way will automatically @@ -8,7 +8,7 @@ // https://github.com/openstreetmap/potlatch2/blob/master/net/systemeD/halcyon/connection/actions/UnjoinNodeAction.as // https://github.com/openstreetmap/josm/blob/mirror/src/org/openstreetmap/josm/actions/UnGlueAction.java // -iD.actions.UnjoinNode = function(nodeId, newNodeId) { +iD.actions.Disconnect = function(nodeId, newNodeId) { var action = function(graph) { if (!action.enabled(graph)) return graph; diff --git a/js/id/operations/disconnect.js b/js/id/operations/disconnect.js new file mode 100644 index 000000000..c8cc0d014 --- /dev/null +++ b/js/id/operations/disconnect.js @@ -0,0 +1,24 @@ +iD.operations.Disconnect = function(selection, context) { + var entityId = selection[0], + action = iD.actions.Disconnect(entityId); + + var operation = function() { + context.perform(action, t('operations.disconnect.annotation')); + }; + + operation.available = function() { + return selection.length === 1 && + context.geometry(entityId) === 'vertex'; + }; + + operation.enabled = function() { + return action.enabled(context.graph()); + }; + + operation.id = "disconnect"; + operation.key = t('operations.disconnect.key'); + operation.title = t('operations.disconnect.title'); + operation.description = t('operations.disconnect.description'); + + return operation; +}; diff --git a/js/id/operations/unjoin.js b/js/id/operations/unjoin.js deleted file mode 100644 index d4fcc1426..000000000 --- a/js/id/operations/unjoin.js +++ /dev/null @@ -1,24 +0,0 @@ -iD.operations.Unjoin = function(selection, context) { - var entityId = selection[0], - action = iD.actions.UnjoinNode(entityId); - - var operation = function() { - context.perform(action, 'Unjoined lines.'); - }; - - operation.available = function() { - return selection.length === 1 && - context.geometry(entityId) === 'vertex'; - }; - - operation.enabled = function() { - return action.enabled(context.graph()); - }; - - operation.id = "unjoin"; - operation.key = t('operations.unjoin.key'); - operation.title = t('operations.unjoin.title'); - operation.description = t('operations.unjoin.description'); - - return operation; -}; diff --git a/locale/en.js b/locale/en.js index b32149ee3..7d1bed947 100644 --- a/locale/en.js +++ b/locale/en.js @@ -77,6 +77,12 @@ locale.en = { multiple: "Deleted {n} objects." } }, + disconnect: { + title: "Disconnect", + description: "Disconnect these ways from each other.", + key: "D", + annotation: "Disconnected ways." + }, move: { title: "Move", description: "Move this to a different location.", @@ -99,12 +105,6 @@ locale.en = { description: "Split this into two ways at this point.", key: "X", annotation: "Split a way." - }, - unjoin: { - title: "Unjoin", - description: "Disconnect these ways from each other.", - key: "⇧-J", - annotation: "Unjoined ways." } }, diff --git a/test/index.html b/test/index.html index 1ed505174..e06e18a4b 100644 --- a/test/index.html +++ b/test/index.html @@ -77,12 +77,12 @@ + - @@ -108,10 +108,10 @@ + - @@ -146,12 +146,12 @@ + - diff --git a/test/index_packaged.html b/test/index_packaged.html index 4b44086c5..673ea46e8 100644 --- a/test/index_packaged.html +++ b/test/index_packaged.html @@ -39,12 +39,12 @@ + - diff --git a/test/spec/actions/unjoin_node.js b/test/spec/actions/disconnect.js similarity index 89% rename from test/spec/actions/unjoin_node.js rename to test/spec/actions/disconnect.js index 5901e97da..4ce298feb 100644 --- a/test/spec/actions/unjoin_node.js +++ b/test/spec/actions/disconnect.js @@ -1,9 +1,9 @@ -describe("iD.actions.UnjoinNode", function () { +describe("iD.actions.Disconnect", function () { describe("#enabled", function () { it("returns false for a node shared by less than two ways", function () { var graph = iD.Graph({'a': iD.Node()}); - expect(iD.actions.UnjoinNode('a').enabled(graph)).to.equal(false); + expect(iD.actions.Disconnect('a').enabled(graph)).to.equal(false); }); it("returns true for a node shared by two or more ways", function () { @@ -19,7 +19,7 @@ describe("iD.actions.UnjoinNode", function () { '|': iD.Way({id: '|', nodes: ['d', 'b']}) }); - expect(iD.actions.UnjoinNode('b').enabled(graph)).to.equal(true); + expect(iD.actions.Disconnect('b').enabled(graph)).to.equal(true); }); }); @@ -46,7 +46,7 @@ describe("iD.actions.UnjoinNode", function () { '|': iD.Way({id: '|', nodes: ['d', 'b']}) }); - graph = iD.actions.UnjoinNode('b', 'e')(graph); + graph = iD.actions.Disconnect('b', 'e')(graph); expect(graph.entity('-').nodes).to.eql(['a', 'b', 'c']); expect(graph.entity('|').nodes).to.eql(['d', 'e']); @@ -64,7 +64,7 @@ describe("iD.actions.UnjoinNode", function () { '|': iD.Way({id: '|', nodes: ['d', 'b']}) }); - graph = iD.actions.UnjoinNode('b', 'e')(graph); + graph = iD.actions.Disconnect('b', 'e')(graph); // Immutable loc => should be shared by identity. expect(graph.entity('b').loc).to.equal(loc);