Skip to content

Commit

Permalink
UX tweaks
Browse files Browse the repository at this point in the history
- font-size fix for #125
- fix empty menu item when API is down
- reorder items
  • Loading branch information
lidel committed Jul 9, 2016
1 parent 8b80a0d commit 9ee773a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
5 changes: 2 additions & 3 deletions data/panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
}
#gateway-status > li {
font-variant: small-caps;
font-size: small;
padding: 0;
}
#gateway-status > li > span:nth-of-type(2) {
Expand Down Expand Up @@ -82,12 +81,12 @@

<ul id="operations">
<li class="header" data-l10n-id="panel_operations-header"></li>
<li class="action" id="open-webui" data-l10n-id="panel_open-webui"></li>
<li class="action" id="open-preferences" data-l10n-id="panel_open-preferences"></li>
<li class="action" id="toggle-gateway-redirect">
<span id="enable-gateway-redirect" data-l10n-id="panel_toggle-gateway-redirect-enable"></span>
<span id="disable-gateway-redirect" data-l10n-id="panel_toggle-gateway-redirect-disable"></span>
</li>
<li class="action" id="open-webui" data-l10n-id="panel_open-webui"></li>
<li class="action" id="open-preferences" data-l10n-id="panel_open-preferences"></li>
</ul>

<ul id="ipfs-resource-actions">
Expand Down
3 changes: 2 additions & 1 deletion data/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ self.port.on('show', function (context) {
// if custom gateway is used
showIf('redirect-enabled', prefs.useCustomGateway)
showIf('redirect-disabled', !prefs.useCustomGateway)
showIf('enable-gateway-redirect', apiIsUp && !prefs.useCustomGateway)
showIf('enable-gateway-redirect', !prefs.useCustomGateway)
showIf('disable-gateway-redirect', prefs.useCustomGateway)
showIf('toggle-gateway-redirect', (apiIsUp && !prefs.useCustomGateway) || prefs.useCustomGateway)
showIf('open-webui', apiIsUp)
showIf('pin-current-ipfs-address', isIPFS && apiIsUp)

Expand Down
4 changes: 2 additions & 2 deletions lib/gateways.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ exports.onPreferencesChange = (f) => {

exports.isIPFS = (uriSpec) => {
return uriSpec &&
(uriSpec.startsWith('fs:/') ? isIPFS.path(uriSpec.replace(/^fs:/, '')) : isIPFS.url(uriSpec)) && // TODO: move to is-ipfs
!uriSpec.startsWith(CUSTOM_API_URI.spec)
(uriSpec.startsWith('fs:/') ? isIPFS.path(uriSpec.replace(/^fs:/, '')) : isIPFS.url(uriSpec)) && // TODO: move to is-ipfs
!uriSpec.startsWith(CUSTOM_API_URI.spec)
}

Object.defineProperty(exports, 'customUri', {
Expand Down
4 changes: 2 additions & 2 deletions lib/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ panel.port.on('copy-current-public-gw-url', hidePanelAnd(copyCurrentPublicGwUrl)
const ipfsContext = cm.PredicateContext((ctx) => {
let targetURL = ctx.srcURL || ctx.linkURL || ctx.documentURL
return !!targetURL &&
(targetURL.startsWith('fs:/') ? isIPFS.path(targetURL.replace(/^fs:/, '')) : isIPFS.url(targetURL)) && // TODO: move to is-ipfs
!targetURL.startsWith(gw.apiUri.spec)
(targetURL.startsWith('fs:/') ? isIPFS.path(targetURL.replace(/^fs:/, '')) : isIPFS.url(targetURL)) && // TODO: move to is-ipfs
!targetURL.startsWith(gw.apiUri.spec)
})

const PIN_IPFS_ADDRESS = cm.Item({
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"id": "ipfs-firefox-addon@lidel.org",
"description": "Access IPFS resources via custom HTTP2IPFS gateway",
"author": "Marcin Rataj",
"version": "1.6.0",
"version": "1.5.9",
"license": "CC0-1.0",
"homepage": "https://github.com/lidel/ipfs-firefox-addon",
"icon": "resource://ipfs-firefox-addon-at-lidel-dot-org/data/ipfs-logo-on.svg",
Expand Down

0 comments on commit 9ee773a

Please sign in to comment.