svmatthews/guss — pull request #7 by thebigspoon (2014-11-15 18:31:07+00:00)
Title: Remove jQuery dependencies, only use gapi calls and organize code into App structure

Sam. I really hope I'm not stepping on your toes. This pull request does not have to be merged. It's more of an example of how I would structure an application and hopefully it generates insights for you ( it might not ). Feel free to ask any questions about it. This is full solution to #2 and #3 ( i merged your `breakout` branch in before b/c i saw you were working on the same thing ).

Two things to note here:

* This commit 6687a8a054320f180c911e0e7dabf75074c8cac7 shows how i structured the calls while still using the 'Build new gus' button with hardcoded Google OAuth2 URL call. It's got some interesting things in it so maybe check it out and see how it works on it's own. However, we probably don't want to use this hardcoded URL b/c the param `redirect_url` would change in production. To accomodate something like that we'd have to build the URL dynamically. Since doing that is a little more work, we just might as well use the gapi library calls to do authorization. See next commit

* This commit 6105055f7e11abd0259afdf28532be7c1e7548ec removes the above hardcoded redirect for gapi authorization call. I put in comments in all the spots where we can remove function calls because of this change to help you see the difference between this and the previous commit.