Commit 3d4eb253 authored by paalj's avatar paalj

Merge branch '6.x-1.x' of git.drupal.org:project/h5p into 6.x-1.x

parents 974f4358 f295df08
......@@ -70,6 +70,17 @@ ns.File.prototype.appendTo = function ($wrapper) {
this.children = [group];
};
/**
* Sync copyright between all video files.
*
* @returns {undefined}
*/
ns.File.prototype.setCopyright = function (value) {
this.copyright = this.params.copyright = value;
};
/**
* Creates thumbnail HTML and actions.
*
......
......@@ -36,8 +36,15 @@ ns.Text.prototype.appendTo = function ($wrapper) {
if (value !== false) {
// Set param
that.value = value;
that.setValue(that.field, ns.htmlspecialchars(value));
if (H5P.trim(value) === '') {
// Avoid storing empty strings. (will be valid if field is optional)
delete that.value;
that.setValue(that.field);
}
else {
that.value = value;
that.setValue(that.field, ns.htmlspecialchars(value));
}
for (var i = 0; i < that.changeCallbacks.length; i++) {
that.changeCallbacks[i](value);
......@@ -98,4 +105,4 @@ ns.Text.prototype.remove = function () {
};
// Tell the editor what widget we are.
ns.widgets.text = ns.Text;
\ No newline at end of file
ns.widgets.text = ns.Text;
Markdown is supported
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