date_popup_authored-node-form.js 891 B

123456789101112131415161718192021222324252627
  1. (function ($) {
  2. Drupal.behaviors.datePopupAuthoredFieldsetSummaries = {
  3. attach: function (context) {
  4. // Provide the vertical tab summaries.
  5. $('fieldset#edit-date-popup-authored', context).drupalSetSummary(function(context) {
  6. var vals = [];
  7. if ($('#edit-date-popup-authored-enabled', context).is(':checked')) {
  8. vals.unshift(Drupal.t('Enabled'));
  9. // Date format.
  10. var format = $('.form-item-date-popup-authored-format select option:selected', context).text();
  11. vals.push(Drupal.t('Date format: @format', {'@format': format}));
  12. // Date range.
  13. var range = $('#edit-date-popup-authored-year-range', context).val();
  14. vals.push(Drupal.t('Display ±@range years', {'@range': range}));
  15. }
  16. else {
  17. vals.unshift(Drupal.t('Disabled'));
  18. }
  19. return vals.join(', ');
  20. });
  21. }
  22. };
  23. })(jQuery);