Skip to content

Commit

Permalink
Updated to better manage google api code
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Regan committed Nov 21, 2015
1 parent 51d4b86 commit 7482bdd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
11 changes: 6 additions & 5 deletions project_information.txt
Expand Up @@ -38,8 +38,8 @@ X Step 1: Get this running
> Create directive for oauth button // see Week-10-solution
X include in index.html as button
X Use GoogleDriveService as controller
* Move init code in head of HTML into controller or service
* load google drive api in head or in service
X Move init code in head of HTML into controller or service
X load google drive api in head or in service
[@
<script>
function init() {
Expand All @@ -50,8 +50,8 @@ X Step 1: Get this running
<script src="vendor.js"></script>
<script src="app.js"></script>
@]
* add window.checkAuth to oauth button directive
* Update view with $rootScope.apply() // see discussions
X add window.checkAuth to oauth button directive
> Update view with $rootScope.apply() // see discussions
X Create Google Drive Service // see routastic
X Migrate app.js code
X inject client/scopes service
Expand Down Expand Up @@ -90,5 +90,6 @@ Change History:
15_11_15_02_06_000: Refactored everything to single app.js file to have easier control over load order and file management
15_11_15_02_06_001: Fixed bugs in bower, gulp, and karma
15_11_15_02_07_000: Added oauth directive to html
15_11_21_02_08_000: Updated to better manage google api code

cd ~/cscie32/DRRrrRrvrr; git status; git commit -a -m "Closing up shop"; git push origin master; git status
cd ~/cscie32/DRRrrRrvrr; git status; git commit -a -m "Updated to better manage google api code"; git push origin master; git status
13 changes: 4 additions & 9 deletions src/index.html
Expand Up @@ -2,20 +2,15 @@
<html lang="en">
<head>
<link rel="stylesheet" href="styles.css"/>
<!-- init the google drive api to manage the load order later -->
<script>
var init = function() {
var interval = window.setInterval(function(){
if(window.checkAuth){
window.checkAuth();
window.clearInterval(interval);
function init() {
gapi.client.load('drive', 'v2');
}
}, 2000);
};
window.action = "list";
</script>
<script src="https://apis.google.com/js/client.js?onload=init"></script>
<script src="vendors.js"></script>
<script src="app.js"></script>
<script src="https://apis.google.com/js/client.js?onload=init"></script>
</head>
<body ng-app="DRRrrRrvrr" ng-cloak class="container">
<h1>Hello Google DRRrrRrvrr!</h1>
Expand Down
10 changes: 10 additions & 0 deletions src/oauth.html
@@ -1,4 +1,14 @@
<div id="authorize-div">
<script>
window.setInterval(function(){
if(window.checkAuth){
window.checkAuth();
window.clearInterval(interval);
}
}, 2000);
};
window.action = "list";
</script>
<span>Authorize access to Drive API</span>
<!--Button for the user to click to initiate auth sequence -->
<button class="btn" id="authorize-btn" ng-click="lc.handleAuthClick()">
Expand Down

0 comments on commit 7482bdd

Please sign in to comment.