* switch roomlisting to templating
[citadel.git] / webcit / static / wclib.js
index 66df5b699316d705ae9e36c3a84d16bc614c0577..7a84ec05a3a7b7ba8afad0c35bafba227fbd5d76 100644 (file)
@@ -210,7 +210,8 @@ function switch_to_menu_buttons() {
   var roomlist = document.getElementById("roomlist");
   roomlist.className += " hidden";
 }
-function IconBarRoomList() {
+
+function GenericTreeRoomList(roomlist) {
   var currentExpanded = ctdlLocalPrefs.readPref("rooms_expanded");
   var curRoomName = "";
   if (document.getElementById("rmname")) {
@@ -218,7 +219,6 @@ function IconBarRoomList() {
   }
   currentDropTargets = new Array();
   var iconbar = document.getElementById("iconbar");
-  roomlist = document.getElementById("roomlist");
   var ul = document.createElement("ul");
   roomlist.appendChild(ul);
   // Add mailbox, because they are special
@@ -268,6 +268,14 @@ function IconBarRoomList() {
     }
   }
 }
+function IconBarRoomList() {
+  roomlist = document.getElementById("roomlist");
+  GenericTreeRoomList(roomlist);
+}
+function KNRoomsRoomList() {
+  roomlist = document.getElementById("roomlist_knrooms");
+  GenericTreeRoomList(roomlist);
+}
 
 function addRoomToList(floorUL,room, roomToEmphasize) {
   var roomName = room[RN_ROOM_NAME];