Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
sbbs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
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
Eric
sbbs
Commits
b7927e9e
Commit
b7927e9e
authored
Oct 08, 2020
by
echicken
🐔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
block-sender button handling
parent
33065703
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
webv4/root/js/forum.js
webv4/root/js/forum.js
+16
-9
No files found.
webv4/root/js/forum.js
View file @
b7927e9e
...
...
@@ -352,18 +352,19 @@ function onThreadStats(data) {
/* Fetch a private mail message's body (with links to attachments) where 'id'
is the message number. Output it to an element with id 'message-<id>'. */
async
function
getMailBody
(
id
)
{
if
(
!
$
(
'
#message-
'
+
id
).
attr
(
'
hidden
'
))
{
$
(
'
#message-
'
+
id
).
attr
(
'
hidden
'
,
true
);
}
else
if
(
$
(
'
#message-
'
+
id
).
html
()
!=
''
)
{
$
(
'
#message-
'
+
id
).
attr
(
'
hidden
'
,
false
);
const
tgt
=
`#message-
${
id
}
`
;
if
(
!
$
(
tgt
).
attr
(
'
hidden
'
))
{
$
(
tgt
).
attr
(
'
hidden
'
,
true
);
}
else
if
(
$
(
tgt
).
html
()
!=
''
)
{
$
(
tgt
).
attr
(
'
hidden
'
,
false
);
}
else
{
const
data
=
await
v4_get
(
'
./api/forum.ssjs?call=get-mail-body&number=
'
+
id
);
const
data
=
await
v4_get
(
`./api/forum.ssjs?call=get-mail-body&number=
${
id
}
`
);
var
str
=
data
.
body
;
if
(
data
.
inlines
&&
data
.
inlines
.
length
>
0
)
{
str
+=
'
<br>Inline attachments:
'
+
data
.
inlines
.
join
(
'
<br>
'
)
+
'
<br>
'
;
str
+=
`<br>Inline attachments:
${
data
.
inlines
.
join
(
'
<br>
'
)}
<br>`
;
}
if
(
data
.
attachments
&&
data
.
attachments
.
length
>
0
)
{
str
+=
'
<br>Attachments:
'
+
data
.
attachments
.
join
(
'
<br>
'
)
+
'
<br>
'
;
str
+=
`<br>Attachments:
${
data
.
attachments
.
join
(
'
<br>
'
)}
<br>`
;
}
str
+=
'
<button class="btn btn-default icon"
'
+
...
...
@@ -377,11 +378,17 @@ async function getMailBody(id) {
'
title="Delete this message" onclick="deleteMessage(
\'
mail
\'
,
'
+
id
+
'
)">
'
+
'
<span class="glyphicon glyphicon-trash"></span>
'
+
'
</button>
'
;
$
(
'
#message-
'
+
id
).
html
(
str
);
$
(
'
#message-
'
+
id
).
attr
(
'
hidden
'
,
false
);
if
(
data
.
buttons
)
str
+=
data
.
buttons
.
join
(
''
);
$
(
tgt
).
html
(
str
);
$
(
tgt
).
attr
(
'
hidden
'
,
false
);
}
}
async
function
blockSender
(
id
,
from
,
from_net
)
{
const
data
=
await
v4_get
(
`./api/forum.ssjs?call=block-sender&from=
${
from
}
&from_net=
${
from_net
}
`
);
if
(
!
data
.
err
)
$
(
`#bsb-
${
id
}
`
).
attr
(
'
disabled
'
,
true
);
}
async
function
setScanCfg
(
sub
,
cfg
)
{
var
opts
=
[
'
scan-cfg-off
'
,
'
scan-cfg-new
'
,
'
scan-cfg-youonly
'
];
const
data
=
await
v4_get
(
'
./api/forum.ssjs?call=set-scan-cfg&sub=
'
+
sub
+
'
&cfg=
'
+
cfg
);
...
...
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