From 4af46921e104016cd81cd20f2bff52651797655f Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 9 Feb 2015 17:37:20 +0000 Subject: [PATCH 1/4] better css --- src/static/css/pad.css | 5 +++-- src/static/js/pad_editbar.js | 11 +++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/static/css/pad.css b/src/static/css/pad.css index 70c15b51..e9a91f4e 100644 --- a/src/static/css/pad.css +++ b/src/static/css/pad.css @@ -919,7 +919,8 @@ input[type=checkbox] { right:0px !important; border-radius:0px !important; width:182px !important; - margin:2px 0 0 0 !important; +/* Below makes UI look weird when X makes editbar flow onto two lines */ +/* margin:2px 0 0 0 !important;*/ border: none !important; border-bottom: 1px solid #ccc !important; height:155px !important; @@ -937,7 +938,7 @@ input[type=checkbox] { padding:0 !important; margin:0 !important; right:0 !important; - top: 200px !important; + top: 200px; width:182px !important; border: none !important; padding:5px !important; diff --git a/src/static/js/pad_editbar.js b/src/static/js/pad_editbar.js index e874614f..56018b35 100644 --- a/src/static/js/pad_editbar.js +++ b/src/static/js/pad_editbar.js @@ -186,9 +186,20 @@ var padeditbar = (function() $('#editbar').css("height", editbarHeight); $('#editorcontainer').css("top", containerTop); + + // If sticky chat is enabled.. if($('#options-stickychat').is(":checked")){ $('#chatbox').css("top", $('#editorcontainer').offset().top + "px"); }; + + // If chat and Users is enabled.. + if($('#options-chatandusers').is(":checked")){ + $('#users').css("top", $('#editorcontainer').offset().top + "px"); + + // We also need to move the chatbox lower.. + $('#chatbox').css("top", 10 + $('#users').height() + $('#editorcontainer').offset().top + "px"); + } + }, registerDropdownCommand: function (cmd, dropdown) { dropdown = dropdown || cmd; From 8c6507e78c655f402269276f1f1730d431dd18e8 Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 9 Feb 2015 18:01:45 +0000 Subject: [PATCH 2/4] more styling stuff --- src/static/css/pad.css | 3 +-- src/static/js/chat.js | 3 ++- src/static/js/pad_editbar.js | 3 --- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/static/css/pad.css b/src/static/css/pad.css index e9a91f4e..19998418 100644 --- a/src/static/css/pad.css +++ b/src/static/css/pad.css @@ -936,9 +936,8 @@ input[type=checkbox] { .chatAndUsersChat{ bottom:0px !important; padding:0 !important; - margin:0 !important; + margin: 165px 0px 0px 0px; right:0 !important; - top: 200px; width:182px !important; border: none !important; padding:5px !important; diff --git a/src/static/js/chat.js b/src/static/js/chat.js index 9cb5b401..102f4637 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -57,7 +57,8 @@ var chat = (function() }, chatAndUsers: function(fromInitialCall) { - if(!userAndChat || fromInitialCall){ + var toEnable = $('#options-chatandusers').is(":checked"); + if(toEnable || !userAndChat || fromInitialCall){ padcookie.setPref("chatAndUsers", true); chat.stickToScreen(true); $('#options-stickychat').prop('checked', true) diff --git a/src/static/js/pad_editbar.js b/src/static/js/pad_editbar.js index 56018b35..4fcb20ea 100644 --- a/src/static/js/pad_editbar.js +++ b/src/static/js/pad_editbar.js @@ -195,9 +195,6 @@ var padeditbar = (function() // If chat and Users is enabled.. if($('#options-chatandusers').is(":checked")){ $('#users').css("top", $('#editorcontainer').offset().top + "px"); - - // We also need to move the chatbox lower.. - $('#chatbox').css("top", 10 + $('#users').height() + $('#editorcontainer').offset().top + "px"); } }, From 5245d2b797856beabd6d7f8d548ac938b867657a Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 9 Feb 2015 18:36:11 +0000 Subject: [PATCH 3/4] and even mroe polish --- src/static/css/pad.css | 2 +- src/static/js/chat.js | 6 +++--- src/static/js/pad_editbar.js | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/static/css/pad.css b/src/static/css/pad.css index 19998418..95ad4f78 100644 --- a/src/static/css/pad.css +++ b/src/static/css/pad.css @@ -897,7 +897,7 @@ input[type=checkbox] { #connectivity, #users { position: absolute; - top: 36px; + top: 38px; right: 20px; display: none; z-index: 500; diff --git a/src/static/js/chat.js b/src/static/js/chat.js index 102f4637..7fd687ea 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -22,7 +22,6 @@ var hooks = require('./pluginfw/hooks'); var chat = (function() { var isStuck = false; - var userAndChat = false; var gotInitialMessages = false; var historyPointer = 0; var chatMentions = 0; @@ -58,14 +57,15 @@ var chat = (function() chatAndUsers: function(fromInitialCall) { var toEnable = $('#options-chatandusers').is(":checked"); - if(toEnable || !userAndChat || fromInitialCall){ + if(toEnable || fromInitialCall){ padcookie.setPref("chatAndUsers", true); chat.stickToScreen(true); $('#options-stickychat').prop('checked', true) $('#options-stickychat').prop("disabled", "disabled"); $('#users').addClass("chatAndUsers"); $("#chatbox").addClass("chatAndUsersChat"); - userAndChat = true; + // redraw + padeditbar.redrawHeight() }else{ padcookie.setPref("chatAndUsers", false); $('#options-stickychat').prop("disabled", false); diff --git a/src/static/js/pad_editbar.js b/src/static/js/pad_editbar.js index 4fcb20ea..4dc80860 100644 --- a/src/static/js/pad_editbar.js +++ b/src/static/js/pad_editbar.js @@ -187,6 +187,9 @@ var padeditbar = (function() $('#editorcontainer').css("top", containerTop); + // make sure pop ups are in the right place + $('.popup').css("top", $('#editorcontainer').offset().top + "px"); + // If sticky chat is enabled.. if($('#options-stickychat').is(":checked")){ $('#chatbox').css("top", $('#editorcontainer').offset().top + "px"); From b216f9271b07b1171a2be36a6cb72989347a873d Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 9 Feb 2015 19:11:35 +0000 Subject: [PATCH 4/4] should be final logic for chatandusers --- src/static/js/chat.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/static/js/chat.js b/src/static/js/chat.js index 7fd687ea..811b1320 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -22,6 +22,7 @@ var hooks = require('./pluginfw/hooks'); var chat = (function() { var isStuck = false; + var userAndChat = false; var gotInitialMessages = false; var historyPointer = 0; var chatMentions = 0; @@ -57,14 +58,16 @@ var chat = (function() chatAndUsers: function(fromInitialCall) { var toEnable = $('#options-chatandusers').is(":checked"); - if(toEnable || fromInitialCall){ + if(toEnable || !userAndChat || fromInitialCall){ padcookie.setPref("chatAndUsers", true); chat.stickToScreen(true); $('#options-stickychat').prop('checked', true) + $('#options-chatandusers').prop('checked', true) $('#options-stickychat').prop("disabled", "disabled"); $('#users').addClass("chatAndUsers"); $("#chatbox").addClass("chatAndUsersChat"); // redraw + userAndChat = true; padeditbar.redrawHeight() }else{ padcookie.setPref("chatAndUsers", false);