Skip to content

Commit

Permalink
chore(gh-pages): convert snake_case to camelCase
Browse files Browse the repository at this point in the history
* Closes #152
  • Loading branch information
MiroslavPetrik authored and tomchentw committed Nov 19, 2015
1 parent 547fbdd commit 4a8bc21
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 37 deletions.
8 changes: 4 additions & 4 deletions examples/gh-pages/scripts/components/AsyncGettingStarted.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default class AsyncGettingStarted extends Component {
* This is called when you click on the map.
* Go and try click now.
*/
_handle_map_click (event) {
handleMapClick (event) {
var {markers} = this.state;
markers = update(markers, {
$push: [
Expand All @@ -51,7 +51,7 @@ export default class AsyncGettingStarted extends Component {
}
}

_handle_marker_rightclick (index, event) {
handleMarkerRightclick (index, event) {
/*
* All you modify is data, and the view is driven by data.
* This is so called data-driven-development. (And yes, it's now in
Expand Down Expand Up @@ -99,12 +99,12 @@ export default class AsyncGettingStarted extends Component {
ref="map"
defaultZoom={3}
defaultCenter={{lat: -25.363882, lng: 131.044922}}
onClick={::this._handle_map_click}>
onClick={::this.handleMapClick}>
{this.state.markers.map((marker, index) => {
return (
<Marker
{...marker}
onRightclick={this._handle_marker_rightclick.bind(this, index)} />
onRightclick={this.handleMarkerRightclick.bind(this, index)} />
);
})}
</ScriptjsGoogleMap>
Expand Down
20 changes: 10 additions & 10 deletions examples/gh-pages/scripts/components/GeojsonToComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,30 +44,30 @@ export default class GeojsonToComponents extends Component {
0: {
ref: "map",
style: {height: "100%"},
onClick: ::this._handle_map_click,
onZoomChanged: ::this._handle_map_zoom_changed,
onClick: ::this.handleMapClick,
onZoomChanged: ::this.handleMapZoomChanged,
},
1: {
ref: "centerMarker",
visible: true,
draggable: true,
onDragend: ::this._handle_marker_dragend,
onClick: ::this._handle_marker_click,
onDragend: ::this.handleMarkerDragend,
onClick: ::this.handleMarkerClick,
child: {
content: "Bermuda Triangle",
owner: "centerMarker",
},
},
3: {
onRightclick: ::this._handle_polygon_rightclick,
onRightclick: ::this.handlePolygonRightclick,
},
},
}

_handle_map_click () {
handleMapClick () {
}

_handle_map_zoom_changed () {
handleMapZoomChanged () {
this.setState(update(this.state, {
geoStateBy: {
0: {
Expand All @@ -84,7 +84,7 @@ export default class GeojsonToComponents extends Component {
}));
}

_handle_marker_click () {
handleMarkerClick () {
this.setState(update(this.state, {
geoStateBy: {
0: {
Expand All @@ -96,7 +96,7 @@ export default class GeojsonToComponents extends Component {
}));
}

_handle_polygon_rightclick () {
handlePolygonRightclick () {
this.setState(update(this.state, {
geoStateBy: {
1: {
Expand All @@ -108,7 +108,7 @@ export default class GeojsonToComponents extends Component {
}));
}

_handle_marker_dragend ({latLng}) {
handleMarkerDragend ({latLng}) {
const marker = this.state.geoJson.features[1],
originalCoordinates = marker.properties.originalCoordinates || marker.geometry.coordinates,
newCoordinates = [latLng.lng(), latLng.lat()];
Expand Down
8 changes: 4 additions & 4 deletions examples/gh-pages/scripts/components/GettingStarted.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class GettingStarted extends Component {
* This is called when you click on the map.
* Go and try click now.
*/
_handle_map_click (event) {
handleMapClick (event) {
var {markers} = this.state;
markers = update(markers, {
$push: [
Expand All @@ -47,7 +47,7 @@ export default class GettingStarted extends Component {
}
}

_handle_marker_rightclick (index, event) {
handleMarkerRightclick (index, event) {
/*
* All you modify is data, and the view is driven by data.
* This is so called data-driven-development. (And yes, it's now in
Expand All @@ -73,12 +73,12 @@ export default class GettingStarted extends Component {
ref="map"
defaultZoom={3}
defaultCenter={{lat: -25.363882, lng: 131.044922}}
onClick={::this._handle_map_click}>
onClick={::this.handleMapClick}>
{this.state.markers.map((marker, index) => {
return (
<Marker
{...marker}
onRightclick={this._handle_marker_rightclick.bind(this, index)} />
onRightclick={this.handleMarkerRightclick.bind(this, index)} />
);
})}
</GoogleMap>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default class AccessingArguments extends Component {
center: new google.maps.LatLng(-25.363882, 131.044922),
}

_handle_map_click (event) {
handleMapClick (event) {
const {markers} = this.state;
markers.push({
position: event.latLng
Expand All @@ -38,7 +38,7 @@ export default class AccessingArguments extends Component {
ref="map"
defaultZoom={4}
center={center}
onClick={::this._handle_map_click}>
onClick={::this.handleMapClick}>
{markers.map((marker, index) =>
<Marker position={marker.position} key={index} />
)}
Expand Down
14 changes: 7 additions & 7 deletions examples/gh-pages/scripts/components/events/ClosureListeners.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,30 +38,30 @@ export default class ClosureListeners extends Component {
});
}

_handle_marker_click (marker) {
handleMarkerClick (marker) {
marker.showInfo = true;
this.setState(this.state);
}

_handle_closeclick (marker) {
handleCloseclick (marker) {
marker.showInfo = false;
this.setState(this.state);
}

_render_InfoWindow (ref, marker) {
renderInfoWindow (ref, marker) {
if (Math.random() > 0.5) {
// Normal version: Pass string as content
return (
<InfoWindow key={`${ref}_info_window`}
content={marker.content}
onCloseclick={this._handle_closeclick.bind(this, marker)}
onCloseclick={this.handleCloseclick.bind(this, marker)}
/>
)
} else {
// "react-google-maps" extended version: Pass ReactElement as content
return (
<InfoWindow key={`${ref}_info_window`}
onCloseclick={this._handle_closeclick.bind(this, marker)}
onCloseclick={this.handleCloseclick.bind(this, marker)}
>
<div>
<strong>{marker.content}</strong>
Expand Down Expand Up @@ -92,8 +92,8 @@ export default class ClosureListeners extends Component {
<Marker key={ref} ref={ref}
position={marker.position}
title={(index+1).toString()}
onClick={this._handle_marker_click.bind(this, marker)}>
{marker.showInfo ? this._render_InfoWindow(ref, marker) : null}
onClick={this.handleMarkerClick.bind(this, marker)}>
{marker.showInfo ? this.renderInfoWindow(ref, marker) : null}
</Marker>
);
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default class GettingProperties extends Component {
content: "Change the zoom level",
}

_handle_zoom_changed () {
handleZoomChanged () {
const zoomLevel = this.refs.map.getZoom();
if (zoomLevel !== this.state.zoomLevel) {
// Notice: Check zoomLevel equality here,
Expand All @@ -40,7 +40,7 @@ export default class GettingProperties extends Component {
ref="map"
defaultCenter={myLatLng}
zoom={zoomLevel}
onZoomChanged={::this._handle_zoom_changed}>
onZoomChanged={::this.handleZoomChanged}>
<InfoWindow
defaultPosition={myLatLng}
content={content}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ export default class SimpleClickEvent extends Component {
center: this.props.initialCenter,
}

_handle_marker_click () {
handleMarkerClick () {
this.setState({
zoom: 8,
});
}

_handle_map_center_changed () {
handleMapCenterChanged () {
const newPos = this.refs.map.getCenter();
if (newPos.equals(new google.maps.LatLng(this.props.initialCenter))) {
// Notice: Check newPos equality here,
Expand Down Expand Up @@ -61,11 +61,11 @@ export default class SimpleClickEvent extends Component {
ref="map"
zoom={zoom}
center={center}
onCenterChanged={::this._handle_map_center_changed}>
onCenterChanged={::this.handleMapCenterChanged}>
<Marker
defaultPosition={center}
title="Click to zoom"
onClick={::this._handle_marker_click} />
onClick={::this.handleMarkerClick} />
</GoogleMap>
);
}
Expand Down
8 changes: 4 additions & 4 deletions examples/gh-pages/scripts/components/places/SearchBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ export default class SearchBoxExample extends Component {
markers: []
}

_handle_bounds_changed () {
handleBoundsChanged () {
this.setState({
bounds: this.refs.map.getBounds(),
center: this.refs.map.getCenter()
});
}

_handle_places_changed () {
handlePlacesChanged () {
const places = this.refs.searchBox.getPlaces();
const markers = [];

Expand Down Expand Up @@ -76,13 +76,13 @@ export default class SearchBoxExample extends Component {
}
}}
defaultZoom={15}
onBoundsChanged={::this._handle_bounds_changed}
onBoundsChanged={::this.handleBoundsChanged}
ref="map">

<SearchBox
bounds={this.state.bounds}
controlPosition={google.maps.ControlPosition.TOP_LEFT}
onPlacesChanged={::this._handle_places_changed}
onPlacesChanged={::this.handlePlacesChanged}
ref="searchBox"
style={SearchBoxExample.inputStyle} />

Expand Down

0 comments on commit 4a8bc21

Please sign in to comment.