Files
old-ribica/front-ui/app/globals.js

28 lines
954 B
JavaScript
Raw Normal View History

2015-01-22 06:38:48 +01:00
module.exports = {
2015-02-16 21:36:14 +01:00
ApiUrl: '@@apiEndpoint',
DefaultPageSize: 24,
ItemGroupIdOfStartPage: "1",
2015-06-13 06:21:04 +02:00
ItemGroupIdOfEmptyCartPage: "1",
FormatCurrency: function(amount_s) {
2015-11-28 08:35:42 +01:00
var amount = parseFloat(amount_s);
return (amount.toFixed(2) + " KM")
},
FormatPercentage: function(amount_s) {
2015-11-28 08:35:42 +01:00
var amount = parseFloat(amount_s);
return (amount.toFixed(2) + "%")
},
2015-11-28 08:35:42 +01:00
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
}
2015-01-22 06:38:48 +01:00
};