aboutsummaryrefslogtreecommitdiff
path: root/wiki.c
diff options
context:
space:
mode:
Diffstat (limited to 'wiki.c')
-rw-r--r--wiki.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/wiki.c b/wiki.c
index cd92564..32f9a82 100644
--- a/wiki.c
+++ b/wiki.c
@@ -113,7 +113,10 @@ int edit(char *path) {
fp ? head(path, path, "vis") : head(path, NULL, NULL);
char buffer[sysconf(_SC_PAGESIZE)];
printf("<form method='post'>\n");
- printf("<p><textarea name=t rows=24 cols=72>");
+ printf("<p class='edit'>\n");
+ if(orz)
+ printf("<a id='orz' href='#'>@picto</a><br>\n");
+ printf("<textarea name=t rows=24 cols=72>");
if(fp)
while(fgets(buffer, sizeof(buffer), fp))
printf("%s", buffer);
@@ -212,11 +215,11 @@ int list(char *raw, int dir, int inc) {
return 0;
}
-int text(char *path) {
+int text(char *path, char *type) {
FILE *fp = fopen(path, "r");
if(fp) {
char buffer[sysconf(_SC_PAGESIZE)];
- printf("Content-Type: text/plain; charset=utf-8\n\n");
+ printf("Content-Type: %s; charset=utf-8\n\n", type);
while(fgets(buffer, sizeof(buffer), fp))
printf("%s", buffer);
}
@@ -291,8 +294,8 @@ int main(int argc, char **argv) {
while(qstr && *qstr) {
switch(*qstr) {
case 'e': return edit(page);
- case 't': return text(page);
- // case 'p': return
+ case 't': return text(page, "text/plain");
+ case 'c': return text(page, "text/css");
}
qstr++;
}