From eb7d9c4e42cb2868ae120e8388ba350854557b12 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 7 May 2008 21:34:13 +0000 Subject: [PATCH] Palette pop up div type thing. Hmm --- webcit/generate_pastel_palette.c | 27 +++++++++++++++++++++++++++ webcit/notes.c | 32 ++++++++++++++++++++++++++++++-- webcit/static/webcit.css | 20 ++++++++++++++++++++ 3 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 webcit/generate_pastel_palette.c diff --git a/webcit/generate_pastel_palette.c b/webcit/generate_pastel_palette.c new file mode 100644 index 000000000..d4c90e5a3 --- /dev/null +++ b/webcit/generate_pastel_palette.c @@ -0,0 +1,27 @@ +#include +#include +#include +#include + + +void rgb(int red, int green, int blue) +{ + printf(" \"#%02x%02x%02x\",\n", red, green, blue); +} + + +main() +{ + int pastel = 223; // try 191 if color depth is shallow + + rgb (pastel, pastel, pastel); // pastel grey + rgb (255, pastel, pastel); // pastel red + rgb (pastel, pastel, 255); // pastel blue + rgb (255, 255, pastel); // pastel yellow + rgb (pastel, 255, pastel); // pastel green + rgb (255, pastel, 255); // pastel magenta + rgb (pastel, 255, 255); // pastel cyan + rgb (255, pastel, 2*pastel-255); // pastel orange + rgb (pastel, 2*pastel-255, 2*pastel-255); // pastel brown + +} diff --git a/webcit/notes.c b/webcit/notes.c index e3589b2ae..a3bb0b564 100644 --- a/webcit/notes.c +++ b/webcit/notes.c @@ -7,10 +7,24 @@ #include "groupdav.h" #include "webserver.h" +char *pastel_palette[] = { + "#dfdfdf", + "#ffdfdf", + "#dfdfff", + "#ffffdf", + "#dfffdf", + "#ffdfff", + "#dfffff", + "#ffdfbf", + "#dfbfbf" +}; + + /* * Display a
containing a rendered sticky note. */ void display_vnote_div(struct vnote *v) { + int i; /* begin outer div */ @@ -36,11 +50,25 @@ void display_vnote_div(struct vnote *v) { wprintf(""); wprintf(""); - wprintf(""); // nothing in the title bar, it's just for dragging + wprintf(""); // nothing in the title bar, it's just for resizing wprintf("
"); - wprintf("uid); wprintf("src=\"static/8paint16.gif\">"); + + /* embed color selector */ + wprintf("
uid); + wprintf("class=\"stickynote_palette\" "); + wprintf("style=\"display:none;\" >"); + wprintf(""); + for (i=0; i<9; ++i) { + if ((i%3)==0) wprintf(""); + wprintf("", pastel_palette[i]); + if (((i+1)%3)==0) wprintf(""); + } + wprintf("
"); + wprintf("
"); + wprintf("
"); wprintf("uid, _("Delete this note?") ); diff --git a/webcit/static/webcit.css b/webcit/static/webcit.css index f30283460..7a7bc5b51 100644 --- a/webcit/static/webcit.css +++ b/webcit/static/webcit.css @@ -1372,3 +1372,23 @@ li.event_unread span, a.event_read_title { right: 0px; bottom: 0px; } + +.stickynote_palette { + position: absolute; + width: 48px; + height: 48px; + background-color: #ffffff; +} + +.stickynote_palette table { + margin: 0; + padding: 0; +} + +.stickynote_palette td { + width: 16px; + height: 16px; + filter:alpha(opacity=100); + -moz-opacity:1.0; + opacity: 1.0; +} -- 2.30.2