Began replacing the FSF's street address with their
[citadel.git] / webcit / static / wclib.js
index 8b9f83bf1429f0889f6115e4207a7a9f68fa4feb..792928d7969e0dc7d44c5abca52860a9603b8569 100644 (file)
@@ -3,10 +3,10 @@
  *
  * Copyright (c) 2005-2011 by the citadel.org team
  *
- * This program is open source software.  You can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 3 of the
- * License, or (at your option) any later version.
+ * This program is open source software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-
 var browserType;
 var room_is_trash = 0;
 
@@ -270,7 +268,7 @@ function addRoomToList(floorUL,room, roomToEmphasize) {
   var hasNewMsgs = ((raflags & UA_HASNEWMSGS) == UA_HASNEWMSGS);
   var roomLI = document.createElement("li");
   var roomA = document.createElement("a");
-  roomA.setAttribute("href","dotgoto?room="+roomName);
+  roomA.setAttribute("href","dotgoto?room="+encodeURIComponent(roomName));
   roomA.appendChild(document.createTextNode(roomName));
   roomLI.appendChild(roomA);
   floorUL.appendChild(roomLI);
@@ -302,17 +300,26 @@ function addRoomToList(floorUL,room, roomToEmphasize) {
 
 function roomListDropHandler(target, dropped) {
   if (dropped.getAttribute("citadel:msgid")) {
-    var room = getTextContent(target);
-    var msgIds = "";
-    for(msgId in currentlyMarkedRows) { //defined in summaryview.js
-      msgIds += ","+msgId;
-    }
-    var mvCommand = encodeURI("g_cmd=MOVE " + msgIds + "|"+room+"|0");
-    new Ajax.Request('ajax_servcmd', {
-      method: 'post',
+      var room = getTextContent(target);
+      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");
+             new Ajax.Request("ajax_servcmd", {
+                 parameters: mvCommand,
+                 method: 'post',
+             });
+             msgIds = "";
+         }
+
+      }
+      var mvCommand = encodeURI("g_cmd=MOVE " + msgIds + "|"+room+"|0");
+      new Ajax.Request('ajax_servcmd', {
+         method: 'post',
          parameters: mvCommand,
          onComplete: deleteAllMarkedRows()});
-    } 
+  }
 }
 function expandFloorEvent(event) {
   expandFloor(event.target);
@@ -860,6 +867,7 @@ function ConfirmLogoff() {
                'do_template?template=confirmlogoff',
                {
                        method: 'get',
+                       evalScripts: true,
                        onSuccess: function(cl_success) {
                                toggleModal(1);
                        }
@@ -880,13 +888,13 @@ function toggle_roomlist()
        /* WARNING: VILE, SLEAZY HACK.  We determine the state of the box based on the image loaded. */
        if ( $('expand_roomlist').src.substring($('expand_roomlist').src.length - 12) == "collapse.gif" ) {
                $('roomlist').style.display = 'none';
-               $('expand_roomlist').src = 'static/expand.gif';
+               $('expand_roomlist').src = 'static/webcit_icons/expand.gif';
                wstate=0;
        }
 
        else {
                $('roomlist').style.display = 'block';
-               $('expand_roomlist').src = 'static/collapse.gif';
+               $('expand_roomlist').src = 'static/webcit_icons/collapse.gif';
                $('roomlist').innerHTML = '';
                FillRooms(IconBarRoomList);
                wstate=1;
@@ -905,13 +913,13 @@ function toggle_wholist()
        /* WARNING: VILE, SLEAZY HACK.  We determine the state of the box based on the image loaded. */
        if ( $('expand_wholist').src.substring($('expand_wholist').src.length - 12) == "collapse.gif" ) {
                $('online_users').style.display = 'none';
-               $('expand_wholist').src = 'static/expand.gif';
+               $('expand_wholist').src = 'static/webcit_icons/expand.gif';
                wstate=0;
        }
 
        else {
                $('online_users').style.display = 'block';
-               $('expand_wholist').src = 'static/collapse.gif';
+               $('expand_wholist').src = 'static/webcit_icons/collapse.gif';
                activate_iconbar_wholist_populat0r();
                wstate=1;
        }