annotate core/modules/ckeditor/js/ckeditor.drupalimage.admin.js @ 2:5311817fb629

Theme updates
author Chris Cannam
date Tue, 10 Jul 2018 13:19:18 +0000
parents c75dbcec494b
children a9cd425dd02b
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@0 27 output += Drupal.t('Uploads enabled, max size: @size @dimensions', { '@size': maxFileSize, '@dimensions': maxDimensions });
Chris@0 28 if ($scheme.length) {
Chris@0 29 output += '<br />' + $scheme.attr('data-label');
Chris@0 30 }
Chris@0 31 return output;
Chris@0 32 });
Chris@0 33 }
Chris@0 34 };
Chris@0 35 })(jQuery, Drupal, drupalSettings);