Skip to content

Commit cbea986

Browse files
author
Kael
committed
doc: add documents about business methods and ua
1 parent 4810b11 commit cbea986

File tree

4 files changed

+88
-1
lines changed

4 files changed

+88
-1
lines changed

doc/api/neuron/biz.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Neuron Business Methods
2+
====
3+
4+
NR.data(): setter
5+
----
6+
存入一个或者一组值
7+
8+
### Syntax
9+
NR.data(key, value);
10+
NR.data(keyMap);
11+
12+
### Arguments
13+
#### key
14+
{string}
15+
16+
#### value
17+
{mixed}
18+
19+
#### keyMap
20+
{Object} 包含 `key: value` 的对象
21+
22+
23+
24+
NR.data(key): getter
25+
----
26+
读取一个值
27+
28+
29+
Example
30+
----
31+
NR.data({
32+
a: 1,
33+
b: "b"
34+
});
35+
36+
NR.data('a'); // 1

doc/api/neuron/loader/loader.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Outline
1111

1212
NR.define
1313
----
14+
Will be deprecated in Neuron 2.1
15+
1416
见 module-defining.md
1517

1618

doc/api/neuron/ua.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
Neuron UA
2+
====
3+
用户浏览器核心 与 platform 侦测
4+
5+
NR.UA
6+
----
7+
{Object} Neuron UA 对象,它包含如下属性
8+
9+
10+
NR.UA.\<engine\>
11+
----
12+
{int=} 它包括
13+
14+
- NR.UA.webkit
15+
- NR.UA.opera
16+
- NR.UA.ie
17+
- NR.UA.mozilla
18+
19+
### 说明
20+
当用户的浏览器引擎为 webkit 时,`NR.UA.webkit` 的值为当前浏览器核心或者浏览器的主版本号。
21+
22+
比如,用户的浏览器引擎核心为 AppleWebKit/537.11 时,有 `NR.UA.webkit === 537`
23+
24+
其他同理
25+
26+
NR.UA.version
27+
----
28+
{int=} 当前浏览器引擎核心的主版本
29+
30+
31+
NR.UA.fullVersion
32+
----
33+
{string} 当前浏览器核心的完整版本
34+
35+
NR.UA.\<platform\>
36+
----
37+
{true=} 它包括
38+
39+
- NR.UA.ios
40+
- NR.UA.webos
41+
- NR.UA.android
42+
- NR.UA.mac
43+
- NR.UA.win
44+
- NR.UA.linux
45+
46+
NR.UA.platform
47+
----
48+
{string=} 用户操作系统的简称,可以为 `"ios"`, `"webos"`, `"android"`, `"mac"`, `"win"`, `"linux"`, 或者 `undefined`
49+

lib/neuron/ua/ua.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var UA = K.UA = {},
3636

3737
if(match){
3838
ua[name] = ua.version = parseInt(match[1]);
39-
UA.fullVersion = match[1];
39+
UA.fullVersion = match[1];
4040
}
4141
}
4242
});

0 commit comments

Comments
 (0)