Compare commits

...

1 Commits

Author SHA1 Message Date
Thomas Marstrander b07143724c
HFP-2862 Fix download warning 2019-10-02 09:40:43 +02:00
2 changed files with 2 additions and 2 deletions

View File

@ -1253,7 +1253,7 @@ H5P.buildMetadataCopyrights = function (metadata) {
H5P.openReuseDialog = function ($element, contentData, library, instance, contentId) { H5P.openReuseDialog = function ($element, contentData, library, instance, contentId) {
let html = ''; let html = '';
if (contentData.displayOptions.export) { if (contentData.displayOptions.export) {
html += '<button type="button" class="h5p-big-button h5p-download-button"><div class="h5p-button-title">Download as an .h5p file</div><div class="h5p-button-description">.h5p files may be uploaded to any web-site where H5P content may be created.</div></button>'; html += '<a class="h5p-big-button h5p-download-button" href="' + contentData.exportUrl + '" download><div class="h5p-button-title">Download as an .h5p file</div><div class="h5p-button-description">.h5p files may be uploaded to any web-site where H5P content may be created.</div></a>';
} }
if (contentData.displayOptions.export && contentData.displayOptions.copy) { if (contentData.displayOptions.export && contentData.displayOptions.copy) {
html += '<div class="h5p-horizontal-line-text"><span>or</span></div>'; html += '<div class="h5p-horizontal-line-text"><span>or</span></div>';
@ -1270,7 +1270,6 @@ H5P.openReuseDialog = function ($element, contentData, library, instance, conten
e.stopPropagation(); e.stopPropagation();
}).appendTo($dialog.find('h2')); }).appendTo($dialog.find('h2'));
$dialog.find('.h5p-download-button').click(function () { $dialog.find('.h5p-download-button').click(function () {
window.location.href = contentData.exportUrl;
instance.triggerXAPI('downloaded'); instance.triggerXAPI('downloaded');
dialog.close(); dialog.close();
}); });

View File

@ -493,6 +493,7 @@ div.h5p-fullscreen {
.h5p-big-button:hover { .h5p-big-button:hover {
border: 1px solid #2747f7; border: 1px solid #2747f7;
background: #eff1fe; background: #eff1fe;
text-decoration: none;
} }
.h5p-big-button:active { .h5p-big-button:active {
border: 1px solid #dedede; border: 1px solid #dedede;