Skip to content

Commit

Permalink
trying to implement mastodon sharing button
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas2511 committed Dec 29, 2024
1 parent 2c9d51b commit f5043ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/helpers/frontend/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def oembed_api_event_url(event)
end

def mastodon_url(title, url)
'javascript:self.location.href("https://" + prompt("Please enter the domain of your mastodon instance, e.g. chaos.social") + "/share?url='.freeze + URI.encode_www_form_component(url) + '&text='.freeze + URI.encode_www_form_component(title)
'javascript:window.location.href = "https://" + prompt("Please enter the domain of your mastodon instance, e.g. chaos.social") + "/share?url='.freeze + URI.encode_www_form_component(url) + '&text='.freeze + URI.encode_www_form_component(title)
end

def facebook_url(title, url)
Expand Down

0 comments on commit f5043ba

Please sign in to comment.