@@ -578,6 +578,8 @@ var CoreComment = (function () {
578578 return ;
579579 }
580580 } ;
581+ CoreComment . prototype . stop = function ( ) {
582+ } ;
581583 CoreComment . prototype . finish = function ( ) {
582584 this . parent . finish ( this ) ;
583585 } ;
@@ -620,10 +622,108 @@ var ScrollComment = (function (_super) {
620622 return ScrollComment ;
621623} ( CoreComment ) ) ;
622624//# sourceMappingURL=Comment.js.map
625+ var __extends = ( this && this . __extends ) || ( function ( ) {
626+ var extendStatics = Object . setPrototypeOf ||
627+ ( { __proto__ : [ ] } instanceof Array && function ( d , b ) { d . __proto__ = b ; } ) ||
628+ function ( d , b ) { for ( var p in b ) if ( b . hasOwnProperty ( p ) ) d [ p ] = b [ p ] ; } ;
629+ return function ( d , b ) {
630+ extendStatics ( d , b ) ;
631+ function __ ( ) { this . constructor = d ; }
632+ d . prototype = b === null ? Object . create ( b ) : ( __ . prototype = b . prototype , new __ ( ) ) ;
633+ } ;
634+ } ) ( ) ;
635+ var CssCompatLayer = ( function ( ) {
636+ function CssCompatLayer ( ) {
637+ }
638+ CssCompatLayer . transform = function ( dom , trans ) {
639+ dom . style . transform = trans ;
640+ dom . style [ "webkitTransform" ] = trans ;
641+ dom . style [ "msTransform" ] = trans ;
642+ dom . style [ "oTransform" ] = trans ;
643+ } ;
644+ return CssCompatLayer ;
645+ } ( ) ) ;
646+ var CssScrollComment = ( function ( _super ) {
647+ __extends ( CssScrollComment , _super ) ;
648+ function CssScrollComment ( ) {
649+ var _this = _super !== null && _super . apply ( this , arguments ) || this ;
650+ _this . _dirtyCSS = true ;
651+ return _this ;
652+ }
653+ Object . defineProperty ( CssScrollComment . prototype , "x" , {
654+ get : function ( ) {
655+ return ( this . ttl / this . dur ) * ( this . parent . width + this . width ) - this . width ;
656+ } ,
657+ set : function ( x ) {
658+ if ( typeof this . _x === "number" ) {
659+ var dx = x - this . _x ;
660+ this . _x = x ;
661+ CssCompatLayer . transform ( this . dom , "translateX(" + dx + "px)" ) ;
662+ }
663+ else {
664+ this . _x = x ;
665+ if ( ! this . absolute ) {
666+ this . _x *= this . parent . width ;
667+ }
668+ if ( this . align % 2 === 0 ) {
669+ this . dom . style . left = this . _x + "px" ;
670+ }
671+ else {
672+ this . dom . style . right = this . _x + "px" ;
673+ }
674+ }
675+ } ,
676+ enumerable : true ,
677+ configurable : true
678+ } ) ;
679+ CssScrollComment . prototype . update = function ( ) {
680+ if ( this . _dirtyCSS ) {
681+ this . dom . style . transition = "transform " + this . ttl + "ms linear" ;
682+ this . x = - this . width ;
683+ this . _dirtyCSS = false ;
684+ }
685+ } ;
686+ CssScrollComment . prototype . invalidate = function ( ) {
687+ _super . prototype . invalidate . call ( this ) ;
688+ this . _dirtyCSS = true ;
689+ } ;
690+ CssScrollComment . prototype . stop = function ( ) {
691+ this . dom . style . transition = "" ;
692+ this . x = this . _x ;
693+ this . _x = null ;
694+ this . x = ( this . ttl / this . dur ) * ( this . parent . width + this . width ) - this . width ;
695+ this . _dirtyCSS = true ;
696+ } ;
697+ return CssScrollComment ;
698+ } ( ScrollComment ) ) ;
699+ //# sourceMappingURL=CssComment.js.map
623700var CommentFactory = ( function ( ) {
624701 function CommentFactory ( ) {
625702 this . _bindings = { } ;
626703 }
704+ CommentFactory . _simpleCssScrollingInitializer = function ( manager , data ) {
705+ var cmt = new CssScrollComment ( manager , data ) ;
706+ switch ( cmt . mode ) {
707+ case 1 : {
708+ cmt . align = 0 ;
709+ cmt . axis = 0 ;
710+ break ;
711+ }
712+ case 2 : {
713+ cmt . align = 2 ;
714+ cmt . axis = 2 ;
715+ break ;
716+ }
717+ case 6 : {
718+ cmt . align = 1 ;
719+ cmt . axis = 1 ;
720+ break ;
721+ }
722+ }
723+ cmt . init ( ) ;
724+ manager . stage . appendChild ( cmt . dom ) ;
725+ return cmt ;
726+ } ;
627727 CommentFactory . _simpleScrollingInitializer = function ( manager , data ) {
628728 var cmt = new ScrollComment ( manager , data ) ;
629729 switch ( cmt . mode ) {
@@ -647,7 +747,6 @@ var CommentFactory = (function () {
647747 manager . stage . appendChild ( cmt . dom ) ;
648748 return cmt ;
649749 } ;
650- ;
651750 CommentFactory . _simpleAnchoredInitializer = function ( manager , data ) {
652751 var cmt = new CoreComment ( manager , data ) ;
653752 switch ( cmt . mode ) {
@@ -674,7 +773,6 @@ var CommentFactory = (function () {
674773 manager . stage . appendChild ( cmt . dom ) ;
675774 return cmt ;
676775 } ;
677- ;
678776 CommentFactory . defaultFactory = function ( ) {
679777 var factory = new CommentFactory ( ) ;
680778 factory . bind ( 1 , CommentFactory . _simpleScrollingInitializer ) ;
@@ -686,6 +784,17 @@ var CommentFactory = (function () {
686784 factory . bind ( 17 , CommentFactory . _advancedCoreInitializer ) ;
687785 return factory ;
688786 } ;
787+ CommentFactory . defaultCssRenderFactory = function ( ) {
788+ var factory = new CommentFactory ( ) ;
789+ factory . bind ( 1 , CommentFactory . _simpleCssScrollingInitializer ) ;
790+ factory . bind ( 2 , CommentFactory . _simpleCssScrollingInitializer ) ;
791+ factory . bind ( 6 , CommentFactory . _simpleCssScrollingInitializer ) ;
792+ factory . bind ( 4 , CommentFactory . _simpleAnchoredInitializer ) ;
793+ factory . bind ( 5 , CommentFactory . _simpleAnchoredInitializer ) ;
794+ factory . bind ( 7 , CommentFactory . _advancedCoreInitializer ) ;
795+ factory . bind ( 17 , CommentFactory . _advancedCoreInitializer ) ;
796+ return factory ;
797+ } ;
689798 CommentFactory . prototype . bind = function ( mode , factory ) {
690799 this . _bindings [ mode ] = factory ;
691800 } ;
@@ -926,6 +1035,8 @@ var CommentManager = (function() {
9261035 /** Public **/
9271036 CommentManager . prototype . stop = function ( ) {
9281037 this . stopTimer ( ) ;
1038+ // Send stop signal to all comments
1039+ this . runline . forEach ( function ( c ) { c . stop ( ) ; } ) ;
9291040 } ;
9301041
9311042 CommentManager . prototype . start = function ( ) {
@@ -984,13 +1095,21 @@ var CommentManager = (function() {
9841095 this . stage . style . webkitPerspective = this . width * Math . tan ( 40 * Math . PI / 180 ) / 2 + "px" ;
9851096 } ;
9861097
987- CommentManager . prototype . init = function ( ) {
1098+ CommentManager . prototype . init = function ( renderer ) {
9881099 this . setBounds ( ) ;
9891100 if ( this . filter == null ) {
9901101 this . filter = new CommentFilter ( ) ; //Only create a filter if none exist
9911102 }
9921103 if ( this . factory == null ) {
993- this . factory = CommentFactory . defaultFactory ( ) ;
1104+ switch ( renderer ) {
1105+ case 'legacy' :
1106+ this . factory = CommentFactory . defaultFactory ( ) ;
1107+ break ;
1108+ default :
1109+ case 'css' :
1110+ this . factory = CommentFactory . defaultCssRenderFactory ( ) ;
1111+ break ;
1112+ }
9941113 }
9951114 } ;
9961115
0 commit comments