Merge pull request #381 from MetaMask/ImproveUiDevMode

Improved Ui Dev Mode
feature/default_network_editable
Dan Finlay 9 years ago committed by GitHub
commit 239165ff81
  1. 1
      development/fonts
  2. 1
      development/images
  3. 38
      development/index.html
  4. 1
      fonts
  5. 1
      images
  6. 2
      package.json
  7. 10
      ui-dev.js

@ -1 +0,0 @@
../app/fonts

@ -1 +0,0 @@
../app/images

@ -3,6 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>MetaMask</title> <title>MetaMask</title>
</head> </head>
<body> <body>
@ -23,4 +24,41 @@ html, body, #app-content, .super-dev-container {
background: #F7F7F7; background: #F7F7F7;
} }
</style> </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> </html>

@ -0,0 +1 @@
app/fonts

@ -0,0 +1 @@
app/images

@ -7,7 +7,7 @@
"start": "gulp dev", "start": "gulp dev",
"test": "mocha --require test/helper.js --compilers js:babel-register --recursive", "test": "mocha --require test/helper.js --compilers js:babel-register --recursive",
"watch": "mocha watch --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": { "browserify": {
"transform": [ "transform": [

@ -1,9 +1,9 @@
const render = require('react-dom').render const render = require('react-dom').render
const h = require('react-hyperscript') const h = require('react-hyperscript')
const Root = require('../ui/app/root') const Root = require('./ui/app/root')
const configureStore = require('./mockStore') const configureStore = require('./development/mockStore')
const states = require('./states') const states = require('./development/states')
const Selector = require('./selector') const Selector = require('./development/selector')
// Query String // Query String
const qs = require('qs') const qs = require('qs')
@ -13,7 +13,7 @@ const firstState = states[selectedView]
updateQueryParams(selectedView) updateQueryParams(selectedView)
// CSS // CSS
const MetaMaskUiCss = require('../ui/css') const MetaMaskUiCss = require('./ui/css')
const injectCss = require('inject-css') const injectCss = require('inject-css')
Loading…
Cancel
Save