Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

Commit

Permalink
fix size of video when in iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
DrClockwork committed Jun 13, 2017
1 parent dc97020 commit 738c1bb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
9 changes: 9 additions & 0 deletions h5pp/h5p/h5pmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"styles/h5p-core-button.css"
]

OVERRIDE_STYLES = '/static/h5p/styles/h5pp.css'

SCRIPTS = [
"js/jquery.js",
"js/h5p.js",
Expand Down Expand Up @@ -334,6 +336,7 @@ def h5pAddFilesAndSettings(request, embedType):
assets = h5pAddCoreAssets()

if not 'json_content' in request.GET or not 'contentId' in request.GET:
print("passe")
return integration

content = h5pGetContent(request)
Expand Down Expand Up @@ -366,6 +369,10 @@ def h5pAddFilesAndSettings(request, embedType):
filesAssets['css'].append(
settings.MEDIA_URL + 'h5pp/' + style['path'])
integration['loadedCss'] = url
#Override CSS
filesAssets['css'].append(OVERRIDE_STYLES)
integration['loadedCss'] = OVERRIDE_STYLES

elif embedType == 'iframe':
h5pAddIframeAssets(request, integration, content['id'], files)

Expand Down Expand Up @@ -520,6 +527,8 @@ def h5pAddIframeAssets(request, integration, contentId, files):
else:
integration['contents'][
'cid-' + contentId]['styles'] = core.getAssetsUrls(files['styles'])
#Override Css
integration['contents']['cid-' + contentId]['styles'].append(OVERRIDE_STYLES)

if writable:
if not os.path.exists(os.path.join(settings.H5P_PATH, 'files')):
Expand Down
7 changes: 6 additions & 1 deletion h5pp/static/h5p/styles/h5pp.css
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ label[for='id_title'] {
padding: 0;
}

/* bootstrap overide */
/* bootstrap override */
.btn:focus, .btn:active {
outline-color: #25AA2E !important;
}
Expand All @@ -187,4 +187,9 @@ label[for='id_title'] {
}
.navbar .navbar-brand:hover {
color: #3ab242;
}

/* h5p override */
.h5p-interactive-video .h5p-video {
height: 500px !important;
}
1 change: 0 additions & 1 deletion h5pp/templates/h5p/content.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
{% if request.GET.is_iframe %}
.content {
padding: 0px !important;
max-width: 900px !important;
}
{% endif %}
</style>
Expand Down

0 comments on commit 738c1bb

Please sign in to comment.