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
051cf24f
Commit
051cf24f
authored
2 months ago
by
Deucе
Browse files
Options
Downloads
Patches
Plain Diff
Some more mnemonics() and do theoretical 40-col support
parent
89feb588
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/textedit.js
+42
-7
42 additions, 7 deletions
exec/textedit.js
with
42 additions
and
7 deletions
exec/textedit.js
+
42
−
7
View file @
051cf24f
...
...
@@ -8,6 +8,7 @@ var pos = 0;
var
len
=
0
;
var
msglens
=
[];
var
displaywith
=
0
;
var
inprow
=
(
console
.
screen_columns
<
80
)
?
18
:
17
;
// TODO: This should be in a separate (JSON) file...
var
details
=
{
...
...
@@ -17,9 +18,18 @@ var details = {
'
DirLibOrAll
'
:
{
'
displaywith
'
:
1
,
},
'
DoYouMeanThisUserQ
'
:
{
'
displaywith
'
:
1
,
},
'
ExtractFilesPrompt
'
:
{
'
displaywith
'
:
1
,
},
'
FileInfoEditPrompt
'
:
{
'
displaywith
'
:
1
,
},
'
FileInfoPrompt
'
:
{
'
displaywith
'
:
1
,
},
'
JoinWhichDir
'
:
{
'
displaywith
'
:
1
,
},
...
...
@@ -62,6 +72,12 @@ var details = {
'
QuitOrNext
'
:
{
'
displaywith
'
:
1
,
},
'
QuoteLinesPrompt
'
:
{
'
displaywith
'
:
1
,
},
'
QWKCtrlACodes
'
:
{
'
displaywith
'
:
1
,
},
'
RExemptRemoveFilePrompt
'
:
{
'
displaywith
'
:
1
,
},
...
...
@@ -117,7 +133,7 @@ function format_entry(str)
{
// bbs.command_str = '@';
// .replace(/@/g, "@U+40:@@")
return
str
.
replace
(
/
[\x
00-
\x
1F
]
/g
,
function
(
match
)
{
return
str
.
replace
(
/
[\x
00-
\x
1F
\x
80-
\x
9F
]
/g
,
function
(
match
)
{
switch
(
match
)
{
case
'
\n
'
:
return
"
\\
n
"
;
...
...
@@ -132,7 +148,9 @@ function format_entry(str)
case
'
\
f
'
:
return
"
\\
f
"
;
default
:
return
'
\
x01
'
+
'
7
\
x01
'
+
'
B^
'
+
String
.
fromCharCode
(
match
.
charCodeAt
(
0
)
+
64
)
+
"
\
x01
"
+
'
0
\
x01
'
+
'
w
'
;
if
(
match
<
'
'
)
return
'
\
x01
'
+
'
7
\
x01
'
+
'
B^
'
+
String
.
fromCharCode
(
match
.
charCodeAt
(
0
)
+
64
)
+
"
\
x01
"
+
'
0
\
x01
'
+
'
w
'
;
return
'
\
x01
'
+
'
7
\
x01
'
+
'
B^
'
+
format
(
"
%02X
"
,
match
.
charCodeAt
(
0
))
+
"
\
x01
"
+
'
0
\
x01
'
+
'
w
'
;
}
});
}
...
...
@@ -243,6 +261,8 @@ function redraw(str, num)
console
.
print
(
"
Example text
\r\n
before message.
\r\n
"
);
console
.
question
=
"
Example question
"
;
// Stuff in a CTRL-C for things like @EXEC:yesnobar@
// TODO: This doesn't work for some reason after the input fix
// in terminal-abstraction branch.
console
.
ungetkeys
(
ctrl
(
'
C
'
),
true
);
switch
(
displaywith
)
{
case
0
:
...
...
@@ -261,9 +281,18 @@ function redraw(str, num)
// Pull out the CTRL-C
console
.
inkey
();
console
.
print
(
"
Example text after message.
\r\n
"
);
console
.
gotoxy
(
0
,
16
);
console
.
print
(
a
+
"
h
"
+
a
+
"
w
"
+
a
+
"
4
"
+
"
"
+
df
+
"
^^ As seen on BBS ^^
"
+
"
vv
"
+
tnames
[
num
]
+
"
(
"
+
num
+
"
) vv
"
+
a
+
"
>
"
);
console
.
gotoxy
(
0
,
17
);
if
(
console
.
screen_columns
<
80
)
{
console
.
gotoxy
(
0
,
inprow
-
2
);
console
.
print
(
a
+
"
h
"
+
a
+
"
w
"
+
a
+
"
4
"
+
"
"
+
df
+
"
^^ As seen on BBS ^^
"
+
a
+
"
>
"
);
console
.
gotoxy
(
0
,
inprow
-
1
);
console
.
print
(
a
+
"
h
"
+
a
+
"
w
"
+
a
+
"
4
"
+
"
vv
"
+
tnames
[
num
]
+
"
(
"
+
num
+
"
) vv
"
+
a
+
"
>
"
);
console
.
gotoxy
(
0
,
inprow
);
}
else
{
console
.
gotoxy
(
0
,
inprow
-
1
);
console
.
print
(
a
+
"
h
"
+
a
+
"
w
"
+
a
+
"
4
"
+
"
"
+
df
+
"
^^ As seen on BBS ^^
"
+
"
vv
"
+
tnames
[
num
]
+
"
(
"
+
num
+
"
) vv
"
+
a
+
"
>
"
);
console
.
gotoxy
(
0
,
inprow
);
}
console
.
cleartoeos
(
7
);
console
.
print
(
format_entry
(
bbs
.
text
(
msg
)));
place_cursor
();
...
...
@@ -289,8 +318,11 @@ function newmsg()
msglens
=
[];
for
(
i
=
0
;
i
<
rmsg
.
length
;
i
++
)
{
msglens
.
push
({
'
tpos
'
:
tpos
,
'
spos
'
:
spos
});
// TODO: 0x80-0x9f should be escaped as well.
if
(
rmsg
[
i
]
<
'
'
)
tpos
++
;
else
if
(
rmsg
[
i
]
>=
'
\
x80
'
&&
rmsg
[
i
]
<=
'
\
x9F
'
)
tpos
++
;
tpos
++
;
spos
++
;
}
...
...
@@ -306,7 +338,7 @@ function newmsg()
function
place_cursor
()
{
console
.
gotoxy
(
0
,
17
);
console
.
gotoxy
(
0
,
inprow
);
var
np
=
msglens
[
pos
].
tpos
;
while
(
np
>=
console
.
screen_columns
)
{
console
.
linefeed
();
...
...
@@ -318,7 +350,10 @@ function place_cursor()
function
get_msgnum
()
{
console
.
gotoxy
(
42
,
16
);
if
(
console
.
screen_columns
<
80
)
console
.
gotoxy
(
1
,
inprow
-
1
);
else
console
.
gotoxy
(
42
,
inprow
-
1
);
console
.
attributes
=
0x1F
;
console
.
cleartoeol
();
var
ret
=
console
.
getnum
(
last_entry
,
msg
);
...
...
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