Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #228 from EsupPortail/drclockwork/hotfix_embed_int…
Browse files Browse the repository at this point in the history
…eractive_video

hotfix/enable force original video when share
  • Loading branch information
DrClockwork authored Jun 29, 2017
2 parents 872cb83 + e34e6a0 commit 1f9c22f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions pod_project/pods/templates/videos/video.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,13 @@
$('.checkbox').hide();
$('#icontent').load(function() {
$('#icontent').fadeIn('slow');
if ('{{request.GET.interactive}}' == 'false') {
$('#button_video_original').click();
}
});
$('#showinteractive').click();
$("label[for=integration_size]").hide();
$("label[for=autoplay").hide();
});
$(document).on('click', '#button_video_original', function() {
$('#icontent').hide();
Expand All @@ -134,6 +138,7 @@
$('.checkbox').show();
$('#showinteractive').click();
$("label[for=integration_size]").show();
$("label[for=autoplay").show();
});
$(document).on('click', '#button_video_interactive', function() {
$('#icontent').show();
Expand All @@ -145,6 +150,7 @@
$('.checkbox').hide();
$('#showinteractive').click();
$("label[for=integration_size]").hide();
$("label[for=autoplay").hide();
});
$(document).on('click', '#refresh-score', function() {
$.ajax({
Expand Down Expand Up @@ -183,13 +189,16 @@
str = str.replace(/(width=)\S+/, '$1' + '\"' + '620' +'\"');
str = str.replace(/(height=)\S+/, '$1' + '\"' + '400' +'\"');
str = str.replace('is_iframe=true', 'is_iframe=true&interactive=true');
$('#txtpartage').val('{% if request.is_secure %}https{% else %}http{% endif %}://{{ request.META.HTTP_HOST }}{% url 'video' slug=video.slug %}?interactive=true');
}
} else if (str.indexOf('interactive=true') > 0) {
str = str.replace(/(width=)\S+/, '$1' + '\"' + '640' +'\"');
str = str.replace(/(height=)\S+/, '$1' + '\"' + '360' +'\"');
str = str.replace('&interactive=true', '');
$('#txtpartage').val('{% if request.is_secure %}https{% else %}http{% endif %}://{{ request.META.HTTP_HOST }}{% url 'video' slug=video.slug %}?interactive=false');
}
$('#txtintegration').val(str);

});
{% endif %}
</script>
Expand Down
2 changes: 1 addition & 1 deletion pod_project/pods/templates/videos/video_interactive.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ <h3 itemprop="name" >
{{video.title}}
<small>
{% if interactive.h5p %}
{% if request.user == video.owner %}
{% if request.user == video.owner or request.user.is_superuser %}
<button type="submit" class="btn btn-default" id="button_delete_video" title="{% trans 'Delete the interactive part of this video' %}">
<span id="delete" class="glyphicon glyphicon-remove-sign"></span>
<span class="sr-only">{% trans 'Delete the interactive part of this video' %}</span>
Expand Down

0 comments on commit 1f9c22f

Please sign in to comment.