From fcd1953c833fac402d2900a359527974ec462ef7 Mon Sep 17 00:00:00 2001 From: Chuck Carpenter Date: Sun, 12 Jul 2015 11:05:11 -0400 Subject: [PATCH 1/4] adding initial React setup --- Gruntfile.js | 2 +- README.md | 13 +++++++++ app/index.html | 28 ++++-------------- app/scripts/main.js | 71 +++++++++++++++++++++++++++++++++++++++++++++ bower.json | 3 +- package.json | 3 ++ 6 files changed, 96 insertions(+), 24 deletions(-) create mode 100644 README.md diff --git a/Gruntfile.js b/Gruntfile.js index b5979a5..b98b0df 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -70,7 +70,7 @@ module.exports = function (grunt) { '<%= config.app %>/images/{,*/}*', '.tmp/scripts/{,*/}*.js' ], - port: 9000, + port: 8000, server: { baseDir: ['.tmp', config.app], routes: { diff --git a/README.md b/README.md new file mode 100644 index 0000000..0e98bd3 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +### Installation: + +* Install [Homebrew](http://brew.sh/): ```ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"``` you may need to run ```ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"``` and make certain that your user has administrative rights for the file system + - Make sure everything is running smoothly with ```brew doctor``` +* Install [Node](http://nodejs.org/): ```brew install node``` +* Install [Grunt-Cli](http://gruntjs.com/): ```npm install -g grunt-cli``` +* Install [Bower](http://bower.io/): ```npm install -g bower``` +* Install packages by running ```npm install && bower install``` + +#### Grunt Commands + +* `grunt serve` - This will give you a local development instance to work from and open the site in a local server. +* `grunt build` - This will build a deployable version of the app. diff --git a/app/index.html b/app/index.html index e945475..a6ffae0 100644 --- a/app/index.html +++ b/app/index.html @@ -57,6 +57,7 @@

Enter a search query

+ @@ -92,14 +93,11 @@
<% }) %> -
-
+
- - - +

GOOGLE TRENDS

+
+ + +
- -

GOOGLE TRENDS

- +
+
+
+ + + +
+
+ - - - - -
-

Twitter Results

- -
- - - - - + - @@ -190,7 +187,6 @@

Twitter Results

- diff --git a/app/scripts/main.js b/app/scripts/main.js index ad45f28..b5a4567 100644 --- a/app/scripts/main.js +++ b/app/scripts/main.js @@ -1,10 +1,9 @@ -// jshint devel:true -console.log('\'Allo \'Allo!'); - // load nytimes: $(document).ready(function() { - nyt('obamacare'); + nyt('digital privacy'); }); + +// React app function get( src, query ) { return new Promise( (res, rej) => { const request = new XMLHttpRequest(); @@ -99,7 +98,7 @@ const SunlightWidget = React.createClass({ }, componentDidMount () { new Promise( ( resolve, reject )=> { - get( 'sunlight', 'Cool' ).then( + get( 'sunlight', 'Digital Privacy' ).then( ( data )=> { if ( !data ) { return; } @@ -138,9 +137,9 @@ const SunlightWidget = React.createClass({ } }); -React.render( - , document.getElementById('form-search') -); +// React.render( +// , document.getElementById('form-search') +// ); React.render( , document.getElementById('sl-widget') From 3f488101dde7c200a9f6bed2c32819a00f84912e Mon Sep 17 00:00:00 2001 From: Chuck Carpenter Date: Sun, 12 Jul 2015 14:49:26 -0400 Subject: [PATCH 4/4] fixing form formatting --- app/index.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/index.html b/app/index.html index caceaaf..38ac497 100644 --- a/app/index.html +++ b/app/index.html @@ -44,7 +44,6 @@

Enter a search query

In order to get started, enter a term and location.

-
@@ -55,7 +54,6 @@

Enter a search query

-