Skip to content

Commit 0de1e11

Browse files
committed
Merge branch 'master' into dev-scripter
2 parents 3bf2c64 + 702483d commit 0de1e11

File tree

9 files changed

+111
-96
lines changed

9 files changed

+111
-96
lines changed

build/CommentCoreLibrary.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ function CommentSpaceAllocator(w,h){
193193
return cmt.y;
194194
}
195195
}
196-
this.setY(cmt,index+1);
196+
return this.setY(cmt,index+1);
197197
};
198198
this.vCheck = function(y,cmt){
199199
var bottom = y + cmt.height;
@@ -529,11 +529,16 @@ CommentManager.prototype.time = function(time){
529529
this.lastPos = time;
530530
if(this.timeline.length <= this.position)
531531
return;
532-
}else this.lastPos = time;
532+
}else{
533+
this.lastPos = time;
534+
}
533535
for(;this.position < this.timeline.length;this.position++){
534536
if(this.limiter > 0 && this.runline.length > this.limiter) break;
535-
if(this.validate(this.timeline[this.position]) && this.timeline[this.position]['stime']<=time) this.sendComment(this.timeline[this.position]);
536-
else break;
537+
if(this.validate(this.timeline[this.position]) && this.timeline[this.position]['stime']<=time){
538+
this.sendComment(this.timeline[this.position]);
539+
}else{
540+
break;
541+
}
537542
}
538543
};
539544
CommentManager.prototype.rescale = function(){
@@ -556,11 +561,12 @@ CommentManager.prototype.sendComment = function(data){
556561
if(data == null) return;
557562
}
558563
cmt = this.initCmt(cmt,data);
564+
559565
this.stage.appendChild(cmt);
560566
cmt.width = cmt.offsetWidth;
561567
cmt.height = cmt.offsetHeight;
562-
cmt.style.width = (cmt.width + 1) + "px";
563-
cmt.style.height = (cmt.height - 3) + "px";
568+
//cmt.style.width = (cmt.width + 1) + "px";
569+
//cmt.style.height = (cmt.height - 3) + "px";
564570
cmt.style.left = this.stage.width + "px";
565571

566572
if(this.filter != null && !this.filter.beforeSend(cmt)){

build/CommentCoreLibrary.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/style.css

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,50 @@
1-
div.abp{
1+
.abp{
22
position:relative;
33
}
44
.abp .container{
5-
overflow: hidden;
6-
display: block;
7-
z-index: 9999;
8-
position: absolute;
9-
top: 0;
10-
left: 0;
11-
bottom: 0;
12-
right: 0;
13-
border: 0;
5+
-webkit-transform: matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);
6+
transform: matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);
7+
position: absolute;
8+
display: block;
9+
overflow: hidden;
10+
margin: 0;
11+
border: 0;
12+
top: 0;
13+
left: 0;
14+
bottom: 0;
15+
right: 0;
16+
z-index: 9999;
1417
touch-callout: none;
15-
-webkit-user-select: none;
16-
-moz-user-select: none;
17-
-ms-user-select: none;
18-
user-select: none;
18+
-webkit-user-select: none;
19+
-moz-user-select: none;
20+
-ms-user-select: none;
21+
user-select: none;
1922
}
2023
.abp .container .cmt{
21-
padding: 3px 0 0 0;
22-
margin: 0;
23-
line-height: 100%;
24-
font-family: Simhei,Simsun,Heiti,"MS Mincho","Meiryo","Microsoft Yahei",monospace;
25-
text-decoration: none;
26-
text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;
27-
color: #fff;
28-
letter-spacing: 0;
29-
font-size: 25px;
30-
position: absolute;
31-
word-break: none;
32-
text-wrap: none;
24+
-webkit-transform: matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);
25+
transform: matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);
26+
position: absolute;
27+
padding: 3px 0 0 0;
28+
margin: 0;
29+
color: #fff;
30+
font-family: SimHei, SimSun, Heiti, "MS Mincho", "Meiryo", "Microsoft YaHei", monospace;
31+
font-size: 25px;
32+
text-decoration: none;
33+
text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;
3334
-webkit-text-size-adjust: none;
3435
-ms-text-size-adjust: none;
3536
text-size-adjust: none;
36-
white-space: pre;
37+
line-height: 100%;
38+
letter-spacing: 0;
39+
word-break: keep-all;
40+
white-space: pre;
41+
3742
}
38-
.cmt.noshadow{
39-
text-shadow: none !important;
40-
text-stroke: none !important;
43+
.abp .container .cmt.noshadow{
44+
text-shadow: none;
4145
}
42-
.cmt.rshadow{
43-
text-shadow: -1px 0 white, 0 1px white, 1px 0 white, 0 -1px white !important;
46+
.abp .container .cmt.rshadow{
47+
text-shadow: -1px 0 white, 0 1px white, 1px 0 white, 0 -1px white;
4448
}
4549

4650
/** Aliases for Chinese named fonts because they don't work on *nix **/

build/style.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/debugger.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,10 @@ function bind(){
217217
var sec = Math.floor(playhead / 1000);
218218
var millis = playhead % 1000;
219219
var millisText = (millis > 99 ? millis : ("0" + (millis > 9 ? millis : "0" + millis)));
220-
$("control-status").innerHTML = Math.floor(sec/60) + ":" +
220+
$("control-status").textContent = Math.floor(sec/60) + ":" +
221221
((sec % 60) > 9 ? (sec % 60) : "0" + (sec % 60)) + ":" + millisText;
222222
}else{
223-
$("control-status").innerHTML = playhead;
223+
$("control-status").textContent = playhead;
224224
}
225225
};
226226

@@ -265,7 +265,7 @@ function bind(){
265265
playhead = new Date().getTime() - start;
266266
displayTime(playhead);
267267
cm.time(playhead);
268-
},10);
268+
},42);
269269
}
270270

