From d593111bba7eb16e9838b7ab08357d29cf8ffd11 Mon Sep 17 00:00:00 2001 From: Alessandro Aglietti Date: Tue, 3 Jun 2014 18:00:27 +0200 Subject: [PATCH 1/3] Use API_VERSION when call JS API --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 005cd1c..330919d 100644 --- a/index.html +++ b/index.html @@ -295,7 +295,7 @@ //small objects (under 64k) so to support larger file sizes //we're using the generic HTTP request method gapi.client.request() var request = gapi.client.request({ - 'path': '/upload/storage/v1beta2/b/' + BUCKET + '/o', + 'path': '/upload/storage/' + API_VERSION + '/b/' + BUCKET + '/o', 'method': 'POST', 'params': {'uploadType': 'multipart'}, 'headers': { From 50dd9f62d89bd50de973d68ec25ccf2747bdc751 Mon Sep 17 00:00:00 2001 From: Alessandro Aglietti Date: Tue, 3 Jun 2014 18:09:24 +0200 Subject: [PATCH 2/3] setTimeout is not the right way --- index.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 330919d..aa760f2 100644 --- a/index.html +++ b/index.html @@ -19,7 +19,7 @@ - + From 373e9954eac3bd6c746fdcba06932c56eac4978d Mon Sep 17 00:00:00 2001 From: Alessandro Aglietti Date: Tue, 3 Jun 2014 18:26:15 +0200 Subject: [PATCH 3/3] clean up comments and onload in jquery way $(..) --- index.html | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index aa760f2..8d2aea1 100644 --- a/index.html +++ b/index.html @@ -512,10 +512,8 @@ /** * Set required API keys and check authentication status. */ -// function handleClientLoad() { function googleJsApiOnLoad(){ gapi.client.setApiKey(apiKey); - // window.setTimeout(checkAuth, 1); checkAuth(); } @@ -567,10 +565,8 @@ /** * Driver for sample application. */ - $(window) - .bind('load', function() { - addSelectionSwitchingListeners(); - // handleClientLoad(); use the "onload" parameter + $(function(){ + addSelectionSwitchingListeners(); });