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
72f2b0f1
Commit
72f2b0f1
authored
10 years ago
by
mcmlxxix
Browse files
Options
Downloads
Patches
Plain Diff
move drawBorder prototype method into oneliners script
parent
f23417fe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
exec/load/frame.js
+0
-39
0 additions, 39 deletions
exec/load/frame.js
xtrn/oneliners/framed.js
+39
-0
39 additions, 0 deletions
xtrn/oneliners/framed.js
with
39 additions
and
39 deletions
exec/load/frame.js
+
0
−
39
View file @
72f2b0f1
...
...
@@ -57,8 +57,6 @@ METHODS:
frame.gotoxy(x,y)
frame.pushxy()
frame.popxy()
frame.drawBorder(color) //draw a border along the inside edge of the frame; see sbbsdefs.js for valid 'color' arguments
//'color' can be an array of colors (try it to see the effect)
PROPERTIES:
...
...
@@ -1212,43 +1210,6 @@ function Frame(x,y,width,height,attr,parent) {
init
.
apply
(
this
,
arguments
);
}
Frame
.
prototype
.
drawBorder
=
function
(
color
)
{
var
theColor
=
color
;
if
(
Array
.
isArray
(
color
));
var
sectionLength
=
Math
.
round
(
this
.
width
/
color
.
length
);
this
.
pushxy
();
for
(
var
y
=
1
;
y
<=
this
.
height
;
y
++
)
{
for
(
var
x
=
1
;
x
<=
this
.
width
;
x
++
)
{
if
(
x
>
1
&&
x
<
this
.
width
&&
y
>
1
&&
y
<
this
.
height
)
continue
;
var
msg
;
this
.
gotoxy
(
x
,
y
);
if
(
y
==
1
&&
x
==
1
)
msg
=
ascii
(
218
);
else
if
(
y
==
1
&&
x
==
this
.
width
)
msg
=
ascii
(
191
);
else
if
(
y
==
this
.
height
&&
x
==
1
)
msg
=
ascii
(
192
);
else
if
(
y
==
this
.
height
&&
x
==
this
.
width
)
msg
=
ascii
(
217
);
else
if
(
x
==
1
||
x
==
this
.
width
)
msg
=
ascii
(
179
);
else
msg
=
ascii
(
196
);
if
(
Array
.
isArray
(
color
))
{
if
(
x
==
1
)
theColor
=
color
[
0
];
else
if
(
x
%
sectionLength
==
0
&&
x
<
this
.
width
)
theColor
=
color
[
x
/
sectionLength
];
else
if
(
x
==
this
.
width
)
theColor
=
color
[
color
.
length
-
1
];
}
this
.
putmsg
(
msg
,
theColor
);
}
}
this
.
popxy
();
}
/* frame reference object */
function
Canvas
(
frame
,
display
)
{
this
.
frame
=
frame
;
...
...
This diff is collapsed.
Click to expand it.
xtrn/oneliners/framed.js
+
39
−
0
View file @
72f2b0f1
...
...
@@ -14,6 +14,45 @@ var initFrames = function() {
console
.
clear
(
BG_BLACK
|
LIGHTGRAY
);
/* frame.drawBorder(color) //draw a border along the inside edge of the frame; see sbbsdefs.js for valid 'color' arguments
//'color' can be an array of colors (try it to see the effect) */
Frame
.
prototype
.
drawBorder
=
function
(
color
)
{
var
theColor
=
color
;
if
(
Array
.
isArray
(
color
));
var
sectionLength
=
Math
.
round
(
this
.
width
/
color
.
length
);
this
.
pushxy
();
for
(
var
y
=
1
;
y
<=
this
.
height
;
y
++
)
{
for
(
var
x
=
1
;
x
<=
this
.
width
;
x
++
)
{
if
(
x
>
1
&&
x
<
this
.
width
&&
y
>
1
&&
y
<
this
.
height
)
continue
;
var
msg
;
this
.
gotoxy
(
x
,
y
);
if
(
y
==
1
&&
x
==
1
)
msg
=
ascii
(
218
);
else
if
(
y
==
1
&&
x
==
this
.
width
)
msg
=
ascii
(
191
);
else
if
(
y
==
this
.
height
&&
x
==
1
)
msg
=
ascii
(
192
);
else
if
(
y
==
this
.
height
&&
x
==
this
.
width
)
msg
=
ascii
(
217
);
else
if
(
x
==
1
||
x
==
this
.
width
)
msg
=
ascii
(
179
);
else
msg
=
ascii
(
196
);
if
(
Array
.
isArray
(
color
))
{
if
(
x
==
1
)
theColor
=
color
[
0
];
else
if
(
x
%
sectionLength
==
0
&&
x
<
this
.
width
)
theColor
=
color
[
x
/
sectionLength
];
else
if
(
x
==
this
.
width
)
theColor
=
color
[
color
.
length
-
1
];
}
this
.
putmsg
(
msg
,
theColor
);
}
}
this
.
popxy
();
}
frame
=
new
Frame
(
1
,
1
,
...
...
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