mirror of
https://github.com/alexadam/save-as-ebook.git
synced 2025-09-10 17:34:47 +00:00
show busy indicator in menu when triggered from shortcut
This commit is contained in:
parent
50dd1c3150
commit
39b66f2f8c
3 changed files with 19 additions and 0 deletions
|
@ -433,5 +433,8 @@ footer, canvas {
|
||||||
if (request.type === 'set include style') {
|
if (request.type === 'set include style') {
|
||||||
chrome.storage.local.set({'includeStyle': request.includeStyle});
|
chrome.storage.local.set({'includeStyle': request.includeStyle});
|
||||||
}
|
}
|
||||||
|
if (request.type === 'is busy?') {
|
||||||
|
sendResponse({isBusy: isBusy})
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
|
@ -13,6 +13,14 @@ document.getElementById('selectionChapterLabel').innerHTML = chrome.i18n.getMess
|
||||||
document.getElementById('editChapters').innerHTML = chrome.i18n.getMessage('editChapters');
|
document.getElementById('editChapters').innerHTML = chrome.i18n.getMessage('editChapters');
|
||||||
document.getElementById('waitMessage').innerHTML = chrome.i18n.getMessage('waitMessage');
|
document.getElementById('waitMessage').innerHTML = chrome.i18n.getMessage('waitMessage');
|
||||||
|
|
||||||
|
checkIfBusy((result) => {
|
||||||
|
if (result.isBusy) {
|
||||||
|
document.getElementById('busy').style.display = 'block';
|
||||||
|
} else {
|
||||||
|
document.getElementById('busy').style.display = 'none';
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
getStyles(createStyleList);
|
getStyles(createStyleList);
|
||||||
|
|
||||||
function createStyleList(styles) {
|
function createStyleList(styles) {
|
||||||
|
|
|
@ -83,6 +83,14 @@ function removeEbook() {
|
||||||
}, function(response) {});
|
}, function(response) {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkIfBusy(callback) {
|
||||||
|
chrome.runtime.sendMessage({
|
||||||
|
type: "is busy?"
|
||||||
|
}, function(response) {
|
||||||
|
callback(response);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/////
|
/////
|
||||||
function getCurrentUrl() {
|
function getCurrentUrl() {
|
||||||
var url = window.location.href;
|
var url = window.location.href;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue