1
0
Fork 0
forked from 0x2620/oxjs

less obscure Ox.map

This commit is contained in:
rolux 2012-05-22 16:29:37 +02:00
commit 12cf77cef5
21 changed files with 125 additions and 101 deletions

View file

@ -1175,14 +1175,27 @@ Ox.VideoPlayer = function(options, self) {
var results = [];
if (query.length) {
query = query.toLowerCase();
results = Ox.map(self.options.annotations, function(annotation) {
results = Ox.filter(self.options.annotations, function(annotation) {
return Ox.decodeHTML(Ox.stripTags(
annotation.text.toLowerCase()
)).indexOf(query) > -1 ? {
)).indexOf(query) > -1;
}).map(function(annotation) {
return {
id: annotation.id,
'in': annotation['in'],
out: annotation.out
} : null;
};
})
results = Ox.filter(self.options.annotations, function(annotation) {
return Ox.decodeHTML(Ox.stripTags(
annotation.text.toLowerCase()
)).indexOf(query) > -1;
}).map(function(annotation) {
return {
id: annotation.id,
'in': annotation['in'],
out: annotation.out
};
});
}
//Ox.print('FIND RESULTS:', results);