mattermost-desktop/src/settings.html

39 lines
893 B
HTML
Raw Normal View History

<!DOCTYPE html>
<html>
2015-10-23 09:44:10 -07:00
<head>
<meta charset="UTF-8">
<title>Settings</title>
</head>
2015-10-23 09:44:10 -07:00
<body>
<h1>Settings</h1>
2015-10-23 09:44:10 -07:00
<p>URL:
<input type="text" id="url">
</p>
<input type="button" value="OK" onclick="saveSettings()">
<input type="button" value="Cancel" onclick="goBack()">
<script type="text/javascript">
2015-11-20 01:54:44 -08:00
const remote = require('electron').remote;
var fs = require('fs');
2015-10-23 09:44:10 -07:00
var saveSettings = function() {
var configFile = remote.getGlobal('config-file');
var urlInput = document.getElementById('url');
var config = {
url: urlInput.value
};
2015-10-23 09:44:10 -07:00
fs.writeFile(configFile, JSON.stringify(config, null, ' '), function(err) {
if (err) throw err;
window.location.href = './index.html';
});
}
2015-10-23 09:44:10 -07:00
var goBack = function() {
remote.getCurrentWindow().webContents.goBack();
}
</script>
</body>
2015-10-23 09:44:10 -07:00
</html>