New module 'Pathauto'

This commit is contained in:
Manuel Cillero 2017-07-26 11:10:32 +02:00
parent 3563734b2c
commit 0197478295
17 changed files with 5146 additions and 0 deletions

View file

@ -0,0 +1,39 @@
if (Drupal.jsEnabled) {
$(document).ready(function() {
if ($("#edit-pathauto-perform-alias").size() && $("#edit-pathauto-perform-alias").attr("checked")) {
// Disable input and hide its description.
$("#edit-path").attr("disabled","disabled");
$("#edit-path-wrapper > div.description").hide(0);
}
$("#edit-pathauto-perform-alias").bind("click", function() {
if ($("#edit-pathauto-perform-alias").attr("checked")) {
// Auto-alias checked; disable input.
$("#edit-path").attr("disabled","disabled");
$("#edit-path-wrapper > div[class=description]").slideUp('fast');
}
else {
// Auto-alias unchecked; enable input.
$("#edit-path").removeAttr("disabled");
$("#edit-path")[0].focus();
$("#edit-path-wrapper > div[class=description]").slideDown('fast');
}
});
});
Drupal.verticalTabs = Drupal.verticalTabs || {};
Drupal.verticalTabs.path = function() {
var path = $('#edit-path').val();
var automatic = $('#edit-pathauto-perform-alias').attr('checked');
if (automatic) {
return Drupal.t('Automatic alias');
}
if (path) {
return Drupal.t('Alias: @alias', { '@alias': path });
}
else {
return Drupal.t('No alias');
}
}
}