From 0211130b3705df588820e295a959a2f773b9ed1f Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 26 Oct 2012 14:04:34 -0400 Subject: [PATCH] Documentation, no more step pane --- js/iD/Node.js | 1 + js/iD/Way.js | 15 +++++++++++- js/iD/ui/StepPane.js | 54 -------------------------------------------- 3 files changed, 15 insertions(+), 55 deletions(-) delete mode 100644 js/iD/ui/StepPane.js diff --git a/js/iD/Node.js b/js/iD/Node.js index 6bab8abd7..0216addc3 100644 --- a/js/iD/Node.js +++ b/js/iD/Node.js @@ -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'; diff --git a/js/iD/Way.js b/js/iD/Way.js index 02aa62c58..7a2808138 100644 --- a/js/iD/Way.js +++ b/js/iD/Way.js @@ -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) { diff --git a/js/iD/ui/StepPane.js b/js/iD/ui/StepPane.js deleted file mode 100644 index ad3553341..000000000 --- a/js/iD/ui/StepPane.js +++ /dev/null @@ -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(); - $('
') - .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 -});