Skip to content

Commit

Permalink
Merge pull request #56 from CAMeL-Lab/fix_signin_bugs
Browse files Browse the repository at this point in the history
more html fixes
  • Loading branch information
muhammed-abuodeh authored Feb 15, 2024
2 parents 95b383b + 2318482 commit 2307c7c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 2 additions & 0 deletions authenticator.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function logout() {
}

function onAuthenticated() {
console.log("onAuthenticated");
// set access token in gapi client for future requests
gapi.client.setToken({ access_token: getTokenFromSessionStorage() });
const accessToken = getTokenFromSessionStorage();
Expand All @@ -24,6 +25,7 @@ function onAuthenticated() {
// if authenticated successfully, hide authentication button && show logout button
$(".toolbar [id='auth_btn']").hide();
$(".toolbar [id='logout_btn']").show();
$(".toolbar [id='upload1']").show();
}
}

Expand Down
7 changes: 2 additions & 5 deletions gapiLoader.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
let gapiClientInited = false;
let gapiPickerInited = false;
let gisInited = false;
// set this to the right server origin when pushed to Github
Expand Down Expand Up @@ -137,13 +136,11 @@ function enableBrowseButton(accessToken) {
* Enables user interaction after all libraries are loaded.
*/
function maybeEnableAuthButton() {
if (gapiClientInited && gapiPickerInited && gisInited && !isAuthenticated) {
if (gapiPickerInited && !isAuthenticated) {
$(".toolbar [id='auth_btn']").show();
}
}

function maybeEnableSaveRemoteButton() {
if (gapiClientInited && gisInited) {
$("#save_remote").show();
}
$("#save_remote").show();
}
4 changes: 2 additions & 2 deletions viewtree.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@

<!-- upload from google drive -->
<div class="container" style="width:100%">
<section id="upload1" class="upload">
<section id="upload1" class="upload; display:none">
<p>MyDrive CoNLL-U files</p>
<input style="float: left; display: none" type="button" id="browse_btn" value="Browse MyDrive" />
<p id="picked_filename" style="float: left"></p>
Expand All @@ -146,7 +146,7 @@
</div>

<div class="toolbar" style="text-align: center;">
<input type="button" tabindex="-1" value="Authenticate with Google Drive" id="auth_btn"
<input type="button" value="Authenticate with Google Drive" id="auth_btn"
onClick="authenticate()"/>
<input type="button" tabindex="-1" value="Logout" id="logout_btn" onClick="logout()" />
</div>
Expand Down

0 comments on commit 2307c7c

Please sign in to comment.