Created
July 7, 2015 09:42
-
-
Save ErnestasJa/91ddea478b501d30c4aa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fmt = function () { | |
var append = function(text,append){ | |
if($.isArray(text)) | |
for(var i = 0; i < text.length; i++) | |
text[i] = text[i] + append; | |
else | |
text = text + append; | |
return text; | |
}, | |
split = function (text, separator) { | |
if (!separator) separator="."; | |
text = text.split(separator); | |
for(var i = 0; i < text.length-1; i++) | |
text[i] = text[i]+ separator; | |
return text; | |
}, | |
warning = function (text,class) { | |
if(!class) class="red" | |
return '<span class="' + class + '">' + text + '</span>'; | |
}, | |
join = function (tokens){ | |
return tokens.join(""); | |
}; | |
return { | |
append: append, | |
split: split, | |
warning: warning, | |
join: join | |
}; | |
}(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment