a64f3745606e829752bd9373eae348888b208c5a
[yaffs-website] / web / modules / contrib / simple_sitemap / js / simple_sitemap.fieldsetSummaries.js
1 /**
2  * @file
3  * Attaches simple_sitemap behaviors to the entity form.
4  */
5 (function($) {
6
7   "use strict";
8
9   Drupal.behaviors.simple_sitemapFieldsetSummaries = {
10     attach: function(context) {
11       $(context).find('#edit-simple-sitemap').drupalSetSummary(function(context) {
12         var vals = [];
13         if ($(context).find('#edit-simple-sitemap-index-content-1').is(':checked')) {
14           vals.push(Drupal.t('Included in sitemap'));
15           vals.push(Drupal.t('Priority') + ': ' + $('#edit-simple-sitemap-priority option:selected', context).text());
16           vals.push(Drupal.t('Change frequency') + ': ' + $('#edit-simple-sitemap-changefreq option:selected', context).text());
17           vals.push(Drupal.t('Include images') + ': ' + $('#edit-simple-sitemap-include-images option:selected', context).text());
18         }
19         else {
20           vals.push(Drupal.t('Excluded from sitemap'));
21         }
22         return vals.join('<br />');
23       });
24     }
25   };
26 })(jQuery);