content_types.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. (function ($) {
  2. Drupal.behaviors.contentTypes = {
  3. attach: function (context) {
  4. // Provide the vertical tab summaries.
  5. $('fieldset#edit-submission', context).drupalSetSummary(function(context) {
  6. var vals = [];
  7. vals.push(Drupal.checkPlain($('#edit-title-label', context).val()) || Drupal.t('Requires a title'));
  8. return vals.join(', ');
  9. });
  10. $('fieldset#edit-workflow', context).drupalSetSummary(function(context) {
  11. var vals = [];
  12. $("input[name^='node_options']:checked", context).parent().each(function() {
  13. vals.push(Drupal.checkPlain($(this).text()));
  14. });
  15. if (!$('#edit-node-options-status', context).is(':checked')) {
  16. vals.unshift(Drupal.t('Not published'));
  17. }
  18. return vals.join(', ');
  19. });
  20. $('fieldset#edit-display', context).drupalSetSummary(function(context) {
  21. var vals = [];
  22. $('input:checked', context).next('label').each(function() {
  23. vals.push(Drupal.checkPlain($(this).text()));
  24. });
  25. if (!$('#edit-node-submitted', context).is(':checked')) {
  26. vals.unshift(Drupal.t("Don't display post information"));
  27. }
  28. return vals.join(', ');
  29. });
  30. }
  31. };
  32. })(jQuery);