-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.js
More file actions
38 lines (33 loc) · 860 Bytes
/
setup.js
File metadata and controls
38 lines (33 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//setup screen
require('electron').ipcRenderer.on('loadSetup', function (event, data) {
loadSetup(data)
})
let setupData
let saveSetupMain = require('electron').remote.getGlobal('saveSetup')
function loadSetup (data) {
//console.log(data)
setupData = data
if (data.setupComplete == true) {
// load data into setup form
}
}
function saveSetup () {
setupData.db = {}
setupData.db.type = $('input[name=db]:checked').val()
if ($('#sync')[0].checked) {
setupData.db.sync = true
}else{
setupData.db.sync = false
}
if ($('input[name=db]:checked').val() == "LocalDB") {
setupData.db.url = $('#syncUrl').val()
}else{
setupData.db.url = $('#Url').val()
}
setupData.setupComplete = true
console.log(setupData)
saveSetupMain(setupData)
}
$('#Save').on('click', function () {
saveSetup()
})