Commit a8e37c5a authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge changes Ibc5652e2,Ib5adf627 into 16.10_STABLE

* changes:
  Bug 1715260: Keep tinymce fields on block config form error
  Bug 1694875: Annotation field validated via JS
parents fdc6390e edb60f89
......@@ -201,7 +201,10 @@ class PluginBlocktypeAnnotation extends MaharaCoreBlocktype {
'width' => '100%',
'height' => $height . 'px',
'defaultvalue' => $text,
'rules' => array('maxlength' => 65536),
'rules' => array(
'maxlength' => 65536,
'required' => true
),
),
'annotationreadonlymsg' => array(
'type' => 'html',
......@@ -455,7 +458,6 @@ class PluginBlocktypeAnnotation extends MaharaCoreBlocktype {
});
}
});
EOF;
}
}
......@@ -53,6 +53,7 @@ $string['makepublicrequestbyownermessage'] = '%s has requested that you make you
$string['makepublicrequestsent'] = 'A message has been sent to %s to request that the feedback be made public.';
$string['makepublicrequestbyauthormessage'] = '%s has requested that you make their feedback public.';
$string['annotationempty'] = 'This field is required.';
$string['annotationfeedbackempty'] = 'Your feedback is empty. Please enter a message.';
$string['newannotationfeedbacknotificationsubject'] = 'New feedback on %s';
......
......@@ -134,6 +134,13 @@
onModalCancel(e, configbutton);
});
}
// Restart any TinyMCE fields if needed
if (typeof tinyMCE !== 'undefined') {
jQuery(form).find('textarea.wysiwyg').each(function() {
tinyMCE.execCommand('mceAddEditor', false, $(this).prop('id'));
});
}
}
//Private Methods
......
......@@ -163,16 +163,25 @@ jQuery(function($) {
values[item.name] = item.value;
}
});
values['tags'] = tags.join();
values['framework'] = params.framework;
values['view'] = params.view;
values['option'] = params.option;
values['action'] = 'update';
if (hastinymce) {
tinyMCE.execCommand('mceRemoveEditor', false, "instconf_text");
if (values["text"].length == 0) {
if ($("#instconf_text").parent().find('.errmsg').length == 0) {
$("#instconf_text").parent().append('<div class="errmsg"><span>' + get_string_ajax('annotationempty', 'artefact.annotation') + '</span></div>');
}
$('#instconf button.submitcancel.submit').prop("disabled", false);
}
else {
values['tags'] = tags.join();
values['framework'] = params.framework;
values['view'] = params.view;
values['option'] = params.option;
values['action'] = 'update';
if (hastinymce) {
tinyMCE.execCommand('mceRemoveEditor', false, "instconf_text");
}
editmatrix_update(values);
hide_dock();
}
editmatrix_update(values);
hide_dock();
});
// When we are saving the annotation feedback form - changing the evidence status
$('#annotationfeedback').on('submit', function(se) {
......
Supports Markdown
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