From ce3c5a4a03a8cb6667aa71357eeb3a998a713e7a Mon Sep 17 00:00:00 2001 From: rolux Date: Sun, 3 Jun 2012 10:40:25 +0200 Subject: [PATCH] remove Ox.highlight --- source/Ox/js/String.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/source/Ox/js/String.js b/source/Ox/js/String.js index 98b34d08..a7cc6dd3 100644 --- a/source/Ox/js/String.js +++ b/source/Ox/js/String.js @@ -44,25 +44,11 @@ Ox.endsWith Checks if a string ends with a given substring true @*/ Ox.ends = Ox.endsWith = function(string, substring) { - // fixme: rename to ends string = string.toString(); substring = substring.toString(); return string.slice(string.length - substring.length) == substring; }; -/*@ -Ox.highlight Highlight matches in a string - > Ox.highlight('foobar', 'foo', 'match') - 'foobar' -@*/ -// fixme: with regexp, special chars have to be escaped -Ox.highlight = function(txt, str, classname) { - return str && str.length ? txt.replace( - new RegExp('(' + str + ')', 'ig'), - '$1' - ) : txt; -}; - /*@ Ox.isValidEmail Tests if a string is a valid e-mail address (str) -> True if the string is a valid e-mail address