mirror of
https://codeberg.org/nobody/LocalCDN.git
synced 2025-06-05 21:49:31 +02:00
Added note about missing translation in popup
This commit is contained in:
@@ -32,6 +32,10 @@ popup._renderContents = function () {
|
||||
helpers.insertI18nContentIntoDocument(document);
|
||||
helpers.insertI18nTitlesIntoDocument(document);
|
||||
|
||||
if (!helpers.insertI18nContentIntoDocument(document)) {
|
||||
popup._renderLocaleNotice();
|
||||
}
|
||||
|
||||
popup._renderNonContextualContents();
|
||||
|
||||
popup._determineTargetTab()
|
||||
@@ -422,6 +426,19 @@ popup._filterDuplicates = function(array, key) {
|
||||
return filtered;
|
||||
};
|
||||
|
||||
popup._renderLocaleNotice = function () {
|
||||
|
||||
let localeNoticeElement, nameTextNode;
|
||||
|
||||
localeNoticeElement = document.getElementById('popup-incomplete-translation');
|
||||
localeNoticeElement.setAttribute('class', 'notice notice-default');
|
||||
localeNoticeElement.addEventListener('mouseup', popup._onIncompleteTranslation);
|
||||
|
||||
nameTextNode = document.createTextNode('Translation is incomplete. You want to help?');
|
||||
|
||||
localeNoticeElement.appendChild(nameTextNode);
|
||||
localeNoticeElement.addEventListener('mouseup', popup._onIncompleteTranslation);
|
||||
};
|
||||
|
||||
/**
|
||||
* Event Handlers
|
||||
@@ -533,6 +550,19 @@ popup._onInfoButtonClicked = function () {
|
||||
}
|
||||
};
|
||||
|
||||
popup._onIncompleteTranslation = function () {
|
||||
if (event.button === 0 || event.button === 1) {
|
||||
|
||||
chrome.tabs.create({
|
||||
'url': 'https://localcdn.de/translation/',
|
||||
'active': (event.button === 0)
|
||||
});
|
||||
}
|
||||
|
||||
if (event.button === 0) {
|
||||
window.close();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Initializations
|
||||
|
Reference in New Issue
Block a user