Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
09f89ab5
Commit
09f89ab5
authored
21 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Added attr_push/attr_pop, and move right CTRL-A support
parent
1e117e4a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/js_global.c
+46
-1
46 additions, 1 deletion
src/sbbs3/js_global.c
with
46 additions
and
1 deletion
src/sbbs3/js_global.c
+
46
−
1
View file @
09f89ab5
...
...
@@ -832,6 +832,8 @@ js_html_encode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
time_t
now
;
BOOL
nodisplay
=
FALSE
;
scfg_t
*
cfg
;
uchar
attr_stack
[
64
];
/* Saved attributes (stack) */
int
attr_sp
;
/* Attribute stack pointer */
if
((
cfg
=
(
scfg_t
*
)
JS_GetPrivate
(
cx
,
obj
))
==
NULL
)
/* Will this work? Ask DM */
return
(
JS_FALSE
);
...
...
@@ -907,6 +909,7 @@ js_html_encode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
{
esccount
++
;
tmpbuf
[
j
++
]
=
inbuf
[
i
];
tmpbuf
[
j
++
]
=
inbuf
[
++
i
];
}
else
if
(
exascii
)
{
ch
=
inbuf
[
i
];
...
...
@@ -1111,9 +1114,23 @@ js_html_encode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
}
else
if
(
ctrl_a
&&
tmpbuf
[
i
]
==
1
)
/* CTRL-A codes */
{
/* j+=sprintf(outbuf+j,"<!-- CTRL-A-%c (%u) -->",tmpbuf[i+1],tmpbuf[i+1]); */
if
(
nodisplay
&&
tmpbuf
[
i
+
1
]
!=
')'
)
continue
;
switch
(
toupper
(
tmpbuf
[
i
+
1
]))
if
(
tmpbuf
[
i
+
1
]
>
0x7f
)
{
j
+=
sprintf
(
outbuf
+
j
,
"%s%s%s"
,
HTML_COLOR_PREFIX
,
htmlansi
[
0
],
HTML_COLOR_SUFFIX
);
lastcolor
=
0
;
l
=
tmpbuf
[
i
+
1
]
-
0x7f
;
if
(
l
>
81
-
hpos
)
l
=
81
-
hpos
;
for
(
k
=
0
;
k
<
l
;
k
++
)
{
j
+=
sprintf
(
outbuf
+
j
,
"%s"
,
" "
);
hpos
++
;
}
}
else
switch
(
toupper
(
tmpbuf
[
i
+
1
]))
{
case
'K'
:
fg
=
0
;
...
...
@@ -1169,6 +1186,34 @@ js_html_encode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
case
'I'
:
blink
=
TRUE
;
break
;
case
'+'
:
if
(
attr_sp
<
(
int
)
sizeof
(
attr_stack
))
attr_stack
[
attr_sp
++
]
=
(
blink
?
(
1
<<
7
)
:
0
)
|
(
bg
<<
4
)
|
(
bold
?
(
1
<<
3
)
:
0
)
|
fg
;
case
'-'
:
if
(
attr_sp
>
0
)
{
blink
=
(
attr_stack
[
--
attr_sp
]
&
(
1
<<
7
))
?
TRUE
:
FALSE
;
bg
=
(
attr_stack
[
attr_sp
]
>>
4
)
&
7
;
blink
=
(
attr_stack
[
attr_sp
]
&
(
1
<<
3
))
?
TRUE
:
FALSE
;
fg
=
attr_stack
[
attr_sp
]
&
7
;
}
else
if
(
bold
||
blink
||
bg
)
{
bold
=
FALSE
;
blink
=
FALSE
;
fg
=
7
;
bg
=
0
;
}
break
;
case
'_'
:
if
(
blink
||
bg
)
{
bold
=
FALSE
;
blink
=
FALSE
;
fg
=
7
;
bg
=
0
;
}
break
;
case
'N'
:
bold
=
FALSE
;
blink
=
FALSE
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment