more docs

This commit is contained in:
j 2011-05-16 12:49:48 +02:00
commit cc75e25415
42 changed files with 664 additions and 93 deletions

View file

@ -1,5 +1,24 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
/*@
Ox.MapPlace <f> MapPlace Object
(options) -> <f> MapPlace Object
options <o> Options object
east <n|0>
editing <b|false>
geoname <s|''>
map <o|null>
markerColor <a|[255> 0> 0]>
markerSize <n|16>
name <s|''>
north <n|0>
selected <b|false>
south <n|0>
type <a|[]>
visible <b|false>
west <n|0>
@*/
Ox.MapPlace = function(options) {
options = Ox.extend({
@ -70,12 +89,18 @@ Ox.MapPlace = function(options) {
return that.map.options('editable') && that.editable;
}
/*@
add <f> add
@*/
that.add = function() {
that.visible = true;
that.marker.add();
return that;
};
/*@
cancel <f> cancel
@*/
that.cancel = function() {
if (editable()) {
that.undo();
@ -86,10 +111,16 @@ Ox.MapPlace = function(options) {
return that;
};
/*@
crossesDateline <f> crossesDateline
@*/
that.crossesDateline = function() {
return that.west > that.east;
}
/*@
deselect <f> dselect
@*/
that.deselect = function() {
that.editing && that.submit();
that.selected = false;
@ -98,6 +129,9 @@ Ox.MapPlace = function(options) {
return that;
};
/*@
edit <f> edit
@*/
that.edit = function() {
if (editable()) {
that.editing = true;
@ -113,6 +147,9 @@ Ox.MapPlace = function(options) {
return that;
}
/*@
remove <f> remove
@*/
that.remove = function() {
that.editing && that.submit();
that.selected && that.deselect();
@ -121,6 +158,9 @@ Ox.MapPlace = function(options) {
return that;
};
/*@
select <f> select
@*/
that.select = function() {
that.selected = true;
!that.visible && that.add();
@ -129,6 +169,9 @@ Ox.MapPlace = function(options) {
return that;
};
/*@
submit <f> submit
@*/
that.submit = function() {
if (editable()) {
that.editing = false;
@ -138,11 +181,17 @@ Ox.MapPlace = function(options) {
return that;
};
/*@
update <f> update
@*/
that.update = function() {
update();
return that;
};
/*@
undo <f> undo
@*/
that.undo = function() {
if (editable()) {
Ox.forEach(that.original, function(v, k) {
@ -157,4 +206,4 @@ Ox.MapPlace = function(options) {
return that;
};
};