3 * CKEditor 'drupalimage' plugin admin behavior.
6 (function($, Drupal, drupalSettings) {
8 * Provides the summary for the "drupalimage" plugin settings vertical tab.
10 * @type {Drupal~behavior}
12 * @prop {Drupal~behaviorAttach} attach
13 * Attaches summary behaviour to the "drupalimage" settings vertical tab.
15 Drupal.behaviors.ckeditorDrupalImageSettingsSummary = {
17 $('[data-ckeditor-plugin-id="drupalimage"]').drupalSetSummary(context => {
19 'input[name="editor[settings][plugins][drupalimage][image_upload]';
20 const $status = $(`${root}[status]"]`);
21 const $maxFileSize = $(`${root}[max_size]"]`);
22 const $maxWidth = $(`${root}[max_dimensions][width]"]`);
23 const $maxHeight = $(`${root}[max_dimensions][height]"]`);
24 const $scheme = $(`${root}[scheme]"]:checked`);
26 const maxFileSize = $maxFileSize.val()
28 : $maxFileSize.attr('placeholder');
30 $maxWidth.val() && $maxHeight.val()
31 ? `(${$maxWidth.val()}x${$maxHeight.val()})`
34 if (!$status.is(':checked')) {
35 return Drupal.t('Uploads disabled');
39 output += Drupal.t('Uploads enabled, max size: @size @dimensions', {
41 '@dimensions': maxDimensions,
44 output += `<br />${$scheme.attr('data-label')}`;
50 })(jQuery, Drupal, drupalSettings);