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
6671d739
Commit
6671d739
authored
12 years ago
by
mcmlxxix
Browse files
Options
Downloads
Patches
Plain Diff
store attributes for future frame.putmsg() calls (for use with ctrl-a)
todo: possibly add support for P_SAVEATTR and other flags
parent
16cca80f
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
exec/load/frame.js
+30
-28
30 additions, 28 deletions
exec/load/frame.js
with
30 additions
and
28 deletions
exec/load/frame.js
+
30
−
28
View file @
6671d739
...
...
@@ -132,6 +132,7 @@ function Frame(x,y,width,height,attr,parent) {
data
:[[]],
open
:
false
,
ctrl_a
:
false
,
curr_attr
:
undefined
,
id
:
0
};
var
settings
=
{
...
...
@@ -880,9 +881,9 @@ function Frame(x,y,width,height,attr,parent) {
if
(
settings
.
word_wrap
)
str
=
word_wrap
(
str
,
this
.
width
);
str
=
str
.
toString
().
split
(
''
);
var
curattr
=
attr
;
if
(
!
cur
attr
)
curattr
=
this
.
attr
;
if
(
attr
)
properties
.
cur
r_
attr
=
attr
;
var
pos
=
position
.
cursor
;
while
(
str
.
length
>
0
)
{
...
...
@@ -897,69 +898,69 @@ function Frame(x,y,width,height,attr,parent) {
pos
.
x
++
;
break
;
case
'
K
'
:
/* Black */
curattr
=
(
curattr
)
&
0xf8
;
properties
.
cur
r_
attr
=
(
properties
.
cur
r_
attr
)
&
0xf8
;
break
;
case
'
R
'
:
/* Red */
curattr
=
((
curattr
)
&
0xf8
)
|
RED
;
properties
.
cur
r_
attr
=
((
properties
.
cur
r_
attr
)
&
0xf8
)
|
RED
;
break
;
case
'
G
'
:
/* Green */
curattr
=
((
curattr
)
&
0xf8
)
|
GREEN
;
properties
.
cur
r_
attr
=
((
properties
.
cur
r_
attr
)
&
0xf8
)
|
GREEN
;
break
;
case
'
Y
'
:
/* Yellow */
curattr
=
((
curattr
)
&
0xf8
)
|
BROWN
;
properties
.
cur
r_
attr
=
((
properties
.
cur
r_
attr
)
&
0xf8
)
|
BROWN
;
break
;
case
'
B
'
:
/* Blue */
curattr
=
((
curattr
)
&
0xf8
)
|
BLUE
;
properties
.
cur
r_
attr
=
((
properties
.
cur
r_
attr
)
&
0xf8
)
|
BLUE
;
break
;
case
'
M
'
:
/* Magenta */
curattr
=
((
curattr
)
&
0xf8
)
|
MAGENTA
;
properties
.
cur
r_
attr
=
((
properties
.
cur
r_
attr
)
&
0xf8
)
|
MAGENTA
;
break
;
case
'
C
'
:
/* Cyan */
curattr
=
((
curattr
)
&
0xf8
)
|
CYAN
;
properties
.
cur
r_
attr
=
((
properties
.
cur
r_
attr
)
&
0xf8
)
|
CYAN
;
break
;
case
'
W
'
:
/* White */
curattr
=
((
curattr
)
&
0xf8
)
|
LIGHTGRAY
;
properties
.
cur
r_
attr
=
((
properties
.
cur
r_
attr
)
&
0xf8
)
|
LIGHTGRAY
;
break
;
case
'
0
'
:
/* Black */
curattr
=
(
curattr
)
&
0x8f
;
properties
.
cur
r_
attr
=
(
properties
.
cur
r_
attr
)
&
0x8f
;
break
;
case
'
1
'
:
/* Red */
curattr
=
((
curattr
)
&
0x8f
)
|
(
RED
<<
4
);
properties
.
cur
r_
attr
=
((
properties
.
cur
r_
attr
)
&
0x8f
)
|
(
RED
<<
4
);
break
;
case
'
2
'
:
/* Green */
curattr
=
((
curattr
)
&
0x8f
)
|
(
GREEN
<<
4
);
properties
.
cur
r_
attr
=
((
properties
.
cur
r_
attr
)
&
0x8f
)
|
(
GREEN
<<
4
);
break
;
case
'
3
'
:
/* Yellow */
curattr
=
((
curattr
)
&
0x8f
)
|
(
BROWN
<<
4
);
properties
.
cur
r_
attr
=
((
properties
.
cur
r_
attr
)
&
0x8f
)
|
(
BROWN
<<
4
);
break
;
case
'
4
'
:
/* Blue */
curattr
=
((
curattr
)
&
0x8f
)
|
(
BLUE
<<
4
);
properties
.
cur
r_
attr
=
((
properties
.
cur
r_
attr
)
&
0x8f
)
|
(
BLUE
<<
4
);
break
;
case
'
5
'
:
/* Magenta */
curattr
=
((
curattr
)
&
0x8f
)
|
(
MAGENTA
<<
4
);
properties
.
cur
r_
attr
=
((
properties
.
cur
r_
attr
)
&
0x8f
)
|
(
MAGENTA
<<
4
);
break
;
case
'
6
'
:
/* Cyan */
curattr
=
((
curattr
)
&
0x8f
)
|
(
CYAN
<<
4
);
properties
.
cur
r_
attr
=
((
properties
.
cur
r_
attr
)
&
0x8f
)
|
(
CYAN
<<
4
);
break
;
case
'
7
'
:
/* White */
curattr
=
((
curattr
)
&
0x8f
)
|
(
LIGHTGRAY
<<
4
);
properties
.
cur
r_
attr
=
((
properties
.
cur
r_
attr
)
&
0x8f
)
|
(
LIGHTGRAY
<<
4
);
break
;
case
'
H
'
:
/* High Intensity */
curattr
|=
HIGH
;
properties
.
cur
r_
attr
|=
HIGH
;
break
;
case
'
I
'
:
/* Blink */
curattr
|=
BLINK
;
properties
.
cur
r_
attr
|=
BLINK
;
break
;
case
'
N
'
:
/* Normal (ToDo: Does this do ESC[0?) */
curattr
=
this
.
attr
;
properties
.
cur
r_
attr
=
this
.
attr
;
break
;
case
'
-
'
:
/* Normal if High, Blink, or BG */
if
(
curattr
&
0xf8
)
curattr
=
this
.
attr
;
if
(
properties
.
cur
r_
attr
&
0xf8
)
properties
.
cur
r_
attr
=
this
.
attr
;
break
;
case
'
_
'
:
/* Normal if blink/background */
if
(
curattr
&
0xf0
)
curattr
=
this
.
attr
;
if
(
properties
.
cur
r_
attr
&
0xf0
)
properties
.
cur
r_
attr
=
this
.
attr
;
break
;
case
'
[
'
:
/* CR */
pos
.
x
=
0
;
...
...
@@ -981,6 +982,7 @@ function Frame(x,y,width,height,attr,parent) {
else
{
switch
(
ch
)
{
case
'
\
1
'
:
/* CTRL-A code */
case
ctrl
(
'
A
'
):
properties
.
ctrl_a
=
true
;
break
;
case
'
\
7
'
:
/* Beep */
...
...
@@ -990,7 +992,7 @@ function Frame(x,y,width,height,attr,parent) {
case
'
\
b
'
:
if
(
pos
.
x
>
0
)
{
pos
.
x
--
;
putChar
.
call
(
this
,
"
"
,
curattr
);
putChar
.
call
(
this
,
"
"
,
properties
.
cur
r_
attr
);
}
break
;
case
'
\r
'
:
...
...
@@ -1007,7 +1009,7 @@ function Frame(x,y,width,height,attr,parent) {
}
break
;
default
:
putChar
.
call
(
this
,
ch
,
curattr
);
putChar
.
call
(
this
,
ch
,
properties
.
cur
r_
attr
);
pos
.
x
++
;
break
;
}
...
...
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