Skip to content

Commit 9730b81

Browse files
colinfruitlidel
authored andcommitted
refactor: replace upload with import terminology (#829)
* language: replace upload with import terminology * update privacy policy language and last updated date Following up on the changes made in #810. This replaces references to `upload` with `import` Closes #817
1 parent ed36f4e commit 9730b81

File tree

12 files changed

+72
-72
lines changed

12 files changed

+72
-72
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ The Browser Action pop-up provides handy toggles for often used operations.
109109
### IPFS Status and Context Actions
110110

111111
- IPFS API and Gateway status
112-
- Add local (quick upload) or remote files (context menu) to IPFS with option to preserve filename
112+
- Add local (quick import) or remote files (context menu) to IPFS with option to preserve filename
113113
- Easy access to [WebUI](https://github.com/ipfs/webui/) and add-on Preferences
114114
- Toggle redirection to local gateway (automatic by default, manual mode can be enabled in Preferences)
115115
- Additional actions for pages loaded from IPFS
@@ -226,7 +226,7 @@ We are also available at the [#ipfs](https://webchat.freenode.net/?channels=ipfs
226226

227227
Questions specific to this browser companion can be asked directly at [`#ipfs-in-web-browsers`](https://webchat.freenode.net/?channels=ipfs-in-web-browsers)
228228

229-
#### Upload via Right-Click Does Not Work in Firefox
229+
#### Import via Right-Click Does Not Work in Firefox
230230

231231
See [this workaround](https://github.com/ipfs/ipfs-companion/issues/227).
232232

add-on/_locales/en/messages.json

+26-26
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
"message": "The number of other IPFS nodes you can connect to",
3636
"description": "A label tooltip in Node status section of Browser Action pop-up (panel_statusSwarmPeersTitle)"
3737
},
38-
"panel_quickUpload": {
38+
"panel_quickImport": {
3939
"message": "Share files via IPFS",
40-
"description": "A menu item in Browser Action pop-up (panel_quickUpload)"
40+
"description": "A menu item in Browser Action pop-up (panel_quickImport)"
4141
},
4242
"panel_openWebui": {
4343
"message": "Open Web UI",
@@ -183,13 +183,13 @@
183183
"message": "Automatic Mode: Public Gateway will be used as a fallback",
184184
"description": "A message in system notification (notify_apiOfflineAutomaticModeMsg)"
185185
},
186-
"notify_uploadErrorTitle": {
187-
"message": "Unable to upload via IPFS API",
188-
"description": "A title of system notification (notify_uploadErrorTitle)"
186+
"notify_importErrorTitle": {
187+
"message": "Unable to import via IPFS API",
188+
"description": "A title of system notification (notify_importErrorTitle)"
189189
},
190-
"notify_uploadTrackingProtectionErrorMsg": {
190+
"notify_importTrackingProtectionErrorMsg": {
191191
"message": "Try disabling Tracking Protection (press ctrl+shift+j for more details)",
192-
"description": "(notify_uploadTrackingProtectionErrorMsg)"
192+
"description": "(notify_importTrackingProtectionErrorMsg)"
193193
},
194194
"notify_inlineMsg": {
195195
"message": "$1",
@@ -491,41 +491,41 @@
491491
"message": "Browser extension that simplifies access to IPFS resources",
492492
"description": "Extension description in the Manifest file (manifest_extensionDescription)"
493493
},
494-
"quickUpload_subhead_peers": {
494+
"quickImport_subhead_peers": {
495495
"message": "Connected to $1 peers",
496-
"description": "Partial info stats beneath the header on the share files page (quickUpload_subhead_peers)"
496+
"description": "Partial info stats beneath the header on the share files page (quickImport_subhead_peers)"
497497
},
498-
"quickUpload_pick_file_button": {
498+
"quickImport_pick_file_button": {
499499
"message": "Pick a file",
500-
"description": "Text on the 'pick a file' button (quickUpload_pick_file_button)"
500+
"description": "Text on the 'pick a file' button (quickImport_pick_file_button)"
501501
},
502-
"quickUpload_or": {
502+
"quickImport_or": {
503503
"message": "or",
504-
"description": "seperates the pick a file button from the drop message (quickUpload_or)"
504+
"description": "seperates the pick a file button from the drop message (quickImport_or)"
505505
},
506-
"quickUpload_drop_it_here": {
506+
"quickImport_drop_it_here": {
507507
"message": "drop it here to share",
508-
"description": "Partial info stats beneath the header on the share files page (quickUpload_drop_it_here)"
508+
"description": "Partial info stats beneath the header on the share files page (quickImport_drop_it_here)"
509509
},
510-
"quickUpload_state_uploading": {
511-
"message": "Upload in progress..",
512-
"description": "Status label on the share files page (quickUpload_state_uploading)"
510+
"quickImport_state_importing": {
511+
"message": "Import in progress..",
512+
"description": "Status label on the share files page (quickImport_state_importing)"
513513
},
514-
"quickUpload_state_buffering": {
514+
"quickImport_state_buffering": {
515515
"message": "(buffering, please wait)",
516-
"description": "Status label on the share files page (quickUpload_state_buffering)"
516+
"description": "Status label on the share files page (quickImport_state_buffering)"
517517
},
518-
"quickUpload_options_show": {
518+
"quickImport_options_show": {
519519
"message": "import options",
520-
"description": "Button on the share files page (quickUpload_options_show)"
520+
"description": "Button on the share files page (quickImport_options_show)"
521521
},
522-
"quickUpload_options_importDir": {
522+
"quickImport_options_importDir": {
523523
"message": "Path to store imported files",
524-
"description": "Textbox label on the share files page (quickUpload_options_importDir)"
524+
"description": "Textbox label on the share files page (quickImport_options_importDir)"
525525
},
526-
"quickUpload_options_openViaWebUI": {
526+
"quickImport_options_openViaWebUI": {
527527
"message": "Open in Web UI",
528-
"description": "Checkbox label on the share files page (quickUpload_options_openViaWebUI)"
528+
"description": "Checkbox label on the share files page (quickImport_options_openViaWebUI)"
529529
},
530530
"page_proxyAcl_title": {
531531
"message": "Manage Permissions",

add-on/src/lib/ipfs-companion.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ module.exports = async function init () {
266266
}
267267
}
268268

269-
// Context Menu Uploader
269+
// Context Menu Importer
270270
// -------------------------------------------------------------------
271271

272272
async function onAddFromContext (context, contextType, options) {
@@ -307,15 +307,15 @@ module.exports = async function init () {
307307
result = await ipfsImportHandler.importFiles(data, options, importDir)
308308
}
309309
} catch (error) {
310-
console.error('Error in upload to IPFS context menu', error)
310+
console.error('Error in import to IPFS context menu', error)
311311
if (error.message === 'NetworkError when attempting to fetch resource.') {
312-
notify('notify_uploadErrorTitle', 'notify_uploadTrackingProtectionErrorMsg')
313-
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')
312+
notify('notify_importErrorTitle', 'notify_importTrackingProtectionErrorMsg')
313+
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')
314314
browser.tabs.create({
315315
url: 'https://github.com/ipfs/ipfs-companion/issues/227'
316316
})
317317
} else {
318-
notify('notify_uploadErrorTitle', 'notify_inlineErrorMsg', `${error.message}`)
318+
notify('notify_importErrorTitle', 'notify_inlineErrorMsg', `${error.message}`)
319319
}
320320
return
321321
}

add-on/src/popup/browser-action/page.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = function browserActionPage (state, emit) {
1616
const onPin = () => emit('pin')
1717
const onUnPin = () => emit('unPin')
1818

19-
const onQuickUpload = () => emit('quickUpload')
19+
const onQuickImport = () => emit('quickImport')
2020
const onOpenWebUi = () => emit('openWebUi')
2121
const onOpenPrefs = () => emit('openPrefs')
2222
const onToggleGlobalRedirect = () => emit('toggleGlobalRedirect')
@@ -25,7 +25,7 @@ module.exports = function browserActionPage (state, emit) {
2525

2626
const headerProps = Object.assign({ onToggleActive, onOpenPrefs }, state)
2727
const activeTabActionsProps = Object.assign({ onViewOnGateway, onToggleSiteRedirect, onCopy, onPin, onUnPin }, state)
28-
const opsProps = Object.assign({ onQuickUpload, onOpenWebUi, onToggleGlobalRedirect }, state)
28+
const opsProps = Object.assign({ onQuickImport, onOpenWebUi, onToggleGlobalRedirect }, state)
2929

3030
return html`
3131
<div class="sans-serif" style="text-rendering: optimizeLegibility;">

add-on/src/popup/browser-action/store.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ module.exports = (state, emitter) => {
128128
}
129129
}
130130

131-
emitter.on('quickUpload', () => {
132-
browser.tabs.create({ url: browser.extension.getURL('dist/popup/quick-upload.html') })
131+
emitter.on('quickImport', () => {
132+
browser.tabs.create({ url: browser.extension.getURL('dist/popup/quick-import.html') })
133133
window.close()
134134
})
135135

@@ -254,7 +254,7 @@ module.exports = (state, emitter) => {
254254
} else {
255255
state.gatewayAddress = status.pubGwURLString
256256
}
257-
// Upload requires access to the background page (https://github.com/ipfs-shipyard/ipfs-companion/issues/477)
257+
// Import requires access to the background page (https://github.com/ipfs-shipyard/ipfs-companion/issues/477)
258258
state.isApiAvailable = state.active && !!(await getBackgroundPage()) && !browser.extension.inIncognitoContext // https://github.com/ipfs-shipyard/ipfs-companion/issues/243
259259
state.swarmPeers = !state.active || status.peerCount === -1 ? null : status.peerCount
260260
state.isIpfsOnline = state.active && status.peerCount > -1

add-on/src/popup/browser-action/tools.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ module.exports = function tools ({
1111
ipfsNodeType,
1212
isIpfsOnline,
1313
isApiAvailable,
14-
onQuickUpload,
14+
onQuickImport,
1515
onOpenWebUi
1616
}) {
17-
const activeQuickUpload = active && isIpfsOnline && isApiAvailable
17+
const activeQuickImport = active && isIpfsOnline && isApiAvailable
1818
const activeWebUI = active && isIpfsOnline && ipfsNodeType !== 'embedded'
1919

2020
return html`
2121
<div>
2222
${navHeader('panel_toolsSectionHeader')}
2323
<div class="fade-in pv1 bb b--black-10">
2424
${navItem({
25-
text: browser.i18n.getMessage('panel_quickUpload'),
25+
text: browser.i18n.getMessage('panel_quickImport'),
2626
style: 'b',
27-
disabled: !activeQuickUpload,
28-
onClick: onQuickUpload
27+
disabled: !activeQuickImport,
28+
onClick: onQuickImport
2929
})}
3030
${navItem({
3131
text: browser.i18n.getMessage('panel_openWebui'),
File renamed without changes.

add-on/src/popup/quick-upload.html add-on/src/popup/quick-import.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
<head>
55
<meta charset="utf-8">
66
<meta name="viewport" content="width=device-width">
7-
<link rel="stylesheet" href="quick-upload.css">
7+
<link rel="stylesheet" href="quick-import.css">
88
</head>
99

1010
<body>
1111
<div id="root"></div>
1212
<script src="/dist/bundles/uiCommons.bundle.js"></script>
13-
<script src="/dist/bundles/uploadPage.bundle.js"></script>
13+
<script src="/dist/bundles/importPage.bundle.js"></script>
1414
</body>
1515

1616
</html>

add-on/src/popup/quick-upload.js add-on/src/popup/quick-import.js

+23-23
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ const logo = require('./logo')
88
const drop = require('drag-and-drop-files')
99
const fileReaderPullStream = require('pull-file-reader')
1010

11-
document.title = browser.i18n.getMessage('panel_quickUpload')
11+
document.title = browser.i18n.getMessage('panel_quickImport')
1212

1313
const app = choo()
1414

15-
app.use(quickUploadStore)
16-
app.route('*', quickUploadPage)
15+
app.use(quickImportStore)
16+
app.route('*', quickImportPage)
1717
app.mount('#root')
1818

19-
function quickUploadStore (state, emitter) {
19+
function quickImportStore (state, emitter) {
2020
state.message = ''
2121
state.peerCount = ''
2222
state.ipfsNodeType = 'external'
@@ -71,7 +71,7 @@ async function processFiles (state, emitter, files) {
7171
}
7272
const { ipfsCompanion } = await browser.runtime.getBackgroundPage()
7373
const ipfsImportHandler = ipfsCompanion.ipfsImportHandler
74-
const uploadTab = await browser.tabs.getCurrent()
74+
const importTab = await browser.tabs.getCurrent()
7575
const streams = files2streams(files)
7676
emitter.emit('render')
7777
const options = {
@@ -85,7 +85,7 @@ async function processFiles (state, emitter, files) {
8585
result = await ipfsImportHandler.importFiles(streams, options, importDir)
8686
} catch (err) {
8787
console.error('Failed to import files to IPFS', err)
88-
ipfsCompanion.notify('notify_uploadErrorTitle', 'notify_inlineErrorMsg', `${err.message}`)
88+
ipfsCompanion.notify('notify_importErrorTitle', 'notify_inlineErrorMsg', `${err.message}`)
8989
throw err
9090
}
9191
state.progress = 'Completed'
@@ -100,11 +100,11 @@ async function processFiles (state, emitter, files) {
100100
} else {
101101
await ipfsImportHandler.openFilesAtWebUI(importDir)
102102
}
103-
// close upload tab as it will be replaced with a new tab with uploaded content
104-
await browser.tabs.remove(uploadTab.id)
103+
// close import tab as it will be replaced with a new tab with imported content
104+
await browser.tabs.remove(importTab.id)
105105
} catch (err) {
106106
console.error('Unable to perform import', err)
107-
// keep upload tab and display error message in it
107+
// keep import tab and display error message in it
108108
state.message = 'Unable to import to IPFS:'
109109
state.progress = `${err}`
110110
emitter.emit('render')
@@ -139,22 +139,22 @@ function files2streams (files) {
139139
return streams
140140
}
141141

142-
function quickUploadOptions (state, emit) {
142+
function quickImportOptions (state, emit) {
143143
const onExpandOptions = (e) => { state.expandOptions = true; emit('render') }
144144
const onDirectoryChange = (e) => { state.userChangedImportDir = true; state.importDir = e.target.value }
145145
const onOpenViaWebUIChange = (e) => { state.userChangedOpenViaWebUI = true; state.openViaWebUI = e.target.checked }
146146
const displayOpenWebUI = state.ipfsNodeType !== 'embedded'
147147

148148
if (state.expandOptions) {
149149
return html`
150-
<div id='quickUploadOptions' class='sans-serif mt3 f6 lh-copy light-gray no-user-select'>
150+
<div id='quickImportOptions' class='sans-serif mt3 f6 lh-copy light-gray no-user-select'>
151151
${displayOpenWebUI ? html`<label for='openViaWebUI' class='flex items-center db relative mt1 pointer'>
152152
<input id='openViaWebUI' type='checkbox' onchange=${onOpenViaWebUIChange} checked=${state.openViaWebUI} />
153153
<span class='mark db flex items-center relative mr2 br2'></span>
154-
${browser.i18n.getMessage('quickUpload_options_openViaWebUI')}
154+
${browser.i18n.getMessage('quickImport_options_openViaWebUI')}
155155
</label>` : null}
156156
<label for='importDir' class='flex items-center db relative mt1 pointer'>
157-
${browser.i18n.getMessage('quickUpload_options_importDir')}
157+
${browser.i18n.getMessage('quickImport_options_importDir')}
158158
<span class='mark db flex items-center relative mr2 br2'></span>
159159
<input id='importDir' class='w-40 bg-transparent aqua monospace br1 ba b--aqua pa2' type='text' oninput=${onDirectoryChange} value=${state.importDir} />
160160
</label>
@@ -163,12 +163,12 @@ function quickUploadOptions (state, emit) {
163163
}
164164
return html`
165165
<button class='mt3 f6 lh-copy link bn bg-transparent moon-gray dib pa0 pointer' style='color: #6ACAD1' onclick=${onExpandOptions}>
166-
${browser.i18n.getMessage('quickUpload_options_show')} »
166+
${browser.i18n.getMessage('quickImport_options_show')} »
167167
</button>
168168
`
169169
}
170170

171-
function quickUploadPage (state, emit) {
171+
function quickImportPage (state, emit) {
172172
const onFileInputChange = (e) => emit('fileInputChange', e)
173173
const { peerCount } = state
174174

@@ -183,31 +183,31 @@ function quickUploadPage (state, emit) {
183183
})}
184184
<div class="pl3">
185185
<h1 class="f2 fw5 ma0">
186-
${browser.i18n.getMessage('panel_quickUpload')}
186+
${browser.i18n.getMessage('panel_quickImport')}
187187
</h1>
188188
<p class="f3 fw2 lh-copy ma0 light-gray">
189-
${browser.i18n.getMessage('quickUpload_subhead_peers', [peerCount])}
189+
${browser.i18n.getMessage('quickImport_subhead_peers', [peerCount])}
190190
</p>
191191
</div>
192192
</header>
193-
<label for="quickUploadInput" class='db relative mt5 hover-inner-shadow pointer' style="border:solid 2px #6ACAD1">
194-
<input class="db pointer w-100 h-100 top-0 o-0" type="file" id="quickUploadInput" multiple onchange=${onFileInputChange} />
193+
<label for="quickImportInput" class='db relative mt5 hover-inner-shadow pointer' style="border:solid 2px #6ACAD1">
194+
<input class="db pointer w-100 h-100 top-0 o-0" type="file" id="quickImportInput" multiple onchange=${onFileInputChange} />
195195
<div class='dt dim' style='padding-left: 100px; height: 300px'>
196196
<div class='dtc v-mid'>
197197
<span class="f3 link dim br1 ph4 pv3 dib white" style="background: #6ACAD1">
198-
${browser.i18n.getMessage('quickUpload_pick_file_button')}
198+
${browser.i18n.getMessage('quickImport_pick_file_button')}
199199
</span>
200200
<span class='f3'>
201201
<emph class='underline pl3 pr2 moon-gray'>
202-
${browser.i18n.getMessage('quickUpload_or')}
202+
${browser.i18n.getMessage('quickImport_or')}
203203
</emph>
204-
${browser.i18n.getMessage('quickUpload_drop_it_here')}
204+
${browser.i18n.getMessage('quickImport_drop_it_here')}
205205
</span>
206206
<p class='f4 db'>${state.message}<span class='code db absolute fr pv2'>${state.progress}</span></p>
207207
</div>
208208
</div>
209209
</label>
210-
${quickUploadOptions(state, emit)}
210+
${quickImportOptions(state, emit)}
211211
</div>
212212
</div>
213213
`

docs/privacy-policy.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# **IPFS Companion Privacy Policy**
22

33
<em>First Posted: 2019-02-15<br/>
4-
Last Update: 2019-02-20</em> ([change history](https://github.com/ipfs-shipyard/ipfs-companion/commits/master/docs/privacy-policy.md))
4+
Last Update: 2019-12-10</em> ([change history](https://github.com/ipfs-shipyard/ipfs-companion/commits/master/docs/privacy-policy.md))
55

66
The IPFS Companion browser extension is owned by Protocol Labs Inc. and created
77
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.
2929
We do not collect, rent, store or sell your Personal Data to anyone. However
3030
because IPFS Companion is a web extension that provides access to the real-time,
3131
peer-to-peer IPFS Network (which is a public platform for which anyone may join
32-
and participate) the data that you add or upload to the IPFS Network using IPFS
32+
and participate) the data that you import to the IPFS Network using IPFS
3333
Companion is then publicly available and accessible to everyone participating in
3434
IPFS Network.
3535

test/functional/lib/ipfs-import.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const { expect } = require('chai')
44
const { useFakeTimers } = require('sinon')
55
const browser = require('sinon-chrome')
66

7-
describe('quick-upload.js', function () {
7+
describe('ipfs-import.js', function () {
88
let createIpfsImportHandler
99
let ipfsImportHandler
1010
let clock

webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ const uiConfig = merge(commonConfig, {
112112
entry: {
113113
browserAction: './add-on/src/popup/browser-action/index.js',
114114
pageAction: './add-on/src/popup/page-action/index.js',
115-
uploadPage: './add-on/src/popup/quick-upload.js',
115+
importPage: './add-on/src/popup/quick-import.js',
116116
optionsPage: './add-on/src/options/options.js',
117117
proxyAclManagerPage: './add-on/src/pages/proxy-acl/index.js',
118118
proxyAclDialog: './add-on/src/pages/proxy-access-dialog/index.js',

0 commit comments

Comments
 (0)