Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
h5p-editor-php-library
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
h5p-editor-php-library
Commits
d02a8458
Unverified
Commit
d02a8458
authored
4 years ago
by
Thomas Marstrander
Browse files
Options
Downloads
Patches
Plain Diff
HFP-3008 Add content language to iframe
parent
f1d28974
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/h5peditor-editor.js
+14
-1
14 additions, 1 deletion
scripts/h5peditor-editor.js
with
14 additions
and
1 deletion
scripts/h5peditor-editor.js
+
14
−
1
View file @
d02a8458
...
@@ -6,7 +6,7 @@ window.ns = window.H5PEditor = window.H5PEditor || {};
...
@@ -6,7 +6,7 @@ window.ns = window.H5PEditor = window.H5PEditor || {};
*
*
* @class H5PEditor.Editor
* @class H5PEditor.Editor
* @param {string} library
* @param {string} library
* @param {
Object
} defaultParams
* @param {
string
} defaultParams
* @param {Element} replace
* @param {Element} replace
* @param {Function} iframeLoaded
* @param {Function} iframeLoaded
*/
*/
...
@@ -16,6 +16,14 @@ ns.Editor = function (library, defaultParams, replace, iframeLoaded) {
...
@@ -16,6 +16,14 @@ ns.Editor = function (library, defaultParams, replace, iframeLoaded) {
// Library may return "0", make sure this doesn't return true in checks
// Library may return "0", make sure this doesn't return true in checks
library
=
library
&&
library
!=
0
?
library
:
''
;
library
=
library
&&
library
!=
0
?
library
:
''
;
let
parsedParams
=
{};
try
{
parsedParams
=
JSON
.
parse
(
defaultParams
);
}
catch
(
e
)
{
// Ignore failed parses, this should be handled elsewhere
}
// Define iframe DOM Element through jQuery
// Define iframe DOM Element through jQuery
var
$iframe
=
ns
.
$
(
'
<iframe/>
'
,
{
var
$iframe
=
ns
.
$
(
'
<iframe/>
'
,
{
'
css
'
:
{
'
css
'
:
{
...
@@ -32,6 +40,11 @@ ns.Editor = function (library, defaultParams, replace, iframeLoaded) {
...
@@ -32,6 +40,11 @@ ns.Editor = function (library, defaultParams, replace, iframeLoaded) {
'
allowfullscreen
'
:
'
allowfullscreen
'
,
'
allowfullscreen
'
:
'
allowfullscreen
'
,
'
allow
'
:
"
fullscreen
"
'
allow
'
:
"
fullscreen
"
});
});
const
language
=
(
parsedParams
.
metadata
&&
parsedParams
.
metadata
.
defaultLanguage
)
?
parsedParams
.
metadata
.
defaultLanguage
:
ns
.
contentLanguage
;
$iframe
.
attr
(
'
lang
'
,
language
);
// The DOM element is often used directly
// The DOM element is often used directly
var
iframe
=
$iframe
.
get
(
0
);
var
iframe
=
$iframe
.
get
(
0
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment