mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge pull request #381 from MetaMask/ImproveUiDevMode
Improved Ui Dev Mode
This commit is contained in:
commit
239165ff81
@ -1 +0,0 @@
|
||||
../app/fonts
|
@ -1 +0,0 @@
|
||||
../app/images
|
@ -3,6 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>MetaMask</title>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@ -23,4 +24,41 @@ html, body, #app-content, .super-dev-container {
|
||||
background: #F7F7F7;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
liveReloadCode(Date.now(), 300)
|
||||
function liveReloadCode(lastUpdate, updateRate) {
|
||||
setTimeout(iter, updateRate)
|
||||
|
||||
function iter() {
|
||||
var xhr = new XMLHttpRequest()
|
||||
|
||||
xhr.open('GET', '/-/live-reload')
|
||||
xhr.onreadystatechange = function() {
|
||||
if(xhr.readyState !== 4) {
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
var change = JSON.parse(xhr.responseText).lastUpdate
|
||||
|
||||
if(lastUpdate < change) {
|
||||
return reload()
|
||||
}
|
||||
} catch(err) {
|
||||
}
|
||||
|
||||
xhr =
|
||||
xhr.onreadystatechange = null
|
||||
setTimeout(iter, updateRate)
|
||||
}
|
||||
|
||||
xhr.send(null)
|
||||
}
|
||||
}
|
||||
|
||||
function reload() {
|
||||
window.location.reload()
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
|
@ -7,7 +7,7 @@
|
||||
"start": "gulp dev",
|
||||
"test": "mocha --require test/helper.js --compilers js:babel-register --recursive",
|
||||
"watch": "mocha watch --compilers js:babel-register --recursive",
|
||||
"ui": "beefy development/mocker.js:bundle.js --live --open --cwd development --index=./development/index.html"
|
||||
"ui": "beefy ui-dev.js:bundle.js --live --open --index=./development/index.html --cwd ./"
|
||||
},
|
||||
"browserify": {
|
||||
"transform": [
|
||||
|
@ -1,9 +1,9 @@
|
||||
const render = require('react-dom').render
|
||||
const h = require('react-hyperscript')
|
||||
const Root = require('../ui/app/root')
|
||||
const configureStore = require('./mockStore')
|
||||
const states = require('./states')
|
||||
const Selector = require('./selector')
|
||||
const Root = require('./ui/app/root')
|
||||
const configureStore = require('./development/mockStore')
|
||||
const states = require('./development/states')
|
||||
const Selector = require('./development/selector')
|
||||
|
||||
// Query String
|
||||
const qs = require('qs')
|
||||
@ -13,7 +13,7 @@ const firstState = states[selectedView]
|
||||
updateQueryParams(selectedView)
|
||||
|
||||
// CSS
|
||||
const MetaMaskUiCss = require('../ui/css')
|
||||
const MetaMaskUiCss = require('./ui/css')
|
||||
const injectCss = require('inject-css')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user