Multi-paned window internals
authorDarren <darren@darrenwhitlen.com>
Sun, 18 Sep 2011 15:25:10 +0000 (16:25 +0100)
committerDarren <darren@darrenwhitlen.com>
Sun, 18 Sep 2011 15:25:10 +0000 (16:25 +0100)
css/default.css
js/front.js
node/client/index.html.jade

index 456b0cd06d99318ada5cfbd935a64ccb9b85142e..8ac934208052bc7a1de61c548b95b6587ddc1266 100644 (file)
@@ -143,8 +143,10 @@ background-image: -moz-linear-gradient(
        position: absolute;\r
        top:92px; left:0px;\r
        right: 110px; bottom:30px;\r
-       overflow-y:scroll;\r
 }\r
+#kiwi .panel { overflow-y:scroll; height:100%; }\r
+#panel1 { float:left; width:100%;}\r
+#panel2 { float:right; width:0%; }\r
 #kiwi .messages {\r
        overflow-x:wrap;\r
        border:none;\r
index cdd3222ea4255cd53ddd24d889ec74a73062a5db..2349d5966da026ae0ba0006a04195484ded5cfc6 100644 (file)
@@ -91,7 +91,6 @@ kiwi.front = {
             new_width = new_width - parseInt($('#kiwi .userlist').css('margin-right'), 10);
 
             // Make sure we don't remove the userlist alltogether
-            console.log(new_width);
             if (new_width < 20) {
                 $(this).data('draggable').offset.click.left = 10;
                 console.log('whoaa');
@@ -1357,8 +1356,13 @@ var Utilityview = function (name) {
     this.name = rand_name;
     this.title = name;
     this.topic = ' ';
+    this.panel = $('#panel1');
 
-    $('#kiwi .windows .scroller').append('<div id="' + tmp_divname + '" class="messages"></div>');
+    if (typeof $('.scroller', this.panel)[0] === 'undefined') {
+        this.panel.append('<div id="' + tmp_divname + '" class="messages"></div>');
+    } else {
+        $('.scroller', this.panel).append('<div id="' + tmp_divname + '" class="messages"></div>');
+    }
 
     this.tab = $('<li id="' + tmp_tabname + '">' + this.title + '</li>');
     this.tab.click(function () {
@@ -1378,12 +1382,13 @@ Utilityview.prototype.title = null;
 Utilityview.prototype.div = null;
 Utilityview.prototype.tab = null;
 Utilityview.prototype.topic = ' ';
+Utilityview.prototype.panel = null;
 Utilityview.prototype.show = function () {
-    $('#kiwi .messages').removeClass("active");
+    $('.messages', this.panel).removeClass("active");
     $('#kiwi .userlist ul').removeClass("active");
     $('#kiwi .toolbars ul li').removeClass("active");
 
-    $('#windows').css('overflow-y', 'hidden');
+    this.panel.css('overflow-y', 'hidden');
     $('#windows').css('right', 0);
     // Activate this tab!
     this.div.addClass('active');
@@ -1400,6 +1405,13 @@ Utilityview.prototype.show = function () {
     }
 };
 
+Utilityview.prototype.setPanel = function (new_panel) {
+    this.div.detach();
+    this.panel = new_panel;
+    this.panel.append(this.div);
+    this.show();
+};
+
 Utilityview.prototype.close = function () {
     this.div.remove();
     this.tab.remove();
@@ -1443,7 +1455,9 @@ Utilityview.prototype.clearPartImage = function () {
  */
 
 
-var Tabview = function () {};
+var Tabview = function () {
+    this.panel = $('#panel1');
+};
 Tabview.prototype.name = null;
 Tabview.prototype.div = null;
 Tabview.prototype.userlist = null;
@@ -1451,18 +1465,19 @@ Tabview.prototype.userlist_width = 100;     // 0 for disabled
 Tabview.prototype.tab = null;
 Tabview.prototype.topic = "";
 Tabview.prototype.safe_to_close = false;                // If we have been kicked/banned/etc from this channel, don't wait for a part message
+Tabview.prototype.panel = null;
 
 Tabview.prototype.show = function () {
     var w, u;
 
-    $('#kiwi .messages').removeClass("active");
+    $('.messages', this.panel).removeClass("active");
     $('#kiwi .userlist ul').removeClass("active");
     $('#kiwi .toolbars ul li').removeClass("active");
     
     w = $('#windows');
     u = $('#kiwi .userlist');
 
-    w.css('overflow-y', 'scroll');
+    //w.css('overflow-y', 'scroll');
 
     // Set the window size accordingly
     this.setUserlistWidth();
@@ -1609,8 +1624,9 @@ Tabview.prototype.addMsg = function (time, nick, msg, type, style) {
 };
 
 Tabview.prototype.scrollBottom = function () {
-    var w = $('#windows');
-    w[0].scrollTop = w[0].scrollHeight;
+    var panel = this.panel;
+    console.log(panel);
+    panel[0].scrollTop = panel[0].scrollHeight;
 };
 
 Tabview.prototype.changeNick = function (newNick, oldNick) {
index 6cf87fd7ea4ece6ccd773605e801110aafc9ee3f..f4083f8b01bb66d475b72bac6e1a87ed4630901c 100644 (file)
@@ -179,7 +179,10 @@ html(xmlns="http://www.w3.org/1999/xhtml", lang="en-gb")
                 ul
 
             div#windows.windows
-                div.scroller(style="width:100%;height:100%;")
+                div#panel1.panel
+                    div.scroller(style="width:100%;height:100%;")
+
+                div#panel2.panel
 
             div.control
                 div.msginput