Skip to content

Commit a7141a3

Browse files
committed
Modified build process. Updated documentation. Updated bower.json
1 parent bf43acc commit a7141a3

File tree

12 files changed

+1085
-131
lines changed

12 files changed

+1085
-131
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
# or operating system, you probably want to add a global ignore instead:
55
# git config --global core.excludesfile ~/.gitignore_global
66
#
7+
*.iml
78
/node_modules/*

BUILDING.md

Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,50 @@
11
Building 编译项目
22
==============================
3+
本项目采用 grunt 管理编译,有关 Grunt 系统的使用请参考[官方文档](http://gruntjs.com/getting-started)
4+
脚本弹幕部分的编译还需要 [TypeScript](http://www.typescriptlang.org/) 。这些库还会依赖于
5+
NodeJS环境。
36

4-
When building the comment core library, you can build two different types,
5-
the minified or non minified.
7+
### 确定你是否需要编译 (Do I need to build CCL?)
8+
CommentCoreLibrary在库外提供了很多可扩展的空间,你可以相对简单的增加新的弹幕格式的支持,新的弹幕
9+
运行模式的支持和挂载各种不同的定时元件。CCL提供了丰富的扩展支持,通过预处理过滤器和运行时过滤器可以
10+
实现非常多的特殊功能支持。编译库意味着你可能需要一些默认环境没有的软件,比如 NodeJS 平台,为此需要
11+
付出一些架设精力。
612

7-
编译模块的时候,可以选择编译成两种不同的单文件。压缩版,和非压缩版。
13+
当然自己编译也会带来一些优势,比如更小的库大小和更加专注的功能支持。还有,希望帮助CCL实现更多支持的
14+
开发者们也需要知道如何有效的编译。
815

9-
The default is to build a minified version (我们默认会编译成压缩版,通过如下命令):
16+
### 配置编译环境(Setup Build Environment)
17+
初次编译请确保你安装了 `node>=0.8.0`,为全局系统安装 grunt 请执行:
1018

11-
make
12-
13-
or
19+
npm install -g grunt-cli
1420

15-
make all-uglify
21+
有些系统下可能需要管理员权限(如 `sudo`)。有关具体如何配置Grunt请参考官方文档。
1622

17-
Minifying the JavaScript requires you to have Node.js installed. 压缩输出文件要求你
18-
有安装了Node.js。
23+
接下来你需要安装编译所需的库,可以简单的通过 `npm install` 进行安装。CommentCoreLibrary在
24+
运行时没有任何依赖关系,但是开发环境需要依赖 grunt 的一些部件和 TypeScript(参考下面“代码弹幕”
25+
章节)。
1926

20-
If you want a non-minified single file version, use (下面的命令则会输出一个未经压缩的
21-
只有堆砌起来的文件):
27+
### 编译(Building)
28+
编译项目请在根目录直接运行:
2229

23-
make all-concat-only
30+
grunt
2431

25-
Separate Components 分模块编译
26-
-----------------------------
27-
To build each module separately, run `make all`. It will produce 2 parts, parsers
28-
and the CommentCoreLibrary. 如果希望弹幕编译每个模块,运行上方命令,会产出两个部件,一个是CCL
29-
弹幕库,另一个是解析库。
32+
即可按照默认模板编译。除此之外,你还可以改变编译目标:
3033

31-
You can also run `make extensions` to build all the experimental extensions. They
32-
will not be minimized. 你还可以编译正在实验中的一些扩展模块,这些模块不会被压缩以方便调试。
34+
- build : 只编译项目,不会clean掉 build文件夹下的产物
35+
- build-core : 只编译弹幕核心,不包括Acfun和Bilibili的解析器。这个更加适用各种二次开发不需要
36+
已有的弹幕格式的
37+
38+
默认模式会自动看管 `src` 源码文件夹,并且在产生变化的时候自动生成新版。
39+
40+
### 调试(Debugging)
41+
本地调试的话,可以在本地架设Web Server。默认的 `demo` 文件夹下也有一套简易的调试界面。同时你还
42+
可以参考这个界面来实现你自己的嵌入调试。
43+
44+
### 代码弹幕(Scripting Engine)
45+
默认的代码弹幕支持需要使用 TypeScript 编译。这需要你安装 TypeScript 支持,通过
46+
`npm install -g typescript` 即可安装。代码弹幕部分临时还在使用旧的 `make` 系统,未来也会
47+
逐渐过渡到使用 Grunt。目前编译项目不会引入代码弹幕支持(考虑到架设难度的增高和潜在受众面相对于
48+
弹幕支持要少一些),相关库需要手动引入。
49+
50+
参考 `docs/scripting` 了解代码弹幕系统和它的编译方法。

CONTRIBUTING.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
Contributing 做出贡献
2+
==================================
3+
CommentCoreLibrary欢迎广大开发者积极做出贡献,提交补丁和Bug信息。以下將介绍如何有效的提交贡献到
4+
CommentCoreLibrary上。
5+
6+
CommentCoreLibrary welcomes all developers to contribute to the project in any
7+
way, such as code, documentation or issue reports. This document describes how
8+
you can effectively contribute to make our work easier.
9+
10+
### 不具合报告(Bug Reports)
11+
CCL欢迎一切相关的缺陷报告,包括浏览器兼容性问题,代码报错,和显示偏差等等。请善用 Github 自建的
12+
[Issue Tracker](https://github.com/jabbany/CommentCoreLibrary/issues)。中文英文
13+
都可以。请在标题上尽可能清楚直观地描述问题,如:“弹幕3D效果投影距离与期待情况有偏差” 这样的标题。
14+
15+
有关显示相关的问题,请最好附带上你的浏览器版本,操作系统/平台版本。欢迎截图,欢迎 console
16+
错误信息复制粘贴。请确保你有标准中文字体(宋体 Simsun【必需】,黑体 Simhei【必需】,
17+
雅黑 Microsoft YaHei,幼圆 YouYuan,隶书),和日文字体(Mincho, Gothic)来达到最佳显示
18+
效果。
19+
20+
Please use the issue tracker provided by Github to submit bug reports. These
21+
include any compatibility problems, script generated errors, display problems
22+
etc. English or Chinese issue reports are both welcome and accepted. Descibe the
23+
problem as clearly as possible in the title too. Also, for display and
24+
compatibility problems please also include your browser vendor and OS info.
25+
26+
PS: Just as heads up, check your font support first. Unix based systems often
27+
choke on Chinese font names and render some fixed point animations wrong, this
28+
may happen if you don't have fonts configured correctly. You should install the
29+
basic Chinese font SimHei for accurate positioning of comments.
30+
31+
### 新功能讨论(Feature Request)
32+
新功能讨论,接口讨论,实验性分支(`dev-*``beta-*`分支树)的问题,也欢迎使用 Issue 报告。CCL
33+
是弹幕渲染层,有关视频格式,旧浏览器的向下兼容问题和各种平台上的挂载问题,可以在相应的
34+
ABPlayerHTML5 项目上报告
35+
36+
You can also use the issue tracker to submit feature requests, implementation
37+
discussions and development questions. Remember that CCL is just a comment
38+
overlay, for problems concerning video, backwards compatability with pre-HTML5
39+
and flash fallback, please report to ABPlayerHTML5 or other corresponding
40+
projects.
41+
42+
### 提交代码(Contributing Code)
43+
提交代码请使用 Github 自带的 Pull Request 功能。先把这个库 Fork 到你的账户,进行更改,之后
44+
选择好节点发送 Pull Request。注意:如果你的更改是对别的分支的更新,比如代码分支或者CSS动画分支,
45+
请提交到相应的分支下,而不是 `master`
46+
47+
Contributions of code or documentation are very welcome! You can use Github's
48+
in-built Pull Request feature to submit a patch. Make sure the patch applies to
49+
the correct branch if you're not working on `master`.

CommentCoreLibrary.iml

Lines changed: 0 additions & 10 deletions
This file was deleted.

Gruntfile.coffee

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,25 @@ module.exports = (grunt) ->
2121
'src/parsers/AcfunFormat.js'
2222
'src/parsers/BilibiliFormat.js'
2323
]
24-
25-
SRC_CORELIB = SRC_PARSER.concat(SRC_CORE)
24+
25+
# Core concatenated with libraries
26+
# Actual concat ordering does not/should not matter
27+
SRC_CORELIB = SRC_CORE.concat(SRC_PARSER)
2628

2729
grunt.initConfig(
30+
clean:
31+
build: ['build']
2832
# Concat CSS and JS files
33+
# core_only : builds CCL without parsers
34+
# all : builds CCL with everything
2935
concat:
30-
basic_and_extras:
36+
core_only:
3137
files:
3238
'build/style.css': ['src/base.css', 'src/fontalias.css']
3339
'build/CommentCore.js': SRC_CORE
40+
all:
41+
files:
42+
'build/style.css': ['src/base.css', 'src/fontalias.css']
3443
'build/CommentCoreLibrary.js': SRC_CORELIB
3544

3645
# Auto-prefix CSS properties using Can I Use?
@@ -50,23 +59,24 @@ module.exports = (grunt) ->
5059

5160
uglify:
5261
options: banner: License
53-
comment_core:
62+
core_only:
5463
files:
5564
'build/CommentCore.min.js': SRC_CORE
56-
comment_core_lib:
65+
all:
5766
files:
5867
'build/CommentCoreLibrary.min.js': SRC_CORELIB
5968

6069
# Watch files for changes
6170
watch:
62-
css:
71+
all:
6372
files: ['src/**/*', '!node_modules']
6473

