pathauto.js 624 B

123456789101112131415161718192021
  1. (function ($) {
  2. 'use strict';
  3. Drupal.behaviors.pathFieldsetSummaries = {
  4. attach: function (context) {
  5. $(context).find('.path-form').drupalSetSummary(function (context) {
  6. var path = $('.js-form-item-path-0-alias input', context).val();
  7. var automatic = $('.js-form-item-path-0-pathauto input', context).prop('checked');
  8. if (automatic) {
  9. return Drupal.t('Automatic alias');
  10. }
  11. else if (path) {
  12. return Drupal.t('Alias: @alias', {'@alias': path});
  13. }
  14. else {
  15. return Drupal.t('No alias');
  16. }
  17. });
  18. }
  19. };
  20. })(jQuery);