Skip to content

Commit 65ba033

Browse files
committed
Cleanup and add stop polyfill.
1 parent 57ce088 commit 65ba033

8 files changed

Lines changed: 60 additions & 31 deletions

File tree

build/CommentCoreLibrary.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,9 @@ var CoreComment = (function () {
571571
}
572572
};
573573

574+
CoreComment.prototype.stop = function () {
575+
};
576+
574577
CoreComment.prototype.finish = function () {
575578
this.parent.finish(this);
576579
};
@@ -1009,6 +1012,9 @@ var CoreComment = (function () {
10091012
}
10101013
};
10111014

1015+
CoreComment.prototype.stop = function () {
1016+
};
1017+
10121018
CoreComment.prototype.finish = function () {
10131019
this.parent.finish(this);
10141020
};
@@ -1064,6 +1070,7 @@ var CSSCompatLayer = (function () {
10641070
};
10651071
return CSSCompatLayer;
10661072
})();
1073+
10671074
var CSSScrollComment = (function (_super) {
10681075
__extends(CSSScrollComment, _super);
10691076
function CSSScrollComment() {

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: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,55 @@
1-
.abp{
2-
position:relative;
1+
.abp {
2+
position: relative;
33
}
4-
.abp .container{
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;
4+
5+
.abp .container {
116
border: 0;
12-
top: 0;
13-
left: 0;
147
bottom: 0;
8+
display: block;
9+
left: 0;
10+
margin: 0;
11+
overflow: hidden;
12+
position: absolute;
1513
right: 0;
16-
z-index: 9999;
14+
top: 0;
1715
touch-callout: none;
16+
-webkit-transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
17+
transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
1818
-webkit-user-select: none;
1919
-moz-user-select: none;
2020
-ms-user-select: none;
2121
user-select: none;
22+
z-index: 9999;
2223
}
23-
.abp .container .cmt{
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-
-webkit-transform-origin: 0% 0%;
27-
-ms-transform-origin: 0% 0%;
28-
transform-origin: 0% 0%;
29-
position: absolute;
30-
padding: 3px 0 0 0;
31-
margin: 0;
24+
25+
.abp .container .cmt {
3226
color: #fff;
3327
font-family: SimHei, SimSun, Heiti, "MS Mincho", "Meiryo", "Microsoft YaHei", monospace;
3428
font-size: 25px;
29+
letter-spacing: 0;
30+
line-height: 100%;
31+
margin: 0;
32+
padding: 3px 0 0 0;
33+
position: absolute;
3534
text-decoration: none;
3635
text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;
3736
-webkit-text-size-adjust: none;
3837
-ms-text-size-adjust: none;
3938
text-size-adjust: none;
40-
line-height: 100%;
41-
letter-spacing: 0;
42-
word-break: keep-all;
39+
-webkit-transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
40+
transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
41+
-webkit-transform-origin: 0% 0%;
42+
-ms-transform-origin: 0% 0%;
43+
transform-origin: 0% 0%;
4344
white-space: pre;
44-
45+
word-break: keep-all;
4546
}
46-
.abp .container .cmt.noshadow{
47+
48+
.abp .container .cmt.noshadow {
4749
text-shadow: none;
4850
}
49-
.abp .container .cmt.rshadow{
51+
52+
.abp .container .cmt.rshadow {
5053
text-shadow: -1px 0 white, 0 1px white, 1px 0 white, 0 -1px white;
5154
}
5255

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.

src/core/Comment.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,9 @@ var CoreComment = (function () {
391391
}
392392
};
393393

394+
CoreComment.prototype.stop = function () {
395+
};
396+
394397
CoreComment.prototype.finish = function () {
395398
this.parent.finish(this);
396399
};

src/core/Comment.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,14 @@ class CoreComment implements IComment {
395395
}
396396
}
397397

398+
/**
399+
* Notify the comment to stop. This has no effect if the comment
400+
* is driven by a timer.
401+
*/
402+
public stop():void {
403+
// Do nothing
404+
}
405+
398406
/**
399407
* Remove the comment and do some cleanup.
400408
*/

src/core/css/CSSComment.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,9 @@ var CoreComment = (function () {
391391
}
392392
};
393393

394+
CoreComment.prototype.stop = function () {
395+
};
396+
394397
CoreComment.prototype.finish = function () {
395398
this.parent.finish(this);
396399
};
@@ -446,6 +449,7 @@ var CSSCompatLayer = (function () {
446449
};
447450
return CSSCompatLayer;
448451
})();
452+
449453
var CSSScrollComment = (function (_super) {
450454
__extends(CSSScrollComment, _super);
451455
function CSSScrollComment() {

src/core/css/CSSComment.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ class CSSCompatLayer {
1414
dom.style["oTransform"] = trans;
1515
}
1616
}
17-
class CSSScrollComment extends ScrollComment{
17+
18+
class CSSScrollComment extends ScrollComment {
1819
private _dirtyCSS:boolean = true;
1920
set x(x:number){
2021
if(typeof this._x === "number") {
@@ -49,11 +50,14 @@ class CSSScrollComment extends ScrollComment{
4950
this._dirtyCSS = true;
5051
}
5152

53+
/**
54+
* Override the toplevel stop to actually stop the CSS.
55+
*/
5256
public stop():void{
5357
this.dom.style.transition = "";
5458
this.x = this._x;
5559
this._x = null;
5660
this.x = (this.ttl / this.dur) * (this.parent.width + this.width) - this.width;
5761
this._dirtyCSS = true;
5862
}
59-
}
63+
}

0 commit comments

Comments
 (0)