Skip to content

Commit 3ef55c6

Browse files
committed
Remove unused documentation for setFilter and getFilter
[ci skip]
1 parent 308d3fa commit 3ef55c6

File tree

1 file changed

+34
-41
lines changed

1 file changed

+34
-41
lines changed

docs/CommentCoreLibraryAPI.md

+34-41
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ CommentManager (弹幕管理器)
77
----
88
The `CommentManager` is initalized by passing in a single parameter that assigns
99
the HTML DOM object to write comments on. This object should have a class type
10-
of `container` and be a descendant of another wrapper under the class `abp`.
10+
of `container` and be a descendant of another wrapper under the class `abp`.
1111
This DOM object is internally referenced as the comment's "stage".
1212

13-
If you have not initialized this object and wish to do so, you should use the
13+
If you have not initialized this object and wish to do so, you should use the
1414
`CommentCore` object to initialize the entire set.
1515

1616
弹幕管理器通过提供一个用于渲染的HTML元件来初始化。这个HTML元件应该属于"container"这个css 类
@@ -22,102 +22,95 @@ Example of the DOM substructure (HTML结构体的示例)
2222

2323
<div class = "abp">
2424
<div class = "container">
25-
<!--
26-
This div will become the comment stage
25+
<!--
26+
This div will become the comment stage
2727
You should pass a DOM reference to this element NOT its parent
2828
-->
2929
</div>
3030
</div>
31-
32-
The `CommentManager` expose a simple API for manipulating comments. The
31+
32+
The `CommentManager` expose a simple API for manipulating comments. The
3333
functions along with their usage will be defined below. `CommentManager` 会暴露出
3434
一套简单的API来供开发者控制弹幕。
3535

3636
* `load ( CommentData[] timeline )`
37-
This method loads in an array of unsorted comment data. Comment data is
38-
directly obtained by parsing the input file. The method will re-sort this
39-
data by timeline-time then by id then by send-time. It will overwrite the
37+
This method loads in an array of unsorted comment data. Comment data is
38+
directly obtained by parsing the input file. The method will re-sort this
39+
data by timeline-time then by id then by send-time. It will overwrite the
4040
current timeline instantly. 这个方法会载入一个新的弹幕列表到弹幕管理器中弹幕列表将会被
4141
排序后存储。调用后方法会覆盖任何可能已经存在的时间轴(弹幕信息列表)。
42-
42+
4343
* `start ()`
44-
This method starts the internal clock that scrolls comments. Comments will
44+
This method starts the internal clock that scrolls comments. Comments will
4545
not move if the comment manager has not been started. 这个方法会启动弹幕管理器的
4646
内部计时器。弹幕在未启动计时器的状态下是不会移动的。
47-
47+
4848
* `stop ()`
49-
This method does the opposite of start and pauses the internal clock.
50-
Comments currently scrolling and effects in progress will be stopped
49+
This method does the opposite of start and pauses the internal clock.
50+
Comments currently scrolling and effects in progress will be stopped
5151
immediately. 这个方法于 start 方法作用相反,正在进行的效果和正在滚动的弹幕会被强制停止。
5252

5353
* `insert ( CommentData comment )`
54-
This method allows for insertion of new comment data into the timeline. It
54+
This method allows for insertion of new comment data into the timeline. It
5555
keeps the timeline sorted even after insertion. 这个方法会往弹幕管理器中插入一条
5656
弹幕,并保持时间轴顺序。注意:当插入弹幕的时间小于已经播放的时间,有可能看不到的。
57-
57+
5858
* `send ( CommentData comment )`
5959
This method **sends a comment to display on the stage**. It does not add the
60-
comment into the timeline. The effects are instant, and the comment will
60+
comment into the timeline. The effects are instant, and the comment will
6161
start if the CommentManager's internal timer is running (see `start`, `stop`
62-
methods). Please note: This does NOT send the comment data to the remote
62+
methods). Please note: This does NOT send the comment data to the remote
6363
server, for that you will need to send to the provider instead.这个方法会把一条
6464
弹幕显示到屏幕上。它不会把弹幕发送到服务器,也不会把弹幕插入时间轴。只要弹幕管理器处于运行状态
6565
弹幕就会立刻显示(参考`start`,`stop`控制弹幕管理器状态)。
66-
66+
6767
* `clear ()`
6868
This method clears the stage. It removes all running comments, but keeps the
6969
timeline intact. 这个方法会强制清空显示界面,但是会保留时间轴。
70-
70+
7171
* `time ( integer time )`
7272
This method sets the playhead time of the comment manager. Time is provided
73-
in miliseconds. All the comments from the last time() to the current time()
74-
will be output if the difference in time is positive and falls below a
75-
threshold. 这个方法设置了CommentManager的播放时间,单位是毫秒(0.001s),所有在上一个
73+
in miliseconds. All the comments from the last time() to the current time()
74+
will be output if the difference in time is positive and falls below a
75+
threshold. 这个方法设置了CommentManager的播放时间,单位是毫秒(0.001s),所有在上一个
7676
time 调用到现在的弹幕都会被输出,前提是两次时间差是正数且低于一个限度。
77-
78-
* `setFilter ( CommentFilter filter )`
79-
This method sets the comment filter for the CommentManager. It replaces the
80-
default filter. 这个方法会替还默认的弹幕过滤器。
81-
82-
* `getFilter ()`
83-
This method returns the current filter being used. 这个方法返回正在使用的过滤器。
84-
77+
8578
CommentFilter (弹幕过滤器)
8679
----
8780
The comment filter is an object that determines if a comment should be displayed
88-
or not depending on its initializing data. It can also control how running
81+
or not depending on its initializing data. It can also control how running
8982
comments are displayed. 弹幕过滤器会根据弹幕信息判对一个弹幕是否显示,当然也可以控制弹幕运行的
9083
方式。
9184

9285
* `doValidate ( CommentData comment )`
9386
This method validates the comment data against a list of filters. It returns
9487
true if the comment is displayed, false if it should be hidden.
95-
88+
9689
* `addRule ( Rule filterRule )`
9790
This method adds a rule into the filter engine.
98-
99-
Rule Definitions:
100-
91+
92+
Rule Definitions:
93+
10194
Rule {
10295
"mode": int/string comment_mode,
10396
"operator": string <comment_filter_operator>,
10497
"subject": string <comment_property>,
10598
"value": primitive <value>
10699
}
107-
108-
For modes, it can be any of [these modes](CommentTypes.md) or 'all'.
100+
101+
For modes, it can be any of [these modes](CommentTypes.md) or 'all'.
109102
Operators can be any of:
110103
* Equality operators : = , ==, eq, equals
111104
* Comparison operators : < , >
112105
* Inequality operators : !=, ineq
113106
* Regular expression match : matches, regex, ~ (or inversly) notmatch, iregex, !~
114107
* Range operators : range
115-
108+
116109
* `addModifier ( function modifier ( CommentData cd ) )`
117110
This method adds a modifier that given comment data returns a modified version
118111
of the comment data.
119-
112+
120113
* `setRuntimeFilter ( function filter ( Comment c ) )`
121-
This method is run every time any element is moved animated. It has access
114+
This method is run every time any element is moved animated. It has access
122115
to the comment's state. You can only set ONE runtime filter for the comments
123116
as setting this greatly influences speed.

0 commit comments

Comments
 (0)