Skip to content
This repository was archived by the owner on Nov 28, 2020. It is now read-only.

Commit 1bfcfc2

Browse files
committed
Docs: Integrate changes into the document
1 parent bb8a511 commit 1bfcfc2

File tree

6 files changed

+85
-63
lines changed

6 files changed

+85
-63
lines changed

docs/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
## Documents
22
Check these documents to understand how to use functions and other functions!
33
We are committed to creating a good community environment.
4+
5+
*Test features will not available at documents but you can use it in typings file*
46
### Contents
57
- Constructors
68
* [peb.QuickAudio](./detail/cons-quickaudio.md)
9+
* [peb.RElement](./detail/cons-relement.md)
710
- Functions
811
<!-- A -->
912
* [peb.ajax()](./detail/func-ajax.md)
@@ -49,3 +52,5 @@ We are committed to creating a good community environment.
4952
* [peb.console](./detail/meth-log.md)
5053
### ProTips
5154
It is not recommended to view the documentation. Please use `peb.d.ts` typings file
55+
56+
The `Docs` folder may be **removed** in 4.0.0

docs/detail/cons-quickaudio.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Constructor `QuickAudio`
2-
The last updated version of this function: *3.0.0-pre.3*
2+
~~The last updated version of this function: *3.0.0-pre.3*~~
3+
4+
This method has been **deprecated**. Will be removed in 4.0.0.
35
## Construct
46
```javascript
5-
new peb.QuickAudio(url: string)
7+
new peb.QuickAudio(url)
68
```
79
Use JavaScript to play audio
810
## Object Method

docs/detail/cons-relement.md

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Constructor `RElement`
2+
**The last updated version of this function**: *3.1.0*
3+
## Browser Support
4+
| <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/chrome.svg" width="30" /> | <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/firefox.svg" width="30" /> | <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/safari.svg" width="30" /> | <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/opera.svg" width="30" /> | <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/edge.svg" width="30" /> |
5+
| :---: | :---: | :---: | :---: | :---: |
6+
| 45 | 39 | 10 | 32 | 12 |
7+
## Usage
8+
```javascript
9+
new peb.RElement(element)
10+
```
11+
12+
Referenced by [`peb.sel`]()
13+
## Properties
14+
### `.attr()`
15+
Get all attributes
16+
### `.attr(sequence: object)`
17+
Change all \[key\] attributes to \[key value\]
18+
### `.attr(name: string, value: string)`
19+
20+
Change the attribute `name` to `value` when available, otherwise, return the attribute value corresponding to `name`
21+
### `.data(name: string, value: string)`
22+
23+
Change the dataset `name` to `value` when available, otherwise, return the dataset value corresponding to `name`
24+
25+
### `insert(...nodes: Node[] | HTMLElement[] | RElement[])`
26+
Add child elements to the object
27+
28+
### `del()`
29+
Remove Element
30+
31+
### `.html(value?: string)`
32+
Get it if no parameters are passed in, otherwise set value to `value`
33+
34+
### `.text()`
35+
Get innerText
36+
37+
### `.val(value?: string)`
38+
Get it if no parameters are passed in, otherwise set value to `value`
39+
40+
### `.hide()`
41+
Hide element
42+
43+
### `.show(type?: string)
44+
set value of `Element.style.display` if passed in parameter, otherwise set display type to value of lastest time hide
45+
46+
### `.on(event: string, listener?: function)`
47+
Add event listener if `listener` is passed in, otherwise remove
48+
49+
### `.class()`
50+
Returns HTMLSettableTokenList
51+
52+
### `.style(sheet)`
53+
Set style by sheet. sheet is a object like `{width: .5em}`
54+
55+
### `.next()`
56+
Get next element sibling
57+
### `.prev()`
58+
Get previous element sibling
59+
### `.parent()`
60+
Get parent
61+
### `.child()`
62+
Get **first** child element
63+
*Tip:* Better effect with `.next()`
64+
### `.domReady(fn)`
65+
Do `fn` When dom content are ready
66+
### `.animate(ms, sheet)`
67+
Animate style to `sheet` in `ms` milliseconds

