Skip to content

Commit 4acdcc5

Browse files
authored
Revert "feat: add logout api method (#893)" (#901)
This reverts commit 0273443.
1 parent cf329ae commit 4acdcc5

File tree

5 files changed

+34
-83
lines changed

5 files changed

+34
-83
lines changed

dummy/logout.html

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,35 @@
11
<meta charset="UTF-8" />
22
<meta content="width=device-width,initial-scale=1" name="viewport" />
33
<script>
4-
UPLOADCARE_PUBLIC_KEY = 'demopublickey'
4+
UPLOADCARE_PUBLIC_KEY = 'demopublickey' // should be replaced
55
UPLOADCARE_TABS = 'all'
66
UPLOADCARE_DEBUG_UPLOADS = true
7+
UPLOADCARE_SOCIAL_BASE = 'https://social.uploadcare.com'
8+
UPLOADCARE_CDN_BASE = 'https://ucarecdn.com'
9+
UPLOADCARE_URL_BASE = 'https://upload.uploadcare.com'
710
</script>
811
<script src="./uploadcare.full.js"></script>
912

10-
<input type="hidden" role="uploadcare-uploader" preview-step="" />
11-
12-
<button id="logout">logout</button>
13+
<input id="key" />
14+
<button id="logout">switch</button>
1315

1416
<script>
17+
function switchKey() {
18+
const $ = uploadcare.jQuery
19+
const key = $('#key').val()
20+
21+
document.querySelector('#uploader')?.remove()
22+
document.querySelector('.uploadcare--widget')?.remove()
23+
24+
$('<input type="hidden" id="uploader" preview-step="" />').appendTo(
25+
document.body
26+
)
27+
const widget1 = uploadcare.Widget('#uploader', {
28+
remoteTabSessionKey: key
29+
})
30+
}
31+
1532
document.querySelector('#logout').addEventListener('click', () => {
16-
uploadcare
17-
.logout()
18-
.then(() => console.log('LOGOUT OK'))
19-
.catch((err) => console.log('LOGOUT FAILED', err))
33+
switchKey()
2034
})
2135
</script>

src/bundles/uploadcare.api.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import { presets, defaults, common } from '../settings'
55
import { fileFrom, filesFrom } from '../files'
66
import { FileGroup, loadFileGroup } from '../files/group-creator'
77

8-
import { logout } from '../logout'
9-
108
import { plugin } from './namespace.api'
119
import { version } from '../../package.json'
1210

@@ -27,6 +25,5 @@ export default {
2725
filesFrom,
2826
FileGroup,
2927
loadFileGroup,
30-
logout,
3128
locales: ['en']
3229
}

src/logout.js

Lines changed: 0 additions & 56 deletions
This file was deleted.

src/social-sources.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/widget/dialog.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import { filesFrom } from '../files'
1616
import { FileGroup } from '../files/group-creator'
1717
import { isFileGroup } from '../utils/groups'
1818
import { isWindowDefined } from '../utils/is-window-defined'
19-
import { socialSources } from '../social-sources'
2019

2120
const lockDialogFocus = function (e) {
2221
if (!e.shiftKey && focusableElements.last().is(e.target)) {
@@ -204,7 +203,18 @@ const registerTab = function (tabName, constructor) {
204203
registerTab('file', FileTab)
205204
registerTab('url', UrlTab)
206205
registerTab('camera', CameraTab)
207-
socialSources.forEach((source) => registerTab(source, RemoteTab))
206+
registerTab('facebook', RemoteTab)
207+
registerTab('dropbox', RemoteTab)
208+
registerTab('gdrive', RemoteTab)
209+
registerTab('gphotos', RemoteTab)
210+
registerTab('instagram', RemoteTab)
211+
registerTab('flickr', RemoteTab)
212+
registerTab('vk', RemoteTab)
213+
registerTab('evernote', RemoteTab)
214+
registerTab('box', RemoteTab)
215+
registerTab('onedrive', RemoteTab)
216+
registerTab('huddle', RemoteTab)
217+
registerTab('nft', RemoteTab)
208218
registerTab('empty-pubkey', function (tabPanel, _1, _2, settings) {
209219
return tabPanel.append(emptyKeyText)
210220
})

0 commit comments

Comments
 (0)