webmcp
annotate framework/env/ui/anchor.lua @ 178:1a85110cdbe2
Throw error in mondelefant-atom-connector when encountering illegal JSON document
| author | jbe | 
|---|---|
| date | Fri Aug 01 23:08:42 2014 +0200 (2014-08-01) | 
| parents | ca44dff90b4e | 
| children | 
| rev | line source | 
|---|---|
| jbe@81 | 1 --[[-- | 
| jbe@81 | 2 ui.anchor{ | 
| jbe@81 | 3 name = name, -- name of anchor | 
| jbe@81 | 4 attr = attr, -- table of HTML attributes | 
| jbe@81 | 5 content = content -- string to be HTML encoded, or function to be executed | 
| jbe@81 | 6 } | 
| jbe@81 | 7 | 
| jbe@81 | 8 This function writes an HTML anchor into the active slot. | 
| jbe@81 | 9 | 
| jbe@81 | 10 --]]-- | 
| jbe@81 | 11 | 
| jbe@81 | 12 function ui.anchor(args) | 
| bsw@82 | 13 local attr = table.new(args.attr) | 
| jbe@81 | 14 attr.name = args.name | 
| jbe@81 | 15 return ui.tag{ | 
| jbe@81 | 16 tag = "a", | 
| jbe@81 | 17 attr = attr, | 
| bsw@82 | 18 content = args.content | 
| jbe@81 | 19 } | 
| jbe@81 | 20 end |