Patched to Drupal 8.4.8 level. See https://www.drupal.org/sa-core-2018-004 and patch...
[yaffs-website] / web / core / modules / ckeditor / js / ckeditor.drupalimage.admin.js
1 /**
2 * DO NOT EDIT THIS FILE.
3 * See the following change record for more information,
4 * https://www.drupal.org/node/2815083
5 * @preserve
6 **/
7
8 (function ($, Drupal, drupalSettings) {
9   Drupal.behaviors.ckeditorDrupalImageSettingsSummary = {
10     attach: function attach() {
11       $('[data-ckeditor-plugin-id="drupalimage"]').drupalSetSummary(function (context) {
12         var root = 'input[name="editor[settings][plugins][drupalimage][image_upload]';
13         var $status = $(root + '[status]"]');
14         var $maxFileSize = $(root + '[max_size]"]');
15         var $maxWidth = $(root + '[max_dimensions][width]"]');
16         var $maxHeight = $(root + '[max_dimensions][height]"]');
17         var $scheme = $(root + '[scheme]"]:checked');
18
19         var maxFileSize = $maxFileSize.val() ? $maxFileSize.val() : $maxFileSize.attr('placeholder');
20         var maxDimensions = $maxWidth.val() && $maxHeight.val() ? '(' + $maxWidth.val() + 'x' + $maxHeight.val() + ')' : '';
21
22         if (!$status.is(':checked')) {
23           return Drupal.t('Uploads disabled');
24         }
25
26         var output = '';
27         output += Drupal.t('Uploads enabled, max size: @size @dimensions', { '@size': maxFileSize, '@dimensions': maxDimensions });
28         if ($scheme.length) {
29           output += '<br />' + $scheme.attr('data-label');
30         }
31         return output;
32       });
33     }
34   };
35 })(jQuery, Drupal, drupalSettings);