jsxc-react-hook 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +4 -1
- package/dist/jsxc.bundle.js +1 -1
- package/package.json +1 -1
- package/public/jsxc.bundle.js +1 -1
- package/src/Jsxc.tsx +19 -10
- package/src/Sel.tsx +7 -7
- package/src/lib/styles/jsxc.bundle.css +3 -3
package/src/Jsxc.tsx
CHANGED
@@ -16,6 +16,9 @@ export interface JsxcProp {
|
|
16
16
|
fullscreen?: boolean;
|
17
17
|
jqueryUrl?: string;
|
18
18
|
showMenu: "yes"|"no";
|
19
|
+
showAudioButton: "yes"|"no";
|
20
|
+
showVideoButton: "yes"|"no";
|
21
|
+
showOfflineButton: "yes"|"no";
|
19
22
|
}
|
20
23
|
|
21
24
|
export async function directOpenChatWindow(jid: string) {
|
@@ -33,7 +36,6 @@ export function Jsxc(prop: JsxcProp) {
|
|
33
36
|
const windowListAppend = 'windowlist-append';
|
34
37
|
const dialogAppend = 'dialog-append';
|
35
38
|
const {
|
36
|
-
|
37
39
|
jqueryUrl = 'https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.js',
|
38
40
|
marginTop = '40px',
|
39
41
|
marginLeft = '40px',
|
@@ -44,7 +46,10 @@ export function Jsxc(prop: JsxcProp) {
|
|
44
46
|
fullscreen,
|
45
47
|
boshUrl,
|
46
48
|
id,
|
47
|
-
pw
|
49
|
+
pw,
|
50
|
+
showAudioButton,
|
51
|
+
showVideoButton,
|
52
|
+
showOfflineButton,
|
48
53
|
} = prop;
|
49
54
|
|
50
55
|
userJid = id;
|
@@ -75,9 +80,6 @@ export function Jsxc(prop: JsxcProp) {
|
|
75
80
|
root.style.setProperty('--jsxc-margin-bottom', marginBottom);
|
76
81
|
root.style.setProperty('--jsxc-margin-right', marginRight);
|
77
82
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
83
|
script.onload = ()=> { localStorage.removeItem('jsxc2:accounts'); // for fobidden show 'account has ..' error message;
|
82
84
|
let jsx = new (window as any).JSXC({
|
83
85
|
/* loadConnectionOptions: function(username: any, password: any) {
|
@@ -91,19 +93,26 @@ export function Jsxc(prop: JsxcProp) {
|
|
91
93
|
rosterAppend: '#' + rosterAppend,
|
92
94
|
dialogAppend: '#' + dialogAppend,
|
93
95
|
windowListAppend: '#' + windowListAppend,
|
96
|
+
lang: 'zh'
|
94
97
|
});
|
95
98
|
(window as any).jsxc = jsx;
|
96
99
|
jsx.start(boshUrl, id, pw);}
|
97
100
|
|
98
|
-
if (showMenu === '
|
101
|
+
if (showMenu === 'no') {
|
99
102
|
root.style.setProperty('--jsxc-show-menu', 'none');
|
100
|
-
console.log('not show jsxc menu')
|
101
103
|
}
|
102
|
-
|
103
|
-
|
104
|
+
if (showAudioButton === 'no') {
|
105
|
+
root.style.setProperty('--jsxc-show-audio-button', 'none');
|
106
|
+
}
|
107
|
+
if (showVideoButton === 'no') {
|
108
|
+
root.style.setProperty('--jsxc-show-video-button', 'none');
|
109
|
+
}
|
110
|
+
if (showOfflineButton === 'no') {
|
111
|
+
root.style.setProperty('--jsxc-show-offline-button', 'none');
|
112
|
+
}
|
113
|
+
|
104
114
|
},[]);
|
105
115
|
|
106
|
-
|
107
116
|
return (
|
108
117
|
// <Keepalive>
|
109
118
|
<div id='jsxc-containers' style={{width: '100%', height: '100%'}} >
|
package/src/Sel.tsx
CHANGED
@@ -10,17 +10,17 @@ export default function Sel() {
|
|
10
10
|
width: 400, height: 400
|
11
11
|
}
|
12
12
|
}>
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
{sel &&
|
14
|
+
<Jsxc boshUrl = 'https://localhost:5443/bosh' fullscreen={true}
|
15
|
+
id= 'user1@localhost' pw='987654'
|
16
|
+
showMenu={'yes'} showAudioButton={'no'} showVideoButton={'yes'}
|
17
|
+
showOfflineButton='yes'
|
18
|
+
/>
|
19
|
+
}
|
18
20
|
|
19
21
|
{!sel && <div>hellow world</div> }
|
20
22
|
<button onClick={()=>{setsel(!sel)}}>show</button>
|
21
23
|
</div>
|
22
|
-
|
23
|
-
|
24
24
|
);
|
25
25
|
|
26
26
|
}
|