forked from 0x2620/oxjs
less obscure Ox.map
This commit is contained in:
parent
33390069b9
commit
12cf77cef5
21 changed files with 125 additions and 101 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue