This repository has been archived on 2025-06-21. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
suitedesk/modules/pathauto/pathauto.js

39 lines
1.3 KiB
JavaScript

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');
}
}
}