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:
parent
6338498da5
commit
56fdc9a360
33 changed files with 4999 additions and 940 deletions
|
|
@ -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;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue