update jQuery click handlers

This commit is contained in:
Paul Rodwell 2023-04-17 09:45:28 +01:00
parent f6dcb5425e
commit 1d4c5d51df
No known key found for this signature in database
GPG Key ID: 083BA337597C49E6
1 changed files with 4 additions and 4 deletions

View File

@ -59,7 +59,7 @@ update_footer = (ownerName, isAuthenticated) ->
logoutTitle = "Not Owner : Sign-out"
logoutIconClass = 'fa fa-lock fa-lg fa-fw notOwner'
$('footer > #security').append "<a href='#' id='logout' class='footer-item' title='#{logoutTitle}'><i class='#{logoutIconClass}'></i></a>"
$('footer > #security > #logout').click (e) ->
$('footer > #security > #logout').on 'click', (e) ->
e.preventDefault()
myInit = {
method: 'GET'
@ -79,14 +79,14 @@ update_footer = (ownerName, isAuthenticated) ->
# These probably should move into a menu, but this is far easier to begin with
if !isClaimed
$('footer > #security').append "<a href='#' id='claim' class='foot-item' title='Claim this Wiki'><i class='fa fa-key fa-lg fa-fw'></i></a>"
$('footer > #security > #claim').click (e) ->
$('footer > #security > #claim').on 'click', (e) ->
e.preventDefault()
claim_wiki()
else
# only offer to add alternative id if using persona - at least initially.
if settings.usingPersona
$('footer > #security').append "<a href='#' id='addAltAuth' class='foot-item' title='Add Alternative Credentials'><i class='fa fa-user-plus fa-lg fa-fw'></i></a>"
$('footer > #security > #addAltAuth').click (e) ->
$('footer > #security > #addAltAuth').on 'click', (e) ->
e.preventDefault
document.cookie = "wikiName=#{window.location.host}" + ";domain=.#{settings.cookieDomain}; path=/; max-age=300; sameSite=Strict;"
@ -135,7 +135,7 @@ update_footer = (ownerName, isAuthenticated) ->
else
signonTitle = 'Wiki Owner Sign-on'
$('footer > #security').append "<a href='#' id='show-security-dialog' class='footer-item' title='#{signonTitle}'><i class='fa fa-lock fa-lg fa-fw'></i></a>"
$('footer > #security > #show-security-dialog').click (e) ->
$('footer > #security > #show-security-dialog').on 'click', (e) ->
e.preventDefault()
document.cookie = "wikiName=#{window.location.host}" + ";domain=.#{settings.cookieDomain}; path=/; max-age=300; sameSite=Strict;"