Skip to content

Commit

Permalink
Merge pull request #30 from iotum/add-set-hidden-elements
Browse files Browse the repository at this point in the history
Add set hidden elements
  • Loading branch information
rex-iotum authored Aug 6, 2024
2 parents 655598a + c2b0a05 commit a89dda0
Show file tree
Hide file tree
Showing 19 changed files with 175 additions and 110 deletions.
5 changes: 5 additions & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ declare module '@iotum/callbridge-js/dashboard' {
* a positive value moves forwards.
*/
go(delta: number): void;
/**
* Hides elements on the dashboard.
* @param ids An array of element IDs to hide.
*/
setHiddenElements(ids: number[]): void;
}

}
Expand Down
7 changes: 7 additions & 0 deletions dist/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,13 @@ var Dashboard = class extends Widget {
go(delta) {
this._send("dashboard", "go", { delta });
}
/**
* Hides elements on the dashboard.
* @param ids An array of element IDs to hide.
*/
setHiddenElements(ids) {
this._send("dashboard", "setHiddenElements", { ids });
}
};

// src/room.ts
Expand Down
7 changes: 7 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,13 @@ var Dashboard = class extends Widget {
go(delta) {
this._send("dashboard", "go", { delta });
}
/**
* Hides elements on the dashboard.
* @param ids An array of element IDs to hide.
*/
setHiddenElements(ids) {
this._send("dashboard", "setHiddenElements", { ids });
}
};

// src/room.ts
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@iotum/callbridge-js",
"description": "Loading wrapper for Callbridge",
"version": "1.0.12",
"version": "1.0.13",
"author": "Iotum (https://www.iotum.com)",
"license": "MIT",
"homepage": "https://www.callbridge.com/",
Expand Down
15 changes: 15 additions & 0 deletions src/__tests__/dashboard-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,19 @@ describe('dashboard', () => {
'*',
);
});

it('can set hidden elements', () => {
dashboard = new Dashboard({ container, domain }, service);

dashboard.setHiddenElements([1, 2, 3, 4]);

expect(dashboard.wnd?.postMessage).toHaveBeenCalledWith(
{
type: 'dashboard',
action: 'setHiddenElements',
ids: [1, 2, 3, 4],
},
'*',
);
});
});
8 changes: 8 additions & 0 deletions src/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,12 @@ export default class Dashboard extends Widget<{
go(delta: number) {
this._send('dashboard', 'go', { delta });
}

/**
* Hides elements on the dashboard.
* @param ids An array of element IDs to hide.
*/
setHiddenElements(ids: number[]) {
this._send('dashboard', 'setHiddenElements', { ids });
}
}
12 changes: 6 additions & 6 deletions wiki/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Audio output settings.

#### Defined in

