gulp prettifyを実行
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Settings</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Settings</h1>
|
||||
<p>URL: <input type="text" id="url"></p>
|
||||
<p>URL:
|
||||
<input type="text" id="url">
|
||||
</p>
|
||||
<input type="button" value="OK" onclick="saveSettings()">
|
||||
<input type="button" value="Cancel" onclick="goBack()">
|
||||
|
||||
@@ -14,21 +18,22 @@
|
||||
var remote = require('remote');
|
||||
var fs = require('fs');
|
||||
|
||||
var saveSettings = function(){
|
||||
var saveSettings = function() {
|
||||
var configFile = remote.require('app').getPath('userData') + '/config.json';
|
||||
var urlInput = document.getElementById('url');
|
||||
var config = {
|
||||
url: urlInput.value
|
||||
};
|
||||
fs.writeFile(configFile, JSON.stringify(config, null, ' '), function(err){
|
||||
if(err) throw err;
|
||||
fs.writeFile(configFile, JSON.stringify(config, null, ' '), function(err) {
|
||||
if (err) throw err;
|
||||
window.location.href = './index.html';
|
||||
});
|
||||
}
|
||||
|
||||
var goBack = function(){
|
||||
var goBack = function() {
|
||||
remote.getCurrentWindow().webContents.goBack();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
</html>
|
Reference in New Issue
Block a user