gopher: Add a stylesheet

Modified version from my attempt at adding gopher to NetSurf.
This commit is contained in:
François Revol 2014-07-26 01:08:07 +02:00
parent ec0e815354
commit 6983b35de5

View File

@ -110,6 +110,63 @@ static struct {
{ GOPHER_TYPE_NONE, NULL }
};
static const char *kStyleSheet = "\n"
"/*\n"
" * gopher listing style\n"
" */\n"
"\n"
"body#gopher {\n"
" /* margin: 10px;*/\n"
" background-color: Window;\n"
" color: WindowText;\n"
" font-size: 100%;\n"
" padding-bottom: 2em; }\n"
"\n"
"body#gopher div.uplink {\n"
" padding: 0;\n"
" margin: 0;\n"
" position: fixed;\n"
" top: 5px;\n"
" right: 5px; }\n"
"\n"
"body#gopher h1 {\n"
" padding: 5mm;\n"
" margin: 0;\n"
" border-bottom: 2px solid #777; }\n"
"\n"
"body#gopher span {\n"
" margin-left: 1em;\n"
" padding-left: 2em;\n"
" font-family: 'DejaVu Sans Mono', Courier, monospace;\n"
" word-wrap: break-word;\n"
" white-space: pre-wrap; }\n"
"\n"
"body#gopher span.error {\n"
" color: #f00; }\n"
"\n"
"body#gopher span.unknown {\n"
" color: #800; }\n"
"\n"
"body#gopher span.dir {\n"
" background-image: url('resource:icons/directory.png');\n"
" background-repeat: no-repeat;\n"
" background-position: bottom left; }\n"
"\n"
"body#gopher span.text {\n"
" background-image: url('resource:icons/content.png');\n"
" background-repeat: no-repeat;\n"
" background-position: bottom left; }\n"
"\n"
"body#gopher span.query {\n"
" background-image: url('resource:icons/search.png');\n"
" background-repeat: no-repeat;\n"
" background-position: bottom left; }\n"
"\n"
"body#gopher span.img img {\n"
" display: block;\n"
" margin-left:auto;\n"
" margin-right:auto; }\n";
static const int32 kGopherBufferSize = 4096;
static const bool kInlineImages = true;
@ -612,10 +669,9 @@ BGopherRequest::_ParseInput(bool last)
"<meta http-equiv=\"Content-Type\""
" content=\"text/html; charset=UTF-8\" />\n"
//FIXME: fix links
"<link rel=\"stylesheet\" title=\"Standard\" "
"type=\"text/css\" href=\"resource:internal.css\">\n"
"<link rel=\"icon\" type=\"image/png\""
" href=\"resource:icons/directory.png\">\n"
//"<link rel=\"icon\" type=\"image/png\""
// " href=\"resource:icons/directory.png\">\n"
"<style type=\"text/css\">\n" << kStyleSheet << "</style>\n"
"<title>" << pageTitle << "</title>\n"
"</head>\n"
"<body id=\"gopher\">\n"