mirror of
https://github.com/alexadam/save-as-ebook.git
synced 2025-09-10 09:24:49 +00:00
miisc
This commit is contained in:
parent
aee4df3cc6
commit
14bdf5fec4
5 changed files with 39 additions and 53 deletions
19
chapter-editor/utils.js
Normal file
19
chapter-editor/utils.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
|
||||
function getEbookPages() {
|
||||
try {
|
||||
var allPages = localStorage.getItem('ebook');
|
||||
if (!allPages) {
|
||||
allPages = [];
|
||||
} else {
|
||||
allPages = JSON.parse(allPages);
|
||||
}
|
||||
return allPages;
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
function saveEbookPages(pages) {
|
||||
localStorage.setItem('ebook', JSON.stringify(pages));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue