Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel
authorArt Cancro <ajc@citadel.org>
Sun, 3 Jan 2016 04:45:15 +0000 (23:45 -0500)
committerArt Cancro <ajc@citadel.org>
Sun, 3 Jan 2016 04:45:15 +0000 (23:45 -0500)
webcit/messages.c
webcit/roomtokens.c
webcit/static/t/navbar.html
webcit/static/t/view_message.html
webcit/static/t/wiki/empty.html
webcit/static/wclib.js

index ac29cd5d7c4ec47015e9956527cedbea031c080b..a8b4c60259a063ccf313212b65d18115cae536db 100644 (file)
@@ -1035,7 +1035,7 @@ void post_message(void)
                StrBuf *Recp = NULL; 
                StrBuf *Cc = NULL;
                StrBuf *Bcc = NULL;
-               char *wikipage = NULL;
+               StrBuf *wikipage = NULL;
                const StrBuf *my_email_addr = NULL;
                StrBuf *CmdBuf = NULL;
                StrBuf *references = NULL;
@@ -1090,7 +1090,7 @@ void post_message(void)
                FreeStrBuf(&EmailAddress);
                FreeStrBuf(&EncBuf);
 
-               wikipage = strdup(bstr("page"));
+               wikipage = NewStrBufDup(sbstr("page"));
                str_wiki_index(wikipage);
                my_email_addr = sbstr("my_email_addr");
                
@@ -1098,7 +1098,7 @@ void post_message(void)
                        StrLength(encoded_subject) +
                        StrLength(Cc) +
                        StrLength(Bcc) + 
-                       strlen(wikipage) +
+                       StrLength(wikipage) +
                        StrLength(my_email_addr) + 
                        StrLength(references);
                CmdBuf = NewStrBufPlain(NULL, sizeof (CMD) + HeaderLen);
@@ -1110,7 +1110,7 @@ void post_message(void)
                             ChrPtr(display_name),
                             saving_to_drafts?"":ChrPtr(Cc),
                             saving_to_drafts?"":ChrPtr(Bcc),
-                            wikipage,
+                            ChrPtr(wikipage),
                             ChrPtr(my_email_addr),
                             ChrPtr(references));
                FreeStrBuf(&references);
@@ -1666,14 +1666,14 @@ void display_enter(void)
                const StrBuf *Recp = NULL; 
                const StrBuf *Cc = NULL;
                const StrBuf *Bcc = NULL;
-               char *wikipage = NULL;
+               StrBuf *wikipage = NULL;
                StrBuf *CmdBuf = NULL;
                const char CMD[] = "ENT0 0|%s|%d|0||%s||%s|%s|%s";
                
                Recp = sbstr("recp");
                Cc = sbstr("cc");
                Bcc = sbstr("bcc");
-               wikipage = strdup(bstr("page"));
+               wikipage = NewStrBufDup(sbstr("page"));
                str_wiki_index(wikipage);
                
                CmdBuf = NewStrBufPlain(NULL, 
@@ -1682,7 +1682,7 @@ void display_enter(void)
                                        StrLength(display_name) +
                                        StrLength(Cc) +
                                        StrLength(Bcc) + 
-                                       strlen(wikipage));
+                                       StrLength(wikipage));
 
                StrBufPrintf(CmdBuf, 
                             CMD,
@@ -1691,7 +1691,7 @@ void display_enter(void)
                             ChrPtr(display_name),
                             ChrPtr(Cc), 
                             ChrPtr(Bcc), 
-                            wikipage
+                            ChrPtr(wikipage)
                );
                serv_puts(ChrPtr(CmdBuf));
                StrBuf_ServGetln(CmdBuf);
index 72daf67406eaaa54cff87805b732f46252539a32..199cc3c1edd14466d650a9aad99d4541550a805d 100644 (file)
@@ -494,6 +494,15 @@ int ConditionalThisRoomXHavePic(StrBuf *Target, WCTemplputParams *TP)
        return WCC->CurRoom.XHaveRoomPic == 1;
 }
 
