]> code.citadel.org Git - citadel.git/blobdiff - webcit/tabs.c
* added gcc printf format checking to wprintf
[citadel.git] / webcit / tabs.c
index f0c72b06911e5a77305f7538187b3f79507d6599..fd50c31b901c05ec9e33d4149147c3e31912d5aa 100644 (file)
@@ -1,17 +1,12 @@
 /*
- * $Id:  $
+ * $Id$
+ *
  */
-/**
- * \defgroup TabUtils Utility functions for creating tabbed dialogs
- * \ingroup WebcitDisplayItems
- */
-/*@{*/
+
 #include "webcit.h"
 
-/**
- * \brief print tabbed dialog
- * \param num_tabs how many tabs do we have?
- * \param tabnames the headers of the tables
+/*
+ * print tabbed dialog
  */
 void tabbed_dialog(int num_tabs, char *tabnames[]) {
        int i;
@@ -22,69 +17,69 @@ void tabbed_dialog(int num_tabs, char *tabnames[]) {
                "       if (which_tab == previously_selected_tab) {                             "
                "               return;                                                         "
                "       }                                                                       "
-               "       $('tabtd'+previously_selected_tab).style.backgroundColor = '#cccccc';   "
                "       $('tabdiv'+previously_selected_tab).style.display = 'none';             "
-               "       $('tabtd'+which_tab).style.backgroundColor = '#ffffff';                 "
                "       $('tabdiv'+which_tab).style.display = 'block';                          "
+               "       $('tabtd'+previously_selected_tab).className = 'tab_cell_edit';         "
+               "       $('tabtd'+which_tab).className = 'tab_cell_label';                      "
                "       previously_selected_tab = which_tab;                                    "
                "}                                                                              "
                "</script>                                                                      \n"
        );
 
-       wprintf("<table id=\"TheTabs\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%%\">"
+       wprintf("<table id=\"TheTabs\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"
                "<tr align=\"center\" style=\"cursor:pointer\"><td>&nbsp;</td>"
        );
 
        for (i=0; i<num_tabs; ++i) {
-               wprintf("<td id=\"tabtd%d\" bgcolor=\"#%s\" "
+               wprintf("<td id=\"tabtd%d\" class=\"%s\" "
                        "onClick='tabsel(\"%d\");'"
-                       ">"
-                       "<span class=\"tablabel\">",
-                       i,
-                       ( (i==0) ? "ffffff" : "cccccc" ),
+                       ">",
                        i,
+                       ( (i==0) ? "tab_cell_label" : "tab_cell_edit" ),
                        i
-               );
+                       );
                wprintf("%s", tabnames[i]);
-               wprintf("</span></td>");
+               wprintf("</td>");
 
                wprintf("<td>&nbsp;</td>\n");
        }
 
        wprintf("</tr></table>\n");
-       wprintf("<table class=\"tabs_background\"><tr><td>");
 }
 
-/**
- * \brief print the tab-header
- * \param tabnum number of the tab to print
- * \param num_tabs total number oftabs to be printed
+/*
+ * print the tab-header
+ *
+ * tabnum:      number of the tab to print
+ * num_tabs:    total number oftabs to be printed
+ *
  */
 void begin_tab(int tabnum, int num_tabs) {
-       wprintf("<div id=\"tabdiv%d\" style=\"display:%s\">",
+       wprintf("<!-- begin tab %d of %d -->\n", tabnum, num_tabs);
+       wprintf("<div id=\"tabdiv%d\" style=\"display:%s\" class=\"tabcontent\" >",
                tabnum,
                ( (tabnum == 0) ? "block" : "none" )
        );
 }
 
-/**
- * \brief print the tab-footer
- * \param tabnum number of the tab to print
- * \param num_tabs total number oftabs to be printed
+/*
+ * print the tab-footer
+ * tabnum:      number of the tab to print
+ * num_tabs:    total number of tabs to be printed
+ *
  */
 void end_tab(int tabnum, int num_tabs) {
        wprintf("</div>\n");
        wprintf("<!-- end tab %d of %d -->\n", tabnum, num_tabs);
 
        if (tabnum == num_tabs-1) {
-               wprintf("</td></tr></table>\n");
+
                wprintf("<script type=\"text/javascript\">"
                        " Nifty(\"table#TheTabs td\", \"small transparent top\");"
                        "</script>"
                );
-                       //" Nifty(\"td#tabtd1\", \"small transparent top\");"
+
        }
 }
 
 
-/*@}*/