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:
@@ -11,7 +11,6 @@ body {
|
||||
margin: 0 auto;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
padding: 0px 15px 0px 15px;
|
||||
max-width: 348px;
|
||||
}
|
||||
|
||||
@@ -20,7 +19,7 @@ header {
|
||||
border-bottom: solid #d3d3d3 1px;
|
||||
display: flex;
|
||||
position: relative;
|
||||
padding: 8px 0px 0px 4px;
|
||||
padding: 8px 15px 15px 4px;
|
||||
}
|
||||
|
||||
.panel {
|
||||
@@ -39,7 +38,7 @@ header {
|
||||
|
||||
footer {
|
||||
overflow: hidden;
|
||||
padding: 8px 0px;
|
||||
padding: 8px 15px;
|
||||
}
|
||||
|
||||
#more-injections-section {
|
||||
@@ -47,6 +46,11 @@ footer {
|
||||
padding: 0px 8px;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 0px 15px;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fonts
|
||||
*/
|
||||
@@ -381,6 +385,16 @@ input:checked + .slider:before {
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
#popup-incomplete-translation {
|
||||
width: 100%;
|
||||
color: white;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
background-color: #ffa500;
|
||||
padding: 0px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compatibility
|
||||
*/
|
||||
|
@@ -90,6 +90,8 @@
|
||||
|
||||
</footer>
|
||||
|
||||
<div id="popup-incomplete-translation"></div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
@@ -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
|
||||
|
@@ -28,6 +28,7 @@
|
||||
<li>Improved font color for dark mode</li>
|
||||
<li>Updated welcome page</li>
|
||||
<li>Updated URL for missing translation in option page</li>
|
||||
<li>Added note about missing translation in popup</li>
|
||||
</ul>
|
||||
<div class="topic-label">
|
||||
Please update your uBlock/uMatrix rules
|
||||
|
Reference in New Issue
Block a user