Skip to content

Commit

Permalink
Merge pull request #314 from tableflip/choo
Browse files Browse the repository at this point in the history
🚂🚋🚋🚋🚋🚋
  • Loading branch information
lidel committed Nov 22, 2017
2 parents 3f010d8 + e3ede8e commit 5af3e26
Show file tree
Hide file tree
Showing 13 changed files with 565 additions and 398 deletions.
4 changes: 2 additions & 2 deletions add-on/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "__MSG_manifest_extensionName__",
"short_name": "__MSG_manifest_shortExtensionName__",
"version" : "2.1.0rc2",
"version" : "2.1.0",

"description": "__MSG_manifest_extensionDescription__",
"homepage_url": "https://github.com/ipfs/ipfs-companion",
Expand Down Expand Up @@ -46,7 +46,7 @@
"128": "icons/png/ipfs-logo-off_128.png"
},
"default_title": "__MSG_browserAction_title__",
"default_popup": "dist/popup/browser-action.html"
"default_popup": "dist/popup/browser-action/index.html"
},

"options_ui": {
Expand Down
289 changes: 0 additions & 289 deletions add-on/src/popup/browser-action.js

This file was deleted.

49 changes: 49 additions & 0 deletions add-on/src/popup/browser-action/context-actions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
'use strict'
/* eslint-env browser, webextensions */

const browser = require('webextension-polyfill')
const html = require('choo/html')

module.exports = function contextActions ({
isIpfsContext,
isPinning,
isUnPinning,
isPinned,
isIpfsOnline,
onCopyIpfsAddr,
onCopyPublicGwAddr,
onPin,
onUnPin
}) {
if (!isIpfsContext) return null

return html`
<div class="panel-section panel-section-list">
<div class="panel-list-item" onclick=${onCopyIpfsAddr}>
<div class="icon"></div>
<div class="text">${browser.i18n.getMessage('panelCopy_currentIpfsAddress')}</div>
<div class="text-shortcut"></div>
</div>
<div class="panel-list-item" onclick=${onCopyPublicGwAddr}>
<div class="icon"></div>
<div class="text">${browser.i18n.getMessage('panel_copyCurrentPublicGwUrl')}</div>
<div class="text-shortcut"></div>
</div>
${isIpfsOnline && isPinned ? null : html`
<div class="panel-list-item ${isPinning ? 'disabled' : ''}" onclick=${onPin}>
<div class="icon"></div>
<div class="text">${browser.i18n.getMessage('panel_pinCurrentIpfsAddress')}</div>
<div class="text-shortcut"></div>
</div>
`}
${isIpfsOnline && isPinned ? html`
<div class="panel-list-item ${isUnPinning ? 'disabled' : ''}" onclick=${onUnPin}>
<div class="icon"></div>
<div class="text">${browser.i18n.getMessage('panel_unpinCurrentIpfsAddress')}</div>
<div class="text-shortcut"></div>
</div>
` : null}
<div class="panel-section-separator"></div>
</div>
`
}
Loading

0 comments on commit 5af3e26

Please sign in to comment.