Documentation, no more step pane

This commit is contained in:
Tom MacWright
2012-10-26 14:04:34 -04:00
parent 33ddd283a8
commit 0211130b37
3 changed files with 15 additions and 55 deletions
+1
View File
@@ -1,5 +1,6 @@
if (typeof iD === 'undefined') iD = {};
// [Node](http://wiki.openstreetmap.org/wiki/Node)
iD.Node = function(connection, id, lat, lon, tags, loaded) {
// summary: An OSM node.
this.entityType = 'node';
+14 -1
View File
@@ -1,5 +1,13 @@
if (typeof iD === 'undefined') iD = {};
// Way
// wiki: http://wiki.openstreetmap.org/wiki/Way
//
// Ways can either be open or closed. A closed way is such that the
// last node is the first node.
//
// If a a way is _closed_, it is assumed to be an area unless it has a
// `highway` or `barrier` tag and is not also tagged `area`.
iD.Way = function(connection, id, nodes, tags, loaded) {
// summary: An OSM way.
this.connection = connection;
@@ -19,9 +27,14 @@ iD.Way = function(connection, id, nodes, tags, loaded) {
};
iD.Way.prototype = {
// JOSM: http://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/data/osm/Way.java#L466
isClosed: function() {
// summary: Is this a closed way (first and last nodes the same)?
return this.nodes[this.nodes.length - 1] === this.nodes[0];
return this.nodes.length > 1 &&
this.nodes[this.nodes.length - 1] === this.nodes[0];
},
isType: function(type) {
-54
View File
@@ -1,54 +0,0 @@
// iD/ui/StepPane.js
/*
Step-by-step help pane.
*/
define(['dojo/_base/declare','dojo/_base/lang'], function(declare,lang){
// ----------------------------------------------------------------------
// StepPane class
declare("iD.ui.StepPane", null, {
currentStep: 0,
constructor:function() {
},
// ---------------------------
// Change the highlighted step
message: function(x) {
this.show();
$('<div></div>')
.appendTo('#road-help')
.attr('class', 'manual')
.text(x);
return this;
},
step: function(x) {
// summary: Highlight the step with the specified name, and dim all others.
this.show();
$('#road-help div').eq(x).show();
return this;
},
// ----------------
// Show/hide window
show: function() {
// summary: Show the window.
$('#road-help').show();
$('#road-help div').hide();
$('#road-help .manual').remove();
return this;
},
hide: function() {
$('#road-help').hide();
$('#road-help div').hide();
return this;
}
});
// ----------------------------------------------------------------------
// End of module
});