diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown index 18e27b3..e104234 100644 --- a/CHANGELOG.markdown +++ b/CHANGELOG.markdown @@ -1,3 +1,7 @@ +## v1.4.0 + +* added warning when it looks like an archive is a full "Your Twitter data" archive + ## v1.3.0 Released 2018-07-06 diff --git a/assets/settings.js b/assets/settings.js index 5bb1aab..cc404c0 100644 --- a/assets/settings.js +++ b/assets/settings.js @@ -1,4 +1,5 @@ import Banner from '../components/Banner.html'; +import ArchiveForm from '../components/ArchiveForm.html'; (function settings_init(){ if(!('fetch' in window)){ @@ -188,4 +189,17 @@ import Banner from '../components/Banner.html'; reason_banner.parentElement.removeChild(reason_banner); }) } + + let archive_form_el = document.querySelector('#archive-form'); + if(archive_form_el){ + let csrf_token = archive_form_el.querySelector('input[name=csrf-token]').value; + let archive_form = new ArchiveForm({ + target: archive_form_el, + hydrate: true, + data: { + action: archive_form_el.action, + csrf_token: csrf_token, + }, + }) + } })(); diff --git a/assets/styles.css b/assets/styles.css index b5fbfcb..cdaeaae 100644 --- a/assets/styles.css +++ b/assets/styles.css @@ -76,6 +76,16 @@ img.avatar.mastodon { padding-top: .6rem; padding-bottom: .6rem; margin-bottom: 1rem; + padding-left: 1rem; + padding-right: 1rem; +} + +.banner p { + margin: .3rem 0; +} + +.banner p ~ p { + margin-top: 1.3rem; } body > section > .banner, diff --git a/components/ArchiveForm.html b/components/ArchiveForm.html new file mode 100644 index 0000000..a242a4d --- /dev/null +++ b/components/ArchiveForm.html @@ -0,0 +1,49 @@ +
+ {#if file_too_big} + + {/if} + + + +
+ + diff --git a/dodo.py b/dodo.py index 3a990f4..8910198 100644 --- a/dodo.py +++ b/dodo.py @@ -125,7 +125,7 @@ def task_rollup(): file_dep=list(chain( # fuck it glob('assets/*.js'), - glob('components/*.html'))), + glob('components/*.html'))) + ['rollup.config.js'], targets=[dst], clean=True, actions=[ diff --git a/rollup.config.js b/rollup.config.js index 2caf179..e418098 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -7,6 +7,7 @@ export default { plugins: [ svelte({ include: 'components/**/*.html', + hydratable: true, }), ] } diff --git a/templates/logged_in.html b/templates/logged_in.html index 179758e..616337f 100644 --- a/templates/logged_in.html +++ b/templates/logged_in.html @@ -139,8 +139,8 @@

Tweet archive import

- Twitter's API only lets us access up to 3200 of your most recent tweets. If you have more tweets than that, you can request a zip archive of your tweets from - Twitter's settings page, + Twitter's API only lets us access up to 3200 of your most recent tweets. If you have more tweets than that, you can request a tweet archive from + your account settings, and upload it here.

@@ -148,7 +148,7 @@ {% endif %} -
+