+int ConditionalThisRoomIsEdit(StrBuf *Target, WCTemplputParams *TP)
+{
+       wcsession *WCC = WC;
+
+       if (WCC == NULL)
+               return 0;
+       return ((WCC->CurRoom.nRoomNameParts > 1) && 
+               (strcmp(ChrPtr(WCC->CurRoom.RoomNameParts[WCC->CurRoom.nRoomNameParts]), "edit") == 0));
+}
 
 int ConditionalThisRoomXHaveInfoText(StrBuf *Target, WCTemplputParams *TP)
 {
@@ -663,6 +672,7 @@ InitModule_ROOMTOKENS
        RegisterConditional("COND:ROOM:EDITACCESS", 0, ConditionalHaveRoomeditRights, CTX_NONE);
 
        RegisterConditional("COND:THISROOM:HAVE_PIC", 0, ConditionalThisRoomXHavePic, CTX_NONE);
+       RegisterConditional("COND:THISROOM:IS_EDIT", 0, ConditionalThisRoomIsEdit, CTX_NONE);
 
        RegisterNamespace("THISROOM:INFOTEXT", 1, 2, tmplput_ThisRoomInfoText, NULL, CTX_NONE);
        RegisterConditional("COND:THISROOM:HAVE_INFOTEXT", 0, ConditionalThisRoomXHaveInfoText, CTX_NONE);
index 7bcc33ceec8060db79f6f36640c3997283696105..21cad17306b2ef9a9e633bd300fc4873c124bbe6 100644 (file)
                                <span class="navbar_link"><?%("COND:WIKI:TYPE", 86, "wiki_history", "", _("Current version", _("History"))></span>
                        </a>
                </li>
+        <??("COND:THISROOM:IS_EDIT", 82)>
+       <li class="publishmessage">
+               <a href="javascript:publishMessage()">
+                       <img src="static/webcit_icons/essen/16x16/skiproom.png" alt="" width="16" height="16">
+                       <span class="navbar_link"><?_("publish to blog")></span>
+               </a>
+       </li>
+       <?!("X", 82)>
 <??("X", 80)>
 
 <?!("COND:THISROOM:CURR_VIEW", 80, #"VIEW_WIKIMD")>
                                <span class="navbar_link"><?%("COND:WIKI:TYPE", 86, "wiki_history", "", _("Current version", _("History"))></span>
                        </a>
                </li>
+        <??("COND:THISROOM:IS_EDIT", 82)>
+       <li class="publishmessage">
+               <a href="javascript:publishMessage()">
+                       <img src="static/webcit_icons/essen/16x16/skiproom.png" alt="" width="16" height="16">
+                       <span class="navbar_link"><?_("publish to blog")></span>
+               </a>
+       </li>
+       <?!("X", 82)>
 <??("X", 80)>
 
 <?!("COND:THISROOM:CURR_VIEW", 90, #"VIEW_BLOG")>
index 79327b16c9c59b02d533517819328814b8a2c93f..a0eba4fc2e97d63ae2cd646a1d0155c6d7418bf7 100644 (file)
@@ -1,4 +1,4 @@
-<div class="message">
+<div class="message" id="msgdiv|<?MAIL:SUMM:N>|<?MAIL:SUMM:INREPLYTO()>">
 <?!("COND:ROOM:TYPE_IS", 13, #"VIEW_BBS")><a name="<?MAIL:SUMM:N>"></a><??("X", 13)>
 <??("COND:ROOM:TYPE_IS", 12, #"VIEW_WIKI")><??("COND:ROOM:TYPE_IS", 12, #"VIEW_WIKIMD")><!-- skip headers for wiki rooms -->
 <div class="message_header">
index 7ba761d808f63c04b92d3c3e1cce7f839146b283..742b42da6098f600941f018c1a6020600b780f1e 100644 (file)
@@ -2,7 +2,7 @@
 <div align="center">
   <table border="0" bgcolor="#ffffff" cellpadding="10">
     <tr><td align="center">
-       <br><b> <?_("There is no page called '"><?BSTR("pagename", "x")><?_("'here").
+       <br><b> <?_("There is no page called '"><?BSTR("pagename", "x")><?_("'here")>.
        </b><br><br>
        <?_("Select the 'Edit this page' link in the room banner if you would like to create this page.")>
        <br><br>
index 462b1f3db060df772ed57121051c1fad955270fc..b15b0cf08f19dba4f0d9204b6de1c8fd0550a786 100644 (file)
@@ -963,9 +963,6 @@ function create_blog()
     var isHtmlWiki = vselectedMarkup === roomtypeWiki;
     var starttext = getBlogStartText(isHtmlWiki);
 
-
-    alert("atonehusnato " + roomname + "  " + starttext);
-
     ToggleVisibility('er_password');
     var type_edit;
     if (adminPW) {
@@ -1112,36 +1109,36 @@ function create_blog()
                     }
                    );
 
-/*
-
-entroom 
-
-
-
-
-POST /editroom HTTP/1.1.
+    return false;
+}
 
 
-nonce=1681692777
-   go=dnthdnth
-   er_name=dnthdnth
-   er_floor=0
-   type=public
-   er_password= 
+function deleteAllSelectedMessages() {
 
-  directory=yes
-   er_dirname=blarg <- file pfad
-   ulallowed=yes
-   dlallowed=yes
-   ulmsg=yes
-   visdir=yes
+}
 
-   anon=no
 
-   er_roomaide=
-   last_tabsel=1
-   ok_button=Save+changes
+function publishMessage()
+{
+    var messages = document.getElementsByClassName("message");
+    var messageIdParts = messages[0].id.split('|');
+    var editRoomName = getTextContent(document.getElementById("rmname"));
+    var roomName = editRoomName.substring(0, editRoomName.length - 5);
+
+    var publish = {
+       editRoom: editRoomName,
+       blogRoom: roomName,
+       msgNo : messageIdParts[1],
+       msgIdStr : messageIdParts[2]
+    }
 
-*/
-    return false;
+    mvCommand = encodeURI("g_cmd=MOVE " + publish.msgNo + "|" + publish.blogRoom + "|1");
+    
+    new Ajax.Request("ajax_servcmd", {
+       parameters: mvCommand,
+       method: 'post',
+       onSuccess: function(transport) {
+           WCLog(transport.responseText);
+       }
+    });
 }
\ No newline at end of file