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

DM-35535: Fix autoupdate for current pages #85

Merged
merged 2 commits into from
Jul 12, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/rubintv/static/js/refresh-current.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* global jQuery */

(function ($) {
setTimeout(function () {
setInterval(function () {
$('#refresher').load(window.location.href + ' #refresher')
}, 5000)
})(jQuery)
2 changes: 1 addition & 1 deletion src/rubintv/templates/current.jinja
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "single_event.jinja" %}
{% block footer_scripts %}
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type=text/javascript src="/rubintv/static/js/refresh-current.js"></script>
<script type=text/javascript src="/rubintv/static/js/refresh-current.js?v=1234"></script>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't affect present functionality, but I'd recommend a more automated approach to cache-busting, like a Jinja function or environment context that provides a dynamically calculated hash of the script file.

{% endblock footer_scripts %}