-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Google picker api * Release 2024.8.2 * Release 2024.8.2
- Loading branch information
Showing
10 changed files
with
136 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<script> | ||
import { | ||
ChromePromiseApi | ||
} from '@/lib/chrome-api-promise.js' | ||
import { manifest } from 'webextension-polyfill'; | ||
const chromePromise = ChromePromiseApi() | ||
export default { | ||
props: { | ||
settings: Object, | ||
googleDriveManager: Object, | ||
}, | ||
data() { | ||
return { | ||
pickerOpen: false, | ||
} | ||
}, | ||
methods: { | ||
showPicker() { | ||
this.pickerOpen = true; | ||
chromePromise.runtime.getManifest().then((manifest) => { | ||
const APP_ID = manifest.static_data[this.googleDriveManager.key].client_id | ||
this.googleDriveManager.getToken().then(accessToken => { | ||
const iframe = document.getElementById("pickerFrame").contentWindow; | ||
iframe.postMessage({ | ||
m: 'showPicker', | ||
accessToken: accessToken, | ||
appId: APP_ID, | ||
}, '*'); | ||
}); | ||
}); | ||
}, | ||
}, | ||
mounted() { | ||
window.addEventListener( | ||
"message", | ||
(event) => { | ||
if (event.data.m === 'pickerResult') { | ||
console.info("Picker result", event) | ||
this.$parent.populate() | ||
this.pickerOpen = false; | ||
} | ||
}, | ||
false, | ||
); | ||
} | ||
} | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<div class="warn pill"> | ||
<p><b>Google Drive support has updated!</b> You can now grant Tusk access to each keepass file.</p> | ||
</div> | ||
<div | ||
v-show="!pickerOpen" | ||
style="margin-top: 10px;" | ||
> | ||
<a | ||
class="btn" | ||
@click="showPicker" | ||
> | ||
Choose database file | ||
</a> | ||
</div> | ||
<iframe | ||
id="pickerFrame" | ||
v-show="pickerOpen" | ||
style="width: 100%; height: 480px; border: 4px solid gray;" | ||
src="https://subdavis.com/Tusk/sandbox-picker.html"> | ||
</iframe> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,4 +128,8 @@ button.action-button { | |
height: 48px; | ||
vertical-align: middle; | ||
} | ||
} | ||
|
||
.mr-10 { | ||
margin-right: 10px; | ||
} |