]> code.citadel.org Git - citadel.git/blobdiff - webcit/static/wclib.js
Added code to activate color selection in javascript.
[citadel.git] / webcit / static / wclib.js
index 5eec5d0d4a45043610bc51bd078ce758319c809a..5ff50ab0e2dabe34b8baeca4ac8c8c9584983c25 100644 (file)
@@ -497,6 +497,43 @@ function NotesDragMouseDown(evt, uid) {
 }
 
 
+// Called when the user clicks on the palette icon of a sticky note to change its color.
+// It toggles the color selector visible or invisible.
+
+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;
+}
+
+
+// Called when the user clicks on one of the colors in an open color selector.
+// Sets the desired color and then closes the color selector.
+
+function NotesClickColor(evt, uid, red, green, blue) {
+       uid_of_note_being_colored = uid;
+       d = $('palette-' + uid_of_note_being_colored);
+
+       alert('FIXME red=' + red + ' green=' + green + ' blue=' + blue);
+
+       d.style.display = 'none';
+}
+
+
+
 
 // These functions handle resizing sticky notes by dragging the resize handle