grammar for tooltips, keybinding hints, other tooltip fixes.

This commit is contained in:
Saman Bemel-Benrud
2013-01-30 19:09:10 -05:00
parent b28fd051db
commit 1b495870c0
14 changed files with 62 additions and 34 deletions
+35 -7
View File
@@ -1159,19 +1159,47 @@ a.success-action {
border-width: 0 5px 5px;
}
.Browse .tooltip {
left: -20px !important; }
.Browse .tooltip .tooltip-arrow {
left: 30px;
left: 60px;
}
.tooltip .keyhint-wrap {
padding: 5px 0 5px 0;
}
.tooltip .keyhint {
float: right;
background: #eee;
display: block;
color: #222;
font-size: 10px;
padding: 0 4px;
background:#aaa;
color:#fff;
padding: 0px 7px;
text-transform: uppercase;
font-weight: bold;
display: inline-block;
border-radius: 2px;
margin-left: 4px;
border: 1px solid #CCC;
position: relative;
z-index: 1;
text-align: left;
clear: both;
}
.tooltip .keyhint .keyhint-label{
display: inline-block;
}
.tooltip .keyhint::after {
content: "";
position: absolute;
border-radius: 2px;
height: 10px;
width: 100%;
z-index: 0;
bottom: -4px;
left: -1px;
border: 1px solid #CCC;
border-top: 0;
}
.tail {
+1 -1
View File
@@ -25,7 +25,7 @@ iD.behavior.DragMidpoint = function(mode) {
.on('end', function() {
history.replace(
iD.actions.Noop(),
'added a node to a way');
'Added a node to a way.');
});
return behavior;
+2 -2
View File
@@ -4,7 +4,7 @@ iD.behavior.DrawWay = function(wayId, index, mode, baseGraph) {
controller = mode.controller,
way = mode.history.graph().entity(wayId),
finished = false,
annotation = 'added to a way',
annotation = 'Added to a way.',
draw = iD.behavior.Draw(map);
var node = iD.Node({loc: map.mouseCoordinates()}),
@@ -153,7 +153,7 @@ iD.behavior.DrawWay = function(wayId, index, mode, baseGraph) {
drawWay.cancel = function() {
history.perform(
d3.functor(baseGraph),
'cancelled drawing');
'Cancelled drawing.');
finished = true;
controller.enter(iD.modes.Browse());
+4 -4
View File
@@ -22,7 +22,7 @@ window.iD = function(container) {
}
function hintprefix(x, y) {
return '<span class="keyhint">' + x + '</span> ' + y;
return '<span>' + y + '</span>' + '<div class="keyhint-wrap"><span class="keyhint"> ' + x + '</span></div>';
}
var m = container.append('div')
@@ -44,10 +44,10 @@ window.iD = function(container) {
.enter().append('button')
.attr('tabindex', -1)
.attr('class', function (mode) { return mode.title + ' add-button col3'; })
.call(bootstrap.tooltip().placement('bottom').html(true))
.attr('data-original-title', function (mode) {
return hintprefix(mode.key, mode.description);
})
.call(bootstrap.tooltip().placement('bottom').html(true))
.on('click.editor', function (mode) { controller.enter(mode); });
function disableTooHigh() {
@@ -207,12 +207,12 @@ window.iD = function(container) {
limiter.select('#undo')
.property('disabled', !undo)
.attr('data-original-title', hintprefix('⌘Z', undo))
.attr('data-original-title', hintprefix('⌘ + Z', undo))
.call(refreshTooltip);
limiter.select('#redo')
.property('disabled', !redo)
.attr('data-original-title', hintprefix('⌘Z', redo))
.attr('data-original-title', hintprefix('⌘ + ⇧ + Z', redo))
.call(refreshTooltip);
});
+1 -1
View File
@@ -21,7 +21,7 @@ iD.modes.AddPoint = function() {
history.perform(
iD.actions.AddNode(node),
'added a point');
'Added a point.');
controller.enter(iD.modes.Select(node, true));
}
+1 -1
View File
@@ -3,7 +3,7 @@ iD.modes.Browse = function() {
button: 'browse',
id: 'browse',
title: 'Browse',
description: 'Pan and zoom the map',
description: 'Pan and zoom the map.',
key: 'b'
};
+1 -1
View File
@@ -12,7 +12,7 @@ iD.modes.DrawLine = function(wayId, direction, baseGraph) {
headId = (direction === 'forward') ? way.last() : way.first();
behavior = iD.behavior.DrawWay(wayId, index, mode, baseGraph)
.annotation(way.isDegenerate() ? 'started a line' : 'continued a line');
.annotation(way.isDegenerate() ? 'Started a line.' : 'Continued a line.');
var addNode = behavior.addNode;
+2 -2
View File
@@ -18,7 +18,7 @@ iD.modes.MoveWay = function(wayId) {
history.perform(
iD.actions.Noop(),
'moved a way');
'Moved a way.');
function move() {
var p = d3.mouse(selection.node()),
@@ -29,7 +29,7 @@ iD.modes.MoveWay = function(wayId) {
history.replace(
iD.actions.MoveWay(wayId, delta, projection),
'moved a way');
'Moved a way.');
}
function finish() {
+2 -2
View File
@@ -14,7 +14,7 @@ iD.modes.Select = function(entity, initial) {
if (!_.isEqual(entity.tags, tags)) {
mode.history.perform(
iD.actions.ChangeEntityTags(d.id, tags),
'changed tags');
'Changed tags.');
}
}
@@ -114,7 +114,7 @@ iD.modes.Select = function(entity, initial) {
history.perform(
iD.actions.AddNode(node),
iD.actions.AddWayNode(datum.id, node.id, choice.index),
'added a point to a road');
'Added a point to a road.');
d3.event.preventDefault();
d3.event.stopPropagation();
+2 -2
View File
@@ -10,12 +10,12 @@ iD.operations.Circularize = function(entityId, mode) {
if (geometry === 'line') {
history.perform(
action,
'made a line circular');
'Made a line circular.');
} else if (geometry === 'area') {
history.perform(
action,
'made an area circular');
'Made an area circular.');
}
};
+5 -5
View File
@@ -9,22 +9,22 @@ iD.operations.Delete = function(entityId, mode) {
if (geometry === 'vertex') {
history.perform(
iD.actions.DeleteNode(entityId),
'deleted a vertex');
'Deleted a vertex.');
} else if (geometry === 'point') {
history.perform(
iD.actions.DeleteNode(entityId),
'deleted a point');
'Deleted a point.');
} else if (geometry === 'line') {
history.perform(
iD.actions.DeleteWay(entityId),
'deleted a line');
'Deleted a line.');
} else if (geometry === 'area') {
history.perform(
iD.actions.DeleteWay(entityId),
'deleted an area');
'Deleted an area.');
}
};
@@ -41,7 +41,7 @@ iD.operations.Delete = function(entityId, mode) {
operation.id = "delete";
operation.key = "⌫";
operation.title = "Delete";
operation.description = "Remove this from the map";
operation.description = "Remove this from the map.";
return operation;
};
+2 -2
View File
@@ -4,7 +4,7 @@ iD.operations.Reverse = function(entityId, mode) {
var operation = function() {
history.perform(
iD.actions.ReverseWay(entityId),
'reversed a line');
'Reversed a line.');
};
operation.available = function() {
@@ -20,7 +20,7 @@ iD.operations.Reverse = function(entityId, mode) {
operation.id = "reverse";
operation.key = "V";
operation.title = "Reverse";
operation.description = "Make this way go in the opposite direction";
operation.description = "Make this way go in the opposite direction.";
return operation;
};
+2 -2
View File
@@ -3,7 +3,7 @@ iD.operations.Split = function(entityId, mode) {
action = iD.actions.SplitWay(entityId);
var operation = function() {
history.perform(action, 'split a way');
history.perform(action, 'Split a way.');
};
operation.available = function() {
@@ -20,7 +20,7 @@ iD.operations.Split = function(entityId, mode) {
operation.id = "split";
operation.key = "X";
operation.title = "Split";
operation.description = "Split this into two ways at this point";
operation.description = "Split this into two ways at this point.";
return operation;
};
+2 -2
View File
@@ -3,7 +3,7 @@ iD.operations.Unjoin = function(entityId, mode) {
action = iD.actions.UnjoinNode(entityId);
var operation = function() {
history.perform(action, 'unjoined lines');
history.perform(action, 'Unjoined lines.');
};
operation.available = function() {
@@ -20,7 +20,7 @@ iD.operations.Unjoin = function(entityId, mode) {
operation.id = "unjoin";
operation.key = "⇧-J";
operation.title = "Unjoin";
operation.description = "Disconnect these ways from each other";
operation.description = "Disconnect these ways from each other.";
return operation;
};