mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge branch 'master' into ConfirmationStyle
This commit is contained in:
commit
a1fdf28a7b
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
- Fix formatting of ETH balance
|
- Fix formatting of ETH balance
|
||||||
- Fix formatting of account details.
|
- Fix formatting of account details.
|
||||||
|
- Use web3 minified dist for faster inject times
|
||||||
|
- Fix issue where dropdowns were not in front of icons.
|
||||||
|
|
||||||
## 2.5.0 2016-06-29
|
## 2.5.0 2016-06-29
|
||||||
|
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
const LocalMessageDuplexStream = require('./lib/local-message-stream.js')
|
const LocalMessageDuplexStream = require('./lib/local-message-stream.js')
|
||||||
const PortStream = require('./lib/port-stream.js')
|
const PortStream = require('./lib/port-stream.js')
|
||||||
const ObjectMultiplex = require('./lib/obj-multiplex')
|
const ObjectMultiplex = require('./lib/obj-multiplex')
|
||||||
// const urlUtil = require('url')
|
|
||||||
|
|
||||||
if (shouldInjectWeb3()) {
|
if (shouldInjectWeb3()) {
|
||||||
setupInjection()
|
setupInjection()
|
||||||
|
setupStreams()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setupInjection(){
|
function setupInjection(){
|
||||||
|
|
||||||
// inject in-page script
|
// inject in-page script
|
||||||
var scriptTag = document.createElement('script')
|
var scriptTag = document.createElement('script')
|
||||||
scriptTag.src = chrome.extension.getURL('scripts/inpage.js')
|
scriptTag.src = chrome.extension.getURL('scripts/inpage.js')
|
||||||
@ -16,6 +15,9 @@ function setupInjection(){
|
|||||||
var container = document.head || document.documentElement
|
var container = document.head || document.documentElement
|
||||||
// append as first child
|
// append as first child
|
||||||
container.insertBefore(scriptTag, container.children[0])
|
container.insertBefore(scriptTag, container.children[0])
|
||||||
|
}
|
||||||
|
|
||||||
|
function setupStreams(){
|
||||||
|
|
||||||
// setup communication to page and plugin
|
// setup communication to page and plugin
|
||||||
var pageStream = new LocalMessageDuplexStream({
|
var pageStream = new LocalMessageDuplexStream({
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
|
/*global Web3*/
|
||||||
cleanContextForImports()
|
cleanContextForImports()
|
||||||
const Web3 = require('web3')
|
require('web3/dist/web3.min.js')
|
||||||
const LocalMessageDuplexStream = require('./lib/local-message-stream.js')
|
const LocalMessageDuplexStream = require('./lib/local-message-stream.js')
|
||||||
const setupDappAutoReload = require('./lib/auto-reload.js')
|
const setupDappAutoReload = require('./lib/auto-reload.js')
|
||||||
const MetamaskInpageProvider = require('./lib/inpage-provider.js')
|
const MetamaskInpageProvider = require('./lib/inpage-provider.js')
|
||||||
restoreContextAfterImports()
|
restoreContextAfterImports()
|
||||||
|
|
||||||
// remove from window
|
|
||||||
delete window.Web3
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// setup plugin communication
|
// setup plugin communication
|
||||||
|
@ -108,7 +108,7 @@ App.prototype.renderAppBar = function () {
|
|||||||
background: props.isUnlocked ? 'white' : 'none',
|
background: props.isUnlocked ? 'white' : 'none',
|
||||||
height: '36px',
|
height: '36px',
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
zIndex: 1,
|
zIndex: 2,
|
||||||
},
|
},
|
||||||
}, props.isUnlocked && [
|
}, props.isUnlocked && [
|
||||||
|
|
||||||
@ -197,10 +197,10 @@ App.prototype.renderNetworkDropdown = function () {
|
|||||||
onClickOutside: (event) => {
|
onClickOutside: (event) => {
|
||||||
this.setState({ isNetworkMenuOpen: !isOpen })
|
this.setState({ isNetworkMenuOpen: !isOpen })
|
||||||
},
|
},
|
||||||
|
zIndex: 1,
|
||||||
style: {
|
style: {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
left: 0,
|
left: 0,
|
||||||
zIndex: 0,
|
|
||||||
},
|
},
|
||||||
innerStyle: {
|
innerStyle: {
|
||||||
background: 'white',
|
background: 'white',
|
||||||
@ -245,13 +245,13 @@ App.prototype.renderDropdown = function () {
|
|||||||
|
|
||||||
return h(MenuDroppo, {
|
return h(MenuDroppo, {
|
||||||
isOpen: isOpen,
|
isOpen: isOpen,
|
||||||
|
zIndex: 1,
|
||||||
onClickOutside: (event) => {
|
onClickOutside: (event) => {
|
||||||
this.setState({ isMainMenuOpen: !isOpen })
|
this.setState({ isMainMenuOpen: !isOpen })
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
right: 0,
|
right: 0,
|
||||||
zIndex: 0,
|
|
||||||
},
|
},
|
||||||
innerStyle: {
|
innerStyle: {
|
||||||
background: 'white',
|
background: 'white',
|
||||||
|
@ -116,7 +116,7 @@ function formatBalance (balance, decimalsToKeep) {
|
|||||||
if (afterDecimal !== '0') {
|
if (afterDecimal !== '0') {
|
||||||
var sigFigs = afterDecimal.match(/^0*(.{2})/) // default: grabs 2 most significant digits
|
var sigFigs = afterDecimal.match(/^0*(.{2})/) // default: grabs 2 most significant digits
|
||||||
if (sigFigs) { afterDecimal = sigFigs[0] }
|
if (sigFigs) { afterDecimal = sigFigs[0] }
|
||||||
formattedBalance = `0.${afterDecimal.slice(0, 6)}`
|
formattedBalance = afterDecimal.substr(0, 5) === '00000' ? '<0.00001' : `0.${afterDecimal.slice(0, 6)}`
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
formattedBalance = `${beforeDecimal}.${afterDecimal.slice(0, 2)}`
|
formattedBalance = `${beforeDecimal}.${afterDecimal.slice(0, 2)}`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user