]> code.citadel.org Git - citadel.git/blobdiff - webcit/roomops.c
More work on the wiki view. Don't try to use it yet.
[citadel.git] / webcit / roomops.c
index 29687f105a75fd153507c846a7d71d090a7605af..9573fc9b3860bc681a5593b38d2fd35fbb0fc88f 100644 (file)
@@ -8,7 +8,7 @@
 
 char floorlist[128][SIZ];
 
-char *viewdefs[6];
+char *viewdefs[7];
 
 void initialize_viewdefs(void) {
        viewdefs[0] = _("Bulletin Board");
@@ -17,6 +17,7 @@ void initialize_viewdefs(void) {
        viewdefs[3] = _("Calendar");
        viewdefs[4] = _("Task List");
        viewdefs[5] = _("Notes List");
+       viewdefs[6] = _("Wiki");
 }
 
 
@@ -225,6 +226,9 @@ void readinfo(void)
        if (buf[0] == '1') {
                fmout("CENTER");
        }
+       else {
+               wprintf(" ");
+       }
 }
 
 
@@ -341,6 +345,13 @@ void embed_room_banner(char *got, int navbar_style) {
                got = fakegot;
        }
 
+       /* The browser needs some information for its own use */
+       wprintf("<script type=\"text/javascript\">      \n"
+               "       room_is_trash = %d;             \n"
+               "</script>\n",
+               WC->wc_is_trash
+       );
+
        /* If the user happens to select the "make this my start page" link,
         * we want it to remember the URL as a "/dotskip" one instead of
         * a "skip" or "gotonext" or something like that.
@@ -506,6 +517,9 @@ void embed_room_banner(char *got, int navbar_style) {
                                                "</span></a></td>\n", _("Add new note")
                                        );
                                        break;
+                               case VIEW_WIKI:
+                                       /* Don't let users create unlinked pages. */
+                                       break;
                                default:
                                        wprintf(
                                                "<td><a href=\"display_enter\">"
@@ -587,6 +601,7 @@ int gotoroom(char *gname)
        WC->wc_floor = extract_int(&buf[4], 10);
        WC->wc_view = extract_int(&buf[4], 11);
        WC->wc_default_view = extract_int(&buf[4], 12);
+       WC->wc_is_trash = extract_int(&buf[4], 13);
 
        if (WC->is_aide)
                WC->is_room_aide = WC->is_aide;
@@ -870,7 +885,7 @@ void display_editroom(void)
 
        /* print the tabbed dialog */
        wprintf("<br />"
-               "<div id=\"fix_scrollbar_bug\">"
+               "<div class=\"fix_scrollbar_bug\">"
                "<TABLE border=0 cellspacing=0 cellpadding=0 width=100%%>"
                "<TR ALIGN=CENTER>"
                "<TD>&nbsp;</TD>\n");
@@ -975,7 +990,7 @@ void display_editroom(void)
        /* end tabbed dialog */ 
 
        /* begin content of whatever tab is open now */
-       wprintf("<div id=\"fix_scrollbar_bug\">"
+       wprintf("<div class=\"fix_scrollbar_bug\">"
                "<TABLE border=0 width=100%% bgcolor=\"#FFFFFF\">\n"
                "<TR><TD>\n");
 
@@ -1827,7 +1842,7 @@ void display_entroom(void)
                "</div>\n<div id=\"content\">\n"
        );
 
-       wprintf("<div id=\"fix_scrollbar_bug\">"
+       wprintf("<div class=\"fix_scrollbar_bug\">"
                "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>\n");
 
        wprintf("<form name=\"create_room_form\" method=\"POST\" action=\"entroom\">\n");
@@ -1850,14 +1865,15 @@ void display_entroom(void)
         wprintf("</SELECT>\n");
 
        /* Our clever little snippet of JavaScript automatically selects
-        * a public room if the view is set to Bulletin Board, and it
-        * selects a mailbox room otherwise.  The user can override this,
-        * of course.
+        * a public room if the view is set to Bulletin Board or wiki, and
+        * it selects a mailbox room otherwise.  The user can override this,
+        * of course.  We also disable the floor selector for mailboxes.
         */
        wprintf("<LI>");
        wprintf(_("Default view for room: "));
         wprintf("<SELECT NAME=\"er_view\" SIZE=\"1\" OnChange=\""
-               "       if (this.form.er_view.value == 0) {     "       
+               "       if ( (this.form.er_view.value == 0)             "
+               "          || (this.form.er_view.value == 6) ) {        "
                "               this.form.type[0].checked=true;         "
                "               this.form.er_floor.disabled = false;    "
                "       }                                               "
@@ -2036,7 +2052,7 @@ void display_private(char *rname, int req_pass)
                "</div>\n<div id=\"content\">\n"
        );
 
-       wprintf("<div id=\"fix_scrollbar_bug\">"
+       wprintf("<div class=\"fix_scrollbar_bug\">"
                "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>\n");
 
        wprintf("<CENTER>\n");