From a507d756b730f4597d24627151f8dd3d233024d1 Mon Sep 17 00:00:00 2001 From: Didier Lafforgue Date: Fri, 13 Apr 2012 18:08:53 +0200 Subject: [PATCH] repair the js slugify method --- app/assets/javascripts/locomotive/utils/core_ext.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/locomotive/utils/core_ext.js b/app/assets/javascripts/locomotive/utils/core_ext.js index c3e112cd..bededa0c 100644 --- a/app/assets/javascripts/locomotive/utils/core_ext.js +++ b/app/assets/javascripts/locomotive/utils/core_ext.js @@ -18,9 +18,9 @@ String.prototype.slugify = function(sep) { if (typeof sep == 'undefined') sep = '_'; - var alphaNumRegexp = new RegExp('[^\w\\' + sep + ']', 'g'); + var alphaNumRegexp = new RegExp('[^\\w\\' + sep + ']', 'g'); var avoidDuplicateRegexp = new RegExp('[\\' + sep + ']{2,}', 'g'); - return this.replace(/\s/g, sep).replace(alphaNumRegexp, '').replace(avoidDuplicateRegexp, sep).toLowerCase() + return this.replace(/\s/g, sep).replace(alphaNumRegexp, '').replace(avoidDuplicateRegexp, sep).toLowerCase(); } window.addParameterToURL = function(key, value, context) { // code from http://stackoverflow.com/questions/486896/adding-a-parameter-to-the-url-with-javascript