1
0
Fork 0
forked from 0x2620/oxjs

add new timeline and find input to video player

This commit is contained in:
rolux 2011-05-16 13:29:26 +02:00
commit ce33d3650a
6 changed files with 326 additions and 162 deletions

View file

@ -3864,11 +3864,12 @@ Ox.highlight <f> Highlight matches in a string
> Ox.highlight('foobar', 'foo', 'match')
'<span class="match">foo</span>bar'
@*/
// fixme: with regexp, special chars would have to be escaped
Ox.highlight = function(txt, str, classname) {
return txt.replace(
return str.length ? txt.replace(
new RegExp('(' + str + ')', 'ig'),
'<span class="' + classname + '">$1</span>'
);
) : txt;
};
/*@