6574
# Run concat, autoprefixer, cssmin and uglify
6675
tasks: ['build']
6776
)
6877

6978
# Register our tasks
70-
grunt.registerTask 'build', ['concat', 'autoprefixer', 'cssmin', 'uglify']
71-
grunt.registerTask 'default', ['build', 'watch']
79+
grunt.registerTask 'build-core', ['concat:core_only', 'autoprefixer', 'cssmin', 'uglify:core_only']
80+
grunt.registerTask 'build', ['concat:all', 'autoprefixer', 'cssmin', 'uglify:all']
81+
grunt.registerTask 'default', ['clean', 'build', 'watch']
7282

README.md

Lines changed: 38 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,64 @@
1-
# Readme
2-
The CommentCoreLibrary is a set of Javascript 'classes' that make up the
3-
core controller for comments streaming on top of a video. It is intended
4-
as a catalyst for the future development of timed comments streaming
5-
alongside videos.
1+
# CommentCoreLibrary 弹幕核心通用构件
2+
The CommentCoreLibrary is a set of Javascript modules that make up the
3+
core controller for comments streaming on top of timed media (video or audio).
4+
It is intended as a catalyst for the development of timed "danmaku" comments
5+
in HTML5.
66

7-
The CCL is intended for education purposes (in contrast to
8-
[ABPlayerHTML5](https://github.com/jabbany/ABPlayerHTML5)
9-
which focuses on real world use) and is separated into sections that
10-
help developers understand how the library and how danmaku comments
11-
work.
7+
Developers willing to incorporate similar comment streaming functionalities
8+
inside their own projects (whether web based or not) are encouraged to learn
9+
from and extend from the CommentCoreLibrary.
1210

13-
Developers willing to incorporate similar comment streaming
14-
functionalities inside their own projects (whether web based or not) are
15-
free to learn from and extend from the CommentCoreLibrary.
16-
17-
## Testing on your browser
18-
You can see a live demo (most current source)
19-
[here](http://jabbany.github.com/CommentCoreLibrary/demo). Feel free to open
20-
tickets if this demo test has bugs. Remember to tell me your browser
21-
vendor/version info though. PS, just a heads up, due to lack of
22-
fonts, Linux systems may render some fixed point animations wrong, this
23-
is normal. You should install the basic chinese font SimHei for accurate
24-
positioning.
11+
## Testing
12+
We have a live demo [here](http://jabbany.github.com/CommentCoreLibrary/demo).
13+
Feel free to [open tickets](CONTRIBUTING.md) if this demo test has bugs.
2514

2615
## License
27-
The CommentCoreLibrary is licensed under the permissive MIT License. If
28-
you wish to use this in any project, you can simply include the
29-
following line:
16+
The CommentCoreLibrary is licensed under the permissive MIT License. If you wish
17+
to use this in any project, you can simply include the following line:
18+
19+
CommentCoreLibrary (//github.com/jabbany/CommentCoreLibrary) - Licensed under the MIT license
3020

31-
CommentCoreLibrary (//github.com/jabbany/CommentCoreLibrary) -
32-
Licensed under the MIT license
33-
3421
## Examples and Documentation
35-
- Documentation can be found inside the /docs/ folder.
36-
- Some sample extension modules may be found in /extend/.
37-
- Experimental modules are in /experimental/.
38-
- You may test using test data found in /tests/.
22+
- Documentation can be found inside the `docs/` folder.
23+
- Some sample extension modules may be found in `extend/`.
24+
- Experimental modules are in `experimental/`.
25+
- You may test using test data found in `tests/`.
3926

4027
## Contributing
41-
Please feel free to fork the project on GitHub. Also, bug reports and
42-
feature requests are welcome!
28+
We encourage any contributions to this project, please read
29+
[CONTRIBUTING](CONTRIBUTING.md) for details on how to contribute to the project.
30+
31+
Also, feel free to have a look at our sister project
32+
[ABPlayerHTML5](https://github.com/jabbany/ABPlayerHTML5) for a reference
33+
implementation of a video player with CommentCoreLibrary.
4334

4435
# 弹幕核心通用构件
45-
弹幕播放核心是一套原始的基于JavaScript构建的弹幕控制器,意在催化HTML5下弹幕播放器的
46-
发展,和为希望了解弹幕播放器弹幕组件运作原理的开发者提供简单但是深入的入门。该播放器核心
47-
由ABPlayerHTML5衍生,并现在被其使用。开发者们可以根据弹幕播放核心来自定义自己的流媒体
48-
注视播放模式。
36+
弹幕核心通用构件是一套基于JavaScript构建的弹幕控制器,意在催化HTML5下弹幕播放器的发展。同时方便
37+
希望了解弹幕播放器运作原理的开发者,提供简单但是深入的入门。开发者们可以根据弹幕核心通用构件来自定义
38+
自己的流媒体注释播放模式。
4939

5040
不管你在开发基于Javascript的Web服务,还是其他的需要弹幕播放功能服务,都可以参考弹幕核心
5141
的实现代码。我们以简单的方法构建了 (1) 时间轴管理 (2) 基础空间规划 (3) 弹幕过滤 (4)
52-
高级弹幕效果 (5) 基础格式解析
42+
高级弹幕效果 (5) 基础格式解析 (6) 代码弹幕支持
5343

5444
## 测试
5545
你可以在[这里](http://jabbany.github.com/CommentCoreLibrary/demo) 访问到测试页面。
56-
我们欢迎各种BUG提交。如果你在用Linux,请确保你有标准中文字体(宋体 Simsun【必需】
57-
,黑体 Simhei【必需】,雅黑 Microsoft YaHei,幼圆 YouYuan,隶书),和日文字体
58-
(Mincho, Gothic)。
46+
我们欢迎各种[BUG报告](CONTRIBUTING.md)
5947

6048
## 许可
61-
本程序为教学用意,采取非常宽松的MIT许可。该许可允许你把本项目运用在任何开源或是闭源的,
62-
非营利或商业性的项目中。
49+
本项目采取非常宽松的MIT许可。该许可允许你把本项目运用在任何开源或是闭源的,非营利或商业性的项目中。
6350
您只需在使用到的地方添加下面一行注释:
6451

65-
CommentCoreLibrary (//github.com/jabbany/CommentCoreLibrary) -
66-
Licensed under the MIT license
52+
CommentCoreLibrary (//github.com/jabbany/CommentCoreLibrary) - Licensed under the MIT license
6753

6854
## 使用
69-
有关本项目的文档可以在 /docs/ 文件夹里面找到。一些功能性扩展模块会出现在 /extend/ 中。
70-
一些实验性模块在 /experimental/ 里面。
55+
- 有关本项目的文档可以在 `docs/` 文件夹里面找到。
56+
- 一些功能性扩展模块会出现在 `extend/` 中。
57+
- 一些实验性模块在 `experimental/` 里。
7158

7259
## 做出贡献
7360
非常欢迎提交问题报告和意见建议,同时你也可以在GitHub上Fork本工程,并发送Pull请求来提交
74-
你对项目的贡献。我们非常欢迎二次开发哟!
61+
你对项目的贡献。我们非常欢迎二次开发哟!有关具体介绍请参考 [CONTRIBUTING](CONTRIBUTING.md)
7562

76-
同时我们也欢迎对项目任何细节处的针对性研发,如解析功能,高级弹幕和CSS优化等。如果希望研发
77-
播放器的构造和功能,请参考 ABPlayerHTML5 项目~
63+
我们欢迎对项目任何细节处的针对性研发,尤其比如:解析功能、高级弹幕/代码弹幕和CSS优化等。
64+
如果希望研发播放器的构造和功能,请参考姊妹项目 ABPlayerHTML5

bower.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
{
22
"name": "CommentCoreLibrary",
33
"version": "0.9.0",
4+
"ignore": [
5+
"tests/**/*",
6+
"experimental/**/*",
7+
"demo/**/*"
8+
],
49
"dependencies": {
510
}
611
}

build/CommentCoreLibrary.js

Lines changed: 885 additions & 2 deletions
Large diffs are not rendered by default.

build/CommentCoreLibrary.min.js

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

0 commit comments

Comments
 (0)