MCPcopy
hub / github.com/jabbany/CommentCoreLibrary / CommentManager

Function CommentManager

src/CommentManager.js:32–85  ·  view source on GitHub ↗
(stageObject)

Source from the content-addressed store, hash-verified

30 };
31
32 function CommentManager(stageObject){
33 var __timer = 0;
34
35 this._listeners = {};
36 this._lastPosition = 0;
37
38 this.stage = stageObject;
39 this.options = {
40 global:{
41 opacity:1,
42 scale:1,
43 className:"cmt"
44 },
45 scroll:{
46 opacity:1,
47 scale:1
48 },
49 limit: 0,
50 seekTrigger: 2000
51 };
52 this.timeline = [];
53 this.runline = [];
54 this.position = 0;
55
56 this.factory = null;
57 this.filter = null;
58 this.csa = {
59 scroll: new CommentSpaceAllocator(0,0),
60 top: new AnchorCommentSpaceAllocator(0,0),
61 bottom: new AnchorCommentSpaceAllocator(0,0),
62 reverse: new CommentSpaceAllocator(0,0),
63 scrollbtm: new CommentSpaceAllocator(0,0)
64 };
65
66 /** Precompute the offset width **/
67 this.width = this.stage.offsetWidth;
68 this.height = this.stage.offsetHeight;
69 this._startTimer = function () {
70 if (__timer > 0) {
71 return;
72 }
73 var lastTPos = new Date().getTime();
74 var cmMgr = this;
75 __timer = window.setInterval(function () {
76 var elapsed = new Date().getTime() - lastTPos;
77 lastTPos = new Date().getTime();
78 cmMgr.onTimerEvent(elapsed,cmMgr);
79 },10);
80 };
81 this._stopTimer = function () {
82 window.clearInterval(__timer);
83 __timer = 0;
84 };
85 }
86
87 /** Public **/
88 CommentManager.prototype.stop = function(){

Callers

nothing calls this directly

Calls 2

setIntervalMethod · 0.80
clearIntervalMethod · 0.80

Tested by

no test coverage detected