Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sfu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alain Takoudjou
sfu
Commits
667412e6
Commit
667412e6
authored
Sep 23, 2020
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement /set command.
parent
cca19444
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
2 deletions
+60
-2
README
README
+3
-0
static/sfu.css
static/sfu.css
+5
-0
static/sfu.js
static/sfu.js
+52
-2
No files found.
README
View file @
667412e6
...
...
@@ -109,6 +109,9 @@ to all users:
- `/me text`: sends a chat message starting with the sender's username;
- `/leave`: equivalent to clicking the *Disconnect* button.
- `/set var val`: sets the value of a configuration variable without any
error checking. Without parameters, displays the current configuration.
- `/unset var`: removes a configuration variable.
The following commands are only available to users with operator
privileges:
...
...
static/sfu.css
View file @
667412e6
...
...
@@ -297,6 +297,11 @@ textarea.form-reply {
background
:
#ececec
;
}
.message-system
{
font-size
:
10px
;
background
:
#ececec
;
}
.message-row
:after
,
.message-row
:before
{
display
:
table
;
content
:
" "
;
...
...
static/sfu.js
View file @
667412e6
...
...
@@ -126,6 +126,27 @@ function updateSettings(settings) {
storeSettings
(
s
);
}
/**
* @param {string} key
* @param {any} value
*/
function
updateSetting
(
key
,
value
)
{
let
s
=
{};
s
[
key
]
=
value
;
updateSettings
(
s
);
}
/**
* @param {string} key
*/
function
delSetting
(
key
)
{
let
s
=
getSettings
();
if
(
!
(
key
in
s
))
return
;
delete
(
s
[
key
]);
storeSettings
(
s
)
}
/**
* @param {string} id
*/
...
...
@@ -1209,7 +1230,9 @@ function addToChatbox(peerId, nick, kind, message){
let
container
=
document
.
createElement
(
'
div
'
);
container
.
classList
.
add
(
'
message
'
);
row
.
appendChild
(
container
);
if
(
userpass
.
username
===
nick
)
{
if
(
!
peerId
)
container
.
classList
.
add
(
'
message-system
'
);
else
if
(
userpass
.
username
===
nick
)
{
container
.
classList
.
add
(
'
message-sender
'
);
}
if
(
kind
!==
'
me
'
)
{
...
...
@@ -1333,6 +1356,33 @@ function handleInput() {
}
serverConnection
.
groupAction
(
'
clearchat
'
);
return
;
case
'
/set
'
:
if
(
!
rest
)
{
let
settings
=
getSettings
();
let
s
=
""
;
for
(
let
key
in
settings
)
s
=
s
+
`
${
key
}
:
${
JSON
.
stringify
(
settings
[
key
])}
\n`
addToChatbox
(
null
,
null
,
null
,
s
);
return
;
}
let
parsed
=
parseCommand
(
rest
);
let
value
;
if
(
parsed
[
1
])
{
try
{
value
=
JSON
.
parse
(
parsed
[
1
])
}
catch
(
e
)
{
displayError
(
e
);
return
;
}
}
else
{
value
=
true
;
}
updateSetting
(
parsed
[
0
],
value
);
reflectSettings
();
return
;
case
'
/unset
'
:
delSetting
(
rest
.
trim
());
return
;
case
'
/lock
'
:
case
'
/unlock
'
:
if
(
!
serverConnection
.
permissions
.
op
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment