]> code.citadel.org Git - citadel.git/blobdiff - webcit/static/wclib.js
* Now attempting to fix the final few rendering problems in Internet Explorer. Testi...
[citadel.git] / webcit / static / wclib.js
index 66df5b699316d705ae9e36c3a84d16bc614c0577..961b995cad508f7e435737d7148ee81949a21807 100644 (file)
@@ -32,11 +32,8 @@ var ns6=document.getElementById&&!document.all;
 Event.observe(window, 'load', ToggleTaskDateOrNoDateActivate);
 Event.observe(window, 'load', taskViewActivate);
 Event.observe(window, 'load', fixbanner);
-Event.observe(window, 'load', resizeViewport);
-Event.observe(window, 'resize', resizeViewport);
 //document.observe("dom:loaded", setupPrefEngine);
 document.observe("dom:loaded", setupIconBar);
-document.observe('dom:loaded', function() { if (!!document.getElementById("ib_chat_launch")) { $('ib_chat_launch').observe('click', launchChat); } });
 function CtdlRandomString()  {
        return((Math.random()+'').substr(3));
 }
@@ -171,7 +168,7 @@ function setupIconBar() {
   }
   var online_users = document.getElementById("online_users");
   if (online_users.offsetParent != null && online_users.offsetTop > 0) {
-    new Ajax.PeriodicalUpdater('online_users', 'do_template?template=wholist_section', {method: 'get', frequency: 30});
+    new Ajax.PeriodicalUpdater('online_users', 'do_template?template=who_iconbar', {method: 'get', frequency: 30});
   }
 }
 function changeIconBarEvent(event) {
@@ -210,7 +207,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 +216,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,14 +265,23 @@ 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];
   var flag = room[RN_ROOM_FLAG];
   var curView = room[RN_CUR_VIEW];
   var view = room[RN_DEF_VIEW];
+  var raflags = room[RN_RAFLAGS];
   var isMailBox = ((flag & QR_MAILBOX) == QR_MAILBOX);
-  var hasNewMsgs = ((curView & UA_HASNEWMSGS) == UA_HASNEWMSGS);
+  var hasNewMsgs = ((raflags & UA_HASNEWMSGS) == UA_HASNEWMSGS);
   var roomLI = document.createElement("li");
   var roomA = document.createElement("a");
   roomA.setAttribute("href","dotgoto?room="+roomName);
@@ -904,31 +910,6 @@ function fixOffsetBanner() {
     contentDiv.style.width = newContentWidth+"px";
   }
 }
-/** Attempt to stop overflowing in x-axis in IE6 */
-function resizeViewport() {
-  var documentWidth = 0;
-  var viewportWidth = document.viewport.getWidth();
-  var iconbar = $('iconbar');
-  var global = $('global');
-  if (iconbar == null || global == null || document.documentElement == null) {
-    return;
-  }
-  if (typeof window.offsetWidth != 'undefined') {
-    documentWidth = window.offsetWidth;
-  } else {
-    documentWidth = document.documentElement.offsetWidth;
-  }
-  if (documentWidth > viewportWidth) {
-    WCLog("resizeViewport");
-    document.documentElement.style.width = viewportWidth+"px";
-    document.documentElement.style.overflowX = "hidden";
-    //viewportWidth = 0.98 * viewportWidth;
-    var newIconBarSize = 0.16 * viewportWidth;
-    var newContentSize = viewportWidth - newIconBarSize;
-    iconbar.style.width = newIconBarSize+"px";
-    global.style.width = newContentSize+"px";
-  }
-}
 
 function RefreshSMTPqueueDisplay() {
        new Ajax.Updater('smtpqueue_inner_div',