Skip to content

Commit

Permalink
version 1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
MicheleBertoli committed Mar 28, 2015
1 parent b4d1581 commit 0acb4f2
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 46 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
language: node_js
node_js:
- 0.10.33
before_deploy:
- npm run demo
deploy:
provider: heroku
api_key:
Expand Down
21 changes: 10 additions & 11 deletions demo/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
var React = require('react'),
ReactGmaps = require('../dist'),
Events = require('../dist/components/events');
var { Gmaps, Marker } = ReactGmaps;
import React from 'react';
import {Gmaps, Marker} from '../dist';
import Events from '../dist/components/events';

var styles = {
let styles = {
item: {
backgroundColor: 'white',
transition: 'background-color 0.2s linear'
Expand All @@ -13,16 +12,16 @@ var styles = {
}
};

var App = React.createClass({
let App = React.createClass({

render() {

var events = [];
var handlers = {};
for (var _event in Events) {
let events = [];
let handlers = {};
for (let _event in Events) {
if (Events.hasOwnProperty(_event)) {
events.push(
<li ref={Events[_event]} style={styles.item}>
<li key={Events[_event]} ref={Events[_event]} style={styles.item}>
{Events[_event]}
</li>
);
Expand All @@ -49,7 +48,7 @@ var App = React.createClass({
},

handler(_event) {
var item = this.refs[_event].getDOMNode();
let item = this.refs[_event].getDOMNode();
item.style.backgroundColor = '#99ccff';
setTimeout(function() {
item.style.backgroundColor = styles.item.backgroundColor;
Expand Down
2 changes: 1 addition & 1 deletion dist/components/__tests__/gmaps-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe("Gmaps", function () {
var TestUtils = React.addons.TestUtils;
var Gmaps = require("../gmaps");

var gmaps;
var gmaps = undefined;
var width = "100%";
var height = "100%";
var style = {
Expand Down
2 changes: 1 addition & 1 deletion dist/components/__tests__/marker-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe("Marker", function () {
var TestUtils = React.addons.TestUtils;
var Marker = require("../marker");

var marker;
var marker = undefined;

beforeEach(function () {
window.google = {
Expand Down
20 changes: 9 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"name": "react-gmaps",
"version": "0.1.4",
"version": "0.1.5",
"description": "A Google Maps component for React.js",
"main": "dist/index.js",
"scripts": {
"build": "babel ./src --out-dir ./dist",
"pretest": "jsxhint --harmony ./src",
"pretest": "jsxhint --babel ./src",
"test": "jest",
"postinstall": "npm run demo",
"demo": "browserify ./demo/index.js -o ./demo/build.js",
"start": "node server"
},
Expand All @@ -28,27 +27,26 @@
"homepage": "https://github.com/MicheleBertoli/react-gmaps",
"devDependencies": {
"babel": "^4.7.16",
"babel-jest": "^4.0.0",
"babelify": "^5.0.4",
"jest-cli": "^0.2.2",
"jsxhint": "^0.9.0"
"jsxhint": "^0.13.3"
},
"dependencies": {
"browserify": "^8.1.3",
"express": "^4.11.2",
"react": "^0.13.1",
"reactify": "^1.0.0"
"react": "^0.13.1"
},
"browserify": {
"transform": [
[
"reactify",
{
"es6": true
}
"babelify"
]
]
},
"jest": {
"scriptPreprocessor": "<rootDir>/preprocessor.js",
"testPathDirs": ["./src"],
"scriptPreprocessor": "<rootDir>/node_modules/babel-jest",
"unmockedModulePathPatterns": [
"<rootDir>/node_modules/react"
]
Expand Down
9 changes: 0 additions & 9 deletions preprocessor.js

This file was deleted.

18 changes: 9 additions & 9 deletions src/components/__tests__/gmaps-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ jest.dontMock('../gmaps');

describe('Gmaps', () => {

var React = require('react/addons');
var TestUtils = React.addons.TestUtils;
var Gmaps = require('../gmaps');
let React = require('react/addons');
let TestUtils = React.addons.TestUtils;
let Gmaps = require('../gmaps');

var gmaps;
var width = '100%';
var height = '100%';
var style = {
let gmaps;
let width = '100%';
let height = '100%';
let style = {
backgroundColor: 'black'
};
var className = 'className';
var onMapCreated = jest.genMockFunction();
let className = 'className';
let onMapCreated = jest.genMockFunction();

beforeEach(() => {
delete window.google;
Expand Down
8 changes: 4 additions & 4 deletions src/components/__tests__/marker-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ jest.dontMock('../marker');

describe('Marker', () => {

var React = require('react/addons');
var TestUtils = React.addons.TestUtils;
var Marker = require('../marker');
let React = require('react/addons');
let TestUtils = React.addons.TestUtils;
let Marker = require('../marker');

var marker;
let marker;

beforeEach(() => {
window.google = {
Expand Down

0 comments on commit 0acb4f2

Please sign in to comment.