forked from 0x2620/oxjs
remove new for all Ox.Elements, dont declare arguments again, add some semicolons
This commit is contained in:
parent
3eab11e967
commit
b27ed00356
69 changed files with 430 additions and 440 deletions
|
|
@ -16,8 +16,8 @@ Ox.ListMap <f:Ox.Element> ListMap Object
|
|||
|
||||
Ox.ListMap = function(options, self) {
|
||||
|
||||
var self = self || {},
|
||||
that = Ox.Element({}, self)
|
||||
self = self || {};
|
||||
var that = Ox.Element({}, self)
|
||||
.defaults({
|
||||
addPlace: null,
|
||||
editPlace: null,
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ Ox.Map <function> Basic map object
|
|||
Ox.Map = function(options, self) {
|
||||
|
||||
self = self || {};
|
||||
var that = new Ox.Element({}, self)
|
||||
var that = Ox.Element({}, self)
|
||||
.defaults({
|
||||
// fixme: isClickable? hasZoombar?
|
||||
clickable: false,
|
||||
|
|
@ -200,7 +200,7 @@ Ox.Map = function(options, self) {
|
|||
});
|
||||
|
||||
if (self.options.toolbar) {
|
||||
self.$toolbar = new Ox.Bar({
|
||||
self.$toolbar = Ox.Bar({
|
||||
size: 24
|
||||
})
|
||||
.appendTo(that);
|
||||
|
|
@ -219,7 +219,7 @@ Ox.Map = function(options, self) {
|
|||
.css({float: 'left', margin: '4px'})
|
||||
.appendTo(self.$toolbar);
|
||||
/*
|
||||
self.$labelsButton = new Ox.Checkbox({
|
||||
self.$labelsButton = Ox.Checkbox({
|
||||
title: 'Labels',
|
||||
width: 64
|
||||
})
|
||||
|
|
@ -229,7 +229,7 @@ Ox.Map = function(options, self) {
|
|||
})
|
||||
.appendTo(self.$toolbar)
|
||||
*/
|
||||
self.$findInput = new Ox.Input({
|
||||
self.$findInput = Ox.Input({
|
||||
clear: true,
|
||||
placeholder: self.options.findPlaceholder,
|
||||
width: 192
|
||||
|
|
@ -241,7 +241,7 @@ Ox.Map = function(options, self) {
|
|||
.appendTo(self.$toolbar)
|
||||
}
|
||||
|
||||
self.$map = new Ox.Element()
|
||||
self.$map = Ox.Element()
|
||||
.css({
|
||||
left: 0,
|
||||
top: self.options.toolbar * 24 + 'px',
|
||||
|
|
@ -251,7 +251,7 @@ Ox.Map = function(options, self) {
|
|||
.appendTo(that);
|
||||
|
||||
if (self.options.zoombar) {
|
||||
self.$zoombar = new Ox.Bar({
|
||||
self.$zoombar = Ox.Bar({
|
||||
size: 16
|
||||
})
|
||||
.css({
|
||||
|
|
@ -261,7 +261,7 @@ Ox.Map = function(options, self) {
|
|||
}
|
||||
|
||||
if (self.options.statusbar) {
|
||||
self.$statusbar = new Ox.Bar({
|
||||
self.$statusbar = Ox.Bar({
|
||||
size: 24
|
||||
})
|
||||
.css({
|
||||
|
|
@ -275,21 +275,21 @@ Ox.Map = function(options, self) {
|
|||
})
|
||||
.css({float: 'left', margin: '4px 2px 4px 4px'})
|
||||
.appendTo(self.$statusbar.$element);
|
||||
self.$placeNameInput = new Ox.Input({
|
||||
self.$placeNameInput = Ox.Input({
|
||||
placeholder: 'Name',
|
||||
width: 96
|
||||
})
|
||||
//.css({position: 'absolute', left: 4, top: 4})
|
||||
.css({float: 'left', margin: '4px 2px 4px 2px'})
|
||||
.appendTo(self.$statusbar);
|
||||
self.$placeGeonameInput = new Ox.Input({
|
||||
self.$placeGeonameInput = Ox.Input({
|
||||
placeholder: 'Geoname',
|
||||
width: 96
|
||||
})
|
||||
//.css({position: 'absolute', left: 104, top: 4})
|
||||
.css({float: 'left', margin: '4px 2px 4px 2px'})
|
||||
.appendTo(self.$statusbar);
|
||||
self.$placeButton = new Ox.Button({
|
||||
self.$placeButton = Ox.Button({
|
||||
title: 'New Place',
|
||||
width: 96
|
||||
})
|
||||
|
|
@ -301,7 +301,7 @@ Ox.Map = function(options, self) {
|
|||
}
|
||||
|
||||
self.$navigationButtons = {
|
||||
'center': new Ox.Button({
|
||||
'center': Ox.Button({
|
||||
title: 'close',
|
||||
type: 'image'
|
||||
})
|
||||
|
|
@ -310,7 +310,7 @@ Ox.Map = function(options, self) {
|
|||
left: '24px',
|
||||
top: '24px'
|
||||
}),
|
||||
'east': new Ox.Button({
|
||||
'east': Ox.Button({
|
||||
title: 'right',
|
||||
type: 'image'
|
||||
})
|
||||
|
|
@ -319,7 +319,7 @@ Ox.Map = function(options, self) {
|
|||
left: '44px',
|
||||
top: '24px',
|
||||
}),
|
||||
'north': new Ox.Button({
|
||||
'north': Ox.Button({
|
||||
title: 'up',
|
||||
type: 'image'
|
||||
})
|
||||
|
|
@ -328,7 +328,7 @@ Ox.Map = function(options, self) {
|
|||
left: '24px',
|
||||
top: '4px',
|
||||
}),
|
||||
'south': new Ox.Button({
|
||||
'south': Ox.Button({
|
||||
title: 'down',
|
||||
type: 'image'
|
||||
})
|
||||
|
|
@ -337,7 +337,7 @@ Ox.Map = function(options, self) {
|
|||
left: '24px',
|
||||
top: '44px',
|
||||
}),
|
||||
'west': new Ox.Button({
|
||||
'west': Ox.Button({
|
||||
title: 'left',
|
||||
type: 'image'
|
||||
})
|
||||
|
|
@ -353,7 +353,7 @@ Ox.Map = function(options, self) {
|
|||
});
|
||||
});
|
||||
|
||||
self.$scaleLabel = new Ox.Label({
|
||||
self.$scaleLabel = Ox.Label({
|
||||
textAlign: 'center',
|
||||
title: '...'
|
||||
})
|
||||
|
|
@ -393,7 +393,7 @@ Ox.Map = function(options, self) {
|
|||
northeast = new google.maps.LatLngBounds(
|
||||
center, bounds.getNorthEast()
|
||||
).getCenter(),
|
||||
place = new Ox.MapPlace({
|
||||
place = Ox.MapPlace({
|
||||
alternativeNames: [],
|
||||
countryCode: '',
|
||||
editable: true,
|
||||
|
|
@ -488,7 +488,7 @@ Ox.Map = function(options, self) {
|
|||
//Ox.print('constructZoomInput', self.minZoom, self.maxZoom)
|
||||
if (self.options.zoombar) {
|
||||
self.$zoomInput && self.$zoomInput.removeElement();
|
||||
self.$zoomInput = new Ox.Range({
|
||||
self.$zoomInput = Ox.Range({
|
||||
arrows: true,
|
||||
max: self.maxZoom,
|
||||
min: self.minZoom,
|
||||
|
|
@ -609,12 +609,12 @@ Ox.Map = function(options, self) {
|
|||
i == length - 1 ||
|
||||
canContain(bounds, result.geometry.bounds || result.geometry.viewport)
|
||||
) {
|
||||
callback(new Ox.MapPlace(parseGeodata(results[i])));
|
||||
callback(Ox.MapPlace(parseGeodata(results[i])));
|
||||
return false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
callback(new Ox.MapPlace(parseGeodata(results[0])));
|
||||
callback(Ox.MapPlace(parseGeodata(results[0])));
|
||||
}
|
||||
}
|
||||
if (
|
||||
|
|
@ -637,7 +637,7 @@ Ox.Map = function(options, self) {
|
|||
address: name
|
||||
}, function(results, status) {
|
||||
if (status == google.maps.GeocoderStatus.OK) {
|
||||
callback(new Ox.MapPlace(parseGeodata(results[0])));
|
||||
callback(Ox.MapPlace(parseGeodata(results[0])));
|
||||
}
|
||||
if (
|
||||
status == google.maps.GeocoderStatus.OK ||
|
||||
|
|
@ -719,7 +719,7 @@ Ox.Map = function(options, self) {
|
|||
self.places = [];
|
||||
if (!self.isAsync) {
|
||||
self.options.places.forEach(function(place, i) {
|
||||
self.places[i] = new Ox.MapPlace(Ox.extend({
|
||||
self.places[i] = Ox.MapPlace(Ox.extend({
|
||||
map: that
|
||||
}, place));
|
||||
});
|
||||
|
|
@ -806,7 +806,7 @@ Ox.Map = function(options, self) {
|
|||
var place = getPlaceById(item.id);
|
||||
if (!place) {
|
||||
self.places.push(
|
||||
new Ox.MapPlace(Ox.extend({
|
||||
Ox.MapPlace(Ox.extend({
|
||||
map: that
|
||||
}, item)).add()
|
||||
);
|
||||
|
|
@ -1023,7 +1023,7 @@ Ox.Map = function(options, self) {
|
|||
]
|
||||
}
|
||||
}, function(results) {
|
||||
place = new Ox.MapPlace(Ox.extend({
|
||||
place = Ox.MapPlace(Ox.extend({
|
||||
map: that
|
||||
}, results.data.items[0])).add();
|
||||
self.places.push(place);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ Ox.MapImage <f:Ox.Element> MapImage Object
|
|||
Ox.MapImage = function(options, self) {
|
||||
|
||||
var self = self || {},
|
||||
that = new Ox.Element('<img>', self)
|
||||
that = Ox.Element('<img>', self)
|
||||
.defaults({
|
||||
height: 360,
|
||||
markerColorHighlight: 'yellow',
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ Ox.MapMarker = function(options) {
|
|||
bounds = bounds.union(that.place.bounds);
|
||||
southWest = bounds.getSouthWest();
|
||||
northEast = bounds.getNorthEast();
|
||||
that.map.newPlace(new Ox.MapPlace({
|
||||
that.map.newPlace(Ox.MapPlace({
|
||||
// fixme: duplicated, see Ox.Map.js
|
||||
alternativeNames: [],
|
||||
countryCode: '',
|
||||
|
|
|
|||
|
|
@ -72,13 +72,13 @@ Ox.MapPlace = function(options) {
|
|||
{lat: that.north, lng: that.east}
|
||||
);
|
||||
if (!that.marker) {
|
||||
that.marker = new Ox.MapMarker({
|
||||
that.marker = Ox.MapMarker({
|
||||
color: that.markerColor,
|
||||
map: that.map,
|
||||
place: that,
|
||||
size: that.markerSize
|
||||
});
|
||||
that.rectangle = new Ox.MapRectangle({
|
||||
that.rectangle = Ox.MapRectangle({
|
||||
map: that.map,
|
||||
place: that
|
||||
});
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@ Ox.MapRectangle <f> MapRectangle Object
|
|||
|
||||
Ox.MapRectangle = function(options, self) {
|
||||
|
||||
var options = Ox.extend({
|
||||
var that = this;
|
||||
options = Ox.extend({
|
||||
map: null,
|
||||
place: null
|
||||
}, options),
|
||||
that = this;
|
||||
}, options);
|
||||
|
||||
Ox.forEach(options, function(val, key) {
|
||||
that[key] = val;
|
||||
|
|
@ -34,7 +34,7 @@ Ox.MapRectangle = function(options, self) {
|
|||
markers <a> array of markers
|
||||
@*/
|
||||
that.markers = Ox.map(that.place.points, function(point, position) {
|
||||
return new Ox.MapRectangleMarker({
|
||||
return Ox.MapRectangleMarker({
|
||||
map: that.map,
|
||||
place: that.place,
|
||||
position: position
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue