X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Ftabs.c;h=4b58ba590a64c086ce8eba75dd18583f63ff4655;hb=HEAD;hp=20f3e3583b13098d85f8343d2f022058036fc509;hpb=c6aec42f213ec284e34648f3d69bcf927dccddb1;p=citadel.git diff --git a/webcit/tabs.c b/webcit/tabs.c index 20f3e3583..4b58ba590 100644 --- a/webcit/tabs.c +++ b/webcit/tabs.c @@ -9,24 +9,31 @@ void tabbed_dialog(int num_tabs, const char *tabnames[]) { int i; StrBufAppendPrintf(WC->trailing_javascript, - "var previously_selected_tab = '0'; \n" - "function tabsel(which_tab) { \n" - " if (which_tab == previously_selected_tab) { \n" - " return; \n" - " } \n" - " $('tabdiv'+previously_selected_tab).style.display = 'none'; \n" - " $('tabdiv'+which_tab).style.display = 'block'; \n" - " $('tabtd'+previously_selected_tab).className = 'tab_cell_edit'; \n" - " $('tabtd'+which_tab).className = 'tab_cell_label'; \n" - " previously_selected_tab = which_tab; \n" - "} \n"); + "var previously_selected_tab = '0'; \n" + "function tabsel(which_tab) { \n" + " if (which_tab == previously_selected_tab) { \n" + " return; \n" + " } \n" + " $('tabdiv'+previously_selected_tab).style.display = 'none'; \n" + " $('tabdiv'+which_tab).style.display = 'block'; \n" + " $('tabtd'+previously_selected_tab).className = 'tab_cell_edit'; \n" + " $('tabtd'+which_tab).className = 'tab_cell_label'; \n" + " previously_selected_tab = which_tab; \n" + "} \n" + ); wc_printf("" - ""); + "" + ); - for (i = 0; i < num_tabs; ++i) { + for (i=0; i", i, ((i == 0) ? "tab_cell_label" : "tab_cell_edit"), i); + "onClick='tabsel(\"%d\");'" + ">", + i, + ( (i==0) ? "tab_cell_label" : "tab_cell_edit" ), + i + ); wc_printf("%s", tabnames[i]); wc_printf(""); @@ -53,8 +60,9 @@ void begin_tab(int tabnum, int num_tabs) { else { wc_printf("\n", tabnum, num_tabs); wc_printf("
", - tabnum, ((tabnum == 0) ? "block" : "none") - ); + tabnum, + ( (tabnum == 0) ? "block" : "none" ) + ); } } @@ -81,37 +89,55 @@ void end_tab(int tabnum, int num_tabs) { /* * print tabbed dialog */ -void StrTabbedDialog(StrBuf * Target, int num_tabs, StrBuf * tabnames[]) { +void StrTabbedDialog(StrBuf *Target, int num_tabs, StrBuf *tabnames[]) { int i; - StrBufAppendBufPlain(Target, - HKEY(" \n"), 0); - - StrBufAppendBufPlain(Target, - HKEY("
 
 
" - ""), 0); - - for (i = 0; i < num_tabs; ++i) { - StrBufAppendPrintf(Target, - "
 ", i, ((i == 0) ? "tab_cell_label" : "tab_cell_edit"), i); + StrBufAppendBufPlain( + Target, + HKEY( + " \n" + ), 0); + + StrBufAppendBufPlain( + Target, + HKEY( + "" + "" + ), 0); + + for (i=0; i", + i, + ( (i==0) ? "tab_cell_label" : "tab_cell_edit" ), + i + ); StrEscAppend(Target, tabnames[i], NULL, 0, 0); - StrBufAppendBufPlain(Target, HKEY("" "\n"), 0); + StrBufAppendBufPlain( + Target, + HKEY( + "" + "\n"), 0); } - StrBufAppendBufPlain(Target, HKEY("
   
\n"), 0); + StrBufAppendBufPlain( + Target, + HKEY("
\n"), 0); } /* @@ -121,24 +147,34 @@ void StrTabbedDialog(StrBuf * Target, int num_tabs, StrBuf * tabnames[]) { * num_tabs: total number oftabs to be printed * */ -void StrBeginTab(StrBuf * Target, int tabnum, int num_tabs, StrBuf ** Names) { +void StrBeginTab(StrBuf *Target, int tabnum, int num_tabs, StrBuf **Names) { if (tabnum == num_tabs) { - StrBufAppendBufPlain(Target, HKEY("\n
"), 0); + StrBufAppendBufPlain( + Target, + HKEY("] -->\n
"), 0); } else { - StrBufAppendBufPlain(Target, HKEY("\n
", - tabnum, ((tabnum == 0) ? "block" : "none") - ); + StrBufAppendPrintf( + Target, + "] -->\n
", + tabnum, + ( (tabnum == 0) ? "block" : "none" ) + ); } } @@ -148,16 +184,27 @@ void StrBeginTab(StrBuf * Target, int tabnum, int num_tabs, StrBuf ** Names) { * num_tabs: total number of tabs to be printed * */ -void StrEndTab(StrBuf * Target, int tabnum, int num_tabs) { +void StrEndTab(StrBuf *Target, int tabnum, int num_tabs) { if (tabnum == num_tabs) { - StrBufAppendBufPlain(Target, HKEY("
\n" "\n"), 0); + StrBufAppendBufPlain( + Target, + HKEY( + "
\n" + "\n"), 0); } else { - StrBufAppendPrintf(Target, "
\n", "\n", tabnum, num_tabs); + StrBufAppendPrintf( + Target, + "
\n", + "\n", tabnum, num_tabs + ); } - if (havebstr("last_tabsel")) { + if (havebstr("last_tabsel")) + { StrBufAppendPrintf(Target, "", BSTR("last_tabsel")); } } + +