271271
/** Load **/
@@ -290,9 +290,9 @@ function bind(){
290290
start = new Date().getTime();
291291
tmr = setInterval(function(){
292292
playhead = new Date().getTime() - start;
293-
displayTime(playhead);
294293
cm.time(playhead);
295-
},10);
294+
displayTime(playhead);
295+
},42);
296296
};
297297

298298
var isWindowedFullscreen = false;

demo/index.htm

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5-
<meta http-equiv="X-UA-Compatible" value="IE=9">
6-
<link rel="stylesheet" href="default.css" />
7-
<link rel="stylesheet" href="../build/style.css" />
8-
<!-- Run 'make' to build the file -->
9-
<script src="../build/CommentCoreLibrary.js"></script>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5+
<meta http-equiv="X-UA-Compatible" value="IE=9">
6+
<title>Debugger Sandbox For CommentCoreLibrary</title>
7+
<link rel="stylesheet" href="default.css" />
108

11-
<!-- A few helpers to do some decoding/fetching below-->
12-
<script src="libxml.js"></script>
13-
<!-- Debuger -->
14-
<script src="debugger.js"></script>
15-
<!-- Extend-->
16-
<script src="../extend/fefx.js"></script>
17-
18-
19-
<title>Debugger Sandbox For CommentCoreLibrary</title>
9+
<!-- CCL -->
10+
<link rel="stylesheet" href="../build/style.css" />
11+
<script type="text/javascript" src="../build/CommentCoreLibrary.js"></script>
12+
<!-- Base -->
13+
<script src="libxml.js"></script>
14+
<script src="debugger.js"></script>
15+
<!-- Extensions -->
16+
<script src="../src/extend/fefx.js"></script>
2017
</head>
2118
<body>
2219
<div id="debugger">
@@ -48,7 +45,7 @@ <h2>Extended</h2>
4845
<a id="test-7" class="button" href="javascript:;">Run Test 7</a>
4946
<a id="test-8" class="button" href="javascript:;">Run Test 8</a>
5047
<a id="test-9" class="button" href="javascript:;">Run Test 9</a>
51-
<a id="test-s" class="button" href="javascript:;">Run Test Scripting</a>
48+
<a id="test-s" class="button" href="javascript:;">Run Test S</a>
5249
<div style="clear:both;"></div>
5350
</div>
5451
<h3>AcFun (Experimental)</h3>

