Skip to content
content_types.js 1.71 KiB
Newer Older
Drupal.behaviors.contentTypes = {
  attach: function (context) {
    // Provide the vertical tab summaries.
    $context.find('fieldset#edit-submission').drupalSetSummary(function(context) {
      vals.push(Drupal.checkPlain($(context).find('#edit-title-label').val()) || Drupal.t('Requires a title'));
    $context.find('fieldset#edit-workflow').drupalSetSummary(function(context) {
      $(context).find("input[name^='node_options']:checked").parent().each(function() {
        vals.push(Drupal.checkPlain($(this).text()));
      });
      if (!$(context).find('#edit-node-options-status').is(':checked')) {
        vals.unshift(Drupal.t('Not published'));
      }
      return vals.join(', ');
    });
    $('fieldset#edit-language', context).drupalSetSummary(function(context) {
      var vals = [];

      vals.push($(".form-item-language-configuration-langcode select option:selected", context).text())

      $('input:checked', context).next('label').each(function() {
        vals.push(Drupal.checkPlain($(this).text()));
      });

      return vals.join(', ');
    });
    $context.find('fieldset#edit-display').drupalSetSummary(function(context) {
      var $context = $(context);
      $context.find('input:checked').next('label').each(function() {
        vals.push(Drupal.checkPlain($(this).text()));
      });
      if (!$context.find('#edit-node-submitted').is(':checked')) {
        vals.unshift(Drupal.t("Don't display post information"));
      }
      return vals.join(', ');
    });