mirror of
https://github.com/alexadam/save-as-ebook.git
synced 2025-09-11 01:44:44 +00:00
30 lines
786 B
JavaScript
30 lines
786 B
JavaScript
// var chapterHolder = document.getElementById('chapters');
|
|
var list = document.getElementById('chapters');
|
|
var allPages = getEbookPages();
|
|
|
|
console.log(allPages.length);
|
|
|
|
for (var i = 0; i < allPages.length; i++) {
|
|
if (!allPages[i]) {
|
|
continue;
|
|
}
|
|
var listItem = document.createElement('li');
|
|
var label = document.createElement('span');
|
|
label.innerHTML = allPages[i].title;
|
|
listItem.appendChild(label);
|
|
list.appendChild(listItem);
|
|
}
|
|
|
|
|
|
document.getElementById('closeButton').onclick = function () {
|
|
window.open(window.location, '_self').close();
|
|
};
|
|
|
|
document.getElementById('saveButton').onclick = function () {
|
|
try {
|
|
buildEbook();
|
|
// window.open(window.location, '_self').close();
|
|
} catch (e) {
|
|
alert(e);
|
|
}
|
|
};
|