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
aff048e6
Commit
aff048e6
authored
14 years ago
by
mcmlxxix
Browse files
Options
Downloads
Patches
Plain Diff
some minor fixes & updates
parent
596942cc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
exec/load/clock.js
+0
-4
0 additions, 4 deletions
exec/load/clock.js
exec/load/funclib.js
+53
-6
53 additions, 6 deletions
exec/load/funclib.js
exec/load/graphic.js
+12
-9
12 additions, 9 deletions
exec/load/graphic.js
with
65 additions
and
19 deletions
exec/load/clock.js
+
0
−
4
View file @
aff048e6
...
...
@@ -8,7 +8,6 @@ function DigitalClock()
this
.
lastupdate
=-
1
;
this
.
digits
=
[];
this
.
hidden
=
false
;
this
.
box
;
this
.
init
=
function
(
x
,
y
,
color
)
{
...
...
@@ -16,8 +15,6 @@ function DigitalClock()
this
.
y
=
y
?
y
:
1
;
this
.
color
=
color
?
color
:
"
\
1n
\
1h
"
;
this
.
loadDigits
();
this
.
box
=
new
Window
(
"
TIME
"
,
this
.
x
,
this
.
y
,
this
.
columns
,
this
.
rows
);
this
.
box
.
draw
();
this
.
update
(
true
);
}
this
.
hide
=
function
()
...
...
@@ -44,7 +41,6 @@ function DigitalClock()
var
time
=
hours
.
toString
()
+
"
:
"
+
minutes
.
toString
();
if
(
minutes
>
this
.
lastupdate
||
forced
)
{
this
.
box
.
draw
();
this
.
lastupdate
=
minutes
;
this
.
drawClock
(
time
);
}
...
...
This diff is collapsed.
Click to expand it.
exec/load/funclib.js
+
53
−
6
View file @
aff048e6
...
...
@@ -5,78 +5,124 @@
function
getColor
(
color
)
{
if
(
!
color
)
return
false
;
switch
(
color
.
toUpperCase
())
switch
(
color
)
{
case
"
BLACK
"
:
case
"
\
1K
"
:
return
BLACK
;
case
BLACK
:
return
"
\
1K
"
;
case
"
BLUE
"
:
case
"
\
1B
"
:
return
BLUE
;
case
BLUE
:
return
"
\
1B
"
;
case
"
CYAN
"
:
case
"
\
1C
"
:
return
CYAN
;
case
CYAN
:
return
"
\
1C
"
;
case
"
RED
"
:
case
"
\
1R
"
:
return
RED
;
case
RED
:
return
"
\
1R
"
;
case
"
GREEN
"
:
case
"
\
1G
"
:
return
GREEN
;
case
GREEN
:
return
"
\
1G
"
;
case
"
BROWN
"
:
case
"
\
1Y
"
:
return
BROWN
;
case
BROWN
:
return
"
\
1Y
"
;
case
"
MAGENTA
"
:
case
"
\
1M
"
:
return
MAGENTA
;
case
MAGENTA
:
return
"
\
1M
"
;
case
"
BG_BLUE
"
:
case
"
\
0014
"
:
return
BG_BLUE
;
case
BG_BLUE
:
return
"
\
0014
"
;
case
"
BG_CYAN
"
:
case
"
\
0016
"
:
return
BG_CYAN
;
case
BG_CYAN
:
return
"
\
0016
"
;
case
"
BG_RED
"
:
case
"
\
0011
"
:
return
BG_RED
;
case
BG_RED
:
return
"
\
0011
"
;
case
"
BG_GREEN
"
:
case
"
\
0012
"
:
return
BG_GREEN
;
case
BG_GREEN
:
return
"
\
0012
"
;
case
"
BG_BROWN
"
:
case
"
\
0013
"
:
return
BG_BROWN
;
case
BG_BROWN
:
return
"
\
0013
"
;
case
"
BG_MAGENTA
"
:
case
"
\
0015
"
:
return
BG_MAGENTA
;
case
BG_MAGENTA
:
return
"
\
0015
"
;
case
"
BG_LIGHTGRAY
"
:
case
"
\
0017
"
:
return
BG_LIGHTGRAY
;
return
BG_LIGHTGRAY
;
case
BG_LIGHTGRAY
:
return
"
\
0017
"
;
case
"
WHITE
"
:
case
"
\
1W
\
1H
"
:
return
WHITE
;
case
WHITE
:
return
"
\
1W
\
1H
"
;
case
"
LIGHTCYAN
"
:
case
"
\
1C
\
1H
"
:
return
LIGHTCYAN
;
case
LIGHTCYAN
:
return
"
\
1C
\
1H
"
;
case
"
LIGHTRED
"
:
case
"
\
1R
\
1H
"
:
return
LIGHTRED
;
case
LIGHTRED
:
return
"
\
1R
\
1H
"
;
case
"
LIGHTGREEN
"
:
case
"
\
1G
\
1H
"
:
return
LIGHTGREEN
;
case
LIGHTGREEN
:
return
"
\
1G
\
1H
"
;
case
"
LIGHTBLUE
"
:
case
"
\
1B
\
1H
"
:
return
LIGHTBLUE
;
case
LIGHTBLUE
:
return
"
\
1B
\
1H
"
;
case
"
YELLOW
"
:
case
"
\
1Y
\
1H
"
:
return
YELLOW
;
case
YELLOW
:
return
"
\
1Y
\
1H
"
;
case
"
LIGHTMAGENTA
"
:
case
"
\
1M
\
1H
"
:
return
LIGHTMAGENTA
;
case
LIGHTMAGENTA
:
return
"
\
1M
\
1H
"
;
case
"
LIGHTGRAY
"
:
case
"
\
1N
"
:
case
"
\
1W
"
:
return
LIGHTGRAY
;
case
LIGHTGRAY
:
return
"
\
1W
"
;
case
"
DARKGRAY
"
:
case
"
\
1K
\
1H
"
:
return
DARKGRAY
;
case
DARKGRAY
:
return
"
\
1K
\
1H
"
;
default
:
return
ANSI_NORMAL
;
}
...
...
@@ -103,11 +149,12 @@ function removeSpaces(text)
}
function
splitPadded
(
string1
,
string2
,
length
,
padding
)
{
if
(
!
string1
)
string1
=
""
;
if
(
!
string2
)
string2
=
""
;
if
(
!
padding
)
padding
=
"
"
;
var
strlength
=
console
.
strlen
(
string1
+
string2
);
if
(
strlength
>
length
)
{
string
=
string
.
substring
(
0
,
length
);
if
(
strlength
>
length
)
{
string1
=
string1
.
substring
(
0
,
length
);
}
var
padlength
=
length
-
strlength
;
var
padded
=
""
;
...
...
This diff is collapsed.
Click to expand it.
exec/load/graphic.js
+
12
−
9
View file @
aff048e6
...
...
@@ -88,7 +88,7 @@ function Graphic_draw(xpos,ypos,width,height,xoff,yoff)
return
(
false
)
}
if
(
xpos
+
width
-
1
>
console
.
screen_columns
||
ypos
+
height
-
1
>
console
.
screen_rows
)
{
alert
(
"
Attempt to draw outside of screen
"
);
alert
(
"
Attempt to draw outside of screen
:
"
+
(
xpos
+
width
-
1
)
+
"
x
"
+
(
ypos
+
height
-
1
)
);
return
(
false
);
}
for
(
y
=
0
;
y
<
height
;
y
++
)
{
...
...
@@ -287,10 +287,12 @@ function Graphic_scroll(dir)
default
:
for
(
x
=
0
;
x
<
this
.
width
;
x
++
)
{
this
.
data
[
x
].
push
(
new
Graphic_sector
(
this
.
ch
,
this
.
attribute
));
if
(
this
.
data
[
x
].
length
>
this
.
scrollback
)
this
.
data
.
shift
();
if
(
this
.
data
[
x
].
length
>
this
.
scrollback
)
{
this
.
data
.
shift
();
}
}
this
.
index
=
this
.
data
[
0
].
length
-
this
.
height
;
this
.
length
++
;
if
(
this
.
length
<
this
.
scrollback
)
this
.
length
++
;
break
;
}
return
true
;
...
...
@@ -298,14 +300,14 @@ function Graphic_scroll(dir)
function
Graphic_resize
(
w
,
h
)
{
this
.
data
=
new
Array
(
w
);
this
.
width
=
w
;
this
.
height
=
h
;
if
(
w
)
this
.
width
=
w
;
if
(
h
)
this
.
height
=
h
;
this
.
index
=
0
;
this
.
length
=
0
;
for
(
var
y
=
0
;
y
<
h
;
y
++
)
{
for
(
var
x
=
0
;
x
<
w
;
x
++
)
{
for
(
var
y
=
0
;
y
<
this
.
height
;
y
++
)
{
for
(
var
x
=
0
;
x
<
this
.
width
;
x
++
)
{
if
(
y
==
0
)
{
this
.
data
[
x
]
=
new
Array
(
h
);
this
.
data
[
x
]
=
new
Array
(
this
.
height
);
}
this
.
data
[
x
][
y
]
=
new
Graphic_sector
(
this
.
ch
,
this
.
attribute
);
}
...
...
@@ -324,8 +326,9 @@ function Graphic_putmsg(xpos, ypos, txt, attr, scroll)
if
(
curattr
==
undefined
)
curattr
=
this
.
attribute
;
/* Expand @-codes */
if
(
txt
==
undefined
||
txt
==
null
||
txt
.
length
==
0
)
if
(
txt
==
undefined
||
txt
==
null
||
txt
.
length
==
0
)
{
return
(
0
);
}
txt
=
txt
.
toString
().
replace
(
/@
(
.*
)
@/g
,
function
(
str
,
code
,
offset
,
s
)
{
return
bbs
.
atcode
(
code
);
...
...
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