Commit 68caec6e authored by Julian Rother's avatar Julian Rother
Browse files

Auto-reload player page when SSO page is closed

parent e42d6a70
......@@ -421,9 +421,9 @@ def lecture(id):
if not checkperm(perms):
mode, text = permdescr(perms)
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':
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:
flash(text+'.')
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() {
})
});
$(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>
{% endblock %}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment