Added Donation button

This commit is contained in:
nobody42 2020-05-16 17:40:46 +02:00
parent ffc4095d7f
commit 419d8c8ba3
No known key found for this signature in database
GPG Key ID: AB5145CF05BFE119
6 changed files with 158 additions and 2 deletions

View File

@ -3,3 +3,7 @@ enabled.svg (edited)
settings-dark.svg, settings-light.svg (edited)
https://www.svgrepo.com/vectors/web-security-fill/
Creative Commons BY 4.0
donate.svg (edited)
https://www.svgrepo.com/svg/39500/heart
CC0

124
icons/donate.svg Normal file
View File

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
viewBox="0 0 13.066 13.066"
style="enable-background:new 0 0 13.066 13.066;"
xml:space="preserve"
sodipodi:docname="donate.svg"
inkscape:version="0.92.3 (2405546, 2018-03-11)"><metadata
id="metadata47"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs45" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1680"
inkscape:window-height="997"
id="namedview43"
showgrid="false"
inkscape:zoom="18.062146"
inkscape:cx="6.6437288"
inkscape:cy="6.533"
inkscape:window-x="1680"
inkscape:window-y="25"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1" />
<g
id="g10"
style="fill:#d75a4a;fill-opacity:1">
<g
id="g8"
style="fill:#d75a4a;fill-opacity:1">
<g
id="g6"
style="fill:#d75a4a;fill-opacity:1">
<g
id="g4"
style="fill:#d75a4a;fill-opacity:1">
<path
style="fill:#d75a4a;fill-opacity:1"
d="M6.555,12.558c-0.098,0-0.195-0.034-0.273-0.103c-0.233-0.2-5.718-4.954-6.199-7.885 C-0.133,3.243,0.071,2.201,0.69,1.474C1.22,0.85,2.034,0.507,2.982,0.507c0.082,0,0.165,0.002,0.247,0.008 c0.058-0.003,0.115-0.004,0.172-0.004c1.048,0,2.343,0.461,3.109,2.421c0.43-1.196,1.311-2.417,3.328-2.417 c1.135,0,2.023,0.342,2.571,0.987c0.597,0.701,0.787,1.733,0.569,3.068c-0.479,2.929-5.918,7.684-6.149,7.884 C6.751,12.524,6.653,12.558,6.555,12.558z"
id="path2" />
</g>
</g>
</g>
</g>
<g
id="g12"
style="fill:#d75a4a;fill-opacity:1">
</g>
<g
id="g14"
style="fill:#d75a4a;fill-opacity:1">
</g>
<g
id="g16"
style="fill:#d75a4a;fill-opacity:1">
</g>
<g
id="g18"
style="fill:#d75a4a;fill-opacity:1">
</g>
<g
id="g20"
style="fill:#d75a4a;fill-opacity:1">
</g>
<g
id="g22"
style="fill:#d75a4a;fill-opacity:1">
</g>
<g
id="g24"
style="fill:#d75a4a;fill-opacity:1">
</g>
<g
id="g26"
style="fill:#d75a4a;fill-opacity:1">
</g>
<g
id="g28"
style="fill:#d75a4a;fill-opacity:1">
</g>
<g
id="g30"
style="fill:#d75a4a;fill-opacity:1">
</g>
<g
id="g32"
style="fill:#d75a4a;fill-opacity:1">
</g>
<g
id="g34"
style="fill:#d75a4a;fill-opacity:1">
</g>
<g
id="g36"
style="fill:#d75a4a;fill-opacity:1">
</g>
<g
id="g38"
style="fill:#d75a4a;fill-opacity:1">
</g>
<g
id="g40"
style="fill:#d75a4a;fill-opacity:1">
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -20,6 +20,7 @@ header {
border-bottom: solid #d3d3d3 1px;
display: flex;
position: relative;
padding: 8px;
}
.panel {
@ -76,6 +77,7 @@ footer {
font-size: 14px;
font-weight: 600;
padding-left: 0;
width: 100%;
}
.subheading {
@ -177,7 +179,8 @@ footer {
color: #339a6f;
}
#options-button-svg {
#options-button-svg,
#donate-button-svg {
background-size: cover;
width: 15px;
height: 15px;
@ -187,6 +190,10 @@ footer {
background-image: url("../../icons/settings-dark.svg");
}
#donate-button-svg {
background-image: url("../../icons/donate.svg");
}
#protection-toggle {
-moz-user-select: none;
cursor: pointer;

View File

@ -27,6 +27,10 @@
<img class="icon-logo" src="icon.svg" alt="Extension Icon">
<div class="heading">LocalCDN <sup id="version-label" class="label-version"></sup></div>
<div id="donate-button" class="button">
<div id="donate-button-svg"></div>
</div>
</header>
<section class="content">

View File

@ -39,18 +39,20 @@ popup._renderContents = function () {
popup._renderNonContextualContents = function () {
let versionLabelElement, counterElement, testingUtilityLinkElement, optionsButtonElement;
let versionLabelElement, counterElement, testingUtilityLinkElement, optionsButtonElement, donationButtonElement;
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');
versionLabelElement.innerText = popup._version;
counterElement.innerText = helpers.formatNumber(popup._amountInjected);
testingUtilityLinkElement.addEventListener('mouseup', popup._onTestingUtilityLinkClicked);
optionsButtonElement.addEventListener('mouseup', popup._onOptionsButtonClicked);
donationButtonElement.addEventListener('mouseup', popup._onDonationButtonClicked);
};
popup._renderContextualContents = function () {
@ -356,6 +358,20 @@ popup._onOptionsButtonClicked = function () {
return window.close();
};
popup._onDonationButtonClicked = function () {
if (event.button === 0 || event.button === 1) {
chrome.tabs.create({
'url': 'https://localcdn.de/donate/',
'active': (event.button === 0)
});
}
if (event.button === 0) {
window.close();
}
};
popup._onProtectionToggled = function () {
let bypassCache = (typeof browser === 'undefined');

View File

@ -24,6 +24,7 @@
<ul>
<li>Fixed: Encoding problem with some websites (maybe only temporary, because at the moment only 9 websites are affected)</li>
<li>Added: Twitter Bootstrap JS and CSS v4.5.0</li>
<li>Added: Donation button</li>
<li>Added: Material Design for Bootstrap (MDB) v4.18.0</li>
<li>Added: Tether v1.4.7</li>
</ul>