@@ -990,12 +990,12 @@ var CommentManager = (function() {
990990 opacity :1 ,
991991 scale :1
992992 } ,
993- limit : 0
993+ limit : 0 ,
994+ seekTrigger : 2000
994995 } ;
995996 this . timeline = [ ] ;
996997 this . runline = [ ] ;
997998 this . position = 0 ;
998- this . limiter = 0 ;
999999
10001000 this . factory = null ;
10011001 this . filter = null ;
@@ -1111,7 +1111,9 @@ var CommentManager = (function() {
11111111
11121112 CommentManager . prototype . time = function ( time ) {
11131113 time = time - 1 ;
1114- if ( this . position >= this . timeline . length || Math . abs ( this . _lastPosition - time ) >= 2000 ) {
1114+ if ( this . position >= this . timeline . length ||
1115+ Math . abs ( this . _lastPosition - time ) >= this . options . seekTrigger ) {
1116+
11151117 this . seek ( time ) ;
11161118 this . _lastPosition = time ;
11171119 if ( this . timeline . length <= this . position ) {
@@ -1122,7 +1124,7 @@ var CommentManager = (function() {
11221124 }
11231125 for ( ; this . position < this . timeline . length ; this . position ++ ) {
11241126 if ( this . timeline [ this . position ] [ 'stime' ] <= time ) {
1125- if ( this . options . limit > 0 && this . runline . length > this . limiter ) {
1127+ if ( this . options . limit > 0 && this . runline . length >= this . options . limit ) {
11261128 continue ; // Skip comments but still move the position pointer
11271129 } else if ( this . validate ( this . timeline [ this . position ] ) ) {
11281130 this . send ( this . timeline [ this . position ] ) ;
@@ -1229,15 +1231,15 @@ var CommentManager = (function() {
12291231
12301232} ) ( ) ;
12311233
1232- /**
1234+ /**
12331235 * Comment Filters Module Simplified
12341236 * @license MIT
12351237 * @author Jim Chen
12361238 */
12371239var CommentFilter = ( function ( ) {
12381240
12391241 /**
1240- * Matches a rule against an input that could be the full or a subset of
1242+ * Matches a rule against an input that could be the full or a subset of
12411243 * the comment data.
12421244 *
12431245 * @param rule - rule object to match
@@ -1275,19 +1277,22 @@ var CommentFilter = (function () {
12751277 case '=' :
12761278 case 'eq' :
12771279 return rule . value ===
1278- ( ( typeof extracted === 'number' ) ?
1280+ ( ( typeof extracted === 'number' ) ?
12791281 extracted : extracted . toString ( ) ) ;
1280- case 'NOT' :
1282+ case '!' :
1283+ case 'not' :
12811284 return ! _match ( rule . value , extracted ) ;
1282- case 'AND' :
1285+ case '&&' :
1286+ case 'and' :
12831287 if ( Array . isArray ( rule . value ) ) {
12841288 return rule . value . every ( function ( r ) {
12851289 return _match ( r , extracted ) ;
12861290 } ) ;
12871291 } else {
12881292 return false ;
12891293 }
1290- case 'OR' :
1294+ case '||' :
1295+ case 'or' :
12911296 if ( Array . isArray ( rule . value ) ) {
12921297 return rule . value . some ( function ( r ) {
12931298 return _match ( r , extracted ) ;
@@ -1352,7 +1357,10 @@ var CommentFilter = (function () {
13521357 * @return boolean indicator of whether this commentData should be shown
13531358 */
13541359 CommentFilter . prototype . doValidate = function ( cmtData ) {
1355- if ( ( ! this . allowUnknownTypes ||
1360+ if ( ! cmtData . hasOwnProperty ( 'mode' ) ) {
1361+ return false ;
1362+ }
1363+ if ( ( ! this . allowUnknownTypes ||
13561364 cmtData . mode . toString ( ) in this . allowTypes ) &&
13571365 ! this . allowTypes [ cmtData . mode . toString ( ) ] ) {
13581366 return false ;
0 commit comments