diff options
-rw-r--r-- | Makefile | 10 | ||||
-rw-r--r-- | README | 6 | ||||
-rw-r--r-- | config.def.h | 3 | ||||
-rw-r--r-- | ukulele.c | 6 | ||||
-rw-r--r-- | ukulele.js | 3 |
5 files changed, 23 insertions, 5 deletions
@@ -1,3 +1,7 @@ +TARGET ?= /srv/www/ukulele.cgi +CSSTARGET ?= /srv/www/ukulele.css +JSTARGET ?= /srv/www/ukulele.js + all: ukulele.cgi ukulele.cgi: config.h ukulele.c @@ -9,4 +13,10 @@ config.h: clean: rm -f ukulele.cgi +install: ukulele.cgi + install ukulele.cgi ${TARGET} + install ukulele.css ${CSSTARGET} + install ukulele.js ${JSTARGET} + again: clean all + @@ -0,0 +1,6 @@ += ukulele - a ~ for all + +hallo, dette er en wiki spesielt godt egnet til å ta vare på kakeoppskrifter og lange lister over yndlingsteene dine. + +ukulele bor på [blekksprut.net: https://blekksprut.net/git/ukulele] og brukes av alle de snille folkene i [#teatime: http://chat.kyber.io/?channels=teatime]. + diff --git a/config.def.h b/config.def.h index 74bcc14..09a60d7 100644 --- a/config.def.h +++ b/config.def.h @@ -1,6 +1,7 @@ -int orz = 0; int dirlist = 0; +static char *orz = 0; + static char *title = "a wiki"; static char *id = "anonymous"; static char *home = "home"; @@ -37,8 +37,8 @@ void head(char *page, char *link, char *what) { printf("Content-Type: text/html; charset=utf-8\n\n"); printf("<!doctype html>\n"); printf("<title>%s · %s</title>\n", title, page); - printf("<link rel='stylesheet' type='text/css' href='%s/wiki.css'>\n", base); - printf("<script src='%s/wiki.js'></script>\n", base); + printf("<link rel='stylesheet' type='text/css' href='%s/ukulele.css'>\n", base); + printf("<script src='%s/ukulele.js'></script>\n", base); printf("<h1>"); if(link && what && !strcmp(what, "rediger")) printf("<a data-text='%s' href='%s'>%s</a>", what, link, page); @@ -123,7 +123,7 @@ int edit(char *path) { printf("<form method='post'>\n"); printf("<p class='edit'>\n"); if(orz) - printf("<a id='orz' href='#'>{picto}</a><br>\n"); + printf("<a id='orz' data-url='%s' href='#'>{picto}</a><br>\n", orz); printf("<textarea name=t rows=24 cols=72>"); if(fp) while(fgets(buffer, sizeof(buffer), fp)) @@ -117,8 +117,9 @@ document.addEventListener("DOMContentLoaded", function(e) { var orz = document.getElementById('orz'); if(orz) { + var url = orz.getAttribute('data-url'); orz.onclick = function(e) { - window.open("/orz"); + window.open(url); return false; } button(orz, "> sitat", marxup_quote); |