X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Flinkchecker%2Fjs%2Flinkchecker.content_types.js;fp=web%2Fmodules%2Fcontrib%2Flinkchecker%2Fjs%2Flinkchecker.content_types.js;h=abc961c3de77067f6a182e7a1a3fe506d3ec4dfe;hp=0000000000000000000000000000000000000000;hb=8acec36f19c470dfcda1ae2336826a782f41874c;hpb=e0411c4e83ba0d079034db83c3f7f55be24a0e35 diff --git a/web/modules/contrib/linkchecker/js/linkchecker.content_types.js b/web/modules/contrib/linkchecker/js/linkchecker.content_types.js new file mode 100644 index 000000000..abc961c3d --- /dev/null +++ b/web/modules/contrib/linkchecker/js/linkchecker.content_types.js @@ -0,0 +1,36 @@ +/** + * @file + * Javascript for the node content type editing form. + */ + +(function ($, Drupal) { + + 'use strict'; + + /** + * Behaviors for setting summaries on content type form. + * + * @type {Drupal~behavior} + * + * @prop {Drupal~behaviorAttach} attach + * Attaches summary behaviors on content type edit forms. + */ + Drupal.behaviors.linkcheckerContentTypes = { + attach: function (context) { + var $context = $(context); + // Provide the vertical tab summaries. + $context.find('#edit-linkchecker').drupalSetSummary(function (context) { + var vals = []; + var $editContext = $(context); + $editContext.find('input:checked').next('label').each(function () { + vals.push(Drupal.checkPlain($(this).text())); + }); + if (!vals.length) { + return Drupal.t('Disabled'); + } + return vals.join(', '); + }); + } + }; + +})(jQuery, Drupal);