Skip to content

Commit

Permalink
updated conflicts in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
isabellachen committed Oct 29, 2017
2 parents b9b57f7 + 5b76232 commit 67b2854
Show file tree
Hide file tree
Showing 9 changed files with 134 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ node_modules
# Custom
private
dist
.pem
19 changes: 19 additions & 0 deletions build/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,25 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de

var store = (0, _redux.createStore)(_reducers2.default, (0, _redux.applyMiddleware)(_reduxLogger2.default));

// chrome.identity.getAuthToken({
// interactive: true,
// }, function (token) {
// if (chrome.runtime.lastError) {
// alert(chrome.runtime.lastError.message);
// return;
// }
// var x = new XMLHttpRequest();
// x.open('GET', 'https://www.googleapis.com/oauth2/v2/userinfo?alt=json&access_token=' + token);
// x.onload = function () {
// alert(x.response);
// };
// x.send();
// });

// chrome.identity.getAuthToken({ 'interactive': true }, function (token) {
// console.log('token ',token);
// });

(0, _reactChromeRedux.wrapStore)(store, {
portName: 'RSC'
});
Expand Down
16 changes: 12 additions & 4 deletions build/manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"manifest_version": 2,
"name": "Map Marklet",
"description": "Map Marklet",
"description": "Bookmarklet for Google Maps",
"version": "0.0.0.1",
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvV6WbCyOCSKPbLYbbe6Qtp24z4iw2WXxBU1nbYJQPO22f0eizdeseIn2TRAE4q7d6N94YNMGXnHyXJXSUiubVZ79ePR5iLovBbgtwcxgaM4XSvKjz8jaP3JGLKPMaNPbmXZdWZAykFEEgighG2f6uZCht3IGNsg3GiTXQ8pCFhgDg5Iw4bRjQQGOV6q8vLL7/Q74yE97Ac4G9IYnYJFYH/OieDezKx68IQI0H/18Ovz3QPF8f/3FvRnuXwdjCl34hfbMvwKM1vwpoPJF2tTBchat2/83ja3r+AtnTvlzXyRDoD89J6cV4cJueZ9DqTQemCFKZgNNKS7mU1fpV4vZ9wIDAQAB",
"background": {
"scripts": [
"event.js"
Expand All @@ -13,7 +14,7 @@
"default_title": "Map Marklet",
"default_popup": "popup.html"
},
"content_security_policy": "script-src 'self' https://maps.googleapis.com; object-src 'self'",
"content_security_policy": "script-src 'self' https://maps.googleapis.com https://connect.facebook.net/en_US/all.js; object-src 'self'",
"content_scripts": [
{
"matches": ["*://*/*"],
Expand All @@ -25,6 +26,13 @@
"./main.html"
],
"permissions": [
"tabs"
]
"tabs",
"identity",
"*://*.google.com/*",
"storage"
],
"oauth2": {
"client_id": "658325221633-v2aurmcset7hj6ajq803cv438k7cf5ti.apps.googleusercontent.com",
"scopes": ["profile"]
}
}
36 changes: 35 additions & 1 deletion build/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -11945,6 +11945,30 @@ var App = function (_Component) {

var _this = _possibleConstructorReturn(this, (App.__proto__ || Object.getPrototypeOf(App)).call(this, props));

_this.renderUserButton = function () {
if (_this.state.authorization) {
return _react2.default.createElement(
'button',
null,
'My Trips'
);
} else {
return _react2.default.createElement(
'button',
{ onClick: _this.signIn },
'Login'
);
}
};

_this.signIn = function () {
chrome.identity.getAuthToken({ 'interactive': true }, function (token) {
_this.setState({
authorization: token
});
});
};

_this.placeMarker = function (latLng, date) {
_this.setState({
place: null,
Expand Down Expand Up @@ -11999,6 +12023,15 @@ var App = function (_Component) {
return _this;
}

// componentWillMount () {
// chrome.identity.getAuthToken({ 'interactive': true }, (token) => {
// this.setState({
// authorization: token,
// });
// console.log('token ',token);
// });
// }

_createClass(App, [{
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
Expand Down Expand Up @@ -12058,7 +12091,8 @@ var App = function (_Component) {
'button',
{ onClick: this.addMarker },
'Add Marker'
)
),
this.renderUserButton()
);
}
}]);
Expand Down
19 changes: 19 additions & 0 deletions event/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,25 @@ const store = createStore(
applyMiddleware(logger)
);

// chrome.identity.getAuthToken({
// interactive: true,
// }, function (token) {
// if (chrome.runtime.lastError) {
// alert(chrome.runtime.lastError.message);
// return;
// }
// var x = new XMLHttpRequest();
// x.open('GET', 'https://www.googleapis.com/oauth2/v2/userinfo?alt=json&access_token=' + token);
// x.onload = function () {
// alert(x.response);
// };
// x.send();
// });

// chrome.identity.getAuthToken({ 'interactive': true }, function (token) {
// console.log('token ',token);
// });

wrapStore(store, {
portName: 'RSC',
});
20 changes: 14 additions & 6 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"manifest_version": 2,
"name": "RCR",
"description": "React, Chrome, and Redux example",
"name": "Map Marklet",
"description": "Bookmarklet for Google Maps",
"version": "0.0.0.1",
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvV6WbCyOCSKPbLYbbe6Qtp24z4iw2WXxBU1nbYJQPO22f0eizdeseIn2TRAE4q7d6N94YNMGXnHyXJXSUiubVZ79ePR5iLovBbgtwcxgaM4XSvKjz8jaP3JGLKPMaNPbmXZdWZAykFEEgighG2f6uZCht3IGNsg3GiTXQ8pCFhgDg5Iw4bRjQQGOV6q8vLL7/Q74yE97Ac4G9IYnYJFYH/OieDezKx68IQI0H/18Ovz3QPF8f/3FvRnuXwdjCl34hfbMvwKM1vwpoPJF2tTBchat2/83ja3r+AtnTvlzXyRDoD89J6cV4cJueZ9DqTQemCFKZgNNKS7mU1fpV4vZ9wIDAQAB",
"background": {
"scripts": [
"event.js"
],
"persistent": true
},
"browser_action": {
"default_title": "RCR Example",
"default_title": "Map Marklet",
"default_popup": "popup.html"
},
"content_security_policy": "script-src 'self' https://maps.googleapis.com; object-src 'self'",
"content_security_policy": "script-src 'self' https://maps.googleapis.com https://connect.facebook.net/en_US/all.js; object-src 'self'",
"content_scripts": [
{
"matches": ["*://*/*"],
Expand All @@ -25,6 +26,13 @@
"./main.html"
],
"permissions": [
"tabs"
]
"tabs",
"identity",
"*://*.google.com/*",
"storage"
],
"oauth2": {
"client_id": "658325221633-v2aurmcset7hj6ajq803cv438k7cf5ti.apps.googleusercontent.com",
"scopes": ["profile"]
}
}
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Isabella Chen",
"author": "Tyler Shaddix",
"dependencies": {
"google-maps-react": "^1.1.0",
"prop-types": "^15.5.10",
"react": "^15.6.1",
"react-chrome-redux": "0.0.7",
"react-dom": "^15.6.1",
"react-facebook-login": "^3.6.2",
"react-redux": "^4.4.8",
"redux": "^3.7.2",
"redux-logger": "^3.0.6",
Expand Down
28 changes: 27 additions & 1 deletion popup/src/scripts/components/app/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,31 @@ class App extends Component {

}

// componentWillMount () {
// chrome.identity.getAuthToken({ 'interactive': true }, (token) => {
// this.setState({
// authorization: token,
// });
// console.log('token ',token);
// });
// }

renderUserButton = () => {
if (this.state.authorization) {
return <button>My Trips</button>;
} else {
return <button onClick={this.signIn}>Login</button>;
}
}

signIn = () => {
chrome.identity.getAuthToken({ 'interactive': true }, (token) => {
this.setState({
authorization: token,
});
});
}

componentWillReceiveProps (nextProps) {
//force googlemaps to update when component recieves props from redux store
if (nextProps.markers !== this.props.markers) {
Expand Down Expand Up @@ -81,7 +106,6 @@ class App extends Component {
});
}


render () {

if (!this.props.loaded) {
Expand Down Expand Up @@ -111,6 +135,8 @@ class App extends Component {
<textarea id="desc" />

<button onClick={this.addMarker}>Add Marker</button>
{this.renderUserButton()}

</div>
);
}
Expand Down

0 comments on commit 67b2854

Please sign in to comment.