mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
ENHANCEMENT Using new URLSegmentFilter API in SiteTree->generateURLSegment(), allowing customisation of URL filtering and transliteration
This commit is contained in:
parent
f02f49c239
commit
55ad61e4c3
@ -139,5 +139,24 @@ Behaviour.register({
|
||||
Element.show('ParentID');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
'#Form_EditForm_URLSegment' : {
|
||||
onchange: function(e) {
|
||||
var $this = jQuery(this);
|
||||
|
||||
if(!$this.val()) return;
|
||||
|
||||
$this.attr('disabled', 'disabled').parents('.field:first').addClass('loading');
|
||||
var oldVal = $this.val();
|
||||
jQuery.get(
|
||||
$this.parents('form:first').attr('action') +
|
||||
'/field/URLSegment/suggest/?value=' + encodeURIComponent($this.val()),
|
||||
function(data) {
|
||||
$this.removeAttr('disabled').parents('.field:first').removeClass('loading');
|
||||
$this.val(decodeURIComponent(data.value));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue
Block a user