src/CommentCoreLibrary.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,16 @@ CommentManager.prototype.time = function(time){
173173
this.lastPos = time;
174174
if(this.timeline.length <= this.position)
175175
return;
176-
}else this.lastPos = time;
176+
}else{
177+
this.lastPos = time;
178+
}
177179
for(;this.position < this.timeline.length;this.position++){
178180
if(this.limiter > 0 && this.runline.length > this.limiter) break;
179-
if(this.validate(this.timeline[this.position]) && this.timeline[this.position]['stime']<=time) this.sendComment(this.timeline[this.position]);
180-
else break;
181+
if(this.validate(this.timeline[this.position]) && this.timeline[this.position]['stime']<=time){
182+
this.sendComment(this.timeline[this.position]);
183+
}else{
184+
break;
185+
}
181186
}
182187
};
183188
CommentManager.prototype.rescale = function(){
@@ -200,11 +205,12 @@ CommentManager.prototype.sendComment = function(data){
200205
if(data == null) return;
201206
}
202207
cmt = this.initCmt(cmt,data);
208+
203209
this.stage.appendChild(cmt);
204210
cmt.width = cmt.offsetWidth;
205211
cmt.height = cmt.offsetHeight;
206-
cmt.style.width = (cmt.width + 1) + "px";
207-
cmt.style.height = (cmt.height - 3) + "px";
212+
//cmt.style.width = (cmt.width + 1) + "px";
213+
//cmt.style.height = (cmt.height - 3) + "px";
208214
cmt.style.left = this.stage.width + "px";
209215

210216
if(this.filter != null && !this.filter.beforeSend(cmt)){

src/CommentSpaceAllocator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function CommentSpaceAllocator(w,h){
7575
return cmt.y;
7676
}
7777
}
78-
this.setY(cmt,index+1);
78+
return this.setY(cmt,index+1);
7979
};
8080
this.vCheck = function(y,cmt){
8181
var bottom = y + cmt.height;

src/css/base.css

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,41 @@
1-
div.abp{
1+
.abp{
22
position:relative;
33
}
44
.abp .container{
5-
overflow: hidden;
6-
display: block;
7-
z-index: 9999;
8-
position: absolute;
9-
top: 0;
10-
left: 0;
11-
bottom: 0;
12-
right: 0;
13-
border: 0;
5+
transform: matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);
6+
position: absolute;
7+
display: block;
8+
overflow: hidden;
9+
margin: 0;
10+
border: 0;
11+
top: 0;
12+
left: 0;
13+
bottom: 0;
14+
right: 0;
15+
z-index: 9999;
1416
touch-callout: none;
15-
user-select: none;
17+
user-select: none;
1618
}
1719
.abp .container .cmt{
18-
padding: 3px 0 0 0;
19-
margin: 0;
20-
line-height: 100%;
21-
font-family: Simhei,Simsun,Heiti,"MS Mincho","Meiryo","Microsoft Yahei",monospace;
22-
text-decoration: none;
23-
text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;
24-
color: #fff;
25-
letter-spacing: 0;
26-
font-size: 25px;
27-
position: absolute;
28-
word-break: none;
29-
text-wrap: none;
20+
transform: matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);
21+
position: absolute;
22+
padding: 3px 0 0 0;
23+
margin: 0;
24+
color: #fff;
25+
font-family: SimHei, SimSun, Heiti, "MS Mincho", "Meiryo", "Microsoft YaHei", monospace;
26+
font-size: 25px;
27+
text-decoration: none;
28+
text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;
3029
text-size-adjust: none;
31-
white-space: pre;
30+
line-height: 100%;
31+
letter-spacing: 0;
32+
word-break: keep-all;
33+
white-space: pre;
34+
3235
}
33-
.cmt.noshadow{
34-
text-shadow: none !important;
35-
text-stroke: none !important;
36+
.abp .container .cmt.noshadow{
37+
text-shadow: none;
3638
}
37-
.cmt.rshadow{
38-
text-shadow: -1px 0 white, 0 1px white, 1px 0 white, 0 -1px white !important;
39+
.abp .container .cmt.rshadow{
40+
text-shadow: -1px 0 white, 0 1px white, 1px 0 white, 0 -1px white;
3941
}

0 commit comments

Comments
 (0)