mirror of
https://github.com/alexadam/save-as-ebook.git
synced 2025-09-16 12:19:45 +00:00
misc
This commit is contained in:
parent
d91272b741
commit
e72d865c09
5 changed files with 54 additions and 50 deletions
|
@ -7,7 +7,8 @@ document.getElementById("editChapters").onclick = function() {
|
|||
|
||||
chrome.tabs.query({
|
||||
currentWindow: true,
|
||||
active: true
|
||||
active: true,
|
||||
highlighted: true
|
||||
}, function(tab) {
|
||||
|
||||
chrome.tabs.executeScript(tab[0].id, {file: '/chapter-editor/jquery.js'});
|
||||
|
@ -35,7 +36,8 @@ function dispatch(action, justAddToBuffer) {
|
|||
}
|
||||
chrome.tabs.query({
|
||||
currentWindow: true,
|
||||
active: true
|
||||
active: true,
|
||||
highlighted: true
|
||||
}, function(tab) {
|
||||
|
||||
chrome.tabs.executeScript(tab[0].id, {file: '/chapter-editor/jquery.js'});
|
||||
|
@ -51,15 +53,15 @@ function dispatch(action, justAddToBuffer) {
|
|||
chrome.tabs.sendMessage(tab[0].id, {
|
||||
type: action
|
||||
}, function(response) {
|
||||
getEbookPages(function (allPages) {
|
||||
allPages.push(response);
|
||||
saveEbookPages(allPages);
|
||||
if (!justAddToBuffer) {
|
||||
buildEbook();
|
||||
} else {
|
||||
if (!justAddToBuffer) {
|
||||
buildEbook([response]);
|
||||
} else {
|
||||
getEbookPages(function (allPages) {
|
||||
allPages.push(response);
|
||||
saveEbookPages(allPages);
|
||||
window.close();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -80,7 +82,3 @@ document.getElementById('pageChapter').onclick = function() {
|
|||
document.getElementById('selectionChapter').onclick = function() {
|
||||
dispatch('extract-selection', true);
|
||||
};
|
||||
|
||||
document.getElementById('saveChapters').onclick = function() {
|
||||
buildEbook();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue