This commit is contained in:
alexadam 2016-07-29 12:13:04 +03:00
parent aee4df3cc6
commit 14bdf5fec4
5 changed files with 39 additions and 53 deletions

19
chapter-editor/utils.js Normal file
View 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));
}