2018-09-07 00:56:04 +02:00
|
|
|
const html = require('choo/html');
|
|
|
|
|
|
|
|
import { setFileProtocolWssUrl, getFileProtocolWssUrl } from '../../app/api';
|
|
|
|
|
|
|
|
export default function preferences(state, emit) {
|
|
|
|
const wssURL = getFileProtocolWssUrl();
|
|
|
|
|
|
|
|
function updateWssUrl(event) {
|
|
|
|
state.wssURL = event.target.value;
|
|
|
|
setFileProtocolWssUrl(state.wssURL);
|
|
|
|
emit('render');
|
|
|
|
}
|
|
|
|
|
|
|
|
function clickDone(event) {
|
|
|
|
event.preventDefault();
|
|
|
|
emit('pushState', '/');
|
|
|
|
}
|
|
|
|
|
2018-11-16 21:39:36 +01:00
|
|
|
return html`
|
|
|
|
<body>
|
|
|
|
<div id="white">
|
|
|
|
<div id="preferences">
|
|
|
|
<a onclick="${clickDone}" href="#"> done </a>
|
|
|
|
<dl>
|
|
|
|
<dt>wss url:</dt>
|
|
|
|
<dd>
|
|
|
|
<input type="text" onchange="${updateWssUrl}" value="${wssURL}" />
|
|
|
|
</dd>
|
|
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
`;
|
2018-09-07 00:56:04 +02:00
|
|
|
}
|