-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confirmation before connecting to youtube.com/youtu.be #4826
base: master
Are you sure you want to change the base?
Changes from all commits
a02b55b
f7e5a88
e851144
ecfb9fe
b240f91
01e9fa3
0fd38e5
effb642
42ac3c8
be1ed83
307e6f5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -43,4 +43,17 @@ module Invidious::Routes::Misc | |||||||||||||||||||||||||||
instance_url = fetch_random_instance | ||||||||||||||||||||||||||||
env.redirect "https://#{instance_url}#{referer}" | ||||||||||||||||||||||||||||
end | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
def self.confirm_leave(env) | ||||||||||||||||||||||||||||
locale = env.get("preferences").as(Preferences).locale | ||||||||||||||||||||||||||||
referer = get_referer(env) | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
if env.params.query["link"]? && !env.params.query["link"].empty? | ||||||||||||||||||||||||||||
link = HTML.escape(env.params.query["link"].to_s) | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
templated "confirm_leave" | ||||||||||||||||||||||||||||
else | ||||||||||||||||||||||||||||
env.redirect "#{referer}" | ||||||||||||||||||||||||||||
end | ||||||||||||||||||||||||||||
Comment on lines
+51
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A few small improvements:
Suggested change
|
||||||||||||||||||||||||||||
end | ||||||||||||||||||||||||||||
end |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,22 @@ | ||||||
<% content_for "header" do %> | ||||||
<title><%= translate(locale, "Leave") %> - Invidious</title> | ||||||
<% end %> | ||||||
|
||||||
<div class="h-box"> | ||||||
<h3><%= translate(locale, "You are leaving Invidious. Continue to external link?") %></h3> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need to add this line to "confirm_dialog_external_link": "You are leaving Invidious. Continue to external link?"
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See the suggestion I made above! You need to use |
||||||
|
||||||
<p><%= link %></p> | ||||||
|
||||||
<div class="pure-g"> | ||||||
<div class="pure-u-1-2"> | ||||||
<a rel="noreferrer noopener" value="confirm_leave" class="pure-button pure-button-primary" href="<%= link %>"> | ||||||
<%= translate(locale, "Yes") %> | ||||||
</a> | ||||||
</div> | ||||||
<div class="pure-u-1-2"> | ||||||
<a class="pure-button" href="<%= referer %>"> | ||||||
<%= translate(locale, "No") %> | ||||||
</a> | ||||||
</div> | ||||||
</div> | ||||||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why you added this here? Is it because you missed one link to replace, as mentioned here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was for replacing the links on comments with the confirmation page, such as when creators pin their own with links from Discord or Twitch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, okay, I see!