2016-03-12 02:13:48 +01:00
|
|
|
const createId = require('hat')
|
2016-06-25 02:22:27 +02:00
|
|
|
const extend = require('xtend')
|
2016-06-24 00:13:24 +02:00
|
|
|
const unmountComponentAtNode = require('react-dom').unmountComponentAtNode
|
|
|
|
const findDOMNode = require('react-dom').findDOMNode
|
|
|
|
const render = require('react-dom').render
|
|
|
|
const h = require('react-hyperscript')
|
2016-06-25 02:22:27 +02:00
|
|
|
const PendingTxDetails = require('../../../ui/app/components/pending-tx-details')
|
|
|
|
const PendingMsgDetails = require('../../../ui/app/components/pending-msg-details')
|
2016-06-24 00:13:24 +02:00
|
|
|
const MetaMaskUiCss = require('../../../ui/css')
|
2016-07-21 19:45:32 +02:00
|
|
|
const extension = require('./extension')
|
2016-03-12 02:13:48 +01:00
|
|
|
var notificationHandlers = {}
|
|
|
|
|
2016-07-12 05:53:26 +02:00
|
|
|
const notifications = {
|
2016-05-24 23:59:33 +02:00
|
|
|
createUnlockRequestNotification: createUnlockRequestNotification,
|
2016-04-28 23:16:24 +02:00
|
|
|
createTxNotification: createTxNotification,
|
|
|
|
createMsgNotification: createMsgNotification,
|
|
|
|
}
|
2016-07-12 00:45:57 +02:00
|
|
|
module.exports = notifications
|
|
|
|
window.METAMASK_NOTIFIER = notifications
|
2016-03-12 02:13:48 +01:00
|
|
|
|
2016-06-21 22:18:32 +02:00
|
|
|
function createUnlockRequestNotification (opts) {
|
2016-08-17 00:39:40 +02:00
|
|
|
showNotification()
|
2016-05-24 23:59:33 +02:00
|
|
|
}
|
|
|
|
|
2016-06-28 21:36:53 +02:00
|
|
|
function createTxNotification (state) {
|
2016-08-17 00:39:40 +02:00
|
|
|
showNotification()
|
2016-04-14 00:28:44 +02:00
|
|
|
}
|
2016-04-28 23:16:24 +02:00
|
|
|
|
2016-06-28 21:36:53 +02:00
|
|
|
function createMsgNotification (state) {
|
2016-08-17 00:39:40 +02:00
|
|
|
showNotification()
|
2016-06-25 02:22:27 +02:00
|
|
|
}
|
|
|
|
|
2016-08-17 00:39:40 +02:00
|
|
|
function showNotification() {
|
2016-08-17 01:46:44 +02:00
|
|
|
extension.windows.create({
|
2016-08-17 00:39:40 +02:00
|
|
|
url:"notification.html",
|
2016-08-17 02:32:54 +02:00
|
|
|
type:"detached_panel",
|
|
|
|
focused:true,
|
2016-08-17 00:39:40 +02:00
|
|
|
width:360,
|
|
|
|
height:500,
|
2016-04-28 23:16:24 +02:00
|
|
|
})
|
2016-06-25 02:22:27 +02:00
|
|
|
}
|
2016-06-23 04:28:11 +02:00
|
|
|
|