]> code.citadel.org Git - citadel.git/blobdiff - webcit/static/wclib.js
Still working on sixel
[citadel.git] / webcit / static / wclib.js
index 462b1f3db060df772ed57121051c1fad955270fc..59bbc84b270fa3668857694f752bbd8adfa618f7 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) {
@@ -1002,7 +999,7 @@ function create_blog()
        create_blog_room: {
            nonce:       Nonce,
            er_name:     roomname,
-           type:        'public',
+           type:       'public',
            er_view:     er_view_blog,
            er_floor:    floorID,
            template:    "room_result_json",
@@ -1011,8 +1008,8 @@ function create_blog()
        setflags_blog_room: {
            nonce:       Nonce,
            er_name:     roomname,
-           go:          roomname,
-           type:        'public',
+           go:   roomname,
+           type:       'public',
            er_floor:    floorID,
 
            directory:   "yes",
@@ -1022,7 +1019,7 @@ function create_blog()
            ulmsg:       "no",
            visdir:      "no",
 
-           anon:        "no",
+           anon:       "no",
            last_tabsel: 1,
            er_view:     er_view_blog,
            template:    "room_result_json",
@@ -1031,7 +1028,7 @@ function create_blog()
        create_blog_edit_room: {
            nonce:       Nonce,
            er_name:     editroomname,
-           type:        type_edit,
+           type:       type_edit,
            er_view:     vselectedMarkup,
            er_floor:    floorID,
            er_password: passvoid,
@@ -1041,8 +1038,8 @@ function create_blog()
        setflags_blog_edit_room: {
            nonce:       Nonce,
            er_name:     editroomname,
-           go:          editroomname,
-           type:        type_edit,
+           go:   editroomname,
+           type:       type_edit,
            er_floor:    floorID,
 
            directory:   "yes",
@@ -1052,7 +1049,7 @@ function create_blog()
            ulmsg:       "no",
            visdir:      "yes",
 
-           anon:        "no",
+           anon:       "no",
            last_tabsel: 1,
            er_view:     er_view_blog,
            template:    "room_result_json",
@@ -1061,7 +1058,7 @@ function create_blog()
        blog_wiki_startmessage : {
            nonce:       Nonce,
            force_room:  editroomname,
-           page:        "home",
+           page:       "home",
            markdown:    (isHtmlWiki)?0:1,
            msgtext:     starttext
 
@@ -1112,36 +1109,59 @@ function create_blog()
                     }
                    );
 
-/*
+    return false;
+}
 
-entroom 
 
+function deleteAllSelectedMessages() {
 
+}
 
 
-POST /editroom HTTP/1.1.
+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]
+    }
 
+    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);
+       }
+    });
+}
 
-nonce=1681692777
-   go=dnthdnth
-   er_name=dnthdnth
-   er_floor=0
-   type=public
-   er_password= 
 
-  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
+// Generate a random string of the specified length
+// Useful for generating one-time-use div names
+//
+function randomString(length) {
+       var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghiklmnopqrstuvwxyz'.split('');
+       var str = '';
+
+       if (!length) {
+               length = Math.floor(Math.random() * chars.length);
+       }
+       for (var i = 0; i < length; i++) {
+               str += chars[Math.floor(Math.random() * chars.length)];
+       }
+       return str;
+}
+
+
+
 
-*/
-    return false;
-}
\ No newline at end of file