annotate core/modules/ckeditor/js/ckeditor.drupalimage.admin.js @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 129ea1e6d783
children
rev   line source
Chris@0 1 /**
Chris@0 2 * DO NOT EDIT THIS FILE.
Chris@0 3 * See the following change record for more information,
Chris@0 4 * https://www.drupal.org/node/2815083
Chris@0 5 * @preserve
Chris@0 6 **/
Chris@0 7
Chris@0 8 (function ($, Drupal, drupalSettings) {
Chris@0 9 Drupal.behaviors.ckeditorDrupalImageSettingsSummary = {
Chris@0 10 attach: function attach() {
Chris@0 11 $('[data-ckeditor-plugin-id="drupalimage"]').drupalSetSummary(function (context) {
Chris@0 12 var root = 'input[name="editor[settings][plugins][drupalimage][image_upload]';
Chris@0 13 var $status = $(root + '[status]"]');
Chris@0 14 var $maxFileSize = $(root + '[max_size]"]');
Chris@0 15 var $maxWidth = $(root + '[max_dimensions][width]"]');
Chris@0 16 var $maxHeight = $(root + '[max_dimensions][height]"]');
Chris@0 17 var $scheme = $(root + '[scheme]"]:checked');
Chris@0 18
Chris@0 19 var maxFileSize = $maxFileSize.val() ? $maxFileSize.val() : $maxFileSize.attr('placeholder');
Chris@0 20 var maxDimensions = $maxWidth.val() && $maxHeight.val() ? '(' + $maxWidth.val() + 'x' + $maxHeight.val() + ')' : '';
Chris@0 21
Chris@0 22 if (!$status.is(':checked')) {
Chris@0 23 return Drupal.t('Uploads disabled');
Chris@0 24 }
Chris@0 25
Chris@0 26 var output = '';
Chris@17 27 output += Drupal.t('Uploads enabled, max size: @size @dimensions', {
Chris@17 28 '@size': maxFileSize,
Chris@17 29 '@dimensions': maxDimensions
Chris@17 30 });
Chris@0 31 if ($scheme.length) {
Chris@0 32 output += '<br />' + $scheme.attr('data-label');
Chris@0 33 }
Chris@0 34 return output;
Chris@0 35 });
Chris@0 36 }
Chris@0 37 };
Chris@0 38 })(jQuery, Drupal, drupalSettings);