diff --git a/modules/instagram.js b/modules/instagram.js index b77780d..c63e8a9 100644 --- a/modules/instagram.js +++ b/modules/instagram.js @@ -5,6 +5,7 @@ zeeschuimer.register_module( let domain = source_platform_url.split("/")[2].toLowerCase().replace(/^www\./, ''); if (!["instagram.com"].includes(domain)) { + console.log('ignoring non-instagram url ' + source_url); return []; } diff --git a/popup/interface.html b/popup/interface.html index ad4777f..276373a 100644 --- a/popup/interface.html +++ b/popup/interface.html @@ -219,7 +219,7 @@ margin-right: 0.25em; } - input:not([type=checkbox]):not([type=radio]), button { + input:not([type=checkbox]):not([type=radio]), button, select { background: var(--neutral-contrast-alt); color: var(--accent); border: 2px solid var(--neutral-contrast); @@ -265,11 +265,15 @@ content: ' \2022'; } - .fourcat-url-container, .zeeschuimer-master-switch, .import-container { + .fourcat-url-container, .zeeschuimer-master-switch, .import-container, .fourcat-pseudonymisation-container { text-align: center; margin-bottom: 0.5em; } + .fourcat-pseudonymisation-container select { + max-width: 15em; + } + #upload-status { text-align: center; } @@ -411,6 +415,18 @@

Connect to 4CAT

title="The URL of the 4CAT server to upload datasets to. Make sure you're logged in to this URL with this browser.">? +
+ +

diff --git a/popup/interface.js b/popup/interface.js index c7180ee..a397c84 100644 --- a/popup/interface.js +++ b/popup/interface.js @@ -82,7 +82,7 @@ async function get_4cat_url(e) { * @returns {Promise} */ async function set_4cat_url(e) { - if(e !== true && !e.target.matches('#fourcat-url')) { + if(e !== true && !e.target.matches('#fourcat-url') && !e.target.matches('#fourcat-pseudonymisation')) { return; } @@ -105,6 +105,8 @@ async function set_4cat_url(e) { } } + await background.browser.storage.local.set({'4cat-pseudonymise': document.querySelector('#fourcat-pseudonymisation').value}); + have_4cat = (url && url.length > 0); } @@ -314,8 +316,10 @@ async function button_handler(event) { xhr = new XMLHttpRequest(); xhr.aborted = false; let upload_url = await get_4cat_url(); + let pseudonymise_bit = document.querySelector('#fourcat-pseudonymisation').value + pseudonymise_bit = pseudonymise_bit !== 'none' ? '?pseudonymise=' + pseudonymise_bit : '' - xhr.open("POST", upload_url + "/api/import-dataset/", true); + xhr.open("POST", upload_url + "/api/import-dataset/" + pseudonymise_bit, true); xhr.setRequestHeader("X-Zeeschuimer-Platform", platform) xhr.onloadstart = function () { status.innerText = 'Starting upload...'; @@ -673,5 +677,9 @@ document.addEventListener('DOMContentLoaded', async function () { const fourcat_url = await background.browser.storage.local.get('4cat-url'); document.querySelector('#fourcat-url').value = fourcat_url['4cat-url'] ? fourcat_url['4cat-url'] : ''; + const pseudonymise = await background.browser.storage.local.get('4cat-pseudonymise'); + console.log(pseudonymise); + document.querySelector('#fourcat-pseudonymisation').value = pseudonymise['4cat-pseudonymise'] ? pseudonymise['4cat-pseudonymise'] : 'none'; + browser.downloads.onChanged.addListener(downloadListener); }); \ No newline at end of file