remove duplicate discord invite as it is already there without a modal
This commit is contained in:
parent
f9eb71d4ad
commit
9a52c12043
12
index.html
12
index.html
@ -160,18 +160,6 @@
|
||||
<button class="eaglerrinth-mod-list">EaglerRinth Mod List</button>
|
||||
</a>
|
||||
</footer>
|
||||
<div id="joinModal" class="modal">
|
||||
<div class="modal-content">
|
||||
<h2>Join Our Discord Server!</h2>
|
||||
<p>Join for voting, bug reports, suggestions, help, etc.</p>
|
||||
<button onclick="openCopyModal()">Yes</button>
|
||||
<button class="cancel-btn" onclick="closeModal()">Cancel</button>
|
||||
<div style="margin-top: 20px;">
|
||||
<input type="checkbox" id="dontShowCheckbox">
|
||||
<label for="dontShowCheckbox">Don't show again</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="copyModal" class="modal">
|
||||
<div class="modal-content">
|
||||
<h2>Copy Discord Link</h2>
|
||||
|
37
js/popup.js
37
js/popup.js
@ -1,37 +0,0 @@
|
||||
import { selectId, pushStyles } from "./helperFunctions.js";
|
||||
|
||||
window.onload = function() {
|
||||
if (!localStorage.getItem('dontShowPopup')) {
|
||||
pushStyles(selectId('joinModal'), { display: 'flex' });
|
||||
}
|
||||
}
|
||||
|
||||
function openModal() {
|
||||
pushStyles(selectId('joinModal'), { display: 'flex' });
|
||||
}
|
||||
|
||||
function openCopyModal() {
|
||||
if (selectId('joinModal').style.display === 'flex') {
|
||||
pushStyles(selectId('joinModal'), { display: 'none' });
|
||||
}
|
||||
pushStyles(selectId('copyModal'), { display: 'flex' });
|
||||
if (selectId('dontShowCheckbox').checked) {
|
||||
localStorage.setItem('dontShowPopup', true);
|
||||
}
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
pushStyles(selectId('copyModal'), { display: 'none' });
|
||||
if (document.getElementById('dontShowCheckbox').checked) {
|
||||
localStorage.setItem('dontShowPopup', true);
|
||||
}
|
||||
}
|
||||
|
||||
function copyLink() {
|
||||
const copyText = selectId('discordLink').textContent;
|
||||
navigator.clipboard.writeText(copyText).then(function() {
|
||||
alert("Discord link copied to clipboard!");
|
||||
}, function() {
|
||||
alert("Failed to copy the link.");
|
||||
});
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user