-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsitelinks.fs
executable file
·61 lines (42 loc) · 1.75 KB
/
sitelinks.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
marker sitelinks.fs .latest \ To link other Forth servers to a home page
1 value #IndexSite \ Points to the ID of the server that contains an index of all sites.
: +quote ( counted-dest$ - ) >r [char] " sp@ 1 r> +place drop ;
: </a>2sp ( - ) +HTML| </a> | ;
: (Tophref) ( - ) html| <a target="_top" href="| ;
: Tophref=" ( - ) (Tophref) +html ;
: <pagelink ( page$ cnt #server - adr cnt )
>r s" http://" upad place
r@ r>ipAdress count +upad s" :" +upad
r> r>port @ (.) +upad
+upad upad +quote s" >" +upad upad count ;
: pagelink> ( link-text cnt - ) +HTML </a>2sp ;
: Sitelink ( #server - )
upad off Tophref=" >r s" /home" r@ <pagelink +HTML
r> r>HostName count pagelink> ;
: +Arplink ( - )
s" /ArpPage" +HTML| <a href="| +homelink +HTML +HTML| ">|
+HTML| Network| +HTML| </a>: | ;
also tcp/ip
: Sitelinks ( page$ cnt - ) \ EG: /UpdateLinks or /SitesIndex
#servers 0 over 1 >
if /UpdateLinks
?do i r>Online @ i TcpPort? and
if i ServerHost <> \ Skip ServerId 0 (=host)
if i Sitelink
then
then
loop
+HTML| <a href="| +homelink +HTML +HTML| ">|
+HTML| Refresh | +HTML| </a>|
else 2drop 2drop
then ;
previous
: (SitesIndex) ( - ) \ make the index link visible
s" /SitesIndex" #IndexSite <pagelink here place
(Tophref) upad place here count +upad
s" <strong>Index</strong>" +upad s" </a> " +upad upad count +html ;
' noop is SitesIndex \ Default is off
[DEFINED] SitesIndexOpt \ When SitesIndexOpt
[IF] ' (SitesIndex) is SitesIndex
[THEN]
\s