appscms-tools-theme 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/assets/js/googledriveinput.js +19 -9
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d214029a66a9d6999fdae7a43813bc7f00afec5a83fed6d0063fb838b084f7b4
|
|
4
|
+
data.tar.gz: 3fd0c42d5d1603a8ff781183162e4b5a0adae2bf288e78bb2830a28d34d746f9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7e898e5a76764132f79e1e4f256992ec123bbbb2e4062da4b8c0f273a33b5461438ece6cb310cfc51125bf1bb3b2ae6511c0e8aaeb83a6a81fa8524c61fd08ea
|
|
7
|
+
data.tar.gz: 4f09aa4b93ad7fdb9e1717dcfc3b1f4d950bc87dadda4b81e4b498ba82910c614a02c027f67fffcff1b8a3351bacd82a20b29fac39148f56a4027560afbeac34
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
---
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
let mimeTypes
|
|
5
|
+
let showLoader
|
|
6
|
+
let closeLoader
|
|
7
|
+
let getFile
|
|
5
8
|
export const addScripts=()=>{
|
|
6
9
|
const scripts=document.getElementsByTagName('script')
|
|
7
10
|
const check= Array.from(scripts).find(item=>item.src==='https://www.dropbox.com/static/api/2/dropins.js')
|
|
@@ -29,30 +32,37 @@ const scope = [
|
|
|
29
32
|
let pickerApiLoaded = false
|
|
30
33
|
let oauthToken
|
|
31
34
|
export const loadPicker = (mimeType,showLoader,closeLoader,getFile) => {
|
|
35
|
+
console.log(showLoder)
|
|
36
|
+
console.log(mimeType)
|
|
37
|
+
mimeTypes=mimeType
|
|
38
|
+
showLoader=showLoader
|
|
39
|
+
closeLoader=closeLoader
|
|
40
|
+
getFile=getFile
|
|
32
41
|
gapi.load('auth', { callback: onAuthApiLoad })
|
|
33
|
-
gapi.load('picker', { callback: onPickerApiLoad
|
|
42
|
+
gapi.load('picker', { callback: onPickerApiLoad })
|
|
34
43
|
}
|
|
35
|
-
const onAuthApiLoad = (
|
|
44
|
+
const onAuthApiLoad = () => {
|
|
45
|
+
|
|
36
46
|
window.gapi.auth.authorize(
|
|
37
47
|
{
|
|
38
48
|
client_id: clientId,
|
|
39
49
|
scope: scope,
|
|
40
50
|
immediate: false,
|
|
41
51
|
},
|
|
42
|
-
handleAuthResult
|
|
52
|
+
handleAuthResult
|
|
43
53
|
)
|
|
44
54
|
}
|
|
45
55
|
let onPickerApiLoad = () => {
|
|
46
56
|
pickerApiLoaded = true
|
|
47
57
|
createPicker()
|
|
48
58
|
}
|
|
49
|
-
const handleAuthResult = (authResult
|
|
59
|
+
const handleAuthResult = (authResult) => {
|
|
50
60
|
if (authResult && !authResult.error) {
|
|
51
61
|
oauthToken = authResult.access_token
|
|
52
|
-
createPicker(
|
|
62
|
+
createPicker()
|
|
53
63
|
}
|
|
54
64
|
}
|
|
55
|
-
const createPicker = (
|
|
65
|
+
const createPicker = () => {
|
|
56
66
|
if (pickerApiLoaded && oauthToken) {
|
|
57
67
|
const view = new google.picker.View(google.picker.ViewId.DOCS)
|
|
58
68
|
view.setMimeTypes(mimeType)
|
|
@@ -64,12 +74,12 @@ const createPicker = (mimeType,showLoader,closeLoader,getFile) => {
|
|
|
64
74
|
.addView(view)
|
|
65
75
|
.addView(new google.picker.DocsUploadView())
|
|
66
76
|
.setDeveloperKey(developerKey)
|
|
67
|
-
.setCallback(pickerCallback
|
|
77
|
+
.setCallback(pickerCallback)
|
|
68
78
|
.build()
|
|
69
79
|
picker.setVisible(true)
|
|
70
80
|
}
|
|
71
81
|
}
|
|
72
|
-
const pickerCallback = async (data
|
|
82
|
+
const pickerCallback = async (data) => {
|
|
73
83
|
if (data.action == google.picker.Action.PICKED) {
|
|
74
84
|
showLoader()
|
|
75
85
|
const res = await fetch(
|