pathauto.js 617 B

123456789101112131415161718192021
  1. (function ($) {
  2. 'use strict';
  3. Drupal.behaviors.pathFieldsetSummaries = {
  4. attach: function (context) {
  5. $('fieldset.path-form', context).drupalSetSummary(function (context) {
  6. var path = $('.form-item-path-alias input', context).val();
  7. var automatic = $('.form-item-path-pathauto input', context).attr('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);