1
0
Fork 0
forked from 0x2620/oxjs

fix issues with automatically opening annotation folders; add annotations option to video player to make find work for all layers

This commit is contained in:
rlx 2012-02-19 10:49:52 +00:00
commit 94cfbdb45c
7 changed files with 108 additions and 30 deletions

View file

@ -75,7 +75,9 @@ Ox.highlightHTML <f> Highlight matches in an HTML string
> Ox.highlightHTML('AT&amp;T', 'amp', 'h')
'AT&amp;T'
> Ox.highlightHTML('a &lt;b&gt; c', '<b>', 'h')
'<span class="h">a <span class="h">&lt;b&gt;</span> c'
'a <span class="h">&lt;b&gt;</span> c'
> Ox.highlightHTML('a <br> c', 'b', 'h')
'a <br> c'
@*/
Ox.highlightHTML = function(html, str, classname, tags) {
var count = 0,
@ -83,7 +85,19 @@ Ox.highlightHTML = function(html, str, classname, tags) {
isTag = false,
position,
positions = [];
tags = Ox.merge(tags || [], ['a', 'b', 'code', 'i', 's', 'sub', 'sup', 'u']);
//fixme: default tags should be same as in parseHTML
tags = Ox.merge(tags || [], [
// inline formatting
'b', 'code', 'i', 's', 'sub', 'sup', 'u',
// block formatting
'blockquote', 'h1', 'h2', 'h3', 'p', 'pre',
// lists
'li', 'ol', 'ul',
// tables
'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr',
// other
'a', 'br', 'img',
]);
str = Ox.encodeHTML(str).toLowerCase();
Ox.forEach(html.toLowerCase(), function(chr, i) {
// check for entity or tag start