Drag+Drop move: propperly escape the roomname so + and friends in roomnames remain...
[citadel.git] / webcit / static / wclib.js
index 956dd67b53d40de30b298a6dd8c2086805b7d28b..de48e2efbf8c37a6112109c341586ca6274048c0 100644 (file)
@@ -89,6 +89,17 @@ function SMTPRunQueue()
     });
 }
 
+function NetworkSynchronizeRoom(NodeName)
+{
+    var p;
+
+    p= encodeURI('g_cmd=NSYN ' + NodeName);
+    new Ajax.Request('ajax_servcmd', {
+       method: 'post',
+       parameters: p,
+       onComplete: function(transport) { ajax_important_message(transport.responseText.substr(4));}
+    });
+}
 function ToggleVisibility ($Which)
 {
        if (document.getElementById)
@@ -188,6 +199,19 @@ function hide_imsg_popup() {
 
        document.poppedLayer.style.visibility = "hidden";
 }
+function remove_something(what_to_search, new_visibility) {
+       if (browserType == "gecko") {
+               document.poppedLayer = eval('document.getElementById(\'' + what_to_search + '\')');
+       }
+       else if (browserType == "ie") {
+               document.poppedLayer = eval('document.all[\'' + what_to_search + '\']');
+       }
+       else {
+               document.poppedLayer = eval('document.layers[\'`' + what_to_search + '\']');
+       }
+    if (document.poppedLayer!= null)
+       document.poppedLayer.innerHTML = "";
+}
 
 function unhide_imsg_popup() {
        if (browserType == "gecko") {
@@ -364,11 +388,12 @@ function addRoomToList(floorUL,room, roomToEmphasize) {
 function roomListDropHandler(target, dropped) {
   if (dropped.getAttribute("citadel:msgid")) {
       var room = getTextContent(target);
+      console.log(room);
       var msgIds = "";
       for(msgId in currentlyMarkedRows) { //defined in summaryview.js
          msgIds += ","+msgId;
          if (msgIds.length > 800) {
-             var mvCommand = encodeURI("g_cmd=MOVE " + msgIds + "|"+room+"|0");
+             var mvCommand = "g_cmd=MOVE%20" + msgIds + "|"+encodeURIComponent(room)+"|0";
              new Ajax.Request("ajax_servcmd", {
                  parameters: mvCommand,
                  method: 'post',
@@ -377,7 +402,7 @@ function roomListDropHandler(target, dropped) {
          }
 
       }
-      var mvCommand = encodeURI("g_cmd=MOVE " + msgIds + "|"+room+"|0");
+      var mvCommand = "g_cmd=MOVE%20" + msgIds + "|"+encodeURIComponent(room)+"|0";
       new Ajax.Request('ajax_servcmd', {
          method: 'post',
          parameters: mvCommand,
@@ -907,8 +932,8 @@ function WCLog(msg) {
 }
 
 function RefreshSMTPqueueDisplay() {
-       new Ajax.Updater('smtpqueue_inner_div',
-       'display_smtpqueue_inner_div', { method: 'get',
+       new Ajax.Updater('mailqueue_list',
+       'dotskip?room=__CitadelSMTPspoolout__&view=11&ListOnly=yes', { method: 'get',
                parameters: Math.random() } );
 }
 
@@ -918,7 +943,7 @@ function DeleteSMTPqueueMsg(msgnum1, msgnum2) {
                'ajax_servcmd', {
                        method: 'post',
                        parameters: p,
-                       onComplete: RefreshSMTPqueueDisplay()
+                       onComplete: function(transport) { ajax_important_message(transport.responseText.substr(4)); RefreshSMTPqueueDisplay();}
                }
        );
 }