View/Edit #1955:text

Switch to edit mode.

Name(s): text
1:  {?padd = caller, ?html = 0} = args
2:  {version, mode, scratchpad, saves, @rest} = padd:getdata()
3:  version >= 0.1 || raise(E_INVARG)
4:  if (mode == "scratchpad")
5:    return html ? {"<TT>", @$www:format(scratchpad), "</TT>"} | scratchpad
6:  elseif (mode == "clock")
7:    return "<FONT size=5><CENTER>" + padd:ctime() + "</CENTER></FONT>"
8:  elseif (mode == "view")
9:    r = {}
10:   for i in [1..length(saves)]
11:     {time, title, text} = saves[i]
12:     entry = "<TD>" + padd:button_text(tostr(i), html) + "</TD> <TD><TT>" + padd:ctime(time) + ":</TT></TD>"
13:     length = "<TD><TT>(" + tostr(length(text)) + (typeof(text) == $LIST ? " lines)" | " bytes)</TT></TD>")
14:     r = {@r, "<TR>" + entry + "<TD><TT><B>" + title + "</B></TT></TD>" + length + "</TR>"}
15:   endfor
16:   return {"<TABLE border=0>", @r, "</TABLE>"}
17: elseif (mode[1..4] == "view")
18:   item = toint(mode[6..$])
19:   item > 0 && item <= length(saves) || raise(E_PROPNF)
20:   text = saves[item][3]
21:   typeof(text) == $STR && (text = {text})
22:   return html ? {"<TT>", @$web:format(text), "</TT>"} | text
23: else
24:   raise(E_INVARG)
25: endif
26: "Last modified by Dax (#789) on Tue May  3 14:09:33 2005 MDT."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Maxamillian (#833)

You are not logged in.

[home | help | who | search | setup | code]