1
0
mirror of https://codeberg.org/nobody/LocalCDN.git synced 2025-02-02 04:16:59 +01:00

Link to the help page added

This commit is contained in:
nobody 2020-05-27 06:22:58 +02:00
parent 88c89909bb
commit ba7e2c99a7
No known key found for this signature in database
GPG Key ID: 8F6DE3D614FCFD7A
3 changed files with 43 additions and 3 deletions

View File

@ -279,6 +279,24 @@ input:checked + .slider:before {
cursor: not-allowed;
}
#manipulateDOM-indicator {
display: inline-block;
cursor: pointer;
}
#manipulateDOM-indicator:hover {
color: #777;
text-decoration: underline;
}
#info-button-svg {
background-image: url("../../icons/info-dark.svg");
background-repeat: no-repeat;
cursor: pointer;
width: 15px;
margin-left: 5px;
}
/**
* Links
*/
@ -445,6 +463,10 @@ input:checked + .slider:before {
background-color: #323232;
}
#info-button-svg {
background-image: url("../../icons/info-light.svg");
}
/**
* Links
*/

View File

@ -59,8 +59,8 @@
</label>
</div>
<div class="label-domain">
<span id="manipulateDOM-indicator" data-i18n-content="labelManipulateDOM"></span>
<div id="label-manipulateDOM" class="label-domain">
<span id="manipulateDOM-indicator" data-i18n-content="labelManipulateDOM"></span><div id="info-button-svg"></div>
</div>
</div>

View File

@ -40,13 +40,15 @@ popup._renderContents = function () {
popup._renderNonContextualContents = function () {
let versionLabelElement, counterElement, testingUtilityLinkElement, optionsButtonElement, donationButtonElement;
let versionLabelElement, counterElement, testingUtilityLinkElement, optionsButtonElement, donationButtonElement, infoButtonLabel, infoButtonSVG;
versionLabelElement = document.getElementById('version-label');
counterElement = document.getElementById('injection-counter');
testingUtilityLinkElement = document.getElementById('testing-utility-link');
optionsButtonElement = document.getElementById('options-button');
donationButtonElement = document.getElementById('donate-button');
infoButtonLabel = document.getElementById('manipulateDOM-indicator');
infoButtonSVG = document.getElementById('info-button-svg');
versionLabelElement.innerText = popup._version;
counterElement.innerText = helpers.formatNumber(popup._amountInjected);
@ -54,6 +56,8 @@ popup._renderNonContextualContents = function () {
testingUtilityLinkElement.addEventListener('mouseup', popup._onTestingUtilityLinkClicked);
optionsButtonElement.addEventListener('mouseup', popup._onOptionsButtonClicked);
donationButtonElement.addEventListener('mouseup', popup._onDonationButtonClicked);
infoButtonLabel.addEventListener('mouseup', popup._onInfoButtonClicked);
infoButtonSVG.addEventListener('mouseup', popup._onInfoButtonClicked);
};
popup._renderContextualContents = function () {
@ -505,6 +509,20 @@ popup._onMoreInjectionsButton = function () {
popup._close();
};
popup._onInfoButtonClicked = function () {
if (event.button === 0 || event.button === 1) {
chrome.tabs.create({
'url': chrome.extension.getURL('pages/help/help.html'),
'active': (event.button === 0)
});
}
if (event.button === 0) {
window.close();
}
};
/**
* Initializations