simple_sitemap.fieldsetSummaries.js 1.1 KB

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