-
Notifications
You must be signed in to change notification settings - Fork 3
/
settings.html
148 lines (135 loc) · 4.49 KB
/
settings.html
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="./res/main.css">
<title>Pengaturan Lafzi</title>
<style>
table.settings td {
vertical-align: top;
padding-bottom: 10px;
}
table.settings td.settingsLabel {
width: 30%;
}
table.settings td.settingsValue {
width: 70%;
}
table.settings small {
font-size: 8pt;
}
input[type=range] {
-webkit-user-select: text;
user-select: text;
}
body {
box-shadow:inset 0px 0px 0px 1px #ccc;
}
</style>
</head>
<body>
<div id="main-wrap">
<div id="srp-header" style="
-webkit-app-region: drag;
margin-top: 0;
top: 1px;
left: 1px;
width: calc(100vh - 22px);
">
<h3>
Pengaturan Lafzi
</h3>
</div>
<div style="padding: 50px 15px;">
<table class="settings">
<tr>
<td class="settingsLabel">Huruf vokal</td>
<td class="settingsValue">
<label for="settingsVowel">
<input type="checkbox" name="vowel" id="settingsVowel">
Sertakan huruf vokal
</label>
<br/>
<small>
Jika nonaktif, huruf vokal (AIUEO) tidak akan diperhitungkan dalam pencarian.
Contohnya, pencarian "munafiqun" akan menyertakan juga "munafiqin".
</small>
</td>
</tr>
<tr>
<td>Terjemahan</td>
<td>
<label for="settingsTrans">
<input type="checkbox" name="trans" id="settingsTrans">
Tampilkan terjemah
</label>
<br/>
<small>
Jika diaktifkan, akan menampilkan terjemahan Al-Quran dalam bahasa Indonesia.
</small>
</td>
</tr>
<tr>
<td>Relevansi</td>
<td>
<label for="settingsThresholdLow">
<input type="radio" name="threshold" id="settingsThresholdLow" value="0.5">
Rendah
</label>
<label for="settingsThresholdMid">
<input type="radio" name="threshold" id="settingsThresholdMid" value="0.7">
Sedang
</label>
<label for="settingsThresholdHi">
<input type="radio" name="threshold" id="settingsThresholdHi" value="0.9">
Tinggi
</label>
<br/>
<small>
Jika Lafzi tidak menemukan hasil yang diinginkan, cobalah untuk membuat tingkat relevansi
lebih rendah. Sebaliknya jika hasil pencarian terlalu banyak, tingkat relevansi dapat
dibuat lebih tinggi.
</small>
</td>
</tr>
</table>
</div>
<div style="
position: absolute;
bottom: 1px;
left: 1px;
width: calc(100vh - 2px);
text-align: center;
background-color: #EEE;
padding: 15px 0;
border-top: 1px solid #ccc;
">
<input type="button" value=" Simpan " id="settingsSave">
</div>
</div>
<script>
window.$ = window.jQuery = require('jquery');
var ipc = require('electron').ipcRenderer;
var remote = require('electron').remote;
var appConfig = remote.getGlobal('appConfig');
$(document).ready(function () {
$('#settingsVowel').prop('checked', appConfig.get('vowel'));
$('#settingsTrans').prop('checked', appConfig.get('showTrans'));
$("input[name=threshold]").val([appConfig.get('threshold')]);
});
$('#settingsSave').on('click', function () {
var settings = {
vowel: $('#settingsVowel').is(':checked'),
showTrans: $('#settingsTrans').is(':checked'),
threshold: Number($("input[name=threshold]:checked").val())
};
ipc.send('settingsSave', settings);
ipc.once('settingsSaveDone', function (e, ret) {
if (ret) {
remote.getCurrentWindow().close();
}
});
});
</script>
</body>
</html>