aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile10
-rw-r--r--README6
-rw-r--r--config.def.h3
-rw-r--r--ukulele.c6
-rw-r--r--ukulele.js3
5 files changed, 23 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 052f049..34496e2 100644
--- a/Makefile
+++ b/Makefile
@@ -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
+
diff --git a/README b/README
new file mode 100644
index 0000000..0f42696
--- /dev/null
+++ b/README
@@ -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";
diff --git a/ukulele.c b/ukulele.c
index f1b87af..46bf1a4 100644
--- a/ukulele.c
+++ b/ukulele.c
@@ -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))
diff --git a/ukulele.js b/ukulele.js
index 7ccf6b5..bce1853 100644
--- a/ukulele.js
+++ b/ukulele.js
@@ -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);