Added function to underscore convert strings.

This commit is contained in:
Thorsten Eckel 2015-08-05 09:28:47 +02:00
parent 89e83717f0
commit f2b1dd2f26

View file

@ -203,6 +203,11 @@ function clone2(item) {
return result; return result;
} }
// taken from https://github.com/epeli/underscore.string/blob/master/underscored.js
function underscored (str) {
return str.trim().replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/[-\s]+/g, '_').toLowerCase();
}
jQuery.event.special.remove = { jQuery.event.special.remove = {
remove: function(e) { remove: function(e) {
if (e.handler) e.handler(); if (e.handler) e.handler();