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
5fc8683372
commit
89ae72fcba
12 changed files with 19 additions and 19 deletions
|
@ -1,84 +0,0 @@
|
|||
|
||||
document.getElementById("editChapters").onclick = function() {
|
||||
|
||||
if (document.getElementById('chapterEditor-Modal')) {
|
||||
return;
|
||||
}
|
||||
|
||||
chrome.tabs.query({
|
||||
currentWindow: true,
|
||||
active: true,
|
||||
highlighted: true
|
||||
}, function(tab) {
|
||||
|
||||
chrome.tabs.executeScript(tab[0].id, {file: '/chapter-editor/jquery.js'});
|
||||
chrome.tabs.executeScript(tab[0].id, {file: '/chapter-editor/utils.js'});
|
||||
chrome.tabs.executeScript(tab[0].id, {file: '/chapter-editor/filesaver.js'});
|
||||
chrome.tabs.executeScript(tab[0].id, {file: '/chapter-editor/jszip.js'});
|
||||
chrome.tabs.executeScript(tab[0].id, {file: '/chapter-editor/jszip-utils.js'});
|
||||
chrome.tabs.executeScript(tab[0].id, {file: '/chapter-editor/saveEbook.js'});
|
||||
chrome.tabs.executeScript(tab[0].id, {file: '/chapter-editor/jquery-sortable.js'});
|
||||
chrome.tabs.insertCSS(tab[0].id, {file: '/chapter-editor/chapterEditor.css'});
|
||||
|
||||
chrome.tabs.executeScript(tab[0].id, {
|
||||
file: '/chapter-editor/chapterEditor.js'
|
||||
});
|
||||
|
||||
window.close();
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
|
||||
function dispatch(action, justAddToBuffer) {
|
||||
if (!justAddToBuffer) {
|
||||
removeEbook();
|
||||
}
|
||||
chrome.tabs.query({
|
||||
currentWindow: true,
|
||||
active: true,
|
||||
highlighted: true
|
||||
}, function(tab) {
|
||||
|
||||
chrome.tabs.executeScript(tab[0].id, {file: '/chapter-editor/jquery.js'});
|
||||
chrome.tabs.executeScript(tab[0].id, {file: '/chapter-editor/utils.js'});
|
||||
chrome.tabs.executeScript(tab[0].id, {file: '/chapter-editor/filesaver.js'});
|
||||
chrome.tabs.executeScript(tab[0].id, {file: '/chapter-editor/jszip.js'});
|
||||
chrome.tabs.executeScript(tab[0].id, {file: '/chapter-editor/jszip-utils.js'});
|
||||
chrome.tabs.executeScript(tab[0].id, {file: '/pure-parser.js'});
|
||||
|
||||
chrome.tabs.executeScript(tab[0].id, {
|
||||
file: 'extractHtml.js'
|
||||
}, function() {
|
||||
chrome.tabs.sendMessage(tab[0].id, {
|
||||
type: action
|
||||
}, function(response) {
|
||||
if (!justAddToBuffer) {
|
||||
buildEbook([response]);
|
||||
} else {
|
||||
getEbookPages(function (allPages) {
|
||||
allPages.push(response);
|
||||
saveEbookPages(allPages);
|
||||
window.close();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
document.getElementById('savePage').onclick = function() {
|
||||
dispatch('extract-page', false);
|
||||
};
|
||||
|
||||
document.getElementById('saveSelection').onclick = function() {
|
||||
dispatch('extract-selection', false);
|
||||
};
|
||||
|
||||
document.getElementById('pageChapter').onclick = function() {
|
||||
dispatch('extract-page', true);
|
||||
};
|
||||
|
||||
document.getElementById('selectionChapter').onclick = function() {
|
||||
dispatch('extract-selection', true);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue