From 4e4ca8e67291055897b58c7e4c6354166ea9b530 Mon Sep 17 00:00:00 2001 From: Darren Date: Sun, 18 Sep 2011 16:25:10 +0100 Subject: [PATCH] Multi-paned window internals --- css/default.css | 4 +++- js/front.js | 34 +++++++++++++++++++++++++--------- node/client/index.html.jade | 5 ++++- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/css/default.css b/css/default.css index 456b0cd..8ac9342 100644 --- a/css/default.css +++ b/css/default.css @@ -143,8 +143,10 @@ background-image: -moz-linear-gradient( position: absolute; top:92px; left:0px; right: 110px; bottom:30px; - overflow-y:scroll; } +#kiwi .panel { overflow-y:scroll; height:100%; } +#panel1 { float:left; width:100%;} +#panel2 { float:right; width:0%; } #kiwi .messages { overflow-x:wrap; border:none; diff --git a/js/front.js b/js/front.js index cdd3222..2349d59 100644 --- a/js/front.js +++ b/js/front.js @@ -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('
'); + if (typeof $('.scroller', this.panel)[0] === 'undefined') { + this.panel.append('
'); + } else { + $('.scroller', this.panel).append('
'); + } this.tab = $('
  • ' + this.title + '
  • '); 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) { diff --git a/node/client/index.html.jade b/node/client/index.html.jade index 6cf87fd..f4083f8 100644 --- a/node/client/index.html.jade +++ b/node/client/index.html.jade @@ -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 -- 2.25.1