Color selector for sticky notes is now opaque instead
authorArt Cancro <ajc@citadel.org>
Sun, 11 May 2008 04:52:22 +0000 (04:52 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 11 May 2008 04:52:22 +0000 (04:52 +0000)
of translucent; it no longer gets covered up by the in-place editor when the mouse
moves into the div, and it disappears when the palette icon is clicked a second
time.  Now all that's left to do is write the selector.

webcit/generate_pastel_palette.c [deleted file]
webcit/notes.c
webcit/static/wclib.js
webcit/static/webcit.css

diff --git a/webcit/generate_pastel_palette.c b/webcit/generate_pastel_palette.c
deleted file mode 100644 (file)
index 8a84616..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#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;
-       int pastel = 191;
-
-       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 5e79ba5c609c7e4dd5bdee4d82349dd84535a728..1fcb6213d5870eff42a2d65344a4f1ea23eb01e1 100644 (file)
@@ -8,15 +8,15 @@
 #include "webserver.h"
 
 char *pastel_palette[] = {
-       "#bfbfbf",
-       "#ffbfbf",
-       "#bfbfff",
-       "#ffffbf",
-       "#bfffbf",
-       "#ffbfff",
-       "#bfffff",
-       "#ffbfbf",
-       "#bfbfbf"
+       "#808080",
+       "#ff8080",
+       "#8080ff",
+       "#ffff80",
+       "#80ff80",
+       "#ff80ff",
+       "#80ffff",
+       "#ff8080",
+       "#808080"
 };
 
 
@@ -50,13 +50,12 @@ 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=\"$('palette-%s').style.display = 'block';\" ", v->uid);
+       wprintf("<img onclick=\"NotesClickPalette(event,'%s')\" ", 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>");
@@ -165,8 +164,8 @@ struct vnote *vnote_new_from_msg(long msgnum) {
                                vnote_from_body = vnote_new();
                                vnote_from_body->uid = strdup(uid_from_headers);
                                vnote_from_body->color_red = 0xFF;
-                               vnote_from_body->color_green = 0xFF;    // pastel yellow
-                               vnote_from_body->color_blue = 0xBF;
+                               vnote_from_body->color_green = 0xff;    // pastel yellow
+                               vnote_from_body->color_blue = 0x80;
                                vnote_from_body->body = malloc(32768);
                                vnote_from_body->body[0] = 0;
                                body_len = 0;
@@ -339,8 +338,8 @@ void add_new_note(void) {
                v->uid = malloc(128);
                generate_uuid(v->uid);
                v->color_red = 0xFF;
-               v->color_green = 0xFF;  // pastel yellow
-               v->color_blue = 0xBF;
+               v->color_green = 0xff;  // pastel yellow
+               v->color_blue = 0x80;
                v->body = strdup(_("Click on any note to edit it."));
                write_vnote_to_server(v);
                vnote_free(v);
index 5eec5d0d4a45043610bc51bd078ce758319c809a..41d8232fe5ba3be285836e94616d5bf777402d50 100644 (file)
@@ -498,6 +498,29 @@ function NotesDragMouseDown(evt, uid) {
 
 
 
+function NotesClickPalette(evt, uid) {
+       uid_of_note_being_colored = uid;
+       d = $('palette-' + uid_of_note_being_colored);
+
+       if (d.style.display) {
+               if (d.style.display == 'none') {
+                       d.style.display = 'block';
+               }
+               else {
+                       d.style.display = 'none';
+               }
+       }
+       else {
+               d.style.display = 'block';
+       }
+
+       return true;
+}
+
+
+
+
+
 // These functions handle resizing sticky notes by dragging the resize handle
 
 var uid_of_note_being_resized = 0;
index 7a7bc5b51e79e226e4bf208864e84e3b1390d922..b06fb006dd7bee75187ec56cd55e20f46aa826e3 100644 (file)
@@ -1343,9 +1343,10 @@ li.event_unread span, a.event_read_title {
        position: absolute;
        width: 200px;
        height: 200px;
-       border: 1px solid black;
+       border: 1px solid #333;
        background-color: #ffff00;
        overflow: hidden;
+       z-index: 10;
 }
 
 .stickynote_titlebar {
@@ -1378,6 +1379,9 @@ li.event_unread span, a.event_read_title {
        width: 48px;
        height: 48px;
        background-color: #ffffff;
+       border: 1px solid #333;
+       z-index: 15;
+       display: none;
 }
 
 .stickynote_palette table {
@@ -1388,7 +1392,4 @@ li.event_unread span, a.event_read_title {
 .stickynote_palette td {
        width: 16px;
        height: 16px;
-       filter:alpha(opacity=100); 
-       -moz-opacity:1.0;         
-       opacity: 1.0;
 }