Skip to content
Snippets Groups Projects
Commit 68caec6e authored by Julian Rother's avatar Julian Rother
Browse files

Auto-reload player page when SSO page is closed

parent e42d6a70
No related branches found
No related tags found
No related merge requests found
...@@ -421,9 +421,9 @@ def lecture(id): ...@@ -421,9 +421,9 @@ def lecture(id):
if not checkperm(perms): if not checkperm(perms):
mode, text = permdescr(perms) mode, text = permdescr(perms)
if mode == 'rwth': if mode == 'rwth':
flash(text+'. <a target="_blank" href="'+url_for('start_rwthauth')+'">Hier authorisieren</a>.') flash(text+'. <a target="_blank" class="reloadonclose" href="'+url_for('start_rwthauth')+'">Hier authorisieren</a>.')
elif mode == 'l2p': elif mode == 'l2p':
flash(text+'. <a target="_blank" href="'+url_for('start_l2pauth')+'">Hier authorisieren</a>.') flash(text+'. <a target="_blank" class="reloadonclose" href="'+url_for('start_l2pauth')+'">Hier authorisieren</a>.')
else: else:
flash(text+'.') flash(text+'.')
return render_template('embed.html' if request.endpoint == 'embed' else 'lecture.html', course=courses[0], lecture=lecture, videos=videos, chapters=chapters) return render_template('embed.html' if request.endpoint == 'embed' else 'lecture.html', course=courses[0], lecture=lecture, videos=videos, chapters=chapters)
......
...@@ -98,5 +98,19 @@ $(function() { ...@@ -98,5 +98,19 @@ $(function() {
}) })
}); });
$(document).ready(function() {
$("a.reloadonclose").click(function () {
var popup = window.open(this.href, this.target);
if (!popup)
return true;
var popup_check = setInterval(function() {
if (popup.closed) {
clearInterval(popup_check);
location.reload();
};
}, 500);
return false;
});
});
</script> </script>
{% endblock %} {% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment