Skip to content

Commit 7330386

Browse files
[update] minor changes after review
1 parent 751e132 commit 7330386

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+421
-370
lines changed

docs/api/config/toolbar.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: You can learn about the toolbar config in the documentation of the
88

99
### Description
1010

11-
@short: Optional. Enables toolbar and specifies buttons displayed within Toolbar
11+
@short: Optional. Enables toolbar and allows users to specify/configure buttons displayed within toolbar
1212

1313
### Usage
1414

@@ -52,7 +52,7 @@ You can specify the following buttons in the RichText toolbar:
5252
| `shortcuts` | Displays a list of available keyboard shortcuts. |
5353
| `separator` | Adds a visual separator between toolbar groups. |
5454

55-
You can use these strings to configure toolbar buttons as follow:
55+
You can use these strings to configure toolbar buttons as follows:
5656

5757
~~~jsx {2-7}
5858
new richtext.Richtext("#root", {
@@ -77,8 +77,6 @@ You can specify custom buttons as objects with the following parameters:
7777
- `css` - (optional) a css class name assigned to the control (default supported classes: wx-primary, wx-secondary)
7878
- `handler` - (optional) a callback function that executes when the button is clicked
7979

80-
You can specify custom buttons within a toolbar as follow:
81-
8280
~~~jsx {6-32}
8381
new richtext.Richtext("#root", {
8482
toolbar: [
@@ -168,10 +166,24 @@ const defaultToolbarButtons = {
168166
~~~
169167

170168
:::tip
171-
You can import default toolbar controls as follows:
169+
Default toolbar controls are exported by the RichText widget and can be accessed via `richtext.defaultToolbarButtons`.
172170

173-
```jsx
174-
richtext.defaultToolbarButtons
171+
```jsx{4}
172+
// initialize RichText
173+
new richtext.Richtext("#root", {
174+
toolbar: [
175+
...richtext.defaultToolbarButtons,
176+
{
177+
type: "button",
178+
id: "btn1", // button id (cannot overlap with existing button ids if you want to apply custom logic)
179+
icon: "wxo-help", // button icon (combines with label)
180+
css: "rounded", // css class name assigned to the control (default supported classes: wx-primary, wx-secondary)
181+
label: "Custom button", // button label (combines with icon)
182+
tooltip: "Some tooltip", // tooltip displayed on hover (if not specified, uses the value from "label")
183+
}
184+
]
185+
// other configuration properties
186+
});
175187
```
176188
:::
177189

docs/api/events/align.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The callback of the **align** event can take an object with the following parame
2525
- `align` - a text alignment. You can specify one of the following values: `"left" | "center" | "right" | "justify"`
2626

2727
:::info
28-
For handling inner events you can use [**Event Bus methods**](/category/event-bus-methods/)
28+
For handling inner events you can use [**Event Bus methods**](api/overview/event_bus_methods_overview.md)
2929
:::
3030

3131
### Example

docs/api/events/clear-text-format.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ description: You can learn about the clear-text-format event in the documentatio
1717
~~~
1818

1919
:::info
20-
For handling inner events you can use [**Event Bus methods**](/category/event-bus-methods/)
20+
For handling inner events you can use [**Event Bus methods**](api/overview/event_bus_methods_overview.md)
2121
:::
2222

2323
### Example

docs/api/events/copy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ description: You can learn about the copy event in the documentation of the DHTM
1717
~~~
1818

1919
:::info
20-
For handling inner events you can use [**Event Bus methods**](/category/event-bus-methods/)
20+
For handling inner events you can use [**Event Bus methods**](api/overview/event_bus_methods_overview.md)
2121
:::
2222

2323
### Example

docs/api/events/create-new.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The callback of the **create-new** event can take an object with the following p
2323
- `reset` - resets the history when creating a new file
2424

2525
:::info
26-
For handling inner events you can use [**Event Bus methods**](/category/event-bus-methods/)
26+
For handling inner events you can use [**Event Bus methods**](api/overview/event_bus_methods_overview.md)
2727
:::
2828

2929
### Example

docs/api/events/cut.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ description: You can learn about the cut event in the documentation of the DHTML
1717
~~~
1818

1919
:::info
20-
For handling inner events you can use [**Event Bus methods**](/category/event-bus-methods/)
20+
For handling inner events you can use [**Event Bus methods**](api/overview/event_bus_methods_overview.md)
2121
:::
2222

2323
### Example

docs/api/events/delete-link.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ description: You can learn about the delete-link event in the documentation of t
1717
~~~
1818

1919
:::info
20-
For handling inner events you can use [**Event Bus methods**](/category/event-bus-methods/)
20+
For handling inner events you can use [**Event Bus methods**](api/overview/event_bus_methods_overview.md)
2121
:::
2222

2323
### Example

docs/api/events/export.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The callback of **export** event can take an object with the following parameter
3333
- `fileName` - a file name to be exported
3434

3535
:::info
36-
For handling inner events you can use [**Event Bus methods**](/category/event-bus-methods/)
36+
For handling inner events you can use [**Event Bus methods**](api/overview/event_bus_methods_overview.md)
3737
:::
3838

3939
### Example

docs/api/events/import.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The callback of **import** event can take an object with the following parameter
2323
- `html` - a text value in the html format
2424

2525
:::info
26-
For handling inner events you can use [**Event Bus methods**](/category/event-bus-methods/)
26+
For handling inner events you can use [**Event Bus methods**](api/overview/event_bus_methods_overview.md)
2727
:::
2828

2929
### Example

docs/api/events/indent.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The callback of the **indent** event can take an object with the following param
2323
- `step` - the step by which indentation was increased
2424

2525
:::info
26-
For handling inner events you can use [**Event Bus methods**](/category/event-bus-methods/)
26+
For handling inner events you can use [**Event Bus methods**](api/overview/event_bus_methods_overview.md)
2727
:::
2828

2929
### Example
@@ -36,7 +36,7 @@ const editor = new richtext.Richtext("#root", {
3636
// subscribe to the "indent" event
3737
editor.api.on("indent", (obj) => {
3838
console.log(obj);
39-
console.log("The indent was added");
39+
console.log("The indention was increased");
4040
});
4141
~~~
4242

0 commit comments

Comments
 (0)