1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2026-03-16 15:45:45 +01:00

Implemented requirejs modules

This commit is contained in:
Max Guglielmi 2014-10-26 21:48:13 +11:00
commit 56fdc9a360
33 changed files with 4999 additions and 940 deletions

View file

@ -2,31 +2,31 @@
* String utilities
*/
(function(window, TF){
define(function () {
'use strict';
TF.Str = {};
var Str = {};
TF.Str.lower = function(text){
Str.lower = function(text){
return text.toLowerCase();
};
TF.Str.upper = function(text){
Str.upper = function(text){
return text.toUpperCase();
};
TF.Str.trim = function(text){
Str.trim = function(text){
if (text.trim){
return text.trim();
}
return text.replace(/^\s*|\s*$/g, '');
};
TF.Str.isEmpty = function(text){
Str.isEmpty = function(text){
return this.trim(text) === '';
};
TF.Str.rgxEsc = function(text){
Str.rgxEsc = function(text){
function escape(e){
var a = new RegExp('\\'+e,'g');
text = text.replace(a,'\\'+e);
@ -39,11 +39,12 @@
return text;
};
TF.Str.matchCase = function(text, mc){
Str.matchCase = function(text, mc){
if(!mc){
return this.lower(text);
}
return text;
};
})(this, this.TF);
return Str;
});