Skip to content
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

Add Safari render warning for RSS feeds #168

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion subdomains/singlecell/templates/conclusion.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,35 @@ <h4 class="mb-3">Single Cell and Spatial Omics community support</h4>
<section>
<h4 class="mb-3">News and Events</h4>

<div class="row justify-content-center">
<div class="row justify-content-center" id="newsAndEvents">
<div class="col">
<iframe width="400px" height="600px" src="https://training.galaxyproject.org/training-material/topics/single-cell/feed.w.xml"></iframe>
</div>
<div class="col">
<iframe width="400px" height="600px" src="https://training.galaxyproject.org/training-material/feeds/single-cell-month.w.xml"></iframe>
</div>
</div>

<script>
// Function to detect Safari on Mac
function isSafari() {
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent) && /Mac/i.test(navigator.platform);
}

// Replace iframe with error text if on Safari
if (isSafari()) {
const newsDiv = $('#newsAndEvents');
if (newsDiv.length) {
const errorText = $(`<p class="alert alert-danger">
Sorry, this content cannot be displayed in Safari. Please use a different browser to see news and events feed, or add the
<a href="https://training.galaxyproject.org/training-material/topics/single-cell/feed.xml">RSS feed</a>
to your RSS reader.
</p>`);
newsDiv.children().remove();
newsDiv.append(errorText);
}
}
</script>
</section>

{% if feedback_email %}
Expand Down