docs/detail/func-classof.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Function `switchCase()`
1+
# Function `classof()`
22
**The last updated version of this function**: *3.0.0-pre.3*
33
## Browser Support
44
| <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/chrome.svg" width="30" /> | <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/firefox.svg" width="30" /> | <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/safari.svg" width="30" /> | <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/opera.svg" width="30" /> | <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/edge.svg" width="30" /> |

docs/detail/func-sel.md

+3-57
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Function `sel()`
2-
**The last updated version of this function**: *2.0.0*
2+
**The last updated version of this function**: *3.1.0*
33
## Browser Support
44
| <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/chrome.svg" width="30" /> | <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/firefox.svg" width="30" /> | <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/safari.svg" width="30" /> | <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/opera.svg" width="30" /> | <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/edge.svg" width="30" /> |
55
| :---: | :---: | :---: | :---: | :---: |
@@ -8,62 +8,8 @@
88
```javascript
99
peb.sel(selector, itemIndex)
1010
```
11-
| Parameter | Type | Optional | Description |
12-
| :---: | :---: | :---: | :---: |
13-
| selector | `String` | | Query Selector to element |
14-
| itemIndex | `Number` | Yes | Item Index in collection |
15-
## Properties
16-
### ID Selector or passed in `itemIndex`
17-
#### `.attr()`
18-
Get all attributes
19-
#### `.attr(sequence: object)`
20-
Change all \[key\] attributes to \[key value\]
21-
#### `.attr(name: string, value: string)`
22-
23-
Change the attribute `name` to `value` when available, otherwise, return the attribute value corresponding to `name`
24-
#### `.data(name: string, value: string)`
25-
26-
Change the dataset `name` to `value` when available, otherwise, return the dataset value corresponding to `name`
27-
28-
#### `insert(...nodes: Node[] | HTMLElement[] | RElement[])`
29-
Add child elements to the object
30-
31-
#### `del()`
32-
Remove Element
33-
34-
#### `.html(value?: string)`
35-
Get it if no parameters are passed in, otherwise set value to `value`
36-
37-
#### `.text()`
38-
Get innerText
39-
40-
#### `.val(value?: string)`
41-
Get it if no parameters are passed in, otherwise set value to `value`
42-
43-
#### `.hide()`
44-
Hide element
45-
46-
#### `.show(type?: string)
47-
set value of `Element.style.display` if passed in parameter, otherwise set display type to value of lastest time hide
48-
49-
#### `.on(event: string, listener?: function)`
50-
Add event listener if `listener` is passed in, otherwise remove
51-
52-
#### `.class()`
53-
Returns HTMLSettableTokenList
54-
55-
#### `.style(sheet)`
56-
Set style by sheet. sheet is a object like `{width: .5em}`
57-
58-
#### `.next()`
59-
Get next element sibling
60-
#### `.prev()`
61-
Get previous element sibling
62-
#### `.parent()`
63-
Get parent
64-
#### `.child()`
65-
Get **first** child element
66-
*Tip:* Better effect with `.next()`
11+
### ID Selector or `itemIndex`
12+
[Reffer to `RElement`](cons-relement.md)
6713

6814
### And Others
6915
#### `.forEach(callbackFn: function, startIndex: number)`

docs/detail/html-peb-trans.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@ Version with this added: *2.3.0*
99
```
1010
#### JS
1111
```javascript
12-
const t = new peb.translationTabel({
12+
const t = new peb.TranslationTable({
1313
"en-us": {
14-
"generic.example_word": "That's a example text"
14+
"generic.example_word": "Example text"
1515
},
1616
"zh-cn": {
17-
"generic.example_word": "这是一个实例文本"
17+
"generic.example_word": "实例文本"
1818
}
1919
});
2020
t.translate("en-us");
2121
```
22+
#### Result
23+
Example text
2224
## Browser Support
2325
| <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/chrome.svg" width="30" /> | <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/firefox.svg" width="30" /> | <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/safari.svg" width="30" /> | <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/opera.svg" width="30" /> | <img src="https://cdn.jsdelivr.net/gh/TechPot-Studio/svg-gallery/edge.svg" width="30" /> |
2426
| :---: | :---: | :---: | :---: | :---: | :---: |

0 commit comments

Comments
 (0)