File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments