diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-07-12 11:53:26 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-07-12 11:53:26 +0800 |
commit | e21a48da838401efed696d2ec0404cec93cee8ff (patch) | |
tree | fa178267c0a5debd58abdf285575f4ae8afdc735 /app/scripts/lib | |
parent | 539fe3e940ca364d0af0abc9cf1e361ea39c1151 (diff) | |
download | tangerine-wallet-browser-e21a48da838401efed696d2ec0404cec93cee8ff.tar tangerine-wallet-browser-e21a48da838401efed696d2ec0404cec93cee8ff.tar.gz tangerine-wallet-browser-e21a48da838401efed696d2ec0404cec93cee8ff.tar.bz2 tangerine-wallet-browser-e21a48da838401efed696d2ec0404cec93cee8ff.tar.lz tangerine-wallet-browser-e21a48da838401efed696d2ec0404cec93cee8ff.tar.xz tangerine-wallet-browser-e21a48da838401efed696d2ec0404cec93cee8ff.tar.zst tangerine-wallet-browser-e21a48da838401efed696d2ec0404cec93cee8ff.zip |
Linted
Diffstat (limited to 'app/scripts/lib')
-rw-r--r-- | app/scripts/lib/notifications.js | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/app/scripts/lib/notifications.js b/app/scripts/lib/notifications.js index 354476af2..b6590b0e5 100644 --- a/app/scripts/lib/notifications.js +++ b/app/scripts/lib/notifications.js @@ -9,7 +9,7 @@ const PendingMsgDetails = require('../../../ui/app/components/pending-msg-detail const MetaMaskUiCss = require('../../../ui/css') var notificationHandlers = {} -const notifications = { +const notifications = { createUnlockRequestNotification: createUnlockRequestNotification, createTxNotification: createTxNotification, createMsgNotification: createMsgNotification, @@ -59,14 +59,13 @@ function createTxNotification (state) { // guard for chrome bug https://github.com/MetaMask/metamask-plugin/issues/236 if (!chrome.notifications) return console.error('Chrome notifications API missing...') - renderTxNotificationSVG(state, function(err, notificationSvgSource){ + renderTxNotificationSVG(state, function (err, notificationSvgSource) { if (err) throw err showNotification(extend(state, { title: 'New Unsigned Transaction', imageUrl: toSvgUri(notificationSvgSource), })) - }) } @@ -74,14 +73,13 @@ function createMsgNotification (state) { // guard for chrome bug https://github.com/MetaMask/metamask-plugin/issues/236 if (!chrome.notifications) return console.error('Chrome notifications API missing...') - renderMsgNotificationSVG(state, function(err, notificationSvgSource){ + renderMsgNotificationSVG(state, function (err, notificationSvgSource) { if (err) throw err showNotification(extend(state, { title: 'New Unsigned Message', imageUrl: toSvgUri(notificationSvgSource), })) - }) } @@ -107,20 +105,19 @@ function showNotification (state) { confirm: state.onConfirm, cancel: state.onCancel, } - } -function renderTxNotificationSVG(state, cb){ +function renderTxNotificationSVG (state, cb) { var content = h(PendingTxDetails, state) renderNotificationSVG(content, cb) } -function renderMsgNotificationSVG(state, cb){ +function renderMsgNotificationSVG (state, cb) { var content = h(PendingMsgDetails, state) renderNotificationSVG(content, cb) } -function renderNotificationSVG(content, cb){ +function renderNotificationSVG (content, cb) { var container = document.createElement('div') var confirmView = h('div.app-primary', { style: { @@ -135,7 +132,7 @@ function renderNotificationSVG(content, cb){ content, ]) - render(confirmView, container, function ready(){ + render(confirmView, container, function ready() { var rootElement = findDOMNode(this) var viewSource = rootElement.outerHTML unmountComponentAtNode(container) @@ -145,7 +142,7 @@ function renderNotificationSVG(content, cb){ }) } -function svgWrapper(content){ +function svgWrapper (content) { var wrapperSource = ` <svg xmlns="http://www.w3.org/2000/svg" width="360" height="240"> <foreignObject x="0" y="0" width="100%" height="100%"> @@ -156,6 +153,6 @@ function svgWrapper(content){ return wrapperSource.split('{{content}}').join(content) } -function toSvgUri(content){ +function toSvgUri (content) { return 'data:image/svg+xml;utf8,' + encodeURIComponent(content) } |