mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-29 11:11:20 -08:00
Refactor documentation for clarity and consistency
- Updated descriptions and terminology across various component documentation files for improved clarity. - Changed headings and section titles for better readability and consistency. - Enhanced the language and structure of the documentation to provide clearer guidance on usage and configuration. - Removed the `fix-docs.js` script as its functionality has been integrated into the translation process. - Improved the translation script to handle Markdown code block issues and added retry logic for API calls.
This commit is contained in:
1 parent
3adff76edf
commit
92f09a4290
15 files changed
+413
-372
No files matched your search
@@ -7,11 +7,11 @@
|
||||
| `disable` | `Boolean` | Whether to disable the component |
|
||||
| `name` | `String` | Unique component name for CSS class |
|
||||
| `index` | `Number` | Component index for display priority |
|
||||
| `html` | `String`, `Element` | Component DOM element |
|
||||
| `html` | `String`, `Element` | DOM element of the component |
|
||||
| `style` | `Object` | Component style object |
|
||||
| `click` | `Function` | Component click event |
|
||||
| `mounted` | `Function` | Triggered after component mount |
|
||||
| `tooltip` | `String` | Component tooltip text |
|
||||
| `tooltip` | `String` | Tooltip text for the component |
|
||||
|
||||
## Creation
|
||||
|
||||
@@ -64,7 +64,7 @@ art.contextmenu.show = true;
|
||||
console.info(art.contextmenu['your-menu']);
|
||||
```
|
||||
|
||||
## Removal
|
||||
## Deletion
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
|
||||
## Configuration
|
||||
|
||||
| Property | Type | Description |
|
||||
| ----------- | ------------------- | ------------------------------------------------ |
|
||||
| `disable` | `Boolean` | Whether to disable the control |
|
||||
| `name` | `String` | Unique control name for CSS class identification |
|
||||
| `index` | `Number` | Control index for display priority |
|
||||
| `html` | `String`, `Element` | Control's DOM element |
|
||||
| `style` | `Object` | Control style object |
|
||||
| `click` | `Function` | Control click event handler |
|
||||
| `mounted` | `Function` | Triggered after control is mounted |
|
||||
| `tooltip` | `String` | Control tooltip text |
|
||||
| `position` | `String` | `left` or `right` - controls display position |
|
||||
| `selector` | `Array` | Array of selector list objects |
|
||||
| `onSelect` | `Function` | Function triggered when selector item is clicked |
|
||||
| Property | Type | Description |
|
||||
| ---------- | ------------------- | ------------------------------------------------ |
|
||||
| `disable` | `Boolean` | Whether to disable the control |
|
||||
| `name` | `String` | Unique name of the control, used for class marking |
|
||||
| `index` | `Number` | Control index, determines display priority |
|
||||
| `html` | `String`, `Element` | DOM element of the control |
|
||||
| `style` | `Object` | Style object for the control |
|
||||
| `click` | `Function` | Click event handler for the control |
|
||||
| `mounted` | `Function` | Triggered after the control is mounted |
|
||||
| `tooltip` | `String` | Tooltip text for the control |
|
||||
| `position` | `String` | `left` or `right` - controls which side the control appears on |
|
||||
| `selector` | `Array` | Array of objects for selection list |
|
||||
| `onSelect` | `Function` | Function triggered when a selection list item is clicked |
|
||||
|
||||
## Creation
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Layer
|
||||
# Layers
|
||||
|
||||
## Configuration
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Built-in
|
||||
|
||||
First, you need to open the settings panel. It comes with four built-in items: `flip`, `playbackRate`, `aspectRatio`, `subtitleOffset`
|
||||
First, you need to open the settings panel. It comes with four built-in items: `flip`, `playbackRate`, `aspectRatio`, `subtitleOffset`.
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -10,7 +10,7 @@ First, you need to open the settings panel. It comes with four built-in items: `
|
||||
var art = new Artplayer({
|
||||
container: '.artplayer-app',
|
||||
url: '/assets/sample/video.mp4',
|
||||
setting: true,
|
||||
setting: true,
|
||||
flip: true,
|
||||
playbackRate: true,
|
||||
aspectRatio: true,
|
||||
@@ -18,15 +18,15 @@ var art = new Artplayer({
|
||||
});
|
||||
```
|
||||
|
||||
## Creating - Buttons
|
||||
## Create - Button
|
||||
|
||||
| Property | Type | Description |
|
||||
| --------- | ------------------- | -------------------- |
|
||||
| `html` | `String`, `Element` | Element DOM |
|
||||
| `icon` | `String`, `Element` | Element icon |
|
||||
| `onClick` | `Function` | Element click event |
|
||||
| `width` | `Number` | List width |
|
||||
| `tooltip` | `String` | Tooltip text |
|
||||
| Property | Type | Description |
|
||||
| ---------- | ------------------- | -------------------- |
|
||||
| `html` | `String`, `Element` | The DOM element |
|
||||
| `icon` | `String`, `Element` | The icon element |
|
||||
| `onClick` | `Function` | The click event |
|
||||
| `width` | `Number` | The list width |
|
||||
| `tooltip` | `String` | The tooltip text |
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -40,25 +40,25 @@ var art = new Artplayer({
|
||||
html: 'Button',
|
||||
icon: '<img width="22" height="22" src="/assets/img/state.svg">',
|
||||
tooltip: 'tooltip',
|
||||
onClick(item, $dom, event) {
|
||||
onClick(item, $dom, event) {
|
||||
console.info(item, $dom, event);
|
||||
return 'new tooltip'
|
||||
}
|
||||
return 'new tooltip';
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
```
|
||||
|
||||
## Creating - Selection Lists
|
||||
## Create - Selection List
|
||||
|
||||
| Property | Type | Description |
|
||||
| --------- | ------------------- | -------------------- |
|
||||
| `html` | `String`, `Element` | Element DOM |
|
||||
| `icon` | `String`, `Element` | Element icon |
|
||||
| `selector`| `Array` | Element list |
|
||||
| `onSelect`| `Function` | Element click event |
|
||||
| `width` | `Number` | List width |
|
||||
| `tooltip` | `String` | Tooltip text |
|
||||
| Property | Type | Description |
|
||||
| ---------- | ------------------- | -------------------- |
|
||||
| `html` | `String`, `Element` | The DOM element |
|
||||
| `icon` | `String`, `Element` | The icon element |
|
||||
| `selector` | `Array` | The list of elements |
|
||||
| `onSelect` | `Function` | The click event |
|
||||
| `width` | `Number` | The list width |
|
||||
| `tooltip` | `String` | The tooltip text |
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -118,7 +118,7 @@ var art = new Artplayer({
|
||||
});
|
||||
```
|
||||
|
||||
## Creating - Nested Lists
|
||||
## Create - Nested List
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -172,13 +172,13 @@ var art = new Artplayer({
|
||||
|
||||
## Create - Toggle Button
|
||||
|
||||
| Property | Type | Description |
|
||||
| ---------- | ------------------- | ------------------------- |
|
||||
| `html` | `String`, `Element` | DOM element of the item |
|
||||
| `icon` | `String`, `Element` | Icon of the item |
|
||||
| Property | Type | Description |
|
||||
| ---------- | ------------------- | -------------------------- |
|
||||
| `html` | `String`, `Element` | DOM element for the item |
|
||||
| `icon` | `String`, `Element` | Icon for the item |
|
||||
| `switch` | `Boolean` | Default state of the button |
|
||||
| `onSwitch` | `Function` | Button toggle event |
|
||||
| `tooltip` | `String` | Tooltip text |
|
||||
| `onSwitch` | `Function` | Button toggle event |
|
||||
| `tooltip` | `String` | Tooltip text |
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -207,14 +207,14 @@ var art = new Artplayer({
|
||||
|
||||
## Create - Range Slider
|
||||
|
||||
| Property | Type | Description |
|
||||
| ---------- | ------------------- | ------------------------- |
|
||||
| `html` | `String`, `Element` | DOM element of the item |
|
||||
| `icon` | `String`, `Element` | Icon of the item |
|
||||
| `range` | `Array` | Default state array |
|
||||
| Property | Type | Description |
|
||||
| ---------- | ------------------- | -------------------------- |
|
||||
| `html` | `String`, `Element` | DOM element for the item |
|
||||
| `icon` | `String`, `Element` | Icon for the item |
|
||||
| `range` | `Array` | Default state array |
|
||||
| `onRange` | `Function` | Event triggered on completion |
|
||||
| `onChange` | `Function` | Event triggered on change |
|
||||
| `tooltip` | `String` | Tooltip text |
|
||||
| `onChange` | `Function` | Event triggered on change |
|
||||
| `tooltip` | `String` | Tooltip text |
|
||||
|
||||
```js
|
||||
const range = [5, 1, 10, 1];
|
||||
|
||||
Reference in new issue
Block a user