MCPcopy Create free account
hub / github.com/OpenPrinting/cups / html_header

Function html_header

tools/ippeveprinter.c:2899–2946  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2897 */
2898
2899static void
2900html_header(ippeve_client_t *client, /* I - Client */
2901 const char *title, /* I - Title */
2902 int refresh) /* I - Refresh timer, if any */
2903{
2904 html_printf(client,
2905 "<!doctype html>\n"
2906 "<html>\n"
2907 "<head>\n"
2908 "<title>%s</title>\n"
2909 "<link rel=\"shortcut icon\" href=\"/icon.png\" type=\"image/png\">\n"
2910 "<link rel=\"apple-touch-icon\" href=\"/icon.png\" type=\"image/png\">\n"
2911 "<meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\">\n", title);
2912 if (refresh > 0)
2913 html_printf(client, "<meta http-equiv=\"refresh\" content=\"%d\">\n", refresh);
2914 html_printf(client,
2915 "<meta name=\"viewport\" content=\"width=device-width\">\n"
2916 "<style>\n"
2917 "body { font-family: sans-serif; margin: 0; }\n"
2918 "div.body { padding: 0px 10px 10px; }\n"
2919 "span.badge { background: #090; border-radius: 5px; color: #fff; padding: 5px 10px; }\n"
2920 "span.bar { box-shadow: 0px 1px 5px #333; font-size: 75%%; }\n"
2921 "table.form { border-collapse: collapse; margin-left: auto; margin-right: auto; margin-top: 10px; width: auto; }\n"
2922 "table.form td, table.form th { padding: 5px 2px; }\n"
2923 "table.form td.meter { border-right: solid 1px #ccc; padding: 0px; width: 400px; }\n"
2924 "table.form th { text-align: right; }\n"
2925 "table.striped { border-bottom: solid thin black; border-collapse: collapse; width: 100%%; }\n"
2926 "table.striped tr:nth-child(even) { background: #fcfcfc; }\n"
2927 "table.striped tr:nth-child(odd) { background: #f0f0f0; }\n"
2928 "table.striped th { background: white; border-bottom: solid thin black; text-align: left; vertical-align: bottom; }\n"
2929 "table.striped td { margin: 0; padding: 5px; vertical-align: top; }\n"
2930 "table.nav { border-collapse: collapse; width: 100%%; }\n"
2931 "table.nav td { margin: 0; text-align: center; }\n"
2932 "td.nav a, td.nav a:active, td.nav a:hover, td.nav a:hover:link, td.nav a:hover:link:visited, td.nav a:link, td.nav a:link:visited, td.nav a:visited { background: inherit; color: inherit; font-size: 80%%; text-decoration: none; }\n"
2933 "td.nav { background: #333; color: #fff; padding: 4px 8px; width: 33%%; }\n"
2934 "td.nav.sel { background: #fff; color: #000; font-weight: bold; }\n"
2935 "td.nav:hover { background: #666; color: #fff; }\n"
2936 "td.nav:active { background: #000; color: #ff0; }\n"
2937 "</style>\n"
2938 "</head>\n"
2939 "<body>\n"
2940 "<table class=\"nav\"><tr>"
2941 "<td class=\"nav%s\"><a href=\"/\">Status</a></td>"
2942 "<td class=\"nav%s\"><a href=\"/supplies\">Supplies</a></td>"
2943 "<td class=\"nav%s\"><a href=\"/media\">Media</a></td>"
2944 "</tr></table>\n"
2945 "<div class=\"body\">\n", !strcmp(client->uri, "/") ? " sel" : "", !strcmp(client->uri, "/supplies") ? " sel" : "", !strcmp(client->uri, "/media") ? " sel" : "");
2946}
2947
2948
2949/*

Callers 3

show_mediaFunction · 0.85
show_statusFunction · 0.85
show_suppliesFunction · 0.85

Calls 1

html_printfFunction · 0.85

Tested by

no test coverage detected