Palette pop up div type thing. Hmm
authorArt Cancro <ajc@citadel.org>
Wed, 7 May 2008 21:34:13 +0000 (21:34 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 7 May 2008 21:34:13 +0000 (21:34 +0000)
webcit/generate_pastel_palette.c [new file with mode: 0644]
webcit/notes.c
webcit/static/webcit.css

diff --git a/webcit/generate_pastel_palette.c b/webcit/generate_pastel_palette.c
new file mode 100644 (file)
index 0000000..d4c90e5
--- /dev/null
@@ -0,0 +1,27 @@
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <ctype.h>
+
+
+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
+
+}
index e3589b2ae92d9294c6f9eabf8e8901f63902e3a4..a3bb0b5643854f3487b1431edffb90fcc1da9392 100644 (file)
@@ -7,10 +7,24 @@
 #include "groupdav.h"
 #include "webserver.h"
 
+char *pastel_palette[] = {
+       "#dfdfdf",
+       "#ffdfdf",
+       "#dfdfff",
+       "#ffffdf",
+       "#dfffdf",
+       "#ffdfff",
+       "#dfffff",
+       "#ffdfbf",
+       "#dfbfbf"
+};
+
+
 /*
  * Display a <div> 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("<table border=0 cellpadding=0 cellspacing=0 valign=middle width=100%%><tr>");
 
        wprintf("<td align=left valign=middle>");
-       wprintf("<img onclick=\"alert('FIXME');\" ");
+       wprintf("<img onclick=\"$('palette-%s').style.display = 'block';\" ", v->uid);
        wprintf("src=\"static/8paint16.gif\">");
+
+       /* embed color selector */
+       wprintf("<div id=\"palette-%s\" ", v->uid);
+       wprintf("class=\"stickynote_palette\" ");
+       wprintf("style=\"display:none;\" >");
+       wprintf("<table border=0 cellpadding=0 cellspacing=0>");
+       for (i=0; i<9; ++i) {
+               if ((i%3)==0) wprintf("<tr>");
+               wprintf("<td bgcolor=\"%s\"> </td>", pastel_palette[i]);
+               if (((i+1)%3)==0) wprintf("</tr>");
+       }
+       wprintf("</table>");
+       wprintf("</div>");
+
        wprintf("</td>");
 
-       wprintf("<td></td>");   // nothing in the title bar, it's just for dragging
+       wprintf("<td></td>");   // nothing in the title bar, it's just for resizing
 
        wprintf("<td align=right valign=middle>");
        wprintf("<img onclick=\"DeleteStickyNote(event,'%s','%s')\" ", v->uid, _("Delete this note?") );
index f30283460977756ba953ff5f21597c7d4ed31714..7a7bc5b51e79e226e4bf208864e84e3b1390d922 100644 (file)
@@ -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;
+}