From b74e240b4d179aabe977e4ad58b9f5ad48b9a6c6 Mon Sep 17 00:00:00 2001 From: colinfruit <17092461+colinfruit@users.noreply.github.com> Date: Mon, 9 Dec 2019 21:14:25 -0500 Subject: [PATCH 1/2] language: replace upload with import terminology --- README.md | 4 +- add-on/_locales/en/messages.json | 52 +++++++++---------- add-on/src/lib/ipfs-companion.js | 10 ++-- add-on/src/popup/browser-action/page.js | 4 +- add-on/src/popup/browser-action/store.js | 6 +-- add-on/src/popup/browser-action/tools.js | 10 ++-- .../{quick-upload.css => quick-import.css} | 0 .../{quick-upload.html => quick-import.html} | 4 +- .../{quick-upload.js => quick-import.js} | 46 ++++++++-------- docs/privacy-policy.md | 2 +- test/functional/lib/ipfs-import.test.js | 2 +- webpack.config.js | 2 +- 12 files changed, 71 insertions(+), 71 deletions(-) rename add-on/src/popup/{quick-upload.css => quick-import.css} (100%) rename add-on/src/popup/{quick-upload.html => quick-import.html} (66%) rename add-on/src/popup/{quick-upload.js => quick-import.js} (84%) diff --git a/README.md b/README.md index 0cc0e4e0a..278e13669 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ The Browser Action pop-up provides handy toggles for often used operations. ### IPFS Status and Context Actions - IPFS API and Gateway status -- Add local (quick upload) or remote files (context menu) to IPFS with option to preserve filename +- Add local (quick import) or remote files (context menu) to IPFS with option to preserve filename - Easy access to [WebUI](https://github.com/ipfs/webui/) and add-on Preferences - Toggle redirection to local gateway (automatic by default, manual mode can be enabled in Preferences) - Additional actions for pages loaded from IPFS @@ -226,7 +226,7 @@ We are also available at the [#ipfs](https://webchat.freenode.net/?channels=ipfs Questions specific to this browser companion can be asked directly at [`#ipfs-in-web-browsers`](https://webchat.freenode.net/?channels=ipfs-in-web-browsers) -#### Upload via Right-Click Does Not Work in Firefox +#### Import via Right-Click Does Not Work in Firefox See [this workaround](https://github.com/ipfs/ipfs-companion/issues/227). diff --git a/add-on/_locales/en/messages.json b/add-on/_locales/en/messages.json index e762d3bb2..d86ece105 100644 --- a/add-on/_locales/en/messages.json +++ b/add-on/_locales/en/messages.json @@ -35,9 +35,9 @@ "message": "The number of other IPFS nodes you can connect to", "description": "A label tooltip in Node status section of Browser Action pop-up (panel_statusSwarmPeersTitle)" }, - "panel_quickUpload": { + "panel_quickImport": { "message": "Share files via IPFS", - "description": "A menu item in Browser Action pop-up (panel_quickUpload)" + "description": "A menu item in Browser Action pop-up (panel_quickImport)" }, "panel_openWebui": { "message": "Open Web UI", @@ -183,13 +183,13 @@ "message": "Automatic Mode: Public Gateway will be used as a fallback", "description": "A message in system notification (notify_apiOfflineAutomaticModeMsg)" }, - "notify_uploadErrorTitle": { - "message": "Unable to upload via IPFS API", - "description": "A title of system notification (notify_uploadErrorTitle)" + "notify_importErrorTitle": { + "message": "Unable to import via IPFS API", + "description": "A title of system notification (notify_importErrorTitle)" }, - "notify_uploadTrackingProtectionErrorMsg": { + "notify_importTrackingProtectionErrorMsg": { "message": "Try disabling Tracking Protection (press ctrl+shift+j for more details)", - "description": "(notify_uploadTrackingProtectionErrorMsg)" + "description": "(notify_importTrackingProtectionErrorMsg)" }, "notify_inlineMsg": { "message": "$1", @@ -483,41 +483,41 @@ "message": "Browser extension that simplifies access to IPFS resources", "description": "Extension description in the Manifest file (manifest_extensionDescription)" }, - "quickUpload_subhead_peers": { + "quickImport_subhead_peers": { "message": "Connected to $1 peers", - "description": "Partial info stats beneath the header on the share files page (quickUpload_subhead_peers)" + "description": "Partial info stats beneath the header on the share files page (quickImport_subhead_peers)" }, - "quickUpload_pick_file_button": { + "quickImport_pick_file_button": { "message": "Pick a file", - "description": "Text on the 'pick a file' button (quickUpload_pick_file_button)" + "description": "Text on the 'pick a file' button (quickImport_pick_file_button)" }, - "quickUpload_or": { + "quickImport_or": { "message": "or", - "description": "seperates the pick a file button from the drop message (quickUpload_or)" + "description": "seperates the pick a file button from the drop message (quickImport_or)" }, - "quickUpload_drop_it_here": { + "quickImport_drop_it_here": { "message": "drop it here to share", - "description": "Partial info stats beneath the header on the share files page (quickUpload_drop_it_here)" + "description": "Partial info stats beneath the header on the share files page (quickImport_drop_it_here)" }, - "quickUpload_state_uploading": { - "message": "Upload in progress..", - "description": "Status label on the share files page (quickUpload_state_uploading)" + "quickImport_state_importing": { + "message": "Import in progress..", + "description": "Status label on the share files page (quickImport_state_importing)" }, - "quickUpload_state_buffering": { + "quickImport_state_buffering": { "message": "(buffering, please wait)", - "description": "Status label on the share files page (quickUpload_state_buffering)" + "description": "Status label on the share files page (quickImport_state_buffering)" }, - "quickUpload_options_show": { + "quickImport_options_show": { "message": "import options", - "description": "Button on the share files page (quickUpload_options_show)" + "description": "Button on the share files page (quickImport_options_show)" }, - "quickUpload_options_importDir": { + "quickImport_options_importDir": { "message": "Path to store imported files", - "description": "Textbox label on the share files page (quickUpload_options_importDir)" + "description": "Textbox label on the share files page (quickImport_options_importDir)" }, - "quickUpload_options_openViaWebUI": { + "quickImport_options_openViaWebUI": { "message": "Open in Web UI", - "description": "Checkbox label on the share files page (quickUpload_options_openViaWebUI)" + "description": "Checkbox label on the share files page (quickImport_options_openViaWebUI)" }, "page_proxyAcl_title": { "message": "Manage Permissions", diff --git a/add-on/src/lib/ipfs-companion.js b/add-on/src/lib/ipfs-companion.js index 9f21bbb68..4c49cccce 100644 --- a/add-on/src/lib/ipfs-companion.js +++ b/add-on/src/lib/ipfs-companion.js @@ -266,7 +266,7 @@ module.exports = async function init () { } } - // Context Menu Uploader + // Context Menu Importer // ------------------------------------------------------------------- async function onAddFromContext (context, contextType, options) { @@ -307,15 +307,15 @@ module.exports = async function init () { result = await ipfsImportHandler.importFiles(data, options, importDir) } } catch (error) { - console.error('Error in upload to IPFS context menu', error) + console.error('Error in import to IPFS context menu', error) if (error.message === 'NetworkError when attempting to fetch resource.') { - notify('notify_uploadErrorTitle', 'notify_uploadTrackingProtectionErrorMsg') - console.warn('IPFS upload often fails because remote file can not be downloaded due to Tracking Protection. See details at: https://github.com/ipfs/ipfs-companion/issues/227') + notify('notify_importErrorTitle', 'notify_importTrackingProtectionErrorMsg') + console.warn('IPFS import often fails because remote file can not be downloaded due to Tracking Protection. See details at: https://github.com/ipfs/ipfs-companion/issues/227') browser.tabs.create({ url: 'https://github.com/ipfs/ipfs-companion/issues/227' }) } else { - notify('notify_uploadErrorTitle', 'notify_inlineErrorMsg', `${error.message}`) + notify('notify_importErrorTitle', 'notify_inlineErrorMsg', `${error.message}`) } return } diff --git a/add-on/src/popup/browser-action/page.js b/add-on/src/popup/browser-action/page.js index 6c3b28b9b..e17a10339 100644 --- a/add-on/src/popup/browser-action/page.js +++ b/add-on/src/popup/browser-action/page.js @@ -16,7 +16,7 @@ module.exports = function browserActionPage (state, emit) { const onPin = () => emit('pin') const onUnPin = () => emit('unPin') - const onQuickUpload = () => emit('quickUpload') + const onQuickImport = () => emit('quickImport') const onOpenWebUi = () => emit('openWebUi') const onOpenPrefs = () => emit('openPrefs') const onToggleGlobalRedirect = () => emit('toggleGlobalRedirect') @@ -25,7 +25,7 @@ module.exports = function browserActionPage (state, emit) { const headerProps = Object.assign({ onToggleActive, onOpenPrefs }, state) const activeTabActionsProps = Object.assign({ onViewOnGateway, onToggleSiteRedirect, onCopy, onPin, onUnPin }, state) - const opsProps = Object.assign({ onQuickUpload, onOpenWebUi, onToggleGlobalRedirect }, state) + const opsProps = Object.assign({ onQuickImport, onOpenWebUi, onToggleGlobalRedirect }, state) return html`
diff --git a/add-on/src/popup/browser-action/store.js b/add-on/src/popup/browser-action/store.js index c4f7cdedc..c6999cc71 100644 --- a/add-on/src/popup/browser-action/store.js +++ b/add-on/src/popup/browser-action/store.js @@ -128,8 +128,8 @@ module.exports = (state, emitter) => { } } - emitter.on('quickUpload', () => { - browser.tabs.create({ url: browser.extension.getURL('dist/popup/quick-upload.html') }) + emitter.on('quickImport', () => { + browser.tabs.create({ url: browser.extension.getURL('dist/popup/quick-import.html') }) window.close() }) @@ -254,7 +254,7 @@ module.exports = (state, emitter) => { } else { state.gatewayAddress = status.pubGwURLString } - // Upload requires access to the background page (https://github.com/ipfs-shipyard/ipfs-companion/issues/477) + // Import requires access to the background page (https://github.com/ipfs-shipyard/ipfs-companion/issues/477) state.isApiAvailable = state.active && !!(await getBackgroundPage()) && !browser.extension.inIncognitoContext // https://github.com/ipfs-shipyard/ipfs-companion/issues/243 state.swarmPeers = !state.active || status.peerCount === -1 ? null : status.peerCount state.isIpfsOnline = state.active && status.peerCount > -1 diff --git a/add-on/src/popup/browser-action/tools.js b/add-on/src/popup/browser-action/tools.js index 58c3ba99f..03d2ccd0e 100644 --- a/add-on/src/popup/browser-action/tools.js +++ b/add-on/src/popup/browser-action/tools.js @@ -11,10 +11,10 @@ module.exports = function tools ({ ipfsNodeType, isIpfsOnline, isApiAvailable, - onQuickUpload, + onQuickImport, onOpenWebUi }) { - const activeQuickUpload = active && isIpfsOnline && isApiAvailable + const activeQuickImport = active && isIpfsOnline && isApiAvailable const activeWebUI = active && isIpfsOnline && ipfsNodeType !== 'embedded' return html` @@ -22,10 +22,10 @@ module.exports = function tools ({ ${navHeader('panel_toolsSectionHeader')}
${navItem({ - text: browser.i18n.getMessage('panel_quickUpload'), + text: browser.i18n.getMessage('panel_quickImport'), style: 'b', - disabled: !activeQuickUpload, - onClick: onQuickUpload + disabled: !activeQuickImport, + onClick: onQuickImport })} ${navItem({ text: browser.i18n.getMessage('panel_openWebui'), diff --git a/add-on/src/popup/quick-upload.css b/add-on/src/popup/quick-import.css similarity index 100% rename from add-on/src/popup/quick-upload.css rename to add-on/src/popup/quick-import.css diff --git a/add-on/src/popup/quick-upload.html b/add-on/src/popup/quick-import.html similarity index 66% rename from add-on/src/popup/quick-upload.html rename to add-on/src/popup/quick-import.html index 4f006b6d4..6dbe771c7 100644 --- a/add-on/src/popup/quick-upload.html +++ b/add-on/src/popup/quick-import.html @@ -4,13 +4,13 @@ - +
- + diff --git a/add-on/src/popup/quick-upload.js b/add-on/src/popup/quick-import.js similarity index 84% rename from add-on/src/popup/quick-upload.js rename to add-on/src/popup/quick-import.js index 36729e170..aac6df6ae 100644 --- a/add-on/src/popup/quick-upload.js +++ b/add-on/src/popup/quick-import.js @@ -8,15 +8,15 @@ const logo = require('./logo') const drop = require('drag-and-drop-files') const fileReaderPullStream = require('pull-file-reader') -document.title = browser.i18n.getMessage('panel_quickUpload') +document.title = browser.i18n.getMessage('panel_quickImport') const app = choo() -app.use(quickUploadStore) -app.route('*', quickUploadPage) +app.use(quickImportStore) +app.route('*', quickImportPage) app.mount('#root') -function quickUploadStore (state, emitter) { +function quickImportStore (state, emitter) { state.message = '' state.peerCount = '' state.ipfsNodeType = 'external' @@ -71,7 +71,7 @@ async function processFiles (state, emitter, files) { } const { ipfsCompanion } = await browser.runtime.getBackgroundPage() const ipfsImportHandler = ipfsCompanion.ipfsImportHandler - const uploadTab = await browser.tabs.getCurrent() + const importTab = await browser.tabs.getCurrent() const streams = files2streams(files) emitter.emit('render') const options = { @@ -85,7 +85,7 @@ async function processFiles (state, emitter, files) { result = await ipfsImportHandler.importFiles(streams, options, importDir) } catch (err) { console.error('Failed to import files to IPFS', err) - ipfsCompanion.notify('notify_uploadErrorTitle', 'notify_inlineErrorMsg', `${err.message}`) + ipfsCompanion.notify('notify_importErrorTitle', 'notify_inlineErrorMsg', `${err.message}`) throw err } state.progress = 'Completed' @@ -100,11 +100,11 @@ async function processFiles (state, emitter, files) { } else { await ipfsImportHandler.openFilesAtWebUI(importDir) } - // close upload tab as it will be replaced with a new tab with uploaded content - await browser.tabs.remove(uploadTab.id) + // close import tab as it will be replaced with a new tab with imported content + await browser.tabs.remove(importTab.id) } catch (err) { console.error('Unable to perform import', err) - // keep upload tab and display error message in it + // keep import tab and display error message in it state.message = 'Unable to import to IPFS:' state.progress = `${err}` emitter.emit('render') @@ -139,7 +139,7 @@ function files2streams (files) { return streams } -function quickUploadOptions (state, emit) { +function quickImportOptions (state, emit) { const onExpandOptions = (e) => { state.expandOptions = true; emit('render') } const onDirectoryChange = (e) => { state.userChangedImportDir = true; state.importDir = e.target.value } const onOpenViaWebUIChange = (e) => { state.userChangedOpenViaWebUI = true; state.openViaWebUI = e.target.checked } @@ -147,14 +147,14 @@ function quickUploadOptions (state, emit) { if (state.expandOptions) { return html` -
+
${displayOpenWebUI ? html`` : null} @@ -163,12 +163,12 @@ function quickUploadOptions (state, emit) { } return html` ` } -function quickUploadPage (state, emit) { +function quickImportPage (state, emit) { const onFileInputChange = (e) => emit('fileInputChange', e) const { peerCount } = state @@ -183,31 +183,31 @@ function quickUploadPage (state, emit) { })}

- ${browser.i18n.getMessage('panel_quickUpload')} + ${browser.i18n.getMessage('panel_quickImport')}

- ${browser.i18n.getMessage('quickUpload_subhead_peers', [peerCount])} + ${browser.i18n.getMessage('quickImport_subhead_peers', [peerCount])}

-
` diff --git a/docs/privacy-policy.md b/docs/privacy-policy.md index 20cc443c8..154e0574f 100644 --- a/docs/privacy-policy.md +++ b/docs/privacy-policy.md @@ -29,7 +29,7 @@ None. We don’t collect your Personal Data, period. We do not collect, rent, store or sell your Personal Data to anyone. However because IPFS Companion is a web extension that provides access to the real-time, peer-to-peer IPFS Network (which is a public platform for which anyone may join -and participate) the data that you add or upload to the IPFS Network using IPFS +and participate) the data that you add or import to the IPFS Network using IPFS Companion is then publicly available and accessible to everyone participating in IPFS Network. diff --git a/test/functional/lib/ipfs-import.test.js b/test/functional/lib/ipfs-import.test.js index b2b5a47ec..608c1e431 100644 --- a/test/functional/lib/ipfs-import.test.js +++ b/test/functional/lib/ipfs-import.test.js @@ -4,7 +4,7 @@ const { expect } = require('chai') const { useFakeTimers } = require('sinon') const browser = require('sinon-chrome') -describe('quick-upload.js', function () { +describe('ipfs-import.js', function () { let createIpfsImportHandler let ipfsImportHandler let clock diff --git a/webpack.config.js b/webpack.config.js index 8d39a5ff4..329d44387 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -112,7 +112,7 @@ const uiConfig = merge(commonConfig, { entry: { browserAction: './add-on/src/popup/browser-action/index.js', pageAction: './add-on/src/popup/page-action/index.js', - uploadPage: './add-on/src/popup/quick-upload.js', + importPage: './add-on/src/popup/quick-import.js', optionsPage: './add-on/src/options/options.js', proxyAclManagerPage: './add-on/src/pages/proxy-acl/index.js', proxyAclDialog: './add-on/src/pages/proxy-access-dialog/index.js', From 0680ece1e3910bb8852521debdba1e4754355390 Mon Sep 17 00:00:00 2001 From: colinfruit <17092461+colinfruit@users.noreply.github.com> Date: Tue, 10 Dec 2019 20:13:32 -0500 Subject: [PATCH 2/2] update privacy policy language and last updated date --- docs/privacy-policy.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/privacy-policy.md b/docs/privacy-policy.md index 154e0574f..58dfe90ff 100644 --- a/docs/privacy-policy.md +++ b/docs/privacy-policy.md @@ -1,7 +1,7 @@ # **IPFS Companion Privacy Policy** First Posted: 2019-02-15
-Last Update: 2019-02-20
([change history](https://github.com/ipfs-shipyard/ipfs-companion/commits/master/docs/privacy-policy.md)) +Last Update: 2019-12-10 ([change history](https://github.com/ipfs-shipyard/ipfs-companion/commits/master/docs/privacy-policy.md)) The IPFS Companion browser extension is owned by Protocol Labs Inc. and created by the IPFS Project. We know you care about how your personal data is used and @@ -29,7 +29,7 @@ None. We don’t collect your Personal Data, period. We do not collect, rent, store or sell your Personal Data to anyone. However because IPFS Companion is a web extension that provides access to the real-time, peer-to-peer IPFS Network (which is a public platform for which anyone may join -and participate) the data that you add or import to the IPFS Network using IPFS +and participate) the data that you import to the IPFS Network using IPFS Companion is then publicly available and accessible to everyone participating in IPFS Network.