forked from e-alfred/epubreader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpersonal.js
21 lines (20 loc) · 928 Bytes
/
personal.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
window.addEventListener('DOMContentLoaded', function () {
// save settings
var readerSettings = {
save : function() {
var data = {
EpubEnable: document.getElementById('EpubEnable').checked ? 'true' : 'false',
PdfEnable: document.getElementById('PdfEnable').checked ? 'true' : 'false',
CbxEnable: document.getElementById('CbxEnable').checked ? 'true' : 'false'
};
OC.msg.startSaving('#reader-personal .msg');
$.post(OC.filePath('epubreader', 'lib', 'personal-back.php'), data, readerSettings.afterSave);
},
afterSave : function(data){
OC.msg.finishedSaving('#reader-personal .msg', data);
}
};
$('#EpubEnable').on("change", readerSettings.save);
$('#PdfEnable').on("change", readerSettings.save);
$('#CbxEnable').on("change", readerSettings.save);
});