Merge branch 'master' of https://github.com/benemery/wagtail into benemery-master

pull/195/head
Matt Westcott 2014-04-08 17:11:44 +01:00
commit b22d9755f6
1 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -239,8 +239,8 @@ function InlinePanel(opts) {
return self;
}
function cleanForSlug(val){
if(URLify != undefined) { // Check to be sure that URLify function exists
function cleanForSlug(val, useURLify){
if(URLify != undefined && useURLify !== false) { // Check to be sure that URLify function exists, and that we want to use it.
return URLify(val, val.length);
} else { // If not just do the "replace"
return val.replace(/\s/g,"-").replace(/[^A-Za-z0-9\-]/g,"").toLowerCase();
@ -262,7 +262,8 @@ function initSlugAutoPopulate(){
function initSlugCleaning(){
$('#id_slug').blur(function(){
$(this).val(cleanForSlug($(this).val()));
// if a user has just set the slug themselves, don't remove stop words etc, just illegal characters
$(this).val(cleanForSlug($(this).val(), false));
});
}