$Id$
+Thu Dec 1 17:42:48 EST 2005 ajc
+* which_div_expanded is now persistent across page loads
+
Thu Dec 1 17:15:32 EST 2005 ajc
* Clicking on the expanded floor div collapses it.
}
+void set_floordiv_expanded(char *which_floordiv) {
+ begin_ajax_response();
+ safestrncpy(WC->floordiv_expanded, which_floordiv, sizeof WC->floordiv_expanded);
+ end_ajax_response();
+}
+
/*
*
*/
char floor_name[256];
char old_floor_name[256];
char floordivtitle[256];
+ char floordiv_id[32];
int levels, oldlevels;
int i, t;
int num_drop_targets = 0;
if (levels == 1) {
/* Begin floor */
stresc(floordivtitle, floor_name, 0, 0);
+ sprintf(floordiv_id, "floordiv%d", i);
wprintf("<span class=\"ib_roomlist_floor\" "
- "onClick=\"expand_floor('floordiv%d')\">"
- "%s</span><br>\n", i, floordivtitle);
- wprintf("<div id=\"floordiv%d\" style=\"display:none\">", i);
+ "onClick=\"expand_floor('%s')\">"
+ "%s</span><br>\n", floordiv_id, floordivtitle);
+ wprintf("<div id=\"%s\" style=\"display:%s\">",
+ floordiv_id,
+ (!strcasecmp(floordiv_id, WC->floordiv_expanded) ? "block" : "none")
+ );
}
oldlevels = levels;
}
wprintf("num_drop_targets = %d;\n", num_drop_targets);
+ if (strlen(WC->floordiv_expanded) > 1) {
+ wprintf("which_div_expanded = '%s';\n", WC->floordiv_expanded);
+ }
wprintf("\">\n");
/* END: The old invisible pixel trick, to get our JavaScript to initialize */
function expand_floor(floor_div) {
if (which_div_expanded != null) {
- $(which_div_expanded).style.display = 'none' ;
+ if ($(which_div_expanded) != null) {
+ $(which_div_expanded).style.display = 'none' ;
+ }
}
if (which_div_expanded == floor_div) {
which_div_expanded = null;
}
$(floor_div).style.display = 'block';
which_div_expanded = floor_div;
+
+ // notify the server of what we did
+ new Ajax.Request(
+ 'set_floordiv_expanded/'+floor_div, {
+ method: 'post',
+ }
+ );
}
function switch_to_menu_buttons() {
recp_autocomplete(bstr("cc"));
} else if (!strcasecmp(action, "bcc_autocomplete")) {
recp_autocomplete(bstr("bcc"));
+ } else if (!strcasecmp(action, "set_floordiv_expanded")) {
+ set_floordiv_expanded(arg1);
} else if (!strcasecmp(action, "diagnostics")) {
output_headers(1, 1, 1, 0, 0, 0);
wprintf("Session: %d<hr />\n", WC->wc_session);
time_t cache_timestamp;
int current_iconbar; /* What's currently in the iconbar? */
+ char floordiv_expanded[32]; /* which floordiv currently expanded */
};
/* values for WC->current_iconbar */
int CtdlDecodeQuotedPrintable(char *decoded, char *encoded, int sourcelen);
void spawn_another_worker_thread(void);
void display_rss(char *roomname, char *request_method);
+void set_floordiv_expanded(char *which_floordiv);
void embed_room_banner(char *, int);
/* navbar types that can be passed to embed_room_banner */