changed slugs to be nicer
This commit is contained in:
@@ -4,12 +4,24 @@ module.exports = {
|
||||
ItemGroupIdOfStartPage: "1",
|
||||
ItemGroupIdOfEmptyCartPage: "1",
|
||||
FormatCurrency: function(amount_s) {
|
||||
var amount = parseFloat(amount_s);
|
||||
return ( amount.toFixed(2) + " KM" )
|
||||
var amount = parseFloat(amount_s);
|
||||
return (amount.toFixed(2) + " KM")
|
||||
},
|
||||
FormatPercentage: function(amount_s) {
|
||||
var amount = parseFloat(amount_s);
|
||||
return ( amount.toFixed(2) + "%" )
|
||||
var amount = parseFloat(amount_s);
|
||||
return (amount.toFixed(2) + "%")
|
||||
},
|
||||
MaxNumberOfItemsToBeAdded: 1000
|
||||
MaxNumberOfItemsToBeAdded: 1000,
|
||||
|
||||
Slugify: function(text) {
|
||||
return text.toString().toLowerCase()
|
||||
.replace(/š/g,'s')
|
||||
.replace(/[čć]/g,'c')
|
||||
.replace(/[ž]/g,'z')
|
||||
.replace(/\s+/g, '-') // Replace spaces with -
|
||||
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
|
||||
.replace(/\-\-+/g, '-') // Replace multiple - with single -
|
||||
.replace(/^-+/, '') // Trim - from start of text
|
||||
.replace(/-+$/, ''); // Trim - from end of text
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user