Skip to content

Commit a052e93

Browse files
authored
Update sitemaplinks.html
1 parent d9d79e1 commit a052e93

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

sitemaplinks.html

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,33 @@
4848
</div>
4949
</nav>
5050
</head>
51-
<body><a href="/sitemaplinks?action=edit"><img src="images.png" class="edit"></a></img>
51+
<body><img src="images.png" alt="Edit Image" id="editImage" style="height: 20px; width: 20px;">
52+
53+
<script>
54+
// Function to check if the user is logged in and if action=edit is set
55+
function handleImageClick() {
56+
const isLoggedIn = localStorage.getItem('loggedIn'); // Example: A "loggedIn" flag in localStorage
57+
const urlParams = new URLSearchParams(window.location.search);
58+
const action = urlParams.get('action');
59+
60+
if (isLoggedIn === 'true') { // Assuming you set this when the user logs in
61+
if (action === 'edit') {
62+
console.log('Edit action detected and user is logged in!');
63+
alert('You are in edit mode!');
64+
} else {
65+
console.log('No edit action found.');
66+
alert('No edit action specified.');
67+
}
68+
} else {
69+
console.log('User not logged in — edit action ignored.');
70+
alert('You must be logged in to edit.');
71+
}
72+
}
73+
74+
// Add click event listener to the image
75+
const editImage = document.getElementById('editImage');
76+
editImage.addEventListener('click', handleImageClick);
77+
</script>
5278
<h1><center><b>Wiki | FAQ | More Links</b></center></h1><a href="/sitemaplinks?action=edit"><img src="images.png"></a></img>
5379
<h2>Sorry but this page is still in progress and is Coming Soon</h2>
5480

0 commit comments

Comments
 (0)