This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
drupalcampbristol/web/modules/contrib/pathauto/pathauto.js
2017-05-22 15:12:47 +01:00

22 lines
617 B
JavaScript

(function ($) {
'use strict';
Drupal.behaviors.pathFieldsetSummaries = {
attach: function (context) {
$('fieldset.path-form', context).drupalSetSummary(function (context) {
var path = $('.form-item-path-alias input', context).val();
var automatic = $('.form-item-path-pathauto input', context).attr('checked');
if (automatic) {
return Drupal.t('Automatic alias');
}
else if (path) {
return Drupal.t('Alias: @alias', {'@alias': path});
}
else {
return Drupal.t('No alias');
}
});
}
};
})(jQuery);