Added 8-type support
This commit is contained in:
@@ -50,7 +50,7 @@ They are listed in the hi01379.js library name:
|
|||||||
- `i` (information message), as well as `I` (generic image file)
|
- `i` (information message), as well as `I` (generic image file)
|
||||||
- `h` (external URL)
|
- `h` (external URL)
|
||||||
|
|
||||||
Outside this list, unknown binary types (`5`, `s`, `;`, `d`) are just treated as type `9` internally, and every other type is assumed to be plain text on access.
|
Outside this list, unknown binary types (`5`, `s`, `;`, `d`) are just treated as type `9` internally, and every other type is assumed to be plain text on access. The 8-type entries are just converted to `telnet://` URIs with no logic attached.
|
||||||
|
|
||||||
In the Gophermap, any line that doesn't contain tabulation characters is automatically considered an information line by Kopher client and hi01379.js library. This allows to display messages from Gopher servers that don't strictly adhere to the format, such as Gophernicus or PyGopherd.
|
In the Gophermap, any line that doesn't contain tabulation characters is automatically considered an information line by Kopher client and hi01379.js library. This allows to display messages from Gopher servers that don't strictly adhere to the format, such as Gophernicus or PyGopherd.
|
||||||
|
|
||||||
|
|||||||
@@ -65,6 +65,10 @@ Hi01379 = (function(psGopherRequest) {
|
|||||||
if(desc = desc.trim()) { // ignore empty descriptions
|
if(desc = desc.trim()) { // ignore empty descriptions
|
||||||
if(type == '3') // error message
|
if(type == '3') // error message
|
||||||
output += '<span class=error>' + desc + '</span>' + lbr
|
output += '<span class=error>' + desc + '</span>' + lbr
|
||||||
|
else if(type == '8') { // output the telnet:// link as is
|
||||||
|
var tlink = 'telnet://' + (sel ? (sel+'@') : '') + host + (port ? (':'+port) : '')
|
||||||
|
output += desc + ': ' + esc(tlink) + lbr
|
||||||
|
}
|
||||||
else { // shape the link (internal hi:type|sel|host|port format unless it's an external URL)
|
else { // shape the link (internal hi:type|sel|host|port format unless it's an external URL)
|
||||||
var deflink = 'hi:'+[type,sel,host,port].join('|'), link = deflink
|
var deflink = 'hi:'+[type,sel,host,port].join('|'), link = deflink
|
||||||
if(type == 'h' && sel.startsWith('URL:')) {
|
if(type == 'h' && sel.startsWith('URL:')) {
|
||||||
|
|||||||
Reference in New Issue
Block a user