[room.ts:6](https://github.com/iotum/callbridge-js/blob/c1b8887/src/room.ts#L6)
[room.ts:6](https://github.com/iotum/callbridge-js/blob/8719b43/src/room.ts#L6)

___

Expand All @@ -65,7 +65,7 @@ ___

#### Defined in

[dashboard.ts:86](https://github.com/iotum/callbridge-js/blob/c1b8887/src/dashboard.ts#L86)
[dashboard.ts:86](https://github.com/iotum/callbridge-js/blob/8719b43/src/dashboard.ts#L86)

___

Expand All @@ -85,7 +85,7 @@ Livestream options.

#### Defined in

[livestream.ts:6](https://github.com/iotum/callbridge-js/blob/c1b8887/src/livestream.ts#L6)
[livestream.ts:6](https://github.com/iotum/callbridge-js/blob/8719b43/src/livestream.ts#L6)

___

Expand Down Expand Up @@ -116,7 +116,7 @@ Meeting options.

#### Defined in

[meeting.ts:7](https://github.com/iotum/callbridge-js/blob/c1b8887/src/meeting.ts#L7)
[meeting.ts:7](https://github.com/iotum/callbridge-js/blob/8719b43/src/meeting.ts#L7)

___

Expand All @@ -138,7 +138,7 @@ Dashboard service options.

#### Defined in

[dashboard.ts:59](https://github.com/iotum/callbridge-js/blob/c1b8887/src/dashboard.ts#L59)
[dashboard.ts:59](https://github.com/iotum/callbridge-js/blob/8719b43/src/dashboard.ts#L59)

___

Expand All @@ -165,4 +165,4 @@ Widget options.

#### Defined in

[widget.ts:9](https://github.com/iotum/callbridge-js/blob/c1b8887/src/widget.ts#L9)
[widget.ts:9](https://github.com/iotum/callbridge-js/blob/8719b43/src/widget.ts#L9)
49 changes: 36 additions & 13 deletions wiki/classes/Dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Callbridge Dashboard.
- [on](Dashboard.md#on)
- [once](Dashboard.md#once)
- [removeAllListeners](Dashboard.md#removealllisteners)
- [setHiddenElements](Dashboard.md#sethiddenelements)
- [toggle](Dashboard.md#toggle)
- [unload](Dashboard.md#unload)

Expand All @@ -54,7 +55,7 @@ Callbridge Dashboard.

#### Defined in

[dashboard.ts:139](https://github.com/iotum/callbridge-js/blob/c1b8887/src/dashboard.ts#L139)
[dashboard.ts:139](https://github.com/iotum/callbridge-js/blob/8719b43/src/dashboard.ts#L139)

## Accessors

Expand All @@ -74,7 +75,7 @@ Widget.instance

#### Defined in

[widget.ts:267](https://github.com/iotum/callbridge-js/blob/c1b8887/src/widget.ts#L267)
[widget.ts:267](https://github.com/iotum/callbridge-js/blob/8719b43/src/widget.ts#L267)

___

Expand All @@ -94,7 +95,7 @@ Widget.isReady

#### Defined in

[widget.ts:260](https://github.com/iotum/callbridge-js/blob/c1b8887/src/widget.ts#L260)
[widget.ts:260](https://github.com/iotum/callbridge-js/blob/8719b43/src/widget.ts#L260)

___

Expand All @@ -114,7 +115,7 @@ Widget.wnd

#### Defined in

[widget.ts:274](https://github.com/iotum/callbridge-js/blob/c1b8887/src/widget.ts#L274)
[widget.ts:274](https://github.com/iotum/callbridge-js/blob/8719b43/src/widget.ts#L274)

## Methods

Expand Down Expand Up @@ -149,7 +150,7 @@ Returns true if the event had listeners, false otherwise.

#### Defined in

[widget.ts:313](https://github.com/iotum/callbridge-js/blob/c1b8887/src/widget.ts#L313)
[widget.ts:313](https://github.com/iotum/callbridge-js/blob/8719b43/src/widget.ts#L313)

___

Expand All @@ -171,7 +172,7 @@ Loads a specific page from the session history.

#### Defined in

[dashboard.ts:184](https://github.com/iotum/callbridge-js/blob/c1b8887/src/dashboard.ts#L184)
[dashboard.ts:184](https://github.com/iotum/callbridge-js/blob/8719b43/src/dashboard.ts#L184)

___

Expand All @@ -194,7 +195,7 @@ Loads the service.

#### Defined in

[dashboard.ts:174](https://github.com/iotum/callbridge-js/blob/c1b8887/src/dashboard.ts#L174)
[dashboard.ts:174](https://github.com/iotum/callbridge-js/blob/8719b43/src/dashboard.ts#L174)

___

Expand Down Expand Up @@ -227,7 +228,7 @@ Removes the specified `listener` from the listener array for the event named `ev

#### Defined in

[widget.ts:294](https://github.com/iotum/callbridge-js/blob/c1b8887/src/widget.ts#L294)
[widget.ts:294](https://github.com/iotum/callbridge-js/blob/8719b43/src/widget.ts#L294)

___

Expand Down Expand Up @@ -260,7 +261,7 @@ Adds the `listener` function to the end of the listeners array for the event nam

#### Defined in

[widget.ts:286](https://github.com/iotum/callbridge-js/blob/c1b8887/src/widget.ts#L286)
[widget.ts:286](https://github.com/iotum/callbridge-js/blob/8719b43/src/widget.ts#L286)

___

Expand Down Expand Up @@ -294,7 +295,7 @@ The next time eventName is triggered, this listener is removed and then invoked.

#### Defined in

[widget.ts:303](https://github.com/iotum/callbridge-js/blob/c1b8887/src/widget.ts#L303)
[widget.ts:303](https://github.com/iotum/callbridge-js/blob/8719b43/src/widget.ts#L303)

___

Expand Down Expand Up @@ -323,7 +324,29 @@ particularly when the instance was created by some other component or module.

#### Defined in

[widget.ts:323](https://github.com/iotum/callbridge-js/blob/c1b8887/src/widget.ts#L323)
[widget.ts:323](https://github.com/iotum/callbridge-js/blob/8719b43/src/widget.ts#L323)

___

### setHiddenElements

**setHiddenElements**(`ids`): `void`

Hides elements on the dashboard.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `ids` | `number`[] | An array of element IDs to hide. |

#### Returns

`void`

#### Defined in

[dashboard.ts:192](https://github.com/iotum/callbridge-js/blob/8719b43/src/dashboard.ts#L192)

___

Expand Down Expand Up @@ -351,7 +374,7 @@ Not available for pop-up.

#### Defined in

[widget.ts:251](https://github.com/iotum/callbridge-js/blob/c1b8887/src/widget.ts#L251)
[widget.ts:251](https://github.com/iotum/callbridge-js/blob/8719b43/src/widget.ts#L251)

___

Expand All @@ -371,4 +394,4 @@ Unloads the widget by removing the iframe or close the tab/window.

#### Defined in

[widget.ts:223](https://github.com/iotum/callbridge-js/blob/c1b8887/src/widget.ts#L223)
[widget.ts:223](https://github.com/iotum/callbridge-js/blob/8719b43/src/widget.ts#L223)
22 changes: 11 additions & 11 deletions wiki/classes/Livestream.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Callbridge Livesteam Viewer.

#### Defined in

[livestream.ts:28](https://github.com/iotum/callbridge-js/blob/c1b8887/src/livestream.ts#L28)
[livestream.ts:28](https://github.com/iotum/callbridge-js/blob/8719b43/src/livestream.ts#L28)

## Accessors

Expand All @@ -72,7 +72,7 @@ Widget.instance

#### Defined in

[widget.ts:267](https://github.com/iotum/callbridge-js/blob/c1b8887/src/widget.ts#L267)
[widget.ts:267](https://github.com/iotum/callbridge-js/blob/8719b43/src/widget.ts#L267)

___

Expand All @@ -92,7 +92,7 @@ Widget.isReady

#### Defined in

[widget.ts:260](https://github.com/iotum/callbridge-js/blob/c1b8887/src/widget.ts#L260)
[widget.ts:260](https://github.com/iotum/callbridge-js/blob/8719b43/src/widget.ts#L260)

___

Expand All @@ -112,7 +112,7 @@ Widget.wnd

#### Defined in

[widget.ts:274](https://github.com/iotum/callbridge-js/blob/c1b8887/src/widget.ts#L274)
[widget.ts:274](https://github.com/iotum/callbridge-js/blob/8719b43/src/widget.ts#L274)

## Methods

Expand Down Expand Up @@ -147,7 +147,7 @@ Returns true if the event had listeners, false otherwise.

#### Defined in

[widget.ts:313](https://github.com/iotum/callbridge-js/blob/c1b8887/src/widget.ts#L313)
[widget.ts:313](https://github.com/iotum/callbridge-js/blob/8719b43/src/widget.ts#L313)

___

Expand Down Expand Up @@ -180,7 +180,7 @@ Removes the specified `listener` from the listener array for the event named `ev

#### Defined in

[widget.ts:294](https://github.com/iotum/callbridge-js/blob/c1b8887/src/widget.ts#L294)
[widget.ts:294](https://github.com/iotum/callbridge-js/blob/8719b43/src/widget.ts#L294)

___

Expand Down Expand Up @@ -213,7 +213,7 @@ Adds the `listener` function to the end of the listeners array for the event nam

#### Defined in

[widget.ts:286](https://github.com/iotum/callbridge-js/blob/c1b8887/src/widget.ts#L286)
[widget.ts:286](https://github.com/iotum/callbridge-js/blob/8719b43/src/widget.ts#L286)

___

Expand Down Expand Up @@ -247,7 +247,7 @@ The next time eventName is triggered, this listener is removed and then invoked.

#### Defined in

[widget.ts:303](https://github.com/iotum/callbridge-js/blob/c1b8887/src/widget.ts#L303)
[widget.ts:303](https://github.com/iotum/callbridge-js/blob/8719b43/src/widget.ts#L303)

___

Expand Down Expand Up @@ -276,7 +276,7 @@ particularly when the instance was created by some other component or module.

#### Defined in

[widget.ts:323](https://github.com/iotum/callbridge-js/blob/c1b8887/src/widget.ts#L323)
[widget.ts:323](https://github.com/iotum/callbridge-js/blob/8719b43/src/widget.ts#L323)

___

Expand Down Expand Up @@ -304,7 +304,7 @@ Not available for pop-up.

#### Defined in

[widget.ts:251](https://github.com/iotum/callbridge-js/blob/c1b8887/src/widget.ts#L251)
[widget.ts:251](https://github.com/iotum/callbridge-js/blob/8719b43/src/widget.ts#L251)

___

Expand All @@ -324,4 +324,4 @@ Unloads the widget by removing the iframe or close the tab/window.

#### Defined in

[widget.ts:223](https://github.com/iotum/callbridge-js/blob/c1b8887/src/widget.ts#L223)
[widget.ts:223](https://github.com/iotum/callbridge-js/blob/8719b43/src/widget.ts#L223)
Loading

0 comments on commit a89dda0

Please sign in to comment.