aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2016-07-12 15:12:44 +0800
committerkumavis <aaron@kumavis.me>2016-07-12 15:12:44 +0800
commit4cf83b582e9ed9c93d7590a42c6f908fe3fa969d (patch)
tree40bd08e3aa7c29067a752553d2e8447b4f318d78 /app
parent791911d6f50a053cee0f8393249ec25da4a1ac77 (diff)
parent947665dca1ba01bca93024fa99c3397fcab6f686 (diff)
downloadtangerine-wallet-browser-4cf83b582e9ed9c93d7590a42c6f908fe3fa969d.tar.gz
tangerine-wallet-browser-4cf83b582e9ed9c93d7590a42c6f908fe3fa969d.tar.zst
tangerine-wallet-browser-4cf83b582e9ed9c93d7590a42c6f908fe3fa969d.zip
Merge branch 'master' of github.com:MetaMask/metamask-plugin into FixMenuBug
Diffstat (limited to 'app')
-rw-r--r--app/manifest.json2
-rw-r--r--app/scripts/background.js2
-rw-r--r--app/scripts/lib/notifications.js23
3 files changed, 12 insertions, 15 deletions
diff --git a/app/manifest.json b/app/manifest.json
index ebeaf16f6..d0207ee0e 100644
--- a/app/manifest.json
+++ b/app/manifest.json
@@ -1,7 +1,7 @@
{
"name": "__MSG_appName__",
"short_name": "Metamask",
- "version": "2.5.0",
+ "version": "2.6.0",
"manifest_version": 2,
"description": "__MSG_appDescription__",
"icons": {
diff --git a/app/scripts/background.js b/app/scripts/background.js
index 28285fd70..801dc95cf 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -43,7 +43,6 @@ function showUnconfirmedMessage (msgParams, msgId) {
onConfirm: idStore.approveMessage.bind(idStore, msgId, noop),
onCancel: idStore.cancelMessage.bind(idStore, msgId),
})
-
}
function showUnconfirmedTx (txParams, txData, onTxDoneCb) {
@@ -60,7 +59,6 @@ function showUnconfirmedTx (txParams, txData, onTxDoneCb) {
onConfirm: idStore.approveTransaction.bind(idStore, txData.id, noop),
onCancel: idStore.cancelTransaction.bind(idStore, txData.id),
})
-
}
//
diff --git a/app/scripts/lib/notifications.js b/app/scripts/lib/notifications.js
index b9d7b79da..b6590b0e5 100644
--- a/app/scripts/lib/notifications.js
+++ b/app/scripts/lib/notifications.js
@@ -9,11 +9,13 @@ const PendingMsgDetails = require('../../../ui/app/components/pending-msg-detail
const MetaMaskUiCss = require('../../../ui/css')
var notificationHandlers = {}
-module.exports = {
+const notifications = {
createUnlockRequestNotification: createUnlockRequestNotification,
createTxNotification: createTxNotification,
createMsgNotification: createMsgNotification,
}
+module.exports = notifications
+window.METAMASK_NOTIFIER = notifications
setupListeners()
@@ -57,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),
}))
-
})
}
@@ -72,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),
}))
-
})
}
@@ -105,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: {
@@ -133,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)
@@ -143,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%">
@@ -154,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)
}