summaryrefslogtreecommitdiff
path: root/read.html
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-02-25 01:33:35 +0300
committerAndrew Dolgov <[email protected]>2017-02-25 01:33:35 +0300
commitabe6ca80782474e266961e49077ee566c22a0a91 (patch)
treede507d423b39e7f6879b98553b87388345a2fcca /read.html
parent54e8aeed8830644ab2d25fb8fb37d2323b607eef (diff)
store font/size settings locally
Diffstat (limited to 'read.html')
-rw-r--r--read.html15
1 files changed, 8 insertions, 7 deletions
diff --git a/read.html b/read.html
index eee1260..8244aa3 100644
--- a/read.html
+++ b/read.html
@@ -165,13 +165,14 @@
book.open(book_url);
- $.get("backend.php", { op: "getsettings" }, function(data) {
- console.log(data);
-
- book.setStyle("fontSize", data.fontSize + "px");
- book.setStyle("fontFamily", data.fontFamily);
- book.setStyle("lineHeight", data.lineHeight + "%");
- });
+ var settings = {
+ fontSize: localStorage['epube:fontSize'] ? localStorage['epube:fontSize'] : '16px',
+ fontFamily: localStorage['epube:fontFamily'] ? localStorage['epube:fontFamily'] : 'Georgia',
+ lineHeight: localStorage['epube:lineHeight'] ? localStorage['epube:lineHeight'] : '140%' };
+
+ book.setStyle("fontSize", settings.fontSize + "px");
+ book.setStyle("fontFamily", settings.fontFamily);
+ book.setStyle("lineHeight", settings.lineHeight + "%");
//styles: { fontSize: '24px', lineHeight: '130%', fontFamily: 'Georgia' }