From 1c9d9d758bac60c1a9a36d57fe5b8162171519e8 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sun, 11 May 2008 04:52:22 +0000 Subject: [PATCH] Color selector for sticky notes is now opaque instead 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 | 28 ---------------------------- webcit/notes.c | 29 ++++++++++++++--------------- webcit/static/wclib.js | 23 +++++++++++++++++++++++ webcit/static/webcit.css | 9 +++++---- 4 files changed, 42 insertions(+), 47 deletions(-) delete mode 100644 webcit/generate_pastel_palette.c diff --git a/webcit/generate_pastel_palette.c b/webcit/generate_pastel_palette.c deleted file mode 100644 index 8a8461621..000000000 --- a/webcit/generate_pastel_palette.c +++ /dev/null @@ -1,28 +0,0 @@ -#include -#include -#include -#include - - -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 - -} diff --git a/webcit/notes.c b/webcit/notes.c index 5e79ba5c6..1fcb6213d 100644 --- a/webcit/notes.c +++ b/webcit/notes.c @@ -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(""); wprintf("
"); - wprintf("uid); + 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(""); @@ -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); diff --git a/webcit/static/wclib.js b/webcit/static/wclib.js index 5eec5d0d4..41d8232fe 100644 --- a/webcit/static/wclib.js +++ b/webcit/static/wclib.js @@ -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; diff --git a/webcit/static/webcit.css b/webcit/static/webcit.css index 7a7bc5b51..b06fb006d 100644 --- a/webcit/static/webcit.css +++ b/webcit/static/webcit.css @@ -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; } -- 2.30.2