fix format
All checks were successful
pyrite-dev/taiga/pipeline/head This commit looks good

This commit is contained in:
Nishi 2026-03-08 22:32:33 +09:00
commit 55aa66a7db
Signed by: nishi
GPG key ID: 27EF69B208EB9343
12 changed files with 143 additions and 209 deletions

View file

@ -17,8 +17,7 @@ void classic_stylesheet(FILE* out, const char* top) {
free(nodes);
}
if(breadcrumb_bgcolor == NULL)
breadcrumb_bgcolor = "#003366";
if(breadcrumb_bgcolor == NULL) breadcrumb_bgcolor = "#003366";
fprintf(out, "body {\n");
fprintf(out, " padding: 0;\n");
@ -130,8 +129,7 @@ void classic_stylesheet(FILE* out, const char* top) {
void classic_head(FILE* out, const char* top, xl_node_t* header) {
xl_node_t* child;
fprintf(out, " <link rel=\"stylesheet\" href=\"%sstyle.css\">\n",
top);
fprintf(out, " <link rel=\"stylesheet\" href=\"%sstyle.css\">\n", top);
child = header->first_child;
while(child != NULL) {
@ -141,10 +139,8 @@ void classic_head(FILE* out, const char* top, xl_node_t* header) {
}
}
void classic_body(FILE* out, const char* top, const char* title,
xl_node_t* body) {
char year[4 + 1 + 4 +
1]; /* no one would use our software in year 10000... right? :) */
void classic_body(FILE* out, const char* top, const char* title, xl_node_t* body) {
char year[4 + 1 + 4 + 1]; /* no one would use our software in year 10000... right? :) */
char* holder = "Unknown people";
char* sitesearch = NULL;
xl_node_t** nodes;
@ -189,8 +185,7 @@ void classic_body(FILE* out, const char* top, const char* title,
if(sitesearch == NULL)
sitesearch = "https://invalid.link";
fprintf(out, " <table border=\"0\" cellpadding=\"0\" "
"cellspacing=\"0\" width=\"100%%\">\n");
fprintf(out, " <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%%\">\n");
fprintf(out, " <tr width=\"100%%\">\n");
fprintf(out, " <td>\n");
for(i = 0; i < sizeof(images) / sizeof(images[0]); i++) {
@ -203,16 +198,14 @@ void classic_body(FILE* out, const char* top, const char* title,
name = nodes[0]->text;
free(nodes);
}
if(name == NULL)
name = "Logo";
if(name == NULL) name = "Logo";
sprintf(path, "%s.link", images[i]);
if((nodes = xl_get_path(skinconf->root, path)) != NULL) {
link = xl_get_attribute(nodes[0], "href");
free(nodes);
}
if(link == NULL)
link = "https://invalid.link";
if(link == NULL) link = "https://invalid.link";
link = u_path(top, link);
@ -222,10 +215,7 @@ void classic_body(FILE* out, const char* top, const char* title,
if(text != NULL) {
text = u_path(top, text);
fprintf(out,
" <a href=\"%s\"><img "
"src=\"%s\" alt=\"%s\" border=\"0\"></a>\n",
link, text, images[i + 1], name);
fprintf(out, " <a href=\"%s\"><img src=\"%s\" alt=\"%s\" border=\"0\"></a>\n", link, text, images[i + 1], name);
free(text);
}
@ -237,8 +227,7 @@ void classic_body(FILE* out, const char* top, const char* title,
fprintf(out, " </td>\n");
fprintf(out, " </tr>\n");
fprintf(out, " </table>\n");
fprintf(out, " <table border=\"0\" cellpadding=\"0\" "
"cellspacing=\"0\" width=\"100%%\" id=\"breadcrumb\">\n");
fprintf(out, " <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%%\" id=\"breadcrumb\">\n");
fprintf(out, " <tr width=\"100%%\">\n");
fprintf(out, " <td>\n");
if((nodes = xl_get_path(skinconf->root, "breadcrumb.link")) != NULL) {
@ -248,18 +237,14 @@ void classic_body(FILE* out, const char* top, const char* title,
char* link = xl_get_attribute(nodes[i], "href");
char* name = xl_get_attribute(nodes[i], "name");
if(link == NULL)
link = "https://invalid.link";
if(link == NULL) link = "https://invalid.link";
link = u_path(top, link);
if(title == NULL)
title = link;
if(title == NULL) title = link;
if(i > 0)
fprintf(out, " |\n");
fprintf(out, " <a href=\"%s\">%s</a>\n",
link, name);
if(i > 0) fprintf(out, " |\n");
fprintf(out, " <a href=\"%s\">%s</a>\n", link, name);
free(link);
}
@ -267,28 +252,19 @@ void classic_body(FILE* out, const char* top, const char* title,
free(nodes);
}
fprintf(out, " </td>\n");
fprintf(out, " <td nowrap=\"1\" "
"align=\"right\">\n");
fprintf(out, " <form "
"action=\"https://www.google.com/search\" method=\"GET\">\n");
fprintf(out, " <td nowrap=\"1\" align=\"right\">\n");
fprintf(out, " <form action=\"https://www.google.com/search\" method=\"GET\">\n");
fprintf(out, " Search\n");
fprintf(out,
" <input type=\"hidden\" "
"name=\"sitesearch\" value=\"%s\">\n",
sitesearch);
fprintf(out, " <input "
"name=\"q\" size=\"10\">\n");
fprintf(out, " <input "
"type=\"submit\" value=\"Go\">\n");
fprintf(out, " <input type=\"hidden\" name=\"sitesearch\" value=\"%s\">\n", sitesearch);
fprintf(out, " <input name=\"q\" size=\"10\">\n");
fprintf(out, " <input type=\"submit\" value=\"Go\">\n");
fprintf(out, " </form>\n");
fprintf(out, " </td>\n");
fprintf(out, " </tr>\n");
fprintf(out, " </table>\n");
fprintf(out, " <table border=\"0\" cellpadding=\"0\" "
"cellspacing=\"0\" width=\"100%%\">\n");
fprintf(out, " <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%%\">\n");
fprintf(out, " <tr>\n");
fprintf(out, " <td width=\"150\" "
"valign=\"top\">\n");
fprintf(out, " <td width=\"150\" valign=\"top\">\n");
fprintf(out, " <div id=\"nav\">\n");
if((nodes = xl_get_path(skinconf->root, "nav")) != NULL) {
@ -307,8 +283,7 @@ void classic_body(FILE* out, const char* top, const char* title,
fprintf(out, " </div>\n");
fprintf(out, " </td>\n");
fprintf(out, " <td valign=\"top\">\n");
fprintf(out, " <div "
"id=\"content\">\n");
fprintf(out, " <div id=\"content\">\n");
child = body->first_child;
while(child != NULL) {
@ -321,62 +296,31 @@ void classic_body(FILE* out, const char* top, const char* title,
fprintf(out, " </td>\n");
fprintf(out, " </tr>\n");
fprintf(out, " </table>\n");
fprintf(out, " <table border=\"0\" cellpadding=\"0\" "
"cellspacing=\"0\" width=\"100%%\">\n");
fprintf(out, " <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%%\">\n");
fprintf(out, " <tr>\n");
fprintf(
out,
" <td id=\"copyright\" align=\"center\">\n");
fprintf(out,
" Copyright &copy; %s %s%s All "
"rights reserved.\n",
year, holder,
(strlen(holder) > 0 && holder[strlen(holder) - 1] == '.') ? "" : ".");
fprintf(out, " <td id=\"copyright\" align=\"center\">\n");
fprintf(out, " Copyright &copy; %s %s%s All rights reserved.\n", year, holder, (strlen(holder) > 0 && holder[strlen(holder) - 1] == '.') ? "" : ".");
fprintf(out, " <td>\n");
fprintf(out, " </tr>\n");
fprintf(out, " <tr>\n");
fprintf(out, " <td align=\"right\">\n");
fprintf(out,
" <a "
"href=\"https://validator.w3.org/check/referer\"><img "
"src=\"%simage/valid-html401.png\" alt=\"Valid HTML 4.01\" "
"border=\"0\"></a>\n",
top);
fprintf(out,
" <a "
"href=\"https://jigsaw.w3.org/css-validator/\"><img "
"src=\"%simage/valid-css.png\" alt=\"Valid CSS\" border=\"0\"></a>\n",
top);
fprintf(out, " <a href=\"https://validator.w3.org/check/referer\"><img src=\"%simage/valid-html401.png\" alt=\"Valid HTML 4.01\" border=\"0\"></a>\n", top);
fprintf(out, " <a href=\"https://jigsaw.w3.org/css-validator/\"><img src=\"%simage/valid-css.png\" alt=\"Valid CSS\" border=\"0\"></a>\n", top);
fprintf(out, " <td>\n");
fprintf(out, " </tr>\n");
fprintf(out, " </table>\n");
fprintf(out, " <!--[if lte IE 6]>\n");
fprintf(
out,
" <script language=\"javascript\" type=\"text/javascript\">\n");
fprintf(
out,
" for(var i = 0; i < document.images.length; i++){\n");
fprintf(out, " var s = "
"document.images[i].src;\n");
fprintf(out, " <script language=\"javascript\" type=\"text/javascript\">\n");
fprintf(out, " for(var i = 0; i < document.images.length; i++){\n");
fprintf(out, " var s = document.images[i].src;\n");
fprintf(out, " if(s.indexOf('.png') > 0){\n");
fprintf(out, " var oldw = "
"document.images[i].clientWidth;\n");
fprintf(out, " var oldh = "
"document.images[i].clientHeight;\n");
fprintf(out,
" document.images[i].src = "
"'%simage/fill.gif';\n",
top);
fprintf(
out,
" document.images[i].style.filter = "
"\"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='\" + s + \"', "
"sizingMethod='scale')\";\n");
fprintf(out, " var oldw = document.images[i].clientWidth;\n");
fprintf(out, " var oldh = document.images[i].clientHeight;\n");
fprintf(out, " document.images[i].src = '%simage/fill.gif';\n", top);
fprintf(out, " document.images[i].style.filter = \"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='\" + s + \"', sizingMethod='scale')\";\n");
fprintf(out, " "
"document.images[i].style.width = oldw + \"px\";\n");
fprintf(out, " "
"document.images[i].style.height = oldh + \"px\";\n");
fprintf(out, " document.images[i].style.height = oldh + \"px\";\n");
fprintf(out, " }\n");
fprintf(out, " }\n");
fprintf(out, " </script>\n");